Data processing method and data processing apparatus
AssigneeAlibaba Cloud Computing Ltd.
InventorZilin Chen
Life of this patent
Estimating the term…
Abstract
A data processing method includes: receiving a data processing request carrying a query statement; converting the query statement into a corresponding relational algebra tree based on the data processing request; determining an operation type corresponding to the query statement based on the relational algebra tree; delivering the query statement to a first database in response to the operation type being a first type; and completing the data processing request in the first database based on the query statement.
Claims16
A data processing method, comprising:
- receiving a data processing request carrying a query statement;
- converting the query statement into a corresponding relational algebra tree based on the data processing request by parsing the query statement into a corresponding abstract syntax tree;
- and converting the abstract syntax tree into the corresponding relational algebra tree, wherein the relational algebra tree includes tree nodes and edges;
- determining an operation type corresponding to the query statement based on the relational algebra tree by:
- determining structural information of the query statement and logical information of the query statement based on the relational algebra tree;
- in response to the structural information of the query statement not satisfying a first preset rule and the logical information of the query statement not satisfying a second preset rule, determining an execution plan of the query statement based on the relational algebra tree and calculating a physical execution cost of the query statement according to the execution plan;
- and
- determining the operation type corresponding to the query statement being a first type in response to the physical execution cost being less than or equal to a preset cost threshold;
- delivering the query statement to a first database in response to the operation type being the first type;
- and
- completing the data processing request in the first database based on the query statement.
A computing device, comprising:
- a memory storing a set of computer-executable instructions;
- and
- one or more processors configured to execute the computer-executable instructions to cause the computing device to perform:
- receiving a data processing request carrying a query statement;
- converting the query statement into a corresponding relational algebra tree based on the data processing request by parsing the query statement into a corresponding abstract syntax tree;
- and converting the abstract syntax tree into the corresponding relational algebra tree, wherein the relational algebra tree includes tree nodes and edges;
- determining an operation type corresponding to the query statement based on the relational algebra tree by:
- determining structural information of the query statement and logical information of the query statement based on the relational algebra tree;
- in response to the structural information of the query statement not satisfying a first preset rule and the logical information of the query statement not satisfying a second preset rule, determining an execution plan of the query statement based on the relational algebra tree and calculating a physical execution cost of the query statement according to the execution plan;
- and
- determining the operation type corresponding to the query statement being a first type in response to the physical execution cost being less than or equal to a preset cost threshold;
- delivering the query statement to a first database in response to the operation type being the first type;
- and
- completing the data processing request in the first database based on the query statement.
A non-transitory computer-readable storage medium storing a set of computer instructions that are executable by one or more processors of an apparatus to cause the apparatus to implement a data processing method comprising:
- receiving a data processing request carrying a query statement;
- converting the query statement into a corresponding relational algebra tree based on the data processing request by parsing the query statement into a corresponding abstract syntax tree;
- and converting the abstract syntax tree into the corresponding relational algebra tree, wherein the relational algebra tree includes tree nodes and edges;
- determining an operation type corresponding to the query statement based on the relational algebra tree by:
- determining structural information of the query statement and logical information of the query statement based on the relational algebra tree;
- in response to the structural information of the query statement not satisfying a first preset rule and the logical information of the query statement not satisfying a second preset rule, determining an execution plan of the query statement based on the relational algebra tree and calculating a physical execution cost of the query statement according to the execution plan;
- and
- determining the operation type corresponding to the query statement being a first type in response to the physical execution cost being less than or equal to a preset cost threshold;
- delivering the query statement to a first database in response to the operation type being a first type;
- and
- completing the data processing request in the first database based on the query statement.
Dependencies are inferred from the claim text.