CN115913975A - Directed topological graph layout method and device, electronic equipment and storage medium - Google Patents

Directed topological graph layout method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN115913975A
CN115913975A CN202211390931.8A CN202211390931A CN115913975A CN 115913975 A CN115913975 A CN 115913975A CN 202211390931 A CN202211390931 A CN 202211390931A CN 115913975 A CN115913975 A CN 115913975A
Authority
CN
China
Prior art keywords
node
nodes
link
remaining
queue
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211390931.8A
Other languages
Chinese (zh)
Inventor
何浪
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Qax Technology Group Inc
Secworld Information Technology Beijing Co Ltd
Original Assignee
Qax Technology Group Inc
Secworld Information Technology Beijing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Qax Technology Group Inc, Secworld Information Technology Beijing Co Ltd filed Critical Qax Technology Group Inc
Priority to CN202211390931.8A priority Critical patent/CN115913975A/en
Publication of CN115913975A publication Critical patent/CN115913975A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a directed topology graph layout method, a directed topology graph layout device, electronic equipment and a storage medium, wherein the method comprises the following steps: acquiring original data, wherein the original data comprises nodes and directed connecting lines, and the directed connecting lines are used for connecting the nodes with the connection relation to obtain node links; determining at least one starting node in the nodes based on the directional connecting line; determining a longest node link and a second long node link from a plurality of node links using a starting node as a starting point; determining a first queue number of a directed topology graph based on the longest node link; determining a second queue number of the directed topology graph based on the second long node link; determining a coordinate space of the directed topological graph based on the first queue number and the second queue number, and correspondingly positioning the nodes to the coordinate space according to the sequencing sequence in the node links; and connecting the nodes with the connection relation. The invention can lay out the topological graph with multiple starting points and multiple connecting points to obtain the topological graph with higher readability.

Description

Directed topological graph layout method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the technical field of topology layout, and in particular, to a directed topology layout method and apparatus, an electronic device, and a storage medium.
Background
In the related art, based on the development of information technology visualization, the scattered nodes are processed through a graph layout algorithm, and the topological relation among the nodes can be presented more clearly, so that the related analysis operation is implemented conveniently.
However, in the current network topology drawing method, the layout of multiple starting points and multiple connection points cannot be realized, and the readability of the layout cannot be improved. Therefore, finding a topological graph layout method capable of realizing multiple starting points and multiple connection points becomes a current research hotspot.
Disclosure of Invention
The invention provides a directed topological graph layout method, a directed topological graph layout device, electronic equipment and a storage medium, which are used for overcoming the defects that the topological graph layout with multiple starting points and multiple connection points cannot be realized in the prior art and further the layout readability cannot be improved, realizing the layout of the topological graph with multiple starting points and multiple connection points and obtaining the topological graph with higher readability.
The invention provides a directed topological graph layout method, which comprises the following steps: acquiring original data, wherein the original data comprise nodes and directed connecting lines, and the directed connecting lines are used for connecting the nodes with the connection relation to obtain node links; determining at least one starting node from the nodes based on the directional connecting line; determining a longest node link and a second long node link from the plurality of node links using the starting node as a starting point, wherein the longest node link comprises a first node, the first node has a connection relationship with a second node of the second long node link, and the second node is the starting node of the second long node link; determining a first queue number of a directed topology graph based on the longest node link; determining a second queue number of the directed topology graph based on the second long node link, wherein the first queue is arranged along a first direction, the second queue is arranged along a second direction, and the first direction and the second direction form a preset angle; determining a coordinate space of the directed topology graph based on the first queue number and the second queue number, and correspondingly positioning the nodes to the coordinate space according to a sequencing sequence in a node link; and connecting the nodes with the connection relation.
According to the directed topology graph layout method provided by the present invention, before determining the first queue number of the directed topology graph based on the longest node link, the method further includes: determining a complex node on the longest node link, wherein the complex node is a node of which the number of connecting piles exceeds a number threshold value, and the connecting piles are fixed points on the node and are used for realizing the connection between the node and the directed connecting line; the determining, based on the longest node link, a first queue number of the directed topology graph specifically includes: determining a first number of the complex nodes; determining a second number of nodes in the longest node link; determining a first number of queues for the directed topology graph based on the first number and the second number.
According to the directed topology graph layout method provided by the present invention, the determining the second queue number of the directed topology graph based on the second long node link specifically includes: determining a third number of nodes in the second long node link; determining a second number of queues for the directed topology graph based on the third number.
According to the directed topology layout method provided by the present invention, the correspondingly positioning the nodes to the coordinate space according to the sorting order in the node links specifically comprises: setting the longest node link in an intermediate queue of the second queues of the coordinate space if the first number of complex nodes is greater than zero; extracting each node in the longest node link, and setting coordinates of the nodes in the intermediate queue in a traversing manner according to the sorting sequence of the nodes in the longest node link, wherein the first-direction coordinates of the nodes are fixed, and the second-direction coordinates of the nodes are increased progressively according to a preset numerical value; determining a second directional coordinate of the second node in the second long node link based on a second directional coordinate of the first node in the longest node link; setting the second long node link in a target queue of the coordinate space, wherein the target queue is a queue in which a second direction coordinate of the second node is located; extracting each node in the second long node link, and setting coordinates of the nodes in the target queue in a traversing manner according to the arrangement sequence of the nodes in the second long node link, wherein the second direction coordinates of the nodes are fixed, and the first direction coordinates of the nodes are increased progressively according to a preset numerical value; extracting remaining nodes, wherein the remaining nodes are other nodes except the node of the longest node link and the node of the second long node link; determining coordinates of the remaining nodes based on coordinates of the node of the longest node link or coordinates of the node of the second long node link; and extracting a free starting node, and sequentially setting the free starting node in a starting queue in the first queue of the coordinate space, wherein the free starting node is a starting node which has no connection relation with other nodes.
According to the directed topology layout method provided by the present invention, the traversing the coordinates of the nodes in the intermediate queue according to the sorting order of the nodes in the longest node link specifically includes: determining a next node of the complex node according to the sorting sequence of the nodes in the longest node link; and compared with the second direction coordinate of the complex node, when the second direction coordinate of the next node of the complex node is set in the middle queue, the second direction coordinate is increased progressively according to the preset multiple of the preset numerical value.
According to the directed topology graph layout method provided by the present invention, the determining the coordinates of the remaining nodes based on the coordinates of the node of the longest node link specifically includes: determining a first remaining node having a connection relation with a node in the longest node link from the remaining nodes, and determining a second direction coordinate of the first remaining node based on a second direction coordinate of the node in the longest node link; determining a first remaining node link comprising the first remaining node, wherein a node in the first remaining node link is a node in the remaining nodes; setting the first remaining node link in a first remaining node link queue of the coordinate space, wherein the first remaining node link queue is a queue in which a second direction coordinate of the first remaining node is located; and extracting each node in the first remaining node link, and setting the coordinates of the node in a traversing manner in the first remaining node link queue according to the arrangement sequence of the node in the first remaining node link, wherein the second direction coordinate of the node is fixed, and the first direction coordinate of the node is increased or decreased according to a preset numerical value.
According to the directed topology graph layout method provided by the present invention, the determining the coordinates of the remaining nodes based on the coordinates of the nodes of the second long node link specifically includes: determining a second remaining node in the remaining nodes, wherein the second remaining node has a connection relation with a node in the second long node link, and determining a first direction coordinate of the second remaining node based on the first direction coordinate of the node in the second long node link; determining a second remaining node link comprising the second remaining node, wherein a node in the second remaining node link is a node in the remaining nodes; setting the second remaining node link in a second remaining node link queue of the coordinate space, wherein the second remaining node link queue is a queue in which a first direction coordinate of the second remaining node is located; and extracting each node in the second remaining node link, and setting the coordinates of the nodes in a traversing manner in the second remaining node link queue according to the arrangement sequence of the nodes in the second remaining node link, wherein the first direction coordinates of the nodes are fixed, and the second direction coordinates of the nodes are increased or decreased according to a preset numerical value.
According to the directed topology graph layout method provided by the invention, the first direction and the second direction form a preset angle, and the method specifically comprises the following steps: the first direction and the second direction are at an angle of 90 degrees, wherein the first direction is a direction indicated by each column of the directed topology map and the second direction is a direction indicated by each row of the directed topology map; or the first direction is a direction indicated by each row of the directed topology graph and the second direction is a direction indicated by each column of the directed topology graph.
According to the directed topology graph layout method provided by the present invention, the connecting the nodes having a connection relationship specifically includes: the method comprises the steps of connecting a connecting pile arranged on a node with a directed connecting line, and realizing the connection between the node and other nodes with connection relations based on the directed connecting line, wherein the position distribution of the connecting pile on the node is determined by adopting the following mode: determining the number of connecting piles of the node; the method comprises the steps of determining the position distribution of each connecting pile in each node on the node based on a preset mapping table, wherein the mapping table comprises the corresponding relation between the number of the connecting piles and the position distribution of each connecting pile on the node, and the connecting piles are uniformly distributed on the node according to a preset position sequence.
The invention also provides a directed topology map layout device, which comprises: the device comprises a first module, a second module and a third module, wherein the first module is used for acquiring original data, the original data comprises nodes and directed connecting lines, and the directed connecting lines are used for connecting the nodes with the connection relation to obtain node links; a second module configured to determine at least one start node among the nodes based on the directional link; a third module, configured to determine a longest node link and a second long node link in multiple node links that use the starting node as a starting point, where the longest node link includes a first node, and the first node has a connection relationship with a second node of the second long node link, and the second node is the starting node of the second long node link; a fourth module for determining a first queue number of a directed topology graph based on the longest node link; a fifth module, configured to determine, based on the second long node link, a second number of queues of the directed topology graph, where the first queue is arranged along a first direction, the second queue is arranged along a second direction, and the first direction and the second direction form a preset angle; a sixth module, configured to determine a coordinate space of the directed topology graph based on the first queue number and the second queue number, and correspondingly place the nodes in the coordinate space according to a sorting order in a node link; a seventh module, configured to connect the nodes with the connection relationship.
The present invention further provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the directed topology layout method as described in any of the above when executing the program.
The present invention also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a directed topology graph placement method as described in any of the above.
The present invention also provides a computer program product comprising a computer program which, when executed by a processor, implements a directed topology graph placement method as described in any of the above.
The directed topology graph layout method, the directed topology graph layout device, the electronic equipment and the storage medium provided by the invention determine the longest node link and the second long node link in a plurality of node links taking a starting node as a starting point; determining a first queue number of the directed topology graph based on the longest node link; determining a second number of queues for the directed topology based on the second long node link; determining a coordinate space of the directed topological graph based on the first queue number and the second queue number, and correspondingly positioning the nodes to the coordinate space according to the sequencing sequence in the node link; and connecting the nodes with the connection relation to obtain a topological graph with clear structure and high readability and related to the original data. Therefore, the topological graph with multiple starting points and multiple connecting points can be laid out, and the topological graph with higher readability is obtained.
Drawings
In order to more clearly illustrate the technical solutions of the present invention or the prior art, the drawings needed for the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.
FIG. 1 is a flow chart of a directed topology graph layout method according to the present invention;
FIG. 2 is a schematic diagram of an application scenario for determining a start node according to the present invention;
FIG. 3 is a schematic diagram of an application scenario for determining a longest node link according to the present invention;
fig. 4 is a schematic diagram of an application scenario for determining a second long node link according to the present invention;
FIG. 5 is a schematic flow chart illustrating a process for determining a first queue number of a directed topology graph based on a longest node link according to the present invention;
FIG. 6 is a schematic flow chart illustrating the process of correspondingly positioning nodes in a coordinate space according to the sorting order in the node link according to the present invention;
FIG. 7 is a schematic flow chart illustrating the determination of the coordinates of the remaining nodes based on the coordinates of the node of the longest node link according to the present invention;
fig. 8 is a schematic flowchart of determining coordinates of remaining nodes based on coordinates of nodes of a second long node link according to the present invention;
FIG. 9 is a schematic diagram of an application scenario of the directed topology graph layout method provided by the present invention;
FIG. 10 is a schematic structural diagram of a directed topology arrangement apparatus provided in the present invention;
fig. 11 is a schematic structural diagram of an electronic device provided in the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is obvious that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
To further describe the directed topology graph layout method provided by the present invention, the following description is made with reference to fig. 1.
Fig. 1 is a schematic flow chart of a directed topology graph layout method provided in the present invention.
In an exemplary embodiment of the present invention, as can be seen in fig. 1, the directed topology layout method may include steps 110 to 170, which are described below.
In step 110, original data is obtained, where the original data includes nodes and directed links, and the directed links are used to connect the nodes having a connection relationship to obtain node links.
In step 120, at least one starting node is determined among the nodes based on the directional links.
In one embodiment, the raw data may be raw data about a network topology node. The raw data may include, among other things, nodes and directed connections associated with the nodes. Wherein the direction of the directional connecting line represents the transmission direction.
In an example, one directional connection line may include a start end and a termination end, and the start end and the termination end of the directional connection line may be connected with a node or may be empty.
It is understood that for node a, if node a is connected to the start of the directional line a, node a may also be referred to as the start node of the directional line a. If no node is connected to the starting end of the directional connection line a, the starting end of the directional connection line a is empty.
For node a, if node B is connected at the terminating end of the directed link a, node B may also be referred to as the target node of the directed link a. If no node is connected to the termination end of the directed link a, the termination of the directed link a is null.
It can be understood that all the directional connecting lines link the nodes in a recursive manner, and a plurality of node links can be obtained.
In one embodiment, the starting node may be determined based on a directed line. There may be a plurality of start nodes.
In an example, the starting node may be a target node of a directed connection that is initially empty. Fig. 2 is a schematic view of an application scenario for determining a start node provided by the present invention, and it can be known from fig. 2 that a node marked by a dashed box can be understood as a start node.
In step 130, a longest node link and a second long node link are determined from the plurality of node links starting from the start node, where the longest node link includes a first node, the first node has a connection relationship with a second node of the second long node link, and the second node is the start node of the second long node link.
In one embodiment, the longest node link may be determined among a plurality of node links starting from the starting node. The longest node link may be a link having the largest number of nodes. Fig. 3 is a schematic view of an application scenario for determining a longest node link according to the present invention, and it can be known from fig. 3 that a node link marked by a dashed box is understood as the longest node link.
It should be noted that, when two longest node links appear, any one of the two longest node links may be selected as the final longest node link, that is, the longest node link in the present embodiment.
In yet another embodiment, a second long node link may also be determined. Here, the second long node link may be understood as a longest node link formed based on the remaining nodes, excluding the nodes in the longest node link. And a first node in the longest node link has a connection relation with a second node in a second long node link. Where the first node may be any one of the nodes on the longest node link and the second node may be understood to be the starting node for the second long node link.
Fig. 4 is a schematic view of an application scenario for determining a second long node link according to the present invention, and it can be known from fig. 4 that a node link marked by a dashed box can be understood as a second long node link. Wherein the first node may correspond to the firewall node in fig. 4, and the second node may correspond to the ICG node in fig. 4.
In step 140, a first number of queues of the directed topology graph is determined based on the longest node link.
In an exemplary embodiment of the present invention, continuing with the embodiment shown in fig. 1 as an example, before determining the first queue number of the directed topology graph based on the longest node link (corresponding to step 140), the directed topology graph layout method may further include: and determining a complex node on the longest node link, wherein the complex node is a node of which the number of connecting piles exceeds a number threshold, and the connecting piles can be fixed points on the node and are used for realizing the connection of the node and a directed connecting line.
In an embodiment, the number threshold may be adjusted according to actual conditions, for example, may be 4, and in this embodiment, the number threshold is not specifically limited. As described with reference to fig. 3, on the longest node link, since the number of connection studs of the firewall is 5, and the number threshold is exceeded, it can be determined that the firewall node is a complex node.
Fig. 5 is a schematic flow chart of determining a first queue number of a directed topology graph based on a longest node link according to the present invention.
As can be seen in fig. 5, determining the first number of queues of the directed topology graph based on the longest node link may include steps 510 to 530, which are described separately below.
In step 510, a first number of complex nodes is determined.
In step 520, a second number of nodes in the longest node link is determined.
In step 530, a first number of queues for the directed topology graph is determined based on the first number and the second number.
Continuing with fig. 3, the complex node is determined to be a firewall node, i.e., the first number is 1. Further, the number of nodes in the longest node link (corresponding to a second number) may also be determined, for example, the second number is 5 in fig. 3. A first number of queues of the directed topology graph is determined based on the first number and the second number.
In an example, the number of columns of the directed topology graph may be the sum of the first number and the second number, and for the embodiment illustrated in fig. 3, the determined first number of columns of the directed topology graph is 1+5=6. In yet another embodiment, the first number of queues of the directed topology graph may also be a sum of the first number and any positive integer greater than the second number. In this embodiment, the determination process of the first queue number of the directed topology graph is not specifically limited.
In step 150, based on the second long node link, a second number of queues of the directed topology graph is determined, where the first queue is arranged along the first direction, the second queue is arranged along the second direction, and the first direction and the second direction form a preset angle.
It should be noted that the preset angle may be adjusted according to actual situations, and the preset angle is not specifically limited in this embodiment.
In an exemplary embodiment of the present application, the first direction and the second direction are at a predetermined angle, which may be implemented as follows:
the first direction and the second direction are at a 90 degree angle. Wherein the first direction is a direction indicated by each column of the directed topological graph and the second direction is a direction indicated by each row of the directed topological graph; or the first direction is a direction indicated by each row of the directed topology graph and the second direction is a direction indicated by each column of the directed topology graph. It will be appreciated that by arranging the first and second directions at 90 degrees, it is ensured that the resulting topology is flat and vertical, further improving the readability of the topology.
Wherein the first number of queues may be a number of columns of the directed topology graph and the second number of queues may be a number of rows of the directed topology graph; alternatively, the first number of queues may be the number of rows of the directed topology graph and the second number of queues may be the number of columns of the directed topology graph.
The first directional coordinates of the nodes may refer to coordinates along a direction indicated by each column of the directed topology graph (corresponding to ordinate in the coordinate space) and the second directional coordinates of the nodes may refer to coordinates along a direction indicated by each row of the directed topology graph (corresponding to abscissa in the coordinate space); or the first directional coordinates of the nodes may refer to coordinates along the direction indicated by each row of the directed topology graph (corresponding to abscissa in coordinate space) and the second directional coordinates of the nodes may refer to coordinates along the direction indicated by each column of the directed topology graph (corresponding to ordinate in coordinate space).
For convenience of description, in the present invention, the first queue number is a column number of the directed topology graph and the second queue number is a row number of the directed topology graph, and the first direction coordinate of the node is a coordinate along a direction indicated by each column of the directed topology graph (corresponding to a vertical coordinate in a coordinate space) and the second direction coordinate of the node is a coordinate along a direction indicated by each row of the directed topology graph (corresponding to a horizontal coordinate in the coordinate space) are taken as an example for description.
In one embodiment, determining the second number of queues of the directed topology graph based on the second long node link may be implemented as follows:
determining a third number of nodes in the second long node link;
based on the third number, a second number of queues for the directed topology graph is determined.
Continuing with the description of fig. 4, the number of nodes in the second long node link (corresponding to a third number) may be determined, e.g., the third number is 2 in fig. 4. Further, a second number of queues for the directed topology graph may be determined based on the third number. In an example, the second number of queues of the directed topology graph can be a third number 2+1. For the embodiment shown in fig. 4, the second queue number of the determined directed topology is 2 × 2+1=5.
In step 160, a coordinate space of the directed topology graph is determined based on the first queue number and the second queue number, and the nodes are correspondingly positioned to the coordinate space according to the sorting order in the node links.
In step 170, the nodes having the connection relationship are connected.
In one embodiment, based on the determined number of columns and rows of the directed topology graph, a coordinate space of the directed topology graph may be determined. Fig. 9 is a schematic view of an application scenario of the directed topology layout method provided by the present invention, and a coordinate space may be determined based on the number of columns (corresponding to the first number of columns) and the number of rows (corresponding to the second number of columns). In the coordinate space shown in fig. 9, the unit length may be 100.
In yet another embodiment, in the coordinate space of the directed topology graph, all nodes related to the original data may be correspondingly located in the coordinate space according to the sorting order in the respective node links, and the nodes having the connection relationship are connected through the connection stub arranged on the node. Therefore, the topological graph with multiple starting points and multiple connecting points can be laid out, and the topological graph with horizontal and vertical node positions, clear structure and higher readability can be obtained.
Note that the nodes having a connection relationship include nodes and nodes, and may also include nodes and empty locations. The connection relation may be embodied by a directed connection. As explained in connection with fig. 9, regarding the zero-trust TAC node, the other end having a connection relationship with the node may be null.
The directed topological graph layout method provided by the invention determines the longest node link and the second longest node link in a plurality of node links taking the initial node as the starting point; determining a first queue number of the directed topology graph based on the longest node link; determining a second number of queues for the directed topology based on the second long node link; determining a coordinate space of the directed topological graph based on the first queue number and the second queue number, and correspondingly positioning the nodes to the coordinate space according to the sequencing sequence in the node link; and connecting the nodes with the connection relation, thereby obtaining the topological graph with clear structure and high readability and related to the original data. Therefore, the topological graph with multiple starting points and multiple connection points can be laid out, and the topological graph with higher readability is obtained.
To further describe the directed topology layout method provided by the present invention, the following will describe a process of correspondingly positioning nodes to a coordinate space according to the sorted order in the node links with reference to the following embodiments.
Fig. 6 is a schematic flow chart of correspondingly positioning nodes in a coordinate space according to a sorting order in a node link according to the present invention.
In an exemplary embodiment of the present invention, as can be seen in fig. 6, the locating the nodes in the coordinate space according to the sorting order in the node links may include steps 610 to 680, which will be described below.
In step 610, in the event that the first number of complex nodes is greater than zero, the longest node link is placed in an intermediate queue in the second queue of the coordinate space.
In one embodiment, the second queue is described as a row in a coordinate space, and therefore, the middle queue in the second queue in the coordinate space refers to the middle row in the coordinate space.
A first number of complex nodes may be determined, and if the first number is greater than zero, i.e., if there are complex nodes, the longest node link may be set in the middle row of the coordinate space. As described with reference to fig. 9, since there is a complex node (firewall node), the longest node link may be set in the third row of the coordinate space based on the aforementioned determined number of rows of the coordinate space being 5 rows.
In yet another embodiment, if the first number is zero, no complex nodes exist. It can be understood that, in this scenario, other nodes connected to the complex node may be arranged under the longest node link without blocking the arrangement of other nodes, and therefore, the longest node link may be disposed in the first row of the coordinate space.
Through the embodiment, all the nodes can be effectively laid out and cannot be shielded by other nodes, and a foundation is laid for obtaining the topological graph which is horizontal, flat, vertical, clear in structure and high in readability and relates to the original data.
In step 620, each node in the longest node link is extracted, and coordinates of the nodes are set in an intermediate queue in a traversing manner according to the sorting sequence of the nodes in the longest node link, wherein the first-direction coordinates of the nodes are fixed, and the second-direction coordinates of the nodes are increased progressively according to a preset value.
In one embodiment, each node in the longest node link may be extracted, and the coordinates of the node are set in the middle row of the coordinate space in a traversal manner according to the arrangement order of the nodes in the longest node link. In an example, the nodes may be sequentially arranged from a starting node in the longest node link to an intermediate row, where the ordinate of each node is the same and the abscissa is incremented by a preset value. The preset value may be adjusted according to an actual situation, for example, may be 100, and in this embodiment, the preset value is not specifically limited.
In another exemplary embodiment of the present invention, the coordinates of the nodes are set in the intermediate queue in a traversal manner according to the sorting order of the nodes in the longest node link, and the following manner may also be adopted:
determining the next node of the complex node according to the sequencing sequence of the nodes in the longest node link;
and compared with the second direction coordinate of the complex node, when the second direction coordinate of the next node of the complex node is set in the middle queue, the second direction coordinate is increased progressively according to the preset multiple of the preset numerical value.
In an embodiment, continuing with the embodiment shown in fig. 9, since the number of connection stubs of a complex node (e.g., firewall node) exceeds 4, there may be other nodes connected to the complex node, e.g., SDWA node. In order to ensure that the nodes connected with each other are not shielded from each other, when the abscissa of the next node (corresponding to the flow meter node in fig. 9) of the complex node is set, the abscissa can be increased by twice the preset value, so that a vacant space can be left between the firewall node and the flow meter node to provide space for the node connected with the SDWA node.
In step 630, a second directional coordinate of a second node in a second long node link is determined based on the second directional coordinate of the first node in the longest node link.
It should be noted that, a connection relationship exists between a first node in the longest node link and a second node in a second long node link. Where the first node may be any one of the nodes on the longest node link and the second node may be understood to be the starting node for the second long node link. As can be seen in fig. 9, the first node may correspond to the firewall node in fig. 9, and the second node may correspond to the ICG node in fig. 9.
In one embodiment, since the second node has a connection relationship with the first node, the abscissa of the second node may be determined based on the abscissa of the first node. In an example, the abscissa of the first node may be the same as the abscissa of the second node. In this embodiment, the abscissa of the second node in the second long node link is determined based on the abscissa of the first node in the longest node link, so that the connecting lines in the formed topology graph can be effectively ensured to be horizontal, flat and vertical, and the readability of the formed topology graph can be improved.
In step 640, the second long node link is set in a target queue of the coordinate space, where the target queue is a queue in which the second direction coordinate of the second node is located.
In step 650, each node in the second long node link is extracted, and the coordinates of the nodes are set in the target queue in a traversing manner according to the arrangement sequence of the nodes in the second long node link, wherein the second direction coordinates of the nodes are fixed, and the first direction coordinates of the nodes are increased progressively according to the preset value.
In one embodiment, the second long node link may be set in a target queue of the coordinate space, where the target queue may refer to a column on which an abscissa of the second node is located. As explained in connection with fig. 9, the target queue may be the column in which the ICG node is located.
Furthermore, each node in the second long node link may be extracted, and the coordinates of the nodes are set in the target queue in a traversal manner according to the arrangement order of the nodes in the second long node link. In an example, the nodes may be sequentially set to the target queue starting from a second node in the second long node link, where the abscissa of each node is the same and the ordinate is incremented by a preset value. The preset value may be adjusted according to an actual situation, for example, may be 100, and in this embodiment, the preset value is not specifically limited.
In step 660, remaining nodes are extracted, wherein the remaining nodes are nodes other than the node of the longest node link and the node of the second longest node link.
In step 670, the coordinates of the remaining nodes are determined based on the coordinates of the node of the longest node link, or the coordinates of the node of the second longest node link.
In one embodiment, the coordinates of the remaining nodes in the coordinate space may be determined. Wherein the remaining nodes are understood to be nodes other than the node of the longest node link and the node of the second longest node link. Continuing with the description in connection with fig. 9, the remaining nodes may include zero trust TAC nodes, CSMP nodes, SDWA nodes, VCPE nodes, and giant limo nodes.
Further, since the remaining nodes are connected to the nodes in the longest node link or the nodes on the second long node link, the coordinates of the remaining nodes may be determined based on the node coordinates of the longest node link or the node coordinates of the second long node link.
In step 680, a free start node is extracted, and the free start node is sequentially arranged in a start queue in the first queue of the coordinate space, wherein the free start node is a start node which has no connection relation with other nodes.
It should be noted that, if the first queue refers to a column in the coordinate space, the starting queue in the first queue of the coordinate space may refer to the first column of the coordinate space. In the present invention, for convenience of description, the first column in which the head queue in the first queue is referred to as a coordinate space will be described as an example.
In yet another embodiment, a free starting node, e.g., a zero-trust TAC node, may also be determined among the remaining nodes. The free start nodes may be arranged in sequence in the first column of the coordinate space.
To further describe the process of determining the coordinates of the remaining nodes based on the coordinates of the node of the longest node link according to the present invention, the following embodiments are described below.
Fig. 7 is a schematic flowchart of determining the coordinates of the remaining nodes based on the coordinates of the node of the longest node link according to the present invention.
In an exemplary embodiment of the present invention, as can be seen from fig. 7, determining the coordinates of the remaining nodes based on the coordinates of the node of the longest node link may include steps 710 to 740, which will be described separately below.
In step 710, a first remaining node having a connection relationship with a node in the longest node link is determined among the remaining nodes, and a second directional coordinate of the first remaining node is determined based on the second directional coordinate of the node in the longest node link.
In one embodiment, a first remaining node having a connection relationship with a node in the longest node link may be determined among the remaining nodes. Continuing with the description of FIG. 9, the first remaining node may be a CSMP node, a VCPE node, a Dayu node, or the like. During application, the abscissa of the first remaining node may be determined based on the abscissas of the nodes in the longest node link. Wherein the first remaining node may be understood as the starting node of the first remaining node link.
In an example, for a WAF node in the longest node link, the abscissa of the VCPE node can be determined based on the abscissa of the WAF node, e.g., the abscissa of the WAF node in the longest node link is the same as the abscissa of the first remaining node (VCPE node).
In yet another example, for a firewall node in the longest node link, an abscissa of the Dayu node may be determined based on the abscissas of the firewall node. For example, the abscissa of the firewall node in the longest node link differs from the abscissa of the first remaining node (daoya node) by a unit length.
In step 720, a first remaining node link including a first remaining node is determined, wherein the nodes in the first remaining node link are the nodes in the remaining nodes.
In step 730, the first remaining node link is set in a first remaining node link queue of the coordinate space, where the first remaining node link queue is a queue in which the second direction coordinate of the first remaining node is located.
In step 740, each node in the first remaining node link is extracted, and coordinates of the node are set in a traversal manner in the first remaining node link queue according to the arrangement sequence of the node in the first remaining node link, wherein the second direction coordinates of the node are fixed, and the first direction coordinates of the node are increased or decreased according to a preset value.
It should be noted that, if the second direction coordinate is an abscissa, the first remaining node link queue may be understood as a queue in which the abscissa of the first remaining node is located.
In one embodiment, a first remaining node link including a first remaining node may be determined, wherein each node in the first remaining node link is a node in the remaining nodes. Further, the first remaining node link is arranged in a first remaining node link queue of the coordinate space, wherein the first remaining node link queue is a column in which an abscissa of the first remaining node is located. As described with reference to fig. 9, the first remaining-node link queue may be a column in which the VCPE node is located, or may be a column in which the davit node is located.
Further, each node in the first remaining node link may be extracted, and the coordinates of the node may be set in a traversal manner in the first remaining node link queue according to the arrangement order of the nodes in the first remaining node link.
In an example, the other nodes may be sequentially set to the first remaining node link queue starting from the first remaining node in the first remaining node link, where the abscissa of each node is the same, and the ordinate is incremented or decremented by a preset value. The preset value may be adjusted according to an actual situation, for example, may be 100, and in this embodiment, the preset value is not specifically limited.
In another embodiment, if the first remaining node is connected to the complex node, the first remaining node may be set on the row where the longest node link is located. Continuing with FIG. 9, for CSMP nodes (the first remaining nodes), CSMP nodes may be placed on the row where the longest node link is located.
Through the embodiment, the remaining nodes can be sequentially arranged in the coordinate space of the directed topological graph, and the nodes are ensured not to be shielded, so that a foundation is laid for improving the readability of the directed topological graph.
To further describe the process of determining the coordinates of the remaining nodes based on the coordinates of the node of the second long node link according to the present invention, the following embodiments are described below.
Fig. 8 is a schematic flowchart of determining the coordinates of the remaining nodes based on the coordinates of the node of the second long node link according to the present invention.
In an exemplary embodiment of the present invention, as can be seen from fig. 8, determining the coordinates of the remaining nodes based on the coordinates of the nodes of the second long node link may include steps 810 to 840, which will be described separately below.
In step 810, a second remaining node having a connection relationship with a node in the second long node link is determined among the remaining nodes, and the first direction coordinate of the second remaining node is determined based on the first direction coordinate of the node in the second long node link.
In one embodiment, a second remaining node having a connection relationship with a node in a second long node link may be determined among the remaining nodes. During application, the ordinate of the second remaining node may be determined based on the ordinate of the node in the second long node link. Wherein the second remaining node may be understood as the starting node of the second remaining node link.
In step 820, a second remaining node link including a second remaining node is determined, wherein the nodes in the second remaining node link are the nodes in the remaining nodes.
In step 830, a second remaining node link queue of the coordinate space is set, where the second remaining node link queue is a queue in which the first direction coordinate of the second remaining node is located.
In step 840, each node in the second remaining node link is extracted, and coordinates of the node are set in the second remaining node link queue in a traversing manner according to the arrangement sequence of the node in the second remaining node link, where the first direction coordinate of the node is fixed, and the second direction coordinate of the node is incremented or decremented according to a preset value.
It should be noted that, if the first direction coordinate represents an ordinate, the queue in which the first direction coordinate is located may be understood as a row in which the ordinate is located. For convenience of explanation, an example of a behavior in which a queue in which the first-direction coordinates are located is taken as a vertical coordinate will be described below.
In one embodiment, a second remaining node link including a second remaining node may be determined, wherein each node in the second remaining node link is a node in the remaining nodes. Further, a second remaining node link is arranged in a second remaining node link queue of the coordinate space, wherein the second remaining node link queue is a row where a vertical coordinate of the second remaining node is located.
Further, each node in the second remaining node link may be extracted, and the coordinates of the node may be set in a traversal manner in the second remaining node link queue according to the arrangement order of the nodes in the second remaining node link.
In an example, starting from a second remaining node in the second remaining node link, other nodes may be sequentially arranged to the second remaining node link queue, where the ordinate of each node is the same, and the abscissa is incremented or decremented by a preset value. The preset value may be adjusted according to an actual situation, for example, may be 100, and in this embodiment, the preset value is not specifically limited.
Through the embodiment, the remaining nodes can be sequentially arranged in the coordinate space of the directed topology graph, and the nodes are ensured not to be shielded from each other, so that a foundation is laid for improving the readability of the directed topology graph.
In another exemplary embodiment of the present invention, connecting the nodes having the connection relationship may be implemented in the following manner:
the connection piles arranged on the nodes are connected with the directed connecting lines, and the nodes are connected with other nodes with connection relations based on the directed connecting lines, wherein the position distribution of the connection piles on the nodes can be determined in the following mode:
determining the number of connecting piles of the nodes;
and determining the position distribution of each connecting pile on the nodes in each node based on a preset mapping table, wherein the mapping table comprises the corresponding relation between the number of the connecting piles and the position distribution of each connecting pile on the nodes, and the connecting piles are uniformly distributed on the nodes according to a preset position sequence.
In one embodiment, in order to ensure regularity of the position distribution of the connection piles on each node, a mapping table may be preset, and the position distribution of each connection pile in each node on the node may be determined based on the mapping table, wherein the connection piles are uniformly distributed on the node according to the preset position order. In one example, the mapping table may be as shown in table 1.
Table 1 relation between the number of connecting piles and the distribution of the positions of the connecting piles on the nodes
Number of connecting piles Position distribution (Angle) of connecting pile
1 [180]
2 [180,0]
3 [180,270,0]
4 [180,270,0,90]
5 [180,270,315,0,90]
6 [180,270,315,0,45,90]
7 [180,270,315,0,45,90,135]
8 [180,270,315,0,45,90,135,225]
In yet another embodiment, the connection piles may be further provided at edge sides of the respective nodes. In the application process, taking the node as a circular shape as an example, the coordinates of the connecting piles can be determined based on the radius of the node and the position distribution of the connecting piles. Further, the nodes with the connection relation are connected through the connection piles arranged on the nodes.
In another embodiment, the connection piles may also be disposed inside the nodes, and in this embodiment, specific arrangement positions of the connection piles are not limited, but it is required to limit the position distribution of the connection piles to ensure that the nodes do not obscure each other and the connection lines do not overlap each other, so that readability of the finally formed directed topological graph can be improved.
As can be seen from the above description, the directed topology graph layout method provided by the present invention determines the longest node link and the second longest node link among the plurality of node links starting from the starting node; determining a first queue number of the directed topology graph based on the longest node link; determining a second number of queues for the directed topology based on the second long node link; determining a coordinate space of the directed topological graph based on the first queue number and the second queue number, and correspondingly positioning the nodes to the coordinate space according to the sequencing sequence in the node link; and connecting the nodes with the connection relation to obtain a topological graph with clear structure and high readability and related to the original data. Therefore, the topological graph with multiple starting points and multiple connecting points can be laid out, and the topological graph with higher readability can be obtained.
Based on the same conception, the invention also provides a directed topological graph layout device.
The following describes the directed topology graph layout apparatus provided in the present invention, and the directed topology graph layout apparatus described below and the directed topology graph layout method described above may be referred to correspondingly.
Fig. 10 is a schematic structural diagram of a directed topology layout apparatus provided in the present invention.
In an exemplary embodiment of the present invention, as can be seen in conjunction with fig. 10, the directed topology graph layout apparatus may include a first module 1010 to a seventh module 1070, which will be described separately below.
A first module 1010, which may be configured to obtain original data, where the original data includes nodes and directed links, and the directed links are used to connect nodes having a connection relationship to obtain node links;
a second module 1020, which may be configured to determine at least one starting node among the nodes based on the directed links;
a third module 1030, configured to determine a longest node link and a second long node link in multiple node links starting from a starting node, where the longest node link includes a first node, and the first node has a connection relationship with a second node of the second long node link, and the second node is the starting node of the second long node link;
a fourth module 1040, which may be configured to determine a first number of queues for the directed topology graph based on the longest node link;
a fifth module 1050, which may be configured to determine a second number of queues of the directed topology graph based on the second long node link, where the first queue is arranged along a first direction, the second queue is arranged along a second direction, and the first direction and the second direction are at a preset angle;
a sixth module 1060, which may be configured to determine a coordinate space of the directed topology graph based on the first queue number and the second queue number, and correspondingly place the nodes into the coordinate space according to the sorting order in the node links;
a seventh module 1070 may be configured to connect nodes having a connection relationship.
In an exemplary embodiment of the invention, the fourth module 1040 may be further configured to:
determining a complex node on the longest node link, wherein the complex node is a node of which the number of connecting piles exceeds a number threshold, and the connecting piles are fixed points on the node and are used for realizing the connection of the node and a directed connecting line;
the fourth module 1040 may determine the first number of queues of the directed topology graph based on the longest node link in the following manner:
determining a first number of complex nodes;
determining a second number of nodes in the longest node link;
a first number of queues for the directed topology graph is determined based on the first number and the second number.
In an exemplary embodiment of the invention, the fifth module 1050 may determine the second number of queues of the directed topology graph based on the second long node link in the following manner:
determining a third number of nodes in the second long node link;
based on the third number, a second number of queues for the directed topology graph is determined.
In an exemplary embodiment of the invention, the sixth module 1060 may correspondingly locate the nodes in the coordinate space according to the sorting order in the node links by:
under the condition that the first number of the complex nodes is larger than zero, setting the longest node link in an intermediate queue in a second queue of the coordinate space;
extracting each node in the longest node link, and setting coordinates of the nodes in an intermediate queue in a traversing manner according to the sorting sequence of the nodes in the longest node link, wherein the coordinates of the nodes in the first direction are fixed, and the coordinates of the nodes in the second direction are increased progressively according to a preset value;
determining a second direction coordinate of a second node in a second long node link based on a second direction coordinate of the first node in the longest node link;
setting a second long node link in a target queue of a coordinate space, wherein the target queue is a queue in which a second direction coordinate of a second node is located;
extracting each node in the second long node link, and traversing and setting coordinates of the nodes in the target queue according to the arrangement sequence of the nodes in the second long node link, wherein the second-direction coordinates of the nodes are fixed, and the first-direction coordinates of the nodes are increased progressively according to a preset numerical value;
extracting remaining nodes, wherein the remaining nodes are other nodes except the node of the longest node link and the node of the second long node link;
determining the coordinates of the remaining nodes based on the coordinates of the node of the longest node link or the coordinates of the node of the second long node link;
and extracting the free starting node, and sequentially arranging the free starting node in a starting queue in a first queue of the coordinate space, wherein the free starting node is a starting node which has no connection relation with other nodes.
In an exemplary embodiment of the invention, the sixth module 1060 may traverse the coordinates of the set nodes in the intermediate queue according to the sorting order of the nodes in the longest node link in the following manner:
determining the next node of the complex node according to the sequencing sequence of the nodes in the longest node link;
and compared with the second direction coordinate of the complex node, when the second direction coordinate of the next node of the complex node is set in the middle queue, the second direction coordinate is increased progressively according to the preset multiple of the preset numerical value.
In an exemplary embodiment of the invention, the sixth module 1060 may determine the coordinates of the remaining nodes based on the coordinates of the node of the longest node link in the following manner:
determining a first residual node having a connection relation with a node in the longest node link from the residual nodes, and determining a second direction coordinate of the first residual node based on the second direction coordinate of the node in the longest node link;
determining a first remaining node link comprising a first remaining node, wherein a node in the first remaining node link is a node in the remaining nodes;
setting the first residual node link in a first residual node link queue of a coordinate space, wherein the first residual node link queue is a queue in which a second direction coordinate of the first residual node is located;
and extracting each node in the first residual node link, and setting coordinates of the nodes in a traversing manner in the first residual node link queue according to the arrangement sequence of the nodes in the first residual node link, wherein the second direction coordinates of the nodes are fixed, and the first direction coordinates of the nodes are increased or decreased progressively according to a preset numerical value.
In an exemplary embodiment of the invention, the sixth module 1060 may determine the coordinates of the remaining nodes based on the coordinates of the nodes of the second long node link in the following manner:
determining a second residual node in the residual nodes, wherein the second residual node has a connection relation with the node in the second long node link, and determining a first direction coordinate of the second residual node based on the first direction coordinate of the node in the second long node link;
determining a second remaining node link comprising a second remaining node, wherein a node in the second remaining node link is a node in the remaining nodes;
setting the second residual node link in a second residual node link queue of the coordinate space, wherein the second residual node link queue is a queue in which the first direction coordinate of the second residual node is located;
and extracting each node in the second remaining node link, and traversing and setting coordinates of the nodes in the second remaining node link queue according to the arrangement sequence of the nodes in the second remaining node link, wherein the first direction coordinates of the nodes are fixed, and the second direction coordinates of the nodes are increased or decreased according to a preset value.
In an exemplary embodiment of the present invention, the fifth module 1050 may implement the first direction and the second direction to be at a predetermined angle by using the following method:
the first direction and the second direction form an angle of 90 degrees, wherein the first direction is a direction indicated by each column of the directed topological graph, and the second direction is a direction indicated by each row of the directed topological graph; or the first direction is a direction indicated by each row of the directed topology graph and the second direction is a direction indicated by each column of the directed topology graph.
In an exemplary embodiment of the present invention, the seventh module 1070 may connect the nodes having the connection relationship in the following manner:
the connection piles arranged on the nodes are connected with the directed connecting lines, and the nodes are connected with other nodes with connection relations based on the directed connecting lines, wherein,
the position distribution of the connecting piles on the nodes is determined by adopting the following modes:
determining the number of connecting piles of the nodes;
and determining the position distribution of each connecting pile on the nodes in each node based on a preset mapping table, wherein the mapping table comprises the corresponding relation between the number of the connecting piles and the position distribution of each connecting pile on the nodes, and the connecting piles are uniformly distributed on the nodes according to a preset position sequence.
Fig. 11 illustrates a physical structure diagram of an electronic device, and as shown in fig. 11, the electronic device may include: a processor (processor) 1110, a communication Interface (Communications Interface) 1120, a memory (memory) 1130, and a communication bus 1140, wherein the processor 1110, the communication Interface 1120, and the memory 1130 communicate with each other via the communication bus 1140. Processor 1110 may invoke logic instructions in memory 1130 to perform a directed topology graph layout method comprising: acquiring original data, wherein the original data comprises nodes and directed connecting lines, and the directed connecting lines are used for connecting the nodes with the connection relation to obtain node links; determining at least one starting node from the nodes based on the directional connecting line; determining a longest node link and a second long node link in a plurality of node links taking the starting node as a starting point, wherein the longest node link comprises a first node, the first node has a connection relationship with a second node of the second long node link, and the second node is the starting node of the second long node link; determining a first queue number of a directed topology graph based on the longest node link; determining a second queue number of the directed topology graph based on the second long node link, wherein the first queue is arranged along a first direction, the second queue is arranged along a second direction, and the first direction and the second direction form a preset angle; determining a coordinate space of the directed topology graph based on the first queue number and the second queue number, and correspondingly positioning the nodes to the coordinate space according to a sequencing sequence in a node link; and connecting the nodes with the connection relation.
In addition, the logic instructions in the memory 1130 may be implemented in the form of software functional units and stored in a computer readable storage medium when the logic instructions are sold or used as independent products. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
In another aspect, the present invention also provides a computer program product, the computer program product including a computer program, the computer program being storable on a non-transitory computer-readable storage medium, wherein when the computer program is executed by a processor, a computer is capable of executing the directed topology layout method provided by the above methods, and the method includes: acquiring original data, wherein the original data comprises nodes and directed connecting lines, and the directed connecting lines are used for connecting the nodes with the connection relation to obtain node links; determining at least one starting node from the nodes based on the directional connecting line; determining a longest node link and a second long node link from a plurality of node links taking the starting node as a starting point, wherein the longest node link comprises a first node, the first node and a second node of the second long node link have a connection relation, and the second node is the starting node of the second long node link; determining a first queue number of a directed topology graph based on the longest node link; determining a second queue number of the directed topology graph based on the second long node link, wherein the first queue is arranged along a first direction, the second queue is arranged along a second direction, and the first direction and the second direction form a preset angle; determining a coordinate space of the directed topology graph based on the first queue number and the second queue number, and correspondingly positioning the nodes to the coordinate space according to a sequencing sequence in a node link; and connecting the nodes with the connection relation.
In yet another aspect, the present invention also provides a non-transitory computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements a directed topology graph layout method provided by performing the above methods, the method comprising: acquiring original data, wherein the original data comprise nodes and directed connecting lines, and the directed connecting lines are used for connecting the nodes with the connection relation to obtain node links; determining at least one starting node from the nodes based on the directional connecting line; determining a longest node link and a second long node link from a plurality of node links taking the starting node as a starting point, wherein the longest node link comprises a first node, the first node and a second node of the second long node link have a connection relation, and the second node is the starting node of the second long node link; determining a first queue number of a directed topology graph based on the longest node link; determining a second queue number of the directed topology graph based on the second long node link, wherein the first queue is arranged along a first direction, the second queue is arranged along a second direction, and the first direction and the second direction form a preset angle; determining a coordinate space of the directed topological graph based on the first queue number and the second queue number, and correspondingly positioning the nodes to the coordinate space according to a sequencing sequence in a node link; and connecting the nodes with the connection relation.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
It is further to be understood that while operations are depicted in the drawings in a particular order, this is not to be understood as requiring that such operations be performed in the particular order shown or in serial order, or that all illustrated operations be performed, to achieve desirable results. In certain environments, multitasking and parallel processing may be advantageous.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (13)

1. A directed topology graph layout method, comprising:
acquiring original data, wherein the original data comprises nodes and directed connecting lines, and the directed connecting lines are used for connecting the nodes with the connection relation to obtain node links;
determining at least one starting node from the nodes based on the directional connecting line;
determining a longest node link and a second long node link from the plurality of node links using the starting node as a starting point, wherein the longest node link comprises a first node, the first node has a connection relationship with a second node of the second long node link, and the second node is the starting node of the second long node link;
determining a first queue number of a directed topology graph based on the longest node link;
determining a second queue number of the directed topology graph based on the second long node link, wherein the first queue is arranged along a first direction, the second queue is arranged along a second direction, and the first direction and the second direction form a preset angle;
determining a coordinate space of the directed topology graph based on the first queue number and the second queue number, and correspondingly positioning the nodes to the coordinate space according to a sequencing sequence in a node link;
and connecting the nodes with the connection relation.
2. The method of claim 1, wherein prior to said determining a first number of queues of the directed topology graph based on the longest node link, the method further comprises:
determining a complex node on the longest node link, wherein the complex node is a node of which the number of connecting piles exceeds a number threshold value, and the connecting piles are fixed points on the node and are used for realizing the connection between the node and the directed connecting line;
the determining a first queue number of the directed topology graph based on the longest node link specifically includes:
determining a first number of the complex nodes;
determining a second number of nodes in the longest node link;
determining a first number of queues for the directed topology graph based on the first number and the second number.
3. The directed topology graph placement method according to claim 1, wherein the determining a second number of queues of the directed topology graph based on the second long node link specifically comprises:
determining a third number of nodes in the second long node link;
determining a second number of queues for the directed topology graph based on the third number.
4. The directed topology graph layout method according to claim 1, wherein the correspondingly positioning the nodes to the coordinate space according to the sorting order in the node links specifically comprises:
setting the longest node link in an intermediate queue of the second queues of the coordinate space if the first number of complex nodes is greater than zero;
extracting each node in the longest node link, and setting coordinates of the nodes in the intermediate queue in a traversing manner according to the sorting sequence of the nodes in the longest node link, wherein the first-direction coordinates of the nodes are fixed, and the second-direction coordinates of the nodes are increased progressively according to a preset numerical value;
determining a second directional coordinate of the second node in the second long node link based on a second directional coordinate of the first node in the longest node link;
setting the second long node link in a target queue of the coordinate space, wherein the target queue is a queue in which a second direction coordinate of the second node is located;
extracting each node in the second long node link, and traversing and setting coordinates of the nodes in the target queue according to the arrangement sequence of the nodes in the second long node link, wherein the second direction coordinates of the nodes are fixed, and the first direction coordinates of the nodes are increased progressively according to a preset numerical value;
extracting remaining nodes, wherein the remaining nodes are other nodes except the node of the longest node link and the node of the second long node link;
determining coordinates of the remaining nodes based on coordinates of the node of the longest node link or coordinates of the node of the second long node link;
and extracting a free starting node, and sequentially setting the free starting node in a starting queue in the first queue of the coordinate space, wherein the free starting node is a starting node which has no connection relation with other nodes.
5. The directed topology graph layout method according to claim 4, wherein the traversing the coordinates of the nodes in the intermediate queue according to the sorting order of the nodes in the longest node link specifically includes:
determining a next node of the complex node according to the sorting sequence of the nodes in the longest node link;
and compared with the second direction coordinate of the complex node, when the second direction coordinate of the next node of the complex node is set in the middle queue, the second direction coordinate is increased progressively according to the preset multiple of the preset numerical value.
6. The directed topology graph placement method according to claim 4, wherein the determining coordinates of the remaining nodes based on the coordinates of the node of the longest node link specifically comprises:
determining a first remaining node having a connection relation with a node in the longest node link from among the remaining nodes, and determining a second direction coordinate of the first remaining node based on a second direction coordinate of the node in the longest node link;
determining a first remaining node link comprising the first remaining node, wherein a node in the first remaining node link is a node in the remaining nodes;
setting the first remaining node link in a first remaining node link queue of the coordinate space, wherein the first remaining node link queue is a queue in which a second direction coordinate of the first remaining node is located;
and extracting each node in the first remaining node link, and setting coordinates of the nodes in the first remaining node link queue in a traversing manner according to the arrangement sequence of the nodes in the first remaining node link, wherein the second direction coordinates of the nodes are fixed, and the first direction coordinates of the nodes are increased or decreased according to a preset numerical value.
7. The directed topology graph placement method according to claim 4, wherein the determining coordinates of the remaining nodes based on the coordinates of the nodes of the second long node link specifically comprises:
determining a second remaining node in the remaining nodes, wherein the second remaining node has a connection relation with a node in the second long node link, and determining a first direction coordinate of the second remaining node based on the first direction coordinate of the node in the second long node link;
determining a second remaining node link comprising the second remaining node, wherein a node in the second remaining node link is a node in the remaining nodes;
setting the second remaining node link in a second remaining node link queue of the coordinate space, wherein the second remaining node link queue is a queue in which a first direction coordinate of the second remaining node is located;
and extracting each node in the second remaining node link, and setting the coordinates of the nodes in a traversing manner in the second remaining node link queue according to the arrangement sequence of the nodes in the second remaining node link, wherein the first direction coordinates of the nodes are fixed, and the second direction coordinates of the nodes are increased or decreased according to a preset numerical value.
8. The directed topology graph layout method according to any one of claims 1 to 7, wherein the first direction and the second direction form a preset angle, specifically comprising:
the first direction and the second direction are at an angle of 90 degrees, wherein the first direction is a direction indicated by each column of the directed topology map and the second direction is a direction indicated by each row of the directed topology map; or the first direction is a direction indicated by each row of the directed topology graph and the second direction is a direction indicated by each column of the directed topology graph.
9. The directed topology graph placement method according to claim 1, wherein the connecting the nodes having a connection relationship specifically includes:
the connection piles arranged on the nodes are connected with the directed connecting lines, and the nodes are connected with other nodes with connection relations based on the directed connecting lines, wherein,
the position distribution of the connecting piles on the nodes is determined in the following way:
determining the number of connecting piles of the node;
the method comprises the steps of determining the position distribution of each connecting pile in each node on the node based on a preset mapping table, wherein the mapping table comprises the corresponding relation between the number of the connecting piles and the position distribution of each connecting pile on the node, and the connecting piles are uniformly distributed on the node according to a preset position sequence.
10. A directed topology graph placement apparatus, comprising:
the system comprises a first module and a second module, wherein the first module is used for acquiring original data, the original data comprises nodes and directed connecting lines, and the directed connecting lines are used for connecting the nodes with the connection relationship to obtain node links;
a second module configured to determine at least one start node among the nodes based on the directional link;
a third module, configured to determine a longest node link and a second long node link in multiple node links that use the starting node as a starting point, where the longest node link includes a first node, and the first node has a connection relationship with a second node of the second long node link, and the second node is the starting node of the second long node link;
a fourth module for determining a first queue number of a directed topology graph based on the longest node link;
a fifth module, configured to determine, based on the second long node link, a second number of queues of the directed topology graph, where the first queue is arranged along a first direction, the second queue is arranged along a second direction, and the first direction and the second direction form a preset angle;
a sixth module, configured to determine a coordinate space of the directed topology graph based on the first queue number and the second queue number, and correspondingly place the nodes in the coordinate space according to a sorting order in a node link;
a seventh module, configured to connect the nodes with the connection relationship.
11. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor implements the directed topology placement method of any of claims 1 to 9 when executing the program.
12. A non-transitory computer readable storage medium having stored thereon a computer program, wherein the computer program, when executed by a processor, implements the directed topology graph placement method of any of claims 1 to 9.
13. A computer program product comprising a computer program, wherein the computer program, when executed by a processor, implements the directed topology graph placement method of any of claims 1 to 9.
CN202211390931.8A 2022-11-07 2022-11-07 Directed topological graph layout method and device, electronic equipment and storage medium Pending CN115913975A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211390931.8A CN115913975A (en) 2022-11-07 2022-11-07 Directed topological graph layout method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211390931.8A CN115913975A (en) 2022-11-07 2022-11-07 Directed topological graph layout method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115913975A true CN115913975A (en) 2023-04-04

Family

ID=86495810

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211390931.8A Pending CN115913975A (en) 2022-11-07 2022-11-07 Directed topological graph layout method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115913975A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2012089285A1 (en) * 2010-12-31 2012-07-05 Tomtom Germany Gmbh & Co. Kg Graph based topological map matching
WO2019179250A1 (en) * 2018-03-23 2019-09-26 华为技术有限公司 Scheduling method, scheduler, storage medium, and system
CN113704943A (en) * 2021-09-10 2021-11-26 京东科技信息技术有限公司 Node topological graph layout method and device, computer storage medium and electronic equipment
CN114092601A (en) * 2021-11-30 2022-02-25 杭州昊美科技有限公司 Single line diagram generation method and device and electronic equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2012089285A1 (en) * 2010-12-31 2012-07-05 Tomtom Germany Gmbh & Co. Kg Graph based topological map matching
WO2019179250A1 (en) * 2018-03-23 2019-09-26 华为技术有限公司 Scheduling method, scheduler, storage medium, and system
CN113704943A (en) * 2021-09-10 2021-11-26 京东科技信息技术有限公司 Node topological graph layout method and device, computer storage medium and electronic equipment
CN114092601A (en) * 2021-11-30 2022-02-25 杭州昊美科技有限公司 Single line diagram generation method and device and electronic equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
吕亮;卢泽新;郦苏丹;李渊;: "基于扩展力学模型的网络拓扑图布局算法", 计算机应用研究, no. 07, 15 July 2010 (2010-07-15) *

Similar Documents

Publication Publication Date Title
CN109754359B (en) Pooling processing method and system applied to convolutional neural network
CN112085701B (en) Face ambiguity detection method and device, terminal equipment and storage medium
CN113449852B (en) Convolutional neural network computing method, system on chip and electronic device
KR20220062622A (en) Data processing methods and related devices
CN115913975A (en) Directed topological graph layout method and device, electronic equipment and storage medium
CN111141208A (en) Parallel line detection method and device
CN106909552A (en) Image retrieval server, system, coordinate indexing and misarrangement method
CN110750536B (en) Vibration noise smoothing method and system for attitude time series data
CN112597662A (en) Method and system for checking correctness and mistakes of building model
CN110138742B (en) Firewall policy optimization method, system and computer readable storage medium
CN111932441A (en) Method and device for determining ship surface strong scattering source
CN112816959B (en) Clustering method, device, equipment and storage medium for vehicles
CN111198535A (en) Method and device for determining curved surface machining path
CN109416748B (en) SVM-based sample data updating method, classification system and storage device
CN107491481B (en) LOD model searching method and system, method for establishing LOD model database and computer-readable storage medium
CN114996503A (en) Node positioning method and device
CN112799533B (en) Touch point determination method and touch equipment
CN109523634A (en) Optimize the method and device of grid
CN114459482A (en) Boundary simplifying method, path planning method, device, equipment and system
CN113795032A (en) Method and device for judging room division invisible fault, storage medium and equipment
CN114816594B (en) Method and device for detecting topology collision
CN117556781B (en) Target pattern determining method and device, electronic equipment and storage medium
US20240355054A1 (en) Data processing method and apparatus, device, and storage medium
CN111158590B (en) Method and equipment for solving hash collision
CN112116680B (en) Non-self-intersecting polygon drawing method, device and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination