Table relationship visualization method, device, electronic device and storage medium

By generating and parsing source code query statements, the table relationship diagram is automatically generated, which solves the problem in the existing technology that the table visualization E-R diagram cannot be automatically generated, and realizes the visualization of table correlation relationships.

CN112597171BActive Publication Date: 2024-08-27PING AN BANK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011645089.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-31
Publication Date
2024-08-27
Estimated Expiration
2040-12-31

AI Technical Summary

Technical Problem

Existing technology cannot automatically generate visual E-R diagrams between tables, especially in the absence of primary and foreign key relationships.

Method used

Generate the configuration file of the default database by obtaining the original framework, simulate the connection and store the source code query statement, use the query statement parser to parse the table association relationship, and generate the table relationship diagram.

Benefits of technology

The association between tables can be automatically generated without the need for primary and foreign key relationships between tables, realizing the visualization of table relationships.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112597171B
    Figure CN112597171B
Patent Text Reader

Abstract

The present invention relates to data display technology, and discloses a table relationship visualization method, including: obtaining an original framework, and using the original framework to generate a configuration file of a table in a preset database, wherein the configuration file includes a source code query statement, simulating a connection to the original framework, and storing the source code query statement in the cache of the original framework, parsing the source code query statement using a preset query statement parser to obtain a table association relationship, and generating a preset format file based on the table association relationship, parsing the preset format file to obtain a table relationship diagram. In addition, the present invention also relates to blockchain technology, and the table relationship diagram can be stored in a node of a blockchain. The present invention also proposes a table relationship visualization device, an electronic device, and a computer-readable storage medium. The present invention can solve the problem that a visualized E-R diagram cannot be automatically generated between tables.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data display technology, and in particular to a table relationship visualization method, device, electronic device and computer-readable storage medium. Background Art

[0002] In the context of big data, the scale of data has expanded dramatically, the data forms have become more diverse, and the requirements for data applications have also increased day by day, which has brought huge challenges to traditional database technology. Data is generally stored in tables in the database. However, the relationship between tables is complex. Many tables are tabular data of the upstream system, and the data is unloaded to the downstream system through Hadoop. Under the existing technology, in order to represent the relationship between tables, ER diagram (Entity Relationship Diagram) is used for display. However, the main ER diagram automatic generation tools on the market are all automatically generated using client tools, which requires the database's own tables to have primary and foreign key relationships, or the foreign key relationships between tables can be manually specified. The disadvantage of the existing technology is that there is no primary and foreign key relationship between tables in many scenarios, and there is no method on the market to dynamically generate visual ER diagrams based on SQL in the source code. Summary of the invention

[0003] The present invention provides a table relationship visualization method, device and computer-readable storage medium, the main purpose of which is to solve the problem that a visualized ER diagram cannot be automatically generated between tables.

[0004] To achieve the above object, the present invention provides a table relationship visualization method, comprising:

[0005] Obtaining an original framework, and using the original framework to generate a configuration file of a table in a preset database, wherein the configuration file includes a source code query statement;

[0006] Simulate the connection to the original framework, and store the source code query statement in the cache of the original framework;

[0007] Utilizing a preset query statement parser to parse the source code query statement to obtain a table association relationship, and generating a preset format file according to the table association relationship;

[0008] The preset format file is parsed to obtain a table relationship diagram.

[0009] Optionally, the step of generating a configuration file of a table in a preset database by using the original framework includes:

[0010] Associating the original framework with the preset database according to a preset business scenario;

[0011] A preset software system is used to extract source code query statements associated with the original framework and the preset database in the business scenario, and the source code query statements are summarized to obtain the configuration file.

[0012] Optionally, the simulating connection to the original framework and storing the source code query statement in a cache of the original framework includes:

[0013] Obtain a preset embedded database, and simulate the connection between the original framework and the embedded database;

[0014] The preset file package in the original framework is called, the simulation call is completed according to the preset file package, and all source code query statements in the configuration file are stored in the cache.

[0015] Optionally, the using a preset query statement parser to parse the source code query statement to obtain a table association relationship includes:

[0016] Parsing the source code query statement into multiple query statement categories using a preset query statement interpreter;

[0017] The fields under the query statement category are extracted, and the table association relationship is determined according to the fields.

[0018] Optionally, extracting fields under the query statement category and determining the table association relationship according to the fields includes:

[0019] Using a preset language processing algorithm to perform word segmentation on the field and remove stop words to obtain key fields;

[0020] The table association relationship is obtained according to the preset association condition rules and the key fields.

[0021] Optionally, parsing the preset format file to obtain a table relationship diagram includes:

[0022] Converting the preset format file into a development format using the original framework;

[0023] The development format is converted into a table relationship diagram using a preset language protocol.

[0024] Optionally, the converting the development format into a table relationship diagram using a preset language protocol includes:

[0025] Extracting the table corresponding to the table association relationship by using the preset language protocol;

[0026] The table is used as an entity, attributes are determined according to the type of the table, and the table association relationship is used as a relationship to generate the table relationship graph.

[0027] In order to solve the above problem, the present invention further provides a table relationship visualization device, the device comprising:

[0028] A table configuration module, used to obtain an original framework and generate a configuration file of a table in a preset database using the original framework, wherein the configuration file includes a source code query statement;

[0029] A simulation connection module, used for performing a simulation connection on the original framework and storing the source code query statement in the cache of the original framework;

[0030] A statement parsing module, used to parse the source code query statement using a preset query statement parser to obtain a table association relationship, and generate a preset format file according to the table association relationship;

[0031] The relationship diagram generation module is used to parse the preset format file to obtain a table relationship diagram.

[0032] In order to solve the above problem, the present invention further provides an electronic device, the electronic device comprising:

[0033] a memory storing at least one instruction; and

[0034] The processor executes the instructions stored in the memory to implement the above-mentioned table relationship visualization method.

[0035] In order to solve the above problem, the present invention also provides a computer-readable storage medium, in which at least one instruction is stored. The at least one instruction is executed by a processor in an electronic device to implement the above-mentioned table relationship visualization method.

[0036] The present invention uses the original framework to generate a configuration file of a table in a preset database, simulates the connection of the original framework, and stores the source code query statement in the cache of the original framework. At the same time, the source code query statement is parsed by a preset query statement parser to obtain the table association relationship. There is no need for a primary and foreign key relationship between tables. The association relationship between tables can be directly obtained based on the source code query statement, and then the table is visualized according to the association relationship. Therefore, the table relationship visualization method, device, electronic device and computer-readable storage medium proposed by the present invention can solve the problem that a visualized ER diagram cannot be automatically generated between tables. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 A schematic diagram of a process flow of a table relationship visualization method provided by an embodiment of the present invention;

[0038] Figure 2 for Figure 1 A detailed implementation flow chart of one of the steps in the process;

[0039] Figure 3 for Figure 1 A detailed implementation flow diagram of another step in FIG.

[0040] Figure 4 for Figure 1 A detailed implementation flow diagram of another step in FIG.

[0041] Figure 5 for Figure 1 A detailed implementation flow diagram of another step in FIG.

[0042] Figure 6 A functional module diagram of a table relationship visualization device provided by an embodiment of the present invention;

[0043] Figure 7 A schematic diagram of the structure of an electronic device for implementing the table relationship visualization method provided by an embodiment of the present invention.

[0044] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0045] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0046] The embodiment of the present application provides a table relationship visualization method. The execution subject of the table relationship visualization method includes but is not limited to at least one of the electronic devices such as a server, a terminal, etc. that can be configured to execute the method provided by the embodiment of the present application. In other words, the table relationship visualization method can be executed by software or hardware installed on a terminal device or a server device, and the software can be a blockchain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, etc.

[0047] Reference Figure 1 FIG. 1 is a flow chart of a table relationship visualization method provided by an embodiment of the present invention. In this embodiment, the table relationship visualization method includes:

[0048] S1. Obtain an original framework, and use the original framework to generate a configuration file of a table in a preset database, wherein the configuration file includes a source code query statement.

[0049] In an embodiment of the present invention, the original framework may be a Mybatis framework, which is a persistence layer framework that supports customized query statements (SQL), stored procedures, and advanced mappings, etc. The preset database may be a relational database such as Oracle, SQL Server, etc. The table may be a table that stores any data. For example, in a banking business scenario, the table includes: a user information table, a salesperson's notes table, an agent's activity organization approval table, a morning and evening meeting theme table, a questionnaire master table, a questionnaire level table, a questionnaire question configuration table, and a questionnaire answer configuration table, etc.

[0050] Reference Figure 2 As shown, in one embodiment of the present invention, the configuration file of the table in the preset database is generated by using the original framework, including:

[0051] S10, associating the original framework with the preset database according to a preset business scenario;

[0052] S11. Utilizing a preset software system, extracting source code query statements associated with the original framework and the preset database in the business scenario, and summarizing the source code query statements to obtain the configuration file.

[0053] The preset software system may be a JAVA software system, which will call different databases in various business scenarios, and each business scenario will have different source code query statements. The source code query statement may be an SQL statement, which allows the user to concisely declare the required business logic. SQL is a set language, and only needs to express the requirements clearly without understanding the specific practices. SQL can be optimized, with multiple query optimizers built in, and multiple query optimizers can translate the optimal execution plan for SQL.

[0054] In detail, the configuration file can be a file in xml (eXtensible Markup Language) format. The xml format is a simple data storage structure. The simplicity of the xml format makes it easy to read and write data in any application, which makes xml quickly become the only common language for data exchange. Different application software supports this xml data exchange format, which means that the program can more easily combine with information generated under Windows, Mac OS, Linux and other platforms, and then it can easily load xml data into the program and analyze it, and output the results in xml format. For example, the JAVA software system assembles SQL statements in different business scenarios into a configuration file mybatis.xml.

[0055] The present invention generates the configuration file, which is convenient for parsing and transmission, and reduces the occupation of computer resources.

[0056] S2. Simulate the connection with the original framework and store the source code query statement in the cache of the original framework.

[0057] For details, refer to Figure 3 As shown, the S2 includes:

[0058] S20, obtaining a preset embedded database, and simulating a connection between the original framework and the embedded database;

[0059] S21, calling the preset file package in the original framework, completing the simulation call according to the preset file package, and storing all source code query statements in the configuration file in the cache.

[0060] Among them, the preset embedded database can be an H2 database, which is a relational database written in Java. It can be embedded in a Java application or run as a separate database server. H2 has the following three main uses: the first use, which is also the most commonly used use, is that it can be packaged and released together with different applications, so that a small amount of structured data can be stored very conveniently; the second use is for unit testing. The startup speed is fast, and the persistence function can be turned off. Each use case is restored to its initial state immediately after execution. The third use is as a cache, that is, as an in-memory database, caching some data that does not change frequently but needs to be accessed frequently, such as dictionary tables and permission tables. In an embodiment of the present invention, in order to execute the source code query statement in the configuration file, a local database (i.e., H2 database) needs to be connected, and the H2 database can be an empty .db file. The preset file package can be the corresponding JAR (Java ARchive) file package in the original framework. The JAR file package is based on the popular ZIP file format. Unlike ZIP files, JAR file packages are not only used for compression and publishing, but also for deployment and packaging of libraries, components and plug-ins, and can be called directly.

[0061] Furthermore, the present invention implements the method of simulating the connection of the original framework and storing the source code query statement in the cache of the original framework without storing it in a relational database, thereby greatly reducing the occupation of storage space.

[0062] S3. parse the source code query statement using a preset query statement parser to obtain a table association relationship, and generate a preset format file according to the table association relationship.

[0063] In an embodiment of the present invention, the preset format may be a JSON (JavaScript Object Notation) format, and the table association relationship may be converted into data in a JSON format by calling a format conversion function in a JavaScript library (such as a jQuery library), and all data in a JSON format may be aggregated to obtain the preset format file. The JSON format is a lightweight data exchange format that uses a text format that is completely independent of a programming language to store and represent data, is easy for humans to read and write, and is also easy for machines to parse and generate, and effectively improves network transmission efficiency. In an embodiment of the present invention, the JSON format file may be {"id1":"sql1","id2":"sql2","id3":"sql3"...}.

[0064] For details, refer to Figure 4 As shown, the source code query statement is parsed by a preset query statement parser to obtain a table association relationship, including:

[0065] S30, parsing the source code query statement into multiple query statement categories using a preset query statement interpreter;

[0066] S31, extracting fields under the query statement category, and determining the table association relationship according to the fields.

[0067] Wherein, the preset query statement interpreter can be a Jsqlparser interpreter, and the Jsqlparser interpreter can parse different source code query statements into corresponding categories. For example, the query SQL will be parsed into a query class (select). The query class includes table name, field name and query function, etc.

[0068] Furthermore, extracting the fields under the query statement category and determining the table association relationship according to the fields includes:

[0069] Using a preset language processing algorithm to perform word segmentation on the field and remove stop words to obtain key fields;

[0070] The table association relationship is obtained according to the preset association condition rules and the key fields.

[0071] Among them, the preset language processing algorithm in the embodiment of the present invention can be the currently disclosed TextRank, a semantic-based keyword extraction algorithm, etc. The preset association condition rule refers to an artificially set rule for establishing different association relationships for different key fields. For example, if the key field obtained under table A is a, and the key field obtained under table B is a, then an association relationship is established: field a of table A = field a of table B.

[0072] The embodiment of the present invention can quickly parse out the table association relationship by parsing the source code query statement using the preset query statement parser.

[0073] S4. Parse the preset format file to obtain a table relationship diagram.

[0074] Reference Figure 5 As shown, in the embodiment of the present invention, the preset format file is parsed to obtain a table relationship diagram, including:

[0075] S40, using the original framework to convert the preset format file into a development format;

[0076] S41, converting the development format into a table relationship diagram using a preset language protocol.

[0077] The development format may be vue.js. The preset language protocol may be Hyper Text Markup Language (HTML). The development format uses a template syntax based on HTML to render the table association relationship. The table relationship diagram may be directly displayed in a browser using HTML.

[0078] Furthermore, the use of a preset language protocol to convert the development format into a table relationship diagram includes:

[0079] Extracting the table corresponding to the table association relationship by using the preset language protocol;

[0080] The table is used as an entity, attributes are determined according to the type of the table, and the table association relationship is used as a relationship to generate the table relationship graph.

[0081] The table relationship diagram may be an ER diagram (Entity Relationship Diagram), which is used to describe table requirements or the type of table to be stored in the database. The ER diagram mainly includes entities, attributes, and associations. For example, if table A and table B have an association relationship and the types of table A and table B are information tables, then in the table relationship diagram, table A and table B are entities, and the information table is an attribute, and they are connected by a line representing the association relationship.

[0082] Furthermore, in actual business system development, various data are generally stored in the database in the form of tables, and each table and its attributes and the relationship between each table represent the data structure in the actual business system. The embodiment of the present invention can fully reflect the data structure relationship through the table relationship diagram, and can also reflect the association relationship between each table.

[0083] The present invention uses the original framework to generate a configuration file of a table in a preset database, simulates the connection of the original framework, and stores the source code query statement in the cache of the original framework. At the same time, the source code query statement is parsed by a preset query statement parser to obtain the table association relationship. There is no need for a primary and foreign key relationship between tables. The association relationship between tables can be directly obtained based on the source code query statement, and then the table is visualized according to the association relationship. Therefore, the implementation of the present invention can solve the problem that a visualized ER diagram cannot be automatically generated between tables.

[0084] like Figure 6 , which is a functional module diagram of a table relationship visualization device provided by an embodiment of the present invention.

[0085] The table relationship visualization device 100 of the present invention can be installed in an electronic device. According to the functions to be implemented, the table relationship visualization device 100 can include a table configuration module 101, a simulation connection module 102, a statement parsing module 103 and a relationship diagram generation module 104. The module of the present invention can also be called a unit, which refers to a series of computer program segments that can be executed by an electronic device processor and can complete fixed functions, which are stored in the memory of the electronic device.

[0086] In this embodiment, the functions of each module / unit are as follows:

[0087] The table configuration module 101 is used to obtain an original framework and generate a configuration file of a table in a preset database using the original framework, wherein the configuration file includes a source code query statement.

[0088] In an embodiment of the present invention, the original framework may be a Mybatis framework, which is a persistence layer framework that supports customized query statements (SQL), stored procedures, and advanced mappings, etc. The preset database may be a relational database such as Oracle, SQL Server, etc. The table may be a table that stores any data. For example, in a banking business scenario, the table includes: a user information table, a salesperson's notes table, an agent's activity organization approval table, a morning and evening meeting theme table, a questionnaire master table, a questionnaire level table, a questionnaire question configuration table, and a questionnaire answer configuration table, etc.

[0089] Preferably, the table configuration module 101 generates a configuration file of a table in a preset database using the original framework through the following operations:

[0090] Associating the original framework with the preset database according to a preset business scenario;

[0091] A preset software system is used to extract source code query statements associated with the original framework and the preset database in the business scenario, and the source code query statements are summarized to obtain the configuration file.

[0092] The preset software system may be a JAVA software system, which will call different databases in various business scenarios, and each business scenario will have different source code query statements. The source code query statement may be an SQL statement, which allows the user to concisely declare the required business logic. SQL is a set language, and only needs to express the requirements clearly without understanding the specific practices. SQL can be optimized, with multiple query optimizers built in, and multiple query optimizers can translate the optimal execution plan for SQL.

[0093] In detail, the configuration file can be a file in xml (eXtensible Markup Language) format. The xml format is a simple data storage structure. The simplicity of the xml format makes it easy to read and write data in any application, which makes xml quickly become the only common language for data exchange. Different application software supports this xml data exchange format, which means that the program can more easily combine with information generated under Windows, Mac OS, Linux and other platforms, and then it can easily load xml data into the program and analyze it, and output the results in xml format. For example, the JAVA software system assembles SQL statements in different business scenarios into a configuration file mybatis.xml.

[0094] The present invention generates the configuration file, which is convenient for parsing and transmission, and reduces the occupation of computer resources.

[0095] The simulated connection module 102 is used to simulate the connection with the original framework and store the source code query statement in the cache of the original framework.

[0096] Preferably, the simulation connection module 102 performs simulation connection on the original frame and stores the source code query statement in the cache of the original frame through the following operations:

[0097] Obtain a preset embedded database, and simulate the connection between the original framework and the embedded database;

[0098] The preset file package in the original framework is called, the simulation call is completed according to the preset file package, and all source code query statements in the configuration file are stored in the cache.

[0099] Among them, the preset embedded database can be an H2 database, which is a relational database written in Java. It can be embedded in a Java application or run as a separate database server. H2 has the following three main uses: the first use, which is also the most commonly used use, is that it can be packaged and released together with different applications, so that a small amount of structured data can be stored very conveniently; the second use is for unit testing. The startup speed is fast, and the persistence function can be turned off. Each use case is restored to its initial state immediately after execution. The third use is as a cache, that is, as an in-memory database, caching some data that does not change frequently but needs to be accessed frequently, such as dictionary tables and permission tables. In an embodiment of the present invention, in order to execute the source code query statement in the configuration file, a local database (i.e., H2 database) needs to be connected, and the H2 database can be an empty .db file. The preset file package can be the corresponding JAR (Java ARchive) file package in the original framework. The JAR file package is based on the popular ZIP file format. Unlike ZIP files, JAR file packages are not only used for compression and publishing, but also for deployment and packaging of libraries, components and plug-ins, and can be called directly.

[0100] Furthermore, the present invention implements the method of simulating the connection of the original framework and storing the source code query statement in the cache of the original framework without storing it in a relational database, thereby greatly reducing the occupation of storage space.

[0101] The statement parsing module 103 is used to parse the source code query statement using a preset query statement parser to obtain a table association relationship, and generate a preset format file according to the table association relationship.

[0102] In an embodiment of the present invention, the preset format may be a JSON (JavaScript Object Notation) format, and the table association relationship may be converted into data in a JSON format by calling a format conversion function in a JavaScript library (such as a jQuery library), and all data in a JSON format may be aggregated to obtain the preset format file. The JSON format is a lightweight data exchange format that uses a text format that is completely independent of a programming language to store and represent data, is easy for humans to read and write, and is also easy for machines to parse and generate, and effectively improves network transmission efficiency. In an embodiment of the present invention, the JSON format file may be {"id1":"sql1","id2":"sql2","id3":"sql3"...}.

[0103] Preferably, the statement parsing module 103 obtains the table association relationship through the following operations:

[0104] Parsing the source code query statement into multiple query statement categories using a preset query statement interpreter;

[0105] The fields under the query statement category are extracted, and the table association relationship is determined according to the fields.

[0106] Wherein, the preset query statement interpreter can be a Jsqlparser interpreter, and the Jsqlparser interpreter can parse different source code query statements into corresponding categories. For example, the query SQL will be parsed into a query class (select). The query class includes table name, field name and query function, etc.

[0107] Furthermore, the statement parsing module 103 extracts the fields under the query statement category through the following operations, and determines the table association relationship according to the fields:

[0108] Using a preset language processing algorithm to perform word segmentation on the field and remove stop words to obtain key fields;

[0109] The table association relationship is obtained according to the preset association condition rules and the key fields.

[0110] Among them, the preset language processing algorithm in the embodiment of the present invention can be the currently disclosed TextRank, a semantic-based keyword extraction algorithm, etc. The preset association condition rule refers to an artificially set rule for establishing different association relationships for different key fields. For example, if the key field obtained under table A is a, and the key field obtained under table B is a, then an association relationship is established: field a of table A = field a of table B.

[0111] The embodiment of the present invention can quickly parse out the table association relationship by parsing the source code query statement using the preset query statement parser.

[0112] The relationship diagram generating module 104 is used to parse the preset format file to obtain a table relationship diagram.

[0113] Preferably, the relationship diagram generation module 104 parses the preset format file through the following operations to obtain a table relationship diagram:

[0114] Converting the preset format file into a development format using the original framework;

[0115] The development format is converted into a table relationship diagram using a preset language protocol.

[0116] The development format may be vue.js. The preset language protocol may be Hyper Text Markup Language (HTML). The development format uses a template syntax based on HTML to render the table association relationship. The table relationship diagram may be directly displayed in a browser using HTML.

[0117] Furthermore, the relationship diagram generation module 104 converts the development format into a table relationship diagram using a preset language protocol through the following operations:

[0118] Extracting the table corresponding to the table association relationship by using the preset language protocol;

[0119] The table is used as an entity, attributes are determined according to the type of the table, and the table association relationship is used as a relationship to generate the table relationship graph.

[0120] The table relationship diagram may be an ER diagram (Entity Relationship Diagram), which is used to describe table requirements or the type of table to be stored in the database. The ER diagram mainly includes entities, attributes, and associations. For example, if table A and table B have an association relationship and the types of table A and table B are information tables, then in the table relationship diagram, table A and table B are entities, and the information table is an attribute, and they are connected by a line representing the association relationship.

[0121] Furthermore, in actual business system development, various data are generally stored in the database in the form of tables, and each table and its attributes and the relationship between each table represent the data structure in the actual business system. The embodiment of the present invention can fully reflect the data structure relationship through the table relationship diagram, and can also reflect the association relationship between each table.

[0122] like Figure 7 FIG. 1 is a schematic diagram of the structure of an electronic device for implementing a table relationship visualization method provided by an embodiment of the present invention.

[0123] The electronic device 1 may include a processor 10 , a memory 11 , and a bus, and may also include a computer program stored in the memory 11 and executable on the processor 10 , such as a table relationship visualization program 12 .

[0124] The memory 11 includes at least one type of readable storage medium, and the readable storage medium includes a flash memory, a mobile hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a magnetic memory, a disk, an optical disk, etc. The memory 11 may be an internal storage unit of the electronic device 1 in some embodiments, such as a mobile hard disk of the electronic device 1. The memory 11 may also be an external storage device of the electronic device 1 in other embodiments, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device 1. Further, the memory 11 may also include both an internal storage unit of the electronic device 1 and an external storage device. The memory 11 may not only be used to store application software and various types of data installed in the electronic device 1, such as the code of the table relationship visualization program 12, etc., but may also be used to temporarily store data that has been output or is to be output.

[0125] The processor 10 may be composed of an integrated circuit in some embodiments, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and combinations of various control chips, etc. The processor 10 is the control core (Control Unit) of the electronic device, and uses various interfaces and lines to connect various components of the entire electronic device, and executes or executes programs or modules (such as table relationship visualization programs, etc.) stored in the memory 11, and calls data stored in the memory 11 to execute various functions of the electronic device 1 and process data.

[0126] The bus may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is configured to realize connection and communication between the memory 11 and at least one processor 10, etc.

[0127] Figure 7 Only an electronic device with components is shown, and those skilled in the art will understand that Figure 7 The structure shown does not constitute a limitation on the electronic device 1, and may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.

[0128] For example, although not shown, the electronic device 1 may also include a power source (such as a battery) for supplying power to each component. Preferably, the power source may be logically connected to the at least one processor 10 through a power management device, so that the power management device can realize functions such as charging management, discharging management, and power consumption management. The power source may also include any components such as one or more DC or AC power sources, recharging devices, power failure detection circuits, power converters or inverters, power status indicators, etc. The electronic device 1 may also include a variety of sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.

[0129] Furthermore, the electronic device 1 may also include a network interface. Optionally, the network interface may include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is generally used to establish a communication connection between the electronic device 1 and other electronic devices.

[0130] Optionally, the electronic device 1 may further include a user interface, which may be a display, an input unit (such as a keyboard), or a standard wired interface or a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED (Organic Light-Emitting Diode) touch device. The display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device 1 and to display a visual user interface.

[0131] It should be understood that the embodiment is for illustration only and the scope of the patent application is not limited to this structure.

[0132] The table relationship visualization program 12 stored in the memory 11 in the electronic device 1 is a combination of multiple instructions. When running in the processor 10, it can achieve:

[0133] Obtaining an original framework, and using the original framework to generate a configuration file of a table in a preset database, wherein the configuration file includes a source code query statement;

[0134] Simulate the connection to the original framework, and store the source code query statement in the cache of the original framework;

[0135] Utilizing a preset query statement parser to parse the source code query statement to obtain a table association relationship, and generating a preset format file according to the table association relationship;

[0136] The preset format file is parsed to obtain a table relationship diagram.

[0137] Specifically, the specific implementation method of the processor 10 for the above instructions can refer to Figures 1 to 5 The description of the relevant steps in the corresponding embodiments will not be repeated here.

[0138] Furthermore, if the module / unit integrated in the electronic device 1 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. The computer-readable storage medium can be volatile or non-volatile. For example, the computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, and a read-only memory (ROM).

[0139] The present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor of an electronic device, the computer program can implement:

[0140] Obtaining an original framework, and using the original framework to generate a configuration file of a table in a preset database, wherein the configuration file includes a source code query statement;

[0141] Simulate the connection to the original framework, and store the source code query statement in the cache of the original framework;

[0142] Utilizing a preset query statement parser to parse the source code query statement to obtain a table association relationship, and generating a preset format file according to the table association relationship;

[0143] The preset format file is parsed to obtain a table relationship diagram.

[0144] In the several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.

[0145] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0146] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional modules.

[0147] It is obvious to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.

[0148] Therefore, no matter from which point of view, the embodiments should be regarded as illustrative and non-restrictive, and the scope of the present invention is limited by the appended claims rather than the above description, so it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any attached figure mark in the claims should not be regarded as limiting the claims involved.

[0149] The blockchain referred to in this invention is a new application mode of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.

[0150] In addition, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in the system claim can also be implemented by one unit or device through software or hardware. The second and other words are used to indicate names, but not to indicate any particular order.

[0151] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention.

Claims

1. A table relationship visualization method, It is characterized in that The method comprises: Acquire an original framework, associate the original framework with a preset database according to a preset business scenario, extract source code query statements that associate the original framework with the preset database under the business scenario using a preset software system, and aggregate the source code query statements to obtain a configuration file; Obtain a preset embedded database, simulate the connection between the original framework and the embedded database, call the preset file package in the original framework, complete the simulated call according to the preset file package, and store all source code query statements in the configuration file into the cache of the original framework, wherein the preset embedded database is an empty local database; Parsing the source code query statement into multiple query statement categories using a preset query statement interpreter, extracting fields under the query statement category, determining table association relationships according to the fields, and generating a preset format file according to the table association relationships; The preset format file is parsed to obtain a table relationship diagram.

2. The table relationship visualization method according to claim 1, It is characterized in that The extracting the fields under the query statement category and determining the table association relationship according to the fields includes: Using a preset language processing algorithm to perform word segmentation on the field and remove stop words to obtain key fields; The table association relationship is obtained according to the preset association condition rules and the key fields.

3. The table relationship visualization method according to claim 1, It is characterized in that The step of parsing the preset format file to obtain a table relationship diagram includes: Converting the preset format file into a development format using the original framework; The development format is converted into a table relationship diagram using a preset language protocol.

4. The table relationship visualization method according to claim 3, It is characterized in that The method of converting the development format into a table relationship diagram using a preset language protocol includes: Extracting the table corresponding to the table association relationship by using the preset language protocol; The table is used as an entity, attributes are determined according to the type of the table, and the table association relationship is used as a relationship to generate the table relationship graph.

5. A table relationship visualization device, It is characterized in that The device comprises: A table configuration module is used to obtain an original framework, associate the original framework with the preset database according to a preset business scenario, extract source code query statements that associate the original framework with the preset database under the business scenario using a preset software system, and summarize the source code query statements to obtain a configuration file; A simulation connection module is used to obtain a preset embedded database, simulate the connection between the original framework and the embedded database, call the preset file package in the original framework, complete the simulation call according to the preset file package, and store all source code query statements in the configuration file into the cache of the original framework, wherein the preset embedded database is an empty local database; A statement parsing module, used to parse the source code query statement into multiple query statement categories using a preset query statement interpreter, extract fields under the query statement category, determine table association relationships according to the fields, and generate a preset format file according to the table association relationships; The relationship diagram generation module is used to parse the preset format file to obtain a table relationship diagram.

6. An electronic device, It is characterized in that The electronic device comprises: 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, and the instructions are executed by the at least one processor to enable the at least one processor to execute the table relationship visualization method according to any one of claims 1 to 4.

7. A computer-readable storage medium storing a computer program, It is characterized in that When the computer program is executed by a processor, the table relationship visualization method according to any one of claims 1 to 4 is implemented.