# US 2021/0081249 A1 · Data Processing Method and Computer Device

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

- Number: US 2021/0081249 A1
- Document ID: US20210081249A1
- Status: Published application
- Kind: A1
- Application number: 17/107,173
- Filed: 2020-11-30
- Published: 2021-03-18
- Earliest claimed: 2018-05-29
- Assignees: Huawei Technologies Co., Ltd.
- Applicants: Huawei Technologies Co., Ltd.
- Inventors: Xiong Gao; Wei Li; Ming Zheng; Hou Fun Lam
- Web page: https://patentgrep.com/patent/US20210081249A1

## CPC

- G06F 9/5016: {the resource being the memory}
- G06F 9/48: Program initiating; Program switching, e.g. by interrupt
- G06F 9/4806: {Task transfer initiation or dispatching}
- G06F 9/4843: {by program, e.g. task dispatcher, supervisor, operating system}
- G06F 9/4881: {Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues}
- G06F 9/50: Allocation of resources, e.g. of the central processing unit [CPU]
- G06F 9/5022: {Mechanisms to release resources}
- G06F 9/5038: {considering the execution order of a plurality of tasks, e.g. taking priority or time dependency constraints into consideration (scheduling strategies G06F9/4881 and subgroups)}
- G06F 13/28: using burst mode transfer, e.g. direct memory access {DMA}, cycle steal (G06F13/32 takes precedence)
- G06F 2209/484: Precedence
- G06F 2209/5011: Pool
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A data processing method implemented by a computer device, includes generating a target task including a buffer application task or a buffer release task, when the target task is the buffer application task, a first buffer corresponding to the buffer application task is used when the second task is executed, or when the target task is the buffer release task, a second buffer corresponding to the buffer release task is used when the first task is executed, obtaining a buffer entry corresponding to the target task after a preceding task of the target task is executed and before a successive task of the target task is executed, where the buffer entry includes a memory size of a buffer corresponding to the target task, a memory location of the buffer, and a memory address of the buffer, and executing the target task to apply for or release the buffer.

## Claims

### Claim 1

A data processing method implemented by a computer device, comprising:
generating a target task comprising a buffer application task or a buffer release task, wherein the target task is a successive task of a first task and is a preceding task of a second task, wherein the first task and the second task are to-be-executed tasks and comprise a sequential dependency relationship between them, wherein a first buffer corresponding to the buffer application task is for use when the target task is the buffer application task and the second task is executed, and wherein a second buffer corresponding to the buffer release task is for use when the target task is the buffer release task and the first task is executed;
obtaining a buffer entry corresponding to the target task after a preceding task of the target task is executed and before a successive task of the target task is executed, wherein the buffer entry comprises a memory size of a third buffer corresponding to the target task, a memory location of the third buffer, and a memory address of the third buffer; and
executing the target task to apply for or release the third buffer.

### Claim 2 (depends on 1)

The data processing method of claim 1, wherein the target task further comprises a memory identity (ID) of the third buffer, and wherein the data processing method further comprises obtaining, based on the memory ID, the buffer entry.

### Claim 3 (depends on 2)

The data processing method of claim 2, wherein the target task is the buffer application task, and wherein the data processing method further comprises:
determining the memory size and the memory location from the buffer entry;
determining a device memory for the third buffer based on the memory size and the memory location; and
updating the memory address based on the device memory.

### Claim 4 (depends on 2)

The data processing method of claim 2, wherein the target task is the buffer release task, and wherein the data processing method further comprises:
determining the memory address from the buffer entry;
releasing a device memory corresponding to the memory address; and
deleting the buffer entry.

### Claim 5 (depends on 2)

The data processing method of claim 2, wherein the target task is the buffer application task, and wherein the data processing method further comprises:
applying for the buffer entry for the third buffer and the memory ID;
generating an application programming interface parameter when the computer device calls an application programming interface;
filling in the buffer entry based on the application programming interface parameter, wherein the memory address is a null address; and
generating the buffer application task based on the buffer entry, wherein the buffer application task comprises the memory ID.

### Claim 6 (depends on 1)

The data processing method of claim 1, wherein the target task further comprises a dependent task group identity (ID), and wherein the data processing method further comprises obtaining, based on the dependent task group ID, the buffer entry.

### Claim 7 (depends on 6)

The data processing method of claim 6, wherein the target task is the buffer application task, and wherein the data processing method further comprises:
determining whether the memory location is located in a local memory;
when the memory location is located in the local memory:
determining a target local memory according to a preset policy; and
updating the memory address and the memory location based on the target local memory; and
when the memory location is not located in the local memory:
setting the memory location to a global memory; and
updating the memory address and the memory location based on the global memory.

### Claim 8 (depends on 1)

The data processing method of claim 1, wherein the target task is a memory copy task, wherein a data copy source address and/or a data copy destination address corresponding to the memory copy task is a valid memory identity (ID), and wherein the data processing method further comprises:
obtaining, based on the valid memory ID, a second buffer entry corresponding to the valid memory ID;
replacing the valid memory ID with a second memory address of a fourth buffer in the second buffer entry; and
executing the memory copy task.

### Claim 9 (depends on 1)

The data processing method of claim 1, wherein the target task is a heterogeneous computing task, wherein an input parameter of the target task comprises a valid memory identity (ID), and wherein the data processing method further comprises:
obtaining, based on the valid memory ID, a second buffer entry corresponding to the valid memory ID;
replacing the valid memory ID with a second memory address of a fourth buffer in the second buffer entry;
determining whether a buffer memory location corresponding to the valid memory ID is located in a local memory; and
executing the heterogeneous computing task based on the local memory when the buffer memory location is located in the local memory.

### Claim 10

A computer device comprising:
a memory configured to store instructions; and
a processor coupled to the memory, wherein the instructions cause the processor to be configured to:
generate a target task comprising a buffer application task or a buffer release task, wherein the target task is a successive task of a first task and is a preceding task of a second task, wherein the first task and the second task are to-be-executed tasks and comprise a sequential dependency relationship between them, wherein a first buffer corresponding to the buffer application task is for use when the target task is the buffer application task and the second task is executed, and wherein a second buffer corresponding to the buffer release task is for use when the target task is the buffer release task and the first task is executed;
obtain, based on the target task, a buffer entry corresponding to the target task after a preceding task of the target task is executed and before a successive task of the target task is executed, wherein the buffer entry comprises a memory size of a third buffer corresponding to the target task, a memory location of the third buffer, and a memory address of the third buffer; and
execute the target task to apply for or release the third buffer.

### Claim 11 (depends on 10)

The computer device of claim 10, wherein the target task further comprises a memory identity (ID) of the third buffer, and wherein the instructions further cause the processor to be configured to obtain, based on the memory ID, the buffer entry.

### Claim 12 (depends on 11)

The computer device of claim 11, wherein the target task is the buffer application task, and wherein the instructions further cause the processor to be configured to:
determine the memory size and the memory location from the buffer entry;
determine a device memory for the third buffer based on the memory size and the memory location; and
update the memory address based on the device memory.

### Claim 13 (depends on 11)

The computer device of claim 11, wherein the target task is the buffer release task, and wherein the instructions further cause the processor to be configured to:
determine, from the buffer entry, the memory address;
release a device memory corresponding to the memory address; and
delete the buffer entry.

### Claim 14 (depends on 11)

The computer device of claim 11, wherein the target task is the buffer application task, and wherein the instructions further cause the processor to be configured to:
apply for the buffer entry and the memory ID;
generate an application programming interface parameter when the computer device calls an application programming interface;
fill in the buffer entry based on the application programming interface parameter, wherein the buffer memory address is a null address; and
generate the buffer application task based on the buffer entry, wherein the buffer application task comprises the memory ID.

### Claim 15

A computer program product comprising computer-executable instructions for storage on a non-transitory computer-readable medium that, when executed by a processor, cause an apparatus to:
generate a target task comprising a buffer application task or a buffer release task, wherein the target task is a successive task of a first task and is a preceding task of a second task, wherein the first task and the second task are to-be-executed tasks and comprising a sequential dependency relationship between them, wherein a first buffer corresponding to the buffer application task is used when the target task is the buffer application task and the second task is executed, and wherein a second buffer corresponding to the buffer release task is used when the target task is the buffer release task and the first task is executed;
obtain a buffer entry corresponding to the target task after a preceding task of the target task is executed and before a successive task of the target task is executed, wherein the buffer entry comprises a memory size of a third buffer corresponding to the target task, a memory location of the third buffer, and a memory address of the third buffer; and
execute the target task to apply for or release the third buffer.

### Claim 16 (depends on 15)

The computer program product of claim 15, wherein the target task further comprises a memory identity (ID) of the third buffer, and wherein the data processing method further comprises obtaining, based on the memory ID, the buffer entry.

### Claim 17 (depends on 16)

The computer program product of claim 16, wherein the target task is the buffer application task, and wherein the data processing method further comprises:
determining the memory size and the memory location from the buffer entry;
determining a device memory for the third buffer based on the memory size and the memory location; and
updating the memory address based on the device memory.

### Claim 18 (depends on 16)

The computer program product of claim 16, wherein the target task is the buffer release task, and wherein the data processing method further comprises:
determining the memory address from the buffer entry;
releasing a device memory corresponding to the memory address; and
deleting the buffer entry.

### Claim 19 (depends on 16)

The computer program product of claim 16, wherein the target task is the buffer application task, and wherein the data processing method further comprises:
applying for the buffer entry for the third buffer and the memory ID;
generating an application programming interface parameter when the computer device calls an application programming interface;
filling in the buffer entry based on the application programming interface parameter, wherein the memory address is a null address; and
generating the buffer application task based on the buffer entry, wherein the buffer application task comprises the memory ID.

### Claim 20 (depends on 15)

The computer program product of claim 15, wherein the target task further comprises a dependent task group identity (ID), and wherein the data processing method further comprises obtaining, based on the dependent task group ID, the buffer entry.
