CN109063056A - A kind of data query method, system and terminal device - Google Patents

A kind of data query method, system and terminal device Download PDF

Info

Publication number
CN109063056A
CN109063056A CN201810800997.7A CN201810800997A CN109063056A CN 109063056 A CN109063056 A CN 109063056A CN 201810800997 A CN201810800997 A CN 201810800997A CN 109063056 A CN109063056 A CN 109063056A
Authority
CN
China
Prior art keywords
dag
query
parameter
data
node
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201810800997.7A
Other languages
Chinese (zh)
Inventor
黎洲
邓青
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Advanced New Technologies Co Ltd
Advantageous New Technologies Co Ltd
Original Assignee
Alibaba Group Holding Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201810800997.7A priority Critical patent/CN109063056A/en
Publication of CN109063056A publication Critical patent/CN109063056A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

This specification embodiment provides a kind of data query method, system and terminal device, which includes: to obtain data query parameter in response to data inquiry request;Construct the corresponding DAG executive plan of the data query parameter;The input parameter that frame is inquired using the data query parameter as DAG is inquired frame by the DAG and executes the corresponding DAG executive plan of the query argument;Wherein, query logic of the DAG inquiry frame for query node in characterize data query argument;Execution result back.

Description

A kind of data query method, system and terminal device
Technical field
This specification embodiment is related to data query technique field more particularly to a kind of data query method, system and end End equipment.
Background technique
Crucial number of the contract data (such as mechanism contract data, trade company's contract data, personal contract data) as Alipay According to always by many system queries and consumption.Contract inquiry system is needed as a very high core system of calling frequency Stable, accurate, efficient query service is provided to peripheral other systems.
The data query method of conventional custom: need for each inquire scene customized development query logic, have with Lower disadvantage: 1, it be easy to cause code structure complicated, processing level is not clear enough;2, it increases query logic newly and does not follow original rule Model leads to internal standard disunity;3, scalability is bad, is easy error when modifying original function;4, O&M level may go out Existing log is buried a little not perfect, and monitoring is incomplete, can not clearly control query execution process, be not easy the problems such as finding performance bottleneck.
Data query method based on abstract syntax tree (abstract syntax tree, AST) mode: by query process It is described with structured query language (Structured Query Language, SQL) mode, SQL can be parsed into AST first, lead to The traversal to AST is crossed to complete to inquire.The program has the disadvantage that: 1, the logic of service inquiry is extremely complex, under many scenes It is difficult that query logic is depicted to come even if being depicted, there is also a large amount of customized Universal Disk Formats by SQL (Universal Disc Format, UDF), the workload for parsing SQL and UDF are very big;2, using AST mode, bottom is inquired Heterogeneous data source will be unified into general mode, for far call, can lose the structure of original object, for it is many from The weak structure object of definition, using will become very troublesome.
In summary, existing data query method lacks normative, and query logic is more complex, higher cost.
Summary of the invention
This specification embodiment provides a kind of data query method, system and terminal device, to solve to count in the prior art Lack normative, the problem of query logic is more complex, higher cost according to querying method.
This specification embodiment adopts the following technical solutions:
In a first aspect, providing a kind of data query method, comprising:
In response to data inquiry request, data query parameter is obtained;
Construct the corresponding DAG executive plan of the data query parameter;
The input parameter that frame is inquired using the data query parameter as DAG is inquired frame by the DAG and executes institute State the corresponding DAG executive plan of query argument;Wherein, the DAG inquiry frame is for inquiring section in characterize data query argument The query logic of point;
Execution result back.
Second aspect provides a kind of data query system, comprising:
Module is obtained, for obtaining data query parameter in response to data inquiry request;
Module is constructed, for constructing the corresponding DAG executive plan of the data query parameter;
Execution module passes through the DAG for inquiring the input parameter of frame using the data query parameter as DAG It inquires frame and executes the corresponding DAG executive plan of the query argument;Wherein, the DAG inquiry frame is looked into for characterize data Ask the query logic of query node in parameter;
Feedback module is used for execution result back.
The third aspect provides a kind of terminal device, comprising: memory, processor and is stored on the memory simultaneously The computer program that can be run on the processor realizes following step when the computer program is executed by the processor It is rapid:
In response to data inquiry request, data query parameter is obtained;
Construct the corresponding DAG executive plan of the data query parameter;
The input parameter that frame is inquired using the data query parameter as DAG is inquired frame by the DAG and executes institute State the corresponding DAG executive plan of query argument;Wherein, the DAG inquiry frame is for inquiring section in characterize data query argument The query logic of point;
Execution result back.
Fourth aspect provides a kind of computer readable storage medium, is stored on the computer readable storage medium Computer program, the computer program realize following steps when being executed by processor:
In response to data inquiry request, data query parameter is obtained;
Construct the corresponding DAG executive plan of the data query parameter;
The input parameter that frame is inquired using the data query parameter as DAG is inquired frame by the DAG and executes institute State the corresponding DAG executive plan of query argument;Wherein, the DAG inquiry frame is for inquiring section in characterize data query argument The query logic of point;
Execution result back.
This specification embodiment use at least one above-mentioned technical solution can reach it is following the utility model has the advantages that
This specification embodiment is by the corresponding DAG executive plan of building data query parameter, with data query parameter work The input parameter that frame is inquired for DAG inquires frame by DAG and executes the corresponding DAG executive plan of query argument, to pass through DAG inquires frame for query logic node, and data query process is clearly showed by query node series connection Come, query logic is simplified;
Based on the scheme of this specification embodiment, data query all can inquire frame by DAG in most of inquiry scenes Uniformly realize that there is normalization;
Based on the scheme of this specification embodiment, inquiring frame by DAG can allow user freely to realize each inquiry The distinctive query logic of node avoids parsing time-consuming, and cost is relatively low.
Detailed description of the invention
Attached drawing described herein is used to provide to further understand this specification, forms part of this specification, The illustrative embodiments and their description of this specification do not constitute the improper restriction to this specification for explaining this specification. In the accompanying drawings:
Fig. 1 is the flow chart for the data query method that one embodiment of this specification provides;
Fig. 2 be the practical application scene of data query method that one embodiment of this specification provides realize schematic diagram it One;
Fig. 3 is the practical application scene implementation process signal for the data query method that one embodiment of this specification provides The two of figure;
Fig. 4 is the practical application scene implementation process signal for the data query method that one embodiment of this specification provides The three of figure;
Fig. 5 is the structural block diagram for the data query system that one embodiment of this specification provides;
Fig. 6 is the structural block diagram for the terminal device that one embodiment of this specification provides.
Specific embodiment
To keep the purposes, technical schemes and advantages of this specification clearer, it is embodied below in conjunction with this specification This specification technical solution is clearly and completely described in example and corresponding attached drawing.Obviously, described embodiment is only this Specification a part of the embodiment, instead of all the embodiments.The embodiment of base in this manual, ordinary skill people Member's every other embodiment obtained without making creative work, belongs to the range of this specification protection.
Several relevant Name Resolutions are incorporated herein in the scheme of this specification embodiment for ease of understanding.
Directed acyclic graph (directed acyclic graph, DAG): in graph theory, if digraph can not be from Some vertex, which is set out, returns to the point by several sides, then this figure is a DAG figure.
Abstract syntax tree (Abstract Syntax Tree, AST): being the tree-shaped performance of the abstract syntax structure of source code Form, each node on tree indicate one of source code structure.Why say that grammer is " abstract ", is because here Grammer can't represent each details occurred in true grammer.For example, nested parenthesis is implied in the structure of tree, and It is presented not in the form of node;And it is similar to conditional jump sentence as if-condition-then, it can be used and have The node of Liang Ge branch indicates.
This specification embodiment provides a kind of data query method, system and terminal device, to solve to count in the prior art Lack normative, the problem of query logic is more complex, higher cost according to querying method.This specification embodiment provides a kind of data Querying method, the executing subject of this method can be, but not limited to terminal device or can be configured as executing this specification implementation The device or system of this method that example provides.
For ease of description, hereafter executing subject in this way is to be able to carry out for the terminal device of this method, to this The embodiment of method is introduced.It is appreciated that it is that one kind is illustratively said that the executing subject of this method, which is terminal device, It is bright, it is not construed as the restriction to this method.
Fig. 1 is the flow chart for the data query method that this specification embodiment provides, and the method for Fig. 1 can be by terminal device It executes, as shown in Figure 1, this method may include:
Step 110, in response to the data inquiry request, obtain data query parameter.
The data inquiry request can be used for transmitting data query parameter.
Before executing step 110, the data query method can also include receiving data inquiry request.
The sending object of the data inquiry request can be peripheral system or other equipment.
Step 120, the corresponding DAG executive plan of the building data query parameter.
The DAG executive plan is directed acyclic graph executive plan.
The corresponding DAG executive plan of building data query parameter, it is specific to can be achieved are as follows: to be based on data query parameter, structure Build the corresponding DAG executive plan of data query parameter.
Illustratively, by taking data query scene 1 as an example, the data query scene 1 have query node A, query node B, Query node C and query node D.
The corresponding DAG executive plan of building data query parameter, it is specific to can be achieved are as follows: based on query node A, inquiry section Point B, query node C and query node D construct directed acyclic graph DAG;Based on each query node in directed acyclic graph DAG it Between logical relation, construct DAG executive plan.
Step 130, the input parameter that frame is inquired using the data query parameter as DAG, pass through the DAG query frame Frame executes the corresponding DAG executive plan of the query argument.
The DAG inquires query logic of the frame for query node in characterize data query argument.
This inquires the input parameter of frame using the data query parameter as DAG, specific to can be achieved are as follows:
Firstly, by data query Parameter Switch at the input parameter of DAG inquiry frame, such as by the format of data query parameter It is converted to the consistent format of input parameter with DAG inquiry frame.
Then, using the data query parameter after conversion as the input parameter of DAG inquiry frame.
What needs to be explained here is that when entering DAG inquiry frame, need to initialize the context, each of DAG inquiry frame The context of node and the input parameter of part of nodes, for example, the Starting Executing Time etc. of initialization DAG inquiry frame.
Step 140, execution result back.
This specification embodiment is by the corresponding DAG executive plan of building data query parameter, with data query parameter work The input parameter that frame is inquired for DAG inquires frame by DAG and executes the corresponding DAG executive plan of query argument, to pass through DAG inquires frame for query logic node, and data query process is clearly showed by query node series connection Come, query logic is simplified;Moreover, data query can all be realized by DAG inquiry unified frame in most of inquiry scenes, With normalization;DAG inquiry frame can allow user freely to realize the distinctive query logic of each query node, avoid understanding Analysis is time-consuming, and cost is relatively low.
Optionally, as one embodiment, after executing step 120, the data query of this specification embodiment offer Method can also include:
Based on the data in query argument multiple queries node attribute information, DAG is split into multiple sub- DAG;
Based on the multiple sub- DAG, processing is optimized to the DAG executive plan.
Illustratively, as shown in Fig. 2, by taking data query scene 2 as an example, which has query node A (inquiry product information), query node B (inquiry contract information) and query node C (pooling information).
Wherein, query node B (inquiry contract information) can be refined as query node B1(inquiry contract essential information) is looked into Ask node B21(inquiry contract attribute information) and query node B3(merging contract information) and query node B1(inquiry contract base This information), query node B22(inquiry contract text information) and query node B3(merging contract information).
Therefore, it in this specification embodiment, (can will be inquired based on query node A (inquiry product information), query node B Contract information) and query node C (pooling information), the DAG of building split, obtained: based on query node A (inquiry product Information), query node B1(inquiry contract essential information), query node B21(inquiry contract attribute information), query node B3It (closes And contract information) and query node C (pooling information) building sub- DAG, and based on query node A (inquiry product information), look into Ask node B1(inquiry contract essential information), query node B22(inquiry contract text information), query node B3(merge contract letter Breath) and query node C (pooling information) construct sub- DAG.
Attribute information of this specification embodiment based on multiple queries node in data query parameter, DAG is split into more A sub- DAG is based on multiple sub- DAG, optimizes processing to DAG executive plan, can be with so that subsequent when carrying out data query Obtain detailed query result.
Optionally, as one embodiment, after executing step 120, the data query of this specification embodiment offer Method can also include:
Based on the data in query argument between multiple queries node adjacent query node incidence relation, merge association Query node, and update DAG;
Based on updated DAG, processing is optimized to the DAG executive plan.
Illustratively, as shown in figure 3, by taking data query scene 3 as an example, which has query node A (preposition processing), query node B (contract number is inquired according to user id), query node C (contract information is inquired according to contract number) With query node D (postpositive disposal).
Wherein, query node B (inquiring contract number according to user id) and query node C (inquire contract letter according to contract number Breath) there are progressive incidence relations, it is (direct according to user id query node B and query node C can be merged into query node O Inquire contract information).
Therefore, in this specification embodiment, query node A (preposition processing), query node B will can be based on (according to user Id inquires contract number), query node C (contract information is inquired according to contract number) and query node D (postpositive disposal), building DAG is updated, and is obtained: (contract letter is directly inquired according to user id based on query node A (preposition processing), query node O Breath) and the new DAG of query node D (postpositive disposal) building.
This specification embodiment is closed based on the association of adjacent query node between multiple queries node in data query parameter System, merges associated query node, and update DAG;Based on updated DAG, processing is optimized to DAG executive plan, it can To simplify query node quantity, so that it is subsequent when carrying out data query, query procedure can be accelerated.
Need exist for supplement, can optimizing that treated, DAG executive plan caches, in order to it is subsequent again It carries out that DAG executive plan can be read when data query directly from caching, reduces the consumption of data query time, improve data and look into Ask efficiency.
Optionally, as one embodiment, step 130 specifically be can be achieved are as follows:
Enter angle value based on query node in the corresponding DAG of DAG inquiry frame, determines the in-degree of the query node The query node that value is zero is pending query node;
Serially execute or parallel execute by way of, execute the pending query node, and by the DAG with institute The angle value that enters for stating other query nodes of pending query node directed connection subtracts one.
It will be appreciated that the process of the execution is the process of a circulation.At the stage of execution, determine that respectively inquiry saves in DAG Point enters angle value;Enter angle value based on query node each in DAG, determine query node enter query node that angle value is zero be to Execute query node;When executing the stage into query node, all pending query nodes can by serially executing or parallel The mode of execution executes.Wherein, the execution of pending query node can be controlled by the system switching of terminal device, Can be specified by terminal device under specifically inquiry scene using specific executive mode, with for different inquiry scenes into Row optimization.The angle value that enters of other query nodes with pending query node directed connection is subtracted one, until zero is reduced to, it can quilt DAG inquiry frame is loaded and is executed, and the state of the query node after execution is set as completing, until all nodes are carried out It completes.
Optionally, as one embodiment, step 130 specific implementation may include:
At least side of at least one query node in the DAG configures interface;Illustratively, in DAG extremely The execution front-end configuration front interface of a few query node, and/or, after the execution of at least one query node in DAG End configuration postposition interface.
Step 130 implements
By way of Java note, the input that the output parameter of current queries node is mapped to next query node is joined Number.
It will be appreciated that the output parameter of current queries node is formatted processing, with unified current queries node and The format of next query node;Again using the output parameter of current queries node as the input parameter of next query node.
The embodiment of the present invention is by configuring interface for at least side of at least one query node in DAG, with to look into It askes node and executes the execution time that additional step is reserved in front and back, to improve scalability;By by the output of current queries node Parameter is mapped to the input parameter of next query node, to support the customized various input parameters of user, improves flexibility.
Optionally, as one embodiment, after executing step 130, the data query of this specification embodiment offer Method can also include:
By the note of total execution time of all query nodes in the execution time of query node each in the DAG and the DAG Record is in journal file.
It will be appreciated that DAG inquires frame can be by all query nodes in the implementation procedure of entire DAG executive plan Total execution time and the execution time of each query node are recorded in journal file in a standard format.
This specification embodiment, which inquires frame by DAG, to be owned in the execution time of query node each in DAG and DAG Total execution time of query node is recorded in journal file, can be by being analyzed journal file and being counted, Ji Kefang Just the entire data query process of grasp and efficiency data query can be not susceptible to performance bottleneck etc. and be asked with locating query node Topic.
Optionally, as one embodiment, step 130 specific implementation can also include:
Determine whether the execution condition for executing the DAG executive plan meets exceptional condition;
The DAG executive plan is executed if so, terminating.
The execution condition can be query time and/or inquiry situation, correspondingly, the exceptional condition can be time-out or look into It askes and exception occurs.
It will be appreciated that start execute DAG executive plan enter inquiry circulation when, it is thus necessary to determine that execute DAG executive plan The execution time it is whether overtime, and/or, execute DAG executive plan occur it is abnormal;DAG executive plan is executed if so, terminating.
You need to add is that cause of accident can be fed back after terminating execution DAG executive plan.
This specification embodiment is by determining whether the execution condition for executing DAG executive plan meets exceptional condition;If so, It then terminates and executes the DAG executive plan, the execution of DAG executive plan is effectively protected, safeguard measure is perfect.
Optionally, as one embodiment, after executing step 110, the data query of this specification embodiment offer Method can also include:
Correctness and/or non-empty verification are carried out to the data query parameter.
The embodiment of the present invention is by carrying out correctness and/or non-empty verification to data query parameter, so that data query Parameter is more acurrate, improves the accuracy, correctness and normalization of data query parameter.
Below in conjunction with specific embodiments, the method for the embodiment of the present invention is further described.
Fig. 4 shows flow chart of the data query method provided in an embodiment of the present invention under practical application scene;
Specifically, as shown in Figure 4:
400, data inquiry request is received, and in response to the data inquiry request, obtains data query parameter.
410, correctness is carried out to the data query parameter and/or non-empty verifies.
420, the corresponding DAG executive plan of the data query parameter is constructed.
430, data query parameter is converted to the consistent parameter of input parameter format with DAG inquiry frame.
440, the input parameter of frame is inquired using the data query parameter as DAG, and frame is inquired by the DAG Execute the corresponding DAG executive plan of the query argument.
The specific implementation of this step can be with are as follows: angle value is entered based on query node in the corresponding DAG of DAG inquiry frame, The query node that angle value is zero that enters for determining the query node is pending query node;By serially executing or executing parallel Mode, execute the pending query node, and by other inquiries in the DAG with pending query node directed connection The angle value that enters of node subtracts one.
The specific implementation of this step may include: to determine whether the execution condition for executing the DAG executive plan meets exception Condition;The DAG executive plan is executed if so, terminating.
Wherein, which can be query time and/or inquiry situation, correspondingly, the exceptional condition can be super When or inquiry occur it is abnormal.
The specific implementation of this step, which may include: that the front side configuration of at least one query node in the DAG is preposition, to be connect Mouthful.
The specific implementation of this step may include: to be mapped the output parameter of current queries node by way of Java note To the input parameter of next query node.
The specific implementation of this step may include: that the rear side configuration postposition of at least one query node in the DAG connects Mouthful.
450, execution result back.
This specification embodiment is by the corresponding DAG executive plan of building data query parameter, with data query parameter work The input parameter that frame is inquired for DAG inquires frame by DAG and executes the corresponding DAG executive plan of query argument, to pass through DAG inquires frame for query logic node, and data query process is clearly showed by query node series connection Come, query logic is simplified;Moreover, data query can all be realized by DAG inquiry unified frame in most of inquiry scenes, With normalization;DAG inquiry frame can allow user freely to realize the distinctive query logic of each query node, avoid understanding Analysis is time-consuming, and cost is relatively low.
More than, the data query method of this specification embodiment is described in detail in conjunction with Fig. 1 to Fig. 4, in the following, in conjunction with Fig. 5, The data query system of this specification embodiment is described in detail.
Fig. 5 shows the structural schematic diagram of the data query system of this specification embodiment offer, as shown in figure 5, the number May include: according to inquiry system 500
Module 510 is obtained, for obtaining data query parameter in response to data inquiry request;
Module 520 is constructed, for constructing the corresponding DAG executive plan of the data query parameter;
Execution module 530, for inquiring the input parameter of frame using the data query parameter as DAG, by described DAG inquires frame and executes the corresponding DAG executive plan of the query argument;Wherein, the DAG inquiry frame is used for characterize data The query logic of query node in query argument;
Feedback module 540 is used for execution result back.
In one embodiment, the data query system 500 can also include:
Module is split to split into DAG for the attribute information of multiple queries node in query argument based on the data Multiple sub- DAG;
First processing module optimizes processing to the DAG executive plan for being based on the multiple sub- DAG.
In one embodiment, the data query system 500 can also include:
Merging module, the association for adjacent query node between multiple queries node in query argument based on the data Relationship merges associated query node, and updates DAG;
Second processing module optimizes processing to the DAG executive plan for being based on updated DAG.
In one embodiment, the execution module 530 includes:
First determination unit is determined for entering angle value based on query node in the corresponding DAG of DAG inquiry frame The query node that angle value is zero that enters of the query node is pending query node;
Execution unit, for serially execute or parallel execute by way of, execute the pending query node, and will The angle value that enters in the DAG with other query nodes of the pending query node directed connection subtracts one.
In one embodiment, the execution module 530 can also include:
Configuration unit, at least side at least one query node in the DAG configure interface;
The execution module 530 may include:
Map unit, for by way of Java note, the output parameter of current queries node to be mapped to next inquiry The input parameter of node.
In one embodiment, the data query system 500 can also include:
Logging modle, for by all query nodes in the execution time of query node each in the DAG and the DAG Total execution time be recorded in journal file.
In one embodiment, the execution module 530 can also include:
Second determination unit, for determining whether the execution condition for executing the DAG executive plan meets exceptional condition;
Execution unit is terminated, if the execution condition for the DAG executive plan meets exceptional condition, terminates and executes institute State DAG executive plan.
In one embodiment, the data query system 500 can also include:
Inspection module, for carrying out correctness and/or non-empty verification to the data query parameter.
This specification embodiment is by the corresponding DAG executive plan of building data query parameter, with data query parameter work The input parameter that frame is inquired for DAG inquires frame by DAG and executes the corresponding DAG executive plan of query argument, to pass through DAG inquires frame for query logic node, and data query process is clearly showed by query node series connection Come, query logic is simplified;Moreover, data query can all be realized by DAG inquiry unified frame in most of inquiry scenes, With normalization;DAG inquiry frame can allow user freely to realize the distinctive query logic of each query node, avoid understanding Analysis is time-consuming, and cost is relatively low.
Fig. 6 is the structural schematic diagram for the terminal device that one embodiment of this specification provides.Referring to FIG. 6, in hardware Level, the terminal device include processor, optionally further comprising internal bus, network interface, memory.Wherein, memory can It can include memory, such as high-speed random access memory (Random-Access Memory, RAM), it is also possible to further include non-easy The property lost memory (non-volatile memory), for example, at least 1 magnetic disk storage etc..Certainly, which is also possible to Including hardware required for other business.
Processor, network interface and memory can be connected with each other by internal bus, which can be ISA (Industry Standard Architecture, industry standard architecture) bus, PCI (Peripheral Component Interconnect, Peripheral Component Interconnect standard) bus or EISA (Extended Industry Standard Architecture, expanding the industrial standard structure) bus etc..The bus can be divided into address bus, data/address bus, control always Line etc..Only to be indicated with a four-headed arrow in Fig. 6, it is not intended that an only bus or a type of convenient for indicating Bus.
Memory, for storing program.Specifically, program may include program code, and said program code includes calculating Machine operational order.Memory may include memory and nonvolatile memory, and provide instruction and data to processor.
Processor is from the then operation into memory of corresponding computer program is read in nonvolatile memory, in logical layer The associated apparatus of resource increment object and resource object is formed on face.Processor executes the program that memory is stored, and specific For performing the following operations:
In response to data inquiry request, data query parameter is obtained;
Construct the corresponding DAG executive plan of the data query parameter;
The input parameter that frame is inquired using the data query parameter as DAG is inquired frame by the DAG and executes institute State the corresponding DAG executive plan of query argument;Wherein, the DAG inquiry frame is for inquiring section in characterize data query argument The query logic of point;
Execution result back.
This specification embodiment is by the corresponding DAG executive plan of building data query parameter, with data query parameter work The input parameter that frame is inquired for DAG inquires frame by DAG and executes the corresponding DAG executive plan of query argument, to pass through DAG inquires frame for query logic node, and data query process is clearly showed by query node series connection Come, query logic is simplified;Moreover, data query can all be realized by DAG inquiry unified frame in most of inquiry scenes, With normalization;DAG inquiry frame can allow user freely to realize the distinctive query logic of each query node, avoid understanding Analysis is time-consuming, and cost is relatively low.
Data query method disclosed in the above-mentioned embodiment illustrated in fig. 1 such as this specification can be applied in processor, or It is realized by processor.Processor may be a kind of IC chip, the processing capacity with signal.During realization, on Each step for stating method can be completed by the integrated logic circuit of the hardware in processor or the instruction of software form.It is above-mentioned Processor can be general processor, including central processing unit (Central Processing Unit, CPU), network processes Device (Network Processor, NP) etc.;Can also be digital signal processor (Digital Signal Processor, DSP), specific integrated circuit (Application Specific Integrated Circuit, ASIC), field programmable gate Array (Field-Programmable Gate Array, FPGA) either other programmable logic device, discrete gate or crystalline substance Body pipe logical device, discrete hardware components.It may be implemented or execute and is in this specification one or more embodiment disclosed Each method, step and logic diagram.General processor can be microprocessor or the processor be also possible to it is any conventional Processor etc..The step of method in conjunction with disclosed in this specification one or more embodiment, can be embodied directly in hardware decoding Processor executes completion, or in decoding processor hardware and software module combination execute completion.Software module can position In random access memory, flash memory, read-only memory, programmable read only memory or electrically erasable programmable memory, register In the storage medium of equal this fields maturation.The storage medium is located at memory, and processor reads the information in memory, in conjunction with it Hardware completes the step of above method.
The terminal device can also carry out the data query method of Fig. 1 performed by the data query system of Fig. 5, and this specification exists This is repeated no more.
Certainly, other than software realization mode, other implementations are not precluded in the terminal device of this specification, such as Logical device or the mode of software and hardware combining etc., that is to say, that the executing subject of following process flow is not limited to multiple Logic unit is also possible to hardware or logical device.
This specification embodiment also provides a kind of computer readable storage medium, is stored on computer readable storage medium Computer program, the computer program realize multiple processes of above-mentioned multiple embodiments of the method when being executed by processor, and can reach To identical technical effect, to avoid repeating, which is not described herein again.Wherein, the computer readable storage medium, it is such as read-only Memory (Read-Only Memory, abbreviation ROM), random access memory (Random Access Memory, abbreviation RAM), magnetic or disk etc..
It should be understood by those skilled in the art that, the embodiment of this specification can provide as method, system or computer journey Sequence product.Therefore, in terms of this specification can be used complete hardware embodiment, complete software embodiment or combine software and hardware Embodiment form.Moreover, it wherein includes computer usable program code that this specification, which can be used in one or more, The computer implemented in computer-usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) The form of program product.
This specification is referring to the method, equipment (system) and computer program product according to this specification embodiment Flowchart and/or the block diagram describes.It should be understood that can be realized by computer program instructions every in flowchart and/or the block diagram The combination of process and/or box in one process and/or box and flowchart and/or the block diagram.It can provide these computers Processor of the program instruction to general purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices To generate a machine, so that generating use by the instruction that computer or the processor of other programmable data processing devices execute It is in realize the function of specifying in one or more flows of the flowchart and/or one or more blocks of the block diagram System.
These computer program instructions, which may also be stored in, is able to guide computer or other programmable data processing devices with spy Determine in the computer-readable memory that mode works, so that it includes referring to that instruction stored in the computer readable memory, which generates, Enable the manufacture of system, the instruction system realize in one box of one or more flows of the flowchart and/or block diagram or The function of being specified in multiple boxes.
These computer program instructions also can be loaded onto a computer or other programmable data processing device, so that counting Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, thus in computer or The instruction executed on other programmable devices is provided for realizing in one or more flows of the flowchart and/or block diagram one The step of function of being specified in a box or multiple boxes.
In a typical configuration, calculating equipment includes one or more processors (CPU), input/output interface, net Network interface and memory.
Memory may include the non-volatile memory in computer-readable medium, random access memory (RAM) and/or The forms such as Nonvolatile memory, such as read-only memory (ROM) or flash memory (flash RAM).Memory is computer-readable medium Example.
Computer-readable medium includes permanent and non-permanent, removable and non-removable media can be by any method Or technology come realize information store.Information can be computer readable instructions, data structure, the module of program or other data. The example of the storage medium of computer includes, but are not limited to phase change memory (PRAM), static random access memory (SRAM), moves State random access memory (DRAM), other kinds of random access memory (RAM), read-only memory (ROM), electric erasable Programmable read only memory (EEPROM), flash memory or other memory techniques, read-only disc read only memory (CD-ROM) (CD-ROM), Digital versatile disc (DVD) or other optical storage, magnetic cassettes, tape magnetic disk storage or other magnetic storage devices Or any other non-transmission medium, can be used for storage can be accessed by a computing device information.As defined in this article, it calculates Machine readable medium does not include temporary computer readable media (transitory media), such as the data-signal and carrier wave of modulation.
It is above-mentioned that specification specific embodiment is described.Other embodiments are within the scope of the appended claims. In some cases, the movement recorded in detail in the claims or step can be executed according to the sequence being different from embodiment And desired result still may be implemented.In addition, process depicted in the drawing not necessarily require the particular order shown or Person's consecutive order is just able to achieve desired result.In some embodiments, multitasking and parallel processing are also possible Or it may be advantageous.
It should also be noted that, the terms "include", "comprise" or its any other variant are intended to nonexcludability It include so that the process, method, commodity or the equipment that include a series of elements not only include those elements, but also to wrap Include other elements that are not explicitly listed, or further include for this process, method, commodity or equipment intrinsic want Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including element There is also other identical elements in process, method, commodity or equipment.
The above is only the embodiments of this specification, are not limited to this specification.For those skilled in the art For, this specification can have various modifications and variations.All any modifications made within the spirit and principle of this specification, Equivalent replacement, improvement etc., should be included within the scope of the claims of this specification.

Claims (11)

1. a kind of data query method, comprising:
In response to data inquiry request, data query parameter is obtained;
Construct the corresponding directed acyclic graph DAG executive plan of the data query parameter;
The input parameter that frame is inquired using the data query parameter as DAG is inquired by the DAG and is looked into described in frame execution Ask the corresponding DAG executive plan of parameter;Wherein, the DAG inquiry frame is for query node in characterize data query argument Query logic;
Execution result back.
2. the method as described in claim 1 is also wrapped after constructing the corresponding DAG executive plan of the data query parameter It includes:
Based on the data in query argument multiple queries node attribute information, DAG is split into multiple sub- DAG;
Based on the multiple sub- DAG, processing is optimized to the DAG executive plan.
3. the method as described in claim 1 is also wrapped after constructing the corresponding DAG executive plan of the data query parameter It includes:
Based on the data in query argument between multiple queries node adjacent query node incidence relation, merge and associated look into Node is ask, and updates DAG;
Based on updated DAG, processing is optimized to the DAG executive plan.
4. the method as described in claim 1, described to inquire the corresponding DAG of the frame execution query argument by the DAG Executive plan, comprising:
Enter angle value based on query node in the corresponding DAG of DAG inquiry frame, determines that the angle value that enters of the query node is Zero query node is pending query node;
Serially execute or parallel execute by way of, execute the pending query node, and by the DAG with it is described to The angle value that enters for executing other query nodes of query node directed connection subtracts one.
5. the method as described in claim 1, described to inquire the corresponding DAG of the frame execution query argument by the DAG Executive plan, comprising:
At least side of at least one query node in the DAG configures interface;
The input parameter of frame is inquired using the data query parameter as DAG, comprising:
By way of Java note, the output parameter of current queries node is mapped to the input parameter of next query node.
6. the method as described in claim 1 is held inquiring the corresponding DAG of the frame execution query argument by the DAG After row plan, further includes:
Total execution time of all query nodes in the execution time of query node each in the DAG and the DAG is recorded in In journal file.
7. the method as described in claim 1, described to inquire the corresponding DAG of the frame execution query argument by the DAG Executive plan, comprising:
Determine whether the execution condition for executing the DAG executive plan meets exceptional condition;
The DAG executive plan is executed if so, terminating.
8. the method as described in claim 1, after obtaining data query parameter, further includes:
Correctness and/or non-empty verification are carried out to the data query parameter.
9. a kind of data query system, comprising:
Module is obtained, for obtaining data query parameter in response to data inquiry request;
Module is constructed, for constructing the corresponding directed acyclic graph DAG executive plan of the data query parameter;
Execution module is inquired for inquiring the input parameter of frame using the data query parameter as DAG by the DAG Frame executes the corresponding DAG executive plan of the query argument;Wherein, the DAG inquiry frame is for characterize data inquiry ginseng The query logic of query node in number;
Feedback module is used for execution result back.
10. a kind of terminal device, comprising: memory, processor and be stored on the memory and can be on the processor The computer program of operation, the computer program realize following steps when being executed by the processor:
In response to data inquiry request, data query parameter is obtained;
Construct the corresponding directed acyclic graph DAG executive plan of the data query parameter;
The input parameter that frame is inquired using the data query parameter as DAG is inquired by the DAG and is looked into described in frame execution Ask the corresponding DAG executive plan of parameter, wherein the DAG inquiry frame is for query node in characterize data query argument Query logic;
Execution result back.
11. a kind of computer readable storage medium, computer program, the meter are stored on the computer readable storage medium Calculation machine program realizes following steps when being executed by processor:
In response to data inquiry request, data query parameter is obtained;
Construct the corresponding directed acyclic graph DAG executive plan of the data query parameter;
The input parameter that frame is inquired using the data query parameter as DAG is inquired by the DAG and is looked into described in frame execution Ask the corresponding DAG executive plan of parameter;Wherein, the DAG inquiry frame is for query node in characterize data query argument Query logic;
Execution result back.
CN201810800997.7A 2018-07-20 2018-07-20 A kind of data query method, system and terminal device Pending CN109063056A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810800997.7A CN109063056A (en) 2018-07-20 2018-07-20 A kind of data query method, system and terminal device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810800997.7A CN109063056A (en) 2018-07-20 2018-07-20 A kind of data query method, system and terminal device

Publications (1)

Publication Number Publication Date
CN109063056A true CN109063056A (en) 2018-12-21

Family

ID=64817571

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810800997.7A Pending CN109063056A (en) 2018-07-20 2018-07-20 A kind of data query method, system and terminal device

Country Status (1)

Country Link
CN (1) CN109063056A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109740916A (en) * 2018-12-28 2019-05-10 中科驭数(北京)科技有限公司 Based on the time Series Processing method, apparatus and storage medium for calculating flow graph
CN110020004A (en) * 2019-02-19 2019-07-16 阿里巴巴集团控股有限公司 A kind of method for computing data and engine
CN110674200A (en) * 2019-09-17 2020-01-10 南京紫津融畅信息科技服务有限公司 Data query method based on annotation, data query equipment and storage medium
CN111538854A (en) * 2020-04-27 2020-08-14 北京百度网讯科技有限公司 Searching method and device
CN112328624A (en) * 2020-11-06 2021-02-05 瀚高基础软件股份有限公司 SQL forwarding method and device and readable storage medium
CN113190215A (en) * 2021-05-24 2021-07-30 上海万物新生环保科技集团有限公司 Query method and device based on search component
CN116383471A (en) * 2023-06-02 2023-07-04 江苏博云科技股份有限公司 Method and system for extracting data by data browser in large data scene of resource management industry

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101267452A (en) * 2008-02-27 2008-09-17 华为技术有限公司 A conversion method and application server for WEB service mixing scheme
CN105404690A (en) * 2015-12-16 2016-03-16 华为技术服务有限公司 Database querying method and apparatus
CN105765609A (en) * 2013-11-13 2016-07-13 微软技术许可有限责任公司 Memory facilitation using directed acyclic graphs
CN106293892A (en) * 2015-06-26 2017-01-04 阿里巴巴集团控股有限公司 Distributed stream calculates system, method and apparatus
CN107463595A (en) * 2017-05-12 2017-12-12 中国科学院信息工程研究所 A kind of data processing method and system based on Spark

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101267452A (en) * 2008-02-27 2008-09-17 华为技术有限公司 A conversion method and application server for WEB service mixing scheme
CN105765609A (en) * 2013-11-13 2016-07-13 微软技术许可有限责任公司 Memory facilitation using directed acyclic graphs
CN106293892A (en) * 2015-06-26 2017-01-04 阿里巴巴集团控股有限公司 Distributed stream calculates system, method and apparatus
CN105404690A (en) * 2015-12-16 2016-03-16 华为技术服务有限公司 Database querying method and apparatus
CN107463595A (en) * 2017-05-12 2017-12-12 中国科学院信息工程研究所 A kind of data processing method and system based on Spark

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109740916A (en) * 2018-12-28 2019-05-10 中科驭数(北京)科技有限公司 Based on the time Series Processing method, apparatus and storage medium for calculating flow graph
CN110020004A (en) * 2019-02-19 2019-07-16 阿里巴巴集团控股有限公司 A kind of method for computing data and engine
WO2020168901A1 (en) * 2019-02-19 2020-08-27 阿里巴巴集团控股有限公司 Data calculation method and engine
TWI723535B (en) * 2019-02-19 2021-04-01 開曼群島商創新先進技術有限公司 Data calculation method and engine
CN110674200A (en) * 2019-09-17 2020-01-10 南京紫津融畅信息科技服务有限公司 Data query method based on annotation, data query equipment and storage medium
CN111538854A (en) * 2020-04-27 2020-08-14 北京百度网讯科技有限公司 Searching method and device
CN111538854B (en) * 2020-04-27 2023-08-08 北京百度网讯科技有限公司 Searching method and device
CN112328624A (en) * 2020-11-06 2021-02-05 瀚高基础软件股份有限公司 SQL forwarding method and device and readable storage medium
CN113190215A (en) * 2021-05-24 2021-07-30 上海万物新生环保科技集团有限公司 Query method and device based on search component
CN116383471A (en) * 2023-06-02 2023-07-04 江苏博云科技股份有限公司 Method and system for extracting data by data browser in large data scene of resource management industry
CN116383471B (en) * 2023-06-02 2023-08-25 江苏博云科技股份有限公司 Method and system for extracting data by data browser in large data scene of resource management industry

Similar Documents

Publication Publication Date Title
CN109063056A (en) A kind of data query method, system and terminal device
US11720581B2 (en) Query decomposition for scalability of continuous query processing
TWI686708B (en) Database query optimization method, device, and computer equipment
CN108696381B (en) Protocol configuration method and device
CN104699718B (en) Method and apparatus for being rapidly introduced into business datum
CN111190924A (en) Cross-domain data query method and device
US20080154818A1 (en) Hybrid evaluation of expressions in DBMS
Ortiz et al. Changing the Face of Database Cloud Services with Personalized Service Level Agreements.
CN113495797B (en) Message queue and consumer dynamic creation method and system
CN114356921A (en) Data processing method, device, server and storage medium
CN109344208A (en) Path query method, apparatus and electronic equipment
CN110442602A (en) Data query method, apparatus, server and storage medium
CN112860730A (en) SQL statement processing method and device, electronic equipment and readable storage medium
US20230040635A1 (en) Graph-based impact analysis of misconfigured or compromised cloud resources
CN109903050A (en) Transaction De-weight method, transaction building method, equipment and storage medium
CN116483859A (en) Data query method and device
CN103678591A (en) Device and method for automatically executing multi-service receipt statistical treatment
CN104408183A (en) Data import method and device of data system
CN109901991A (en) A kind of method, apparatus and electronic equipment for analyzing exception call
CN110019207B (en) Data processing method and device and script display method and device
CN112116468B (en) Structured wind control implementation method and system based on stream computing engine
US20200409670A1 (en) Automatic software generation for computer systems
CN112541001A (en) Data query method, device, storage medium and equipment
CN109582300A (en) Code analysis on altered project method, device and equipment based on path
CN111221860A (en) Mixed query optimization method and device based on big data

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20200923

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman, British Islands

Applicant after: Innovative advanced technology Co.,Ltd.

Address before: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman, British Islands

Applicant before: Advanced innovation technology Co.,Ltd.

Effective date of registration: 20200923

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman, British Islands

Applicant after: Advanced innovation technology Co.,Ltd.

Address before: A four-storey 847 mailbox in Grand Cayman Capital Building, British Cayman Islands

Applicant before: Alibaba Group Holding Ltd.