A method for visualizing tree layout based on network data snapshots

By calculating the tree structure data of network data snapshots, a compact, symmetrical, and non-overlapping visual tree is generated, which solves the problems of non-compact, asymmetrical, and overlapping layouts in network data snapshot analysis, and realizes intuitive data display and rapid information discovery.

CN118568307BActive Publication Date: 2026-06-02SHENSI TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHENSI TECH CO LTD
Filing Date
2024-07-09
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

Existing network data snapshot analysis suffers from issues such as non-compact layout, asymmetry, and overlap, resulting in unintuitive data presentation.

Method used

By acquiring the tree structure data from the default snapshot of network data, the total number of rows, total number of columns, row number and length of non-leaf nodes, and position of leaf nodes of the visualization tree are calculated. The tree visualization view is then drawn, and a compact, symmetrical, and non-overlapping visualization tree is generated using recursive traversal and specific judgment rules.

Benefits of technology

It generates a compact, symmetrical, and non-overlapping visual tree, which helps to intuitively understand and quickly discover useful information in network data, thereby improving work efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118568307B_ABST
    Figure CN118568307B_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on network data snapshot visual tree layout method, belong to data visualization technical field, including the following steps: obtaining the tree structure data of network data default snapshot;According to tree structure data, the total row number, total column number, the row number and length of non-leaf node, the position of leaf node of visual tree are calculated;According to the tree structure data obtained in S1 and the data calculated in S2, the position of non-leaf node of visual tree is calculated;According to the position data of leaf node in S2 and the position data of non-leaf node in S3, tree type visual view is drawn, the tree structure data of network data default snapshot is traversed in the application, and the length, row number and column number of leaf node and non-leaf node are calculated, the position of leaf node and non-leaf node is obtained, and compact, symmetrical, non-overlapping visual tree can be generated layout, can be more intuitive and in-depth to understand data, quickly discover and mine effective information, greatly improve work efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of data visualization technology, specifically relating to a visualization tree layout method based on network data snapshots. Background Technology

[0002] With the widespread application of computer technology in various fields, massive amounts of information and data have been generated. Understanding and communicating the infinite value of data is crucial to maximizing its potential. Data visualization is a powerful tool that can transform abstract, raw data into intuitive and meaningful visual graphics, helping people to understand data more intuitively and deeply, quickly discover and extract valuable information, and greatly improve work efficiency.

[0003] In the field of cybersecurity, previous network data snapshot analysis data displays were not intuitive and lacked visualization. If the data were directly visualized, there would be problems such as loose layout, asymmetry, and overlap. Summary of the Invention

[0004] To address the problems mentioned in the background art, this invention provides a visualization tree layout method based on network data snapshots, which solves the problems of non-compact, asymmetrical, and overlapping layouts when directly visualizing existing network data snapshot analysis data.

[0005] To achieve the above objectives, the present invention provides the following technical solution:

[0006] A method for visualizing tree layout based on network data snapshots includes the following steps:

[0007] S1: Retrieves 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, total number of columns, row number and length of non-leaf nodes, and position of leaf nodes in the visualized tree;

[0009] S3: Based on the tree structure data obtained in S1 and the data calculated in S2, calculate the positions of the non-leaf nodes of the visualized tree;

[0010] S4: Draw a tree-shaped 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 visualized tree are recursively traversed and the following judgments are made:

[0012] S2.1: Determine if the current node is the root node. If it is, the row number of the current node is 1. If it is 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 set to 1. Check if the row number of the current node is greater than the total number of rows. If it is greater, update the total number of rows to the row number of the current node.

[0014] S2.3: Determine if the current node has child nodes and is in an expanded state. If yes, jump to S2.4. Otherwise, set the length of the current node to 1, increment the total number of columns by 1, set the column number of the current node to the current total number of columns, and return the recursion.

[0015] S2.4: Traverse the child nodes and execute S2.1-S2.3 with the child node as the current node.

[0016] Preferably, in S3, the nodes of the visualized tree are recursively traversed and the following judgments are made;

[0017] S3.1: Determine if the current node has child nodes and is in an expanded state. If yes, proceed to S3.2; otherwise, return to recursion.

[0018] S3.2: Determine if the current node has exactly one child node. If so, the column number of the current node is equal to the column number of its child node, and return the recursion. If not, proceed to S3.3.

[0019] S3.3: If all leaf nodes of the current node are arranged in a row, determine whether the length of the current node is even. If it is, the index of the middle leaf node is equal to the length of the current node / 2. If it is not, the index of the middle leaf node is equal to (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 among 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 obtain the sum of the lengths;

[0022] When the index of the intermediate leaf node in S3.3 is greater than the sum of the lengths of the intermediate leaf nodes, but less than the sum of the lengths of the current leaf node and the next leaf node, record the next leaf node as... And the sum of the lengths of the current leaf node and the next leaf node is . ;

[0023] When the sum of lengths equals the index of the intermediate node in S3.3, record the current child node as... and length and ;

[0024] S3.5 From the child nodes of the current node Start by traversing and accumulating the child nodes to get the length. ;

[0025] S3.6: The column number of the current node = the number of its child nodes. Column number + ( - ) / 2.

[0026] Compared with the prior art, the beneficial effects of the present invention are:

[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 position of leaf nodes and non-leaf nodes. Using leaf nodes and non-leaf nodes as the components of visualization, a compact, symmetrical, and non-overlapping visualization tree can be generated. The default snapshot of network data is transformed into an intuitive and meaningful visualization graphic for presentation, helping people to understand the data more intuitively and deeply, quickly discover and mine effective information, and greatly improve work efficiency. Attached Figure Description

[0028] Figure 1 This is a schematic diagram illustrating the calculation process for the leaf node positions.

[0029] Figure 2 This is a schematic diagram illustrating the calculation process for non-leaf node positions.

[0030] Figure 3 and Figure 4 This is a schematic diagram illustrating the calculation of node positions. Detailed Implementation

[0031] To facilitate understanding of the technical content of this invention by those skilled in the art, the invention will be further described in detail below with reference to the accompanying drawings and specific examples. It should be understood that the specific examples described herein are merely illustrative and not intended to limit the scope of the invention.

[0032] Example 1:

[0033] A method for visualizing tree layout based on network data snapshots includes the following steps:

[0034] S1: Retrieves 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 visualized tree, the row number and length of non-leaf nodes (the length of the current node is the number of all its leaf nodes), and the position of the leaf nodes (including row and column numbers), such as... Figure 1 As shown, the specific algorithm is as follows:

[0036] S2.1: Determine if the current node is the root node. If it is, set the row number of the current node to 1; otherwise, set the row number of the current node to the row number of its parent node plus 1.

[0037] S2.2: Determine if the row number of the current node is greater than the total number of rows. If it is, update the total number of rows to the row number of the current node.

[0038] S2.3: Determine if 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 incremented by 1, and the column number of the current node is the current total number of columns.

[0039] S3: Based on the data in S1 and S2, calculate the positions of the non-leaf nodes in the visualized tree, such as... Figure 2 As shown, the specific algorithm is as follows:

[0040] S3.1: Determine if the current node has child nodes and is in an expanded state. If yes, proceed to S3.2; otherwise, return to recursion.

[0041] S3.2: Determine if the current node has exactly one child node. If so, the column number of the current node is equal to the column number of its child node, and return the recursion. If not, proceed to S3.3.

[0042] S3.3: If all leaf nodes of the current node are arranged in a row, determine whether the length of the current node is even. If it is, the index of the middle leaf node is equal to the length of the current node / 2. If it is not, the index of the middle leaf node is equal to (the length of the current node + 1) / 2.

[0043] S3.4: Find the child nodes of the ancestor nodes of the intermediate leaf nodes that satisfy S3.3 from the leaf nodes of the current node. Specifically:

[0044] Starting from the first leaf node of the current node, traverse and accumulate the lengths of the leaf nodes to obtain the sum of the lengths;

[0045] When the index of the intermediate leaf node in S3.3 is greater than the sum of the lengths of the intermediate leaf nodes, but less than the sum of the lengths of the current leaf node and the next leaf node, record the next leaf node as... And the sum of the lengths of the current leaf node and the next leaf node is . ;

[0046] When the sum of the lengths equals the index of the intermediate leaf node in 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 by traversing and accumulating the leaf nodes to get the length. ;

[0048] S3.6: The column number of the current node = the leaf node Column number + ( - ) / 2.

[0049] S4: Draw a tree-shaped visualization view based on the position information of all nodes obtained from S2 and S3.

[0050] In this embodiment, as Figure 3 All leaf nodes have a length of 1, node B has a length of 2, node C has a length of 3, node D has a length of 4, and node A has a length of 10.

[0051] The middle leaf node of node C is Y4, and the middle node of node C is also Y4. Therefore, 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. Therefore, 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 All leaf nodes have a length of 1, node B has a length of 2, node C has a length of 3, node D has a length of 4, and node A has a length of 10.

[0056] The middle leaf node of node D is Y7, and the middle node of node D is also Y7. Therefore, 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. Therefore, 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 position of leaf nodes and non-leaf nodes. Using leaf nodes and non-leaf nodes as the components of visualization, a compact, symmetrical, and non-overlapping visualization tree can be generated. The default snapshot of network data is transformed into an intuitive and meaningful visualization graphic for presentation, helping people to understand the data more intuitively and deeply, quickly discover and mine effective information, and greatly improve work efficiency.

Claims

1. A method for visualizing tree layout based on network data snapshots, characterized in that, Includes the following steps: S1: Retrieves the tree structure data of the default snapshot of network data; S2: Based on the tree structure data, calculate the total number of rows, total number of columns, row number and length of non-leaf nodes, and position of leaf nodes in the visualized tree; In S2, the nodes of the visualized tree are recursively traversed and the following judgments are made: S2.1: Determine if the current node is the root node. If it is, the row number of the current node is 1. If it is 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 set to 1. Check if the row number of the current node is greater than the total number of rows. If it is greater, update the total number of rows to the row number of the current node. S2.3: Determine if the current node has child nodes and is in an expanded state. If yes, jump to S2.

4. Otherwise, set the length of the current node to 1, increment the total number of columns by 1, set the column number of the current node to the current total number of columns, and return the recursion. S2.4: Traverse the child nodes and execute S2.1-S2.3 with the child node as the current node; S3: Based on the tree structure data obtained in S1 and the data calculated in S2, calculate the positions of the non-leaf nodes of the visualized tree; In S3, the nodes of the visualized tree are recursively traversed and the following judgments are made; S3.1: Determine if the current node has child nodes and is in an expanded state. If yes, proceed to S3.2; otherwise, return to recursion. S3.2: Determine if the current node has exactly one child node. If so, the column number of the current node is equal to the column number of its child node, and return the recursion. If not, proceed to S3.

3. S3.3: If all leaf nodes of the current node are arranged in a row, determine whether the length of the current node is even. If it is, the index of the middle leaf node is equal to the length of the current node / 2. If it is not, the index of the middle leaf node is equal to (the length of the current node + 1) / 2. S3.4: Find the child nodes of the ancestor nodes of the intermediate leaf nodes that satisfy S3.3 from the leaf nodes of the current node. Specifically: Starting from the first leaf node of the current node, traverse and accumulate the lengths of the leaf nodes to obtain the sum of the lengths; When the index of the intermediate leaf node is greater than the sum of the lengths of the current leaf node and the next leaf node, record the next leaf node as... And the sum of the lengths of the current leaf node and the next leaf node is . ; When the sum of the lengths equals the index of the middle leaf node, record the current leaf node as... , length and equal to leaf node Length; S3.5 From the leaf node of the current node Start by traversing and accumulating the leaf nodes to get the length. ; S3.6: The column number of the current node = the leaf node Column number + ( - ) / 2; S4: Draw a tree-shaped visualization view based on the position data of the leaf nodes in S2 and the position data of the non-leaf nodes in S3.