Visual tree layout method based on network data snapshots
By calculating the tree structure data of the network data snapshot, calculating and drawing the leaf node and non-leaf node positions of the network data, it solves the problem of unintuitive data display, achieves a compact and symmetrical visual tree layout, and improves data understanding and mining. efficiency.
Patent Information
- Application Number
- CN202410912876.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-09
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2044-07-09
AI Technical Summary
The existing network data snapshot analysis data display is not intuitive, and there are problems such as non-compact layout, asymmetry, and overlapping.
By obtaining the tree structure data of network data, calculate the total number of rows, total number of columns, row numbers and lengths of non-leaf nodes of the visual tree, recursively traverse the nodes to calculate the positions of leaf nodes and non-leaf nodes, and draw compact, symmetrical, and non-leaf nodes. Overlapping visual tree layout.
A visual tree with a compact, symmetrical, and non-overlapping layout is generated to help intuitively understand the data and improve the efficiency of data mining.
Smart Images

Figure CN118568307A
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of data visualization, and in particular relates to a visualization tree layout method based on network data snapshots. Background Art
[0002] With the widespread application of computer technology in various fields, a huge amount of information data has been generated. Understanding and conveying the infinite value of data can play its real role. Data visualization is a powerful tool that can transform abstract raw data into intuitive and meaningful visual graphics for presentation, helping people to understand data more intuitively and deeply, quickly discover and mine effective information, and greatly improve work efficiency.
[0003] In the field of network security, previous network data snapshot analysis data displays were not intuitive and lacked visualization. If the data was directly visualized, there would be problems with the layout being loose, asymmetric, and overlapping. Summary of the invention
[0004] In order to solve the problems raised in the above background technology, the present invention provides a visual tree layout method based on network data snapshots to solve the problems of directly visually displaying data by analyzing the existing network data snapshots, resulting in non-compact, asymmetric and overlapping layouts.
[0005] To achieve the above object, the present invention provides the following technical solutions:
[0006] A visual tree layout method based on network data snapshot includes the following steps:
[0007] S1: Get the tree structure data of the default snapshot of network data;
[0008] S2: Based on the tree structure data, calculate the total number of rows and columns of the visualization tree, the row number and length of non-leaf nodes, and the position of leaf nodes;
[0009] S3: Calculate the position of non-leaf nodes of the visualization tree based on the tree structure data obtained in S1 and the data calculated in S2;
[0010] S4: Draw a tree visualization view based on the position data of the leaf nodes in S2 and the position data of the non-leaf nodes in S3.
[0011] Preferably, the nodes of the visualization tree are recursively traversed and the following judgment is made:
[0012] S2.1: Determine whether the current node is the root node. If so, the row number of the current node is 1. If not, the row number of the current node is equal to the row number of its parent node plus 1.
[0013] S2.2: The total number of rows is initially 1. Check whether the row number of the current node is greater than the total number of rows. If so, update the total number of rows to the row number of the current node.
[0014] S2.3: Determine whether the current node has a child node and is in the expanded state. If so, jump to S2.4. If not, the length of the current node is 1, the total number of columns is accumulated by 1, the column number of the current node is the current total number of columns and return recursively;
[0015] S2.4: Traverse the child nodes and execute S2.1-S2.3 using the child nodes as the current nodes.
[0016] Preferably, in S3, the nodes of the visualization tree are recursively traversed and the following judgment is performed;
[0017] S3.1: Determine whether the current node has a child node and is in the expanded state. If so, go to S3.2. If not, return recursively;
[0018] S3.2: Determine whether the current node has one and only one child node. If so, the column number of the current node is equal to the column number of its child node, and return recursively. If not, enter S3.3;
[0019] S3.3: Assume that all leaf nodes of the current node are arranged in a row, and determine whether the length of the current node is an even number. If so, the middle leaf node number = the length of the current node / 2. If not, the middle leaf node number = (the length of the current node + 1) / 2.
[0020] S3.4: Find the child nodes of the ancestor nodes of the intermediate leaf nodes that satisfy S3.3 from the child nodes of the current node , specifically:
[0021] Starting from the first leaf node of the current node, traverse and accumulate the lengths of the leaf nodes to get the sum of the lengths;
[0022] When the sequence number of the intermediate leaf node in S3.3 is greater than the sum of the lengths of the intermediate leaf nodes and less than the sum of the length of the current leaf node plus the length of the next leaf node, the next leaf node is recorded as , and the sum of the length of the current leaf node and the length of the next leaf node is ;
[0023] When the length sum is equal to the intermediate node number of S3.3, record the current child node as and length and ;
[0024] S3.5 From the child nodes of the current node Start traversing and accumulating child nodes to get the length ;
[0025] S3.6: The column number of the current node = the child node Column number + ( - ) / 2.
[0026] Compared with the prior art, the present invention has the following beneficial effects:
[0027] This application uses the tree structure data of the default snapshot of network data to traverse and calculate the length, row number and column number of leaf nodes and non-leaf nodes, and then obtains the positions of leaf nodes and non-leaf nodes. With leaf nodes and non-leaf nodes as visualization components, a compact, symmetrical, and non-overlapping visualization tree can be generated, and the default snapshot of network data can be converted into intuitive and meaningful visualization graphics for presentation, helping people to understand data more intuitively and deeply, quickly discover and mine effective information, and greatly improve work efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 Schematic diagram of the calculation process of the leaf node position;
[0029] Figure 2 Schematic diagram of the calculation process of non-leaf node positions;
[0030] Figure 3 and Figure 4 Schematic diagram of node position calculation. DETAILED DESCRIPTION
[0031] In order to facilitate those skilled in the art to understand the technical content of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific examples. It should be understood that the specific examples described herein are only used to explain the present invention and are not used to limit the present invention.
[0032] Embodiment 1:
[0033] A visual tree layout method based on network data snapshot includes the following steps:
[0034] S1: Get the tree structure data of the default snapshot of network data;
[0035] S2: Based on the data in S1, calculate the total number of rows and columns of the visualization tree, the row number and length of non-leaf nodes (the length of the current node is the number of all leaf nodes it belongs to), and the position of the leaf node (including row number and column number), such as Figure 1 As shown, the specific algorithm is as follows:
[0036] S2.1: Determine whether the current node is the root node. If so, the row number of the current node is 1; if not, the row number of the current node is equal to the row number of its parent node plus 1;
[0037] S2.2: Determine whether the row number of the current node is greater than the total number of rows. If so, update the total number of rows to the row number of the current node.
[0038] S2.3: Determine whether the current node has child nodes and is in an expanded state. If so, execute S2.1 to recursively traverse the child nodes of the current node. After completing the recursive traversal, the length of the current node is the sum of the lengths of the next-level child nodes; if not, the length of the current node is 1, the total number of columns is accumulated by 1, and the column number of the current node is the current total number of columns.
[0039] S3: Based on the data of S1 and S2, calculate the position of non-leaf nodes of the visualization tree, such as Figure 2 As shown, the specific algorithm is as follows:
[0040] S3.1: Determine whether the current node has a child node and is in the expanded state. If so, go to S3.2. If not, return recursively;
[0041] S3.2: Determine whether the current node has one and only one child node. If so, the column number of the current node is equal to the column number of its child node, and return recursively. If not, enter S3.3;
[0042] S3.3: Assume that all leaf nodes of the current node are arranged in a row, and determine whether the length of the current node is an even number. If so, the middle leaf node number = the length of the current node / 2. If not, the middle leaf node number = (the length of the current node + 1) / 2.
[0043] S3.4: Find the child node of the ancestor node of the intermediate leaf node that satisfies S3.3 from the leaf node of the current node , specifically:
[0044] Start from the first leaf node of the current node and traverse and add the lengths of the leaf nodes to get the sum of the lengths;
[0045] When the sequence number of the intermediate leaf node in S3.3 is greater than the sum of the lengths of the intermediate leaf nodes and less than the sum of the length of the current leaf node plus the length of the next leaf node, the next leaf node is recorded as , and the sum of the length of the current leaf node and the length of the next leaf node is ;
[0046] When the length sum is equal to the intermediate leaf node number of S3.3, record the current leaf node as , length and Equal to leaf node Length;
[0047] S3.5 From the leaf node of the current node Start traversing and accumulating leaf nodes to get the length ;
[0048] S3.6: The column number of the current node = leaf node Column number + ( - ) / 2.
[0049] S4: Draw a tree visualization view based on the location information of all nodes obtained in S2 and S3.
[0050] In this embodiment, if Figure 3 , the length of all leaf nodes is 1, the length of node B is 2, the length of node C is 3, the length of node D is 4, and the length of node A is 10.
[0051] The middle leaf node of node C is Y4, and the middle node of node C is also Y4. According to the algorithm, the column number of node C can be calculated as follows:
[0052] The column number of node C = the column number of node Y4 + (the length of node Y5 - the length of node Y3) / 2.0 = 4 + (1-1) / 2.0 = 4;
[0053] The middle leaf node of node A is Y5, and the middle child node of node A is C. According to the algorithm, the column number of node A can be calculated as follows:
[0054] The column number of node A = the column number of node C + (the length of node D + the length of node Y10 - the length of node B) / 2.0 = 4 + (4 + 1 - 2) / 2.0 = 5.5;
[0055] like Figure 4 , the length of all leaf nodes is 1, the length of node B is 2, the length of node C is 3, the length of node D is 4, and the length of node A is 10.
[0056] The middle leaf node of node D is Y7, and the middle node of node D is also Y7. According to the algorithm, the column number of node D can be calculated as follows:
[0057] The column number of node C = the column number of node Y7 + ((the length of node Y8 + the length of node Y9) - (the length of node Y6)) / 2.0 = 7 + (2-1) / 2.0 = 7.5;
[0058] The middle leaf node of node A is Y6, and the middle child node of node A is D. According to the algorithm, the column number of node A can be calculated as follows:
[0059] The column number of node A = the column number of node D + ((the length of node Y10 + the length of node Y11) - (the length of node B + the length of node C)) / 2.0 = 7.5 + (2-5) / 2.0 = 6.
[0060] This application uses the tree structure data of the default snapshot of network data to traverse and calculate the length, row number and column number of leaf nodes and non-leaf nodes, and then obtains the positions of leaf nodes and non-leaf nodes. With leaf nodes and non-leaf nodes as visualization components, a compact, symmetrical, and non-overlapping visualization tree can be generated, and the default snapshot of network data can be converted into intuitive and meaningful visualization graphics for presentation, helping people to understand data more intuitively and deeply, quickly discover and mine effective information, and greatly improve work efficiency.
Claims
1. A visual tree layout method based on network data snapshots, It is characterized in that The following steps are involved: S1: Get the tree structure data of the default snapshot of network data; S2: Based on the tree structure data, calculate the total number of rows and columns of the visualization tree, the row number and length of non-leaf nodes, and the position of leaf nodes; S3: Calculate the position of non-leaf nodes of the visualization tree based on the tree structure data obtained in S1 and the data calculated in S2; S4: Draw a tree visualization view based on the position data of the leaf nodes in S2 and the position data of the non-leaf nodes in S3.
2. A visual tree layout method based on network data snapshot according to claim 1, It is characterized in that In S2, the nodes of the visual tree are recursively traversed and the following judgments are made: S2.1: Determine whether the current node is the root node. If so, the row number of the current node is 1. If not, the row number of the current node is equal to the row number of its parent node plus 1. S2.2: The total number of rows is initially 1, and it is determined whether the row number of the current node is greater than the total number of rows. If so, the total number of rows is updated to the row number of the current node; S2.3: Determine whether the current node has a child node and is in the expanded state. If so, jump to S2.
4. If not, the length of the current node is 1, the total number of columns is accumulated by 1, the column number of the current node is the current total number of columns and return recursively; S2.4: Traverse the child nodes and execute S2.1-S2.3 using the child nodes as the current nodes.
3. A visual tree layout method based on network data snapshot according to claim 2, It is characterized in that In S3, the nodes of the visualization tree are recursively traversed and the following judgments are made; S3.1: Determine whether the current node has a child node and is in the expanded state. If so, go to S3.
2. If not, return recursively; S3.2: Determine whether the current node has one and only one child node. If so, the column number of the current node is equal to the column number of its child node, and return recursively. If not, enter S3.3; S3.3: Assume that all leaf nodes of the current node are arranged in a row, and determine whether the length of the current node is an even number. If so, the sequence number of the middle leaf node = the length of the current node / 2; if not, the sequence number of the middle leaf node = (the length of the current node + 1) / 2; S3.4: Find the child node of the ancestor node of the intermediate leaf node that satisfies S3.3 from the leaf node of the current node , specifically: Start from the first leaf node of the current node and traverse and add the lengths of the leaf nodes to get the sum of the lengths; When the sequence number of the intermediate leaf node is greater than the sum of the lengths of the intermediate leaf nodes, and the sequence number of the intermediate leaf node is less than the sum of the lengths of the current leaf node and the length of the next leaf node, the next leaf node is recorded as , and the sum of the length of the current leaf node and the length of the next leaf node is ; When the length sum is equal to the middle leaf node sequence number, record the current leaf node as , length and Equal to leaf node Length; S3.5 From the leaf node of the current node Start traversing and accumulating leaf nodes to get the length ; S3.6: The column number of the current node = leaf node Column number + ( - ) / 2.
Citation Information
Patent Citations
Visualization interaction method based on space optimization tree layout
CN103984724A
Data analysis and visualization processing method and device
CN107491305A
Hierarchical data visualization method and device, equipment and storage medium
CN116010510A
System and method for visualization of node-link structures
US20070018983A1
