CN113312377A - Automatic-association SQL query statement processing method and device and electronic equipment - Google Patents
Automatic-association SQL query statement processing method and device and electronic equipment Download PDFInfo
- Publication number
- CN113312377A CN113312377A CN202110652084.7A CN202110652084A CN113312377A CN 113312377 A CN113312377 A CN 113312377A CN 202110652084 A CN202110652084 A CN 202110652084A CN 113312377 A CN113312377 A CN 113312377A
- Authority
- CN
- China
- Prior art keywords
- objects
- sql
- blood relationship
- syntax tree
- relationship
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/242—Query formulation
- G06F16/2433—Query languages
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/22—Indexing; Data structures therefor; Storage structures
- G06F16/2228—Indexing structures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/28—Databases characterised by their database models, e.g. relational or object models
- G06F16/284—Relational databases
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Mathematical Physics (AREA)
- Computational Linguistics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The embodiment of the specification provides an automatic association SQL query statement processing method, which includes the steps of collecting execution log information of a multi-source system into an object association system in a batch data synchronization mode, analyzing blood relationship of objects in the execution log information, building a syntax tree according to the analyzed blood relationship, storing the objects in the syntax tree into a graph database according to the structure of the syntax tree, storing blood relationship between object nodes and the nodes in the graph database, providing an automatic association module for a user, determining the objects to be associated selected by the user, querying the blood relationship between the objects to be associated in the graph database, and generating an SQL query statement. Because the bloody border relationship between the objects to be correlated can be automatically inquired by using the table relationship analyzed by the execution log, the SQL inquiry statement is automatically correlated and generated, the analysis work of database developers is reduced, the required SQL development script is automatically generated according to the selection of the developers, the processing efficiency is improved, and the error rate is reduced.
Description
Technical Field
The present application relates to the field of computers, and in particular, to a method and an apparatus for processing an automatically associated SQL query statement, and an electronic device.
Background
The data processing depends on processing the data table by using SQL query statements, at present, the SQL query statements are mostly established manually, and SQL query statements are constructed by manually analyzing the query relation of the database table so as to provide data processing services subsequently. However, this approach requires a lot of manpower, especially in cases involving multi-level data table lookup relationships.
Therefore, it is necessary to provide a new method to improve the processing efficiency of the SQL query statement.
The analysis of the prior art shows that when constructing an SQL query statement, a developer needs to select a plurality of objects, and construct a query statement according to the functional relationship among the objects and the positions of the objects. If the background can automatically form a corresponding SQL query statement after the user selects the object, the processing efficiency can be greatly improved.
Disclosure of Invention
The embodiment of the specification provides an automatic association SQL query statement processing method and device and electronic equipment, and aims to improve processing efficiency.
An embodiment of the present specification provides an automatic association SQL query statement processing method, including
Acquiring execution log information of the multi-source system into an object association system in a batch data synchronization mode;
analyzing the blood relationship of the object in the execution log information by using a blood relationship analysis module, and building a syntax tree according to the analyzed blood relationship;
storing the object in the syntax tree into a graph database according to the structure of the syntax tree, wherein the graph database stores object nodes and the blood relationship among the nodes;
and providing an automatic association module for a user, determining the objects to be associated selected by the user, inquiring the blood relationship among the objects to be associated in the graph database, and generating an SQL inquiry statement.
Optionally, the executing the log information includes:
the system log of the multi-source system, the SQL execution log in the database and the SQL query statement script;
and collecting metadata and business data in the multi-source system database.
Optionally, the analyzing, by the kindred relationship analyzing module, the kindred relationship of the object in the execution log information includes:
extracting SQL (structured query language) segments in the log, generating a data visitor, traversing and capturing fields and field aliases in the SQL segments, and parallelly acquiring table names and table alias sets of source tables to which the captured fields belong in a multi-thread manner;
and acquiring a non-independent table name set, performing alias replacement, and recording the blood relationship by using the SQL segment after the table name replacement.
Optionally, the performing alias replacement includes:
and if the captured fields are related queries or sub-queries, searching the target fields according to the query hierarchy and the hierarchy, and performing alias replacement on the target fields.
Optionally, the method further comprises:
and verifying the matching degree and the blood relationship between the objects to be associated by utilizing a pre-constructed natural language processing rule.
Optionally, the object comprises a field in a table.
Optionally, the kindred relationship comprises a parent-child relationship.
Optionally, the method further comprises:
and submitting the generated SQL query statement to a database, and querying when receiving a query instruction.
Optionally, the building of the syntax tree according to the parsed blood relationship includes:
and building nodes of the syntax tree at adjacent levels, wherein the objects to be associated span multiple levels of the syntax tree.
The embodiment of the present specification further provides an automatic association SQL query statement processing module, which includes
The acquisition module acquires execution log information of the multi-source system into the object association system in a batch data synchronization mode;
the analysis module is used for analyzing the blood relationship of the objects in the execution log information by using the blood relationship analysis module and building a syntax tree according to the analyzed blood relationship;
the storage module is used for storing objects in the syntax tree into a graph database according to the structure of the syntax tree, and the graph database stores object nodes and the blood relationship among the nodes;
and the automatic association module is used for providing the automatic association module for the user, determining the objects to be associated selected by the user, inquiring the blood relationship among the objects to be associated in the graph database, and generating the SQL inquiry statement.
An embodiment of the present specification further provides an electronic device, where the electronic device includes:
a processor; and the number of the first and second groups,
a memory storing computer-executable instructions that, when executed, cause the processor to perform any of the methods described above.
The present specification also provides a computer readable storage medium, wherein the computer readable storage medium stores one or more programs which, when executed by a processor, implement any of the above methods.
According to various technical schemes provided by the embodiment of the specification, execution log information of a multi-source system is acquired into an object association system in a batch data synchronization mode, the blood relationship of objects in the execution log information is analyzed, a syntax tree is built according to the analyzed blood relationship, the objects in the syntax tree are stored into a graph database according to the structure of the syntax tree, blood relationship between object nodes and the blood relationship between the object nodes are stored in the graph database, an automatic association module is provided for a user, the objects to be associated selected by the user are determined, the blood relationship between the objects to be associated is inquired in the graph database, and SQL inquiry sentences are generated. Because the bloody border relationship between the objects to be correlated can be automatically inquired by using the table relationship analyzed by the execution log, the SQL inquiry statement is automatically correlated and generated, the analysis work of database developers is reduced, the required SQL development script is automatically generated according to the selection of the developers, the processing efficiency is improved, and the error rate is reduced.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
FIG. 1 is a schematic diagram illustrating a method for processing an automatically associated SQL query statement according to an embodiment of the present disclosure;
fig. 2 is a schematic structural diagram of an automatic association SQL query statement processing apparatus according to an embodiment of the present disclosure;
fig. 3 is a schematic structural diagram of an electronic device provided in an embodiment of the present disclosure;
fig. 4 is a schematic diagram of a computer-readable medium provided in an embodiment of the present specification.
Detailed Description
Exemplary embodiments of the present invention will now be described more fully with reference to the accompanying drawings. The exemplary embodiments, however, may be embodied in many different forms and should not be construed as limited to the embodiments set forth herein. Rather, these exemplary embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of the invention to those skilled in the art. The same reference numerals denote the same or similar elements, components, or parts in the drawings, and thus their repetitive description will be omitted.
Features, structures, characteristics or other details described in a particular embodiment do not preclude the fact that the features, structures, characteristics or other details may be combined in a suitable manner in one or more other embodiments in accordance with the technical idea of the invention.
In describing particular embodiments, the present invention has been described with reference to features, structures, characteristics or other details that are within the purview of one skilled in the art to provide a thorough understanding of the embodiments. One skilled in the relevant art will recognize, however, that the invention may be practiced without one or more of the specific features, structures, characteristics, or other details.
The flow charts shown in the drawings are merely illustrative and do not necessarily include all of the contents and operations/steps, nor do they necessarily have to be performed in the order described. For example, some operations/steps may be decomposed, and some operations/steps may be combined or partially combined, so that the actual execution sequence may be changed according to the actual situation.
The block diagrams shown in the figures are functional entities only and do not necessarily correspond to physically separate entities. I.e. these functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor means and/or microcontroller means.
The term "and/or" and/or "includes all combinations of any one or more of the associated listed items.
Fig. 1 is a schematic diagram of a method for processing an automatically associated SQL query statement according to an embodiment of the present disclosure, where the method may include:
s101: and acquiring execution log information of the multi-source system into an object association system in a batch data synchronization mode.
Considering that a query update operation is performed by an existing program in the data system, if the existing program can be used to identify a new table relationship on an existing table relationship, an SQL query statement having the table relationship can be automatically generated.
However, directly fetching these programs is not meaningful because since it is the newly created SQL query statement that must be altered, the table relationships embodied behind these programs, if utilized, can be used to generate the new SQL query statement.
Therefore, we need to restore the table relationships.
By analyzing the data fetching process of the existing programs and tracking and analyzing the data query process of the programs, the database table relation can be quickly found.
Specifically, in an embodiment of this specification, the executing log information includes:
the system log of the multi-source system, the SQL execution log in the database and the SQL query statement script;
metadata and business data in the multi-source system database can also be collected.
The SQL tracking tool belongs to the prior art and is not elaborated herein.
And then, extracting the database table association relation by taking the tracked SQL execution sequence as a clue.
S102: analyzing the blood relationship of the object in the execution log information by using a blood relationship analysis module, and building a syntax tree according to the analyzed blood relationship.
In an embodiment of the present specification, the analyzing, by using a blood-relationship analysis module, a blood-relationship of an object in the execution log information includes:
extracting SQL (structured query language) segments in the log, generating a data visitor, traversing and capturing fields and field aliases in the SQL segments, and parallelly acquiring table names and table alias sets of source tables to which the captured fields belong in a multi-thread manner;
and acquiring a non-independent table name set, performing alias replacement, and recording the blood relationship by using the SQL segment after the table name replacement.
Where a non-independent table name refers to a data table that has a so or queried relationship with other data tables.
Wherein a data visitor may include a walk instruction and a corresponding data storage space, such as a stack.
In an embodiment of this specification, the performing alias replacement includes:
and if the captured fields are related queries or sub-queries, searching the target fields according to the query hierarchy and the hierarchy, and performing alias replacement on the target fields.
Alias replacement refers to replacing an alias with a real table name.
In the embodiment of this specification, still include:
and verifying the matching degree and the blood relationship between the objects to be associated by utilizing a pre-constructed natural language processing rule.
The accuracy of the blood relationship between objects (tables) is effectively guaranteed through a blood relationship analysis algorithm, and the false analysis of the blood relationship can be effectively avoided through verification through an NLP (natural language processing rule).
In an embodiment of the present specification, the object comprises a field in a table.
In an embodiment of the present specification, the kindred relationship may include a parent-child relationship.
In an embodiment of this specification, the building a syntax tree according to the parsed blood relationship includes:
and building nodes of the syntax tree at adjacent levels, wherein the objects to be associated span multiple levels of the syntax tree.
In actual implementation, an SQL fragment in a log is obtained firstly, an abstract syntax data visitor is generated, then fields and field aliases in an SQL statement are captured in a traversing (recursion) mode, table names and alias sets of a source single table are obtained in a parallel recursion mode, then judgment is carried out, a non-independent table name set is obtained, if a source field is a complex associated query or a sub-query, a final target field is found in a sub-query hierarchical relation set in a recursion mode, alias replacement is carried out, if the source field is an independent single table alias associated with the outermost layer, a real table name is directly replaced, and finally a blood relationship among the tables, the fields and the tables is obtained.
S103: and storing the object in the grammar tree into a graph database according to the structure of the grammar tree, wherein the graph database stores object nodes and the blood relationship among the nodes.
In this embodiment of the present specification, we may name nodes in the syntax tree according to the relationship of ancestry, where the ancestry relationship of the node having the direct query or queried relationship is a parent-child relationship, the node having the indirect query or queried relationship is a grandparent relationship, and besides the ancestry relationship, the node may also have a collateral ancestry relationship, which is not described in detail herein.
SQL query sentences in the execution log may only relate to father-son kindred relations, but by building a syntax tree, a plurality of SQL query sentences can be combined to form grandfather-grandson kindred relations, and then SQL query sentences of which the association mode is grandfather-grandson kindred relations are directly generated.
Therefore, the method can effectively utilize the table relation embodied by the existing execution log to generate the SQL query statement with complex association.
S104: and providing an automatic association module for a user, determining the objects to be associated selected by the user, inquiring the blood relationship among the objects to be associated in the graph database, and generating an SQL inquiry statement.
Acquiring execution log information of a multi-source system into an object association system in a batch data synchronization mode, analyzing the blood relationship of objects in the execution log information, building a syntax tree according to the analyzed blood relationship, storing the objects in the syntax tree into a database according to the structure of the syntax tree, storing blood relationship between object nodes and nodes in the database, providing an automatic association module for a user, determining the objects to be associated selected by the user, inquiring the blood relationship between the objects to be associated in the database, and generating an SQL inquiry statement. Because the bloody border relationship between the objects to be correlated can be automatically inquired by using the table relationship analyzed by the execution log, the SQL inquiry statement is automatically correlated and generated, the analysis work of database developers is reduced, the required SQL development script is automatically generated according to the selection of the developers, the processing efficiency is improved, and the error rate is reduced.
Of course, in the embodiment of the present specification, the method may further include:
and submitting the generated SQL query statement to a database, and querying when receiving a query instruction.
Fig. 2 is a schematic structural diagram of an automatic association SQL query statement processing apparatus provided in an embodiment of the present specification, where the apparatus may include:
the acquisition module 201 acquires execution log information of the multi-source system into an object association system in a batch data synchronization mode;
the analysis module 202 is used for analyzing the blood relationship of the object in the execution log information by using the blood relationship analysis module and building a syntax tree according to the analyzed blood relationship;
the storage module 203 stores the object in the syntax tree into a graph database according to the structure of the syntax tree, and the graph database stores the object node and the blood relationship between the nodes;
the automatic association module 204 provides an automatic association module for the user, determines the objects to be associated selected by the user, queries the blood relationship between the objects to be associated in the graph database, and generates an SQL query statement.
In an embodiment of the present specification, the executing log information includes:
the system log of the multi-source system, the SQL execution log in the database and the SQL query statement script;
and collecting metadata and business data in the multi-source system database.
In an embodiment of the present specification, the analyzing, by using a blood-relationship analysis module, a blood-relationship of an object in the execution log information includes:
extracting SQL (structured query language) segments in the log, generating a data visitor, traversing and capturing fields and field aliases in the SQL segments, and parallelly acquiring table names and table alias sets of source tables to which the captured fields belong in a multi-thread manner;
and acquiring a non-independent table name set, performing alias replacement, and recording the blood relationship by using the SQL segment after the table name replacement.
In an embodiment of this specification, the performing alias replacement includes:
and if the captured fields are related queries or sub-queries, searching the target fields according to the query hierarchy and the hierarchy, and performing alias replacement on the target fields.
In the embodiment of this specification, still include:
and verifying the matching degree and the blood relationship between the objects to be associated by utilizing a pre-constructed natural language processing rule.
In an embodiment of the present specification, the object comprises a field in a table.
In an embodiment of the present specification, the kindred relationship includes a parent-child relationship.
In the embodiment of this specification, still include:
and submitting the generated SQL query statement to a database, and querying when receiving a query instruction.
In an embodiment of this specification, the building a syntax tree according to the analyzed blood relationship may include:
and building nodes of the syntax tree at adjacent levels, wherein the objects to be associated span multiple levels of the syntax tree.
The device collects execution log information of a multi-source system into an object correlation system in a batch data synchronization mode, analyzes the blood relationship of objects in the execution log information, builds a grammar tree according to the analyzed blood relationship, stores the objects in the grammar tree into a graph database according to the structure of the grammar tree, stores blood relationship between object nodes and nodes in the graph database, provides an automatic correlation module for a user, determines the objects to be correlated selected by the user, inquires the blood relationship between the objects to be correlated in the graph database, and generates an SQL inquiry statement. Because the bloody border relationship between the objects to be correlated can be automatically inquired by using the table relationship analyzed by the execution log, the SQL inquiry statement is automatically correlated and generated, the analysis work of database developers is reduced, the required SQL development script is automatically generated according to the selection of the developers, the processing efficiency is improved, and the error rate is reduced.
Based on the same inventive concept, the embodiment of the specification further provides the electronic equipment.
In the following, embodiments of the electronic device of the present invention are described, which may be regarded as specific physical implementations for the above-described embodiments of the method and apparatus of the present invention. Details described in the embodiments of the electronic device of the invention should be considered supplementary to the embodiments of the method or apparatus described above; for details which are not disclosed in embodiments of the electronic device of the invention, reference may be made to the above-described embodiments of the method or the apparatus.
Fig. 3 is a schematic structural diagram of an electronic device provided in an embodiment of the present disclosure. An electronic device 300 according to this embodiment of the invention is described below with reference to fig. 3. The electronic device 300 shown in fig. 3 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 3, electronic device 300 is embodied in the form of a general purpose computing device. The components of electronic device 300 may include, but are not limited to: at least one processing unit 310, at least one memory unit 320, a bus 330 connecting the various system components (including the memory unit 320 and the processing unit 310), a display unit 340, and the like.
Wherein the storage unit stores program code executable by the processing unit 310 to cause the processing unit 310 to perform the steps according to various exemplary embodiments of the present invention described in the above-mentioned processing method section of the present specification. For example, the processing unit 310 may perform the steps as shown in fig. 1.
The storage unit 320 may include readable media in the form of volatile storage units, such as a random access memory unit (RAM)3201 and/or a cache storage unit 3202, and may further include a read only memory unit (ROM) 3203.
The storage unit 320 may also include a program/utility 3204 having a set (at least one) of program modules 3205, such program modules 3205 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
The electronic device 300 may also communicate with one or more external devices 400 (e.g., keyboard, pointing device, bluetooth device, etc.), with one or more devices that enable a user to interact with the electronic device 300, and/or with any devices (e.g., router, modem, etc.) that enable the electronic device 300 to communicate with one or more other computing devices. Such communication may occur via an input/output (I/O) interface 350. Also, the electronic device 300 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the internet) via the network adapter 360. Network adapter 360 may communicate with other modules of electronic device 300 via bus 330. It should be appreciated that although not shown in FIG. 3, other hardware and/or software modules may be used in conjunction with electronic device 300, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAI D systems, tape drives, and data backup storage systems, etc.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments of the present invention described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiment of the present invention can be embodied in the form of a software product, which can be stored in a computer-readable storage medium (which can be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to make a computing device (which can be a personal computer, a server, or a network device, etc.) execute the above-mentioned method according to the present invention. The computer program, when executed by a data processing apparatus, enables the computer readable medium to implement the above-described method of the invention, namely: such as the method shown in fig. 1.
Fig. 4 is a schematic diagram of a computer-readable medium provided in an embodiment of the present specification.
A computer program implementing the method shown in fig. 1 may be stored on one or more computer readable media. The computer readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The computer readable storage medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable storage medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
In summary, the invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art will appreciate that some or all of the functionality of some or all of the components in embodiments in accordance with the invention may be implemented in practice using a general purpose data processing device such as a microprocessor or a Digital Signal Processor (DSP). The present invention may also be embodied as apparatus or device programs (e.g., computer programs and computer program products) for performing a portion or all of the methods described herein. Such programs implementing the present invention may be stored on computer-readable media or may be in the form of one or more signals. Such a signal may be downloaded from an internet website or provided on a carrier signal or in any other form.
While the foregoing embodiments have described the objects, aspects and advantages of the present invention in further detail, it should be understood that the present invention is not inherently related to any particular computer, virtual machine or electronic device, and various general-purpose machines may be used to implement the present invention. The invention is not to be considered as limited to the specific embodiments thereof, but is to be understood as being modified in all respects, all changes and equivalents that come within the spirit and scope of the invention.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments.
The above description is only an example of the present application and is not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims (12)
1. An automatic correlation SQL query statement processing method is characterized by comprising
Acquiring execution log information of the multi-source system into an object association system in a batch data synchronization mode;
analyzing the blood relationship of the object in the execution log information by using a blood relationship analysis module, and building a syntax tree according to the analyzed blood relationship;
storing the object in the syntax tree into a graph database according to the structure of the syntax tree, wherein the graph database stores object nodes and the blood relationship among the nodes;
and providing an automatic association module for a user, determining the objects to be associated selected by the user, inquiring the blood relationship among the objects to be associated in the graph database, and generating an SQL inquiry statement.
2. The method of claim 1, wherein the executing log information comprises:
the system log of the multi-source system, the SQL execution log in the database and the SQL query statement script;
and collecting metadata and business data in the multi-source system database.
3. The method of claim 1, wherein the analyzing the blooding relationships of the objects in the execution log information by the blooding relationships analyzing module comprises:
extracting SQL (structured query language) segments in the log, generating a data visitor, traversing and capturing fields and field aliases in the SQL segments, and parallelly acquiring table names and table alias sets of source tables to which the captured fields belong in a multi-thread manner;
and acquiring a non-independent table name set, performing alias replacement, and recording the blood relationship by using the SQL segment after the table name replacement.
4. The method of claim 3, wherein the performing alias replacement comprises:
and if the captured fields are related queries or sub-queries, searching the target fields according to the query hierarchy and the hierarchy, and performing alias replacement on the target fields.
5. The method of claim 1, further comprising:
and verifying the matching degree and the blood relationship between the objects to be associated by utilizing a pre-constructed natural language processing rule.
6. The method of claim 4, wherein the object comprises a field in a table.
7. The method of claim 1, wherein the consanguinity relationships comprise paternal-to-child relationships.
8. The method of claim 1, further comprising:
and submitting the generated SQL query statement to a database, and querying when receiving a query instruction.
9. The method of claim 1, wherein building a syntax tree from the parsed relationship comprises:
and building nodes of the syntax tree at adjacent levels, wherein the objects to be associated span multiple levels of the syntax tree.
10. An automatic correlation SQL query statement processing module is characterized by comprising
The acquisition module acquires execution log information of the multi-source system into the object association system in a batch data synchronization mode;
the analysis module is used for analyzing the blood relationship of the objects in the execution log information by using the blood relationship analysis module and building a syntax tree according to the analyzed blood relationship;
the storage module is used for storing objects in the syntax tree into a graph database according to the structure of the syntax tree, and the graph database stores object nodes and the blood relationship among the nodes;
and the automatic association module is used for providing the automatic association module for the user, determining the objects to be associated selected by the user, inquiring the blood relationship among the objects to be associated in the graph database, and generating the SQL inquiry statement.
11. An electronic device, wherein the electronic device comprises:
a processor; and the number of the first and second groups,
a memory storing computer-executable instructions that, when executed, cause the processor to perform the method of any of claims 1-9.
12. A computer readable storage medium, wherein the computer readable storage medium stores one or more programs which, when executed by a processor, implement the method of any of claims 1-9.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110652084.7A CN113312377A (en) | 2021-06-11 | 2021-06-11 | Automatic-association SQL query statement processing method and device and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110652084.7A CN113312377A (en) | 2021-06-11 | 2021-06-11 | Automatic-association SQL query statement processing method and device and electronic equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113312377A true CN113312377A (en) | 2021-08-27 |
Family
ID=77378521
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110652084.7A Pending CN113312377A (en) | 2021-06-11 | 2021-06-11 | Automatic-association SQL query statement processing method and device and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113312377A (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113742316A (en) * | 2021-09-08 | 2021-12-03 | 辽宁振兴银行股份有限公司 | Device and method for synchronizing Mysql database by executing sql sentences in batches |
CN113742347A (en) * | 2021-09-07 | 2021-12-03 | 中国兵器装备集团自动化研究所有限公司 | Database data storage method, electronic device and computer readable storage medium |
CN114185958A (en) * | 2021-11-18 | 2022-03-15 | 招联消费金融有限公司 | Blood relationship generation method and device, computer equipment and storage medium |
CN114490651A (en) * | 2022-01-19 | 2022-05-13 | 阿里云计算有限公司 | Data storage method and device |
CN114756469A (en) * | 2022-04-24 | 2022-07-15 | 阿里巴巴(中国)有限公司 | Data relation analysis method and device and electronic equipment |
CN115994152A (en) * | 2023-03-24 | 2023-04-21 | 云账户技术(天津)有限公司 | Verification method, device, equipment and storage medium of MySQL query statement |
-
2021
- 2021-06-11 CN CN202110652084.7A patent/CN113312377A/en active Pending
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113742347A (en) * | 2021-09-07 | 2021-12-03 | 中国兵器装备集团自动化研究所有限公司 | Database data storage method, electronic device and computer readable storage medium |
CN113742347B (en) * | 2021-09-07 | 2023-06-27 | 中国兵器装备集团自动化研究所有限公司 | Method for storing data, electronic device and computer readable storage medium |
CN113742316A (en) * | 2021-09-08 | 2021-12-03 | 辽宁振兴银行股份有限公司 | Device and method for synchronizing Mysql database by executing sql sentences in batches |
CN114185958A (en) * | 2021-11-18 | 2022-03-15 | 招联消费金融有限公司 | Blood relationship generation method and device, computer equipment and storage medium |
CN114185958B (en) * | 2021-11-18 | 2024-04-02 | 招联消费金融股份有限公司 | Blood relationship generation method, device, computer equipment and storage medium |
CN114490651A (en) * | 2022-01-19 | 2022-05-13 | 阿里云计算有限公司 | Data storage method and device |
CN114756469A (en) * | 2022-04-24 | 2022-07-15 | 阿里巴巴(中国)有限公司 | Data relation analysis method and device and electronic equipment |
CN115994152A (en) * | 2023-03-24 | 2023-04-21 | 云账户技术(天津)有限公司 | Verification method, device, equipment and storage medium of MySQL query statement |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN113312377A (en) | Automatic-association SQL query statement processing method and device and electronic equipment | |
CN109863473B (en) | Method, electronic device and electronic system for sample-driven profile-guided optimization | |
CN106897322B (en) | A kind of access method and device of database and file system | |
CN110825767A (en) | Data query method, platform, equipment and storage medium | |
US20140075161A1 (en) | Data-Parallel Computation Management | |
JP5791149B2 (en) | Computer-implemented method, computer program, and data processing system for database query optimization | |
CN110543571A (en) | knowledge graph construction method and device for water conservancy informatization | |
CN108694221B (en) | Data real-time analysis method, module, equipment and device | |
CN111078729B (en) | Medical data tracing method, device, system, storage medium and electronic equipment | |
CN112860727B (en) | Data query method, device, equipment and medium based on big data query engine | |
Reza et al. | Prunejuice: pruning trillion-edge graphs to a precise pattern-matching solution | |
US11573790B2 (en) | Generation of knowledge graphs based on repositories of code | |
CN113419740B (en) | Program data stream analysis method and device, electronic equipment and readable storage medium | |
US8458679B2 (en) | May-constant propagation | |
CN107391528B (en) | Front-end component dependent information searching method and equipment | |
CN111949654A (en) | User label-based quick query method and system and electronic equipment | |
CN114356964A (en) | Data blood margin construction method and device, storage medium and electronic equipment | |
CN111506603B (en) | Data processing method, device, equipment and storage medium | |
CN113568605B (en) | Method, device and system for configuring defined route | |
Lai et al. | {GLogS}: Interactive graph pattern matching query at large scale | |
US20220374212A1 (en) | Indexing and accessing source code snippets contained in documents | |
CN113326261A (en) | Data blood relationship extraction method and device and electronic equipment | |
CN112818070A (en) | Data query method and device based on global data dictionary and electronic equipment | |
CN116795412A (en) | Buried data processing method, buried data processing device, buried data processing equipment and storage medium | |
CN112988778B (en) | Method and device for processing database query script |
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 |