# US 2022/0292083 A1 · System and method for batch and real-time feature computation

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

- Number: US 2022/0292083 A1
- Document ID: US20220292083A1
- Status: Published application
- Kind: A1
- Application number: 17/639,125
- Filed: 2020-08-26
- Published: 2022-09-15
- Earliest claimed: 2019-08-26
- Assignees: The Fourth Paradigm (Beijing) Tech Co Ltd
- Applicants: The Fourth Paradigm (Beijing) Tech Co Ltd
- Inventors: Ni MU; Taize WANG
- Web page: https://patentgrep.com/patent/US20220292083A1

## CPC

- G06F 16/2386: {Bulk updating operations (data conversion details G06F16/258)}
- G06F 9/5027: {the resource being a machine, e.g. CPUs, Servers, Terminals}
- G06F 16/25: Integrating or interfacing systems involving database management systems
- G06F 16/27: Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
- G06N 20/00: Machine learning
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS

## Abstract

The present disclosure discloses a system and method for batch and real-time feature computation, and the system includes: a management server, one or more batch feature computing units, one or more distributed computing units, one or more real-time feature computing units, an offline database and a real-time database. The management server receives a script containing feature computing logics, starts batch feature computation in a batch feature computing scenario, and deploys the script in a real-time feature computing scenario to generate a real-time computing plan, wherein the script containing the feature computing logics has unity for batch feature computing logics and real-time feature computing logics, and the real-time database obtains and stores data for the real-time feature computation from the offline database. According to the present disclosure, the batch feature computing logics and the real-time feature computing logics may be unified by the script.

## Claims

### Claim at position 1

1-9. (canceled)

### Claim 10

A method for batch and real-time feature computation, wherein the method comprises:
receiving a script containing feature computing logics;
in a batch feature computing scenario, selecting a batch feature computing unit for batch feature computation from batch feature computing units registered with a management server to start the batch feature computation such that the selected batch feature computing unit generates a batch computing task, and transmitting the batch computing task to one or more distributed computing units such that the one or more distributed computing units execute the batch computing task to perform the batch feature computation based on the script and data stored in an offline database; and
in a real-time feature computing scenario, deploying the script to real-time feature computing units registered with the management server to generate a real-time computing plan, and selecting a real-time feature computing unit used when executing the real-time computing plan from the real-time feature computing units registered with the management server such that the selected real-time feature computing unit performs the real-time feature computation based on data stored in a real-time database and the script,
wherein the script containing the feature computing logics has unity for batch feature computing logics and real-time feature computing logics, and the data stored in the offline database is data for the batch feature computation; and the data stored in the real-time database is data for the real-time feature computation obtained from the offline database.

### Claim 11 (depends on 10)

The method of claim 10, wherein the real-time database and the offline database perform data synchronization of at least a part of data based on data changes or based on a master-slave synchronization mechanism periodically or in response to user triggering.

### Claim 12 (depends on 11)

The method of claim 11, wherein the method further comprises at least one of following steps:
initializing the real-time database to obtain a data field structure corresponding to the real-time feature computation; and
receiving raw data imported by a user and storing the raw data in the offline database as the data for the batch feature computation, or using at least a part of the data pre-stored in the offline database as the data for the batch feature computation.

### Claim 13 (depends on 11)

The method of claim 11, wherein the real-time database is a memory database.

### Claim 14 (depends on 10)

The method of claim 10, wherein the method further comprises at least one of following steps:
verifying whether there is a syntax error in the script;
debugging at least a part of intermediate running results corresponding to the script based on at least a part of the data; and
debugging at least a part of final running results corresponding to the script based on at least a part of the data.

### Claim 15 (depends on 12)

The method of claim 12, wherein the method further comprises:
when at least one piece of data for the real-time feature computation is received and the real-time computing plan is executed, transmitting the at least one piece of data to the selected real-time feature computing unit such that the selected real-time feature computing unit requests window data from the real-time database when receiving the at least one piece of data, and performs the real-time feature computation based on the window data and the script,
wherein the at least one piece of data conforms to the data field structure corresponding to the real-time feature computation, and the window data contains all or a part of data fields of the data of the real-time database.

### Claim 16 (depends on 10)

The method of claim 10, wherein the one or more distributed computing units obtain the data stored in the offline database based on a data storage path of the offline database, perform the batch feature computation based on the obtained data and the script, and transmit batch feature computation execution status to the batch feature computing unit; and
wherein, the method further comprises: obtaining the batch feature computation execution status from the batch feature computing unit when receiving a batch feature computation execution status query request.

### Claim 17 (depends on 10)

The method of claim 10, wherein a computation result of the batch feature computation is used for model training or batch prediction, a computation result of the real-time feature computation is used for prediction based on a trained model, and the prediction comprises online prediction.

### Claim 18 (depends on 10)

The method of claim 10, wherein the method further comprises:
running the script such that the script is converted to be codes executable by at least one of the batch feature computing unit, the distributed computing unit and the real-time feature computing unit, and implementing, when executed, the feature computing logics contained in the script.

### Claim 19 (depends on 10)

The method of claim 10, wherein when the script is run, at least one of the batch feature computing unit, the distributed computing unit and the real-time feature computing unit parses out the feature computing logics contained in the script.

### Claim 20

A management server comprising at least one computing device and at least one storage device storing instructions, wherein the instructions, when being run by the at least one computing device, cause the at least one computing device to execute following steps of a method for batch and real-time feature computation:
receiving a script containing feature computing logics;
in a batch feature computing scenario, selecting a batch feature computing unit for batch feature computation from batch feature computing units registered with a management server to start the batch feature computation such that the selected batch feature computing unit generates a batch computing task, and transmitting the batch computing task to one or more distributed computing units such that the one or more distributed computing units execute the batch computing task to perform the batch feature computation based on the script and data stored in an offline database; and
in a real-time feature computing scenario, deploying the script to real-time feature computing units registered with the management server to generate a real-time computing plan, and selecting a real-time feature computing unit used when executing the real-time computing plan from the real-time feature computing units registered with the management server such that the selected real-time feature computing unit performs the real-time feature computation based on data stored in a real-time database and the script,
wherein the script containing the feature computing logics has unity for batch feature computing logics and real-time feature computing logics, and the data stored in the offline database is data for the batch feature computation; and the data stored in the real-time database is data for the real-time feature computation obtained from the offline database.

### Claim 21 (depends on 20)

The management server of claim 20, wherein the real-time database and the offline database perform data synchronization of at least a part of data based on data changes or based on a master-slave synchronization mechanism periodically or in response to user triggering.

### Claim 22 (depends on 21)

The management server of claim 21, wherein the instructions, when being run by the at least one computing device, cause the at least one computing device to execute at least one of following steps:
initializing the real-time database to obtain a data field structure corresponding to the real-time feature computation; and
receiving raw data imported by a user and storing the raw data in the offline database as the data for the batch feature computation, or using at least a part of the data pre-stored in the offline database as the data for the batch feature computation.

### Claim 23

(canceled)

### Claim 24 (depends on 20)

The management server of claim 20, wherein the instructions, when being run by the at least one computing device, cause the at least one computing device to execute at least one of following steps:
verifying whether there is a syntax error in the script;
debugging at least a part of intermediate running results corresponding to the script based on at least a part of the data; and
debugging at least a part of final running results corresponding to the script based on at least a part of the data.

### Claim 25 (depends on 22)

The management server of claim 22, wherein the instructions, when being run by the at least one computing device, cause the at least one computing device to execute at least one of following steps:
when at least one piece of data for the real-time feature computation is received and the real-time computing plan is executed, transmitting the at least one piece of data to the selected real-time feature computing unit such that the selected real-time feature computing unit requests window data from the real-time database when receiving the at least one piece of data, and performs the real-time feature computation based on the window data and the script,
wherein the at least one piece of data conforms to the data field structure corresponding to the real-time feature computation, and the window data contains all or a part of data fields of the data of the real-time database.

### Claim 26 (depends on 20)

The management server of claim 20, wherein the one or more distributed computing units obtain the data stored in the offline database based on a data storage path of the offline database, perform the batch feature computation based on the obtained data and the script, and transmit a batch feature computation execution status to the batch feature computing unit; and
wherein the instructions, when being run by the at least one computing device, cause the at least one computing device to execute a following step: obtaining the batch feature computation execution status from the batch feature computing unit when receiving a batch feature computation execution status query request.

### Claim 27 (depends on 20)

The management server of claim 20, wherein a computation result of the batch feature computation is used for model training or batch prediction, a computation result of the real-time feature computation is used for prediction based on a trained model, and the prediction comprises online prediction.

### Claim 28 (depends on 20)

The management server of claim 20, wherein the instructions, when being run by the at least one computing device, cause the at least one computing device to execute a following step:
running the script such that the script is converted to be codes executable by at least one of the batch feature computing unit, the distributed computing unit and the real-time feature computing unit, and implementing, when executed, the feature computing logics contained in the script.

### Claim 29 (depends on 20)

The management server of claim 20, wherein when the script is run, at least one of the batch feature computing unit, the distributed computing unit and the real-time feature computing unit parses out the feature computing logics contained in the script.

### Claim 30

A non-transitory computer readable storage medium storing instructions, wherein the instructions, when executed by at least one computing device, cause the at least one computing device to execute following steps of a method for batch and real-time feature computation:
receiving a script containing feature computing logics;
in a batch feature computing scenario, selecting a batch feature computing unit for batch feature computation from batch feature computing units registered with a management server to start the batch feature computation such that the selected batch feature computing unit generates a batch computing task, and transmitting the batch computing task to one or more distributed computing units such that the one or more distributed computing units execute the batch computing task to perform the batch feature computation based on the script and data stored in an offline database; and
in a real-time feature computing scenario, deploying the script to real-time feature computing units registered with the management server to generate a real-time computing plan, and selecting a real-time feature computing unit used when executing the real-time computing plan from the real-time feature computing units registered with the management server such that the selected real-time feature computing unit performs the real-time feature computation based on data stored in a real-time database and the script,
wherein the script containing the feature computing logics has unity for batch feature computing logics and real-time feature computing logics, and the data stored in the offline database is data for the batch feature computation; and the data stored in the real-time database is data for the real-time feature computation obtained from the offline database.
