Path diagram drawing method and device

By generating topological groups and calculating node coordinates in the same coordinate system, the problems of fiber occlusion and poor display effects in the path diagram are solved, and clear path display and hierarchical relationship maintenance are achieved.

CN118612079APending Publication Date: 2024-09-06FIBERHOME TELECOMMUNICATION TECHNOLOGIES CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410701214.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-31
Publication Date
2024-09-06

AI Technical Summary

Technical Problem

When the existing technology draws complex path diagrams, the graphics are often unclear because nodes are blocked by connecting fibers, resulting in poor user experience, and the node relationships and hierarchical structures cannot be effectively maintained.

Method used

By dividing the nodes to be drawn into main nodes and associated nodes, a topology group is generated, and the node coordinates are calculated according to the preset model to ensure that all nodes are drawn in the same rectangular coordinate system to avoid fiber occlusion and maintain hierarchical relationships.

Benefits of technology

It achieves a clear display of flow data paths, avoids fiber occlusion, improves the display effect and user experience, and maintains an obvious hierarchical structure of node associations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118612079A
    Figure CN118612079A
Patent Text Reader

Abstract

The invention discloses a path diagram drawing method and device, and relates to the field of path diagram drawing, and the method comprises the steps: taking to-be-drawn nodes as main nodes, and enabling all the main nodes and corresponding associated nodes to jointly generate a topology group; according to a preset model corresponding to each topology group, calculating the coordinates of each node in the group, after the calculation of the current topology group is completed, calculating the topology group containing the most associated nodes in other calculated topology groups of the main node, and after the calculation of the node coordinates of all the topology groups is completed, drawing nodes and connecting fibers; wherein the coordinates of all the nodes are located in the same rectangular coordinate system, and the connecting fiber between the two associated nodes in the preset model does not pass through the third node. The drawn path diagram can clearly display the trend of each piece of flow data, an obvious hierarchical relationship is kept, meanwhile, the granularity of each layer and each piece of flow is subdivided to calculate node coordinates, the situation that nodes are shielded by connecting fibers is avoided as much as possible, and the display effect is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of path map drawing, and specifically to a path map drawing method and device. Background Art

[0002] In the field of communications, there are a large number of scenarios for drawing path diagrams and topology diagrams. Usually based on user needs: generally, the maximum number of external fiber connections for a single node is 5, and the most common number is 2 to 5. The drawing method of the existing technology is based on node coordinates, combined with self-developed libraries or other third-party libraries for drawing, and finally presented to the user. There are also scenarios for drawing business path diagrams. Usually, the data of this scenario is displayed in the business dimension, including the node name of each business flow, the fiber connection relationship between nodes, but does not include the specific coordinate values ​​of the nodes.

[0003] At present, based on the above scenario, the common drawing method is to calculate the coordinate points in the form of node hierarchy and then draw the fiber connection. This method can display the flow path normally when the data volume is small, but when the data volume is too large or too complex, the fiber connection will block the node, the graphics will be unclear, and the user experience will be poor. In order to solve the problem of fiber connection blocking the node, some researchers have proposed solutions such as "mirror node" and "virtual node". These methods are to first calculate the relationship between all node coordinates and fiber connections, and then identify whether there is a fiber connection blocking the node. If node A is blocked, a virtual node A' of node A is generated, and the corresponding fiber connection is connected to the virtual node A'. This type of method can effectively solve the occlusion problem, but it will generate a large number of virtual nodes. It is difficult for users to distinguish the relationship between real nodes and virtual nodes, and the display effect is poor. In addition, the node association relationship is not considered in the prior art, and the flow data hierarchy is chaotic and the correlation is weak. Summary of the invention

[0004] The present application provides a path map drawing method and device, which can solve the technical problems existing in the prior art such as fiber connection blocking nodes and poor display effect.

[0005] In a first aspect, an embodiment of the present application provides a method for drawing a path map, the method comprising:

[0006] The nodes to be drawn are respectively used as main nodes, and each main node and the corresponding associated nodes jointly generate a topological group;

[0007] Calculate the coordinates of each node in the group according to the preset model corresponding to each topological group. After the calculation of the current topological group is completed, calculate the topological group with the most associated nodes among the other topological groups whose main nodes are calculated. After the node coordinates of all topological groups are calculated, draw the nodes and fibers.

[0008] Wherein, all node coordinates are located in the same rectangular coordinate system, and the fiber connection between two associated nodes in the preset model does not pass through a third node.

[0009] In combination with the first aspect, in one implementation, each topology group includes a master node ID of the group, all associated node IDs associated with the master node, and the number of associated nodes;

[0010] When there are two or more topology groups with the same number of associated nodes, each topology group is calculated in sequence according to the node ID order of the master node.

[0011] In combination with the first aspect, in one implementation, the preset models are classified according to the number of associated fibers in the topology group, and each type of preset model is classified into at least one type according to the number of associated nodes and the association relationship between the nodes;

[0012] When there is no association relationship between the associated nodes in a topological group, or the number of associated fibers in a topological group is odd, all associated nodes are evenly spaced around the main node, and the fiber length K of the main node and each associated node is the same. The main node is taken as the origin, and the coordinates of each associated node are calculated counterclockwise in the order of node ID from small to large.

[0013] In combination with the first aspect, in one implementation, when there is an association relationship between the associated nodes in the topological group and the number of associated fibers is an even number, the coordinates of each associated node are calculated in reverse time sequence in the order of the node ID from small to large, with the main node as the origin, and only the associated nodes associated with the main node have the same fiber length K as the main node;

[0014] If the currently calculated associated node is associated with the previously calculated associated node, the associated node with the largest node ID among the previously calculated associated nodes is used as the origin to calculate the coordinates of the current associated node, and the fiber length K between the current associated node and the associated node as the origin.

[0015] In combination with the first aspect, in one embodiment, collision detection is performed before drawing nodes and fibers, including: calculating whether there are other nodes on all lines connecting two nodes with a fiber length of K; if there are other nodes, expanding all K by the same multiple, and recalculating the node coordinates of all topological groups until there are no other nodes on the line.

[0016] In combination with the first aspect, in one implementation, when the number of associated fibers in the topology group is 2, there are two preset models, including:

[0017] There is no association relationship between the two associated nodes, and the two associated nodes are symmetrically distributed on both sides of the main node;

[0018] There is an association relationship between the two associated nodes, and a 90° angle is formed between the two associated nodes and the main node.

[0019] In combination with the first aspect, in one implementation, when the number of associated fibers in the topology group is 3, the three associated nodes in the preset model are distributed at the vertices of an equilateral triangle centered on the main node.

[0020] In combination with the first aspect, in one implementation, when the number of associated fibers in the topology group is 5, the 5 associated nodes in the preset model are distributed at the vertices of a regular pentagon centered on the main node.

[0021] In combination with the first aspect, in one implementation, when the number of associated fibers in the topology group is 4 and there is no association relationship between all associated nodes, the 4 associated nodes in the preset model are distributed at 4 vertices of a square centered on the main node;

[0022] When there is an association relationship between at least two associated nodes, the coordinates of each associated node are calculated in reverse time order according to the node ID from small to large, with the main node as the center, and the associated nodes only associated with the main node are distributed at the vertices of the square with the main node as the center, and the distance from the square vertex to the center is K;

[0023] Among the associated nodes with an associated relationship, if the currently calculated associated node is associated with the previously calculated associated node, the currently calculated associated node is distributed at the vertices of a square centered on the previously calculated associated node, and the distance from the vertices to the center of the square is K.

[0024] In a second aspect, an embodiment of the present application provides a path diagram drawing device based on the above-mentioned path drawing method, the device comprising:

[0025] A generation module is used to use the nodes to be drawn as main nodes respectively, and each main node and the corresponding associated nodes jointly generate a topology group;

[0026] A calculation module, which is used to calculate the coordinates of each node in the group according to the preset model corresponding to each topological group, wherein, after the calculation of the current topological group is completed, the topological group containing the most associated nodes is calculated among the other topological groups calculated by the main node, until the node coordinates of all topological groups are calculated; wherein all node coordinates are located in the same rectangular coordinate system, and the fiber connection between two associated nodes in the preset model does not pass through a third node;

[0027] The drawing module is used to draw nodes and fibers after the node coordinates of all topological groups are calculated.

[0028] The beneficial effects brought by the technical solution provided in the embodiments of the present application include:

[0029] By generating topological groups for the nodes to be drawn, the coordinates of each node of the topological group with the most associated nodes are calculated first. After the calculation of the current topological group is completed, the topological group with the most associated nodes is calculated among the other topological groups calculated by the main node, until the node coordinates of all topological groups are calculated, and then the nodes and fibers are drawn, and all node coordinates are in the same rectangular coordinate system. The fiber between two associated nodes in the preset model does not pass through the third node. Therefore, the direction of each flow data can be clearly displayed, maintaining an obvious hierarchical relationship, and at the same time, the node coordinates are calculated at the granularity of each level and each flow to avoid the situation where the fiber obscures the node as much as possible, thereby improving the display effect. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 A schematic diagram of a process flow of an embodiment of a method for drawing a path map of the present application;

[0031] Figure 2 This is a schematic diagram of the first preset model in which the number of associated fibers in the topology group of this application is 2;

[0032] Figure 3 This is a schematic diagram of a second preset model in which the number of associated fibers in the topology group of this application is 2;

[0033] Figure 4 This is a schematic diagram of a preset model in which the number of associated fibers in the topology group of this application is 3;

[0034] Figure 5 This is a schematic diagram of a preset model in which the number of associated fibers in the topology group of this application is 5;

[0035] Figure 6 This is a schematic diagram of the first preset model in which the number of associated fibers in the topology group of this application is 4;

[0036] Figure 7 This is a schematic diagram of a second preset model in which the number of associated fibers in the topology group of this application is 4;

[0037] Figure 8 This is a schematic diagram of the third preset model in which the number of associated fibers in the topology group of this application is 4;

[0038] Fig. 9 This is a schematic diagram of the fourth preset model in which the number of associated fibers in the topology group of this application is 4;

[0039] Fig.10 This is a schematic diagram of the fifth preset model in which the number of associated fibers in the topology group of this application is 4;

[0040] Fig.11 This is a schematic diagram of the node coordinate calculation principle in the embodiment of the present application;

[0041] Fig.12A schematic diagram of a process flow of another embodiment of the method for drawing a path map of the present application;

[0042] Fig.13 This is a schematic diagram of the path drawn by the path map drawing method of this application. DETAILED DESCRIPTION

[0043] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0044] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0045] First, some technical terms in the present application are explained to facilitate those skilled in the art to understand the present application.

[0046] Stream data: Stream data is a set of sequential, large, fast, and continuous data sequences. Generally speaking, stream data can be regarded as a dynamic data set that grows infinitely over time.

[0047] In a first aspect, an embodiment of the present application provides a method for drawing a path map.

[0048] In one embodiment, referring to Figure 1 , Figure 1 This is a schematic diagram of the process of the first embodiment of the method for drawing a path map of the present application. Figure 1 As shown, the path diagram drawing method includes:

[0049] S1. The nodes to be drawn are respectively used as main nodes, and each main node and the corresponding associated nodes jointly generate a topological group.

[0050] S2. Calculate the coordinates of each node in each topological group according to the preset model corresponding to each topological group. Specifically, first calculate the coordinates of each node of the topological group with the most associated nodes. After the calculation of the current topological group is completed, calculate the topological group with the most associated nodes among the other topological groups calculated by the main node until the node coordinates of all topological groups are calculated. Among them, all node coordinates are in the same rectangular coordinate system, and the fiber connection between two associated nodes in each preset model does not pass through the third node.

[0051] S3. After the node coordinates of all topological groups are calculated, the nodes and connecting fibers are drawn.

[0052] In this embodiment, the node coordinates of each topological group are calculated in turn according to the preset model corresponding to each topological group, and all node coordinates are located in the same rectangular coordinate system. The fiber connection between two associated nodes in the preset model does not pass through a third node. In this way, in the drawn path diagram, each topological group can maintain an obvious hierarchical relationship. At least, there will be no situation where the fiber connection of each topological group obscures the node, thereby improving the path clarity of the flow data and the display effect.

[0053] This application has no special requirements for the format of the original data, as long as the original data contains information such as node ID, node name, fiber connection relationship, etc. Further, in the above step S1, the node to be drawn is obtained according to the original stream data. In this embodiment, a set of node IDs is generated in the order of node ID from small to large. Each node is used as the main node, and the main node and the corresponding associated node generate a topological group. The expression form of each topological group is: [node ID, (associated node ID), number of associated nodes].

[0054] In this embodiment, the data processing process is simple, the format requirements for input data are not high, the versatility is strong, and the classification process is easy to understand.

[0055] Further, in one embodiment, in the above step S2, the coordinates of each node of the topological group with the most associated nodes are calculated first. After the calculation of the current topological group is completed, the associated nodes that have been calculated may be the main nodes in other topological groups. Then, in other topological groups whose main nodes are calculated, the topological group containing the most associated nodes is calculated again, and then the calculation is continuously cyclically calculated until the node coordinates of all topological groups are calculated. For example, for topological groups with 2, 3, 4 and 5 associated nodes, the coordinates of each node in the topological group with 5 associated nodes are calculated first. After the calculation is completed, it is found that the main node of the topological group with 4 associated nodes has not been calculated, and among the calculated associated nodes, there are the main nodes of the topological group with 3 associated nodes and the main nodes of the topological group with 2 associated nodes. Then, the coordinates of all nodes in the topological group with 3 associated nodes are calculated, and then the judgment is made again. If it is found after the judgment is made again that among the calculated associated nodes, there is the main node of the topological group with 4 associated nodes, then the coordinates of all nodes in the topological group with 4 associated nodes are calculated, and then the judgment is made again until the node coordinates of all topological groups are calculated.

[0056] If there are two or more topology groups with the same number of associated nodes, the topology groups are calculated in sequence according to the node ID order of the master nodes in the topology groups. For example, after a topology group is calculated, if the master nodes of two topology groups with 4 associated nodes are calculated, then the topology group with the larger master node ID is calculated first according to the node ID order of the master nodes in the topology groups from large to small.

[0057] In this embodiment, according to the calculation method of the associated node calculation, the number of iterations can be reduced and the calculation time of the entire process can be shortened. In addition, in the first calculation, the coordinates of the most nodes are determined and the nodes are aggregated for display; in addition, most nodes are included in the first calculation, and the main node coordinates of other topological groups can be covered as much as possible, thereby improving modeling efficiency.

[0058] Furthermore, the above preset models are pre-set and classified according to the number of associated fibers in the topology group, and each type of preset model is further classified into at least one type according to the number of associated nodes and the association relationship between the nodes.

[0059] When there is no association relationship between the associated nodes in a topological group, or the number of associated fibers in a topological group is odd, all associated nodes are evenly spaced around the main node, and the fiber lengths of the main node and each associated node are the same, both of which are K. The main node is taken as the origin, and the coordinates of each associated node are calculated counterclockwise in ascending order of node ID.

[0060] When there is an association relationship between the associated nodes in the topological group, and the number of associated fibers is an even number, the coordinates of each associated node are calculated in reverse time in the order of node ID from small to large, with the main node as the origin, and only the associated nodes associated with the main node have the same fiber length K as the main node. Further, if the currently calculated associated node is associated with the previously calculated associated node, the associated node with the largest node ID among the previously calculated associated associated nodes is used as the origin to calculate the coordinates of the current associated node, and the fiber length between the current associated node and the associated node as the origin is K, and the fiber length between the associated node as the origin and the main node is also K.

[0061] Usually, the maximum number of externally connected fibers of a single node is 5, and the common number of connected fibers is 2 to 5. The preset model is described in detail below through several embodiments.

[0062] In one embodiment, if Figure 2 As shown, it is a schematic diagram of the first preset model in which the number of associated fibers in the topological group of the present application is 2. In this embodiment, the topological group includes 1 main node (N0) and two associated nodes (N1 and N2), and there is no association relationship between the two associated nodes. The preset model is a straight line, and N1 and N2 are axially symmetrically distributed on both sides of N0. With N0 as the vertex, N1 and N2 are distributed at an angle of 180° (360°÷2), and the fiber lengths of the main node and each associated node are all K.

[0063] In one embodiment, if Figure 3As shown, it is a schematic diagram of the second preset model in which the number of associated fibers in the topological group of the present application is 2. In this embodiment, the topological group includes 1 main node (N0) and two associated nodes (N1 and N2), and there is an association relationship between the two associated nodes. The preset model is a right triangle, with N0 as the vertex, N1 and N2 distributed at an angle of 90° (180°÷2), and the fiber lengths of the main node and each associated node are all K.

[0064] In one embodiment, if Figure 4 As shown, it is a schematic diagram of a preset model in which the number of associated fibers in the topological group of the present application is 3. In this embodiment, the topological group includes 1 main node (N0) and 3 associated nodes (N1, N2 and N3), the preset model is an equilateral triangle, and the 3 associated nodes are distributed at the vertices of the equilateral triangle centered on the main node. With N0 as the vertex, two adjacent associated nodes are distributed at an angle of 120° (360°÷3), and the fiber lengths of the main node and each associated node are all K. In this embodiment, the 3 associated nodes are distributed at the 3 corners of the equilateral triangle, and no matter whether the 3 associated nodes have an associated relationship, no overlap will occur.

[0065] In one embodiment, if Figure 5 As shown, it is a schematic diagram of a preset model in which the number of associated fibers in the topological group of the present application is 5. In this embodiment, the topological group includes 1 main node (N0) and 5 associated nodes (N1, N2, N3, N4 and N5), the preset model is a regular pentagon, and the 5 associated nodes are distributed at the vertices of the regular pentagon centered on the main node. With N0 as the vertex, two adjacent associated nodes are distributed at an angle of 72° (360°÷5), and the fiber lengths of the main node and each associated node are all K. In the preset model in this embodiment, no matter whether the 5 associated nodes have an associated relationship, no overlap will occur.

[0066] In one embodiment, if Figure 6 As shown, it is a schematic diagram of the first preset model in which the number of associated fibers in the topological group of the present application is 4. In this embodiment, the topological group includes 1 main node (N0) and 4 associated nodes (N1, N2, N3 and N4), and there is no association relationship between all associated nodes. The preset model is a square, and the 4 associated nodes are distributed at the 4 vertices of the square centered on the main node. With N0 as the vertex, N1, N2, N3 and N4 are distributed in counterclockwise order, and the two adjacent associated nodes are distributed at an angle of 90° (360°÷4), and the fiber lengths of the main node and each associated node are all K.

[0067] In one embodiment, if Figure 7As shown, it is a schematic diagram of the second preset model in which the number of associated fibers in the topological group of the present application is 4. In this embodiment, there is one association relationship among the four associated nodes (N1, N2, N3 and N4), with the main node (N0) as the center. Among the four associated nodes, they are arranged counterclockwise in the order of node ID from small to large. N1 and N3 are associated nodes that are only associated with N0, and are distributed at the vertices of the square centered on N0. N2 is not associated with the associated nodes with a node ID smaller than it, and is also distributed at the vertices of the square centered on N0. N4 is associated with N2, so N4 is set at the vertex of the square centered on N2. In addition, the squares are of the same size, and the fiber length from the center of the square to the vertex is K. It can be seen that in this embodiment, the preset model is a combination of two squares.

[0068] In one embodiment, if Figure 8 As shown, it is a schematic diagram of the third preset model in which the number of associated fibers in the topological group of the present application is 4. In this embodiment, there are two association relationships among the four associated nodes (N1, N2, N3 and N4), and N3 and N4 are both associated with N2. The principle is the same as that of the previous embodiment. The preset model of this embodiment is centered on the main node (N0), and N1 and N2 are distributed at the vertices of the square centered on N0, and are arranged counterclockwise in the order of node ID from small to large. N3 and N4 are both associated with N2, so they are distributed at the vertices of the square centered on N2. Since N3 and N4 are also associated with N0, in accordance with the principle that the fiber connection between the two associated nodes does not pass through the third node, N3 and N4 are symmetrically arranged relative to N2. In addition, the squares are of the same size, and the fiber connection length from the center of the square to the vertex is K. In this embodiment, the preset model is also a combination of two squares.

[0069] In one embodiment, if Fig. 9 As shown, it is a schematic diagram of the fourth preset model in which the number of associated fibers in the topological group of the present application is 4. In this embodiment, there are also two association relationships among the four associated nodes (N1, N2, N3 and N4), N3 is associated with N2, and N4 is associated with N3. The principle is the same as the previous embodiment. The preset model of this embodiment is centered on the main node (N0), and N1 and N2 are distributed at the vertices of the square centered on N0, and are distributed counterclockwise in the order of node ID from small to large. N3 is associated with N2, and N3 is distributed at the vertex of the square centered on N2; N4 is associated with N3, and N4 is distributed at the vertex of the square centered on N3; and the principle that the fiber between the two associated nodes does not pass through the third node is observed. The squares are of the same size, and the fiber length from the center of the square to the vertex is K. In this embodiment, the preset model is a combination of three squares.

[0070] In one embodiment, if Fig.10As shown, it is a schematic diagram of the fifth preset model in which the number of associated fibers in the topological group of this application is 4. In this embodiment, there are three association relationships among the four associated nodes (N1, N2, N3 and N4), N3 and N4 are both associated with N2, and N4 is associated with N3. The principle is the same as that of the previous embodiment. The preset model of this embodiment is centered on the main node (N0), and N1 and N2 are distributed at the vertices of the square centered on N0, and are arranged counterclockwise in the order of node ID from small to large. N3 is associated with N2, and N3 is distributed at the vertex of the square centered on N2; since the node ID of N4 is greater than the node ID of N3, the position of N3 is determined first at this time. Then N4 is associated with N3 and N2 respectively, and N4 is distributed at the vertex of the square centered on N3; and in accordance with the principle that the fiber connection between the two associated nodes does not pass through the third node, there is also an associated fiber connection between N4 and N2. The size of each square is the same, and the fiber connection length from the center of the square to the vertex is K. In this embodiment, the preset model is also a combination of three squares.

[0071] In the above-mentioned preset model embodiments, based on the fiber connection relationship and constructed according to the association relationship, the main node and the associated node can be drawn in the same area on the graph as much as possible, which complies with the proximity principle and can more realistically display the node relationship and fiber connection direction of the flow data.

[0072] Furthermore, if Fig.11 As shown in the figure, it is assumed that the maximum number of associated nodes in the topology group is 5. For the convenience of representation, it is assumed that the node IDs in the topology group are 1, 2, 3, 4, 5, and 6, and each node is represented by a node ID. The main node N0 is 1, and the associated nodes are 2, 3, 4, 5, and 6. Taking the preset model with 5 associated fibers in the topology group as an example, the calculation of the node coordinates in the topology group is explained. Construct a rectangular coordinate system and draw the main node 1 at (0,0). According to Figure 5 The preset model of the embodiment calculates the coordinates of the associated nodes in a counterclockwise direction. The calculation formula is as follows:

[0073] X1=(x1,y1) T ,X2=(x2,y2) T ,x1≤x2,y1≤y2,

[0074]

[0075] After decomposing the above formula:

[0076] X3=(x1+[(x2-x1)cosθ-(y2-y1)sinθ],y1+[(x2-x1)sinθ+(y2-y1)cosθ]) T ,

[0077] Among them, X1 represents the main node, whose coordinates are (x1, y1), X2 represents the previous associated node, whose coordinates are (x2, y2), T represents transpose, and X3 represents the current associated node being calculated, whose horizontal coordinate is x1+[(x2-x1)cosθ-(y2-y1)sinθ] and vertical coordinate is y1+[(x2-x1)sinθ+(y2-y1)cosθ], and θ represents the angle between two adjacent associated nodes with the main node as the vertex.

[0078] In this embodiment, the coordinates of the associated nodes are calculated counterclockwise in the order of the node ID from small to large. When the previous node coordinates are calculated, the calculated node coordinates do not need to be calculated again when calculating the subsequent topological group, which reduces the overall amount of calculation. In addition, during the calculation process, only the association relationship of the previously calculated associated nodes needs to be considered, and the uncalculated associated nodes do not need to be considered, which improves

[0079] Furthermore, in one embodiment, in the above step S3, after the node coordinates of all topological groups are calculated, before drawing the nodes and connecting fibers, collision detection is also included, specifically: calculating whether there are other nodes between the current node and the line connecting the associated node with a connecting fiber length of K, and calculating whether there are other nodes between the associated node as the origin and the line connecting the associated node with a connecting fiber length of K. This is equivalent to calculating whether there are other nodes between all two nodes with a distance of K. If there are other nodes, all K values ​​are expanded by the same multiple, and then the node coordinates of all topological groups are recalculated until there are no other nodes on the above connecting lines.

[0080] Specifically, calculate whether there are other nodes on the line connecting two nodes, that is, determine whether the three nodes are on a straight line. The method is: according to the coordinates of the two nodes (x1, y1) and (x2, y2), construct the straight line equation (x-x1)(x2-x1) = (y-y1)(y2-y1), and replace the coordinates of the third node (x i ,y i ) is substituted into the straight line equation. If it conforms to the straight line equation, that is, the fiber is blocking the node, and all K values ​​need to be enlarged by the same multiple, and then the node coordinates of all topological groups are recalculated; otherwise, it means that the fiber is not blocked by the node, and the collision detection of the corresponding node passes.

[0081] Preferably, a self-service training method may be used to continuously perform collision detection and adjust the K value. When all nodes are not blocked by connecting fibers, nodes are drawn according to node coordinates, and existing components may be used to draw connecting fibers.

[0082] In this embodiment, mathematical linear relationships are used to add collision detection to the algorithm to achieve the process of autonomous training, automatic tuning, self-detection, and self-improvement of the entire calculation process, so that a reasonable K value can be obtained, and the optimal drawing method can be obtained, which is more flexible and the algorithm is effective and reliable. In addition, the core part of the above algorithm is based on mathematical modeling and spatial geometry, and the theoretical knowledge is reliable, which reduces the cost of learning and development; at the same time, it is not limited by programming languages ​​and can be used for any application of the corresponding scene, with good compatibility and wide application. The above algorithm itself has been verified by engineering, is not distorted in the case of large amounts of data, and has a stable and reliable running speed and good performance.

[0083] like Fig.12 As shown, taking the topological group model with the number of associated fibers being 2, 3, 4, and 5 as an example, the path diagram drawing method of the present application is further described. In this embodiment, each node is represented by a node ID, and the specific steps include:

[0084] M1. Get the network element set based on the flow data. For example, the IDs of the three input flow data are: [[1,2,5,4,7,9,3], [5,1,7,9,8,10], [2,4,9,7,10,5,11]]. According to the default ascending sorting of node IDs, the output node ID set is: [1,2,3,4,5,7,8,9,10,11].

[0085] M2. Generate a topology group in the form of [node ID, (associated node ID), number of associated nodes] based on the node associated fiber information, and obtain the following 10 topology groups:

[0086] [1,(2,5,7),3], [2,(1,4,5),3], [3,(9),1], [4,(2,5,7,9),4], [5,(1,2,4,10,11),5], [7,(1,4,9,10),4], [8,(9,10),2], [9,(3,4,7,8),4], [10,(5,7),2], [11,(5),1].

[0087] Among them, the topological group with the largest number of associated nodes is 5, and the corresponding topological group is [5,(1,2,4,10,11),5].

[0088] M3. Calculate the coordinates of each associated node in the topological group in sequence according to the rules. The rules include: after the current topological group is calculated, calculate the topological group containing the most associated nodes among other topological groups whose main nodes are calculated. Among them, the coordinates of each node of the topological group with the most associated nodes can be calculated first.

[0089] In this embodiment, the coordinates of each associated node in the topological group with 5 associated nodes are first calculated. Fig.11As shown, in the counterclockwise direction, the coordinates of the main node 5 in the topological group are (0,0), and the first associated node is drawn in the first quadrant of the rectangular coordinate system. According to the node spacing K between 1 and 5, the coordinates of N1 are calculated to be (0.71K, 0.71K). Then, according to the coordinates of the previous node obtained and the angle θ between two adjacent nodes, the coordinates of the remaining associated nodes are calculated in turn.

[0090] In the calculation of other topological groups, the calculation is performed according to the preset models corresponding to different topological groups. For the topological group with 4 associated nodes, when calculating the coordinates of the current associated node Ni, it is determined whether Ni is associated with the associated nodes calculated by the topological group. If there is an association, the last associated node Ne (e<i) is obtained according to the node ID sequence of the associated associated nodes, and Ni is calculated with Ne as the main node; if there is no association, the coordinates of the associated node are calculated according to the calculation method in the topological group with 5 associated nodes.

[0091] M4, determine whether the node coordinates of all topological groups have been calculated. If yes, go to M5; if not, go to M3;

[0092] M5. Perform collision detection on all two nodes with a distance K between them to determine whether the collision detection passes. If not, proceed to M6. If yes, proceed to M7.

[0093] M6: If there is occlusion, all K values ​​are enlarged by the same multiple and transferred to M3;

[0094] M7, if there is no occlusion, draw the nodes and fibers according to the coordinates of all nodes. Finally, the drawn path diagram is as follows Fig.13 shown.

[0095] In a second aspect, an embodiment of the present application also provides a path map drawing device, including: a generation module, a calculation module and a drawing module.

[0096] The generation module is used to use the nodes to be drawn as main nodes respectively, and each main node and the corresponding associated nodes jointly generate a topology group.

[0097] A calculation module calculates the coordinates of each node in the group according to the preset model corresponding to each topological group, wherein the coordinates of each node of the topological group with the most associated nodes are calculated first. After the calculation of the current topological group is completed, the topological group with the most associated nodes is calculated among the other topological groups calculated by the main node until the node coordinates of all topological groups are calculated; wherein all node coordinates are located in the same rectangular coordinate system, and the fiber connection between two associated nodes in the preset model does not pass through the third node.

[0098] The drawing module is used to draw nodes and fibers after the node coordinates of all topological groups are calculated.

[0099] Among them, the functional implementation of each module in the above-mentioned path map drawing device corresponds to the various steps in the above-mentioned path map drawing method embodiment, and its functions and implementation processes will not be repeated here one by one.

[0100] It should be noted that the serial numbers of the above-mentioned embodiments of the present application are only for description and do not represent the advantages or disadvantages of the embodiments.

[0101] The terms "including" and "having" and any variations thereof in the specification and claims of this application and the above-mentioned drawings are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices. The terms "first", "second" and "third" are used to distinguish different objects, etc., and do not represent a sequence, nor do they limit "first", "second" and "third" to different types.

[0102] In the description of the embodiments of the present application, "exemplary", "for example" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary", "for example" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary", "for example" or "for example" is intended to present related concepts in a specific way.

[0103] In the description of the embodiments of the present application, unless otherwise specified, “ / ” means or, for example, A / B can mean A or B; the “and / or” in the text is merely a description of the association relationship of associated objects, indicating that three relationships may exist, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, “multiple” refers to two or more than two.

[0104] In some processes described in the embodiments of the present application, multiple operations or steps that appear in a specific order are included, but it should be understood that these operations or steps may not be executed in the order in which they appear in the embodiments of the present application or in parallel, and the sequence number of the operation is only used to distinguish the different operations, and the sequence number itself does not represent any execution order. In addition, these processes may include more or fewer operations, and these operations or steps may be executed in sequence or in parallel, and these operations or steps may be combined.

[0105] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, disk, CD) as described above, and includes a number of instructions for a terminal device to execute the methods described in each embodiment of the present application.

[0106] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. A method for drawing a path diagram, characterized in that: The method comprises: The nodes to be drawn are respectively used as main nodes, and each main node and the corresponding associated nodes jointly generate a topological group; Calculate the coordinates of each node in the group according to the preset model corresponding to each topological group. After the calculation of the current topological group is completed, calculate the topological group with the most associated nodes among the other topological groups whose main nodes are calculated. After the node coordinates of all topological groups are calculated, draw the nodes and fibers. Wherein, all node coordinates are located in the same rectangular coordinate system, and the fiber connection between two associated nodes in the preset model does not pass through a third node.

2. The method for drawing a path diagram according to claim 1, wherein: Each topology group includes the master node ID of the group, all associated node IDs associated with the master node, and the number of associated nodes; When there are more than two topology groups with the same number of associated nodes, each topology group is calculated in sequence according to the node ID order of the master node.

3. The method for drawing a path diagram according to claim 1, wherein: The preset models are classified according to the number of associated fibers in the topology group, and each type of preset model is classified into at least one type according to the number of associated nodes and the association relationship between nodes; When there is no association relationship between the associated nodes in a topological group, or the number of associated fibers in a topological group is odd, all associated nodes are evenly spaced around the main node, and the fiber length K of the main node and each associated node is the same. The main node is taken as the origin, and the coordinates of each associated node are calculated counterclockwise in the order of node ID from small to large.

4. The method for drawing a path diagram according to claim 3, wherein: When there is an association relationship between the associated nodes in the topological group, and the number of associated fibers is an even number, the coordinates of each associated node are calculated in reverse time sequence from small to large node IDs with the main node as the origin, and only the associated nodes associated with the main node have the same fiber length K as the main node; If the currently calculated associated node is associated with the previously calculated associated node, the associated node with the largest node ID among the previously calculated associated nodes is used as the origin to calculate the coordinates of the current associated node, and the fiber length K between the current associated node and the associated node as the origin.

5. The method for drawing a path diagram according to claim 4, wherein: The collision detection is performed before drawing nodes and fibers, including: calculating whether there are other nodes on the connection lines between all two nodes with a fiber length of K; if there are other nodes, expanding all K by the same multiple, and recalculating the node coordinates of all topological groups until there are no other nodes on the connection lines.

6. The method for drawing a path diagram according to claim 3, wherein: When the number of associated fibers in the topology group is 2, there are two preset models, including: There is no association relationship between the two associated nodes, and the two associated nodes are axially symmetrically distributed on both sides of the main node; There is an association relationship between the two associated nodes, and a 90° angle is formed between the two associated nodes and the main node.

7. The method for drawing a path diagram according to claim 3, wherein: When the number of associated fibers in the topology group is 3, the three associated nodes in the preset model are distributed at the vertices of an equilateral triangle centered on the main node.

8. The method for drawing a path diagram according to claim 3, wherein: When the number of associated fibers in the topology group is 5, the 5 associated nodes in the preset model are distributed at the vertices of a regular pentagon centered at the main node.

9. The method for drawing a path diagram according to claim 3, wherein: When the number of associated fibers in the topology group is 4, and there is no association relationship between all associated nodes, the 4 associated nodes in the preset model are distributed at the 4 vertices of a square centered on the main node; When there is an association relationship between at least two associated nodes, the coordinates of each associated node are calculated in reverse time order according to the node ID from small to large, with the main node as the center, and the associated nodes only associated with the main node are distributed at the vertices of the square with the main node as the center, and the distance from the square vertex to the center is K; Among the associated nodes with an associated relationship, if the currently calculated associated node is associated with the previously calculated associated node, the currently calculated associated node is distributed at the vertices of a square centered on the previously calculated associated node, and the distance from the vertices to the center of the square is K.

10. A path diagram drawing device based on the path drawing method according to any one of claims 1 to 9, characterized in that: The device comprises: A generation module is used to use the nodes to be drawn as main nodes respectively, and each main node and the corresponding associated nodes jointly generate a topology group; A calculation module, which is used to calculate the coordinates of each node in the group according to the preset model corresponding to each topological group, wherein, after the calculation of the current topological group is completed, the topological group containing the most associated nodes is calculated among the other topological groups calculated by the main node, until the node coordinates of all topological groups are calculated; wherein all node coordinates are located in the same rectangular coordinate system, and the fiber connection between two associated nodes in the preset model does not pass through a third node; The drawing module is used to draw nodes and fibers after the node coordinates of all topological groups are calculated.