Network topology visualization method based on force-directed graph algorithm
Through the network topology visualization method based on the force-oriented graph algorithm, the center node is determined by counting the number of node connections and setting thresholds, and the central ring algorithm and hole points are used to deal with link overlap, the problem of node display in the e-commerce system is solved, and the orderly node and link arrangement is achieved, which improves user observation and positioning efficiency.
Patent Information
- Application Number
- CN202510499918.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-21
- Publication Date
- 2025-09-02
AI Technical Summary
The existing network topology layout algorithms fail to meet the needs of specific scenarios in the e-commerce system, resulting in messy node display and low user observation and positioning efficiency.
The network topology visualization method based on the force-oriented graph algorithm is adopted to determine the center node by counting the number of node connections and setting the threshold, the central ring algorithm is used to layout, and the link overlap is processed by setting holes, and parallel or polyline connections are used to avoid overlap, forming an ordered node and link arrangement.
It realizes the orderly arrangement of nodes and links, improves the convenience of user observation and positioning, enhances the reliability, security and aesthetics of the e-commerce system, and simplifies the automated management and monitoring of equipment.
Smart Images

Figure HDA0005368156410000011 
Figure HDA0005368156410000012 
Figure HDA0005368156410000021
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of automatic operation and maintenance management of network equipment, and in particular to a network topology visualization method based on a force-directed graph algorithm. Background Art
[0002] As e-commerce systems continue to grow in scale and complexity, research on network device auto-discovery technology has become increasingly widespread. It can help quickly identify and map devices within e-commerce systems, such as routers, switches, servers, and clients. Once devices are discovered, a network topology diagram can visually display the connections between related devices in the system, ensuring that all devices in the network are monitored and managed. This is particularly important for maintaining a large and dynamically changing e-commerce platform. Therefore, combining network device auto-discovery technology with network topology visualization technology can help e-commerce system operators and maintainers automate the addition, management, and monitoring of devices, thereby enhancing the reliability and security of e-commerce systems.
[0003] Currently, topology layout algorithms used to implement network topology graphs, including force-directed graph algorithms, are generally general-purpose and are typically not optimized for specific scenarios. These algorithms typically focus on ensuring that topological nodes overlap and links intersect, but in certain application scenarios, such layouts can appear chaotic and disorganized. E-commerce systems need to develop or adopt more advanced topology layout algorithms that can be customized to specific scenarios. This will enable a clearer and more organized network topology display, better adapting to evolving business needs.
[0004] Currently, commonly used algorithms for network topology visualization are generally categorized as tree-based layout algorithms and force-directed graph layout algorithms. The tree layout algorithm is a relatively common layout algorithm with a simple final structure. Its structure consists of a collection of one or more nodes. The core of the algorithm recursively traverses all nodes to generate a tree-like parent-child data structure. The positions of each node are then determined and displayed in the graph based on the canvas size. This layout works well for simple, organized data, but with larger amounts of data, especially when connections are irregular, the graph can appear disorganized. The force-directed graph algorithm, a commonly used algorithm for logically arranging network topologies, simulates the Coulomb and spring forces in physics and, after multiple iterations, balances the forces to determine the final node positions. While this algorithm is advantageous for displaying large numbers of nodes, regardless of actual usage scenarios, in e-commerce networks, with a large number of nodes, the entire structure tends to converge toward nodes with a high number of connections, leading to significant node overlap and stagnation. This hinders the visualization and location of nodes, reducing user efficiency.
[0005] Currently existing related algorithms generally do not layout network device nodes for specific scenarios, such as e-commerce network systems. After obtaining the nodes, they are more likely to be directly laid out into a mesh structure without considering the connection relationship between the nodes or the overlap between the connections. Whether from the perspective of aesthetics or practicality, they do not meet the corresponding requirements, which hinders users from observing and locating the nodes and is inefficient. Summary of the Invention
[0006] The problem to be solved by this invention is that, in the context of automated operation and maintenance of network equipment in e-commerce systems, existing layout algorithms cannot meet the layout structure requirements of network equipment. The disorganized display structure makes it difficult for users to observe and locate nodes. Therefore, a network topology visualization method based on a force-directed graph algorithm is provided. By counting and counting the number of node connections and setting a threshold, the center node is determined, and the remaining nodes are laid out as ring nodes. This makes the entire layout structure simple and clear, making it easier for users to locate and observe nodes.
[0007] In order to achieve the purpose of the present invention, the technical solution adopted is: a network topology visualization method based on a force-directed graph algorithm, comprising the following steps:
[0008] 1) For network device nodes, generate the initial displayed node graph according to the force-directed graph algorithm;
[0009] 2) Apply the central ring algorithm to the initially displayed node graph to obtain a central ring display graph. The central ring display graph is a display structure with a certain node as the center and the remaining connected nodes as nodes on the ring;
[0010] 3) In the center ring display, optimize overlapping links to avoid overlap.
[0011] As an optimization solution of the present invention, a threshold is set and votes are counted to determine which nodes are the center of the circle. Once the number of votes exceeds the threshold, the node becomes the center of the circle, and the child nodes connected to it that do not exceed the threshold are displayed on the ring. Multiple links between the same nodes only count as one vote.
[0012] The formula for the ring is as follows:
[0013] R 2 =(xx i ) 2 +(yy i ) 2
[0014] Where: x i and y i is the coordinate of the center of a circular block, and R is the set radius.
[0015] As an optimization solution, after determining the center and the nodes on the ring, it is necessary to check whether there are any connection points at the ring nodes. The line connecting the center and the ring nodes is used as a ray, and the positions of subsequent child nodes are determined based on the angle of this ray: the first child node is located on the ray, and the remaining child nodes are distributed symmetrically along the ray, forming a ring block radiating outward from the center. If the number of child nodes of a node exceeds a set threshold, the node generates a new center node and migrates the excess child nodes to the ring managed by the new center to ensure the stability of the hierarchical structure.
[0016] As an optimization solution of the present invention, when displaying the layout, all circular blocks are translated to the coordinate origin and sorted from most to least according to the number of nodes contained in the circular blocks, with priority being placed in sequence along the horizontal axis to the right. For the circular blocks that have been laid out, their maximum horizontal and vertical coordinate values are calculated, and the starting position of the subsequent circular blocks needs to be offset to the right of the maximum horizontal coordinate of the current row to ensure that there is no overlap. If the number of circular blocks laid out in a single row exceeds a preset threshold, the line is wrapped to the starting position of the next row for display until all the arrangements are completed.
[0017] As an optimization solution of the present invention, in step 3), holes are made on the icons of the overlapping links, and parallel lines or broken lines are used to avoid overlap.
[0018] As an optimization solution of the present invention, the hole point processing is as follows: first, the icon is divided into four blocks based on its center, namely the upper left, upper right, lower left, and lower right. The hole is made on the icon with the center point as the center, and the coordinate points that can be connected are determined at certain intervals as hole points. If the current coordinates on the icon are already connected, this point will be marked, and the coordinates of the next connection should select the next available hole point.
[0019] As an optimization solution of the present invention, in step 3), when there are multiple links between two nodes with overlapping links, after determining the hole point on the icon, the two nodes are connected in a straight line, but are connected by parallel lines at a certain interval.
[0020] As an optimization solution of the present invention, in step 3), when the overlapping links are three or more nodes on a straight line, and the middle node blocks the connection line, making it impossible to distinguish which two nodes the link is between, after determining the hole point on the icon, select the hole point on the node to make a broken line connection.
[0021] The present invention has the following positive effects: 1) The present invention has the advantages of simplicity and clarity, and the arrangement and layout of nodes and links become more regular, making it easier for users to observe and locate nodes. This can help e-commerce system operators and maintainers to automatically add, manage, and monitor equipment, thereby enhancing the reliability, security, and aesthetics of the e-commerce system.
[0022] 2) This invention improves visibility, simplifying and regularly arranging nodes and links, making network topology diagrams more intuitive and easy to understand. This more organized layout helps operators quickly locate and manage devices. It is particularly suitable for the complex network environments found in e-commerce systems, providing users with a more efficient and intuitive network management method. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0024] Figure 1 is the node-link overlap graph;
[0025] Figure 2 It is a binary "hole punching" graph;
[0026] Figure 3 Optimize graph for link overlap;
[0027] Figure 4 It is a force-directed algorithm with many nodes and few connections.
[0028] Figure 5 It is a force-directed algorithm with a graph that has many links and few nodes;
[0029] Figure 6 It is a multi-link multi-node graph for force-directed algorithm;
[0030] Figure 7 Optimize the graph to have more links and fewer nodes in the central ring;
[0031] Figure 8 An optimized graph with multiple links and nodes in the central ring. DETAILED DESCRIPTION
[0032] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0033] The terms "first," "second," and the like in the specification, claims, and accompanying drawings of the present invention are used to distinguish between different items, not to describe a specific order. Furthermore, the terms "including," "having," and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of steps or elements is not limited to the listed steps or elements and may include steps or elements that are not listed.
[0034] The technical solution of the present application will be further explained below with reference to the accompanying drawings and through specific implementation methods.
[0035] 1. Force-directed algorithm for graph generation;
[0036] Force-directed algorithms are advantageous when there are few nodes or connections between them. However, for large numbers of nodes and connections, they can still meet most display requirements, regardless of actual requirements. With a large number of nodes, they present a centrally converged network, resembling a network graph. This approach is not tailored to specific scenarios, resulting in a disorganized layout of network device nodes found in e-commerce systems. However, it is still possible to generate and obtain the initial node graph using the force-directed graph algorithm once to eliminate scattered nodes and nodes with few connections, improving performance.
[0037] 2. The central ring forms a picture;
[0038] The center ring is a display structure with a certain node as the center and the rest of the nodes with a connection relationship as nodes on the ring. Therefore, how to determine the center of the circle is a key step. Here, the nodes that serve as the center of the circle are determined by setting a threshold and counting votes. Once the number of votes exceeds the threshold, it becomes the center node, and the child nodes connected to it that do not exceed the threshold are displayed on the ring. As for the number of votes, it is calculated based on whether there is a connection to each node. Each additional link adds one vote. The threshold can be determined based on the votes of all nodes after the data is counted. After determining the center of the circle, traverse all nodes according to the connection relationship of the links to form hierarchical data from the center to the ring. The remaining nodes follow the above steps to generate ring block data. Since there may be multiple links between nodes at the same time, in order to avoid duplication, multiple links between the same nodes are only counted as one vote. The ring formula is as follows:
[0039] R 2 =(xx i ) 2 +(yy i ) 2
[0040] Where: x i and y iis the coordinate of the center of a certain ring block, and R is the set radius. In order to prevent nodes from overlapping, the radius setting needs to be determined according to the number of child nodes at the center and the size of the node icon. After determining the center and the nodes on the ring, it is necessary to check whether there is a connection point between the ring nodes. The line connecting the center to the ring nodes is used as a ray, and the position of subsequent child nodes is determined according to the angle of the ray. The first child node is located on the ray, and the remaining child nodes are symmetrically distributed along both sides of the ray, forming a ring block radiating outward from the center of the circle; if the number of child nodes of a node exceeds the set threshold, the node will generate a new center node and migrate the excess child nodes to the ring managed by the new center to ensure the stability of the hierarchical structure. In order to reduce node overlap, the threshold should be set as small as possible, and there should not be too many nodes on the ring. If the hierarchy is too deep, the ring still needs to be displayed as an independent center for aesthetics.
[0041] 3. Link processing;
[0042] In the center ring diagram, there is a problem with the display of links. That is, when two or more nodes are on the same horizontal and vertical coordinates or there are too many connections between nodes, the links will overlap. Figure 1 As shown, it is impossible to tell whether there is one link or two, and whether there are overlapping links in the figure. In order to obtain link information more intuitively, it needs to be optimized. The principle is to first divide the icon into four block levels with the center of the icon, namely the upper left, upper right, lower left, and lower right, and "punching holes" is to use the center point as the center on the icon and determine the coordinate points that can be connected at a certain interval, which are "hole points". If the current coordinates on the icon are already connected, this point will be marked, and the coordinates of the next connection will be the next unmarked "hole point". See the principle diagram Figure 2 After determining the hole points on the icon, you can use polylines to process them, and avoid overlap between lines. The optimization results are as follows: Figure 3 shown.
[0043] Specific implementation case 1 is as follows:
[0044] 1. Force-directed algorithm for graph generation;
[0045] The topology data is derived from the backend's automatic discovery algorithm, which retrieves relevant device nodes in the e-commerce system network. Without coordinates, the force-directed algorithm is used for the first step of processing, aiming to resolve scattered nodes and nodes with few connections. With the force-directed algorithm, the entire node structure is laid out in a mesh structure. The following three scenarios are used for comparison:
[0046] (1) There are fewer connections but more nodes.
[0047] (2) There are many connections but few nodes.
[0048] (3) The situation with a large number of nodes and a large number of connections.
[0049] After processing with the force-directed algorithm, refer to the attached Figure 4 、 5 , as shown in 6.
[0050] 2. Center Ring Algorithm
[0051] After the force-directed algorithm generates the graph, the center ring algorithm is used to generate multiple block-shaped ring structures based on the link connections. When processing the rings, because there may still be a large number of connections between the obtained center data centers, the center data is further processed and regenerated, and the old center data that has not been included in the center is displayed on the ring. Because there are multiple ring blocks, when displaying the layout, all ring blocks are translated to the coordinate origin and sorted from the largest to the smallest number of nodes, with priority given to the right along the horizontal axis. For the already laid out ring blocks, their maximum horizontal and vertical coordinate values are calculated, and the starting position of subsequent ring blocks is offset to the right of the maximum horizontal coordinate of the current row to ensure no overlap. If the number of laid out ring blocks in a single row exceeds a preset threshold, the blocks are wrapped to the starting position of the next row until the layout is complete. To prevent all blocks from being displayed on the same row, the blocks may be wrapped to a new row if they exceed a certain number.
[0052] 3. Link processing;
[0053] After node processing is completed, consider the possibility of overlap between links between nodes. Generally, there are two situations:
[0054] (1) There are multiple links between two nodes.
[0055] (2) When three or more nodes are on a straight line, the middle node blocks the line, making it impossible to distinguish which two nodes are connected by the link.
[0056] After dotting the node icon at a certain interval, for the first case, the two nodes are still connected by a straight line, but with a parallel line at a certain interval. For the second case, a broken line connection is used, and the holes are selected on the nodes to connect them. See the attached picture for the final effect. Figure 7 、 8 As shown, the arrangement and layout of visible nodes and links have become more regular.
[0057] This method uses a force-directed algorithm to draw the network topology layout, processing scattered nodes or nodes with few connections. The center is then selected based on the number of links connecting the nodes, and the structure is rearranged in a central ring pattern. For potentially overlapping lines, "holes" are added to the icon, using parallel or broken lines to avoid overlap. The center node is determined by counting the number of connections and setting a threshold. The remaining nodes are laid out as nodes on the ring, making the overall layout simple and clear, making it easier for users to locate and observe nodes.
[0058] The specific embodiments described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above are only specific embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A network topology visualization method based on a force-directed graph algorithm, characterized by: The steps include: 1) For network device nodes, generate the initial displayed node graph according to the force-directed graph algorithm; 2) Apply the central ring algorithm to the initially displayed node graph to obtain a central ring display graph. The central ring display graph is a display structure with a certain node as the center and the remaining connected nodes as nodes on the ring; 3) In the center ring display, optimize overlapping links to avoid overlap.
2. The network topology visualization method based on the force-directed graph algorithm according to claim 1, characterized in that: The nodes that serve as the center of the circle are determined by setting a threshold and counting votes. Once the number of votes exceeds the threshold, the node becomes the center of the circle. The child nodes connected to it that do not exceed the threshold are displayed on the ring. Multiple links between the same node only count as one vote. The formula for the ring is as follows: R 2 =(x-x i ) 2 +(y-y i ) 2 Where: x i and y i is the coordinate of the center of a circular block, and R is the set radius.
3. The network topology visualization method based on the force-directed graph algorithm according to claim 2, characterized in that: After determining the center of the circle and the nodes on the ring, it is necessary to check whether there are connection points on the ring nodes. The line connecting the center of the circle to the ring nodes is used as a ray, and the positions of subsequent child nodes are determined according to the angle of the ray. The first child node is located on the ray, and the remaining child nodes are symmetrically distributed along both sides of the ray, forming a ring block radiating outward from the center of the circle; if the number of child nodes of a node exceeds the set threshold, the node will generate a new center node and migrate the excess child nodes to the ring managed by the new center to ensure the stability of the hierarchical structure.
4. The network topology visualization method based on the force-directed graph algorithm according to claim 3, characterized in that: When displaying the layout, all circular blocks are translated to the coordinate origin and sorted from most to least according to the number of nodes they contain, with priority given to arranging them in sequence along the horizontal axis to the right. For the circular blocks that have been laid out, their maximum horizontal and vertical coordinate values are calculated, and the starting position of subsequent circular blocks needs to be offset to the right of the maximum horizontal coordinate of the current row to ensure that there is no overlap. If the number of circular blocks laid out in a single row exceeds the preset threshold, they are wrapped to the starting position of the next row for display until all layouts are completed.
5. The network topology visualization method based on the force-directed graph algorithm according to claim 4, characterized in that: In step 3), for the overlapping links, holes are made on the icons, and parallel lines or broken lines are used to avoid overlap.
6. The network topology visualization method based on the force-directed graph algorithm according to claim 5, characterized in that: The hole point processing is as follows: first, the icon is divided into four blocks based on its center, namely the upper left, upper right, lower left, and lower right. The hole is to use the center point as the center on the icon, and determine the coordinate points that can be connected at a certain interval as the hole points. If the current coordinates on the icon already have a connection, this point will be marked, and the coordinates of the next connection should select the next available hole point.
7. The network topology visualization method based on the force-directed graph algorithm according to claim 6, characterized in that: In step 3), when there are multiple links between two nodes, after the hole point on the icon is determined, the two nodes are connected in a straight line, but parallel lines are connected at a certain interval.
8. The network topology visualization method based on the force-directed graph algorithm according to claim 6, characterized in that: In step 3), if the overlapping links are three or more nodes on a straight line, and the middle node blocks the connection, making it impossible to distinguish which two nodes the link is between, after determining the hole points on the icon, select the hole points on the nodes to make broken line connections.