A data management and control method for heterogeneous data sources

By generating a unified set of metadata entities and performing incremental lineage updates, combined with permission arbitration, the problems of partial updates of metadata changes and permission management in heterogeneous data sources are solved, achieving real-time synchronization of lineage relationships and accuracy of permissions.

CN123179458APending Publication Date: 2026-11-27GUANGZHOU UNIPOWER COMP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611474111.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-21
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

Existing technologies cannot achieve incremental lineage propagation and partial updates based on metadata changes, and are prone to problems such as permission mismatch, permission omission, or excessive permission access in permission management of heterogeneous data sources.

Method used

By generating a unified set of metadata entities, performing abstract syntax tree normalization and operator-level field lineage mapping, monitoring metadata changes and performing incremental updates, and combining native permission policies to generate unified permission quadruples for permission arbitration.

Benefits of technology

It enables partial updates and real-time synchronization of bloodline relationships, avoids waste of computing resources, ensures the accuracy and consistency of permissions, avoids permission mismatch and omission, and achieves unified and reliable data access permission management in multi-source environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123179458A_ABST
    Figure CN123179458A_ABST
Patent Text Reader

Abstract

The application discloses a data management and control method for heterogeneous data sources, which relies on a metadata change set to drive blood relationship propagation and incremental update, does not need to reanalyze all jobs and full blood relationships, only realizes partial blood relationship update, solves the incremental blood relationship update problem under metadata change, reduces resource consumption, and ensures that blood relationships are timely synchronized with metadata changes; meanwhile, the original permission of the heterogeneous data source is converted into a unified permission quadruple, the permission arbitration is carried out in combination with a field-level blood relationship directed graph, the direct permission and the blood relationship derived permission are fused, the permission merging and conflict resolution are completed, the derived access permission brought by data flow can be completely captured, the permission omission is avoided, the permission conflict is handled, the defects of permission mismatch, omission and excessive opening are improved, and unified and reliable data access permission management and control in a multi-source heterogeneous scene is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data management technology, and in particular to a data management method for heterogeneous data sources. Background Technology

[0002] As enterprises continue to advance their digital transformation, a large number of heterogeneous data sources exist within enterprises, covering various types such as relational databases, data warehouses, object storage, and data warehouse engines. The metadata formats, permission systems, and SQL dialects of different data sources vary. In multi-source data fusion scenarios, data lineage tracing and unified permission control are the core requirements for data governance.

[0003] In existing technologies, when metadata changes (field addition, deletion, renaming, table structure modification), existing lineage systems mostly update lineage relationships by re-parseing all data. This method incurs high computational overhead, has poor real-time performance, and cannot achieve incremental lineage propagation and partial updates based on metadata changes. Furthermore, regarding access control, each heterogeneous data source maintains its own independent native access control policy. Access control models from different data sources are incompatible, and access control rules cannot be managed uniformly. Most existing solutions only perform access control based on local objects within the data source, lacking the ability to arbitrate lineage-derived permissions by incorporating field-level lineage relationships. They cannot identify indirect access permissions derived during data flow, and when metadata changes, the access control system cannot be updated synchronously with the lineage relationships, easily leading to issues such as access mismatch, missing permissions, or excessive access. Summary of the Invention

[0004] In view of this, the present invention proposes a data management method for heterogeneous data sources, which can effectively solve the defects of existing technologies, such as the inability to achieve incremental lineage propagation and local updates based on metadata changes, and the easy occurrence of permission mismatch, permission omission, or excessive permission opening.

[0005] The technical solution of this invention is implemented as follows:

[0006] A data management and control method for heterogeneous data sources, specifically including:

[0007] Step S1: Obtain the native metadata of each heterogeneous data source, and generate a unified metadata entity set based on the native metadata. The unified metadata entity set includes data source instance entities, library schema entities, table view materialized view entities, field entities, and job entities.

[0008] Step S2: Using the structured query language text in the job entity as the processing object, and combining the data source instance entity, library schema entity, table view materialized view entity, and field entity, perform abstract syntax tree normalization processing and operator-level field lineage mapping processing to generate a field-level lineage directed graph.

[0009] Step S3: Monitor metadata changes to obtain a metadata change set. Combine the unified metadata entity set and the metadata change set, perform lineage propagation and incremental update processing on the field-level lineage directed graph to obtain the updated field-level lineage directed graph.

[0010] Step S4: Translate the native permission policies of each heterogeneous data source into a unified permission quadruple, combine the unified metadata entity set and the updated field-level lineage directed graph to perform permission arbitration, and generate a data access permission policy.

[0011] As a further optional solution to the data management method for heterogeneous data sources, the data source instance entity attributes include a unique identifier for the data source instance, the data source instance name, the data source type, connection information, synchronization strategy, and data source priority; the database schema entity attributes include a unique identifier for the database schema and the database schema name; the table-view-materialized-view entity attributes include a unique identifier for the table, the table name, the table type, the storage format, the partition key array, the primary key array, the foreign key array, and the metadata version number; the field entity attributes include a unique identifier for the field, the field name, the field type, whether it is a partition key, whether it is a primary key, and whether it can be nullable; the job entity attributes include a unique identifier for the job, the job type, the original Structured Query Language text, the Structured Query Language dialect, the status, the creation time, and the end time.

[0012] As a further optional solution to the data management method for heterogeneous data sources, step S2 specifically includes:

[0013] Identify the dialect type of the structured query language text in the task entity, and parse the structured query language text to generate the native abstract syntax tree of the corresponding dialect;

[0014] Transform the native abstract syntax tree into an intermediate object of a unified relational algebra tree;

[0015] For each operator node of the intermediate object in the unified relational algebra tree, field-level lineage directed edges are generated according to the preset operator lineage mapping rules;

[0016] Based on all field-level lineage directed edges and field nodes obtained from the field entities, a field-level lineage directed graph is constructed; wherein, the vertices of the field-level lineage directed graph are field nodes identified by a quadruple consisting of a unique identifier of the data source instance, a unique identifier of the library schema, a unique identifier of the table, and a unique identifier of the field; the edges of the field-level lineage directed graph include source node, target node, edge type, expression text, job unique identifier, creation time, and materialized view number attribute.

[0017] As a further optional solution to the aforementioned data management method for heterogeneous data sources, the preset operator lineage mapping rule includes:

[0018] Table scan operator rules are used to record origin edges, pointing to the physical source table field;

[0019] Projection operator rules are used to generate direct bloodline edges for pure column references in the output column expression, and to generate expression bloodline edges for non-pure column references, while also recording the expression text.

[0020] Filtering operator rules are used to generate filtering dependency edges for filtering predicate reference columns and record the predicate text;

[0021] Connect operator rules are used to generate connection type lineage edges across multi-source output columns, and record the connection condition and connection key columns;

[0022] Aggregate operator rules are used to generate direct lineage edges for grouping fields, aggregate lineage edges for aggregate function output columns, and to count the association table identifiers of all output columns.

[0023] Joint operator rules are used to generate joint lineage edges for each branch of the output column;

[0024] Window operator rules are used to generate expression bloodlines in the output columns of window functions, and record partitioning, sorting, and window range information.

[0025] Common table expressions and subquery operator rules are used to recursively parse internal lineages and map internal output columns to outer references to generate lineage edges.

[0026] Insert, create, and query operator rules are used to generate derived lineage edges between target table fields and query output fields, and to associate unique identifiers for jobs.

[0027] As a further optional solution to the data management method for heterogeneous data sources, step S3 specifically includes:

[0028] Monitoring metadata changes yields a set of metadata changes;

[0029] Based on the metadata change set, obtain the set of changed field nodes, and traverse forward along the outgoing edges of the field-level lineage directed graph to calculate the set of affected nodes;

[0030] Obtain the job entity associated with the metadata change set, reuse the processing logic of abstract syntax tree normalization and operator-level field lineage mapping in step S2 to obtain the updated local lineage subgraph, and use the local lineage subgraph to replace the corresponding subgraph part of the field-level lineage directed graph.

[0031] Set failure flags for downstream nodes corresponding to the affected node set, and attach failure flag attributes to the original nodes in the field-level lineage directed graph;

[0032] For lineage edges with cross-directory markers in the field-level lineage directed graph, perform snapshot version alignment processing and update the snapshot version information associated with the lineage edge;

[0033] After replacing the local lineage subgraph, setting node failure markers, and aligning cross-directory lineage edge snapshot versions, the updated field-level lineage directed graph is obtained.

[0034] As a further optional solution to the data management method for heterogeneous data sources, the step of obtaining the set of changed field nodes based on the metadata change set, and traversing forward along the outgoing edges of the field-level lineage directed graph to calculate the set of affected nodes specifically includes:

[0035] Parse the metadata change records in the metadata change set, extract the unique identifier of the field entity corresponding to the change, and obtain the set of changed field nodes based on the unique identifier of the field entity.

[0036] Add all nodes in the set of changed field nodes to the processing queue, and simultaneously add them to the set of affected nodes;

[0037] The current processing node is retrieved from the processing queue in a loop, and all outgoing edges of the current processing node in the field-level lineage directed graph are traversed to obtain the target node corresponding to each outgoing edge.

[0038] Determine whether the target node has been included in the affected node set. If not, mark the target node as affected, add the target node to the affected node set, and add the target node to the processing queue.

[0039] Repeat the loop traversal operation until the processing queue is empty, and output the set of affected nodes that have been calculated.

[0040] As a further optional solution to the aforementioned data management method for heterogeneous data sources, the step of performing snapshot version alignment processing on lineage edges with cross-directory markers in a field-level lineage directed graph, and updating the snapshot version information associated with the lineage edge, specifically includes:

[0041] Traverse all lineage edges in the field-level lineage directed graph and filter out lineage edges that carry cross-directory markers;

[0042] Read the directory snapshot version of the source node and the directory snapshot version of the target node of the filtered bloodline edge;

[0043] Compare the snapshot version of the directory corresponding to the source node with the snapshot version of the directory corresponding to the target node to determine whether they are consistent;

[0044] If the snapshot version of the directory corresponding to the source node is inconsistent with the snapshot version of the directory corresponding to the target node, the directory with the lagging snapshot version is identified, the latest metadata of the lagging directory is pulled, and the snapshot version information associated with the bloodline edge is updated based on the latest metadata pulled.

[0045] If the snapshot version of the directory corresponding to the source node is the same as the snapshot version of the directory corresponding to the target node, then the snapshot version information associated with the bloodline edge remains unchanged;

[0046] Complete the snapshot version alignment process for all lineage edges carrying cross-directory tags, output the lineage edges with completed snapshot version alignment, and write them back to the field-level lineage directed graph.

[0047] As a further optional solution to the data management method for heterogeneous data sources, step S4 specifically includes:

[0048] Read the native permission policies of various heterogeneous data sources, parse the subject information, object information, operation type and constraint conditions in the native permission policies, and translate them to generate a unified permission quadruple;

[0049] The unified permission quadruple is matched and verified with the unified metadata entity set to verify whether the metadata object pointed to by the unified permission quadruple exists in the unified metadata entity set.

[0050] Based on the verified unified permission quadruple, combined with the updated field-level bloodline directed graph, the associated attributes of bloodline edges are traversed to identify bloodline-derived permissions.

[0051] Based on the preset permission arbitration rules, direct permissions and bloodline-derived permissions are merged and conflict-resolved to obtain the data access permission policy.

[0052] As a further optional solution to the aforementioned data management method for heterogeneous data sources, the step of merging and resolving conflicts between direct permissions and lineage-derived permissions according to preset permission arbitration rules to obtain a data access permission policy specifically includes:

[0053] According to the preset permission arbitration rules, direct permissions and bloodline-derived permissions are merged, and multiple permission records under the same subject and the same access object are aggregated.

[0054] Identify permission conflicts between aggregated permission records;

[0055] Based on conflict priority, conflict resolution is performed on permission records with conflicting permissions to determine the final effective permissions;

[0056] The final permissions are encapsulated in a structured manner to obtain the data access permission policy.

[0057] A data management and control system for heterogeneous data sources includes:

[0058] The metadata collection and generation module is used to acquire the native metadata of various heterogeneous data sources and generate a unified metadata entity set based on the native metadata. The unified metadata entity set includes data source instance entities, library schema entities, table view materialized view entities, field entities, and job entities.

[0059] The field-level lineage generation module is used to take the structured query language text in the job entity as the processing object, and combine it with the data source instance entity, library schema entity, table view materialized view entity, and field entity to perform abstract syntax tree normalization processing and operator-level field lineage mapping processing to generate a field-level lineage directed graph.

[0060] The bloodline incremental update module is used to monitor metadata changes to obtain a set of metadata changes. Combining the unified metadata entity set and the set of metadata changes, it performs bloodline propagation and incremental update processing on the field-level bloodline directed graph to obtain the updated field-level bloodline directed graph.

[0061] The permission arbitration generation module is used to translate the native permission policies of various heterogeneous data sources into a unified permission quadruple, and combine it with the unified metadata entity set and the updated field-level lineage directed graph to perform permission arbitration and generate data access permission policies.

[0062] The beneficial effects of this invention are as follows: By relying on metadata change sets to drive lineage propagation and incremental updates, it eliminates the need to re-parse and calculate all jobs and all lineage relationships, achieving partial updates of lineage relationships. This effectively solves the problem that existing technologies struggle to complete incremental lineage propagation updates based on metadata changes, reduces computational resource consumption, and ensures that lineage relationships can be synchronized in a timely manner with metadata changes. Secondly, it unifies heterogeneous data source permissions into unified permission quadruples and combines them with field-level lineage directed graphs to complete permission arbitration. It comprehensively handles direct permissions and lineage-derived permissions, performs permission merging and conflict resolution, and can fully cover the derived access permissions generated by data flow, avoiding permission omissions. At the same time, it handles permission conflicts, effectively improving the shortcomings of existing technologies such as permission mismatch, permission omissions, and excessive permission openness, and achieving unified and reliable data access permission management in a multi-source environment. Attached Figure Description

[0063] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0064] Figure 1 This is a flowchart illustrating a data management method for heterogeneous data sources according to the present invention. Detailed Implementation

[0065] The technical solutions in the embodiments of the present invention will be clearly and completely described below. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0066] Example 1: This example corresponds to the complete implementation process of the method described in this invention. Refer to... Figure 1 This embodiment provides a data management method for heterogeneous data sources, applied to enterprise multi-source data governance scenarios. The enterprise contains heterogeneous data sources such as MySQL, Hive, and ClickHouse, each with independent metadata, SQL dialects, and permission configurations. The method includes four steps: metadata collection (step S1), field-level lineage generation (step S2), incremental lineage update (step S3), and permission arbitration generation (step S4).

[0067] Step S1: Obtain the native metadata of each heterogeneous data source, and generate a unified metadata entity set based on the native metadata. The unified metadata entity set includes data source instance entities, library schema entities, table view materialized view entities, field entities, and job entities.

[0068] In one specific implementation, the system connects to three heterogeneous data sources: MySQL, Hive, and ClickHouse. It retrieves native metadata from each data source through a pre-defined metadata synchronization task. For each connected data source, a data source instance entity is created, with attributes configured as a unique identifier, name, type, connection information, synchronization strategy, and priority. A database schema entity is generated based on the database / schema information within the data source, with attributes configured as a unique identifier and name. All tables, views, and materialized views under the database are traversed to generate table-view-materialized view entities, with attributes configured as a unique identifier, name, type, storage format, partition key array, primary key array, foreign key array, and metadata version number. The table structure is parsed to obtain field entities, with attributes configured as a unique identifier, name, type, whether it is a partition key, whether it is a primary key, and whether it can be nullable. Data processing job information is collected to generate job entities, with attributes configured as a unique identifier, job type, original structured query language text, structured query language dialect, status, creation time, and end time. All generated data source instance entities, library schema entities, table view materialized view entities, field entities, and job entities are aggregated to obtain a unified metadata entity set.

[0069] Specifically, by connecting to multiple heterogeneous data sources and modeling native metadata according to a unified entity model, five types of metadata objects—data source instances, database schemas, table views, materialized views, fields, and jobs—are uniformly abstracted into entities with consistent attribute structures. Hierarchical relationships are established through unique identifiers and associated fields for each entity, bringing metadata scattered across different data sources and with varying formats under a unified entity system. This provides a unified data object foundation for subsequent multi-dialect SQL lineage parsing, incremental propagation based on metadata changes, and cross-source permission arbitration, thereby helping to eliminate parsing and governance obstacles caused by inconsistencies in metadata models between heterogeneous data sources. Specifically, the metadata version number attribute in the table view materialized view entity provides version identification for subsequent metadata change monitoring and incremental lineage updates; the job entity retains the original structured query language text and dialect type, providing input for subsequent dialect-based parsing and lineage mapping; and the relationships established between entities through unique identifiers provide data sources for the field-level lineage directed graph, which identifies field nodes using four-tuples.

[0070] Step S2: Using the structured query language text in the job entity as the processing object, and combining it with the data source instance entity, library schema entity, table view materialized view entity, and field entity, perform abstract syntax tree normalization processing and operator-level field lineage mapping processing to generate a field-level lineage directed graph, specifically including:

[0071] Identify the dialect type of the structured query language text in the task entity, and parse the structured query language text to generate the native abstract syntax tree of the corresponding dialect;

[0072] Transform the native abstract syntax tree into an intermediate object of a unified relational algebra tree;

[0073] For each operator node of the intermediate object in the unified relational algebra tree, field-level lineage directed edges are generated according to the preset operator lineage mapping rules;

[0074] Based on all field-level lineage directed edges and field nodes obtained from the field entities, a field-level lineage directed graph is constructed; wherein, the vertices of the field-level lineage directed graph are field nodes identified by a quadruple consisting of a unique identifier of the data source instance, a unique identifier of the library schema, a unique identifier of the table, and a unique identifier of the field; the edges of the field-level lineage directed graph include source node, target node, edge type, expression text, job unique identifier, creation time, and materialized view number attribute.

[0075] Specifically, it reads the raw structured query language text stored in the job entity within the unified metadata entity set, identifies the SQL dialect type to which the SQL text belongs, such as Hive SQL, MySQL SQL, or ClickHouse SQL; calls the parser that matches the dialect, performs lexical and syntactic parsing on the structured query language text, and generates the native abstract syntax tree of the corresponding dialect.

[0076] The native abstract syntax trees corresponding to different dialects are converted into a unified relational algebra intermediate object that is independent of specific SQL dialects. The unified relational algebra intermediate object contains standardized operator nodes such as table scan, projection, filtering, join, aggregation, union, window, and subquery.

[0077] Traverse all operator nodes within the intermediate object of the unified relational algebra tree and generate field-level lineage directed edges according to the preset operator lineage mapping rules.

[0078] Field nodes are constructed using field entities in a unified metadata entity set. Each field node is uniquely identified by a quadruple consisting of a unique identifier for the data source instance, a unique identifier for the database schema, a unique identifier for the table, and a unique identifier for the field. A field-level lineage directed graph is constructed based on all generated field-level lineage directed edges and field nodes. Each lineage edge in the field-level lineage directed graph carries the attributes of source node, target node, edge type, expression text, job unique identifier, creation time, and materialized view number.

[0079] In this way, the SQL dialect parsing process from different data sources is decoupled from the lineage mapping process. First, the native abstract syntax tree is obtained by parsing according to the dialect, and then it is converted into a unified relational algebra tree intermediate object. This eliminates the impact of differences in SQL dialect syntax on lineage parsing and avoids problems such as lineage parsing failure and lineage breakage caused by dialect differences. Secondly, operator-level field lineage mapping is performed based on standardized operator nodes, which can finely identify the data dependency relationship between fields within each operator and accurately generate field-level lineage directed edges. In addition, field nodes use quadruples to identify the field entities across data sources, databases, and tables. Lineage edges carry multi-dimensional auxiliary attributes, and the constructed field-level lineage directed graph can completely record the data flow relationship between fields.

[0080] In one specific implementation, the preset operator lineage mapping rule includes:

[0081] The table scan operator rule is used to read the fields of the physical source table, generate the origin edge, and mark the edge as the starting point of the original field of the data source;

[0082] The projection operator rule is used to determine the type of the output column expression. If it is only a simple column reference, a direct bloodline edge is generated. If it contains non-pure column reference expressions such as functions and constant operations, an expression bloodline edge is generated, and the complete expression text is stored in the bloodline edge attribute.

[0083] Filtering operator rules are used to extract fields referenced in the WHERE filter predicate, generate filter dependency edges, synchronously save the predicate text, and record the dependency relationship of fields in the filter conditions.

[0084] Join operator rules are used for multi-table JOIN scenarios to identify join key columns, generate join type lineage edges for output columns across multiple data sources, and record join conditions and join key column information;

[0085] Aggregate operator rules are used to generate direct lineage edges for grouping fields; the output columns of aggregate functions such as SUM and COUNT generate aggregate lineage edges; when counting all rows, the output columns are associated with the corresponding table identifiers;

[0086] The joint operator rule is used for the UNION / UNION ALL operator to match the output columns with the corresponding input fields in each query branch to generate joint lineage edges;

[0087] Window operator rules are used to identify output columns of window functions such as ROW_NUMBER and RANK, generate expression lineage edges, and record partition fields, sorting fields, and window range information in the edge attributes;

[0088] Common table expressions and subquery operator rules are used to recursively parse subqueries and operator lineages within CTEs, mapping the output fields inside the subquery to the reference positions in the outer SQL, and generating corresponding lineage edges;

[0089] Insert, table creation, and query operator rules are used to identify INSERT and CREATE TABLE AS SELECT statements, generate derived lineage edges between target table fields and query output fields, and bind unique job identifiers.

[0090] Thus, by setting independent lineage mapping rules for different types of operators in the relational algebra tree, it is possible to distinguish the field dependencies corresponding to different SQL operation logics. This not only identifies direct field-transmitted relationships but also captures indirect dependencies caused by complex operations such as filtering, aggregation, windowing, joining, and subqueries, fully covering data flow scenarios for various SQL statements. Secondly, the lineage edges generated by different operators carry corresponding business attribute information, which can distinguish the type of lineage edges. This facilitates the subsequent identification of different dependency patterns between fields, improves the granularity and accuracy of lineage relationships, and avoids the problems of missing or incomplete lineage links in complex SQL scenarios.

[0091] Step S3: Monitor metadata changes to obtain a metadata change set. Combine the unified metadata entity set and the metadata change set, perform lineage propagation and incremental update processing on the field-level lineage directed graph to obtain the updated field-level lineage directed graph. Specifically, this includes:

[0092] By listening to the metadata change interface of heterogeneous data sources or periodically polling the metadata version number field, events such as table addition, table deletion, field addition, field deletion, field renaming, and field type change are captured. Each change event is encapsulated into a change record containing the change type, the unique identifier of the changed field entity, the metadata snapshot before the change, the metadata snapshot after the change, and the change time. All change records are collected to obtain a metadata change set.

[0093] Based on the metadata change set, obtain the set of changed field nodes, and traverse forward along the outgoing edges of the field-level lineage directed graph to calculate the set of affected nodes;

[0094] Based on the metadata change set, the original structured query language text in the job entity references the job whose fields have changed, and the set of job entities associated with this change is determined. Only the structured query language text corresponding to this set of job entities is loaded, and the dialect recognition and parsing, native abstract syntax tree generation, unified relational algebra tree conversion and operator-level field lineage mapping processing logic in step S2 are reused to regenerate the field-level lineage directed edges of the affected jobs, and the updated local lineage subgraph is obtained. The local lineage subgraph is used to replace the corresponding subgraph part in the field-level lineage directed graph, and the lineage subgraphs that have not changed are kept in the original cache.

[0095] Traverse the set of affected nodes. For downstream nodes whose upstream fields no longer exist due to field deletion or renaming, add an invalidation flag attribute to such nodes in the field-level lineage directed graph to mark that the current lineage relationship of the node may be unreliable. After the incremental parsing is completed, remove the invalidation flag on nodes with restored valid lineage relationships.

[0096] For lineage edges with cross-directory markers in the field-level lineage directed graph, perform snapshot version alignment processing and update the snapshot version information associated with the lineage edge;

[0097] After completing the replacement of local lineage subgraphs, setting node failure markers, and aligning cross-directory lineage edge snapshot versions, the updated field-level lineage directed graph will be written back and stored.

[0098] Thus, by using the metadata change set as the trigger entry point for incremental updates, and propagating forward along the outgoing edges of the field-level lineage directed graph from the changed field node, the calculation scope of lineage updates is narrowed from the full job to the local job and local subgraph associated with the affected node set. This avoids re-parsing all jobs and rebuilding the entire lineage graph, thereby reducing the overhead of lineage recalculation triggered by metadata changes and improving the real-time performance of lineage relationships updating synchronously with metadata changes. Secondly, only the processing logic of step S2 is reused to regenerate the local lineage subgraph for associated jobs and replace the corresponding parts. Subgraphs without changes are directly reused from the original cache, further reducing redundant calculations. At the same time, failure markers are added to downstream nodes caused by field deletion and renaming, which can identify nodes whose lineage relationships may be unreliable and avoid incorrect downstream judgments based on outdated lineage relationships. In addition, snapshot version alignment is performed on lineage edges with cross-directory markers, which can keep the metadata versions at both ends of the cross-data source lineage edge consistent and avoid lineage pointing errors due to metadata lag on one side.

[0099] In one specific implementation, the step of obtaining the set of changed field nodes based on the metadata change set, and then traversing forward along the outgoing edges of the field-level lineage directed graph to calculate the set of affected nodes specifically includes:

[0100] Parse the metadata change records in the metadata change set, extract the unique identifier of the field entity corresponding to the change, and obtain the set of changed field nodes based on the unique identifier of the field entity.

[0101] Add all nodes in the set of changed field nodes to the processing queue, and simultaneously add them to the set of affected nodes;

[0102] The process iterates through the processing queue, retrieving a current processing node and reading all outgoing edges of that node in the field-level lineage directed graph. It then retrieves the target node pointed to by each outgoing edge and checks if each target node already exists in the affected node set. If a target node is not yet in the affected node set, it is marked as an affected node, added to the affected node set, and simultaneously placed into the processing queue for further iteration. If a target node is already in the affected node set, it is skipped and not added to the queue again.

[0103] Repeat the loop traversal operation until the processing queue is empty, and output the set of affected nodes that have been calculated.

[0104] Thus, by using the field node corresponding to the metadata change as the starting point for traversal, and employing a queue to traverse the outgoing edges of the directed lineage graph in a forward direction, the impact is propagated layer by layer along the data flow direction, capturing all downstream dependent field nodes at once, and accurately locking the set of all affected nodes affected by the metadata change. Secondly, this traversal method does not scan nodes in the lineage graph that are unrelated to the current change, which can quickly define the scope of the lineage that needs to be re-parsed, providing accurate boundaries for subsequent local lineage subgraph updates, avoiding indiscriminate full recalculation of the lineage graph, effectively reducing the calculation scope of incremental updates, reducing unnecessary computational overhead, and improving the efficiency of lineage updates after metadata changes.

[0105] In one specific implementation, the step of performing snapshot version alignment processing on kinship edges with cross-directory markers in a field-level kinship directed graph, and updating the snapshot version information associated with the kinship edge, specifically includes:

[0106] For each cross-directory lineage edge obtained through filtering, the data source instance entity to which the source node belongs is located based on the unique identifier of the data source instance in the source node quadruple, and the current directory snapshot version number saved by the data source instance entity is read; at the same time, the data source instance entity to which the target node belongs is located based on the unique identifier of the data source instance in the target node quadruple, and the current directory snapshot version number saved by the data source instance entity is read.

[0107] Compare the snapshot version number on the source side with the snapshot version number on the target side to determine if they are consistent. If the version numbers are consistent, it means that the metadata snapshots of the two data sources are in the same version state. The snapshot version information associated with this cross-directory lineage edge remains unchanged, and the next cross-directory lineage edge is processed.

[0108] If the version numbers are inconsistent, compare the size of the version numbers on both sides and identify the side with the smaller version number as the directory with the lagging snapshot version. Based on the unique identifier of the data source instance corresponding to the lagging directory, initiate a metadata fetch request to the data source instance to fetch the latest database schema, table view materialized view, and field metadata in that directory. Based on the latest metadata fetched, update the attributes and version numbers of the corresponding data source instance entity, database schema entity, table view materialized view entity, and field entity in the unified metadata entity set, and update the snapshot version numbers on both sides of the bloodline edge to align them to a consistent state.

[0109] Repeat the above process of version reading, version comparison, and pull update from the lagging side until all bloodline edges carrying cross-directory markers have completed snapshot version alignment. Write the processed bloodline edges and their updated snapshot version attributes back to the field-level bloodline directed graph to complete this snapshot version alignment process.

[0110] Thus, by traversing the directed lineage graph to filter out lineage edges carrying cross-directory markers, snapshot version verification is performed on cross-data source lineage edges in a targeted manner, avoiding meaningless cross-version comparisons of lineage edges within the same data source. Secondly, by comparing the snapshot version numbers of the data source instances to which the nodes on both sides of the lineage edge belong, the lagging side is identified when versions are inconsistent, and the latest metadata is pulled for alignment, ensuring that the metadata referenced by both ends of the cross-data source lineage edge is in the same version state. This avoids lineage pointing errors caused by changes in metadata on one side of the data source while the other side has not yet synchronized, ensuring the accuracy and timeliness of cross-data source field-level lineage relationships. At the same time, metadata retrieval and updates are only performed on the lagging side directory, rather than re-collecting all data source metadata, which can reduce the data transmission and computation overhead caused by cross-source metadata alignment.

[0111] Step S4: Translate the native permission policies of each heterogeneous data source into a unified permission quadruple, combine it with the unified metadata entity set and the updated field-level lineage directed graph to perform permission arbitration, and generate a data access permission policy, specifically including:

[0112] It reads native permission policies from heterogeneous data sources such as MySQL, Hive, and ClickHouse, parses the subject information, object information, operation type, and constraints within the native permission policies, and translates the differentiated permission syntax of different data sources into a unified permission four-tuple of [subject, object, operation, constraint]. For example, it converts Hive's GRANT SELECT ON TABLE statement and MySQL's column-level authorization statement into this four-tuple format, where the subject is the user / role identifier, the object is the unique identifier of the metadata object, the operation is the operation type such as read / write, and the constraint is additional restrictions such as row filtering and data anonymization.

[0113] The object information in the generated unified permission quadruple is matched and verified with the unique entity identifier in the unified metadata entity set to determine whether the metadata object pointed to by the quadruple exists in the unified metadata entity set. If the object does not exist, the permission record is deemed invalid and discarded directly. If the object exists, the unified permission quadruple is retained to obtain the permission set that passes the verification.

[0114] Based on the verified unified permission quadruple, combined with the updated field-level lineage directed graph, the unique job identifier and field quadruple carried by the lineage edge are traversed, and the lineage-derived permissions derived in the data flow link are identified by tracing forward along the edge of the lineage directed graph: when a user has access rights to the upstream source field, the derived access rights of the target field obtained by the downstream calculation and flow are automatically derived.

[0115] Based on the preset permission arbitration rules, direct permissions and bloodline-derived permissions are merged and conflict-resolved to obtain the data access permission policy.

[0116] In this way, the native permission policies of multiple heterogeneous data sources are uniformly translated into standardized permission quadruples, shielding the differences in permission syntax and authorization models of different data sources and achieving a unified expression of multi-source permissions. Secondly, by performing object matching and verification with a unified metadata entity set, invalid permissions that do not exist in the metadata object are filtered out, reducing the interference of invalid permissions on the arbitration process. At the same time, relying on the updated field-level lineage directed graph to identify lineage-derived permissions, indirect access permissions generated during data flow can be captured, avoiding the omission of downstream data permissions due to configuring only direct permissions. In addition, through permission merging and conflict resolution, the overlap and mutual exclusion conflicts between direct permissions and derived permissions are uniformly handled, preventing excessive permissions or missing permissions. Finally, a unified and conflict-free data access permission policy is output, realizing unified permission control at the field level in cross-heterogeneous data source scenarios.

[0117] In one specific implementation, the step of merging and resolving conflicts between direct permissions and lineage-derived permissions according to preset permission arbitration rules to obtain a data access permission policy specifically includes:

[0118] According to the preset permission arbitration rules, the permission merging process is performed on the set of permissions to be arbitrated: using the subject identifier, the access object quadruple, and the operation type as the union key, multiple permission records of the same subject performing the same operation on the same access object are aggregated into a single merge record. The intersection of the constraints in each record is taken as the constraint of the merge record. At the same time, the number of direct permission sources and the number of lineage-derived permission sources contained in the merge record are recorded.

[0119] Each aggregated permission record is checked for conflict: whether there are records that allow access and records that deny access under the same composite key, and whether there are permission records with mutually exclusive operation types. The identified conflict items are marked as conflicts to be resolved.

[0120] According to the pre-configured conflict priority in the preset permission arbitration rules, conflict resolution is performed on the marked conflicts to be resolved: when both allow and deny permissions exist, the final effective permission under the composite key is determined as deny according to the rule of deny permission priority; when operation types are mutually exclusive, the operation type with the highest priority is selected as the final effective operation according to the operation type priority from high to low; for permission records without conflicts, their permission configuration is directly retained.

[0121] All final effective permission records determined after merging and conflict resolution are encapsulated in a structured manner. Each record is encapsulated as structured data containing subject identifier, access object quadruple, operation type, constraint condition, permission source type, and effective time. The complete set of data access permission policies is then aggregated and persistently stored.

[0122] Thus, by aggregating and merging direct permissions and lineage-derived permissions using the subject, access object, and operation type as the joint key, multiple scattered permission records are consolidated into a unified record, avoiding fragmented storage of permission information for the same subject on the same object, and providing a complete permission view for subsequent conflict identification. Secondly, by identifying permission conflicts such as the coexistence of allow and deny, and mutual exclusion of operation types, and performing resolution according to preset conflict priorities, permission conflicts are explicitly handled rather than implicitly coexisting, thereby avoiding uncertainty in permission results caused by the superposition of multiple permission records.

[0123] Example 2, System Implementation: A data management and control system for heterogeneous data sources, comprising:

[0124] The metadata collection and generation module is used to acquire the native metadata of various heterogeneous data sources and generate a unified metadata entity set based on the native metadata. The unified metadata entity set includes data source instance entities, library schema entities, table view materialized view entities, field entities, and job entities.

[0125] The field-level lineage generation module is used to take the structured query language text in the job entity as the processing object, and combine it with the data source instance entity, library schema entity, table view materialized view entity, and field entity to perform abstract syntax tree normalization processing and operator-level field lineage mapping processing to generate a field-level lineage directed graph.

[0126] The bloodline incremental update module is used to monitor metadata changes to obtain a set of metadata changes. Combining the unified metadata entity set and the set of metadata changes, it performs bloodline propagation and incremental update processing on the field-level bloodline directed graph to obtain the updated field-level bloodline directed graph.

[0127] The permission arbitration generation module is used to translate the native permission policies of various heterogeneous data sources into a unified permission quadruple, and combine it with the unified metadata entity set and the updated field-level lineage directed graph to perform permission arbitration and generate data access permission policies.

[0128] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A data management and control method for heterogeneous data sources, characterized in that, Specifically, it includes: Step S1: Obtain the native metadata of each heterogeneous data source, and generate a unified metadata entity set based on the native metadata. The unified metadata entity set includes data source instance entities, library schema entities, table view materialized view entities, field entities, and job entities. Step S2: Using the structured query language text in the job entity as the processing object, and combining the data source instance entity, library schema entity, table view materialized view entity, and field entity, perform abstract syntax tree normalization processing and operator-level field lineage mapping processing to generate a field-level lineage directed graph. Step S3: Monitor metadata changes to obtain a metadata change set. Combine the unified metadata entity set and the metadata change set, perform lineage propagation and incremental update processing on the field-level lineage directed graph to obtain the updated field-level lineage directed graph. Step S4: Translate the native permission policies of each heterogeneous data source into a unified permission quadruple, combine the unified metadata entity set and the updated field-level lineage directed graph to perform permission arbitration, and generate a data access permission policy.

2. The data management and control method for heterogeneous data sources according to claim 1, characterized in that, The data source instance entity attributes include a unique identifier for the data source instance, the data source instance name, the data source type, connection information, synchronization strategy, and data source priority; the database schema entity attributes include a unique identifier for the database schema and the database schema name; the table-view materialized view entity attributes include a unique identifier for the table, the table name, the table type, the storage format, the partition key array, the primary key array, the foreign key array, and the metadata version number. The field entity attributes include field unique identifier, field name, field type, whether it is a partition key, whether it is a primary key, and whether it can be null; the job entity attributes include job unique identifier, job type, original structured query language text, structured query language dialect, status, creation time, and end time.

3. The data management and control method for heterogeneous data sources according to claim 2, characterized in that, Step S2 specifically includes: Identify the dialect type of the structured query language text in the task entity, and parse the structured query language text to generate the native abstract syntax tree of the corresponding dialect; Transform the native abstract syntax tree into an intermediate object of a unified relational algebra tree; For each operator node of the intermediate object in the unified relational algebra tree, field-level lineage directed edges are generated according to the preset operator lineage mapping rules; Based on all field-level lineage directed edges and field nodes obtained from the field entities, a field-level lineage directed graph is constructed; wherein, the vertices of the field-level lineage directed graph are field nodes identified by a quadruple consisting of a unique identifier of the data source instance, a unique identifier of the library schema, a unique identifier of the table, and a unique identifier of the field; the edges of the field-level lineage directed graph include source node, target node, edge type, expression text, job unique identifier, creation time, and materialized view number attribute.

4. The data management and control method for heterogeneous data sources according to claim 3, characterized in that, The preset operator lineage mapping rules include: Table scan operator rules are used to record origin edges, pointing to the physical source table field; Projection operator rules are used to generate direct bloodline edges for pure column references in the output column expression, and to generate expression bloodline edges for non-pure column references, while also recording the expression text. Filtering operator rules are used to generate filtering dependency edges for filtering predicate reference columns and record the predicate text; Connect operator rules are used to generate connection type lineage edges across multi-source output columns, and record the connection condition and connection key columns; Aggregate operator rules are used to generate direct lineage edges for grouping fields, aggregate lineage edges for aggregate function output columns, and to count the association table identifiers of all output columns. Joint operator rules are used to generate joint lineage edges for each branch of the output column; Window operator rules are used to generate expression bloodlines in the output columns of window functions, and record partitioning, sorting, and window range information. Common table expressions and subquery operator rules are used to recursively parse internal lineages and map internal output columns to outer references to generate lineage edges. Insert, create, and query operator rules are used to generate derived lineage edges between target table fields and query output fields, and to associate unique identifiers for jobs.

5. The data management and control method for heterogeneous data sources according to claim 1, characterized in that, Step S3 specifically includes: Monitoring metadata changes yields a set of metadata changes; Based on the metadata change set, obtain the set of changed field nodes, and traverse forward along the outgoing edges of the field-level lineage directed graph to calculate the set of affected nodes; Obtain the job entity associated with the metadata change set, reuse the processing logic of abstract syntax tree normalization and operator-level field lineage mapping in step S2 to obtain the updated local lineage subgraph, and use the local lineage subgraph to replace the corresponding subgraph part of the field-level lineage directed graph. Set failure flags for downstream nodes corresponding to the affected node set, and attach failure flag attributes to the original nodes in the field-level lineage directed graph; For lineage edges with cross-directory markers in the field-level lineage directed graph, perform snapshot version alignment processing and update the snapshot version information associated with the lineage edge; After replacing the local lineage subgraph, setting node failure markers, and aligning cross-directory lineage edge snapshot versions, the updated field-level lineage directed graph is obtained.

6. The data management and control method for heterogeneous data sources according to claim 5, characterized in that, The process of obtaining the set of changed field nodes based on the metadata change set, and then traversing forward along the outgoing edges of the field-level lineage directed graph to calculate the set of affected nodes specifically includes: Parse the metadata change records in the metadata change set, extract the unique identifier of the field entity corresponding to the change, and obtain the set of changed field nodes based on the unique identifier of the field entity. Add all nodes in the set of changed field nodes to the processing queue, and simultaneously add them to the set of affected nodes; The current processing node is retrieved from the processing queue in a loop, and all outgoing edges of the current processing node in the field-level lineage directed graph are traversed to obtain the target node corresponding to each outgoing edge. Determine whether the target node has been included in the affected node set. If not, mark the target node as affected, add the target node to the affected node set, and add the target node to the processing queue. Repeat the loop traversal operation until the processing queue is empty, and output the set of affected nodes that have been calculated.

7. The data management and control method for heterogeneous data sources according to claim 5, characterized in that, For kinship edges with cross-directory markers in the field-level kinship directed graph, snapshot version alignment processing is performed to update the snapshot version information associated with the kinship edge. Specifically, this includes: Traverse all lineage edges in the field-level lineage directed graph and filter out lineage edges that carry cross-directory markers; Read the directory snapshot version of the source node and the directory snapshot version of the target node of the filtered bloodline edge; Compare the snapshot version of the directory corresponding to the source node with the snapshot version of the directory corresponding to the target node to determine whether they are consistent; If the snapshot version of the directory corresponding to the source node is inconsistent with the snapshot version of the directory corresponding to the target node, the directory with the lagging snapshot version is identified, the latest metadata of the lagging directory is pulled, and the snapshot version information associated with the bloodline edge is updated based on the latest metadata pulled. If the snapshot version of the directory corresponding to the source node is the same as the snapshot version of the directory corresponding to the target node, then the snapshot version information associated with the bloodline edge remains unchanged; Complete the snapshot version alignment process for all lineage edges carrying cross-directory tags, output the lineage edges with completed snapshot version alignment, and write them back to the field-level lineage directed graph.

8. The data management and control method for heterogeneous data sources according to claim 1, characterized in that, Step S4 specifically includes: Read the native permission policies of various heterogeneous data sources, parse the subject information, object information, operation type and constraint conditions in the native permission policies, and translate them to generate a unified permission quadruple; The unified permission quadruple is matched and verified with the unified metadata entity set to verify whether the metadata object pointed to by the unified permission quadruple exists in the unified metadata entity set. Based on the verified unified permission quadruple, combined with the updated field-level bloodline directed graph, the associated attributes of bloodline edges are traversed to identify bloodline-derived permissions. Based on the preset permission arbitration rules, direct permissions and bloodline-derived permissions are merged and conflict-resolved to obtain the data access permission policy.

9. The data management and control method for heterogeneous data sources according to claim 8, characterized in that, The process of merging and resolving conflicts between direct permissions and lineage-derived permissions according to preset permission arbitration rules to obtain a data access permission policy specifically includes: According to the preset permission arbitration rules, direct permissions and bloodline-derived permissions are merged, and multiple permission records under the same subject and the same access object are aggregated. Identify permission conflicts between aggregated permission records; Based on conflict priority, conflict resolution is performed on permission records with conflicting permissions to determine the final effective permissions; The final permissions are encapsulated in a structured manner to obtain the data access permission policy.

10. A data management and control system for heterogeneous data sources, characterized in that, include: The metadata collection and generation module is used to acquire the native metadata of various heterogeneous data sources and generate a unified metadata entity set based on the native metadata. The unified metadata entity set includes data source instance entities, library schema entities, table view materialized view entities, field entities, and job entities. The field-level lineage generation module is used to take the structured query language text in the job entity as the processing object, and combine it with the data source instance entity, library schema entity, table view materialized view entity, and field entity to perform abstract syntax tree normalization processing and operator-level field lineage mapping processing to generate a field-level lineage directed graph. The bloodline incremental update module is used to monitor metadata changes to obtain a set of metadata changes. Combining the unified metadata entity set and the set of metadata changes, it performs bloodline propagation and incremental update processing on the field-level bloodline directed graph to obtain the updated field-level bloodline directed graph. The permission arbitration generation module is used to translate the native permission policies of various heterogeneous data sources into a unified permission quadruple, and combine it with the unified metadata entity set and the updated field-level lineage directed graph to perform permission arbitration and generate data access permission policies.