# US 2015/0106797 A1 · Dynamic code selection based on data policies

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

- Number: US 2015/0106797 A1
- Document ID: US20150106797A1
- Status: Published application
- Kind: A1
- Application number: 14/052,799
- Filed: 2013-10-14
- Published: 2015-04-16
- Earliest claimed: 2013-10-14
- Assignees: International Business Machines Corporation
- Applicants: International Business Machines Corporation
- Inventors: Swaminathan Balasubramanian; Radha M. De; Brian M. O'Connell; Cheranellore Vasudevan
- Web page: https://patentgrep.com/patent/US20150106797A1

## CPC

- G06F 8/4432: {Reducing the energy consumption}
- G06F 8/443: {Optimisation}
- G06F 9/44536: {Selecting among different versions}
- Y02D 10/00: Energy efficient computing, e.g. low power processors, power management or thermal management
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- Y02D: CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE

## Abstract

In a method for dynamically replacing code within a software application on a device, an annotated code segment that performs a function according to a first data policy is received. The computer determines an alternate segment that performs the function according to a second data policy.

## Claims

### Claim 1

A method for dynamically replacing code within a software application on a device, the method comprising:
a computer receiving an annotated code segment that performs a function according to a first data policy; and
the computer determining an alternate code segment that performs the function according to a second data policy.

### Claim 2 (depends on 1)

The method of claim 1, wherein the first and second data policies are energy policies for data.

### Claim 3 (depends on 1)

The method of claim 1, further comprising:
the computer determining that a device utilizes the second data policy; and
the computer substituting the annotated code segment with the alternate code segment.

### Claim 4 (depends on 1)

The method of claim 1, wherein the annotated code segment includes a data structure class.

### Claim 5 (depends on 1)

The method of claim 1, further comprising:
the computer generating a first compiled code segment using the annotated code segment; and
the computer generating a second compiled code segment using the alternate code segment.

### Claim 6 (depends on 5)

The method of claim 5, further comprising:
the computer determining that the device utilizes the second data policy; and
the computer causing the software application to execute using the second compiled code segment.

### Claim 7 (depends on 1)

The method of claim 1, wherein the annotated code segment includes an annotation indicating that the annotated code segment may be substituted with another code segment if the device utilizes a data policy that is not the first data policy.

### Claim 8

A computer program product for dynamically replacing code within a software application on a device, the computer program product comprising:
one or more computer-readable storage media and program instructions stored on the one or more computer-readable storage media, the program instructions comprising:
program instructions to receive an annotated code segment that performs a function according to a first data policy; and
program instructions to determine an alternate code segment that performs the function according to a second data policy.

### Claim 9 (depends on 8)

The computer program product of claim 8, wherein the first and second data policies are energy policies for data.

### Claim 10 (depends on 8)

The computer program product of claim 8, further comprising:
program instructions, stored on the one or more computer-readable storage media, to determine that a device utilizes the second data policy; and
program instructions, stored on the one or more computer-readable storage media, to substitute the annotated code segment with the alternate code segment.

### Claim 11 (depends on 8)

The computer program product of claim 8, wherein the annotated code segment includes a data structure class.

### Claim 12 (depends on 8)

The computer program product of claim 8, further comprising:
program instructions, stored on the one or more computer-readable storage media, to generate a first compiled code segment using the annotated code segment; and
program instructions, stored on the one or more computer-readable storage media, to generate a second compiled code segment using the alternate code segment.

### Claim 13 (depends on 12)

The computer program product of claim 12, further comprising:
program instructions, stored on the one or more computer-readable storage media, to determine that the device utilizes the second data policy; and
program instructions, stored on the one or more computer-readable storage media, to cause the software application to execute using the second compiled code segment.

### Claim 14 (depends on 8)

The computer program product of claim 8, wherein the annotated code segment includes an annotation indicating that the annotated code segment may be substituted with another code segment if the device utilizes a data policy that is not the first data policy.

### Claim 15

A computer system for dynamically replacing code within a software application on a device, the computer system comprising:
one or more computer processors, one or more computer-readable storage media, and program instructions stored on the computer-readable storage media for execution by at least one of the one or more processors, the program instructions comprising:
program instructions to receive an annotated code segment that performs a function according to a first data policy; and
program instructions to determine an alternate code segment that performs the function according to a second data policy.

### Claim 16 (depends on 15)

The computer system of claim 15, wherein the first and second data policies are energy policies for data.

### Claim 17 (depends on 15)

The computer system of claim 15, further comprising:
program instructions, stored on the computer-readable storage media for execution by at least one of the one or more processors, to determine that a device utilizes the second data policy; and
program instructions, stored on the computer-readable storage media for execution by at least one of the one or more processors, to substitute the annotated code segment with the alternate code segment.

### Claim 18 (depends on 15)

The computer system of claim 15, wherein the annotated code segment includes a data structure class.

### Claim 19 (depends on 15)

The computer system of claim 15, further comprising:
program instructions, stored on the computer-readable storage media for execution by at least one of the one or more processors, to generate a first compiled code segment using the annotated code segment; and
program instructions, stored on the computer-readable storage media for execution by at least one of the one or more processors, to generate a second compiled code segment using the alternate code segment.

### Claim 20 (depends on 19)

The computer system of claim 19, further comprising:
program instructions, stored on the computer-readable storage media for execution by at least one of the one or more processors, to determine that the device utilizes the second data policy; and
program instructions, stored on the computer-readable storage media for execution by at least one of the one or more processors, to cause the software application to execute using the second compiled code segment.
