# US 10,372,194 B2 · Optimizing use of location services in mobile applications to improve battery consumption

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 10,372,194 B2
- Document ID: US10372194B2
- Status: Granted
- Kind: B2
- Application number: 15/018,880
- Filed: 2016-02-09
- Published: 2017-08-10
- Granted: 2019-08-06
- Earliest claimed: 2016-02-09
- Assignees: International Business Machines Corporation
- Applicants: International Business Machines Corporation
- Inventors: Aharon Abadi; Moria Abadi; Mordechai Nisenson
- Web page: https://patentgrep.com/patent/US10372194B2

## CPC

- G06F 1/3234: Power saving characterised by the action undertaken
- G06F 1/3215: Monitoring of peripheral devices
- G06F 1/325: {Power saving in peripheral device}
- G06F 3/0484: for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
- G06F 8/33: Intelligent editors
- G06F 8/433: {Dependency analysis; Data or control flow analysis}
- G06F 8/52: Binary to binary
- G06F 9/30145: {Instruction analysis, e.g. decoding, instruction word fields}
- G06F 11/3698: Environments for analysis, debugging or testing of software
- H04W 4/02: Services making use of location information
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- H04W: WIRELESS COMMUNICATION NETWORKS (broadcast communication H04H; communication systems using wireless links for non-selective communication, e.g. wireless extensions H04M1/72)

## Abstract

A method for optimizing use of location services in mobile applications, comprising: analyzing a computer code executable on a processor of a mobile device; identifying in the computer code program instructions for receiving location data from at least one location service device of the mobile device; analyzing the program instructions according to a set of location request rules to identify program instructions violating at least one of the location request rules; and providing at least one suggested change to the program instructions according to the at least one of the location request rules.

## Claims

### Claim 1

A method for modifying a computer code of a mobile application to become adapted to an optimized use of location services, comprising:
analyzing a computer code of a mobile application executable on a processor of a mobile device;
identifying, in said computer code, at least one code segment which includes program instructions for requesting location data from at least one location service device of said mobile device;
identifying, in said computer code, an other code segment which includes program instructions for using the data acquired from said at least one location service device;
obtaining a pre-defined set of location request rules defining preferred practices for requesting location services to achieve optimized use of said location services;
analyzing said program instructions of said at least one code segment and said other code segment to identify a relation between a location, within said computer code, of said at least one code segment and a location of said other code segment;
determining when said relation violates at least one of said location request rules, wherein said at least one of said location request rules requires a reduction in time window during which said at least one location service device provides location data updates as a result of said request for said location data, before said location data is used; and
upon said determination, providing at least one suggested modification to said program instructions, to adapt said computer code to said optimized use, according to said at least one of said location request rules.

### Claim 2 (depends on 1)

The method of claim 1, wherein said computer code is edited by a graphical user interface (GUI) of an integrated development environment (IDE) executed on a client terminal.

### Claim 3 (depends on 2)

The method of claim 2, wherein said at least one suggested change is presented in said GUI.

### Claim 4 (depends on 1)

The method of claim 1, wherein said computer code is included in a software development kit (SDK) for mobile applications.

### Claim 5 (depends on 1)

The method of claim 1, wherein said computer code is included in a mobile application currently installed on said mobile device.

### Claim 6 (depends on 1)

The method of claim 1, wherein said at least one location service device includes global positioning system (GPS).

### Claim 7 (depends on 1)

The method of claim 1, wherein said at least one location service device includes network location service.

### Claim 8 (depends on 1)

The method of claim 1, further comprising: automatically changing said computer code according to said at least one suggested change.

### Claim 9 (depends on 1)

The method of claim 1, wherein said identifying includes representing said computer code as a finite state machine (FSM).

### Claim 10 (depends on 1)

The method of claim 1, wherein said identifying includes representing at least parts of said computer code with intermediate representation (IR).

### Claim 11 (depends on 10)

The method of claim 10, wherein said intermediate representation (IR) is one of abstract syntax tree (AST), control flow graph (CFG), static single assignment form (SSA) and program dependence graph (PDG).

### Claim 12 (depends on 1)

The method of claim 1, wherein said analyzing of said program instructions includes at least one of dynamic profiler, symbolic execution and control flow analysis.

### Claim 13 (depends on 1)

The method of claim 1, wherein said defined relation is a defined proximity, in said computer code, between said location of said code segment responsible for requesting location data and said location of said other code segment responsible for said use of said acquired location data from said at least one location service device, said defined proximity is determined by an algorithm.

### Claim 14 (depends on 1)

The method of claim 1, wherein said set of location request rules includes a rule for using network location service instead of GPS location service when possible.

### Claim 15 (depends on 1)

The method of claim 1, wherein said set of location request rules includes a rule for using existing location information instead of requesting location updates received from said at least one location service device.

### Claim 16 (depends on 1)

The method of claim 1, wherein said set of location request rules includes a rule for maximal frequency of location updates received from said at least one location service device.

### Claim 17 (depends on 1)

The method of claim 1, wherein said suggested change includes adding a command to stop requesting location.

### Claim 18 (depends on 1)

A computer readable medium comprising computer executable instructions adapted to perform the method of claim 1.

### Claim 19

A system for modifying a computer code of a mobile application to become adapted to an optimized use of location services, comprising:
a memory storing a pre-defined set of location request rules defining preferred practices for requesting location services;
a code store storing a code of an application; and
at least one processor coupled to a graphical user interface (GUI), the memory and the program store for executing the stored code, the code comprising:
code instructions to analyze a computer code of a mobile application executable on a processor of a mobile device;
code instructions to identify in said computer code at least one code segment which includes program instructions for requesting location data from at least one location service device of said mobile device;
code instructions to identify, in said computer code, an other code segment which includes program instructions for using the data acquired from said at least one location service device;
code instructions to analyze said program instructions of said at least one code segment and said other code segment to identify a relation between a location, within said computer code, of said at least one code segment and a location of said other code segment;
code instructions to determine when said relation violates at least one of said location request rules, wherein said at least one of said location request rules requires a reduction in time window during which said at least one location service device provides location data updates as a result of said request for said location data, before said location data is used; and
code instructions to provide, upon said determination, at least one suggested modification to said program instructions, to adapt said computer code to said optimized use, according to said at least one of said location request rules.

### Claim 20

A software program product for modifying a computer code of a mobile application to become adapted to an optimized use of location services, comprising:
a non-transitory computer readable storage medium;
first program instructions for analyzing a computer code of a mobile application, executable on a processor of a mobile device;
second program instructions for identifying in said computer code at least one code segment which includes program instructions for requesting location data from at least one location service device of said mobile device;
third program instructions for identifying, in said computer code, an other code segment which includes program instructions for using the data acquired from said at least one location service device;
fourth program instructions for obtaining a pre-defined set of location request rules defining preferred practices for requesting location services to achieve optimized use of said location services;
fifth program instructions for analyzing said program instructions of said at least one code segment and said other code segment to identify a relation between a location, within said computer code, of said at least one code segment and a location of said other code segment;
sixth program instructions for determining when said relation violates at least one of said location request rules, wherein said at least one of said location request rule requires a reduction in time window during which said at least one location service device provides location data updates as a result of said request for said location data, before said location data is used; and
seventh program instructions for providing, upon said determination, at least one suggested modification, to adapt said computer code to said optimized use, according to said at least one of said location request rules;
wherein said first, second, third, fourth, fifth, sixth and seventh program instructions are executed by at least one computerized processor from said non-transitory computer readable storage medium.
