Data lineage tracing method, device, equipment and medium
Patent Information
- Application Number
- CN202410895207.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-05
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2044-07-05
Smart Images

Figure CN118427186B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data lineage technology, and in particular to a data lineage tracing method, device, equipment and medium. Background Art
[0002] Data lineage tracing is a crucial process in the fields of data management, data analysis, and data governance. Through data lineage tracing, the entire flow path of data from the original source to the final use or presentation form can be traced forward, or the data anomaly point can be traced back to the source of the anomaly. Data lineage tracing can ensure data security and quality, and effectively troubleshoot data problems. In the prior art, when constructing a lineage link of data, the lineage link constructed by simply splicing the direct dependencies of each data field will contain irrelevant upstream and downstream data, resulting in irrelevant data being traced back when the root lineage link is traced, resulting in too low efficiency of lineage tracing. Summary of the invention
[0003] The present invention provides a data lineage tracing method, device, equipment and medium to solve the technical problem in the prior art that irrelevant data exists in the data lineage tracing process, resulting in low tracing efficiency.
[0004] According to one aspect of the present invention, a data lineage tracing method is provided, comprising:
[0005] Acquire a target tracing field and a data processing script associated with the target tracing field, perform syntax parsing on the data processing script using a preset syntax parsing method, and determine an abstract syntax tree corresponding to the data processing script;
[0006] Constructing at least one direct blood relationship according to the data fields in the abstract syntax tree and the dependency relationship corresponding to each data field, and constructing a data blood relationship graph based on all the direct blood relationships;
[0007] A bloodline clipping window corresponding to the target tracing field is constructed according to the data bloodline map through a preset sliding window construction method, and the target tracing field is clipped for bloodline relationship in the data bloodline map through the bloodline clipping window to determine the target bloodline link corresponding to the target tracing field.
[0008] According to another aspect of the present invention, there is provided a data lineage tracing device, comprising:
[0009] A syntax parsing module, used to obtain a target tracing field and a data processing script associated with the target tracing field, perform syntax parsing on the data processing script using a preset syntax parsing method, and determine an abstract syntax tree corresponding to the data processing script;
[0010] A data lineage graph construction module, used to construct at least one direct lineage relationship according to the data fields in the abstract syntax tree and the dependency relationship corresponding to each data field, and to construct a data lineage graph based on all the direct lineage relationships;
[0011] A blood relationship clipping module is used to construct a blood relationship clipping window corresponding to the target tracing field according to the data blood relationship map through a preset sliding window construction method, and to perform blood relationship clipping on the target tracing field in the data blood relationship map through the blood relationship clipping window to determine the target blood relationship link corresponding to the target tracing field.
[0012] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0013] at least one processor; and
[0014] a memory communicatively connected to the at least one processor; wherein,
[0015] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the data lineage tracing method described in any embodiment of the present invention.
[0016] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the data lineage tracing method described in any embodiment of the present invention when executed.
[0017] The technical solution of the embodiment of the present invention obtains the target tracing field and the data processing script associated with the target tracing field, performs syntax analysis on the data processing script through a preset syntax analysis method, determines the abstract syntax tree corresponding to the data processing script, and directly reflects the dependency relationship in the data processing script by constructing the abstract syntax tree of the data processing script. The effective and clear dependency relationship improves the accuracy of constructing the data lineage map and improves the efficiency of data tracing; at least one direct lineage relationship is constructed according to the data field in the abstract syntax tree and the dependency relationship corresponding to each data field, and a data lineage map is constructed based on all the direct lineage relationships. The data lineage map constructed by the direct lineage relationship can prevent Stop duplicate data fields in the data lineage map, improve the accuracy of the data lineage map, and improve the precision of data tracing; construct a lineage clipping window corresponding to the target tracing field according to the data lineage map through a preset sliding window construction method, and perform lineage clipping on the target tracing field in the data lineage map through the lineage clipping window to determine the target lineage link corresponding to the target tracing field. The lineage clipping window can be used to clip the lineage relationship of the data lineage map, remove abnormal data in the lineage relationship of the target tracing field, improve the precision of the lineage link, and solve the technical problem of irrelevant data in the lineage tracing process of data in the prior art, resulting in too low tracing efficiency. Tracing through field-level lineage links will avoid a large amount of irrelevant upstream data, effectively improving the efficiency of tracing analysis.
[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 1 A flow chart of a data lineage tracing method is provided for an embodiment of the present invention;
[0021] Figure 2 A flowchart of another data lineage tracing method provided by an embodiment of the present invention;
[0022] Figure 3 A schematic diagram of a blood relationship tailoring process disclosed in the present invention;
[0023] Figure 4 A schematic diagram of another process of blood relationship tailoring disclosed in the present invention;
[0024] Figure 5 A schematic diagram of another process of blood relationship tailoring disclosed in the present invention;
[0025] Figure 6 A schematic diagram of the structure of a data lineage tracing device provided in an embodiment of the present invention;
[0026] Figure 7 A schematic structural diagram of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0027] 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.
[0028] 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.
[0029] Figure 1 A flow chart of a data lineage tracing method is provided for an embodiment of the present invention. This embodiment is applicable to the case of performing lineage tracing on a target tracing field. The method can be executed by a data lineage tracing device. The data lineage tracing device can be implemented in the form of hardware and / or software. The data lineage tracing device can be configured in an electronic device. Figure 1 As shown, the method includes:
[0030] S110: Obtain a target tracing field and a data processing script associated with the target tracing field, perform syntax parsing on the data processing script using a preset syntax parsing method, and determine an abstract syntax tree corresponding to the data processing script.
[0031] The target tracing field may be a data field for which a lineage link needs to be constructed for lineage tracing. It should be noted that a data field may be data used to store characteristic types in a data repository, and each data field has a name and a data type, which is used to define the type and format of the stored data. Exemplarily, a data field may be a column of a data table in SQL (Structured Query Language).
[0032] The data processing script may be a collection of database processing command statements, which are usually written in the same executable file and can be used to perform specific database operations. For example, the data processing script may be an SQL script or a SQL-like script, and the database processing command statement may be an SQL statement.
[0033] Among them, the preset syntax parsing method can be a pre-set method for parsing the syntax of the data processing script. The abstract syntax tree can be a tree representation of the abstract syntax result of the data processing script. It should be noted that the nodes in the abstract syntax tree can represent data fields, and the edges connecting the nodes of each data field can represent the dependency relationship between the data fields. The dependency relationship can be used to reflect the correlation between different data fields in the data processing or business logic in the database. The dependency relationship can include a write operator and a conditional operator; the write operator can be an operation that describes the dependency relationship, and the conditional operator can be a condition that describes the dependency relationship.
[0034] Optionally, the nodes in the abstract syntax tree may represent tables, and the edges connecting the table nodes may represent the dependency relationships between the tables.
[0035] Optionally, when performing syntax analysis on a data processing script using a preset syntax analysis method, it is first necessary to perform lexical analysis on the data processing script, identify identification units in the data processing script, perform syntax analysis on the identification units and construct an abstract syntax tree. Exemplarily, the preset syntax analysis method may be AST (Abstract Syntax Tree).
[0036] Specifically, the target tracing field that needs to be traced by bloodline and the data processing script associated with the target tracing field are obtained, the data processing script is parsed by a preset syntax parsing method, and an abstract syntax tree corresponding to the data processing script is constructed.
[0037] S120. Construct at least one direct blood relationship according to the data fields in the abstract syntax tree and the dependency relationship corresponding to each data field, and construct a data blood relationship graph based on all the direct blood relationships.
[0038] Among them, the direct blood relationship can be that the dependency between two data fields is a direct dependency, and the direct dependency between the two data fields is determined as a direct blood relationship. It should be noted that the direct dependency can be that the data field directly depends on another data field or is directly dependent on another data field. When constructing a direct blood relationship, for different application scenarios of the direct blood relationship, in the case of forward tracing based on the target tracing field as the original node, the direct dependency corresponding to the data field directly depending on another data field is used as the direct blood relationship of the target tracing field; in the case of reverse tracing to the original node based on the target tracing field target node, the direct dependency corresponding to the data field directly being dependent on another data field is used as the direct blood relationship of the target tracing field. Exemplarily, it is necessary to obtain the direct blood relationship in the dependency relationship corresponding to each data field and each data field based on the dependency relationship between the data fields and the data fields in the abstract syntax tree, and the number of direct blood relationships is at least one. Exemplarily, the sql query statement is as follows:
[0039] SELECT column1,column2, "1"
[0040] INTO new_table(column4, column5, column6)
[0041] FROM existing_table
[0042] WHERE column3 = 1;
[0043] Construct an abstract syntax tree for the SQL query statement, and parse it based on the abstract syntax tree to get:
[0044] 1. Dependent table: existing_table; Dependent field: column1; Dependent table: new_table; Dependent field: column4; Write operator: column1; Condition operator: WHERE column3 = 1;
[0045] 2. Dependent table: existing_table; Dependent field: column3; Dependent table: new_table; Dependent field: column4; Write operator: column1; Condition operator: WHERE column3 = 1;
[0046] 3. Dependent table: existing_table; Dependent field: column1; Dependent table: new_table; Dependent field: column5; Write operator: column2; Condition operator: WHERE column3 = 1;
[0047] 4. Dependent table: existing_table; Dependent field: column3; Dependent table: new_table; Dependent field: column5; Write operator: column2; Condition operator: WHERE column3 = 1;
[0048] 5. Dependent table: existing_table; Dependent field: column3: Dependent table: new_table; Dependent field: column6; Write operator: constant "1"; Condition operator: WHERE column3 = 1; Then the dependency relationship between data fields and data fields is obtained, and the direct blood relationship can be field column1 and field column4, field column3 and field column4, field column1 and field column5, field column3 and field column5, field column3 and field column6.
[0049] Among them, the data lineage map can be a visual representation of each processing step from the original source of each data field to the final use or presentation form. It should be noted that the data lineage map is a visual representation based on the naturally formed relationship between data. In an embodiment of the present invention, the data nodes in the data lineage map are data fields and the edges formed by the direct lineage relationship between data fields. Usually, the data lineage map is stored in a graph structure, the nodes of the graph structure are defined as data fields, and the edges of the graph structure are defined as the direct lineage relationship between data fields.
[0050] Optionally, after obtaining the direct blood relationship between each data field and each data field, all data fields and the direct blood relationship between each data field are merged to construct a data blood relationship map, and the data fields are sequentially used as nodes of the data blood relationship map, and the direct blood relationship between the data fields is used as the edge connecting the nodes, and all data fields and the direct blood relationship between the data fields are used as nodes and edges to obtain a data blood relationship map composed of the direct blood relationship between all data fields and data fields. Among them, for the same data field, the same data field is used as a node, and the direct blood relationship is merged to ensure that the same data field has only one node in the data blood relationship map.
[0051] Optionally, the nodes in the data lineage graph can also be defined as tables, and the edges can be defined as dependencies between tables, thereby forming a data lineage graph in which the nodes are tables.
[0052] Specifically, by parsing the data processing script through the abstract syntax tree, the data fields and the dependency relationship of each data field can be obtained according to the abstract syntax tree, and then at least one direct blood relationship corresponding to each data field can be constructed based on the dependency relationship between the data field and each data field itself, and a data blood relationship map can be constructed based on the direct blood relationships of all data fields.
[0053] S130. Construct a bloodline clipping window corresponding to the target tracing field according to the data bloodline map by using a preset sliding window construction method, perform bloodline clipping on the target tracing field in the data bloodline map through the bloodline clipping window, and determine a target bloodline link corresponding to the target tracing field.
[0054] Among them, the preset sliding window construction method can be pre-set for constructing a blood relationship clipping window. The blood relationship clipping window can be used to judge and process the blood relationship link constructed by the target tracing field in the data blood relationship map. It should be noted that when constructing the blood relationship clipping window for the target tracing field in the data blood relationship map, it is necessary to determine the range of the sliding window, obtain the corresponding data field according to the direct blood relationship of the target tracing field, and then obtain the data field according to the direct blood relationship of this data field. If the direct blood relationship of the target tracing field corresponds to the data field, the target tracing field, the data field corresponding to the direct blood relationship of the target tracing field, and the direct blood relationship of the data field corresponding to the direct blood relationship of the target tracing field are used as the range of the sliding window, and this sliding window is used as the blood relationship clipping window; if the data field corresponding to the direct blood relationship of the target tracing field does not have a direct blood relationship, the target tracing field and the direct blood relationship of the target tracing field are used as the range of the sliding window, and this sliding window is used as the blood relationship clipping window. The lineage trimming window only involves the direct lineage relationship of the target traceability field, and the direct lineage relationship of the data field corresponding to the direct lineage relationship of the target traceability field.
[0055] The target lineage link may be the only lineage link of the target traceability field in the data lineage map. It should be noted that, when the lineage relationship of the target traceability field is cut in the data lineage map through the lineage cutting window, the data fields that do not have an upstream or downstream relationship with the target traceability field are cut, and only the data fields that have a lineage relationship with the target traceability field are retained, which can effectively trace the upstream and downstream data fields of the target traceability field that have a lineage relationship in the data lineage map.
[0056] Specifically, a preset sliding window construction method is used to construct a lineage clipping window in the data lineage map based on the direct lineage relationship of the target tracing field, and the lineage clipping window is used to perform lineage clipping on the target tracing field in the data lineage map to determine the target lineage link corresponding to the target tracing field.
[0057] The technical solution of the embodiment of the present invention obtains the target tracing field and the data processing script associated with the target tracing field, performs syntax analysis on the data processing script through a preset syntax analysis method, determines the abstract syntax tree corresponding to the data processing script, and directly reflects the dependency relationship in the data processing script by constructing the abstract syntax tree of the data processing script. The effective and clear dependency relationship improves the accuracy of constructing the data lineage map and improves the efficiency of data tracing; at least one direct lineage relationship is constructed according to the data field in the abstract syntax tree and the dependency relationship corresponding to each data field, and a data lineage map is constructed based on all the direct lineage relationships. The data lineage map constructed by the direct lineage relationship can prevent Stop duplicate data fields in the data lineage map, improve the accuracy of the data lineage map, and improve the precision of data tracing; construct a lineage clipping window corresponding to the target tracing field according to the data lineage map through a preset sliding window construction method, and perform lineage clipping on the target tracing field in the data lineage map through the lineage clipping window to determine the target lineage link corresponding to the target tracing field. The lineage clipping window can be used to clip the lineage relationship of the data lineage map, remove abnormal data in the lineage relationship of the target tracing field, improve the precision of the lineage link, and solve the technical problem of irrelevant data in the lineage tracing process of data in the prior art, resulting in too low tracing efficiency. Tracing through field-level lineage links will avoid a large amount of irrelevant upstream data, effectively improving the efficiency of tracing analysis.
[0058] Figure 2 This is a flow chart of another data lineage tracing method provided by an embodiment of the present invention. The relationship between this embodiment and the above embodiment is to specifically explain the specific process of lineage clipping of the target tracing field through the lineage clipping window. Figure 2 As shown, the method includes:
[0059] S210: Obtain a target tracing field and a data processing script associated with the target tracing field, perform syntax parsing on the data processing script using a preset syntax parsing method, and determine an abstract syntax tree corresponding to the data processing script.
[0060] S220. Construct at least one direct blood relationship according to the data fields in the abstract syntax tree and the dependency relationships corresponding to each data field, and construct a data blood relationship graph based on all the direct blood relationships.
[0061] S230, obtaining a clipping window lineage link formed by data fields in the lineage clipping window.
[0062] The trimming window lineage link may be a lineage link formed by all data fields in the lineage trimming window. It should be noted that, since the lineage trimming window only involves the direct lineage relationship of the data fields, and the direct lineage relationship of the data fields corresponds to the direct lineage relationship of the data fields, the trimming window lineage link is determined according to the data fields, the direct lineage relationship of the data fields, and the direct lineage relationship of the data fields corresponding to the direct lineage relationship of the data fields.
[0063] Specifically, the trimming window kinship link in the current kinship trimming window is determined according to the data field in the kinship trimming window and the direct kinship relationship associated with the data field. Exemplarily, for the kinship trimming window constructed for the target tracing field, in the first kinship trimming window, the target tracing field is used as the starting node of the trimming window kinship link, and the direct kinship relationship of the target tracing field and the direct kinship relationship of the data field corresponding to the direct kinship relationship of the target tracing field are used as the end node. As the kinship trimming window moves, the data field in the kinship trimming window changes, and the trimming window kinship link in the kinship trimming window is updated. In the second kinship trimming window, the data field corresponding to the direct kinship relationship of the target tracing field is used as the starting node of the trimming window kinship link at this time, and the direct kinship relationship of the data field corresponding to the direct kinship relationship of the target tracing field is used as the second node, and the direct kinship relationship of the second node is used as the end node. As the kinship trimming window moves, the data field in the trimming window kinship link changes accordingly.
[0064] S240, identifying the lineage link length of the lineage link of the clipping window, clipping the lineage link of the clipping window according to the lineage link length, determining the clipped lineage link corresponding to the target traceability field, and moving the lineage clipping window according to a preset step length to update the clipping window lineage link;
[0065] Among them, the length of the lineage link can be the length of the lineage link of the clipping window. It should be noted that, in the embodiment of the present invention, the lineage link takes the target tracing field as the starting point, and the length of the lineage link formed by the direct lineage relationship between the target tracing field and the target tracing field is 1, and the lineage link takes the target tracing field as the starting point, and the length of the lineage link formed by the direct lineage relationship between the target tracing field and the data field corresponding to the direct lineage relationship of the target tracing field is 2. Optionally, the length of the lineage link can be the number of edges from the node corresponding to the data field in the data lineage graph to the node corresponding to another data field.
[0066] Secondly, the tailoring of the lineage link can be obtained in the process of tailoring the lineage relationship of the target traceability field. It should be noted that in the data lineage map, the number of data fields that have a lineage relationship with the target traceability field is more than one. When the lineage relationship of the target traceability field is tailored through the lineage tailoring window, the tailored lineage link of the tailored window is tailored in the lineage tailoring window, and then the tailored lineage link of the tailored window is updated to the tailored lineage link of the target traceability field. After the lineage tailoring window is moved and the tailored window lineage link is updated, the tailored lineage link of the tailored window lineage link is tailored again, and then the tailored lineage link is updated and merged through the tailored window lineage link, and the tailored window lineage link and the tailored lineage link are merged as a new tailored lineage link.
[0067] Optionally, when performing bloodline trimming on the bloodline link in the trimming window, the embodiment of the present invention sets different trimming methods according to different bloodline link lengths, and thus needs to identify the bloodline link length of the bloodline link in the trimming window, and then perform bloodline trimming on the bloodline link in the trimming window according to the bloodline link length to determine the trimmed bloodline link corresponding to the target traceability field.
[0068] The preset step size may be a moving step size of a preset blood relationship clipping window. It should be noted that, in order to improve the accuracy of the target blood relationship link corresponding to the target tracing field, the preset step size is usually set to 1.
[0069] Optionally, after determining the trimmed lineage link corresponding to the target traceability field, the lineage trimming window is moved by a preset step size, and a new trimming window lineage link is constructed based on the data field in the moved lineage trimming window to complete the update of the trimming window lineage link.
[0070] S250: If the moved lineage clipping window does not have the clipping window lineage link, use the clipping lineage link as the target lineage link.
[0071] Optionally, after moving the lineage trimming window, determine whether the moved lineage trimming window has the trimming window lineage link, by obtaining the data field in the lineage trimming window. If there is only one data field, it means that there is no trimming window lineage link in the lineage trimming window, and it is considered that the lineage relationship corresponding to the target tracing field has been trimmed, and the trimmed lineage link is used as the target lineage link; if there are two or more data fields, it means that there is a trimming window lineage link in the lineage trimming window, and the lineage relationship corresponding to the target tracing field has not been trimmed, then return to execute the step of identifying the lineage link length of the trimming window lineage link, perform lineage trimming on the trimming window lineage link according to the lineage link length, determine the trimmed lineage link corresponding to the target tracing field, and move the lineage trimming window according to the preset step size to update the trimming window lineage link.
[0072] Optionally, in another optional embodiment of the present invention, the performing blood relationship clipping on the clipping window blood relationship link according to the blood relationship link length to determine the clipped blood relationship link corresponding to the target traceability field includes:
[0073] If the lineage link length of the trimming window lineage link is 2, then the data field corresponding to the start node in the lineage link length is used as the start field, at least one first tracing field is determined according to the direct lineage relationship of the start field, and at least one second tracing field is determined according to the direct lineage relationship of each of the first tracing fields;
[0074] The blood relationship is pruned in sequence according to the dependency relationship of each of the first tracing fields and the dependency relationship of the second tracing fields corresponding to each of the first tracing fields, to determine the pruned blood relationship link corresponding to the target tracing field.
[0075] The starting field may be the starting node in the lineage link of the trimming window. It should be noted that the starting fields of lineage links of different trimming windows correspond to different data. The starting field of the lineage link of the trimming window corresponding to the first lineage trimming window is the target tracing field, while the starting field of the lineage link of the trimming window corresponding to the second lineage trimming window is the data field corresponding to the direct lineage relationship of the target tracing field.
[0076] Among them, the first tracing field may be a data field corresponding to the direct blood relationship of the starting field. The second tracing field may be a data field corresponding to the direct blood relationship of the first tracing. It should be noted that in the embodiment of the present invention, there are different application scenarios for the starting field. In the case of forward tracing based on the starting field as the original node, the first tracing field and the second tracing field may be the upstream node of the starting field; in the case of reverse tracing to the original node based on the starting field as the target node, the first tracing field and the second tracing field may be the downstream node of the starting field.
[0077] Specifically, if the bloodline link length of the trimming window bloodline link is 2, the data field corresponding to the starting node in the bloodline link length is used as the starting field, and at least one first tracing field is determined according to the direct bloodline relationship of the starting field, and at least one second tracing field is determined according to the direct bloodline relationship of each first tracing field. Bloodline trimming is performed in turn according to the dependency relationship of each first tracing field and the dependency relationship of the second tracing field corresponding to each first tracing field to determine the trimmed bloodline link corresponding to the target tracing field.
[0078] Optionally, in another optional embodiment of the present invention, the performing blood relationship clipping on the clipping window blood relationship link according to the blood relationship link length to determine the clipped blood relationship link corresponding to the target traceability field further includes:
[0079] If the lineage link length of the cropping window lineage link is 1, the cropping lineage link is determined according to the cropping window lineage link.
[0080] Specifically, if the length of the cropping window lineage link in the lineage cropping window is 1, it means that the cropping window lineage link does not need to be cropped, and the cropping window lineage link is updated and merged, and the cropped cropping window lineage link and the cropping lineage link are merged as the new cropping lineage link.
[0081] Optionally, in another optional embodiment of the present invention, the performing blood relationship tailoring according to the dependency relationship of the first tracing field and the dependency relationship of the second tracing field includes:
[0082] If the dependency relationship of the first tracing field and the dependency relationship of the second tracing field are mutually exclusive, the second tracing field is clipped, and the second tracing field is determined as a relationship tracing field, and the relationship tracing field is retroactively clipped;
[0083] In the case that there is no mutually exclusive relationship between the dependency of the first tracing field and the dependency of the second tracing field, the dependency of the target tracing field is propagated to update the dependency of the first tracing field.
[0084] Among them, the relationship tracing field can be a data field that has no blood relationship with the target tracing field. It should be noted that, due to the limited length of the blood relationship link of the trimming window blood relationship link, the data field that has no blood relationship with the target tracing field will be temporarily saved during blood relationship trimming. When it is found that there is a relationship tracing field in the trimming window blood relationship link, it is necessary to perform blood relationship tracing trimming for the relationship tracing field and clear the data field that has no blood relationship in the trimming blood relationship link.
[0085] Optionally, when performing lineage trimming based on the dependency relationship of the first traceability field and the dependency association of the second traceability field, it is necessary to perform a relationship comparison based on the conditional operator between the first traceability field and the starting field and the write operator between the second traceability field and the second traceability field. If the conditional operator between the first traceability field and the starting field and the write operator between the second traceability field and the second traceability field are mutually exclusive, the second traceability field is trimmed, and the second traceability field is determined as the relationship traceability field, and the relationship traceability field is trimmed; if the conditional operator between the first traceability field and the starting field and the write operator between the second traceability field and the second traceability field are not mutually exclusive, it means that the second traceability field and the target traceability field have a lineage relationship, and the second traceability field does not need to be trimmed. It is necessary to perform relationship propagation on the conditional operator between the first traceability field and the target traceability field, and determine a new conditional operator based on the conditional operator between the first traceability field and the target traceability field and the dependency relationship between the first traceability field and the second traceability field, so as to update the dependency relationship of the first traceability field.
[0086] Optionally, when there is no mutually exclusive relationship between the conditional operator between the first tracing field and the start field and the write operator between the second tracing field and the second tracing field, a pre-trained large language module or neural network model is called, the conditional operator between the first tracing field and the target tracing field and the dependency relationship between the first tracing field and the second tracing field are input into the big data model or the neural network model, and the conditional operator output by the big data model or the neural network model is used as a new conditional operator between the first tracing field and the second tracing field.
[0087] Optionally, in another optional embodiment of the present invention, the tracing back and clipping the relationship tracing field includes: obtaining a blood relationship associated field of the relationship tracing field, clipping the relationship tracing field, and determining whether the blood relationship associated field has a direct blood relationship that has not been clipped;
[0088] If the blood relationship field does not have any unclipped direct blood relationship, the blood relationship field is updated to a relationship tracing field, and the process returns to the step of obtaining the blood relationship field of the relationship tracing field, pruning the relationship tracing field, and determining whether the blood relationship field has any unclipped direct blood relationship; if the blood relationship field has any unclipped direct blood relationship, terminating the pruning.
[0089] Among them, the blood relationship field can be the data field corresponding to the direct dependency that has undergone blood relationship clipping in the relationship tracing field. It should be noted that in different application scenarios, the method of obtaining the blood relationship field of the relationship tracing field is different, as follows: in the case of forward tracing based on the starting field as the original node, the moving direction of the blood relationship clipping window at this time is to move to the upstream node of the target tracing field, and the downstream data field corresponding to the direct dependency that has undergone blood relationship clipping in the relationship tracing field is used as the blood relationship field; in the case of reverse tracing based on the starting field as the target node, the moving direction of the blood relationship clipping window at this time is to move to the downstream node of the target tracing field, and the upstream data field corresponding to the direct dependency that has undergone blood relationship clipping in the relationship tracing field is used as the blood relationship field.
[0090] Optionally, the blood relationship associated field is obtained according to the blood relationship of the relationship tracing field, and the relationship tracing field is trimmed to obtain the direct blood relationship of the blood relationship associated field, and it is determined whether the blood relationship associated field has an uncropped direct blood relationship. If the blood relationship associated field does not have an uncropped direct blood relationship, it means that the blood relationship associated field and the target tracing field do not have a blood relationship, and the blood relationship associated field is updated to the relationship tracing field, and the process returns to execute the steps of obtaining the blood relationship associated field of the relationship tracing field, trimming the relationship tracing field, and determining whether the blood relationship associated field has an uncropped direct blood relationship; if the blood relationship associated field has an uncropped direct blood relationship, it means that the blood relationship associated field and the target tracing field have a blood relationship, and the trimming needs to be terminated.
[0091] For example, Figure 3 A schematic diagram of a blood relationship tailoring process disclosed in the present invention; Figure 4 A schematic diagram of another process of blood relationship tailoring disclosed in the present invention; Figure 5 FIG. 1 is a schematic diagram of another process of blood relationship cutting disclosed in the present invention. Figure 3 and Figure 4 As shown, Figure 3The disclosure discloses a process of cutting the blood relationship of the target traceability field through the first blood relationship cutting window. In the cutting window blood relationship link corresponding to the first blood relationship cutting window, the direct blood relationship of the starting field is the first traceability field. The first traceability field has multiple direct blood relationships, namely, the second traceability field A, the second traceability field B, and the second traceability field C. Figure 3 Also shown is the data field A corresponding to the second tracing field A, the data field B corresponding to the second tracing field B, and the data field C corresponding to the second tracing field C. In the first lineage trimming window, the trimming window lineage link is the starting field-the first tracing field-(the second tracing field A, the second tracing field B, the second tracing field C), and the lineage link length of the trimming window lineage link is 2. Then, the conditional operator (f==1orf==3) between the first tracing field and the starting field is judged in relation to the write operator (original value write) between the first tracing field and the second tracing field A. The conditional operator (f==1orf==3) between the first tracing field and the starting field is judged in relation to the write operator (original value write) between the first tracing field and the second tracing field A. If there is no mutually exclusive relationship between the write operators of the two traceability fields A (original value writing), no trimming is performed. In the same way, the relationship between the conditional operator (f==1orf==3) between the first traceability field and the starting field and the write operator (original value writing) between the first traceability field and the second traceability field B is judged, and the relationship between the conditional operator (f==1orf==3) between the first traceability field and the starting field and the write operator (original value writing) between the first traceability field and the second traceability field C is judged. The same result without trimming can be obtained. The lineage trimming window is moved, the first traceability field is updated to the starting field, and the first traceability field, the second traceability field and the dependency relationship are updated accordingly.
[0092] like Figure 4 As shown, after the first bloodline clipping window is clipped, the bloodline clipping window is moved to enter the second bloodline clipping window. Figure 4In the example, since the conditional operator between the data field D and the start field is propagated and updated to before the start field and the first tracing field A, the first tracing field B and the first tracing field C, and the second tracing field A corresponding to the first tracing field, the second tracing field B corresponding to the first tracing field B, and the second tracing field C corresponding to the first tracing field C are determined, at this time, the lineage link length of the lineage link of the trimming window is 2, then the relationship between the conditional operator (f==1orf==3) between the first tracing field A and the start field and the write operator (f==1) between the first tracing field A and the second tracing field A is judged, and the relationship between the conditional operator (f==1orf==3) between the first tracing field A and the start field and the write operator (f==1) between the first tracing field A and the second tracing field A is not mutually exclusive, then no trimming is performed; the first tracing field C and the start field are trimmed. The conditional operator (f==1orf==3) between the segments is judged to have a relationship with the write operator (f==3) between the first traceback field C and the second traceback field C. The conditional operator (f==1orf==3) between the first traceback field C and the start field and the write operator (f==3) between the first traceback field C and the second traceback field C are not mutually exclusive, so no trimming is performed; the conditional operator (f==1orf==3) between the first traceback field B and the start field and the write operator (f==2) between the first traceback field B and the second traceback field B are judged to have a relationship. The conditional operator (f==1orf==3) between the first traceback field B and the start field and the write operator (f==2) between the first traceback field B and the second traceback field B are mutually exclusive, so the first traceback field B and the second traceback field B are trimmed. The trimming result is as follows: Figure 5 As shown, the first tracing field A and the second tracing field A and the first tracing field C and the second tracing field C are retained, and the first tracing field B and the second tracing field B are trimmed.
[0093] The technical solution of the embodiment of the present invention obtains the target tracing field and the data processing script associated with the target tracing field, performs syntax analysis on the data processing script through a preset syntax analysis method, determines the abstract syntax tree corresponding to the data processing script, and directly reflects the dependency relationship in the data processing script by constructing the abstract syntax tree of the data processing script. The effective and clear dependency relationship improves the accuracy of constructing the data lineage map and improves the efficiency of data tracing; at least one direct lineage relationship is constructed according to the data field in the abstract syntax tree and the dependency relationship corresponding to each data field, and a data lineage map is constructed based on all the direct lineage relationships. The data lineage map constructed by the direct lineage relationship can prevent Stop duplicate data fields in the data lineage map, improve the accuracy of the data lineage map, and improve the precision of data tracing; construct a lineage clipping window corresponding to the target tracing field according to the data lineage map through a preset sliding window construction method, and perform lineage clipping on the target tracing field in the data lineage map through the lineage clipping window to determine the target lineage link corresponding to the target tracing field. The lineage clipping window can be used to clip the lineage relationship of the data lineage map, remove abnormal data in the lineage relationship of the target tracing field, improve the precision of the lineage link, and solve the technical problem of irrelevant data in the lineage tracing process of data in the prior art, resulting in too low tracing efficiency. Tracing through field-level lineage links will avoid a large amount of irrelevant upstream data, effectively improving the efficiency of tracing analysis.
[0094] Figure 6 The following is a schematic diagram of the structure of a data lineage tracing device provided by an embodiment of the present invention. Figure 6 As shown, the device includes: a syntax parsing module 610, a data bloodline graph construction module 620 and a bloodline relationship cutting module 630.
[0095] The syntax parsing module 610 is used to obtain the target tracing field and the data processing script associated with the target tracing field, perform syntax parsing on the data processing script using a preset syntax parsing method, and determine an abstract syntax tree corresponding to the data processing script;
[0096] A data lineage graph construction module 620 is used to construct at least one direct lineage relationship according to the data fields in the abstract syntax tree and the dependency relationship corresponding to each data field, and to construct a data lineage graph based on all the direct lineage relationships;
[0097] A blood relationship clipping module 630 is used to construct a blood relationship clipping window corresponding to the target tracing field according to the data blood relationship map by using a preset sliding window construction method, and to perform blood relationship clipping on the target tracing field in the data blood relationship map through the blood relationship clipping window to determine a target blood relationship link corresponding to the target tracing field;
[0098] The technical solution of the embodiment of the present invention obtains the target tracing field and the data processing script associated with the target tracing field, performs syntax analysis on the data processing script through a preset syntax analysis method, determines the abstract syntax tree corresponding to the data processing script, and directly reflects the dependency relationship in the data processing script by constructing the abstract syntax tree of the data processing script. The effective and clear dependency relationship improves the accuracy of constructing the data lineage map and improves the efficiency of data tracing; at least one direct lineage relationship is constructed according to the data field in the abstract syntax tree and the dependency relationship corresponding to each data field, and a data lineage map is constructed based on all the direct lineage relationships. The data lineage map constructed by the direct lineage relationship can prevent Stop duplicate data fields in the data lineage map, improve the accuracy of the data lineage map, and improve the precision of data tracing; construct a lineage clipping window corresponding to the target tracing field according to the data lineage map through a preset sliding window construction method, and perform lineage clipping on the target tracing field in the data lineage map through the lineage clipping window to determine the target lineage link corresponding to the target tracing field. The lineage clipping window can be used to clip the lineage relationship of the data lineage map, remove abnormal data in the lineage relationship of the target tracing field, improve the precision of the lineage link, and solve the technical problem of irrelevant data in the lineage tracing process of data in the prior art, resulting in too low tracing efficiency. Tracing through field-level lineage links will avoid a large amount of irrelevant upstream data, effectively improving the efficiency of tracing analysis.
[0099] Optionally, the blood relationship cutting module is specifically used for:
[0100] Obtaining a lineage link of a clipping window formed by data fields in the lineage clipping window;
[0101] Identify the lineage link length of the lineage link of the clipping window, perform lineage clipping on the lineage link of the clipping window according to the lineage link length, determine the clipped lineage link corresponding to the target traceability field, move the lineage clipping window according to a preset step length, and update the lineage link of the clipping window;
[0102] If the moved lineage clipping window does not have the clipping window lineage link, the clipping lineage link is used as the target lineage link.
[0103] Optionally, the blood relationship cutting module is further used for:
[0104] If there is a lineage link in the lineage cropping window after the move, return to execute the step of identifying the lineage link length of the lineage link of the cropping window, perform lineage cropping on the lineage link of the cropping window according to the lineage link length, determine the cropped lineage link corresponding to the target traceability field, and move the lineage cropping window according to the preset step size to update the lineage link of the cropping window.
[0105] Optionally, the blood relationship cutting module is further used for:
[0106] If the lineage link length of the trimming window lineage link is 2, then the data field corresponding to the start node in the lineage link length is used as the start field, at least one first tracing field is determined according to the direct lineage relationship of the start field, and at least one second tracing field is determined according to the direct lineage relationship of each of the first tracing fields;
[0107] The blood relationship is pruned in sequence according to the dependency relationship of each of the first tracing fields and the dependency relationship of the second tracing fields corresponding to each of the first tracing fields, to determine the pruned blood relationship link corresponding to the target tracing field.
[0108] Optionally, the blood relationship cutting module is further used for:
[0109] If the dependency relationship of the first tracing field and the dependency relationship of the second tracing field are mutually exclusive, the second tracing field is clipped, and the second tracing field is determined as a relationship tracing field, and the relationship tracing field is retroactively clipped;
[0110] In the case that there is no mutually exclusive relationship between the dependency of the first tracing field and the dependency of the second tracing field, the dependency of the target tracing field is propagated to update the dependency of the first tracing field.
[0111] Optionally, the blood relationship cutting module is further used for:
[0112] Acquire the blood relationship field of the relationship tracing field, clip the relationship tracing field, and determine whether the blood relationship field has a direct blood relationship that has not been clipped;
[0113] If the blood relationship field does not have any unclipped direct blood relationship, the blood relationship field is updated to a relationship tracing field, and the step of returning to obtain the blood relationship field of the relationship tracing field, pruning the relationship tracing field, and determining whether the blood relationship field has any unclipped direct blood relationship;
[0114] If there is a direct blood relationship that has not been trimmed in the blood relationship field, the trimming is terminated.
[0115] Optionally, the blood relationship cutting module is further used for:
[0116] If the lineage link length of the cropping window lineage link is 1, the cropping lineage link is determined according to the cropping window lineage link.
[0117] The data lineage tracing device provided in the embodiment of the present invention can execute the data lineage tracing method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0118] Figure 7 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their modes are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0119] like Figure 7 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. The input / output (I / O) interface 15 is also connected to the bus 14.
[0120] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer grid such as the Internet and / or various telecommunication grids.
[0121] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a data lineage tracing method.
[0122] In some embodiments, the data lineage tracing method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the data lineage tracing method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the data lineage tracing method in any other appropriate manner (e.g., by means of firmware).
[0123] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0124] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the modes / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0125] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, device, or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0126] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0127] The systems and techniques described herein may be implemented in a computing system that includes a backend component (e.g., as a data server), or a computing system that includes a middleware component (e.g., an application server), or a computing system that includes a frontend component (e.g., a user computer with a graphical user interface or a grid browser through which a user can interact with an implementation of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication grid). Examples of communication grids include: a local area network (LAN), a wide area network (WAN), a blockchain grid, and the Internet.
[0128] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication grid. The client and server relationship is generated by computer programs running on the respective computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0129] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0130] This embodiment provides a computer-readable storage medium having a computer program stored thereon. When the program is executed by a processor, the steps of the data lineage tracing method provided in any embodiment of the present invention are implemented. The method includes:
[0131] Acquire a target tracing field and a data processing script associated with the target tracing field, perform syntax parsing on the data processing script using a preset syntax parsing method, and determine an abstract syntax tree corresponding to the data processing script;
[0132] Constructing at least one direct blood relationship according to the data fields in the abstract syntax tree and the dependency relationship corresponding to each data field, and constructing a data blood relationship graph based on all the direct blood relationships;
[0133] A bloodline clipping window corresponding to the target tracing field is constructed according to the data bloodline map through a preset sliding window construction method, and the target tracing field is clipped for bloodline relationship in the data bloodline map through the bloodline clipping window to determine the target bloodline link corresponding to the target tracing field.
[0134] The computer storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to: an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.
[0135] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0136] The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0137] Computer program code for performing the operation of the present invention may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of grid, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0138] It should be understood by those skilled in the art that the above modules or steps of the present invention can be implemented by a general-purpose computing device, they can be concentrated on a single computing device, or distributed on a grid composed of multiple computing devices, optionally, they can be implemented by a program code executable by a computer device, so that they can be stored in a storage device and executed by the computing device, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
[0139] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0140] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A data lineage tracing method, characterized in that: include: Acquire a target tracing field and a data processing script associated with the target tracing field, perform syntax parsing on the data processing script using a preset syntax parsing method, and determine an abstract syntax tree corresponding to the data processing script; Constructing at least one direct blood relationship according to the data fields in the abstract syntax tree and the dependency relationship corresponding to each data field, and constructing a data blood relationship graph based on all the direct blood relationships; The method comprises: constructing a blood relationship clipping window corresponding to the target tracing field according to the data blood relationship map by a preset sliding window construction method, performing blood relationship clipping on the target tracing field in the data blood relationship map by the blood relationship clipping window, and determining a target blood relationship link corresponding to the target tracing field. The method comprises: Obtaining a lineage link of a clipping window formed by data fields in the lineage clipping window; Identify the lineage link length of the lineage link of the clipping window, perform lineage clipping on the lineage link of the clipping window according to the lineage link length, determine the clipped lineage link corresponding to the target traceability field, move the lineage clipping window according to a preset step length, and update the lineage link of the clipping window; If the moved lineage clipping window does not have the clipping window lineage link, the clipping lineage link is used as the target lineage link.
2. The method according to claim 1, characterized in that After the bloodline clipping window is moved according to the preset step length, the method further includes: If there is a lineage link in the lineage cropping window after the move, return to execute the step of identifying the lineage link length of the lineage link of the cropping window, perform lineage cropping on the lineage link of the cropping window according to the lineage link length, determine the cropped lineage link corresponding to the target traceability field, and move the lineage cropping window according to the preset step size to update the lineage link of the cropping window.
3. The method according to claim 1, characterized in that The performing blood relationship tailoring on the tailoring window blood relationship link according to the blood relationship link length to determine the tailored blood relationship link corresponding to the target traceability field includes: If the lineage link length of the trimming window lineage link is 2, then the data field corresponding to the start node in the lineage link length is used as the start field, at least one first tracing field is determined according to the direct lineage relationship of the start field, and at least one second tracing field is determined according to the direct lineage relationship of each of the first tracing fields; The blood relationship is pruned in sequence according to the dependency relationship of each of the first tracing fields and the dependency relationship of the second tracing fields corresponding to each of the first tracing fields, to determine the pruned blood relationship link corresponding to the target tracing field.
4. The method according to claim 3, characterized in that The performing blood relationship cutting according to the dependency relationship of each first tracing field and the dependency relationship of the second tracing field corresponding to each first tracing field in sequence includes: If the dependency relationship of the first tracing field and the dependency relationship of the second tracing field are mutually exclusive, the second tracing field is clipped, and the second tracing field is determined as a relationship tracing field, and the relationship tracing field is retroactively clipped; In the case that there is no mutually exclusive relationship between the dependency of the first tracing field and the dependency of the second tracing field, the dependency of the target tracing field is propagated to update the dependency of the first tracing field.
5. The method according to claim 4, characterized in that The tracing back and trimming the relationship tracing field includes: Acquire the blood relationship field of the relationship tracing field, clip the relationship tracing field, and determine whether the blood relationship field has a direct blood relationship that has not been clipped; If the blood relationship field does not have any unclipped direct blood relationship, the blood relationship field is updated to a relationship tracing field, and the step of returning to obtain the blood relationship field of the relationship tracing field, pruning the relationship tracing field, and determining whether the blood relationship field has any unclipped direct blood relationship; If there is a direct blood relationship that has not been trimmed in the blood relationship field, the trimming is terminated.
6. The method according to claim 1, characterized in that The method of performing blood relationship cutting on the cutting window blood relationship link according to the blood relationship link length to determine the cut blood relationship link corresponding to the target traceability field also includes: If the lineage link length of the cropping window lineage link is 1, the cropping lineage link is determined according to the cropping window lineage link.
7. A data lineage tracing device, characterized in that: include: A syntax parsing module, used to obtain a target tracing field and a data processing script associated with the target tracing field, perform syntax parsing on the data processing script using a preset syntax parsing method, and determine an abstract syntax tree corresponding to the data processing script; A data lineage graph construction module, used to construct at least one direct lineage relationship according to the data fields in the abstract syntax tree and the dependency relationship corresponding to each data field, and to construct a data lineage graph based on all the direct lineage relationships; A blood relationship clipping module, used to construct a blood relationship clipping window corresponding to the target tracing field according to the data blood relationship map by a preset sliding window construction method, and perform blood relationship clipping on the target tracing field in the data blood relationship map through the blood relationship clipping window to determine the target blood relationship link corresponding to the target tracing field; The blood relationship cutting module is specifically used for: Obtaining a lineage link of a clipping window formed by data fields in the lineage clipping window; Identify the lineage link length of the lineage link of the clipping window, perform lineage clipping on the lineage link of the clipping window according to the lineage link length, determine the clipped lineage link corresponding to the target traceability field, move the lineage clipping window according to a preset step length, and update the lineage link of the clipping window; If the moved lineage clipping window does not have the clipping window lineage link, the clipping lineage link is used as the target lineage link.
8. An electronic device, 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 a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the data lineage tracing method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the data lineage tracing method according to any one of claims 1 to 6 when executed.
