IP Library Granted Patent US 12699688
Granted Patent B2
US 12699688 · App. 18/773,507 · Granted Aug 4, 2026

Data processing method, medium and electronic device for a database

Inventors: Dongyan Zhou (Beijing, CN); Liya Fan (Beijing, CN); Ruidong Li (Beijing, CN); Junda Zhao (Beijing, CN); Heng Chen (Beijing, CN); Rui Shi (Beijing, CN); Jianjun Chen (Los Angeles, CA)
Assignee: Beijing Volcano Engine Technology Co., Ltd.
G06F16/2379
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12699688
App. No.
18/773,507
Granted
Aug 4, 2026
Kind
B2
Abstract

The present disclosure relates to a data processing method, a medium and an electronic device for a database. The method includes: obtaining a first execution statement for performing a target operation; reading, when a data source corresponding to the first execution statement includes first data corresponding to a committed transaction and second data corresponding to an uncommitted transaction, a materialized view obtained after performing the target operation on the first data as a target materialized view from a pre-created materialized view set; reading the second data and performing the target operation on the second data to obtain operation result data; performing data merging processing on the target materialized view and the operation result data to obtain merged data; and performing the target operation on the merged data to obtain an execution result corresponding to the first execution statement.

Claims (82)

1 . A method for executing Structured Query Language (SQL) statements of a database by a processing device to implement real-time queries and ensure accuracy of query results, comprising:

obtaining an SQL statement for performing a target operation in the database, wherein the SQL statement comprises an annotation indicating that the SQL statement includes both committed data stored in the database and uncommitted data stored in the database;

loading a first operator to read a target materialized view corresponding to the committed data as a first result associated with the SQL statement, wherein the target materialized view was pre-created based on previously performing the target operation on the committed data, and wherein reading the target materialized view instead of re-performing the target operation on the committed data reduces a query delay;

loading at least one second operator to read the uncommitted data from the database and perform the target operation for a first time on the uncommitted data to obtain a second result associated with the SQL statement, thereby ensuring an integrity of data queried by the SQL statement;

loading a third operator to perform data merging processing on the first result associated with the SQL statement and the second result associated with the SQL statement to obtain merged data; and

executing the SQL statement by the processing device performing the target operation for a second time on the merged data to ensure an accuracy of a final result of executing the SQL statement.

2 . The method according to claim 1 , wherein the at least one second operator comprises a scanning operator and a first executing operator, the method further comprising:

constructing the first operator for reading the target materialized view;

constructing the scanning operator for reading the second data;

constructing the first executing operator for performing the target operation on the second data to obtain the second result;

constructing the third operator for performing data merging processing on the target materialized view and the second result to obtain the merged data; and

constructing a second executing operator for performing the target operation for the second time on the merged data to obtain the final result of executing the SQL statement.

3 . The method according to claim 1 , wherein the SQL statement comprises execution scope information, and performing the target operation for the first time on the uncommitted data to obtain the second result associated with the SQL statement comprises:

filtering the uncommitted data according to the execution scope information to obtain filtered uncommitted data; and

performing the target operation on the filtered uncommitted data to obtain the second result; and

performing the data merging processing on the first result associated with the SQL statement and the second result associated with the SQL statement to obtain the merged data comprises:

filtering the first result according to the execution scope information to obtain filtered committed data; and

merging the filtered committed data and the second result to obtain the merged data.

4 . The method according to claim 3 , further comprising:

constructing a first filtering operator for filtering the first result according to the execution scope information to obtain the filtered committed data;

constructing a second filtering operator for filtering the uncommitted data according to the execution scope information to obtain the filtered uncommitted data;

constructing a third executing operator for performing the target operation on the filtered uncommitted data to obtain the second result; and

constructing a second merging operator for merging the filtered committed data and the second result to obtain the merged data.

5 . The method according to claim 1 , further comprising:

obtaining a second execution statement for creating the target materialized view, wherein a data source corresponding to the second execution statement is the committed data; and

in response to the second execution statement, performing the target operation on the committed data to generate the target materialized view.

6 . The method according to claim 1 , wherein the target operation is an operation of processing based on multiple rows of data.

7 . A non-transitory computer-readable medium having a computer program stored thereon, wherein the computer program when executed by a processing device causes the processing device to implement operations for executing Structured Query Language (SQL) statements of a database by a processing device to implement real-time queries and ensure accuracy of query results, the operations comprising;

obtaining an SQL statement for performing a target operation in the database, wherein the SQL statement comprises an annotation indicating that the SQL statement includes both committed data stored in the database and uncommitted data stored in the database;

loading a first operator to read a target materialized view corresponding to the committed data as a first result associated with the SQL statement, wherein the target materialized view was pre-created based on previously performing the target operation on the committed data, and wherein reading the target materialized view instead of re-performing the target operation on the committed data reduces a query delay;

loading a second operator to read the uncommitted data from the database and perform the target operation for a first time on the uncommitted data to obtain a second result associated with the SQL statement, thereby ensuring an integrity of data queried by the SQL statement;

loading a third operator to perform data merging processing on the first result associated with the SQL statement and the second result associated with the SQL statement to obtain merged data; and

executing the SQL statement by the processing device performing the target operation for a second time on the merged data to ensure an accuracy of a final result of executing the SQL statement.

8 . The non-transitory computer-readable medium according to claim 7 , wherein the at least one second operator comprises a scanning operator and a first executing operator, and wherein the operations further comprise:

constructing the first operator for reading the target materialized view;

constructing the scanning operator for reading the second data;

constructing the first executing operator for performing the target operation on the second data to obtain the second result;

constructing the third operator for performing data merging processing on the target materialized view and the second result to obtain the merged data; and

constructing a second executing operator for performing the target operation for the second time on the merged data to obtain the final result of executing the SQL statement.

9 . The non-transitory computer-readable medium according to claim 7 , wherein the SQL statement comprises execution scope information, and performing the target operation for the first time on the uncommitted data to obtain the second associated with the SQL statement comprises:

filtering the uncommitted data according to the execution scope information to obtain filtered uncommitted data; and

performing the target operation on the filtered uncommitted data to obtain the second result; and

performing the data merging processing on the first result associated with the SQL statement and the second result associated with the SQL statement to obtain the merged data comprises:

filtering the first result according to the execution scope information to obtain filtered committed data; and

merging the filtered committed data and the second result to obtain the merged data.

10 . The non-transitory computer-readable medium according to claim 9 , wherein the operations further comprise:

constructing a first filtering operator for filtering the first result according to the execution scope information to obtain the filtered committed data;

constructing a second filtering operator for filtering the uncommitted data according to the execution scope information to obtain the filtered uncommitted data;

constructing a third executing operator for performing the target operation on the filtered uncommitted data to obtain the second result; and

constructing a second merging operator for merging the first filtered committed data and the second result to obtain the merged data.

11 . The non-transitory computer-readable medium according to claim 7 , wherein the operations further comprise:

obtaining a second execution statement for creating the target materialized view, wherein a data source corresponding to the second execution statement is the committed data; and

in response to the second execution statement, performing the target operation on the committed data to generate the target materialized view.

12 . The non-transitory computer-readable medium according to claim 7 , wherein the target operation is an operation of processing based on multiple rows of data.

13 . An electronic device, comprising:

a storage device having a computer program stored thereon; and

a processing device configured to execute the computer program in the storage device to implement operations for executing Structured Query Language (SQL) statements of a database by a processing device to implement real-time queries and ensure accuracy of query results, the operations comprising:

obtaining an SQL statement for performing a target operation in the database, wherein the SQL statement comprises an annotation indicating that the SQL statement includes both committed data stored in the database and uncommitted data stored in the database;

loading a first operator to read a target materialized view corresponding to the committed data as a first result associated with the SQL statement, wherein the target materialized view was pre-created based on previously performing the target operation on the committed data, and wherein reading the target materialized view instead of re-performing the target operation on the committed data reduces a query delay;

loading a second operator to read the uncommitted data from the database and perform the target operation for a first time on the uncommitted data to obtain a second result associated with the SQL statement, thereby ensuring an integrity of data queried by the SQL statement;

loading a third operator to perform data merging processing on the first result associated with the SQL statement and the second result associated with the SQL statement to obtain merged data; and

executing the SQL statement by the processing device performing the target operation for a second time on the merged data to ensure an accuracy of a final result of executing the SQL statement.

14 . The electronic device according to claim 13 , wherein the at least one second operator comprises a scanning operator and a first executing operator, and wherein the operations further comprise:

constructing the first operator for reading the target materialized view;

constructing the scanning operator for reading the second data;

constructing the first executing operator for performing the target operation on the second data to obtain the second result;

constructing the third operator for performing data merging processing on the target materialized view and the second result to obtain the merged data; and

constructing a second executing operator for performing the target operation for the second time on the merged data to obtain the final result of executing the SQL statement.

15 . The electronic device according to claim 13 , wherein the SQL statement comprises execution scope information, and performing the target operation for the first time on the uncommitted data to obtain the second associated with the SQL statement comprises:

filtering the uncommitted data according to the execution scope information to obtain filtered uncommitted data; and

performing the target operation on the filtered uncommitted data to obtain the second result; and

performing the data merging processing on the first result associated with the SQL statement and the second result associated with the SQL statement to obtain the merged data comprises:

filtering the first result according to the execution scope information to obtain filtered committed data; and

merging the filtered committed data and the second result to obtain the merged data.

16 . The electronic device according to claim 13 , wherein the operations further comprise:

constructing a first filtering operator for filtering the first result according to the execution scope information to obtain the filtered committed data;

constructing a second filtering operator for filtering the uncommitted data according to the execution scope information to obtain the filtered uncommitted data;

constructing a third executing operator for performing the target operation on the filtered uncommitted data to obtain the second result; and

constructing a second merging operator for merging the filtered committed data and the second result to obtain the merged data.

17 . The electronic device according to claim 13 , wherein the operations further comprise:

obtaining a second execution statement for creating the target materialized view, wherein a data source corresponding to the second execution statement is the committed data; and

in response to the second execution statement, performing the target operation on the committed data to generate the target materialized view.