Data blood relationship visualization method and device, electronic equipment and storage medium
By obtaining the number and type of nodes, adjusting the node spacing and size, and optimizing the canvas layout, the problems of node overlap and low space utilization in the visualization of data lineage were solved, improving the visualization effect and the user's ability to distinguish.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- WUHAN BIG PULP IND DEV CO LTD
- Filing Date
- 2026-03-02
- Publication Date
- 2026-07-10
AI Technical Summary
Existing data lineage visualization technologies struggle to effectively address issues such as blank areas when the number of nodes is small and overlap when the number of nodes is dense, resulting in poor visualization performance when faced with complex enterprise-level application scenarios.
By obtaining the number of nodes to be visualized, determining the row spacing and vertical spacing between nodes based on the number of nodes, and setting different preset sizes according to the node type, a target canvas is constructed to optimize node layout and space utilization.
It avoids node overlap in data lineage graphs of different scales, improves space utilization and node visualization, and makes it easier for users to distinguish different types of nodes.
Smart Images

Figure CN122364447A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of big data governance technology, and in particular to a method, apparatus, electronic device and storage medium for visualizing data lineage. Background Technology
[0002] With the rapid development of big data technology and the increasing demands of enterprise data governance, data lineage analysis has become a crucial aspect of data asset management. Data lineage visualization, as an important way to present analysis results, directly impacts the efficiency of users' understanding of the data flow process and the effectiveness of analysis. Traditional data lineage visualization techniques primarily employ static layout-based visualization schemes. These schemes typically abstract data entities (such as tables and fields) as nodes and data flow relationships as edges, displaying them graphically.
[0003] However, in real-world enterprise applications, data lineages are often characterized by their massive scale and complex structure. A typical enterprise data warehouse may contain thousands of tables and tens of thousands of fields, with these entities forming intricate dependency networks through ETL tasks, data synchronization, and other methods. Existing visualization technologies face numerous challenges in handling such complex scenarios: static layout algorithms struggle to adapt to the display needs of graphs of varying sizes; when the number of nodes is small, numerous blank areas appear, while when nodes are dense, overlap is prone to occur, resulting in poor node visualization.
[0004] Therefore, a new method for visualizing data lineage is urgently needed to solve the above problems. Summary of the Invention
[0005] In view of this, this application provides a data lineage visualization method, apparatus, electronic device and storage medium, which can improve the space utilization of the canvas and improve the visualization effect of nodes.
[0006] A first aspect of this application provides a method for visualizing data lineage relationships, comprising: obtaining the number of nodes of the node to be visualized; performing node type detection on the node to be visualized to determine task nodes and data nodes in the node to be visualized, and obtaining topology information of the task nodes; determining the row spacing between the nodes to be visualized, the first vertical spacing between adjacent task nodes, and the second vertical spacing between adjacent data nodes according to the number of nodes; wherein, the more nodes there are, the larger the row spacing, the first vertical spacing, and the second vertical spacing are; determining the canvas size according to the number of nodes, the first preset size of the task nodes, and the second preset size of the data nodes; constructing a target canvas according to the canvas size, and constructing a data lineage relationship map of the node to be visualized in the target canvas according to the topology information, the row spacing, the first vertical spacing, and the second vertical spacing.
[0007] In one possible implementation, determining the row spacing between the nodes to be visualized, the first vertical spacing between adjacent task nodes, and the second vertical spacing between adjacent data nodes based on the number of nodes includes: setting the row spacing to a first preset row spacing when the number of nodes is less than or equal to a first preset number; setting the row spacing to a second preset row spacing when the number of nodes is greater than the first preset number, wherein the first preset row spacing is less than the second preset row spacing; calculating the first vertical spacing based on the number of nodes and the first preset vertical spacing, and calculating the second vertical spacing based on the number of nodes and the second preset vertical spacing, wherein the first preset vertical spacing is less than the second preset vertical spacing.
[0008] In one possible implementation, calculating the first vertical spacing based on the number of nodes and a first preset vertical spacing, and calculating the second vertical spacing based on the number of nodes and a second preset vertical spacing, includes: calculating the first vertical spacing according to the following formula: ;in, This is the first vertical spacing. The first preset vertical spacing, The number of nodes; The second vertical spacing is calculated using the following formula: ;in, This is the second vertical spacing. The second preset vertical spacing.
[0009] In one possible implementation, determining the canvas size based on the number of nodes, a first preset size of the task nodes, and a second preset size of the data nodes includes: calculating a target height of the canvas based on the first preset size and the number of task nodes; taking the maximum value of the target height and the screen height of the electronic device used to display the canvas as the final height of the canvas; calculating a target width of the canvas based on the first preset size, the second preset size, and the number of task nodes; and determining the final width of the canvas based on the maximum value of the target height and the screen width of the electronic device.
[0010] In one possible implementation, calculating the target height of the canvas based on the first preset size and the number of task nodes includes: calculating the target height according to the following formula: ;in, The target height, This is the preset base offset. The number of task nodes. The first preset size, The preset node connection space; the step of calculating the target width of the canvas based on the first preset size, the second preset size, and the number of task nodes includes: calculating the target width according to the following formula: ;in, The target width, The line spacing is... This is the second preset size.
[0011] In one possible implementation, after obtaining the number of nodes to be visualized, the method further includes: determining the layout pattern of the nodes to be visualized in the canvas based on the number of nodes; the step of constructing a data lineage graph of the nodes to be visualized in the target canvas based on the topology information, the row spacing, the first vertical spacing, and the second vertical spacing includes: constructing the data lineage graph in the target canvas in the layout pattern based on the topology information, the row spacing, the first vertical spacing, and the second vertical spacing.
[0012] In one possible implementation, determining the layout mode of the node to be visualized in the canvas based on the number of nodes includes: determining the layout mode as a centered layout mode when the number of nodes is less than or equal to a second preset number; and determining the layout mode as a panoramic display mode when the number of nodes is greater than the second preset number.
[0013] Secondly, embodiments of this application also provide a data lineage visualization device, comprising: a first acquisition module, a detection module, a second acquisition module, a first determination module, a second determination module, a first construction module, and a second construction module; the first acquisition module is used to acquire the number of nodes of the node to be visualized; the detection module is used to perform node type detection on the node to be visualized, and determine the task nodes and data nodes in the node to be visualized; the second acquisition module is used to acquire the topology information of the task nodes; the first determination module is used to determine the row spacing between the nodes to be visualized, the first vertical spacing between adjacent task nodes, and the second vertical spacing between adjacent data nodes according to the number of nodes; wherein, the more nodes there are, the larger the row spacing, the first vertical spacing, and the second vertical spacing are; the second determination module is used to determine the canvas size according to the number of nodes, the first preset size of the task nodes, and the second preset size of the data nodes; the first construction module is used to construct a target canvas according to the canvas size; the second construction module is used to construct a data lineage map of the node to be visualized in the target canvas according to the topology information, the row spacing, the first vertical spacing, and the second vertical spacing.
[0014] Thirdly, embodiments of this application also provide an electronic device, the electronic device including a processor and a memory, the memory being used to store instructions, and the processor being used to call the instructions in the memory, causing the electronic device to execute the data lineage visualization method as described in the first aspect.
[0015] Fourthly, embodiments of this application also provide a computer-readable storage medium that stores computer instructions that, when executed on an electronic device, cause the electronic device to perform the data lineage visualization method as described in the first aspect.
[0016] Compared with related technologies, the embodiments of this application have at least the following advantages: By obtaining the number of nodes to be visualized, and then determining the row spacing between the nodes to be visualized, the first vertical spacing between adjacent task nodes, and the second vertical spacing between adjacent data nodes based on the number of nodes, the row spacing, the first vertical spacing, and the second vertical spacing are larger as the number of nodes increases. This results in smaller spacing between nodes when the number of nodes is small, making it easier for users to focus on viewing the data. Conversely, when the number of nodes is large, the spacing between nodes is large, effectively avoiding node overlap and ensuring that data lineage maps of different scales can achieve the best visualization effect. By determining the canvas size based on the number of nodes, the first preset size of task nodes, and the second preset size of data nodes, the problem of excessive white space on the canvas when the number of nodes is small and easy node overlap when the number of nodes is large is avoided. This ensures that the content of the nodes to be visualized is displayed completely and the canvas space utilization is optimal, improving the canvas space utilization and further enhancing the visualization effect of the nodes. Furthermore, by performing node type detection on the nodes to be visualized, the task nodes and data nodes in the nodes to be visualized are identified, and the vertical spacing between adjacent task nodes and adjacent data nodes is set to be different, as well as the first preset size of task nodes and the second preset size of data nodes are different. This makes it easier for users to distinguish different types of nodes in the data lineage graph, further improving the visualization effect of the nodes.
[0017] The technical effects achieved by the second, third, and fourth aspects mentioned above are similar to those achieved by the corresponding technical means in the first aspect, and will not be repeated here. Attached Figure Description
[0018] Figure 1 A flowchart illustrating the steps of a data kinship visualization method provided in an embodiment of this application; Figure 2 A flowchart illustrating another step of the data kinship visualization method provided in an embodiment of this application; Figure 3 This is a functional block diagram of a data kinship visualization device provided in an embodiment of this application; Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0019] To better understand the above-mentioned objectives, features, and advantages of this application, the application will be described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in these embodiments can be combined with each other.
[0020] The following description sets forth many specific details to provide a full understanding of this application. The described embodiments are only some, not all, of the embodiments of this application.
[0021] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein in the specification of this application is for the purpose of describing particular embodiments only and is not intended to be limiting of this application.
[0022] It should be further noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0023] In this application, "at least one" means one or more, and "more than one" means two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The terms "first," "second," "third," "fourth," etc. (if present) in the specification, claims, and drawings of this application are used to distinguish similar objects, not to describe a specific order or sequence.
[0024] In the embodiments of this application, the terms "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of terms such as "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.
[0025] For ease of understanding, some concepts related to the embodiments of this application are illustrated and explained by way of example.
[0026] Data lineage mapping: Like a data "family tree" or "travel route map," it clearly tracks the entire lifecycle of data from its source to its final use. This visualization tool can quickly locate data problems and assess the impact of modifications, making it an indispensable part of data governance.
[0027] Topology information describes the connection methods and positional relationships of nodes in the overall structure. It does not care about specific shapes or distances, but only focuses on "who is connected to whom" and "how they are connected".
[0028] G6 Graph Editor: Developed by AntV, this graph visualization engine focuses on the visualization and analysis of relational data. It supports rich interactive and customization capabilities, making it ideal for building applications such as flowchart editors. It provides core functions such as node management, connection editing, drag-and-drop, and zooming, and also supports plugin extensions and custom interactions.
[0029] Minimap plugin: A tool in the G6 diagram editor that can quickly generate a minimap, making it easy to quickly locate and navigate nodes in complex flowcharts.
[0030] Please refer to Figure 1 , Figure 1 This is a flowchart illustrating one embodiment of the data kinship visualization method provided in this application. The order of steps in this flowchart can be changed, and some steps can be omitted, depending on different requirements.
[0031] It should be noted that the data lineage visualization method of this application embodiment can be applied to node array visualization scenarios. The executing entity can be a data lineage visualization device. For example, after obtaining the node array to be visualized, a data lineage graph of the node array can be generated by the data lineage visualization device. Of course, the data lineage visualization method of this application embodiment can also be applied to other scenarios requiring node visualization, and this application does not specifically limit its application in this regard.
[0032] The specific process of this embodiment is as follows: Figure 1 As shown, it includes the following steps: S101, obtain the number of nodes to be visualized.
[0033] S102, perform node type detection on the node to be visualized to determine the task nodes and data nodes in the node to be visualized.
[0034] In some embodiments, the nodes to be visualized are traversed, and the presence of a task type (taskType) attribute in the data field of each node is checked. If the attribute exists and is not empty, the node is determined to be a task node and added to the task node subset.
[0035] S103, obtain the topology information of the task node.
[0036] In some embodiments, after obtaining a subset of task nodes, the topology information of each task node is extracted.
[0037] It is worth noting that in this embodiment, all starting node IDs in the task node subset are aggregated to form a predecessor node set, and all ending node IDs are aggregated to form a successor node set. The predecessor and successor node sets only record the external boundaries directly connected to the task nodes; a complete adjacency relationship has not yet been established, but they provide the necessary topology entry / exit data for subsequent layout calculations or critical path calculations. This approach ensures that a data lineage graph can be constructed subsequently.
[0038] S104, determine the row spacing between nodes to be visualized, the first vertical spacing between adjacent task nodes, and the second vertical spacing between adjacent data nodes based on the number of nodes.
[0039] Specifically, in this embodiment, the more nodes there are, the larger the row spacing, the first vertical spacing, and the second vertical spacing.
[0040] In some embodiments, determining the row spacing between nodes to be visualized, the first vertical spacing between adjacent task nodes, and the second vertical spacing between adjacent data nodes based on the number of nodes includes: setting the row spacing to a first preset row spacing when the number of nodes is less than or equal to a first preset number; setting the row spacing to a second preset row spacing when the number of nodes is greater than the first preset number, wherein the first preset row spacing is less than the second preset row spacing; calculating the first vertical spacing based on the number of nodes and the first preset vertical spacing, and calculating the second vertical spacing based on the number of nodes and the second preset vertical spacing, wherein the first preset vertical spacing is less than the second preset vertical spacing.
[0041] In some embodiments, calculating the first vertical spacing based on the number of nodes and a first preset vertical spacing, and calculating the second vertical spacing based on the number of nodes and a second preset vertical spacing, includes: calculating the first vertical spacing according to the following formula: ;in, This is the first vertical spacing. The first preset vertical spacing, The number of nodes; The second vertical spacing is calculated using the following formula: ;in, This is the second vertical spacing. This is the second preset vertical spacing.
[0042] To facilitate understanding, the following provides a detailed explanation of how the line spacing, the first vertical spacing, and the second vertical spacing are calculated in this embodiment: Assume the first preset line spacing is 80px, the second preset line spacing is 100px, and the first preset number of nodes is 5. When the number of nodes is less than or equal to 5, set the line spacing to 80px; when the number of nodes is greater than 5, set the line spacing to 100px.
[0043] Assuming the first preset vertical spacing is 30px, the second preset vertical spacing is 50px, and the number of nodes is 10, then the first vertical spacing is calculated as follows: px, the second vertical spacing is px.
[0044] S105, determine the canvas size based on the number of nodes, the first preset size of the task nodes, and the second preset size of the data nodes.
[0045] In some embodiments, determining the canvas size based on the number of nodes, a first preset size of the task nodes, and a second preset size of the data nodes includes: calculating a target height of the canvas based on the first preset size and the number of task nodes; taking the maximum value of the target height and the screen height of the electronic device used to display the canvas as the final height of the canvas; calculating a target width of the canvas based on the first preset size, the second preset size, and the number of task nodes; and determining the final width of the canvas based on the maximum value of the target width and the screen width of the electronic device.
[0046] In some embodiments, calculating the target height of the canvas based on a first preset size and the number of task nodes includes: calculating the target height according to the following formula: ;in, For the target height, This is the preset base offset. The number of task nodes. The first preset size, This is a pre-defined space for connecting nodes; The target width of the canvas is calculated based on the first preset size, the second preset size, and the number of task nodes, including: calculating the target width using the following formula: ;in, For target width, For line spacing, This is the second preset size.
[0047] It is understandable that, in order to achieve differentiated display of task nodes and data nodes, this embodiment sets task nodes and data nodes to different sizes.
[0048] It is worth noting that when the data lineage graph is large, a scroll bar will be set in the canvas to facilitate users' scrolling through the data lineage graph. Therefore, in this embodiment, determining the final width of the canvas based on the maximum value of the target width and the screen width of the electronic device is specifically as follows: if the target width is less than or equal to the maximum screen width minus the scroll bar width, the final width is set to the target width; if the target width is greater than the maximum screen width minus the scroll bar width, the final width is set to the maximum screen width minus the scroll bar width.
[0049] In some embodiments, the first preset size is set to 48px and the second preset size is set to 64px.
[0050] It should be noted that this embodiment does not impose specific limitations on the size of the base offset, the first preset size, and the second preset size, and these can be set according to actual needs. For example, the base offset can be set to 100px.
[0051] S106, Construct the target canvas based on the canvas size.
[0052] S107. Construct a data lineage graph of the nodes to be visualized in the target canvas based on topological information, row spacing, first vertical spacing, and second vertical spacing.
[0053] In some embodiments, the data kinship graph is visualized and rendered. For example, when building a data kinship graph in the G6 graph editor, a customized minimap plugin is integrated, and the maskStyle configuration achieves a semi-transparent mask effect (rgba transparency 0.2), while the border style enhances visual hierarchy. Through the carefully designed minimap plugin and semi-transparent mask effect, the browsing efficiency of large graphs is significantly improved.
[0054] In some embodiments, intelligent positioning is achieved by calculating the coordinates of the canvas center point, ensuring that the core content is always centered in the visible area. Smooth zoom control is provided, with a coefficient of 1.1 / 0.9 ensuring that each operation produces a noticeable but not excessive change in perspective.
[0055] Specifically, intelligent positioning is achieved in the following ways: scrollTop = scrollHeight / 2 - clientHeight / 2; scrollLeft = scrollWidth / 2 - clientWidth / 2.
[0056] In some embodiments, node click event listeners detect the `isDelete` (whether a node has been deleted) status flag and trigger a corresponding warning. The `return false` method blocks event propagation to avoid accidental operations, while the `emit` method (triggering or sending an event) passes legitimate node data to the upper-layer business system. This mechanism reduces the false status judgment rate by more than 90%.
[0057] Specifically, the data lineage graph provided in this embodiment can accurately identify logical deletion status (isDelete detection), verify node type compliance (nodeType verification), and intelligently block illegal operations. Combined with a context-aware prompting system (ElMessage), it provides users with immediate operational feedback. This innovative design reduces user error rates by over 90% and significantly improves the accuracy of data analysis.
[0058] Compared with related technologies, the embodiments of this application have at least the following advantages: By obtaining the number of nodes to be visualized, and then determining the row spacing between the nodes to be visualized, the first vertical spacing between adjacent task nodes, and the second vertical spacing between adjacent data nodes based on the number of nodes, the row spacing, the first vertical spacing, and the second vertical spacing are larger as the number of nodes increases. This results in smaller spacing between nodes when the number of nodes is small, making it easier for users to focus on viewing the data. Conversely, when the number of nodes is large, the spacing between nodes is large, effectively avoiding node overlap and ensuring that data lineage maps of different scales can achieve the best visualization effect. By determining the canvas size based on the number of nodes, the first preset size of task nodes, and the second preset size of data nodes, the problem of excessive white space on the canvas when the number of nodes is small and easy node overlap when the number of nodes is large is avoided. This ensures that the content of the nodes to be visualized is displayed completely and the canvas space utilization is optimal, improving the canvas space utilization and further enhancing the visualization effect of the nodes. Furthermore, by performing node type detection on the nodes to be visualized, the task nodes and data nodes in the nodes to be visualized are identified, and the vertical spacing between adjacent task nodes and adjacent data nodes is set to be different, as well as the first preset size of task nodes and the second preset size of data nodes are different. This makes it easier for users to distinguish different types of nodes in the data lineage graph, further improving the visualization effect of the nodes.
[0059] Please refer to Figure 2 , Figure 2 This is a flowchart illustrating the steps of an embodiment of the data kinship visualization method of this application. Depending on different needs, the order of the steps in this flowchart can be changed, and some steps can be omitted. This data kinship visualization method can be applied to the aforementioned data kinship visualization device, but is not limited thereto, and this embodiment of the application does not limit it in this regard.
[0060] This embodiment is a further improvement on the foregoing embodiment. The main improvement is that, after obtaining the number of nodes to be visualized, this embodiment further includes: determining the layout mode of the nodes to be visualized on the canvas based on the number of nodes. This method can further improve the visualization effect of the nodes to be visualized.
[0061] The specific process of this embodiment is as follows: Figure 2 As shown, it includes the following steps: S201, Get the number of nodes to be visualized.
[0062] S202, perform node type detection on the node to be visualized to determine the task nodes and data nodes in the node to be visualized.
[0063] S203, obtain the topology information of the task node.
[0064] S204, determine the row spacing between nodes to be visualized, the first vertical spacing between adjacent task nodes, and the second vertical spacing between adjacent data nodes based on the number of nodes.
[0065] S205, determine the canvas size based on the number of nodes, the first preset size of the task nodes, and the second preset size of the data nodes.
[0066] S206, Construct the target canvas based on the canvas size.
[0067] S207, determine the layout pattern of the nodes to be visualized in the canvas based on the number of nodes.
[0068] In some embodiments, if the number of nodes is less than or equal to the second preset number, the layout mode is determined to be a centered layout mode; if the number of nodes is greater than the second preset number, the layout mode is determined to be a panoramic display mode.
[0069] It is understood that this embodiment does not specifically limit the size of the second preset quantity, which can be set according to actual needs.
[0070] S208, construct a data lineage graph in the target canvas in a layout mode based on topology information, row spacing, first vertical spacing, and second vertical spacing.
[0071] Compared with related technologies, the embodiments of this application have at least the following advantages: By obtaining the number of nodes to be visualized, and then determining the row spacing between the nodes to be visualized, the first vertical spacing between adjacent task nodes, and the second vertical spacing between adjacent data nodes based on the number of nodes, the row spacing, the first vertical spacing, and the second vertical spacing are larger as the number of nodes increases. This results in smaller spacing between nodes when the number of nodes is small, making it easier for users to focus on viewing the data. Conversely, when the number of nodes is large, the spacing between nodes is large, effectively avoiding node overlap and ensuring that data lineage maps of different scales can achieve the best visualization effect. By determining the canvas size based on the number of nodes, the first preset size of task nodes, and the second preset size of data nodes, the problem of excessive white space on the canvas when the number of nodes is small and easy node overlap when the number of nodes is large is avoided. This ensures that the content of the nodes to be visualized is displayed completely and the canvas space utilization is optimal, improving the canvas space utilization and further enhancing the visualization effect of the nodes. Furthermore, by performing node type detection on the nodes to be visualized, the task nodes and data nodes in the nodes to be visualized are identified, and the vertical spacing between adjacent task nodes and adjacent data nodes is set to be different, as well as the first preset size of task nodes and the second preset size of data nodes are different. This makes it easier for users to distinguish different types of nodes in the data lineage graph, further improving the visualization effect of the nodes.
[0072] Based on the same idea as the data kinship visualization method in the above embodiments, this application also provides a data kinship visualization device, which can be used to execute the above-described data kinship visualization method. For ease of explanation, the structural schematic diagram of the data kinship visualization device embodiment only shows the parts related to the embodiments of this application. Those skilled in the art will understand that the illustrated structure does not constitute a limitation on the device, and may include more or fewer components than illustrated, or combine certain components, or have different component arrangements.
[0073] like Figure 3 As shown, the data lineage visualization device 30 includes a first acquisition module 301, a detection module 302, a second acquisition module 303, a first determination module 304, a second determination module 305, a first construction module 306, and a second construction module 307. In some embodiments, the above modules can be programmable software instructions stored in memory and executable by a processor. It is understood that in other embodiments, the above modules can also be program instructions or firmware embedded in the processor.
[0074] The first acquisition module 301 is used to acquire the number of nodes of the node to be visualized; The detection module 302 is used to perform node type detection on the node to be visualized and to determine the task nodes and data nodes in the node to be visualized. The second acquisition module 303 is used to acquire the topology information of the task node; The first determining module 304 is used to determine the row spacing between the nodes to be visualized, the first vertical spacing between adjacent task nodes, and the second vertical spacing between adjacent data nodes based on the number of nodes; wherein, the more nodes there are, the larger the row spacing, the first vertical spacing, and the second vertical spacing are. The second determining module 305 is used to determine the canvas size based on the number of nodes, the first preset size of the task node, and the second preset size of the data node. The first construction module 306 is used to construct a target canvas according to the canvas size; The second construction module 307 is used to construct a data lineage graph of the node to be visualized in the target canvas based on the topology information, the row spacing, the first vertical spacing, and the second vertical spacing.
[0075] The data kinship visualization device 30 provided in the above embodiments can realize the technical solutions described in the above data kinship visualization method embodiments. The specific implementation principles of each module or unit can be found in the corresponding content in the above data kinship visualization method embodiments, and will not be repeated here.
[0076] Please refer to Figure 4 , Figure 4 This is a schematic diagram of an embodiment of the electronic device of this application. In this embodiment of the invention, the electronic device 400 includes a processor 401, a memory 402, and a display 403. Figure 4 Only some components of the electronic device 400 are shown, but it should be understood that it is not required to implement all the components shown, and more or fewer components may be implemented instead.
[0077] In some embodiments, processor 401 may be a central processing unit (CPU), microprocessor, or other data processing chip, used to run program code stored in memory 402 or process data, such as the data lineage visualization method of the present invention.
[0078] In some embodiments, processor 401 may be a single server or a group of servers. The server group may be centralized or distributed. In some embodiments, processor 401 may be local or remote. In some embodiments, processor 401 may be implemented on a cloud platform. In one embodiment, the cloud platform may include a private cloud, public cloud, hybrid cloud, community cloud, distributed cloud, inter-cloud, multi-cloud, or any combination thereof.
[0079] In some embodiments, memory 402 may be an internal storage unit of electronic device 400, such as a hard disk or memory of electronic device 400. In other embodiments, memory 402 may also be an external storage device of electronic device 400, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc. equipped on electronic device 400.
[0080] Furthermore, the memory 402 may include both internal storage units of the electronic device 400 and external storage devices. The memory 402 is used to store application software and various types of data installed on the electronic device 400.
[0081] In some embodiments, display 403 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, or an OLED (Organic Light-Emitting Diode) touchscreen. Display 403 is used to display information from electronic device 400 and to display visual user applications. Components 401-403 of electronic device 400 communicate with each other via a system bus.
[0082] In one embodiment, when the processor 401 executes the data lineage visualization program in the memory 402, the following steps can be implemented: Obtain the number of nodes to be visualized; Perform node type detection on the node to be visualized to determine the task nodes and data nodes in the node to be visualized, and obtain the topology information of the task nodes; The row spacing between the nodes to be visualized, the first vertical spacing between adjacent task nodes, and the second vertical spacing between adjacent data nodes are determined based on the number of nodes; wherein, the more nodes there are, the larger the row spacing, the first vertical spacing, and the second vertical spacing are; The canvas size is determined based on the number of nodes, the first preset size of the task nodes, and the second preset size of the data nodes; A target canvas is constructed based on the canvas size, and a data lineage graph of the nodes to be visualized is constructed in the target canvas based on the topology information, the row spacing, the first vertical spacing, and the second vertical spacing.
[0083] It should be understood that when the processor 401 executes the data lineage visualization program in the memory 402, in addition to the functions mentioned above, it can also perform other functions, as can be found in the description of the corresponding method embodiments above.
[0084] Furthermore, this embodiment of the invention does not specifically limit the type of electronic device 400 mentioned. Electronic device 400 can be a mobile phone, tablet computer, personal digital assistant (PDA), wearable device, laptop computer, or other portable electronic device. Exemplary embodiments of portable electronic devices include, but are not limited to, portable electronic devices running iOS, Android, Microsoft, or other operating systems. The aforementioned portable electronic device can also be other portable electronic devices, such as a laptop computer with a touch-sensitive surface (e.g., a touch panel). It should also be understood that in some other embodiments of the invention, electronic device 400 may not be a portable electronic device, but rather a desktop computer with a touch-sensitive surface (e.g., a touch panel).
[0085] Accordingly, this application also provides a computer-readable storage medium for storing a computer-readable program or instruction. When the program or instruction is executed by a processor, it can implement the steps or functions of the data lineage visualization method provided in the above-described method embodiments.
[0086] Those skilled in the art will understand that all or part of the processes of the methods described in the above embodiments can be implemented by a computer program instructing related hardware (such as a processor, controller, etc.), and the computer program can be stored in a computer-readable storage medium. The computer-readable storage medium may be a disk, optical disk, read-only memory, or random access memory, etc.
[0087] The data lineage visualization method, apparatus, electronic device, and computer-readable storage medium provided in this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A method for visualizing data kinship, characterized in that, include: Get the number of nodes to be visualized; Perform node type detection on the node to be visualized to determine the task nodes and data nodes in the node to be visualized, and obtain the topology information of the task nodes; The row spacing between the nodes to be visualized, the first vertical spacing between adjacent task nodes, and the second vertical spacing between adjacent data nodes are determined based on the number of nodes; wherein, the more nodes there are, the larger the row spacing, the first vertical spacing, and the second vertical spacing are; The canvas size is determined based on the number of nodes, the first preset size of the task nodes, and the second preset size of the data nodes; A target canvas is constructed based on the canvas size, and a data lineage graph of the nodes to be visualized is constructed in the target canvas based on the topology information, the row spacing, the first vertical spacing, and the second vertical spacing.
2. The data kinship visualization method according to claim 1, characterized in that, The step of determining the row spacing between the nodes to be visualized, the first vertical spacing between adjacent task nodes, and the second vertical spacing between adjacent data nodes based on the number of nodes includes: When the number of nodes is less than or equal to a first preset number, the line spacing is set to a first preset line spacing; when the number of nodes is greater than the first preset number, the line spacing is set to a second preset line spacing, wherein the first preset line spacing is less than the second preset line spacing. The first vertical spacing is calculated based on the number of nodes and the first preset vertical spacing, and the second vertical spacing is calculated based on the number of nodes and the second preset vertical spacing, wherein the first preset vertical spacing is less than the second preset vertical spacing.
3. The data kinship visualization method according to claim 2, characterized in that, The step of calculating the first vertical spacing based on the number of nodes and the first preset vertical spacing, and calculating the second vertical spacing based on the number of nodes and the second preset vertical spacing, includes: The first vertical spacing is calculated using the following formula: ;in, This is the first vertical spacing. The first preset vertical spacing, The number of nodes; The second vertical spacing is calculated using the following formula: ;in, This is the second vertical spacing. The second preset vertical spacing.
4. The data kinship visualization method according to claim 1, characterized in that, Determining the canvas size based on the number of nodes, the first preset size of the task nodes, and the second preset size of the data nodes includes: Calculate the target height of the canvas based on the first preset size and the number of task nodes; The final height of the canvas is the maximum value of the target height and the screen height of the electronic device used to display the canvas. The target width of the canvas is calculated based on the first preset size, the second preset size, and the number of task nodes; The final width of the canvas is determined based on the maximum value between the target width and the screen width of the electronic device.
5. The data kinship visualization method according to claim 4, characterized in that, The step of calculating the target height of the canvas based on the first preset size and the number of task nodes includes: The target height is calculated using the following formula: ;in, The target height, This is the preset base offset. The number of task nodes. The first preset size, This is a pre-defined space for connecting nodes; The step of calculating the target width of the canvas based on the first preset size, the second preset size, and the number of task nodes includes: The target width is calculated using the following formula: ;in, The target width, The line spacing is... This is the second preset size.
6. The data kinship visualization method according to claim 1, characterized in that, After obtaining the number of nodes to be visualized, the process further includes: The layout pattern of the nodes to be visualized in the canvas is determined based on the number of nodes. The step of constructing a data lineage graph of the nodes to be visualized in the target canvas based on the topology information, the row spacing, the first vertical spacing, and the second vertical spacing includes: Based on the topology information, the row spacing, the first vertical spacing, and the second vertical spacing, the data lineage graph is constructed in the target canvas in the layout mode.
7. The data kinship visualization method according to claim 6, characterized in that, Determining the layout pattern of the nodes to be visualized in the canvas based on the number of nodes includes: If the number of nodes is less than or equal to the second preset number, the layout mode is determined to be a center layout mode. If the number of nodes is greater than the second preset number, the layout mode is determined to be a panoramic display mode.
8. A data kinship visualization device, characterized in that, include: The module comprises a first acquisition module, a detection module, a second acquisition module, a first determination module, a second determination module, a first construction module, and a second construction module. The first acquisition module is used to acquire the number of nodes to be visualized; The detection module is used to perform node type detection on the node to be visualized, and to determine the task nodes and data nodes in the node to be visualized. The second acquisition module is used to acquire the topology information of the task node; The first determining module is used to determine the row spacing between the nodes to be visualized, the first vertical spacing between adjacent task nodes, and the second vertical spacing between adjacent data nodes based on the number of nodes; wherein, the more nodes there are, the larger the row spacing, the first vertical spacing, and the second vertical spacing are; The second determining module is used to determine the canvas size based on the number of nodes, the first preset size of the task node, and the second preset size of the data node; The first construction module is used to construct a target canvas according to the canvas size; The second construction module is used to construct a data lineage graph of the nodes to be visualized in the target canvas based on the topology information, the row spacing, the first vertical spacing, and the second vertical spacing.
9. An electronic device, the electronic device comprising a processor and a memory, characterized in that, The memory is used to store instructions, and the processor is used to call the instructions in the memory to cause the electronic device to execute the data lineage visualization method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that, when executed on an electronic device, cause the electronic device to perform the data lineage visualization method as described in any one of claims 1 to 7.