[go: up one dir, main page]

CN107832391B - Data query method and system - Google Patents

Data query method and system Download PDF

Info

Publication number
CN107832391B
CN107832391B CN201711047703.XA CN201711047703A CN107832391B CN 107832391 B CN107832391 B CN 107832391B CN 201711047703 A CN201711047703 A CN 201711047703A CN 107832391 B CN107832391 B CN 107832391B
Authority
CN
China
Prior art keywords
sdl
data
instruction
syntax tree
abstract syntax
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.)
Active
Application number
CN201711047703.XA
Other languages
Chinese (zh)
Other versions
CN107832391A (en
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.)
New Great Wall Technology Co.,Ltd.
Original Assignee
Great Wall Computer Software & Systems Inc
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 Great Wall Computer Software & Systems Inc filed Critical Great Wall Computer Software & Systems Inc
Priority to CN201711047703.XA priority Critical patent/CN107832391B/en
Publication of CN107832391A publication Critical patent/CN107832391A/en
Application granted granted Critical
Publication of CN107832391B publication Critical patent/CN107832391B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2457Query processing with adaptation to user needs
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24553Query execution of query operations
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • G06F16/254Extract, transform and load [ETL] procedures, e.g. ETL data flows in data warehouses

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention relates to a data query method and a data query system, and belongs to the technical field of big data. The method comprises the following steps: an SDL analyzer in the SDL engine analyzes the received SDL instruction to obtain an abstract syntax tree; an SDL interpreter in the SDL engine analyzes the abstract syntax tree; after the SDL engine is connected with the data warehouse through the SDL interface, the SDL interpreter calls data information corresponding to the analyzed abstract syntax tree in the data warehouse through an Http protocol; and the SDL interpreter executes the operation corresponding to the SDL instruction according to the data information and the analyzed abstract syntax tree. Through the technical scheme provided by the embodiment, on one hand, the technical defects that in the prior art, the consumption cost is high, the applicability is single, the query result is not accurate enough, and the interference is easily caused are avoided; on the other hand, the data can be flexibly inquired, and the technical effects of high accuracy and high inquiry efficiency are achieved.

Description

Data query method and system
Technical Field
The embodiment of the invention relates to the technical field of big data, in particular to a data query method and a data query system.
Background
With the development of big data related technology, more and more people pay attention to the huge economic value hidden under big data. To do big data analysis work, not only business knowledge but also IT technology needs to be mastered, and the high requirement on an analyst makes the analyst prohibitive.
In the prior art, when the statistical data needs to be queried, there are two implementation ways.
The first mode is as follows: the statistical data is queried by a particular system.
The second implementation manner is as follows: the statistical data is queried by fields (or key fields).
However, in the process of implementing the present invention, the inventors found that at least the following problems exist:
1. if the query is performed in a system development mode, the cost is increased, the query can be performed only aiming at certain specific data, and the diversity cannot be realized;
2. if the query is performed in a field mode, the process is complicated, and the required information is easily shielded.
Disclosure of Invention
In order to solve the above technical problems, embodiments of the present invention provide a data query method and system.
According to a first aspect of the embodiments of the present invention, an embodiment of the present invention provides a data query method, where the method includes:
an SDL analyzer in the SDL engine analyzes the received SDL instruction to obtain an abstract syntax tree;
an SDL interpreter in the SDL engine analyzes the abstract syntax tree;
after the SDL engine is connected with a data warehouse through an SDL interface, the SDL interpreter calls data information corresponding to the analyzed abstract syntax tree in the data warehouse through an Http protocol;
and the SDL interpreter executes the operation corresponding to the SDL instruction according to the data information and the analyzed abstract syntax tree.
The embodiment provides that: the SDL interpreter analyzes the SDL instruction to obtain an abstract syntax tree, and the SDL interpreter analyzes the abstract syntax tree and calls data information corresponding to the analyzed abstract syntax tree through an Http protocol, so that the technical scheme of the operation corresponding to the SDL instruction is executed according to the data information and the analyzed abstract syntax tree, and on one hand, the technical defects of high consumption cost and single applicability when data is queried through a specific system in the prior art are avoided; on the other hand, the technical defects that when data is queried through a 'field' or a 'key field', the query result is not accurate enough and interference is easily caused in the prior art are avoided; on the other hand, the data can be flexibly queried, and the technical effects of high accuracy and high query efficiency are achieved.
Further, an SDL parser in the SDL engine parses the received SDL instruction to obtain an abstract syntax tree, which specifically includes:
analyzing the SDL instruction to obtain a constant, an operator, a variable and a named object in the SDL instruction;
and converting the constant, the operator, the variable and the named object in the SDL instruction into the abstract syntax tree according to the priority of the operator in the SDL instruction.
The embodiment provides that: according to the technical scheme of obtaining the abstract syntax tree from the constant, the operator, the variable and the named object according to the priority of the operator, the technical effect of accurately and quickly generating the abstract syntax tree is achieved, and therefore the technical effects of flexible data query, high accuracy and high query efficiency are further achieved.
Further, the SDL interpreter executes an operation corresponding to the SDL instruction according to the data information and the parsed abstract syntax tree, and specifically includes:
traversing the nodes of the analyzed abstract syntax tree according to a preset traversal rule so as to obtain a computational logic;
and executing the operation corresponding to the SDL instruction according to the calculation logic and the called data information, and obtaining an execution result.
The embodiment provides that: the calculation logic is obtained according to the traversal nodes, so that the technical scheme of executing the operation corresponding to the SDL instruction according to the calculation logic and the data information is facilitated, the technical effect of accurately and quickly executing the operation corresponding to the SDL instruction is achieved, the data is further flexibly queried, and the technical effects of high accuracy and high query efficiency are achieved.
Further, the preset traversal rule is as follows: breadth first rules or depth first rules.
Further, the method further comprises:
the processor defines the syntactic structure of the query instruction in the data warehouse according to a preset predefined rule;
and when the SDL instruction is matched with the syntactic structure of the query instruction and the SDL engine is connected with the data warehouse through the SDL interface, the SDL interpreter calls data information corresponding to the analyzed abstract syntactic tree in the data warehouse through an Http protocol.
The embodiment provides that: the technical scheme that the SDL interpreter can invoke the data information in the data warehouse only when the SDL instruction is matched with the grammatical structure of the query instruction and after the SDL engine is connected with the data warehouse, ensures the safety and reliability of invoking the data information, further realizes flexible query of the data, and has high accuracy and high query efficiency.
According to another aspect of the embodiments of the present invention, an embodiment of the present invention provides a data query system corresponding to the above-described embodiment, where the system includes: an SDL engine, an SDL interface, and a data repository, wherein the SDL engine includes an SDL parser and an SDL interpreter, wherein,
the SDL parser is used for: analyzing the received SDL instruction to obtain an abstract syntax tree;
the SDL interpreter is to: and analyzing the abstract syntax tree, calling data information corresponding to the analyzed abstract syntax tree in the data warehouse through an Http protocol after the SDL engine is connected with the data warehouse through the SDL interface, and executing an operation corresponding to the SDL instruction according to the data information and the analyzed abstract syntax tree.
Further, the SDL parser is specifically configured to:
analyzing the SDL instruction to obtain a constant, an operator, a variable and a named object in the SDL instruction;
and converting the constant, the operator, the variable and the named object in the SDL instruction into the abstract syntax tree according to the priority of the operator in the SDL instruction.
Further, the SDL interpreter is specifically configured to:
traversing the nodes of the abstract syntax tree according to a preset traversal rule so as to obtain a computational logic;
and executing the operation corresponding to the SDL instruction according to the calculation logic and the called data information, and obtaining an execution result.
Further, the preset traversal rule is as follows: breadth first rules or depth first rules.
Further, the system further comprises: a processor for, among other things,
the processor is configured to: defining a syntactic structure of the query instruction in the data warehouse according to a preset predefined rule;
and when the SDL instruction is matched with the syntactic structure of the query instruction and the SDL interface connects the SDL engine with a data warehouse, the SDL interpreter calls data information corresponding to the analyzed abstract syntax tree in the data warehouse through an Http protocol.
The embodiment of the invention has the advantages that the SDL analyzer is adopted to analyze the SDL instruction to obtain the abstract syntax tree, the SDL interpreter analyzes the abstract syntax tree and calls the data information corresponding to the analyzed abstract syntax tree through the Http protocol, so that the technical scheme of the operation corresponding to the SDL instruction is executed according to the data information and the analyzed abstract syntax tree, and on one hand, the technical defects of high consumption cost and single applicability when the data is queried through a specific system in the prior art are avoided; on the other hand, the technical defects that when data is queried through a 'field' or a 'key field', the query result is not accurate enough and interference is easily caused in the prior art are avoided; on the other hand, the data can be flexibly queried, and the technical effects of high accuracy and high query efficiency are achieved.
Drawings
Fig. 1 is a schematic flowchart of a data query method according to an embodiment of the present invention;
FIG. 2 is a schematic structural diagram of a data query system according to an embodiment of the present invention;
fig. 3 is a reference diagram illustrating an abstract syntax tree generated in a data query method according to an embodiment of the present invention.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth such as the particular system architecture, interfaces, techniques, etc., in order to provide a thorough understanding of the present invention. It will be apparent, however, to one skilled in the art that the present invention may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, circuits, and methods are omitted so as not to obscure the description of the present invention with unnecessary detail.
The embodiment of the invention provides a data query method and a data query system.
According to an aspect of the embodiments of the present invention, the embodiments of the present invention provide a data query method.
Referring to fig. 1, fig. 1 is a schematic flow chart of a data query method according to an embodiment of the present invention.
As shown in fig. 1, the method includes:
step S100: an SDL analyzer in the SDL engine analyzes the received SDL instruction to obtain an abstract syntax tree;
step S200: an SDL interpreter in the SDL engine analyzes the abstract syntax tree;
step S300: after the SDL engine is connected with the data warehouse through the SDL interface, the SDL interpreter calls data information corresponding to the analyzed abstract syntax tree in the data warehouse through an Http protocol;
step S400: and the SDL interpreter executes the operation corresponding to the SDL instruction according to the data information and the analyzed abstract syntax tree.
It will be appreciated that SDL is divided into two levels of structure, specifically a grammar definition layer and a language implementation layer. The SDL engine and the SDL interface belong to a language implementation layer, and the data warehouse belongs to a grammar definition layer. And, the SDL engine includes an SDL parser and an SDL interpreter.
For example: and if the user needs to inquire certain data A, sending an SDL instruction B corresponding to the data A to the SDL engine. And the SDL parser parses the received SDL instruction B to obtain an abstract syntax tree C. The SDL interpreter parses the abstract syntax tree and can only call data information through an Http protocol when the SDL engine is connected with the data warehouse.
The step of connecting the SDL engine with the data warehouse may be performed before step S300. And the SDL interface is a channel for accessing the data warehouse, the SDL provides access in a standard Http protocol format to the outside, and a computer which can support the Http protocol can complete query operation on the data warehouse through the SDL.
Wherein the SDL interface is specifically an SDL API.
And combining the called data information D corresponding to the SDL instruction A with the analyzed abstract syntax tree, and executing the operation corresponding to the SDL instruction A to realize the query of the data.
The embodiment provides that: the SDL interpreter analyzes the SDL instruction to obtain an abstract syntax tree, and the SDL interpreter analyzes the abstract syntax tree and calls data information corresponding to the analyzed abstract syntax tree through an Http protocol, so that the technical scheme of the operation corresponding to the SDL instruction is executed according to the data information and the analyzed abstract syntax tree, and on one hand, the technical defects of high consumption cost and single applicability when data is queried through a specific system in the prior art are avoided; on the other hand, the technical defects that when data is queried through a 'field' or a 'key field', the query result is not accurate enough and interference is easily caused in the prior art are avoided; on the other hand, the data can be flexibly queried, and the technical effects of high accuracy and high query efficiency are achieved.
In another embodiment, step S100 specifically includes:
analyzing the SDL instruction to obtain a constant, an operator, a variable and a named object in the SDL instruction;
and converting constants, operators, variables and named objects in the SDL instruction into an abstract syntax tree according to the priority of operators in the SDL instruction.
In this embodiment, how the SDL parser gets an abstract syntax tree is illustrated.
More specifically, the abstract syntax tree is generated from bottom to top in sequence according to the priority of operators in the SDL instruction.
For example: after receiving the SDL instruction, the SDL analyzer analyzes the SDL instruction to obtain a constant, an operator, a variable and a named object in the SDL instruction.
Such as: the SDL instruction is: a1+ a × b, which analyzes the SDL command, obtains the abstract syntax tree shown in fig. 3.
The embodiment provides that: according to the technical scheme of obtaining the abstract syntax tree from the constant, the operator, the variable and the named object according to the priority of the operator, the technical effect of accurately and quickly generating the abstract syntax tree is achieved, and therefore the technical effects of flexible data query, high accuracy and high query efficiency are further achieved.
In another embodiment, in step S300, the executing, by the SDL interpreter, an operation corresponding to the SDL instruction according to the data information and the parsed abstract syntax tree specifically includes:
traversing the nodes of the analyzed abstract syntax tree according to a preset traversal rule so as to obtain a computational logic;
and executing the operation corresponding to the SDL instruction according to the calculation logic and the called data information, and obtaining an execution result.
Referring to fig. 3 for details, the abstract syntax tree in fig. 3 is traversed from bottom to top in sequence to obtain the computation logic: the product of a and b is first calculated and then added to a 1.
And then the data information corresponding to a, b and A1 called from the data warehouse and the calculation logic execute the operation corresponding to the SDL instruction to obtain the execution result.
If the data information corresponding to a1 is 5, the data information corresponding to a is 6, and the data information corresponding to b is also 5, the obtained result is 35.
The embodiment provides that: the calculation logic is obtained according to the traversal nodes, so that the technical scheme of executing the operation corresponding to the SDL instruction according to the calculation logic and the data information is facilitated, the technical effect of accurately and quickly executing the operation corresponding to the SDL instruction is achieved, the data is further flexibly queried, and the technical effects of high accuracy and high query efficiency are achieved.
In another embodiment, the preset traversal rule is as follows: breadth first rules or depth first rules.
More specifically, the depth-first rule is a traversal from the lowest node to the highest node of the abstract syntax tree.
In another embodiment, the method further comprises:
the processor defines a syntactic structure of the query instruction in the data warehouse according to a preset predefined rule;
and when the SDL instruction is matched with the syntactic structure of the query instruction and the SDL engine is connected with the data warehouse through the SDL interface, the SDL interpreter calls data information corresponding to the analyzed abstract syntactic tree in the data warehouse through an Http protocol.
More specifically, the processor also defines the functions of the query instruction, the function list, the matching rules, and the like. Complex technical logic is shielded, and abundant service operation capacity is reserved.
Namely, the grammar definition layer realizes connection and disconnection with the data warehouse, and realizes operations of metadata query, data statistics, data charting, matching tools and the like.
The data types supported by the SDL engine comprise: 1. the figures specifically include: integer, floating point number; 2. the system constants specifically include: null, true, false; 3. character strings, identified by "" such as: "This is a string"; 4. naming parameters such as: abc; 5. functions such as: add () and the like; 6. an operator, comprising: () [ ]! + -, etc.
Wherein, the matching rule includes: fuzzy matching rules, range matching rules and parallel relation matching rules.
Specifically, the method can be carried out by: "%" indicates fuzzy matching; "to" indicates a range match; "," indicates a parallel relationship; "! "indicates a relationship other than specified.
It should be noted that, the matching rules may be used in combination.
The operation function of the connected data warehouse may be: connect (username, passswerd); the operation function of the data query may be: sdl.data (); the operation function of the metadata query may be: variable (), the operation function of data computation can be: sdl, data, min (), the operation function of data mapping can be: boxplot (), the operation function of the toolset may be: stools. sort ().
The embodiment provides that: the technical scheme that the SDL interpreter can invoke the data information in the data warehouse only when the SDL instruction is matched with the grammatical structure of the query instruction and after the SDL engine is connected with the data warehouse, ensures the safety and reliability of invoking the data information, further realizes flexible query of the data, and has high accuracy and high query efficiency.
In order to make the technical solution of the embodiment of the present invention clearer, the following description is given by way of example.
For example, it is necessary to "inquire the total profit margin of an industrial enterprise whose operating income exceeds 100 ten thousand" to convert the request into the SDL directive: the variable is "total profit", the revenue is "1000000-" and the specialty is "industrial".
The detailed execution steps are as follows:
the SDL parser parses the SDL instruction to obtain an abstract syntax tree, and the SDL interpreter parses the abstract syntax tree by: the sdl.connect ("username", "password") connects to the data warehouse, calls the data information, and executes the operation corresponding to the SDL instruction, which is specifically as follows:
and inquiring metadata: 1. variable ("gross profit, revenue, professional")
The codes for finding the three variables from the returned result are VAR100002, VAR100151 and VAR 101059;
2. code of sdl ("Industrial")
// returned traffic is coded as B
And (3) inquiring data:
sdl.data(variables="VAR100002",VAR100151="1000000~",VAR101059="B")
after obtaining the data information to be queried, the query can be performed by: disconnect () disconnects the data warehouse.
According to another aspect of the embodiment of the invention, the embodiment of the invention provides a data query system corresponding to the method.
Referring to fig. 2, fig. 2 is a schematic structural diagram of a data query system according to an embodiment of the present invention.
As shown in fig. 2, the system includes: an SDL engine, an SDL interface, and a data repository, wherein the SDL engine includes an SDL parser and an SDL interpreter, wherein,
the SDL parser is used for: analyzing the received SDL instruction to obtain an abstract syntax tree;
the SDL interpreter is to: and analyzing the abstract syntax tree, after the SDL engine is connected with the data warehouse through the SDL interface, calling data information corresponding to the analyzed abstract syntax tree in the data warehouse through an Http protocol, and executing operation corresponding to the SDL instruction according to the data information and the analyzed abstract syntax tree.
More specifically, the SDL parser is specifically configured to:
analyzing the SDL instruction to obtain a constant, an operator, a variable and a named object in the SDL instruction;
and converting constants, operators, variables and named objects in the SDL instruction into an abstract syntax tree according to the priority of operators in the SDL instruction.
More specifically, the SDL interpreter is specifically configured to:
traversing nodes of the abstract syntax tree according to a preset traversal rule so as to obtain a computational logic;
and executing the operation corresponding to the SDL instruction according to the calculation logic and the called data information, and obtaining an execution result.
More specifically, the preset traversal rule is as follows: breadth first rules or depth first rules.
More specifically, the system further comprises: a processor for, among other things,
the processor is configured to: defining a syntactic structure of a query instruction in a data warehouse according to a preset predefined rule;
and when the SDL instruction is matched with the syntactic structure of the query instruction and the SDL engine is connected with the data warehouse through the SDL interface, the SDL interpreter calls data information corresponding to the analyzed abstract syntactic tree in the data warehouse through an Http protocol.
According to the embodiment of the invention, an SDL (software development language) command is analyzed by an SDL analyzer to obtain an abstract syntax tree, an SDL interpreter analyzes the abstract syntax tree and calls data information corresponding to the analyzed abstract syntax tree by an Http protocol, so that the technical scheme of operation corresponding to the SDL command is executed according to the data information and the analyzed abstract syntax tree, and on one hand, the technical defects of high consumption cost and single applicability when data is queried by a specific system in the prior art are avoided; on the other hand, the technical defects that when data is queried through a 'field' or a 'key field', the query result is not accurate enough and interference is easily caused in the prior art are avoided; on the other hand, the data can be flexibly queried, and the technical effects of high accuracy and high query efficiency are achieved.
The reader should understand that in the description of this specification, reference to the description of the terms "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, a division of a unit is merely a logical division, and an actual implementation may have another division, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed.
Units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment of the present invention.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention essentially or partially contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
It should also be understood that, in the embodiments of the present invention, the sequence numbers of the above-mentioned processes do not mean the execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
While the invention has been described with reference to specific embodiments, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention as defined by the appended claims. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (6)

1. A method for data query, the method comprising:
an SDL analyzer in the SDL engine analyzes the received SDL instruction to obtain an abstract syntax tree;
an SDL interpreter in the SDL engine analyzes the abstract syntax tree;
after the SDL engine is connected with a data warehouse through an SDL interface, the SDL interpreter calls data information corresponding to the analyzed abstract syntax tree in the data warehouse through an Http protocol;
the SDL interpreter executes the operation corresponding to the SDL instruction according to the data information and the analyzed abstract syntax tree;
the SDL parser in the SDL engine parses the received SDL instruction to obtain an abstract syntax tree, which specifically includes:
analyzing the SDL instruction to obtain a constant, an operator, a variable and a named object in the SDL instruction;
converting the constant, the operator, the variable and the named object in the SDL instruction into the abstract syntax tree according to the priority of the operator in the SDL instruction;
wherein the data types supported by the SDL engine include: numbers, system constants, strings, naming parameters, functions, operators;
the processor defines the syntactic structure of the query instruction in the data warehouse according to a preset predefined rule;
when the SDL instruction is matched with the syntactic structure of the query instruction and an SDL interface connects the SDL engine with a data warehouse, the SDL interpreter calls data information corresponding to the analyzed abstract syntax tree in the data warehouse through an Http protocol;
the operational functions of the connected data warehouse are: connect (username, passswerd); the operation function of the data query is as follows: sdl.data (); the operation function of the metadata query is: variable (), the operation function of data computation is: sdl.data.min (), the operation function of data drawing is: boxplot (), the operation function of the toolset is: stools. sort ().
2. The method as claimed in claim 1, wherein the SDL interpreter executes an operation corresponding to an SDL instruction according to the data information and the parsed abstract syntax tree, and specifically includes:
traversing the nodes of the analyzed abstract syntax tree according to a preset traversal rule so as to obtain a computational logic;
and executing the operation corresponding to the SDL instruction according to the calculation logic and the called data information, and obtaining an execution result.
3. A data query method as claimed in claim 2, wherein the preset traversal rule is: breadth first rules or depth first rules.
4. A data query system, the system comprising: an SDL engine, an SDL interface, and a data repository, wherein the SDL engine includes an SDL parser and an SDL interpreter, wherein,
the SDL parser is used for: analyzing the received SDL instruction to obtain an abstract syntax tree;
the SDL interpreter is to: analyzing the abstract syntax tree, calling data information corresponding to the analyzed abstract syntax tree in the data warehouse through an Http protocol after the SDL engine is connected with the data warehouse through the SDL interface, and executing an operation corresponding to the SDL instruction according to the data information and the analyzed abstract syntax tree;
the SDL parser is specifically configured to:
analyzing the SDL instruction to obtain a constant, an operator, a variable and a named object in the SDL instruction;
converting the constant, the operator, the variable and the named object in the SDL instruction into the abstract syntax tree according to the priority of the operator in the SDL instruction;
wherein the data types supported by the SDL engine include: numbers, system constants, strings, naming parameters, functions, operators;
the system further comprises: a processor for, among other things,
the processor is configured to: defining a syntactic structure of the query instruction in the data warehouse according to a preset predefined rule;
when the SDL instruction is matched with the syntactic structure of the query instruction and the SDL interface connects the SDL engine with a data warehouse, the SDL interpreter calls data information corresponding to the analyzed abstract syntax tree in the data warehouse through an Http protocol;
the operational functions of the connected data warehouse are: connect (username, passswerd); the operation function of the data query is as follows: sdl.data (); the operation function of the metadata query is: variable (), the operation function of data computation is: sdl.data.min (), the operation function of data drawing is: boxplot (), the operation function of the toolset is: stools. sort ().
5. The data query system of claim 4, wherein the SDL interpreter is specifically configured to:
traversing the nodes of the abstract syntax tree according to a preset traversal rule so as to obtain a computational logic;
and executing the operation corresponding to the SDL instruction according to the calculation logic and the called data information, and obtaining an execution result.
6. A data query system as claimed in claim 5, wherein said preset traversal rules are: breadth first rules or depth first rules.
CN201711047703.XA 2017-10-31 2017-10-31 Data query method and system Active CN107832391B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711047703.XA CN107832391B (en) 2017-10-31 2017-10-31 Data query method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711047703.XA CN107832391B (en) 2017-10-31 2017-10-31 Data query method and system

Publications (2)

Publication Number Publication Date
CN107832391A CN107832391A (en) 2018-03-23
CN107832391B true CN107832391B (en) 2020-08-18

Family

ID=61651165

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711047703.XA Active CN107832391B (en) 2017-10-31 2017-10-31 Data query method and system

Country Status (1)

Country Link
CN (1) CN107832391B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108806797A (en) * 2018-06-27 2018-11-13 思派(北京)网络科技有限公司 A kind of processing method and system of medical data
CN108920614B (en) * 2018-06-28 2021-08-20 北京奇虎科技有限公司 Method, device and system for online data query
CN109542954A (en) * 2018-11-30 2019-03-29 长城计算机软件与系统有限公司 A kind of data query method and system of unified interface
CN112579856A (en) * 2019-09-30 2021-03-30 北京国双科技有限公司 Method and device for processing crawling control instruction

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104252509A (en) * 2013-11-05 2014-12-31 深圳市华傲数据技术有限公司 Expression execution method and expression execution device
CN104899314A (en) * 2015-06-17 2015-09-09 北京京东尚科信息技术有限公司 Pedigree analysis method and device of data warehouse
CN105930267A (en) * 2016-04-15 2016-09-07 中国工商银行股份有限公司 Database dictionary based storage process static detection method and system
CN107038207A (en) * 2017-02-20 2017-08-11 阿里巴巴集团控股有限公司 A kind of data query method, data processing method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10095734B2 (en) * 2015-06-10 2018-10-09 International Business Machines Corporation Source code search engine

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104252509A (en) * 2013-11-05 2014-12-31 深圳市华傲数据技术有限公司 Expression execution method and expression execution device
CN104899314A (en) * 2015-06-17 2015-09-09 北京京东尚科信息技术有限公司 Pedigree analysis method and device of data warehouse
CN105930267A (en) * 2016-04-15 2016-09-07 中国工商银行股份有限公司 Database dictionary based storage process static detection method and system
CN107038207A (en) * 2017-02-20 2017-08-11 阿里巴巴集团控股有限公司 A kind of data query method, data processing method and device

Also Published As

Publication number Publication date
CN107832391A (en) 2018-03-23

Similar Documents

Publication Publication Date Title
CN110908997B (en) Data blood relationship construction method and device, server and readable storage medium
US7676453B2 (en) Partial query caching
US10404731B2 (en) Method and device for detecting website attack
CN107832391B (en) Data query method and system
US10754628B2 (en) Extracting web API endpoint data from source code to identify potential security threats
CN108710662B (en) Language conversion method and device, storage medium, data query system and method
CN113901083B (en) Heterogeneous data source operation resource analysis positioning method and equipment based on multiple resolvers
CN108959294B (en) A method and apparatus for accessing a search engine
CN117407414A (en) Method, device, equipment and medium for processing structured query statement
CN113868698A (en) A kind of document desensitization method and equipment
US12393590B2 (en) System and methods for processing data queries in hybrid data mesh architectures
CN116303574A (en) Database operation statement optimization and database operation method, equipment and medium
CN115935420A (en) Data processing method, device, server and medium
CN119149715B (en) Method, device, electronic equipment and computer program product for acquiring index data
CN114398315A (en) Data storage method, system, storage medium and electronic equipment
US20250131037A1 (en) Systems and methods for querying a graph data structure
US20200125325A1 (en) Identification of users across multiple platforms
CN115168399B (en) Data processing method, device, equipment and storage medium based on graphical interface
CN117971883A (en) Data table map generation method and device, equipment, storage medium and program product
CN117032646A (en) Index configuration method, index execution method and system
CN116243925A (en) Code analysis and evaluation method, apparatus, device, medium and program product
CN118069507B (en) Regression testing quality assessment method and device based on code knowledge graph
CN110659345A (en) Data pushing method, device, equipment and storage medium for fact report
CN119783163B (en) Interaction method and device of database and computer equipment
CN119149549B (en) Method, device, electronic device and computer program product for data table screening

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
GR01 Patent grant
GR01 Patent grant
CP01 Change in the name or title of a patent holder
CP01 Change in the name or title of a patent holder

Address after: 100190 17-19 / F, building a 1, 66 Zhongguancun East Road, Haidian District, Beijing

Patentee after: New Great Wall Technology Co.,Ltd.

Address before: 100190 17-19 / F, building a 1, 66 Zhongguancun East Road, Haidian District, Beijing

Patentee before: GREAT WALL COMPUTER SOFTWARE & SYSTEMS Inc.