A method, device, system and medium for visualizing a complex SQL statement

CN117033413BActive Publication Date: 2026-08-07PING AN BANK CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
PING AN BANK CO LTD
Filing Date
2023-08-10
Publication Date
2026-08-07

AI Technical Summary

Technical Problem

因为涉及到大量的字段关联使用,所以在编写SQL时会使用多表复杂SQL语句,使得在后续维护或变更的过程中开发人员需要耗费大量精力去校验核对字段,提高了开发维护成本

Benefits of technology

[0036]有益效果:本发明公开了一种复杂SQL语句的可视化方法、装置、系统及介质,相比于现有技术,本发明实施例通过按预设拆分规则对复杂SQL语句进行结构拆分,以便基于拆分得到的结构化数据生成可以直观展示数据类型与数据关联关系的可视化页面,令开发人员快速直观的了解复杂SQL语句的数据结构,实现复杂SQL语句的可视化展示,降低开发维护成本。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117033413B_ABST
    Figure CN117033413B_ABST
Patent Text Reader

Abstract

The application discloses a complex SQL statement visualization method, device, system and medium, and the method comprises the steps of obtaining a complex SQL statement to be processed; performing structural splitting on the complex SQL statement according to a preset splitting rule to obtain corresponding structured data; generating a visualization page according to the data type and data association relationship in the structured data; and displaying the visualization page on a display interface to display the data structure of the complex SQL statement. The complex SQL statement is structurally split according to the preset splitting rule, the structured data obtained by splitting is used to generate a visualization page which can intuitively display the data type and data association relationship, the developer can quickly and intuitively understand the data structure of the complex SQL statement, the visualization of the complex SQL statement is realized, and the development and maintenance cost is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of financial technology, and in particular to a method, apparatus, system, and medium for visualizing complex SQL statements. Background Technology

[0002] With the rapid development of various business scenarios in the financial sector, an increasing number of financial software projects are being launched, providing convenient and efficient services for more banking business scenarios to achieve digital finance. Big data development is indispensable in the advancement of digital finance.

[0003] In big data development, especially in data warehouse construction, it is often necessary to obtain corresponding fields from several data source layer tables and then combine them with detailed data to produce data for the data business layer. Because this involves a large number of field relationships, complex multi-table SQL statements are often used when writing SQL, which requires developers to spend a lot of time verifying and checking fields during subsequent maintenance or changes, thus increasing development and maintenance costs. Summary of the Invention

[0004] In view of the shortcomings of the prior art, the purpose of this invention is to provide a method, apparatus, system and medium for visualizing complex SQL statements that can be applied to financial technology or other related fields, with the aim of realizing the visual display of complex SQL statements and reducing development and maintenance costs.

[0005] The technical solution of the present invention is as follows:

[0006] A method for visualizing complex SQL statements, including:

[0007] Retrieve complex SQL statements to be processed;

[0008] The complex SQL statement is structurally split according to preset splitting rules to obtain the corresponding structured data;

[0009] A visualization page is generated based on the data types and data relationships in the structured data;

[0010] The visualization page is displayed on the interface to show the data structure of the complex SQL statement.

[0011] In one embodiment, before performing structural splitting of the complex SQL statement according to preset splitting rules to obtain the corresponding structured data, the method further includes:

[0012] Receive statement rule configuration information and generate preset splitting rules based on the statement rule configuration information.

[0013] In one embodiment, the step of structurally splitting the complex SQL statement according to a preset splitting rule to obtain the corresponding structured data includes:

[0014] Determine the splitting keywords and the data types corresponding to different splitting keywords according to the preset splitting rules;

[0015] In the complex SQL statement, identify the position of the splitting keyword, and split the complex SQL statement into multiple clauses based on the position;

[0016] The data type of each clause is determined by the splitting keywords of each clause, and the corresponding structured data is obtained by combining the relationships between the clauses.

[0017] In one embodiment, the splitting keywords include field keywords and table keywords.

[0018] In one embodiment, the step of determining the data type of each clause based on the splitting keywords of each clause, and obtaining the corresponding structured data by combining the relationships between the clauses, includes:

[0019] Confirm that the splitting key for each clause is a field key or a table key, and obtain the data type of each clause;

[0020] Obtain field and table information from the complex SQL statement based on the data type of each clause;

[0021] Based on the field information, table information, and the relationships between each clause, corresponding structured data is generated.

[0022] In one embodiment, generating a visualization page based on the data types and data relationships in the structured data includes:

[0023] The clauses in the structured data are classified and clustered according to the data type to obtain several association tables and the fields contained in each association table;

[0024] Based on the relationships between each field in each associated table and other associated tables, data guidance identifiers are added to each associated table before generating the visualization page.

[0025] In one embodiment, after generating the visualization page based on the data types and data relationships in the structured data, the method further includes:

[0026] Based on the data types and data relationships in the structured data, the corresponding data graph is generated by retrieving metadata from the data warehouse.

[0027] A visualization device for complex SQL statements, comprising:

[0028] The acquisition module is used to acquire complex SQL statements to be processed.

[0029] The splitting module is used to structurally split the complex SQL statement according to preset splitting rules to obtain the corresponding structured data;

[0030] A visualization generation module is used to generate visualization pages based on the data types and data relationships in the structured data;

[0031] The display module is used to display the visualization page on the display interface to show the data structure of the complex SQL statement.

[0032] A visualization system for complex SQL statements, the system comprising at least one processor; and,

[0033] A memory communicatively connected to the at least one processor; wherein,

[0034] The memory stores instructions that can be executed by the at least one processor, which enables the at least one processor to execute the visualization method for the complex SQL statements described above.

[0035] A non-volatile computer-readable storage medium storing computer-executable instructions that, when executed by one or more processors, enable the one or more processors to execute the aforementioned visualization method for complex SQL statements.

[0036] Beneficial effects: This invention discloses a method, apparatus, system, and medium for visualizing complex SQL statements. Compared with the prior art, the embodiments of this invention perform structural decomposition of complex SQL statements according to preset decomposition rules, so as to generate a visualization page that can intuitively display data types and data relationships based on the structured data obtained from the decomposition. This allows developers to quickly and intuitively understand the data structure of complex SQL statements, realize the visualization of complex SQL statements, and reduce development and maintenance costs. Attached Figure Description

[0037] The present invention will be further described below with reference to the accompanying drawings and embodiments. In the accompanying drawings:

[0038] Figure 1 A flowchart illustrating a method for visualizing complex SQL statements provided in an embodiment of the present invention;

[0039] Figure 2 A flowchart of step S200 in the visualization method for complex SQL statements provided in the embodiments of the present invention;

[0040] Figure 3 A flowchart of step S203 in the visualization method for complex SQL statements provided in the embodiments of the present invention;

[0041] Figure 4 A flowchart of step S300 in the visualization method for complex SQL statements provided in the embodiments of the present invention;

[0042] Figure 5 A schematic diagram of the functional modules of the visualization device for complex SQL statements provided in an embodiment of the present invention;

[0043] Figure 6 A schematic diagram of the hardware structure of a visualization system for complex SQL statements provided in an embodiment of the present invention. Detailed Implementation

[0044] To make the objectives, technical solutions, and effects of this invention clearer and more explicit, the invention is further described in detail below. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. The embodiments of the invention are described below in conjunction with the accompanying drawings.

[0045] With the rapid development of various business scenarios in the financial sector, an increasing number of financial software projects are being launched, providing convenient and efficient services for more banking business scenarios to achieve digital finance. Big data development is indispensable in the advancement of digital finance.

[0046] In big data development, especially in data warehouse construction, it is often necessary to retrieve corresponding fields from several data source layer tables and then combine them with detailed data to produce data for the data business layer. Because this involves numerous field joins, complex multi-table SQL statements are often used when writing SQL, requiring developers to spend considerable effort verifying and checking fields during subsequent maintenance or changes, thus increasing development and maintenance costs. To address these issues, this invention proposes a visualization method for complex SQL statements. Please refer to [link / reference]. Figure 1 , Figure 1This is a flowchart of one embodiment of the visualization method for complex SQL statements provided by the present invention. The visualization method for complex SQL statements provided in this embodiment is applied to a system comprising a terminal device, a network, and a server. The network is the medium providing a communication link between the terminal device and the server, and can include various connection types, such as wired, wireless communication links, or fiber optic cables. The operating system on the terminal device can include a handheld device operating system (iPhone operating system, iOS system), Android system, or other operating systems. The terminal device connects to the server through the network to achieve interaction, thereby performing operations such as receiving or sending data. Specifically, it can be various electronic devices with a display screen and supporting web browsing, including but not limited to smartphones, tablets, portable computers, and desktop servers. Figure 1 As shown, the method specifically includes the following steps:

[0047] S100: Obtain complex SQL statements to be processed.

[0048] In this embodiment, the complex SQL statements to be processed can be obtained by examining the project source code. For example, the project source code can be obtained from the project management repository GitLab using the `git clone` command, and files with the ".xml" extension throughout the project can be searched. These files are then added to the list of files to be analyzed. For each file, methods such as node analysis and node attribute analysis are performed to detect the SQL statements. This allows for the detection of complex SQL statements in all XML files within the project, identifying the complex SQL statements that need to be visualized and processed.

[0049] S200. The complex SQL statement is structurally split according to the preset splitting rules to obtain the corresponding structured data.

[0050] For the obtained complex SQL statements, the complex SQL statements are decomposed into structure based on predefined screening rules. Specifically, the structure can be split based on the data types contained in the statement and the relationships between different data, so as to convert complex SQL statements with multi-table joins and field associations into structured data distributed according to certain rules, so as to provide an accurate basis for visualizing the structure of complex SQL statements.

[0051] S300. Generate a visualization page based on the data types and data relationships in the structured data;

[0052] S400. Display the visualization page on the display interface to show the data structure of the complex SQL statement.

[0053] Based on the data types and relationships within the decomposed structured data, such as complex SQL statements containing multiple tables and related tables or fields within each table, the complex SQL statements are hierarchically categorized by data type and used as visualization elements. Each visualization element is then connected based on its data relationships to generate a corresponding visualization page for display. This allows developers to directly understand the data structure of complex SQL statements through visualizations such as images and charts on the display page, making it easier to clarify the relationships between data. This effectively improves development and maintenance efficiency while reducing development and maintenance time and manpower costs.

[0054] In one embodiment, prior to step S100, the method further includes:

[0055] Receive statement rule configuration information and generate preset splitting rules based on the statement rule configuration information.

[0056] In this embodiment, users can flexibly set preset splitting rules according to different splitting needs. Specifically, the display interface shows a rule configuration page, which receives the statement configuration rule information entered by the user on the rule configuration page, such as the words to be split, the splitting rules for each word, etc. Based on the flexible and modifiable statement rule configuration information, the corresponding preset splitting rules are generated to adapt to the splitting needs of complex SQL statements under different visualization requirements and improve the flexibility of visualization processing.

[0057] In one embodiment, such as Figure 2 As shown, step S200 includes:

[0058] S201. Confirm the splitting keywords and the data types corresponding to different splitting keywords according to the preset splitting rules;

[0059] S202. Confirm the position of the splitting keyword in the complex SQL statement, and split the complex SQL statement into multiple clauses according to the position;

[0060] S203. Based on the splitting keywords of each clause, determine the data type of each clause, and combine the relationships between the clauses to obtain the corresponding structured data.

[0061] In this embodiment, when splitting a statement, the splitting keywords and the data types corresponding to different splitting keywords are determined based on the currently defined splitting rules. The specific splitting keywords include field keywords and table keywords. That is, the splitting rules define keywords used to split fields and keywords used to split tables, thereby ensuring the fine-grained splitting of complex SQL statements.

[0062] Next, identify the positions of each field key and table key in the complex SQL statement, thereby breaking the complex SQL statement into multiple clauses. At this point, the data type of each clause can be identified by the splitting key. For example, the content of the clause after the field key is the field data, and the content of the clause after the table key is the table data. Then, combine the relationships between the clauses, that is, the relationships between tables and fields, and between tables, to obtain the corresponding structured data, thus breaking the complex SQL statement into hierarchically distributed structured data.

[0063] In one embodiment, such as Figure 3 As shown, step S203 includes:

[0064] Confirm that the splitting key for each clause is a field key or a table key, and obtain the data type of each clause;

[0065] Obtain field and table information from the complex SQL statement based on the data type of each clause;

[0066] Based on the field information, table information, and the relationships between each clause, corresponding structured data is generated.

[0067] In this embodiment, when generating structured data, the splitting keywords of each clause are first used to confirm whether it is field data or table data. Thus, the field information and table information in the complex SQL statement can be obtained according to the data type of each clause, that is, all the fields and tables contained in the complex statement. Then, the obtained field information and table information are arranged hierarchically according to the relationship between each clause to generate the corresponding structured data.

[0068] In practice, the keywords `select` and `from` are used as field keywords to determine the field information of a table, and the keyword `left join` is used as the table keyword to determine the information of the related tables. During decomposition, the position of each decomposition keyword is confirmed, for example, by using fast and slow pointers to locate the keywords `select` and `from`, where the slow pointer stays at the `select` position and the fast pointer stays at the `from` position, thus determining the position of the field keywords. Combined with the identified `left join` keyword, the complex SQL statement is decomposed into multiple clauses. At this point, the clauses following the keywords `select` and `from` contain fields, and the clauses following `left join` contain tables. Based on the relationships between tables and fields, and between tables, the complex SQL statement is decomposed into hierarchically distributed structured data. For example, the complex SQL statement includes tables 1, 2, and 3 at the same level, where table 1 is associated with field A, table 2 with field B and table 4, table 3 with field C, table 4 further with field D, and so on, achieving the structured decomposition of the complex SQL statement.

[0069] In one embodiment, such as Figure 4 As shown, step S300 includes:

[0070] S301. Classify and aggregate the clauses in the structured data according to the data type to obtain several association tables and the fields contained in each association table;

[0071] S302. Based on the relationship between each field in each associated table and other associated tables, data guidance identifiers are added to each associated table, and then the visualization page is generated.

[0072] In this embodiment, when generating the visualization page, clauses in the structured data are categorized and clustered based on data type. Specifically, fields belonging to the same table are categorized and clustered into a single visualization element based on field and table information. This means that several visualization elements representing related tables are generated on a table-by-table basis. Each related table further contains several fields. Specific visualization elements can take the form of rectangles, lists, etc. Furthermore, based on the relationships between fields in each related table and other related tables, corresponding data guidance identifiers are added to the visualization elements of each related table. For example, if field A in table 1 comes from table 2, field B in table 1 comes from table 3, and field C in table 1 comes from table 3, then single-line arrows or other data source indicators can be used to connect fields A, B, and C in table 1 to tables 2, 3, and 4 respectively. This allows for a clear and intuitive understanding of the data structure of complex SQL statements through visualization elements and data guidance identifiers, quickly identifying data references, shortening the time required for data processing, and ultimately improving development efficiency.

[0073] In one embodiment, after step S300, the method further includes:

[0074] Based on the data types and data relationships in the structured data, the corresponding data graph is generated by retrieving metadata from the data warehouse.

[0075] In this embodiment, based on the structured data obtained after structured decomposition and combined with the metadata in the data warehouse, a corresponding data graph can be generated. Since the decomposition reveals which places reference the tables in the data warehouse, data reference analysis and data source tracing can be achieved, thereby summarizing and forming a corresponding data graph, which is conducive to better sorting and managing data assets and reducing maintenance costs.

[0076] Another embodiment of the present invention provides a visualization device for complex SQL statements, such as... Figure 5 As shown, device 1 includes:

[0077] Module 11 is used to obtain complex SQL statements to be processed;

[0078] The splitting module 12 is used to perform structural splitting on the complex SQL statement according to preset splitting rules to obtain corresponding structured data;

[0079] The visualization generation module 13 is used to generate a visualization page based on the data types and data relationships in the structured data;

[0080] The display module 14 is used to display the visualization page on the display interface to show the data structure of the complex SQL statement.

[0081] The module referred to in this invention is a series of computer program instruction segments that can perform specific functions. It is more suitable than a program for describing the visual execution process of complex SQL statements. For specific implementation methods of each module, please refer to the corresponding method embodiments above, which will not be repeated here.

[0082] In one embodiment, the device 1 further includes:

[0083] The rule generation module is used to receive statement rule configuration information and generate preset splitting rules based on the statement rule configuration information.

[0084] In one embodiment, the splitting module 12 includes:

[0085] The rule confirmation unit is used to confirm the splitting keywords and the data types corresponding to different splitting keywords according to the preset splitting rules.

[0086] The positioning and splitting unit is used to identify the position of the splitting keyword in the complex SQL statement and split the complex SQL statement into multiple clauses based on the position;

[0087] The structured generation unit is used to determine the data type of each clause based on the splitting keywords of each clause, and to obtain the corresponding structured data by combining the relationships between the clauses.

[0088] In one embodiment, the splitting keywords include field keywords and table keywords.

[0089] In one embodiment, the structure generation unit includes:

[0090] The clause type confirmation unit is used to confirm whether the splitting key of each clause is a field key or a table key, and to obtain the data type of each clause;

[0091] The information acquisition unit is used to acquire field information and table information in the complex SQL statement according to the data type of each clause;

[0092] The generation unit is used to generate corresponding structured data based on the field information, table information, and the relationship between each clause.

[0093] In one embodiment, the visualization generation module 13 includes:

[0094] The classification and aggregation unit is used to classify and aggregate the clauses in the structured data according to the data type, so as to obtain several association tables and the fields contained in each association table;

[0095] The guidance addition unit is used to add data guidance identifiers to each associated table based on the relationship between each field in each associated table and other associated tables, and then generate the visualization page.

[0096] In one embodiment, the device 1 further includes:

[0097] The map generation unit is used to generate corresponding data maps by retrieving metadata from the data warehouse based on the data types and data associations in the structured data.

[0098] Another embodiment of the present invention provides a visualization system for complex SQL statements, such as... Figure 6 As shown, system 10 includes:

[0099] One or more processors 110 and memory 120, Figure 6 The following description uses a processor 110 as an example. The processor 110 and the memory 120 can be connected via a bus or other means. Figure 6 Taking the example of a connection between China and Israel via a bus.

[0100] Processor 110 is used to perform various control logics of system 10, and can be a general-purpose processor, digital signal processor (DSP), application-specific integrated circuit (ASIC), field-programmable gate array (FPGA), microcontroller, ARM (Acorn RISC Machine) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination of these components. Furthermore, processor 110 can also be any conventional processor, microprocessor, or state machine. Processor 110 can also be implemented as a combination of computing devices, such as a combination of DSP and microprocessor, multiple microprocessors, one or more microprocessors combined with DSP and / or any other such configuration.

[0101] The memory 120, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as the program instructions corresponding to the visualization method for complex SQL statements in the embodiments of the present invention. The processor 110 executes various functional applications and data processing of the system 10 by running the non-volatile software programs, instructions, and units stored in the memory 120, thereby implementing the visualization method for complex SQL statements in the above method embodiments.

[0102] The memory 120 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created according to the use of the system 10. Furthermore, the memory 120 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 120 may optionally include memory remotely located relative to the processor 110, and these remote memories may be connected to the system 10 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0103] One or more units are stored in memory 120, and when executed by one or more processors 110, perform the following steps:

[0104] Retrieve complex SQL statements to be processed;

[0105] The complex SQL statement is structurally split according to preset splitting rules to obtain the corresponding structured data;

[0106] A visualization page is generated based on the data types and data relationships in the structured data;

[0107] The visualization page is displayed on the interface to show the data structure of the complex SQL statement.

[0108] In one embodiment, before performing structural splitting of the complex SQL statement according to preset splitting rules to obtain the corresponding structured data, the method further includes:

[0109] Receive statement rule configuration information and generate preset splitting rules based on the statement rule configuration information.

[0110] In one embodiment, the step of structurally splitting the complex SQL statement according to a preset splitting rule to obtain the corresponding structured data includes:

[0111] Determine the splitting keywords and the data types corresponding to different splitting keywords according to the preset splitting rules;

[0112] In the complex SQL statement, identify the position of the splitting keyword, and split the complex SQL statement into multiple clauses based on the position;

[0113] The data type of each clause is determined by the splitting keywords of each clause, and the corresponding structured data is obtained by combining the relationships between the clauses.

[0114] In one embodiment, the splitting keywords include field keywords and table keywords.

[0115] In one embodiment, the step of determining the data type of each clause based on the splitting keywords of each clause, and obtaining the corresponding structured data by combining the relationships between the clauses, includes:

[0116] Confirm that the splitting key for each clause is a field key or a table key, and obtain the data type of each clause;

[0117] Obtain field and table information from the complex SQL statement based on the data type of each clause;

[0118] Based on the field information, table information, and the relationships between each clause, corresponding structured data is generated.

[0119] In one embodiment, generating a visualization page based on the data types and data relationships in the structured data includes:

[0120] The clauses in the structured data are classified and clustered according to the data type to obtain several association tables and the fields contained in each association table;

[0121] Based on the relationships between each field in each associated table and other associated tables, data guidance identifiers are added to each associated table before generating the visualization page.

[0122] In one embodiment, after generating the visualization page based on the data types and data relationships in the structured data, the method further includes:

[0123] Based on the data types and data relationships in the structured data, the corresponding data graph is generated by retrieving metadata from the data warehouse.

[0124] This invention provides a non-volatile computer-readable storage medium storing computer-executable instructions that are executed by one or more processors, for example, to perform the operations described above. Figure 1 Method steps S100 to S400.

[0125] As examples, non-volatile storage media can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) as external cache memory. By way of illustration and not limitation, RAM can be obtained in many forms such as synchronous RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), Synchlink DRAM (SLDRAM), and direct Rambus RAM (DRRAM). The memory components or memories disclosed in the operating environment described herein are intended to include one or more of these and / or any other suitable types of memory.

[0126] In summary, the present invention discloses a method, apparatus, system, and medium for visualizing complex SQL statements. The method involves acquiring a complex SQL statement to be processed; structurally decomposing the complex SQL statement according to preset decomposition rules to obtain corresponding structured data; generating a visualization page based on the data types and data relationships in the structured data; and displaying the visualization page on a display interface to show the data structure of the complex SQL statement. By structurally decomposing the complex SQL statement according to preset decomposition rules, a visualization page that intuitively displays data types and data relationships can be generated based on the structured data obtained from the decomposition. This allows developers to quickly and intuitively understand the data structure of complex SQL statements, achieving a visual display of complex SQL statements and reducing development and maintenance costs.

[0127] Of course, those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware (such as a processor, controller, etc.). The computer program can be stored in a non-volatile, computer-readable storage medium, and when executed, it can include the processes described in the above method embodiments. The storage medium can be a memory, magnetic disk, floppy disk, flash memory, optical storage, etc.

[0128] It should be understood that the application of the present invention is not limited to the examples above. Those skilled in the art can make improvements or modifications based on the above description, and all such improvements and modifications should fall within the protection scope of the appended claims.

Claims

1. A method for visualizing complex SQL statements, characterized in that, include: Retrieve complex SQL statements to be processed; The complex SQL statement is structurally split according to preset splitting rules to obtain the corresponding structured data; A visualization page is generated based on the data types and data relationships in the structured data; The visualization page is displayed on the display interface to show the data structure of the complex SQL statement; The step of structurally splitting the complex SQL statement according to preset splitting rules to obtain corresponding structured data includes: Determine the splitting keywords and the data types corresponding to different splitting keywords according to the preset splitting rules; In the complex SQL statement, identify the position of the splitting keyword, and split the complex SQL statement into multiple clauses based on the position; The data type of each clause is determined by the splitting keywords of each clause, and the corresponding structured data is obtained by combining the relationships between the clauses. The step of generating a visualization page based on the data types and data relationships in the structured data includes: The clauses in the structured data are classified and clustered according to the data type. Fields belonging to the same table are classified and clustered in a visualization element. Several visualization elements of related tables and the fields contained in each related table are obtained by table. Based on the relationships between each field in each associated table and other associated tables, data guidance identifiers are added to the visualization elements of each associated table to generate the visualization page. The data guidance identifier is a single-line arrow with a data source indication.

2. The visualization method for complex SQL statements according to claim 1, characterized in that, Before performing structural splitting on the complex SQL statement according to preset splitting rules to obtain the corresponding structured data, the method further includes: Receive statement rule configuration information and generate preset splitting rules based on the statement rule configuration information.

3. The visualization method for complex SQL statements according to claim 1, characterized in that, The splitting keywords include field keywords and table keywords.

4. The visualization method for complex SQL statements according to claim 3, characterized in that, The process involves determining the data type of each clause based on its splitting keywords, and then combining this with the relationships between the clauses to obtain the corresponding structured data, including: Confirm that the splitting key for each clause is a field key or a table key, and obtain the data type of each clause; Obtain field and table information from the complex SQL statement based on the data type of each clause; Based on the field information, table information, and the relationships between each clause, corresponding structured data is generated.

5. The visualization method for complex SQL statements according to claim 1, characterized in that, After generating the visualization page based on the data types and data relationships in the structured data, the method further includes: Based on the data types and data relationships in the structured data, the corresponding data graph is generated by retrieving metadata from the data warehouse.

6. A visualization device for complex SQL statements, characterized in that, include: The acquisition module is used to acquire complex SQL statements to be processed. The splitting module is used to structurally split the complex SQL statement according to preset splitting rules to obtain the corresponding structured data; A visualization generation module is used to generate visualization pages based on the data types and data relationships in the structured data; The display module is used to display the visualization page on the display interface to show the data structure of the complex SQL statement; The splitting module includes: The rule confirmation unit is used to confirm the splitting keywords and the data types corresponding to different splitting keywords according to the preset splitting rules. The positioning and splitting unit is used to identify the position of the splitting keyword in the complex SQL statement and split the complex SQL statement into multiple clauses based on the position; The structured generation unit is used to determine the data type of each clause based on the splitting keywords of each clause, and to obtain the corresponding structured data by combining the relationships between the clauses. The visualization generation module includes: The classification and aggregation unit is used to classify and aggregate clauses in the structured data according to the data type, and to classify and aggregate fields belonging to the same table into a visualization element, thereby obtaining visualization elements of several related tables and the fields contained in each related table by table. The guidance addition unit is used to add data guidance identifiers to the visualization elements of each associated table according to the relationship between each field in each associated table and other associated tables, and then generate the visualization page. The data guidance identifier is an identifier with a single-line arrow that indicates the data source.

7. A visualization system for complex SQL statements, characterized in that, The system includes at least one processor; and, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the visualization method for complex SQL statements as described in any one of claims 1-5.

8. A non-volatile computer-readable storage medium, characterized in that, The non-volatile computer-readable storage medium stores computer-executable instructions that, when executed by one or more processors, cause the one or more processors to perform the visualization method for complex SQL statements as described in any one of claims 1-5.

Citation Information

Patent Citations

  • Structured query language statement visualization method and device

    CN110874367A