Data kinship analysis method, device, computer equipment and storage medium

Through multi-level analysis and integration at the report layer and program layer, a complete data lineage is generated, which solves the problem of poor accuracy and completeness of data lineage in the existing technology, and improves data management efficiency and storage space utilization.

CN114610791BActive Publication Date: 2024-10-01AGRICULTURAL BANK OF CHINA
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202210219987.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-08
Publication Date
2024-10-01
Estimated Expiration
2042-03-08

AI Technical Summary

Technical Problem

The existing technology has poor accuracy and completeness in obtaining data kinship relationships during data processing, and cannot effectively manage the correlation between data, resulting in large storage space usage and inability to realize the value of big data.

Method used

By extracting semantic information and parsing data query statements at the report layer, combined with the analysis of key control statements and data manipulation statements at the program layer, the relationship between the report layer and the program layer is integrated to generate a complete data lineage.

Benefits of technology

It improves the accuracy and completeness of data kinship results, achieves effective management of correlations between data, and optimizes storage space utilization and data value.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114610791B_ABST
    Figure CN114610791B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, device, computer equipment and storage medium for analyzing data lineage. The method comprises: obtaining a report to be analyzed and a source program matching the report to be analyzed; extracting semantic information and analyzing data query statements of the report to be analyzed to obtain the report layer relationship of the report to be analyzed; analyzing key control statements and data manipulation statements of the source program to obtain the program layer relationship of the report to be analyzed; integrating the report layer relationship and the program layer relationship of the report to be analyzed to obtain the data lineage relationship matching the report to be analyzed. By using the technical solution of the present invention, the accuracy and completeness of the data lineage result can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a method, device, computer equipment and storage medium for analyzing data blood relationship. Background Art

[0002] In the financial field, data platforms or data marts store a large amount of financial data. The analysis system processes the data in the data platform or data mart to generate reports or indicator data required by the business. During the long-term operation of different systems, data processing logic, intermediate data and result data continue to accumulate, and the relationship between various data is difficult to manage in a unified manner, which not only takes up a lot of storage space, but also fails to bring out the value of big data.

[0003] The existing method of combing the association relationship between data, that is, obtaining the data lineage relationship, is to parse the SQL (Structured Query Language) statements in the data processing process to obtain the relationship between the data table and the field. However, other high-level languages ​​are also used in the data processing process, and there are logical control relationships between different statements. Therefore, the accuracy and completeness of the data lineage relationship results obtained by the technical solutions of the prior art are poor. Summary of the invention

[0004] The present invention provides a data lineage analysis method, device, computer equipment and storage medium to improve the accuracy and completeness of data lineage results.

[0005] In a first aspect, an embodiment of the present invention provides a method for analyzing data lineage relationships, the method comprising:

[0006] Obtain the report to be parsed and the source program matching the report to be parsed;

[0007] Extract semantic information and parse data query statements from the report to be parsed, and obtain the report layer relationship of the report to be parsed;

[0008] Parse the key control statements and data manipulation statements of the source program to obtain the program level relationship of the report to be parsed;

[0009] The report layer relationship and program layer relationship of the report to be parsed are integrated to obtain the data lineage relationship that matches the report to be parsed.

[0010] In a second aspect, an embodiment of the present invention further provides a device for analyzing data blood relationship, the device comprising:

[0011] A module for acquiring reports to be parsed and source programs, used to acquire reports to be parsed and source programs matching the reports to be parsed;

[0012] The report layer relationship determination module is used to extract semantic information and parse data query statements of the report to be parsed, and obtain the report layer relationship of the report to be parsed;

[0013] The program layer relationship determination module is used to parse the key control statements and data manipulation statements of the source program to obtain the program layer relationship of the report to be parsed;

[0014] The data lineage relationship determination module is used to integrate the report layer relationship and the program layer relationship of the report to be parsed, and obtain the data lineage relationship that matches the report to be parsed.

[0015] In a third aspect, an embodiment of the present invention further provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, a method for analyzing data kinship relationships as described in any one of the embodiments of the present invention is implemented.

[0016] In a fourth aspect, an embodiment of the present invention further provides a storage medium storing computer executable instructions, which, when executed by a computer processor, are used to perform a data lineage analysis method as described in any one of the embodiments of the present invention.

[0017] The technical solution of the embodiment of the present invention extracts semantic information and parses data query statements on the report to be parsed at the report layer to obtain the report layer relationship of the report to be parsed, parses key control statements and data manipulation statements of the source program at the program layer to obtain the program layer relationship of the report to be parsed, integrates the report layer relationship and the program layer relationship to generate a complete data lineage relationship. The problem that the accuracy and integrity of the data lineage relationship results obtained by only parsing SQL statements at the data processing layer in the prior art is poor is solved, and the accuracy and integrity of the data lineage relationship results are improved.

[0018] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0020] Figure 1is a flow chart of a method for analyzing data blood relationship provided in the first embodiment of the present invention;

[0021] Figure 2a is a flow chart of a method for analyzing data blood relationship provided by Embodiment 2 of the present invention;

[0022] Figure 2b is a schematic diagram of a source program provided by Embodiment 2 of the present invention;

[0023] Figure 3 It is a schematic diagram of the structure of a data kinship analysis device provided in Embodiment 3 of the present invention;

[0024] Figure 4 It is a structural diagram of a computer device provided in Embodiment 4 of the present invention. DETAILED DESCRIPTION

[0025] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0026] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0027] Embodiment 1

[0028] Figure 1 A flow chart of a method for analyzing data lineage relationships is provided for the first embodiment of the present invention. This embodiment is applicable to situations where a complete data lineage relationship analysis is performed on a report to be parsed. The method can be executed by a data lineage relationship analysis device, which can be implemented in the form of hardware and / or software and can be configured in a server.

[0029] like Figure 1 As shown, the method includes:

[0030] S110, obtaining a report to be parsed and a source program matching the report to be parsed.

[0031] The report to be parsed is a report in the report display layer that needs to be parsed for data lineage. The number of reports to be parsed can be one or more. The source program is a program in the data processing layer that matches the report to be parsed.

[0032] In an embodiment of the present invention, data lineage is analyzed from two levels: the data processing layer and the report display layer. Data processing is the process of generating new data based on existing data. Therefore, the data processing layer can reflect the relationship between existing data and new data, as well as the relationship between new data and new data. The report display layer involves information such as Chinese semantics, which is also an important manifestation of data lineage. Data lineage analysis from two levels: the data processing layer and the report display layer can fully and clearly express the relationship between data, as well as the relationship between data and business.

[0033] S120 , extracting semantic information and parsing data query statements from the report to be parsed, and obtaining report layer relationships of the report to be parsed.

[0034] Semantic information extraction is used to extract the semantic information of the Chinese part of the report to be parsed. Semantic information extraction is performed on the report to be parsed, and the semantic information is mapped with the physical tables and fields of the data processing layer. This can make the meaning of the physical tables and fields clearer and more intuitive, and facilitate the understanding and management of data lineage relationships.

[0035] Data query statements are also called DQL (Data Query Language) statements, and DQL statements use SELECT as the core instruction. The report to be parsed includes data query statements and insert statements. The data query statement is used to query the data set to obtain the required data, and the insert statement is used to indicate that the data set identifier that matches the queried data is inserted into the report to be parsed. The data query statement is the statement that best reflects the data lineage relationship, so the embodiment of the present invention parses the data query statement. By parsing the data query statement, it is possible to obtain the data set identifier that matches the queried data, and the comparison relationship between the data table and the field of the report to be parsed at the data processing layer.

[0036] Optionally, the report layer relationship includes a mapping relationship between semantic information and physical tables and fields. By combining the data query statements with the same horizontal and vertical coordinates in the report to be parsed with the semantic information, the report layer relationship of the report to be parsed, that is, the mapping relationship between semantic information and physical tables and fields, can be obtained.

[0037] S130, parsing the key control statements and data manipulation statements of the source program to obtain the program level relationship of the report to be parsed.

[0038] Key control statements are logical control statements between different data manipulation statements. For example, key control statements can be If / Else statements. Data manipulation statements are also DML (Data Manipulation Language) statements. DML statements are used to add, modify, delete and query database records and check data integrity. DML statements use INSERT, UPDATE, and DELETE as core instructions. Since DML statements involve operations such as adding, modifying, and deleting data, DML statements are the statements that best reflect data lineage at the data processing layer. At the same time, since key control statements reflect the contextual association of DML statements, the correctness and integrity of data lineage can be guaranteed by parsing key control statements and DML statements.

[0039] Optionally, the program layer relationship includes mapping relationships between physical tables, between fields, and between physical tables and fields;

[0040] In the embodiment of the present invention, the DML statements and key control statements are parsed at the data processing layer, which improves the correctness and completeness of the data lineage relationship analysis results compared to the parsing of SQL statements in the prior art.

[0041] S140. Integrate the report layer relationship and the program layer relationship of the report to be parsed to obtain the data lineage relationship that matches the report to be parsed.

[0042] Specifically, the report layer relationship and program layer relationship of the report to be parsed are integrated by adding semantic information to the physical table and / or field according to the mapping relationship between the semantic information and the physical table and field, so as to obtain a complete data lineage relationship with semantics.

[0043] The technical solution of the embodiment of the present invention extracts semantic information and parses data query statements on the report to be parsed at the report layer to obtain the report layer relationship of the report to be parsed, parses key control statements and data manipulation statements of the source program at the program layer to obtain the program layer relationship of the report to be parsed, integrates the report layer relationship and the program layer relationship to generate a complete data lineage relationship. The problem that the accuracy and integrity of the data lineage relationship results obtained by only parsing SQL statements at the data processing layer in the prior art is poor is solved, and the accuracy and integrity of the data lineage relationship results are improved.

[0044] Embodiment 2

[0045] Figure 2aA flow chart of a method for analyzing data lineage relationships provided in the second embodiment of the present invention. Based on the above embodiments, the embodiment of the present invention further specifies the process of obtaining report layer relationships of the report to be analyzed, obtaining program layer relationships of the report to be analyzed, and integrating the report layer relationships and program layer relationships of the report to be analyzed, and adds the step of storing the data lineage relationships in a graph database.

[0046] like Figure 2a As shown, the method includes:

[0047] S210: Obtain a report to be parsed and a source program matching the report to be parsed.

[0048] In the embodiment of the present invention, the analysis of data lineage relationship is divided into two parts: analysis of the report to be analyzed and analysis of the source program.

[0049] S220: Determine the title area, table header area, and data area of ​​the report to be parsed.

[0050] The title area is the area for filling in the title of the report to be analyzed. For example, if the report to be analyzed is the underpaid reserve table of Bank A, then the title area in the report to be analyzed should be filled in with "Bank A Underpaid Reserve Table". Usually the first line of the report is the title area. The header area is the beginning of the table, which is used to classify the nature of some problems. For example, when the report to be analyzed is the underpaid reserve table of Bank A, the header area can be filled in with "serial number", "bank code", "bank name", "accounting institution code", "accounting institution name", "total underpaid reserve product" and "total profit to be marked down" and other contents. The data area is an area that matches the header area and is used to fill in data.

[0051] Optionally, a report template to be parsed may be pre-set, and each region of the report template to be parsed is marked with a region type and region coordinates, and the region coordinates may be represented by the coordinates of the upper left corner and the lower right corner of the region. The report to be parsed is generated according to the template, so the contents of the title region, the header region, and the data region in the report to be parsed may be obtained according to the report template to be parsed.

[0052] Optionally, content can be extracted from each area of ​​the report to be parsed, and the content of each area can be classified by a classifier to determine the title area, table header area, and data area. This embodiment does not limit the specific method of determining the title area, table header area, and data area of ​​the report to be parsed.

[0053] S230, performing semantic extraction on the report to be parsed to obtain semantic information.

[0054] Accordingly, S230 may include:

[0055] Semantic extraction is performed on the title area and the header area of ​​the report to be parsed to obtain semantic information. This embodiment does not limit the specific method of semantic extraction.

[0056] The type of semantic information includes at least one of the following: title name, dimension name, and indicator name.

[0057] Specifically, semantic extraction of the title area can obtain the title name, thereby determining the relationship between the title name and the physical table. Semantic extraction of the header area can obtain dimension names and / or indicator names. Taking the A bank underpaid reserve table as an example, "serial number", "bank code", "bank name", "accounting institution code", "accounting institution name", "total underpaid reserve product" and "total profit to be transferred down" are indicator names, and dimension names can be report time period, unit, etc.

[0058] S240: Perform formula analysis on the report to be analyzed to obtain a data set identifier that matches the semantic information.

[0059] The report to be parsed usually includes a report formula. For example, the report formula may include a summation formula, which is used to represent the sum of the data in column A and the data in column B in the data set.

[0060] Accordingly, S240 may include:

[0061] Formulas are extracted and parsed for the data area of ​​the report to be parsed, and a data set identifier matching the semantic information is obtained.

[0062] The data set identifier indicates the rows and columns of the data used for formula calculation in the data set. For example, if the report formula is a summation formula that sums the data in column A and column B in the data set, the data set identifier can be column A and column B.

[0063] In the embodiment of the present invention, formulas are extracted from the data region, and the extracted formulas are parsed to obtain a data set identifier.

[0064] S250: Parse the data query statement matching the data set to obtain a mapping relationship between the data set identifier and the physical table and field.

[0065] By parsing the DQL statement, we can obtain the mapping relationship between the data set identifier and the physical table and field of the data processing layer.

[0066] S260: Obtain the report layer relationship of the report to be parsed according to the semantic information and the mapping relationship between the data set identifier and the physical table and field.

[0067] Based on the data set identifier obtained by parsing the formula of the data area, and the mapping relationship between the data set identifier obtained by parsing the corresponding DQL statement and the physical table and field of the data processing layer, the mapping relationship between the data area and the physical table and field can be obtained. Since there is a corresponding relationship between the header area and the data area, the semantic information of the header area corresponding to the data area and the mapping relationship between the physical table and field can be obtained.

[0068] S270. Parse key control statements and data manipulation statements of the source program to obtain an abstract syntax tree.

[0069] S270 can also include:

[0070] S271. Identify key control statements and data manipulation statements in the source program, and generate a primary syntax tree based on the key control statements and data manipulation statements.

[0071] Specifically, the key control statements and data manipulation statements may be obtained by lexical analysis and grammatical analysis of the source program, but this embodiment does not limit the identification method of the key control statements and data manipulation statements.

[0072] In the embodiment of the present invention, after the key control statements and data manipulation statements are identified, a coarse-grained primary syntax tree is constructed with the data manipulation statements and their contexts. The primary syntax tree is a tree representation of the abstract syntax structure of the data manipulation statements and their contexts.

[0073] S272. Parse the data manipulation statement to obtain a structured query statement.

[0074] Each DML statement is parsed in turn to obtain the SQL statement corresponding to the DML statement, and the SQL statement is further parsed to obtain the secondary syntax tree corresponding to each SQL statement. The secondary syntax tree is a tree representation of the abstract syntax structure of the SQL statement.

[0075] S273. Generate a secondary syntax tree according to the structured query statement.

[0076] S274. Obtain an abstract syntax tree based on the primary syntax tree and the secondary syntax tree.

[0077] Compared with the prior art method of parsing SQL statements to generate an abstract syntax tree, the technical solution of this embodiment generates a more complete abstract syntax tree by constructing a primary syntax tree and a secondary syntax tree, thereby making the data lineage relationship obtained according to the abstract syntax tree more accurate and complete.

[0078] S280. Perform a depth-first traversal on the abstract syntax tree to obtain mapping relationships between physical tables, between fields, and between physical tables and fields.

[0079] Perform a depth-first traversal on the abstract syntax tree. Specifically, traverse the primary syntax tree in depth-first order. When encountering an SQL statement during the traversal, enter the secondary syntax tree corresponding to the SQL statement. The secondary syntax tree is also traversed in depth-first order until all abstract syntax trees are traversed to obtain the mapping relationships between physical tables, between fields, and between physical tables and fields.

[0080] Optionally, after obtaining the mapping relationships between physical tables, between fields, and between physical tables and fields, the connection relationships involving temporary tables can also be cleared to reduce redundant relationships in data lineage relationships and improve the intuitiveness and simplicity of data lineage results.

[0081] Figure 2b A schematic diagram of a source program is provided. Figure 2b The program shown in the figure is parsed to obtain the mapping relationships between physical tables, between fields, and between physical tables and fields as shown in Table 1:

[0082] Table 1

[0083]

[0084] Table 2 shows the mapping relationships between existing physical tables, between fields, and between physical tables and fields:

[0085] Table 2

[0086]

[0087] Combining the relationship table obtained after parsing the source program of the report to be parsed in Table 1 with the existing relationship table in Table 2, we can get the updated blood relationship analysis table in Table 3:

[0088] Table 3

[0089]

[0090] S290. According to the mapping relationship between the semantic information and the physical tables and fields, semantic information is added to the program layer relationship to generate data lineage relationship.

[0091] Through the mapping relationship between semantic information and physical tables and fields, semantic information is added to the physical tables and fields of the data processing layer.

[0092] Taking the above Table 3 as an example, after adding semantic information, the complete data lineage relationship after adding semantics in Table 4 is obtained:

[0093] Table 4

[0094]

[0095] Optionally, the generated data kinship relationship can be adjusted by setting a user interaction interface, etc. Exemplarily, semantic information can be added and adjusted through the user interaction interface. This setting can further ensure the accuracy and completeness of the data kinship relationship.

[0096] S2100. In the graph database, the data lineage relationship matching the report to be parsed is stored through the report entity, the indicator entity, the field entity, and the physical table entity.

[0097] Graph database is a high-performance NoSQL database. Its biggest feature is the storage and calculation of relational data. Common graph databases include neo4j, etc. The storage and management of data lineage relationships based on graph databases facilitates the query of reports, indicators, fields, and the relationship between physical tables, thus facilitating the analysis of redundant and erroneous processing.

[0098] In an embodiment of the present invention, four types of entities are set in the graph database. Among them, the relationship between the report entity and the indicator entity is a one-to-many relationship, and a report can contain one or more indicators. The indicator entity and the field entity are a one-to-many relationship, and an indicator can involve one or more fields. The physical table entity and the field entity are a one-to-many relationship, and a physical table contains multiple fields. There is a many-to-many relationship between physical table entities, and one physical table can generate multiple physical tables. Similarly, one physical table can be generated based on multiple physical tables.

[0099] Optionally, auxiliary information may be added to the graph database, including function mappings between fields and field statistics. For example, field statistics may include maximum, minimum, median, etc. Auxiliary information is mainly used for analysis and processing when using data lineage relationships to quickly locate abnormal indicators.

[0100] Optionally, a user interaction interface can be set up to visualize the complete data lineage relationship after adding semantics. Specifically, when a user queries a report through the user interaction interface, the report name, indicator information, and reports associated with the report that match the report are displayed. When a user queries a physical table through the user interaction interface, the physical table name, the database where the physical table is located, the field information corresponding to the physical table, and the physical table information are displayed. When a user queries a field through the user interaction interface, the field name, the physical table and report corresponding to the field, and the database where the field is located are displayed. When a user queries an indicator through the user interaction interface, the indicator name, the report matching the indicator, and the system where the indicator is located are queried.

[0101] Embodiment 3

[0102] Figure 3 This is a schematic diagram of the structure of a data kinship analysis device provided in Embodiment 3 of the present invention. Figure 3 As shown, the device includes: a report to be parsed and source program acquisition module 310, a report layer relationship determination module 320, a program layer relationship determination module 330 and a data lineage relationship determination module 340. Among them:

[0103] The report to be parsed and source program acquisition module 310 is used to acquire the report to be parsed and the source program matching the report to be parsed;

[0104] The report layer relationship determination module 320 is used to extract semantic information and parse data query statements of the report to be parsed, and obtain the report layer relationship of the report to be parsed;

[0105] The program layer relationship determination module 330 is used to parse the key control statements and data manipulation statements of the source program to obtain the program layer relationship of the report to be parsed;

[0106] The data lineage relationship determination module 340 is used to integrate the report layer relationship and the program layer relationship of the report to be parsed, and obtain the data lineage relationship that matches the report to be parsed.

[0107] The technical solution of the embodiment of the present invention extracts semantic information and parses data query statements on the report to be parsed at the report layer to obtain the report layer relationship of the report to be parsed, parses key control statements and data manipulation statements of the source program at the program layer to obtain the program layer relationship of the report to be parsed, integrates the report layer relationship and the program layer relationship to generate a complete data lineage relationship. The problem that the accuracy and integrity of the data lineage relationship results obtained by only parsing SQL statements at the data processing layer in the prior art is poor is solved, and the accuracy and integrity of the data lineage relationship results are improved.

[0108] Based on the above embodiment, the report layer relationship includes a mapping relationship between semantic information and physical tables and fields;

[0109] The program layer relationship includes mapping relationships between physical tables, between fields, and between physical tables and fields;

[0110] The data blood relationship determination module 340 includes:

[0111] According to the mapping relationship between semantic information and physical tables and fields, semantic information is added to the program layer relationship to generate data lineage relationship.

[0112] Based on the above embodiment, the report layer relationship determination module 320 includes:

[0113] A semantic extraction unit is used to perform semantic extraction on the report to be parsed to obtain semantic information;

[0114] A formula parsing unit is used to parse the formula of the report to be parsed and obtain a data set identifier that matches the semantic information;

[0115] A data query statement parsing unit, used to parse the data query statement matching the data set to obtain a mapping relationship between the data set identifier and the physical table and field;

[0116] The report layer relationship determination unit is used to obtain the report layer relationship of the report to be parsed according to the semantic information and the mapping relationship between the data set identifier and the physical table and field.

[0117] Based on the above embodiment, the device further includes:

[0118] Determine the title area, header area, and data area of ​​the report to be parsed;

[0119] Semantic extraction unit, specifically used for:

[0120] Perform semantic extraction on the title area and header area of ​​the report to be parsed to obtain semantic information;

[0121] The type of semantic information includes at least one of the following: title name, dimension name, and indicator name;

[0122] Formula parsing unit, specifically used for:

[0123] Formulas are extracted and parsed for the data area of ​​the report to be parsed, and a data set identifier matching the semantic information is obtained.

[0124] Based on the above embodiment, the program layer relationship determination module 330 includes:

[0125] An abstract syntax tree determination unit is used to parse key control statements and data manipulation statements of a source program to obtain an abstract syntax tree;

[0126] The mapping relationship determination unit is used to perform a depth-first traversal on the abstract syntax tree to obtain mapping relationships between physical tables, between fields, and between physical tables and fields.

[0127] Based on the above embodiment, the abstract syntax tree determination unit is specifically used for:

[0128] Identify key control statements and data manipulation statements in the source program, and generate a primary syntax tree based on the key control statements and data manipulation statements;

[0129] Parse the data manipulation statements to obtain structured query statements;

[0130] Generate a secondary syntax tree based on the structured query statement;

[0131] According to the primary syntax tree and the secondary syntax tree, an abstract syntax tree is obtained.

[0132] Based on the above embodiment, the device further includes:

[0133] The data lineage storage module is used to store the data lineage matching the report to be parsed in the graph database through report entities, indicator entities, field entities and physical table entities.

[0134] The data lineage relationship analysis device provided in the embodiment of the present invention can execute the data lineage relationship analysis method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0135] Embodiment 4

[0136] Figure 4 A schematic diagram of the structure of a computer device provided in Embodiment 4 of the present invention is shown in FIG. Figure 4 As shown, the computer device includes a processor 70, a memory 71, an input device 72 and an output device 73; the number of processors 70 in the computer device can be one or more. Figure 4 A processor 70 is taken as an example; the processor 70, memory 71, input device 72 and output device 73 in the computer device can be connected by a bus or other means. Figure 4 The example of connecting through bus is taken in the following.

[0137] The memory 71, as a computer-readable storage medium, can be used to store software programs, computer executable programs and modules, such as the modules corresponding to the data lineage analysis method in the embodiment of the present invention (for example, the to-be-analyzed report and source program acquisition module 310, the report layer relationship determination module 320, the program layer relationship determination module 330, and the data lineage determination module 340 in the data lineage analysis device). The processor 70 executes various functional applications and data processing of the computer device by running the software programs, instructions and modules stored in the memory 71, that is, implements the above-mentioned data lineage analysis method. The method includes:

[0138] Obtain the report to be parsed and the source program matching the report to be parsed;

[0139] Extract semantic information and parse data query statements from the report to be parsed, and obtain the report layer relationship of the report to be parsed;

[0140] Parse the key control statements and data manipulation statements of the source program to obtain the program level relationship of the report to be parsed;

[0141] The report layer relationship and program layer relationship of the report to be parsed are integrated to obtain the data lineage relationship that matches the report to be parsed.

[0142] The memory 71 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required for a function; the data storage area may store data created according to the use of the terminal, etc. In addition, the memory 71 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 71 may further include a memory remotely arranged relative to the processor 70, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0143] The input device 72 may be used to receive input digital or character information and generate key signal input related to user settings and function control of the computer device. The output device 73 may include a display device such as a display screen.

[0144] Embodiment 5

[0145] Embodiment 5 of the present invention further provides a storage medium including computer executable instructions, wherein the computer executable instructions are used to execute a data lineage relationship analysis method when executed by a computer processor, the method comprising:

[0146] Obtain the report to be parsed and the source program matching the report to be parsed;

[0147] Extract semantic information and parse data query statements from the report to be parsed, and obtain the report layer relationship of the report to be parsed;

[0148] Parse the key control statements and data manipulation statements of the source program to obtain the program level relationship of the report to be parsed;

[0149] The report layer relationship and program layer relationship of the report to be parsed are integrated to obtain the data lineage relationship that matches the report to be parsed.

[0150] Of course, the computer executable instructions of a storage medium containing computer executable instructions provided by an embodiment of the present invention are not limited to the method operations described above, and can also execute related operations in the data lineage analysis method provided by any embodiment of the present invention.

[0151] Through the above description of the implementation methods, the technicians in the relevant field can clearly understand that the present invention can be implemented by means of software and necessary general hardware, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, a read-only memory (ROM), a random access memory (RAM), a flash memory (FLASH), a hard disk or an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.

[0152] It is worth noting that in the embodiment of the above-mentioned data lineage analysis device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.

[0153] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims

1. A method for analyzing data kinship, characterized in that: include: Obtain the report to be parsed and the source program matching the report to be parsed; Extract semantic information and parse data query statements from the report to be parsed, and obtain the report layer relationship of the report to be parsed; Parse the key control statements and data manipulation statements of the source program to obtain the program level relationship of the report to be parsed; Integrate the report layer relationship and program layer relationship of the report to be parsed to obtain the data lineage relationship that matches the report to be parsed; The report layer relationship includes the mapping relationship between semantic information and physical tables and fields; The program layer relationship includes mapping relationships between physical tables, between fields, and between physical tables and fields; Integrate the report layer relationship and program layer relationship of the report to be parsed to obtain the data lineage relationship that matches the report to be parsed, including: According to the mapping relationship between semantic information and physical tables and fields, semantic information is added to the program layer relationship to generate data lineage relationship.

2. The method according to claim 1, characterized in that Extract semantic information and parse data query statements of the report to be parsed to obtain the report layer relationship of the report to be parsed, including: Perform semantic extraction on the report to be parsed to obtain semantic information; Perform formula analysis on the report to be analyzed to obtain the dataset identifier that matches the semantic information; Parse the data query statement that matches the data set to obtain the mapping relationship between the data set identifier and the physical table and field; According to the semantic information and the mapping relationship between the dataset identifier and the physical table and field, the report layer relationship of the report to be parsed is obtained.

3. The method according to claim 2, characterized in that Before semantic extraction of the report to be parsed, it also includes: Determine the title area, header area, and data area of ​​the report to be parsed; Perform semantic extraction on the report to be parsed to obtain semantic information, including: Perform semantic extraction on the title area and header area of ​​the report to be parsed to obtain semantic information; The type of semantic information includes at least one of the following: title name, dimension name, and indicator name; Perform formula analysis on the report to be analyzed and obtain the dataset identifier that matches the semantic information, including: Formulas are extracted and parsed for the data area of ​​the report to be parsed, and a data set identifier matching the semantic information is obtained.

4. The method according to claim 1, characterized in that: Parse the key control statements and data manipulation statements of the source program to obtain the program-level relationship of the report to be parsed, including: Parse the key control statements and data manipulation statements of the source program to obtain an abstract syntax tree; Perform a depth-first traversal of the abstract syntax tree to obtain mapping relationships between physical tables, between fields, and between physical tables and fields.

5. The method according to claim 4, characterized in that Parse the key control statements and data manipulation statements of the source program to obtain an abstract syntax tree, including: Identify key control statements and data manipulation statements in the source program, and generate a primary syntax tree based on the key control statements and data manipulation statements; Parse the data manipulation statements to obtain structured query statements; Generate a secondary syntax tree based on the structured query statement; According to the primary syntax tree and the secondary syntax tree, an abstract syntax tree is obtained.

6. The method according to claim 1, characterized in that After obtaining the data lineage relationship that matches the report to be parsed, it also includes: In the graph database, the data lineage relationships that match the report to be parsed are stored through report entities, indicator entities, field entities, and physical table entities.

7. A device for analyzing data blood relationship, characterized in that: include: A module for acquiring reports to be parsed and source programs, used to acquire reports to be parsed and source programs matching the reports to be parsed; The report layer relationship determination module is used to extract semantic information and parse data query statements of the report to be parsed, and obtain the report layer relationship of the report to be parsed; The program layer relationship determination module is used to parse the key control statements and data manipulation statements of the source program to obtain the program layer relationship of the report to be parsed; The data lineage relationship determination module is used to integrate the report layer relationship and program layer relationship of the report to be parsed, and obtain the data lineage relationship that matches the report to be parsed; The report layer relationship includes the mapping relationship between semantic information and physical tables and fields; The program layer relationship includes mapping relationships between physical tables, between fields, and between physical tables and fields; The data blood relationship determination module includes: According to the mapping relationship between semantic information and physical tables and fields, semantic information is added to the program layer relationship to generate data lineage relationship.

8. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method for analyzing data kinship relationships as described in any one of claims 1-6 is implemented.

9. A storage medium storing computer executable instructions, characterized in that: When the computer executable instructions are executed by a computer processor, they are used to perform the data lineage analysis method as described in any one of claims 1-6.

Citation Information

Cited By

  • A multi-source heterogeneous data automatic collection intelligent report generation method

    CN122904867A