# US 2025/0094135 A1 · Method and apparatus for modifying data of software object, device and medium

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

- Number: US 2025/0094135 A1
- Document ID: US20250094135A1
- Status: Published application
- Kind: A1
- Application number: 18/886,648
- Filed: 2024-09-16
- Published: 2025-03-20
- Earliest claimed: 2023-09-15
- Applicants: Lemon Inc.
- Inventors: Yang YU
- Web page: https://patentgrep.com/patent/US20250094135A1

## CPC

- G06F 8/33: Intelligent editors
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Embodiments of the present disclosure provides a method and apparatus for modifying data of a software object, a device and a medium. In a specific implementation, the method includes: receiving a target instruction for modifying a target object, and parsing the target instruction to determine therefrom at least an operation type of the target instruction and an access path from the target object to target data included in the target object; and searching the target data from the target object according to the access path, and if the search is successful, modifying the target data at least according to the operation type. Through the method, the data included in the software object can be modified efficiently, thereby, the running performance of a software application can be improved.

## Claims

### Claim 1

A method of modifying data of a software object, comprising:
receiving a target instruction for modifying a target object, and parsing the target instruction to determine therefrom at least an operation type of the target instruction and an access path from the target object to target data comprised in the target object; and
searching the target data from the target object according to the access path, and if the search is successful, modifying the target data at least according to the operation type.

### Claim 2 (depends on 1)

The method of claim 1, wherein the access path comprises a plurality of fields in sequence, an initial field in the plurality of fields corresponds to the target object, a last field in the plurality of fields corresponds to the target data, and remaining fields in the plurality of fields correspond to intermediate objects between the target object to the target data, the intermediate objects comprise a single object or an array object, wherein a post field of a corresponding field of any array object corresponds to an array member of the array object.

### Claim 3 (depends on 2)

The method of claim 2, wherein the searching the target data from the target object according to the access path comprises:
sequentially parsing the plurality of fields from the access path, wherein for each field before the last field, if a field corresponds to a single object, the single object corresponding to the field is obtained by reflection, and an attribute corresponding to a post field of the field is searched from attributes comprised in the single object corresponding to the field; if a field corresponds to an array object, the array member corresponding to the post field of the field is obtained by reflection according to the field and a subscript of the post field of the field, and an attribute corresponding to the post field of the field is searched from attributes comprised in the array member.

### Claim 4 (depends on 1)

The method of claim 1, wherein the operation type comprises a replace operation;
the parsing the target instruction to determine therefrom at least an operation type of the target instruction and an access path from the target object to target data comprised in the target object comprises: parsing the target instruction to determine therefrom the operation type of the target instruction, the access path from the target object to target data in the target object, and a target value; and
the modifying the target data at least according to the operation type comprises: changing a value of the target data according to the target value in response to the operation type being the replace operation.

### Claim 5 (depends on 4)

The method of claim 4, wherein the changing the value of the target data according to the target value comprises:
if a data type of the target data is a basic type, converting the data type of the target value into the basic type, and changing the value of the target data according to the converted target value; and
if the data type of the target data is an object type, deserializing according to the target value to obtain an instance of the object type, and endowing the instance to the target data.

### Claim 6 (depends on 1)

The method of claim 1, wherein the operation type comprises an add operation;
the parsing the target instruction to determine therefrom at least the operation type of the target instruction and the access path from the target object to target data comprised in the target object comprises: parsing the target instruction to determine therefrom the operation type of the target instruction, the access path from the target object to target data in the target object, and a target value; and
the modifying the target data at least according to the operation type comprises: adding array members or attributes comprised in the target data according to the target value in response to the operation type being the add operation.

### Claim 7 (depends on 1)

The method of claim 1, wherein the operation type comprises a remove operation;
the modifying the target data at least according to the operation type comprises: setting the value of the target data as a default value in response to the operation type being the remove operation.

### Claim 8 (depends on 1)

The method of claim 1, wherein the operation type comprises a reorder operation;
the parsing the target instruction to determine therefrom at least the operation type of the target instruction and the access path from the target object to target data comprised in the target object comprises: parsing the target instruction to determine therefrom the operation type of the target instruction, the access path from the target object to target data in the target object, and a target value; and
the modifying the target data at least according to the operation type comprises: reordering array members comprised in the target data according to the target value in response to the operation type being the reorder operation.

### Claim 9 (depends on 1)

The method of claim 1, wherein the operation type comprises a nested operation;
the parsing the target instruction to determine therefrom at least the operation type of the target instruction and the access path from the target object to target data comprised in the target object comprises: parsing the target instruction to determine therefrom the operation type of the target instruction, the access path from the target object to target data in the target object, and a target value; and
wherein if the operation type is the nested operation, the target value comprises one or more sub-instructions, and an operation type of each sub-instruction comprises one selected from a group of an add operation, a remove operation, a replace operation, a reorder operation and a nested operation.

### Claim 10 (depends on 1)

The method of claim 1, further comprising:
if the search is unsuccessful, abandoning a modification of the target data.

### Claim 11 (depends on 1)

The method of claim 1, further comprising:
if the search is successful, storing the access path and the modified target data in a predetermined cache in an associated manner, wherein,
if the data type of the target data is an object, storing the access path, a parent object of the target data and the modified target data in the cache in an associated manner; and
if the data type of the target data is a basic type, storing the access path, the modified target data and a class name to which the target data belongs in the cache in an associated manner.

### Claim 12 (depends on 1)

The method of claim 1, wherein the target object is a pre-built global singleton object.

### Claim 13

An electronic device comprising a non-transitory memory and a processor, wherein executable codes are stored in the non-transitory memory, and the executable codes, when executed by the processor, cause the processor to:
receive a target instruction for modifying a target object, and parse the target instruction to determine therefrom at least an operation type of the target instruction and an access path from the target object to target data comprised in the target object; and
search the target data from the target object according to the access path, and if the search is successful, modify the target data at least according to the operation type.

### Claim 14 (depends on 13)

The electronic device of claim 13, wherein the access path comprises a plurality of fields in sequence, an initial field in the plurality of fields corresponds to the target object, a last field in the plurality of fields corresponds to the target data, and remaining fields in the plurality of fields correspond to intermediate objects between the target object to the target data, the intermediate objects comprise a single object or an array object, wherein a post field of a corresponding field of any array object corresponds to an array member of the array object.

### Claim 15 (depends on 14)

The electronic device of claim 14, wherein the searching the target data from the target object according to the access path comprises:
sequentially parsing the plurality of fields from the access path, wherein for each field before the last field, if a field corresponds to a single object, the single object corresponding to the field is obtained by reflection, and an attribute corresponding to a post field of the field is searched from attributes comprised in the single object corresponding to the field; if a field corresponds to an array object, the array member corresponding to the post field of the field is obtained by reflection according to the field and a subscript of the post field of the field, and an attribute corresponding to the post field of the field is searched from attributes comprised in the array member.

### Claim 16 (depends on 13)

The electronic device of claim 13, wherein the operation type comprises a replace operation;
the parsing the target instruction to determine therefrom at least an operation type of the target instruction and an access path from the target object to target data comprised in the target object comprises: parsing the target instruction to determine therefrom the operation type of the target instruction, the access path from the target object to target data in the target object, and a target value; and
the modifying the target data at least according to the operation type comprises: changing a value of the target data according to the target value in response to the operation type being the replace operation.

### Claim 17 (depends on 16)

The electronic device of claim 16, wherein the changing the value of the target data according to the target value comprises:
if a data type of the target data is a basic type, converting the data type of the target value into the basic type, and changing the value of the target data according to the converted target value; and
if the data type of the target data is an object type, deserializing according to the target value to obtain an instance of the object type, and endowing the instance to the target data.

### Claim 18 (depends on 13)

The electronic device of claim 13, wherein the executable codes further cause the processor to:
if the search is successful, store the access path and the modified target data in a predetermined cache in an associated manner, wherein,
if the data type of the target data is an object, store the access path, a parent object of the target data and the modified target data in the cache in an associated manner; and
if the data type of the target data is a basic type, store the access path, the modified target data and a class name to which the target data belongs in the cache in an associated manner.

### Claim 19

A non-transitory computer-readable storage medium storing instructions that cause a processor to:
receive a target instruction for modifying a target object, and parse the target instruction to determine therefrom at least an operation type of the target instruction and an access path from the target object to target data comprised in the target object; and
search the target data from the target object according to the access path, and if the search is successful, modify the target data at least according to the operation type.

### Claim 20 (depends on 19)

The non-transitory computer-readable storage medium of claim 19, wherein the access path comprises a plurality of fields in sequence, an initial field in the plurality of fields corresponds to the target object, a last field in the plurality of fields corresponds to the target data, and remaining fields in the plurality of fields correspond to intermediate objects between the target object to the target data, the intermediate objects comprise a single object or an array object, wherein a post field of a corresponding field of any array object corresponds to an array member of the array object.
