A method and system for converting a relationship graph into a tree-like bloodline graph

By processing the relationship graph data structure into a blood-like tree structure layout, the functional limitations of the blood-related graph and relationship graph are solved, visual display of cross-level relationships is realized, and the scope of application is improved.

CN114265941BActive Publication Date: 2025-08-26BAIRONG ZHIXIN (BEIJING) TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111562912.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-20
Publication Date
2025-08-26
Estimated Expiration
2041-12-20

AI Technical Summary

Technical Problem

In the prior art, the respective functional limitations of blood relationship diagrams and relationship diagrams have limited application scope and cannot effectively display cross-level node relationships and free nodes.

Method used

The relationship graph data structure is processed into a blood-like tree structure layout, and the free node layout attributes are adjusted to realize the visual display of cross-hierarchical relationships.

Benefits of technology

It realizes visual display of cross-level relationships, and has a hierarchical layout form that is both up, down, left and right, breaks functional limitations and improves the scope of application.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114265941B_ABST
    Figure CN114265941B_ABST
Patent Text Reader

Abstract

The present invention provides a method and system for converting a processing relationship graph into a tree-like kinship graph relationship. The method comprises: obtaining a first relationship graph data structure; obtaining a first processing instruction, processing the first relationship graph data structure into a kinship tree-like structure layout algorithm, and obtaining a first processing result; performing node information calculation based on the first processing result to obtain a first calculation result; performing hierarchical information calculation based on the first processing result to obtain a second calculation result; obtaining a first preliminary tree-like layout conversion result based on the first processing result, the first calculation result, and the second calculation result; obtaining a first free node layout calculation attribute; and adjusting the first preliminary tree-like layout conversion result based on the first free node layout calculation attribute to obtain a kinship tree-like data structure. This method solves the technical problem in the prior art of limiting the application scope due to the functional limitations of kinship graphs and relationship graphs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field related to visualization display, and in particular to a method and system for converting a processing relationship graph into a tree-like bloodline graph relationship. Background Art

[0002] With the continuous development of technology, networks are more prominent in our lives than ever before. A series of network or graph structures contain more and more implicit information. Efficient analysis and mining of these networks is an urgent problem to be solved. Visualization technology has incomparable advantages in this regard. Its visual presentation can give people an intuitive understanding and perception of data, and graphs are more suitable for exploring the internal relationships of data than other visualization forms.

[0003] Currently, the fields of topology visualization generally include: relationship diagrams, flow charts, DAG diagrams, lineage diagrams, ER diagrams, and tree diagrams. Among them, lineage diagrams and relationship diagrams are both widely used. Lineage diagrams are almost always displayed using a tree-like structure, and the data structure is also a tree-like hierarchical structure. Relationship diagrams, on the other hand, are different. The relationships between nodes are interconnected, and there is no concept of hierarchy. If you want to view the entire lineage relationship of a node's upstream and downstream nodes, it is not particularly intuitive and the relationships are confusing. At the same time, there will be many nodes that are unrelated to the upstream and downstream nodes of this lineage, which affects the viewing experience. In some scenarios, such as the need to display the lineage relationship of references between libraries and tables, the associations between tables have cross-hierarchical relationships, and neither lineage diagrams nor relationship diagrams are suitable for such scenarios.

[0004] However, in the process of implementing the technical solutions of the embodiments of the present application, the inventors of the present application discovered that the above technology has at least the following technical problems:

[0005] In the prior art, due to the functional limitations of the bloodline graph and the relationship graph, there is a technical problem of limiting the scope of application. Summary of the Invention

[0006] The embodiment of the present application solves the technical problem of limited application scope in the prior art due to the functional limitations of the bloodline graph and the relationship graph, by providing a method and system for converting a processing relationship graph into a tree-like bloodline graph relationship. By integrating the data relationships in special scenarios into a relationship graph data structure, and then processing the relationship graph data structure into a bloodline-like tree-like structure layout according to the processing instructions, and further calculating and setting adjustments to the nodes and levels of the bloodline-like tree-like structure layout, a preliminary tree-like layout conversion result is obtained, and then the free node layout attributes are calculated based on the data relationships in the relationship graph data structure, and then the free nodes are laid out in the preliminary tree-like layout conversion result to obtain the final bloodline-like tree-like data structure, which can show cross-level relationships and has free nodes, and at the same time has a hierarchical layout form of up, down, left and right, breaking the functional limitations and achieving the technical effect of increasing the scope of application.

[0007] In view of the above problems, an embodiment of the present application provides a method and system for converting a processing relationship graph into a tree-like bloodline graph relationship.

[0008] In the first aspect, an embodiment of the present application provides a method for converting a processing relationship graph into a tree-like bloodline graph relationship, wherein the method includes: obtaining a first relationship graph data structure; obtaining a first processing instruction, and processing the first relationship graph data structure into a bloodline tree-like structure layout algorithm according to the first processing instruction to obtain a first processing result; performing node information calculation according to the first processing result to obtain a first calculation result; performing hierarchical information calculation according to the first processing result to obtain a second calculation result; obtaining a first preliminary tree-like layout conversion result according to the first processing result, the first calculation result, and the second calculation result; obtaining a first free node layout calculation attribute; adjusting the first preliminary tree-like layout conversion result according to the first free node layout calculation attribute to obtain a bloodline tree data structure.

[0009] On the other hand, an embodiment of the present application provides a system for converting a processing relationship graph into a tree-like bloodline graph relationship, wherein the system includes: a first obtaining unit, the first obtaining unit is used to obtain a first relationship graph data structure; a second obtaining unit, the second obtaining unit is used to obtain a first processing instruction, and according to the first processing instruction, the first relationship graph data structure is processed into a bloodline tree structure layout algorithm to obtain a first processing result; a third obtaining unit, the third obtaining unit is used to perform node information calculation based on the first processing result to obtain a first calculation result; a fourth obtaining unit, the fourth obtaining unit is used to perform hierarchical information calculation based on the first processing result to obtain a second calculation result; a fifth obtaining unit, the fifth obtaining unit is used to obtain a first preliminary tree-like layout conversion result based on the first processing result, the first calculation result, and the second calculation result; a sixth obtaining unit, the sixth obtaining unit is used to obtain a first free node layout calculation attribute; a seventh obtaining unit, the seventh obtaining unit is used to adjust the first preliminary tree-like layout conversion result according to the first free node layout calculation attribute to obtain a bloodline tree-like data structure.

[0010] In a third aspect, an embodiment of the present application provides a system for converting a processing relationship graph into a tree-like bloodline graph relationship, comprising a memory, a processor, and a computer program stored on the memory and runnable on the processor, wherein the processor implements the steps of any one of the methods described in the first aspect when executing the program.

[0011] One or more technical solutions provided in the embodiments of this application have at least the following technical effects or advantages:

[0012] Due to the adoption of obtaining a first relationship graph data structure; obtaining a first processing instruction, processing the first relationship graph data structure into a bloodline tree structure layout algorithm according to the first processing instruction, obtaining a first processing result; performing node information calculation according to the first processing result, obtaining a first calculation result; performing hierarchical information calculation according to the first processing result, obtaining a second calculation result; obtaining a first preliminary class tree layout conversion result according to the first processing result, the first calculation result, and the second calculation result; obtaining a first free node layout calculation attribute; adjusting the first preliminary class tree layout conversion result according to the first free node layout calculation attribute, obtaining a bloodline The technical solution of the kinship tree data structure integrates the data relationships in special scenarios into a relationship graph data structure, and then processes the relationship graph data structure into a lineage tree structure layout according to processing instructions. The nodes and levels of the lineage tree structure layout are further calculated and adjusted to obtain a preliminary tree-like layout conversion result. The free node layout attributes are calculated based on the data relationships in the relationship graph data structure, and the free nodes are then laid out in the preliminary tree-like layout conversion result to obtain the final lineage tree-like data structure, which can display cross-level relationships and has free nodes. At the same time, it has a hierarchical layout form of up, down, left and right, breaking the functional limitations and achieving the technical effect of increasing the scope of application.

[0013] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] Figure 1 A schematic flow chart of a method for converting a processing relationship graph into a tree-like lineage graph is provided for an embodiment of the present application;

[0015] Figure 2 The present invention provides a flowchart of a method for calculating the attributes of free nodes in a method for converting a relationship graph into a tree-like lineage graph.

[0016] Figure 3 A schematic diagram of a system structure for converting a processing relationship graph into a tree-like lineage graph is provided for an embodiment of the present application;

[0017] Figure 4 This is a schematic diagram of the structure of an exemplary electronic device according to an embodiment of the present application.

[0018] Explanation of the reference numerals: first obtaining unit 11 , second obtaining unit 12 , third obtaining unit 13 , fourth obtaining unit 14 , fifth obtaining unit 15 , sixth obtaining unit 16 , seventh obtaining unit 17 , electronic device 300 , memory 301 , processor 302 , communication interface 303 , bus architecture 304 . DETAILED DESCRIPTION

[0019] The embodiment of the present application solves the technical problem of limited application scope in the prior art due to the functional limitations of the bloodline graph and the relationship graph, by providing a method and system for converting a processing relationship graph into a tree-like bloodline graph relationship. By integrating the data relationships in special scenarios into a relationship graph data structure, and then processing the relationship graph data structure into a bloodline-like tree-like structure layout according to the processing instructions, and further calculating and setting adjustments to the nodes and levels of the bloodline-like tree-like structure layout, a preliminary tree-like layout conversion result is obtained, and then the free node layout attributes are calculated based on the data relationships in the relationship graph data structure, and then the free nodes are laid out in the preliminary tree-like layout conversion result to obtain the final bloodline-like tree-like data structure, which can show cross-level relationships and has free nodes, and at the same time has a hierarchical layout form of up, down, left and right, breaking the functional limitations and achieving the technical effect of increasing the scope of application.

[0020] Application Overview

[0021] With the continuous advancement of technology, networks are more prominent than ever in our lives. Networks or graphs contain an increasing amount of implicit information, making efficient analysis and mining of these networks a pressing challenge. Visualization technology offers unparalleled advantages in this regard. Its visual presentation can provide an intuitive understanding and perception of data, and graphs are more suitable for exploring the internal relationships of data than other visualization formats. Currently, topological visualizations commonly include relationship diagrams, flow charts, DAGs, lineage diagrams, ER diagrams, and tree diagrams. Lineage diagrams and relationship diagrams are both widely used. Lineage diagrams are almost always presented in a tree-like structure, and the data structure is also a tree-like hierarchy. Relationship diagrams, on the other hand, are different. Nodes are interconnected, lacking a hierarchy. This makes it difficult to intuitively understand the entire lineage relationship between a node's upstream and downstream nodes, and the relationships are often confusing. Furthermore, many unrelated nodes may be present, hindering visualization. In certain scenarios, such as displaying the lineage relationship between database tables, where the relationships between tables span multiple hierarchies, neither lineage diagrams nor relationship diagrams are suitable. However, due to the functional limitations of the bloodline graph and the relationship graph in the existing technology, there is a technical problem of limiting the scope of application.

[0022] In response to the above technical problems, the overall idea of ​​the technical solution provided by this application is as follows:

[0023] An embodiment of the present application provides a method for converting a processing relationship graph into a tree-like bloodline graph relationship, wherein the method includes: obtaining a first relationship graph data structure; obtaining a first processing instruction, processing the first relationship graph data structure into a bloodline tree-like structure layout algorithm according to the first processing instruction, and obtaining a first processing result; performing node information calculation according to the first processing result to obtain a first calculation result; performing hierarchical information calculation according to the first processing result to obtain a second calculation result; obtaining a first preliminary tree-like layout conversion result according to the first processing result, the first calculation result, and the second calculation result; obtaining a first free node layout calculation attribute; adjusting the first preliminary tree-like layout conversion result according to the first free node layout calculation attribute to obtain a bloodline tree data structure.

[0024] After introducing the basic principles of the present application, various non-limiting implementation methods of the present application will be specifically introduced in conjunction with the drawings in the specification.

[0025] Example 1

[0026] like Figure 1 As shown, an embodiment of the present application provides a method for converting a processing relationship graph into a tree-like bloodline graph relationship, wherein the method includes:

[0027] S100: Obtain a first relationship graph data structure;

[0028] Specifically, the first relationship graph data structure refers to the result obtained by processing a data set that needs to use a graph to visualize the internal relationship in the form of a relationship graph. Preferably, the antv / g6 library is used to complete the rendering and display of the first relationship graph data structure of the data. However, the first relationship graph data can only display the mutual relationship between nodes, but cannot display the hierarchical relationship between nodes. When faced with data nodes that only have hierarchical relationships, a bloodline graph can be used for visual display. However, if there is a group of data that needs to display the hierarchical relationship between nodes and the relationship between nodes across levels, or even the display of free nodes, then neither the first relationship graph data structure nor the bloodline graph can achieve visual display. For such data, it is necessary to use the customized bloodline tree-like data structure of the embodiment of the present application for visual display. Such data is first integrated using the first relationship graph data structure to facilitate subsequent feedback processing.

[0029] S200: Obtain a first processing instruction, and process the first relationship graph data structure into a lineage tree-like structure layout algorithm according to the first processing instruction to obtain a first processing result;

[0030] Specifically, the first processing instruction refers to a control instruction for calling a lineage-like tree structure layout algorithm issued by a system for converting a processing relationship graph into a tree-like lineage graph after the data in a special scenario where the hierarchical relationship between nodes needs to be displayed and the relationship between nodes across levels, or even the display of free nodes, is expressed using the first relationship graph data structure; the first processing result refers to the response status of the processing module for converting the relationship graph into a tree-like lineage graph calling the lineage-like tree structure layout algorithm after receiving the first processing instruction, including two states: successful response and failed response. If the response is successful, the subsequent processing process can be carried out. If the response fails, it needs to be fed back to the system for converting the relationship graph into a tree-like lineage graph for a second call until the response is successful and the processing of the first relationship graph data structure begins.

[0031] S300: Calculate node information according to the first processing result to obtain a first calculation result;

[0032] Specifically, the kinship tree structure layout algorithm includes an algorithm module for calculating the position coordinates and spacing of each tree node in the hierarchical layout. For example: the hierarchy layout is used to calculate the node position coordinates and spacing of the tree-like relationship, wherein the hierarchy layout module is a control that can perform custom debugging of the tree-like layout. Furthermore, the hierarchy layout is used to traverse and calculate each data node in the first relationship graph data structure, and the position coordinate layout of the data nodes and the spacing layout of the data nodes are calculated based on the relationship of the current data nodes. The calculated results and the corresponding data nodes are stored in correspondence and recorded as the first calculation results to facilitate subsequent processing.

[0033] S400: Calculating hierarchical information according to the first processing result to obtain a second calculation result;

[0034] Specifically, after calculating the data node position coordinate layout and node spacing layout, the hierarchy layout is called to traverse the internal relationships of each data node in the first relationship graph data structure, obtaining a hierarchical layout of tree-like relationship nodes. This is stored in a one-to-one correspondence with each node and recorded as the second calculation result. By combining the first and second calculation results, the hierarchical positions of the tree-like relationship nodes after the data in the first relationship graph data structure is converted into a tree-like structure visual layout, the position coordinates of the tree-like relationship nodes at the same level, the spacing between each node, and other information are obtained, facilitating subsequent information feedback processing.

[0035] S500: Obtaining a first preliminary class tree layout conversion result according to the first processing result, the first calculation result, and the second calculation result;

[0036] Specifically, the lineage-like tree structure layout algorithm also includes an algorithm module for configuring tree-like layout properties. For example: use treeLayout to configure tree-like layout calculation properties, including the following custom properties: root: lineage tree root node ID, view different root nodes, calculate and render different lineage trees, direction: set lineage tree layout direction, nodeSep: set node spacing, rankSep: set level spacing, ShowFreeNodes: whether to display free nodes, getSide: return whether a special node is upstream or downstream, and other calculation properties. Among them, the treeLayout module is a custom control for performing tree-like layout calculation properties.

[0037] Furthermore, the first preliminary class tree layout conversion result refers to the conversion of the first relationship graph data structure after the class tree layout calculation attributes are customized and calculated, and then the first calculation result and the second calculation result are combined to complete the rendering and display using the antv / g6 library combined with the React component to obtain a visual customized conversion result. Through configuration + component development, the use and subsequent expansion of layout methods are more convenient. Among them, the React component is also a commonly used component for rendering visual pages. Furthermore, corresponding to the rendering performance processing under a large number of data nodes and a large number of node relationships, the canvas module is used by default for drawing. However, the visual rendering of node details and too many nodes will cause page jams and longer rendering time. The bloodline graph is scaled according to the number of nodes, only the important information of the node is rendered, and the detailed information is hidden. At the same time, the entire graph is dragged, the node information is hidden, and the node relationship connection lines are hidden to optimize the rendering performance. Among them, the canvas module is a drawing control. The first preliminary tree layout conversion result can display the hierarchical relationship between nodes and the relationship between nodes across levels. In simple terms, the first relationship graph data structure is displayed using a tree structure, thereby achieving the technical effect of improving the scope of application.

[0038] S600: Obtaining a first free node layout calculation attribute;

[0039] Specifically, although the aforementioned visual display solves the problem of displaying the hierarchical relationship between nodes and the relationship between nodes across levels, it does not process the free nodes in the first relationship graph data structure. Therefore, the lineage tree structure layout algorithm also includes a custom module for the free node layout calculation attributes. For example: the layout calculation attributes of the free node are set through neatlyLayout, wherein neatlyLayout is a module for customizing the free node calculation attributes. The custom attributes include: startX: the X coordinate of the starting position, StartY: the Y coordinate of the starting position, rankSep: the spacing of each row, nodeSep: the spacing of each column node, rowNums: the number of nodes in each row, getWidth: get the node width, getHeight: get the node height and other custom attributes. The customized results of the free node calculation attributes are stored and recorded as the first free node layout calculation attributes. When all free nodes in the first relationship graph data structure are traversed, it stops and is displayed in the tree-like layout through separate processing of the free nodes, avoiding confusion caused by the free nodes in the visualization node and improving the visualization effect.

[0040] S700: Adjusting the first preliminary class tree layout conversion result according to the first free node layout calculation attribute to obtain a class lineage tree data structure.

[0041] Specifically, the first preliminary class tree layout conversion result is adjusted based on the first free node layout calculation attribute, and the free nodes are extracted for display. The obtained class bloodline tree data structure can simultaneously display: the hierarchical relationship between nodes; the relationship between cross-level nodes; and the better visualization of free nodes. Other required displays can also be designed and added by each custom algorithm module. Furthermore, it is preferred to use neatly controls to make the overall layout neat, wherein neatly controls are controls for neatly planning the content of the visualization page. In the visualization interface: bloodline graph nodes can also be dragged and moved, and cross-level node relationships can be rendered; the bloodline upstream and downstream node relationships of a node can be viewed in a large and complex relationship graph under a large number of nodes, combining the advantages of both bloodline graphs and relationship graphs, and solving the visualization defects of the two graphs; the node shape can be customized, and the shrinking and expanding interaction of the leaves is supported, which improves the visualization effect and achieves the technical effect of increasing the scope of application of the visualization display of the internal relationship of the data.

[0042] Furthermore, based on obtaining the first calculation result, step S300 further includes:

[0043] S310: Obtain the lineage tree root node ID, and calculate the lineage tree identification information according to the lineage tree root node ID;

[0044] S320: Obtain lineage tree layout direction information and node spacing information, and obtain the first calculation result according to the lineage tree identification information, the lineage tree layout direction information, and the node spacing information.

[0045] Specifically, when traversing each node in the first relationship graph data structure, it is necessary to analyze the relationship between the data nodes and customize the bloodline tree root node ID. Selecting different root nodes will render different types of bloodline tree data structures. Therefore, different bloodline tree root node IDs can be used as corresponding bloodline tree identification information. Use the customized bloodline tree root node ID to identify the bloodline tree data structure. When the identification information is sufficient, different types of bloodline tree data structures can be called according to different identification information based on needs; further, after determining the bloodline tree root node ID, calculate the customized attribute information: bloodline tree layout direction information, node spacing information, build a coordinate system based on the bloodline tree layout direction information, and customize each node based on the internal relationship between the nodes in the first relationship graph data structure. The coordinate positions between nodes are preferably represented by x, which represents the horizontal position of the node in the bloodline tree-like data structure, and y, which represents the vertical position of the node in the bloodline tree-like data structure, wherein the x coordinate includes the X coordinate and the y coordinate includes the Y coordinate; and the node spacing information is determined based on the number of nodes and the size of the visualization page, and the custom results and nodes are stored one-to-one. The calculation configuration method is used to traverse the calculation configuration from the root node of the bloodline tree to the node type of the upstream and downstream nodes: root node or leaf node, and then determine the node coordinates, spacing and hierarchical information, wherein the traversed nodes do not change the hierarchical attributes of the nodes. If the data node is in a contracted state, indicating that there is no leaf node, it is marked as a contracted state, and the attribute information of each node is recorded and stored as the first calculation result to facilitate the subsequent information feedback processing.

[0046] Furthermore, the step of obtaining the first preliminary class tree layout conversion result further includes step S800:

[0047] S810: Obtain whether the free node displays the setting result;

[0048] S820: Obtaining a node return setting rule, and obtaining the first preliminary class tree layout conversion result according to whether the free node displays a setting result and the node return setting rule.

[0049] Furthermore, the method step S820 further includes:

[0050] S821: Determine whether the setting result of whether to display the free node is to not display the free node;

[0051] S822: When the result of the setting whether to display the free node is to not display the free node, obtain a first processing instruction;

[0052] S833: Processing nodes and node relationship data that meet preset requirements according to the first processing instruction.

[0053] Specifically, the free node can be customized to be displayed or not, and different settings have different node return setting rules; when the free node is customized to not display the setting result, the node returns to the setting rule: issue the first processing instruction, the preset required node and node relationship data refer to the nodes that are only related to the free node, and the corresponding node and node relationship data are stored as invalid nodes and invalid node relationship data, then it is necessary to not display the invalid node and node relationship data in the visual interface; when the free node is customized to display the setting result, the node returns to the setting rule: call the various custom attributes of the free node for configuration calculation, and then process as steps S600-S700 to achieve visual display. The visualization effect is improved by customizing the display settings of the free node.

[0054] Further, such as Figure 2 As shown, based on obtaining the first free node layout calculation attribute, step S600 further includes:

[0055] S610: Obtain the starting position X and Y coordinate information of the free node;

[0056] S620: Obtain row spacing information and column spacing information of the free nodes;

[0057] S630: Obtain the first free node layout calculation attribute according to the starting position X, Y coordinate information, the row spacing information, and the column spacing information.

[0058] Furthermore, the method step S630 further includes:

[0059] S631: Obtain row node quantity information, node height information, and node width information;

[0060] S632: Obtain the first free node layout calculation attribute according to the row node quantity information, the node height information, and the node width information.

[0061] Specifically, when it is necessary to display a free node, it is necessary to configure various customized attributes. The starting position X of the free node refers to the customized horizontal position of the free node in the class lineage tree data structure, and the starting position Y coordinate information of the free node refers to the customized vertical position of the free node in the class lineage tree data structure; the row spacing information and column spacing information of the free node refer to the customized row and column spacing information based on the nodes with internal relationships with the free node and the total number of nodes in the first relationship graph data structure; the node height information refers to the customized node display height information of the free node in the class lineage tree data structure; the node width information refers to the customized node display width information of the free node in the class lineage tree data structure. The specific values ​​need to be set according to the actual application scenario and are not limited here. Further, the starting position X, Y coordinate information, the row spacing information and the column spacing information, the row node number information, the node height information and the node width information are stored as the first free node layout calculation attributes as the subsequent visual layout feedback information.

[0062] Furthermore, the method further includes step S900:

[0063] S910: Obtaining a first node connection preset rule;

[0064] S920: Modify the kinship tree-like data structure according to the first node connection preset rule.

[0065] Specifically, the first node preset rule refers to the rule that after processing the node coordinate calculation of the bloodline tree data structure, the position of the connection point of the node relationship is preset according to the layout direction of the bloodline tree to ensure the layout in different directions, the connection relationship between the nodes is natural, and there is no intersection as much as possible; the bloodline tree data structure is adjusted through the first node connection preset rule, so that the connection relationship between the nodes of the bloodline tree data structure in the visualization interface is natural, with fewer forks, thereby enhancing the visualization effect.

[0066] In summary, the method and system for converting a processing relationship graph into a tree-like bloodline graph provided by the embodiments of the present application have the following technical effects:

[0067] 1. The embodiment of the present application solves the technical problem of limited application scope in the prior art due to the functional limitations of the bloodline graph and the relationship graph, by providing a method and system for converting a processing relationship graph into a tree-like bloodline graph relationship. By integrating the data relationships in special scenarios into a relationship graph data structure, and then processing the relationship graph data structure into a bloodline-like tree-like structure layout according to the processing instructions, and further calculating and setting the nodes and levels of the bloodline-like tree-like structure layout to obtain a preliminary tree-like layout conversion result, and then calculating the free node layout attributes based on the data relationship in the relationship graph data structure, and then laying out the free nodes in the preliminary tree-like layout conversion result to obtain the final bloodline-like tree-like data structure, which can show cross-level relationships and has free nodes, and at the same time has a hierarchical layout form of up, down, left and right, breaking the functional limitations and achieving the technical effect of increasing the scope of application.

[0068] 2. It realizes the tree-structure layout of the bloodline graph in the relationship graph mode and the processing of free nodes; it combines the advantages of the two graphs, and the bloodline graph nodes can also be dragged and moved, and the cross-level node relationships can be rendered; the bloodline upstream and downstream node relationships of a node can be viewed in a large and complex relationship graph under a large number of nodes; the use of configuration + component development makes the use and subsequent layout expansion more convenient.

[0069] Example 2

[0070] Based on the same inventive concept as the method for converting a processing relationship graph into a tree-like bloodline graph in the aforementioned embodiment, Figure 3 As shown, an embodiment of the present application provides a system for converting a processing relationship graph into a tree-like bloodline graph relationship, wherein the system includes:

[0071] A first obtaining unit 11, wherein the first obtaining unit 11 is used to obtain a first relationship graph data structure;

[0072] A second obtaining unit 12 is configured to obtain a first processing instruction, and process the first relationship graph data structure into a lineage tree-like structure layout algorithm according to the first processing instruction to obtain a first processing result;

[0073] a third obtaining unit 13, configured to calculate node information according to the first processing result to obtain a first calculation result;

[0074] a fourth obtaining unit 14, configured to calculate the hierarchical information according to the first processing result to obtain a second calculation result;

[0075] a fifth obtaining unit 15, configured to obtain a first preliminary class tree layout conversion result according to the first processing result, the first calculation result, and the second calculation result;

[0076] A sixth obtaining unit 16, wherein the sixth obtaining unit 16 is configured to obtain a first free node layout calculation attribute;

[0077] The seventh obtaining unit 17 is used to adjust the first preliminary tree-like layout conversion result according to the first free node layout calculation attribute to obtain a lineage tree-like data structure.

[0078] Furthermore, the system further comprises:

[0079] An eighth obtaining unit, the eighth obtaining unit is used to obtain the lineage tree root node ID, and calculate the lineage tree identification information according to the lineage tree root node ID;

[0080] A ninth obtaining unit is used to obtain lineage tree layout direction information and node spacing information, and obtain the first calculation result according to the lineage tree identification information, the lineage tree layout direction information, and the node spacing information.

[0081] Furthermore, the system further comprises:

[0082] a tenth obtaining unit, configured to obtain whether the free node displays a setting result;

[0083] The eleventh obtaining unit is used to obtain a node return setting rule, and obtain the first preliminary class tree layout conversion result according to whether the free node displays a setting result and the node return setting rule.

[0084] Furthermore, the system further comprises:

[0085] a twelfth obtaining unit, the twelfth obtaining unit being used to obtain X and Y coordinate information of a starting position of a free node;

[0086] a thirteenth obtaining unit, configured to obtain row spacing information and column spacing information of the free nodes;

[0087] A fourteenth obtaining unit is configured to obtain the first free node layout calculation attribute according to the starting position X, Y coordinate information, the row spacing information, and the column spacing information.

[0088] Furthermore, the system further comprises:

[0089] a fifteenth obtaining unit, the fifteenth obtaining unit being used to obtain row node quantity information, node height information, and node width information;

[0090] A sixteenth obtaining unit is configured to obtain the first free node layout calculation attribute according to the row node quantity information, the node height information, and the node width information.

[0091] Furthermore, the system further comprises:

[0092] a seventeenth obtaining unit, the seventeenth obtaining unit being configured to obtain a first node connection preset rule;

[0093] The first execution unit is used to modify the bloodline tree-like data structure according to the first node connection preset rule.

[0094] Furthermore, the system further comprises:

[0095] a first judging unit, configured to judge whether the setting result of whether to display the free node is to not display the free node;

[0096] an eighteenth obtaining unit, configured to obtain a first processing instruction when the result of the setting of whether to display the free node is not to display the free node;

[0097] The second execution unit is used to process the nodes and node relationship data that meet preset requirements according to the first processing instruction.

[0098] Exemplary electronic devices

[0099] Reference below Figure 4 To describe the electronic device of the embodiment of the present application,

[0100] Based on the same inventive concept as the method for converting a processing relationship graph into a tree-like bloodline graph relationship in the aforementioned embodiment, the embodiment of the present application also provides a system for converting a processing relationship graph into a tree-like bloodline graph relationship, including: a processor, the processor is coupled to a memory, the memory is used to store a program, when the program is executed by the processor, the system executes the method described in any one of the first aspects

[0101] The electronic device 300 includes: a processor 302, a communication interface 303, and a memory 301. Optionally, the electronic device 300 may further include a bus architecture 304. The communication interface 303, the processor 302, and the memory 301 may be interconnected via the bus architecture 304; the bus architecture 304 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus architecture 304 may be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, Figure 4 Only one thick line is used in the diagram, but this does not mean that there is only one bus or one type of bus.

[0102] The processor 302 may be a CPU, a microprocessor, an ASIC, or one or more integrated circuits for controlling the execution of the program of the present application.

[0103] The communication interface 303 uses any transceiver-like system for communicating with other devices or communication networks, such as Ethernet, radio access network (RAN), wireless local area network (WLAN), wired access network, etc.

[0104] The memory 301 can be a ROM or other type of static storage device that can store static information and instructions, a RAM or other type of dynamic storage device that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, an optical disc storage (including a compact disc, a laser disc, an optical disc, a digital versatile disc, a Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory can exist independently and be connected to the processor via the bus architecture 304. The memory can also be integrated with the processor.

[0105] The memory 301 is used to store computer-executable instructions for executing the solution of the present application, and the execution is controlled by the processor 302. The processor 302 is used to execute the computer-executable instructions stored in the memory 301, thereby implementing a method for converting a processing relationship diagram into a tree-like lineage diagram provided in the above embodiment of the present application.

[0106] Optionally, the computer-executable instructions in the embodiments of the present application may also be referred to as application code, which is not specifically limited in the embodiments of the present application.

[0107] The embodiment of the present application solves the technical problem of limited application scope in the prior art due to the functional limitations of the bloodline graph and the relationship graph, by providing a method and system for converting a processing relationship graph into a tree-like bloodline graph relationship. By integrating the data relationships in special scenarios into a relationship graph data structure, and then processing the relationship graph data structure into a bloodline-like tree-like structure layout according to the processing instructions, and further calculating and setting adjustments to the nodes and levels of the bloodline-like tree-like structure layout, a preliminary tree-like layout conversion result is obtained, and then the free node layout attributes are calculated based on the data relationships in the relationship graph data structure, and then the free nodes are laid out in the preliminary tree-like layout conversion result to obtain the final bloodline-like tree-like data structure, which can show cross-level relationships and has free nodes, and at the same time has a hierarchical layout form of up, down, left and right, breaking the functional limitations and achieving the technical effect of increasing the scope of application.

[0108] Those skilled in the art will understand that the various numerical numbers such as the first and second involved in this application are only for the convenience of description, and are not used to limit the scope of the embodiments of the present application, nor do they represent the order of precedence. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one" refers to one or more. At least two refers to two or more. "At least one", "any one" or similar expressions refer to any combination of these items, including any combination of single items (individuals) or plural items (individuals). For example, at least one item (individual, kind) of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.

[0109] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When software is used for implementation, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable system. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website, computer, server or data center to another website, computer, server or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrations. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)).

[0110] The various illustrative logic units and circuits described in the embodiments of the present application can be implemented or operated by the design of a general-purpose processor, a digital signal processor, an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic system, discrete gate or transistor logic, discrete hardware components, or any combination thereof. The general-purpose processor can be a microprocessor, alternatively, the general-purpose processor can also be any traditional processor, controller, microcontroller or state machine. The processor can also be implemented by a combination of computing systems, such as a digital signal processor and a microprocessor, a plurality of microprocessors, one or more microprocessors in conjunction with a digital signal processor core, or any other similar configuration to implement.

[0111] The steps of the method or algorithm described in the embodiments of the present application can be directly embedded in hardware, software units executed by a processor, or a combination of the two. The software unit can be stored in RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, hard disk, removable disk, CD-ROM or any other form of storage medium in the art. For example, the storage medium can be connected to the processor so that the processor can read information from the storage medium and write information to the storage medium. Optionally, the storage medium can also be integrated into the processor. The processor and the storage medium can be provided in an ASIC, and the ASIC can be provided in a terminal. Optionally, the processor and the storage medium can also be provided in different components in the terminal. These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are performed on the computer or other programmable device to produce computer-implemented processing, so that the instructions executed on the computer or other programmable device provide for implementing the process in the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0112] Although the present application has been described with reference to specific features and embodiments thereof, it will be apparent that various modifications and combinations may be made thereto without departing from the spirit and scope of the present application. Accordingly, this specification and the drawings are merely illustrative of the present application as defined by the appended claims and are deemed to cover any and all modifications, variations, combinations or equivalents within the scope of the present application. Obviously, those skilled in the art may make various modifications and variations to the present application without departing from the scope of the present application. Thus, the present application intends to include such modifications and variations if they fall within the scope of the claims of the present application and their equivalents.

Claims

1. A method for converting a relationship graph into a tree-like bloodline graph, wherein: The method comprises: Obtaining a first relationship graph data structure, where the first relationship graph data structure refers to a result obtained by processing a data set that requires visualizing internal relationships using a graph in the form of a relationship graph; Obtaining a first processing instruction, processing the first relationship graph data structure into a lineage-like tree structure layout algorithm according to the first processing instruction, and obtaining a first processing result, wherein the first processing result refers to a response status of the relationship graph-to-tree-like lineage graph processing module calling the lineage-like tree structure layout algorithm after receiving the first processing instruction; Calculating node information according to the first processing result to obtain a first calculation result, where the first calculation result is a position coordinate layout of the data nodes and a spacing layout of the data nodes; Performing hierarchical information calculation based on the first processing result to obtain a second calculation result, wherein the second calculation result is a hierarchical layout of tree-like relationship nodes; Obtaining a first preliminary class tree layout conversion result based on the first processing result, the first calculation result, and the second calculation result. The first preliminary class tree layout conversion result refers to converting the first relationship graph data structure in combination with the first calculation result and the second calculation result after customizing and calculating the class tree layout calculation properties, and then using the antv / g6 library in combination with the React component to complete rendering and display, thereby obtaining a visual customized conversion result. Get the first free node layout calculation attributes; The first preliminary class tree layout conversion result is adjusted according to the first free node layout calculation attribute to obtain a class lineage tree data structure.

2. The method according to claim 1, wherein The obtaining of the first calculation result further includes: Obtaining the lineage tree root node ID, and calculating the lineage tree identification information based on the lineage tree root node ID; Obtain lineage tree layout direction information and node spacing information, and obtain the first calculation result according to the lineage tree identification information, the lineage tree layout direction information, and the node spacing information.

3. The method according to claim 2, wherein: The obtaining of the first preliminary class tree layout conversion result further includes: Get whether the free node displays the set result; A node return setting rule is obtained, and the first preliminary class tree layout conversion result is obtained according to whether the free node displays a setting result and the node return setting rule.

4. The method according to claim 1, wherein The obtaining of the first free node layout calculation attribute further includes: Get the starting position X and Y coordinate information of the free node; Get row spacing information and column spacing information of free nodes; The first free node layout calculation attribute is obtained according to the starting position X, Y coordinate information, the row spacing information, and the column spacing information.

5. The method according to claim 4, wherein: The method further comprises: Get row node quantity information, node height information and node width information; The first free node layout calculation attribute is obtained according to the row node quantity information, the node height information, and the node width information.

6. The method of claim 1, wherein: The method further comprises: Obtaining a first node connection preset rule; The kinship tree-like data structure is modified according to the first node connection preset rule.

7. The method of claim 3, wherein: The method further comprises: Determining whether the setting result of displaying the free node is to not display the free node; When the result of the setting whether to display the free node is not to display the free node, obtaining a first processing instruction; Processing of nodes and node relationship data that meet preset requirements is performed according to the first processing instruction.

8. A system for converting a relationship graph into a tree-like lineage graph, wherein: The system comprises: a first obtaining unit, configured to obtain a first relationship graph data structure, wherein the first relationship graph data structure refers to a result obtained by processing a data set whose internal relationships need to be visualized using a graph in the form of a relationship graph; a second obtaining unit, the second obtaining unit being configured to obtain a first processing instruction, and to process the first relationship graph data structure into a lineage-like tree structure layout algorithm according to the first processing instruction, to obtain a first processing result, wherein the first processing result refers to a response status of the relationship graph-to-tree-like lineage graph processing module calling the lineage-like tree structure layout algorithm after receiving the first processing instruction; a third obtaining unit, configured to calculate node information according to the first processing result to obtain a first calculation result, where the first calculation result is a position coordinate layout of the data nodes and a spacing layout of the data nodes; a fourth obtaining unit, configured to calculate hierarchical information according to the first processing result to obtain a second calculation result, wherein the second calculation result is a hierarchical layout of tree-like relationship nodes; a fifth obtaining unit, configured to obtain a first preliminary class tree layout conversion result based on the first processing result, the first calculation result, and the second calculation result, wherein the first preliminary class tree layout conversion result refers to converting the first relationship graph data structure in combination with the first calculation result and the second calculation result after customizing and calculating the class tree layout calculation properties, and then using the antv / g6 library in combination with the React component to complete rendering and display, thereby obtaining a visual customized conversion result; a sixth obtaining unit, configured to obtain a first free node layout calculation attribute; A seventh obtaining unit is configured to adjust the first preliminary tree-like layout conversion result according to the first free node layout calculation attribute to obtain a lineage tree-like data structure.

9. A system for converting a relationship graph into a tree-like lineage graph, comprising: A processor is coupled to a memory, wherein the memory is used to store a program, and when the program is executed by the processor, the system is enabled to perform the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Data blood relationship analysis method and device, equipment and storage medium

    CN113486008A