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

Directed topology graph layout method, 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
directed
remaining
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.)
Granted
Application number
CN202211390931.8A
Other languages
Chinese (zh)
Other versions
CN115913975B (en
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.)
Secworld Information Technology Beijing Co Ltd
Qax Technology Group Inc
Original Assignee
Secworld Information Technology Beijing Co Ltd
Qax Technology Group Inc
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 Secworld Information Technology Beijing Co Ltd, Qax Technology Group Inc filed Critical Secworld Information Technology Beijing Co Ltd
Priority to CN202211390931.8A priority Critical patent/CN115913975B/en
Publication of CN115913975A publication Critical patent/CN115913975A/en
Application granted granted Critical
Publication of CN115913975B publication Critical patent/CN115913975B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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

本发明提供一种有向拓扑图布局方法、装置、电子设备及存储介质,所述方法包括:获取原始数据,其中,原始数据包括节点和有向连线,有向连线用于对具有连接关系的节点进行连接得到节点链路;基于有向连线在节点中确定出至少一个起始节点;在以起始节点为起点的多条节点链路中确定最长节点链路以及确定第二长节点链路;基于最长节点链路确定有向拓扑图的第一队列数;基于第二长节点链路确定有向拓扑图的第二队列数;基于第一队列数和第二队列数,确定有向拓扑图的坐标空间,并将节点按照在节点链路中的排序顺序对应落位至坐标空间;将存在连接关系的节点进行连接。通过本发明可以对多起点、多连接点的拓扑图进行布局,得到可读性更高的拓扑图。

Figure 202211390931

The present invention provides a directed topological graph layout method, device, electronic equipment and storage medium. The method includes: obtaining original data, wherein the original data includes nodes and directed connections, and the directed connections are used to connect Connect the nodes of the relationship to obtain node links; determine at least one starting node in the node based on the directed connection; determine the longest node link and determine the second node link among multiple node links starting from the starting node Long node link; determine the first queue number of the directed topology graph based on the longest node link; determine the second queue number of the directed topology graph based on the second long node link; based on the first queue number and the second queue number , determine the coordinate space of the directed topological graph, and place the nodes in the coordinate space according to the sort order in the node link; connect the nodes with connection relationship. Through the present invention, the topology diagram with multiple starting points and multiple connection points can be laid out to obtain a topology diagram with higher readability.

Figure 202211390931

Description

有向拓扑图布局方法、装置、电子设备及存储介质Directed topology graph layout method, device, electronic equipment and storage medium

技术领域technical field

本发明涉及拓扑图布局技术领域,尤其涉及一种有向拓扑图布局方法、装置、电子设备及存储介质。The present invention relates to the technical field of topological graph layout, in particular to a directed topological graph layout method, device, electronic equipment and storage medium.

背景技术Background technique

在相关技术中,基于信息技术可视化的发展,通过图布局算法对散乱的节点进行处理,可以更加清晰得呈现出节点之间的拓扑关系,以便于实施相关的分析操作。In related technologies, based on the development of information technology visualization, the graph layout algorithm is used to process scattered nodes, so that the topological relationship between nodes can be presented more clearly, so as to facilitate the implementation of relevant analysis operations.

然而,在当前网络拓扑图的绘制方式中,无法实现多起点、多连接点的布局,进而不能提高布局的可读性。因此,寻找一种可以实现多起点、多连接点的拓扑图布局方法成为当前的研究热点。However, in the current drawing method of the network topology map, it is impossible to realize the layout of multiple starting points and multiple connection points, and thus the readability of the layout cannot be improved. Therefore, looking for a topology map layout method that can realize multiple starting points and multiple connection points has become a current research hotspot.

发明内容Contents of the invention

本发明提供一种有向拓扑图布局方法、装置、电子设备及存储介质,用以解决现有技术中无法实现多起点、多连接点的拓扑图布局,进而不能提高布局可读性的缺陷,实现了可以对多起点、多连接点的拓扑图进行布局,能够得到具有更高可读性的拓扑图。The present invention provides a directed topological map layout method, device, electronic equipment and storage medium, which are used to solve the defects in the prior art that the topological map layout with multiple starting points and multiple connection points cannot be realized, and the readability of the layout cannot be improved. It realizes the layout of the topology diagram with multiple starting points and multiple connection points, and can obtain a topology diagram with higher readability.

本发明提供一种有向拓扑图布局方法,所述有向拓扑图布局方法包括:获取原始数据,其中,所述原始数据包括节点和有向连线,所述有向连线用于对具有连接关系的节点进行连接得到节点链路;基于所述有向连线,在所述节点中确定出至少一个起始节点;在以所述起始节点为起点的多条所述节点链路中,确定最长节点链路,以及确定第二长节点链路,其中,所述最长节点链路中包括第一节点,所述第一节点与所述第二长节点链路的第二节点存在连接关系,所述第二节点为所述第二长节点链路的起始节点;基于所述最长节点链路,确定有向拓扑图的第一队列数;基于所述第二长节点链路,确定有向拓扑图的第二队列数,其中,第一队列沿第一方向设置,第二队列沿第二方向设置,所述第一方向和第二方向呈预设角度;基于所述第一队列数和所述第二队列数,确定所述有向拓扑图的坐标空间,并将所述节点按照在节点链路中的排序顺序对应落位至所述坐标空间;将存在连接关系的所述节点进行连接。The present invention provides a directed topological graph layout method. The directed topological graph layout method includes: obtaining original data, wherein the original data includes nodes and directed connections, and the directed connections are used for The nodes in the connection relationship are connected to obtain node links; based on the directed connection, at least one starting node is determined among the nodes; among the plurality of node links starting from the starting node , determine the longest node link, and determine the second long node link, wherein the longest node link includes the first node, the first node and the second node of the second long node link There is a connection relationship, the second node is the starting node of the second long node link; based on the longest node link, determine the first queue number of the directed topology graph; based on the second long node Links, determining the number of second queues in the directed topology graph, wherein the first queue is set along the first direction, the second queue is set along the second direction, and the first direction and the second direction form a preset angle; based on the The first number of queues and the second number of queues, determine the coordinate space of the directed topology graph, and place the nodes in the coordinate space correspondingly according to the sort order in the node link; there will be connections The nodes of the relationship are connected.

根据本发明提供的一种有向拓扑图布局方法,在所述基于所述最长节点链路,确定有向拓扑图的第一队列数之前,所述方法还包括:在所述最长节点链路上确定复杂节点,其中,所述复杂节点为连接桩的数量超过数量阈值的节点,所述连接桩为所述节点上固定的点,用于实现所述节点与所述有向连线相连;所述基于所述最长节点链路,确定有向拓扑图的第一队列数,具体包括:确定所述复杂节点的第一数量;确定所述最长节点链路中节点的第二数量;基于所述第一数量和所述第二数量,确定所述有向拓扑图的第一队列数。According to a directed topological graph layout method provided by the present invention, before determining the first queue number of the directed topological graph based on the longest node link, the method further includes: A complex node is determined on the link, wherein the complex node is a node whose number of connection stubs exceeds a threshold value, and the connection stub is a fixed point on the node, which is used to realize the connection between the node and the directed link connected; said determining the first number of queues in the directed topology graph based on the longest node link specifically includes: determining the first number of complex nodes; determining the second number of nodes in the longest node link Quantity; based on the first quantity and the second quantity, determine a first queue quantity of the directed topology graph.

根据本发明提供的一种有向拓扑图布局方法,所述基于所述第二长节点链路,确定有向拓扑图的第二队列数,具体包括:确定所述第二长节点链路中节点的第三数量;基于所述第三数量,确定所述有向拓扑图的第二队列数。According to a 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 the number of queues in the second long node link A third number of nodes; based on the third number, determining a second queue number of the directed topology graph.

根据本发明提供的一种有向拓扑图布局方法,所述将所述节点按照在节点链路中的排序顺序对应落位至所述坐标空间,具体包括:在复杂节点的第一数量大于零的情况下,将所述最长节点链路设置在所述坐标空间的所述第二队列中的中间队列;提取所述最长节点链路中各节点,并按照所述节点在所述最长节点链路中的排序顺序,在所述中间队列遍历设置所述节点的坐标,其中,所述节点的第一方向坐标固定,所述节点的第二方向坐标按照预设数值递增;基于所述最长节点链路中的所述第一节点的第二方向坐标,确定所述第二长节点链路中所述第二节点的第二方向坐标;将所述第二长节点链路设置在所述坐标空间的目标队列,其中,所述目标队列为所述第二节点的第二方向坐标所在的队列;提取所述第二长节点链路中各节点,并按照所述节点在所述第二长节点链路中的排列顺序,在所述目标队列遍历设置所述节点的坐标,其中,所述节点的第二方向坐标固定,所述节点的第一方向坐标按照预设数值递增;提取剩余节点,其中,所述剩余节点为除所述最长节点链路的节点和所述第二长节点链路的节点之外的其他节点;基于所述最长节点链路的节点的坐标,或所述第二长节点链路的节点的坐标,确定所述剩余节点的坐标;提取游离的起始节点,并将所述游离的起始节点依次设置在所述坐标空间的所述第一队列中的起始队列,其中,所述游离的起始节点为未与其他节点存在连接关系的起始节点。According to a directed topological graph layout method provided by the present invention, the corresponding positioning of the nodes in the coordinate space according to the sort order in the node link specifically includes: the first number of complex nodes is greater than zero In the case of , set the longest node link in the intermediate queue in the second queue in the coordinate space; extract each node in the longest node link, and according to the node in the longest The sorting order in the long node link is to traverse and set the coordinates of the nodes in the intermediate queue, wherein the first direction coordinates of the nodes are fixed, and the second direction coordinates of the nodes are incremented according to the preset value; based on the The second directional coordinates of the first node in the longest node link, determine the second directional coordinates of the second node in the second long node link; set the second long node link In the target queue in the coordinate space, wherein the target queue is the queue where the second direction coordinates of the second node are located; extract each node in the second long node link, and according to the node in the The arrangement sequence in the second long node link, the coordinates of the nodes are set in the target queue traversal, wherein the second direction coordinates of the nodes are fixed, and the first direction coordinates of the nodes are incremented according to the preset value ; extract the 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; based on the node of the longest node link Coordinates, or the coordinates of the nodes of the second long node link, determine the coordinates of the remaining nodes; extract the free start node, and set the free start node in the coordinate space in turn The initial queue in the first queue, wherein the free initial node is an initial node that has no connection relationship with other nodes.

根据本发明提供的一种有向拓扑图布局方法,所述按照所述节点在所述最长节点链路中的排序顺序,在所述中间队列遍历设置所述节点的坐标,具体包括:按照所述节点在所述最长节点链路中的排序顺序,确定出所述复杂节点的下一节点;相比于所述复杂节点的第二方向坐标,在所述中间队列设置所述复杂节点的下一节点的第二方向坐标时,按照预设数值的预设倍数进行递增。According to a directed topological graph layout method provided by the present invention, according to the sorting order of the nodes in the longest node link, traversing and setting the coordinates of the nodes in the intermediate queue specifically includes: The sorting order of the nodes in the longest node link determines the next node of the complex node; compared with the second direction coordinates of the complex node, the complex node is set in the intermediate queue When the second direction coordinate of the next node of , it is incremented according to the preset multiple of the preset value.

根据本发明提供的一种有向拓扑图布局方法,所述基于所述最长节点链路的节点的坐标,确定所述剩余节点的坐标,具体包括:在所述剩余节点中确定出与所述最长节点链路中的节点存在连接关系的第一剩余节点,并基于所述最长节点链路中的节点的第二方向坐标,确定所述第一剩余节点的第二方向坐标;确定包括所述第一剩余节点的第一剩余节点链路,其中,所述第一剩余节点链路中的节点为所述剩余节点中的节点;将所述第一剩余节点链路设置在所述坐标空间的第一剩余节点链路队列,其中,所述第一剩余节点链路队列为所述第一剩余节点的第二方向坐标所在的队列;提取所述第一剩余节点链路中各节点,并按照所述节点在所述第一剩余节点链路中的排列顺序,在所述第一剩余节点链路队列遍历设置所述节点的坐标,其中,所述节点的第二方向坐标固定,所述节点的第一方向坐标按照预设数值递增或递减。According to a directed topological 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 the coordinates of the remaining nodes among the remaining nodes The nodes in the longest node link are connected to the first remaining nodes, and based on the second direction coordinates of the nodes in the longest node link, determine the second direction coordinates of the first remaining nodes; determine A first remaining node link including the first remaining node, wherein a node in the first remaining node link is a node in the remaining node; setting the first remaining node link in the The first remaining node link queue in the coordinate space, wherein the first remaining node link queue is the queue where the second direction coordinates of the first remaining node are located; each node in the first remaining node link is extracted , and according to the arrangement order of the nodes in the first remaining node link, set the coordinates of the nodes in the first remaining node link queue traversal, wherein the second direction coordinates of the nodes are fixed, The first direction coordinates of the nodes are incremented or decremented according to a preset value.

根据本发明提供的一种有向拓扑图布局方法,所述基于所述第二长节点链路的节点的坐标,确定所述剩余节点的坐标,具体包括:在所述剩余节点中确定出与所述第二长节点链路中的节点存在连接关系的第二剩余节点,并基于所述第二长节点链路中的节点的第一方向坐标,确定所述第二剩余节点的第一方向坐标;确定包括所述第二剩余节点的第二剩余节点链路,其中,所述第二剩余节点链路中的节点为所述剩余节点中的节点;将所述第二剩余节点链路设置在所述坐标空间的第二剩余节点链路队列,其中,所述第二剩余节点链路队列为所述第二剩余节点的第一方向坐标所在的队列;提取所述第二剩余节点链路中的各节点,并按照所述节点在所述第二剩余节点链路中的排列顺序,在所述第二剩余节点链路队列遍历设置所述节点的坐标,其中,所述节点的第一方向坐标固定,所述节点的第二方向坐标按照预设数值递增或递减。According to a 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 the coordinates of the remaining nodes in the remaining nodes The nodes in the second long node link have second remaining nodes that are connected, and based on the first direction coordinates of the nodes in the second long node link, determine the first direction of the second remaining node coordinates; determine the second remaining node link including the second remaining node, wherein the node in the second remaining node link is a node in the remaining node; set the second remaining node link The second remaining node link queue in the coordinate space, wherein the second remaining node link queue is the queue where the first direction coordinates of the second remaining node are located; extract the second remaining node link Each node in, and according to the arrangement order of the nodes in the second remaining node link, set the coordinates of the node in the second remaining node link queue traversal, wherein, the first of the node The direction coordinates are fixed, and the second direction coordinates of the nodes increase or decrease according to a preset value.

根据本发明提供的一种有向拓扑图布局方法,所述第一方向和所述第二方向呈预设角度,具体包括:所述第一方向和所述第二方向呈90度角,其中,所述第一方向为所述有向拓扑图的各列所指示的方向且所述第二方向为所述有向拓扑图的各行所指示的方向;或者所述第一方向为所述有向拓扑图的各行所指示的方向且所述第二方向为所述有向拓扑图的各列所指示的方向。According to a directed topological graph layout method provided by the present invention, the first direction and the second direction form a preset angle, specifically including: the first direction and the second direction form an angle of 90 degrees, wherein , the first direction is the direction indicated by each column of the directed topological map and the second direction is the direction indicated by each row of the directed topological map; or the first direction is the direction indicated by the directed topological map The direction indicated by each row of the directed topology map and the second direction is the direction indicated by each column of the directed topology map.

根据本发明提供的一种有向拓扑图布局方法,所述将存在连接关系的所述节点进行连接,具体包括:通过设置在所述节点上的连接桩与所述有向连线相连,并基于所述有向连线实现所述节点与存在连接关系的其他节点进行连接,其中,所述连接桩在所述节点上的位置分布采用以下方式确定:确定所述节点的连接桩的数量;基于预先设置的映射表,确定各个节点中各个连接桩在节点上的位置分布,其中,所述映射表中包括连接桩的数量与各个连接桩在节点上的位置分布的对应关系,所述连接桩按照预设位置顺序在所述节点上均匀分布。According to a directed topological graph layout method provided by the present invention, the connecting the nodes having a connection relationship specifically includes: connecting to the directed link through a connecting pile set on the node, and Realize that the node is connected with other nodes that have a connection relationship based on the directed connection, wherein the position distribution of the connection piles on the node is determined in the following manner: determine the number of connection piles of the node; Based on the preset mapping table, the position distribution of each connection pile on the node in each node is determined, wherein the mapping table includes the corresponding relationship between the number of connection piles and the position distribution of each connection pile on the node, and the connection The piles are evenly distributed on the nodes in a preset position order.

本发明还提供一种有向拓扑图布局装置,所述有向拓扑图布局装置包括:第一模块,用于获取原始数据,其中,所述原始数据包括节点和有向连线,所述有向连线用于对具有连接关系的节点进行连接得到节点链路;第二模块,用于基于所述有向连线,在所述节点中确定出至少一个起始节点;第三模块,用于在以所述起始节点为起点的多条所述节点链路中,确定最长节点链路,以及确定第二长节点链路,其中,所述最长节点链路中包括第一节点,所述第一节点与所述第二长节点链路的第二节点存在连接关系,所述第二节点为所述第二长节点链路的起始节点;第四模块,用于基于所述最长节点链路,确定有向拓扑图的第一队列数;第五模块,用于基于所述第二长节点链路,确定有向拓扑图的第二队列数,其中,第一队列沿第一方向设置,第二队列沿第二方向设置,所述第一方向和第二方向呈预设角度;第六模块,用于基于所述第一队列数和所述第二队列数,确定所述有向拓扑图的坐标空间,并将所述节点按照在节点链路中的排序顺序对应落位至所述坐标空间;第七模块,用于将存在连接关系的所述节点进行连接。The present invention also provides a directed topological graph layout device, the directed topological graph layout device includes: a first module for acquiring original data, wherein the original data includes nodes and directed links, and the directed The directed connection is used to connect the nodes with the connection relationship to obtain the node link; the second module is used to determine at least one starting node in the nodes based on the directed connection; the third module uses Among the plurality of node links starting from the starting node, determining the longest node link and determining the second long node link, wherein the longest node link includes the first node , the first node has a connection relationship with the second node of the second long node link, and the second node is the starting node of the second long node link; the fourth module is configured to The longest node link is used to determine the first queue number of the directed topology graph; the fifth module is used to determine the second queue number of the directed topology graph based on the second long node link, wherein the first queue Arranged along the first direction, the second queue is arranged along the second direction, the first direction and the second direction form a preset angle; the sixth module is used to, based on the number of the first queue and the number of the second queue, Determining the coordinate space of the directed topological graph, and correspondingly positioning the nodes in the coordinate space according to the sort order in the node link; the seventh module is used to connect the nodes with connection relationship .

本发明还提供一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现如上述任一种所述的有向拓扑图布局方法。The present invention also provides an electronic device, including a memory, a processor, and a computer program stored on the memory and operable on the processor. When the processor executes the program, the directional Topology map layout method.

本发明还提供一种非暂态计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现如上述任一种所述的有向拓扑图布局方法。The present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the directed topology graph layout method as described in any one of the above is implemented.

本发明还提供一种计算机程序产品,包括计算机程序,所述计算机程序被处理器执行时实现如上述任一种所述的有向拓扑图布局方法。The present invention also provides a computer program product, including a computer program. When the computer program is executed by a processor, the directed topology graph layout method described in any one of the above is implemented.

本发明提供的有向拓扑图布局方法、装置、电子设备及存储介质,通过在以起始节点为起点的多条节点链路中确定最长节点链路和第二长节点链路;并基于最长节点链路确定有向拓扑图的第一队列数;基于第二长节点链路确定有向拓扑图的第二队列数;再基于第一队列数和第二队列数可以确定出有向拓扑图的坐标空间,并将节点按照在节点链路中的排序顺序对应落位至坐标空间;将存在连接关系的节点进行连接,可以得到结构清晰、可读性高的关于原始数据的拓扑图。以此可以实现对多起点、多连接点的拓扑图进行布局,得到具有更高可读性的拓扑图。The directed topological graph layout method, device, electronic equipment and storage medium provided by the present invention determine the longest node link and the second longest node link among multiple node links starting from the starting node; and based on The longest node link determines the first queue number of the directed topology graph; determines the second queue number of the directed topology graph based on the second longest node link; and then determines the directed queue number based on the first queue number and the second queue number. The coordinate space of the topology map, and the nodes are placed in the coordinate space according to the order of the node links; the nodes with connection relationships can be connected to obtain a topology map of the original data with a clear structure and high readability . In this way, the layout of the topology diagram with multiple starting points and multiple connection points can be realized, and a topology diagram with higher readability can be obtained.

附图说明Description of drawings

为了更清楚地说明本发明或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the present invention or the technical solutions in the prior art, the accompanying drawings that need to be used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the accompanying drawings in the following description are the present invention. For some embodiments of the invention, those skilled in the art can also obtain other drawings based on these drawings without creative effort.

图1是本发明提供的有向拓扑图布局方法的流程示意图之一;Fig. 1 is one of the schematic flow charts of the directed topological graph layout method provided by the present invention;

图2是本发明提供的确定起始节点的应用场景示意图;Fig. 2 is a schematic diagram of an application scenario for determining a starting node provided by the present invention;

图3是本发明提供的确定最长节点链路的应用场景示意图;Fig. 3 is a schematic diagram of an application scenario for determining the longest node link provided by the present invention;

图4是本发明提供的确定第二长节点链路的应用场景示意图;FIG. 4 is a schematic diagram of an application scenario for determining a second long node link provided by the present invention;

图5是本发明提供的基于最长节点链路,确定有向拓扑图的第一队列数的流程示意图;Fig. 5 is a schematic flow diagram of determining the first queue number of a directed topology graph based on the longest node link provided by the present invention;

图6是本发明提供的将节点按照在节点链路中的排序顺序对应落位至坐标空间的流程示意图;Fig. 6 is a schematic flow diagram of placing nodes in the coordinate space according to the sort order in the node links provided by the present invention;

图7是本发明提供的基于最长节点链路的节点的坐标,确定剩余节点的坐标的流程示意图;Fig. 7 is a schematic flow diagram of determining the coordinates of the remaining nodes based on the coordinates of the node of the longest node link provided by the present invention;

图8是本发明提供的基于第二长节点链路的节点的坐标,确定剩余节点的坐标的流程示意图;Fig. 8 is a schematic flowchart of determining the coordinates of the remaining nodes based on the coordinates of the nodes of the second long node link provided by the present invention;

图9是本发明提供的有向拓扑图布局方法的应用场景示意图;Fig. 9 is a schematic diagram of an application scenario of the directed topological graph layout method provided by the present invention;

图10是本发明提供的有向拓扑图布局装置的结构示意图;Fig. 10 is a schematic structural diagram of a directed topology graph layout device provided by the present invention;

图11是本发明提供的电子设备的结构示意图。Fig. 11 is a schematic structural diagram of an electronic device provided by the present invention.

具体实施方式Detailed ways

为使本发明的目的、技术方案和优点更加清楚,下面将结合本发明中的附图,对本发明中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the purpose, technical solutions and advantages of the present invention clearer, the technical solutions in the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the present invention. Obviously, the described embodiments are part of the embodiments of the present invention , but not all examples. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without creative efforts fall within the protection scope of the present invention.

为了进一步介绍本发明提供的有向拓扑图布局方法,下面将结合图1进行说明。In order to further introduce the directed topology graph layout method provided by the present invention, it will be described below in conjunction with FIG. 1 .

图1是本发明提供的有向拓扑图布局方法的流程示意图之一。Fig. 1 is one of the schematic flow charts of the directed topological graph layout method provided by the present invention.

在本发明一示例性实施例中,结合图1可知,有向拓扑图布局方法可以包括步骤110至步骤170,下面将分别介绍各步骤。In an exemplary embodiment of the present invention, referring to FIG. 1 , it can be seen that the directed topology graph layout method may include step 110 to step 170, and each step will be introduced below.

在步骤110中,获取原始数据,其中,原始数据包括节点和有向连线,有向连线用于对具有连接关系的节点进行连接得到节点链路。In step 110, the original data is obtained, wherein the original data includes nodes and directed links, and the directed links are used to connect nodes with a connection relationship to obtain node links.

在步骤120中,基于有向连线,在节点中确定出至少一个起始节点。In step 120, at least one starting node among the nodes is determined based on the directed link.

在一种实施例中,原始数据可以是关于网络拓扑节点的原始数据。其中,原始数据可以包括节点,以及与节点相关联的有向连线。其中,有向连线的方向表示传输方向。In one embodiment, the raw data may be raw data about network topology nodes. Wherein, the original data may include nodes and directed connections associated with the nodes. Wherein, the direction of the directed line represents the transmission direction.

在一示例中,一条有向连线可以包括起始端和终止端,有向连线的起始端和终止端可以连接有节点,也可以为空。In an example, a directed link may include a start end and an end end, and the start end and the end end of the directed link may be connected with nodes, or may be empty.

可以理解的是,对于节点A,若节点A连接在有向连线a的起始端,那么节点A还可以称为有向连线a的起始节点。若没有节点连接在有向连线a的起始端,那么有向连线a的起始为空。It can be understood that, for node A, if node A is connected to the starting end of directed link a, then node A can also be called the starting node of directed link a. If no node is connected to the start of directed link a, then the start of directed link a is empty.

对于节点A,若节点B连接在有向连线a的终止端,那么节点B还可以称为有向连线a的目标节点。若没有节点连接在有向连线a的终止端,那么有向连线a的终止为空。For node A, if node B is connected to the terminal end of directed link a, then node B can also be called the target node of directed link a. If no node is connected to the end of directed link a, then the end of directed link a is empty.

可以理解的是,所有的有向连线按照递归形式将节点进行链接,可以得到多条节点链路。It can be understood that all directed links link nodes recursively, and multiple node links can be obtained.

在一种实施例中,可以基于有向连线,确定出起始节点。其中,起始节点可以有多个。In an embodiment, the starting node may be determined based on the directed link. Among them, there can be multiple starting nodes.

在一示例中,起始节点可以是起始为空的有向连线的目标节点。图2是本发明提供的确定起始节点的应用场景示意图,结合图2可知,对于虚线框标注的节点可以理解为是起始节点。In one example, the start node may be the target node of a directed link that is initially empty. FIG. 2 is a schematic diagram of an application scenario for determining a starting node provided by the present invention. It can be seen from FIG. 2 that a node marked with a dotted line box can be understood as a starting node.

在步骤130中,在以起始节点为起点的多条节点链路中,确定最长节点链路,以及确定第二长节点链路,其中,最长节点链路中包括第一节点,第一节点与第二长节点链路的第二节点存在连接关系,第二节点为第二长节点链路的起始节点。In step 130, among the plurality of node links starting from the starting node, determine the longest node link, and determine the second long node link, wherein the longest node link includes the first node, the second longest node link A node has a connection relationship with a second node of the second long node link, and the second node is a starting node of the second long node link.

在一种实施例中,可以在以起始节点为起点的多条节点链路中,确定出最长节点链路。其中,最长节点链路可以为是含有节点数量最多的链路。图3是本发明提供的确定最长节点链路的应用场景示意图,结合图3可知,对于虚线框标注的节点链路可以理解为是最长节点链路。In an embodiment, the longest node link may be determined among multiple node links starting from the starting node. Wherein, the longest node link may be the link containing the largest number of nodes. FIG. 3 is a schematic diagram of an application scenario for determining the longest node link provided by the present invention. Combining with FIG. 3 , it can be seen that the node link marked with a dotted line box can be understood as the longest node link.

需要说明的是,当出现两条最长节点链路时,可以选择任意一条作为最终的最长节点链路,即对应本实施例中的最长节点链路。It should be noted that, when there are two longest node links, any one may be selected as the final longest node link, which corresponds to the longest node link in this embodiment.

在又一种实施例中,还可以确定出第二长节点链路。其中,第二长节点链路可以理解为是除去最长节点链路中的节点,基于剩余的节点形成的最长的节点链路。最长节点链路中的第一节点与第二长节点链路中的第二节点存在连接关系。其中,第一节点可以是最长节点链路上的任意一个节点,第二节点可以理解为是关于第二长节点链路的起始节点。In yet another embodiment, the second long node link may also be determined. Wherein, the second long node link can be understood as the longest node link formed based on the remaining nodes except the nodes in the longest node link. There is a connection relationship between the first node in the longest node link and the second node in the second longest node link. Wherein, the first node may be any node on the longest node link, and the second node may be understood as the starting node of the second longest node link.

图4是本发明提供的确定第二长节点链路的应用场景示意图,结合图4可知,对于虚线框标注的节点链路可以理解为是第二长节点链路。其中,第一节点可以对应图4中的防火墙节点,第二节点可以对应图4中的ICG节点。FIG. 4 is a schematic diagram of an application scenario for determining the second long node link provided by the present invention. Combining with FIG. 4 , it can be seen that the node link marked with a dotted line box can be understood as the 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 .

在步骤140中,基于最长节点链路,确定有向拓扑图的第一队列数。In step 140, the first queue number of the directed topology graph is determined based on the longest node link.

在本发明一示例性实施例中,继续以图1所示的实施例为例进行说明,在基于最长节点链路,确定有向拓扑图的第一队列数(对应步骤140)之前,有向拓扑图布局方法还可以包括:在最长节点链路上确定复杂节点,其中,复杂节点为连接桩的数量超过数量阈值的节点,其中,连接桩可以为节点上固定的点,用于实现节点与有向连线相连。In an exemplary embodiment of the present invention, continue to take the embodiment shown in Figure 1 as an example for description, before determining the first queue number (corresponding to step 140) of the directed topology graph based on the longest node link, there is The topology map layout method may also include: determining a complex node on the longest node link, wherein the complex node is a node whose number of connection piles exceeds a threshold value, wherein the connection piles may be fixed points on the node for realizing Nodes are connected with directed links.

在一种实施例中,数量阈值可以根据实际情况进行调整,例如可以是4,在本实施例中,不对数量阈值作具体限定。结合图3进行说明,在最长节点链路上,由于防火墙的连接桩的数量为5,超过了数量阈值,因此,可以确定防火墙节点为复杂节点。In an embodiment, the quantity threshold may be adjusted according to actual conditions, for example, it may be 4. In this embodiment, the quantity threshold is not specifically limited. To illustrate with reference to FIG. 3 , on the longest node link, since the number of connection stubs of the firewall is 5, which exceeds the number threshold, it can be determined that the firewall node is a complex node.

图5是本发明提供的基于最长节点链路,确定有向拓扑图的第一队列数的流程示意图。Fig. 5 is a schematic flowchart of determining the first queue number of a directed topology graph based on the longest node link provided by the present invention.

结合图5可知,基于最长节点链路,确定有向拓扑图的第一队列数可以包括步骤510至步骤530,下面将分别介绍各步骤。It can be seen from FIG. 5 that, based on the longest node link, determining the first number of queues in the directed topology graph may include steps 510 to 530, and each step will be introduced below.

在步骤510中,确定复杂节点的第一数量。In step 510, a first number of complex nodes is determined.

在步骤520中,确定最长节点链路中节点的第二数量。In step 520, a second number of nodes in the longest link of nodes is determined.

在步骤530中,基于第一数量和第二数量,确定有向拓扑图的第一队列数。In step 530, based on the first number and the second number, a first queue number of the directed topology graph is determined.

继续结合图3进行说明,确定出复杂节点为防火墙节点,即第一数量为1。进一步的,还可以确定最长节点链路中的节点数量(对应第二数量),例如,图3中的第二数量为5。再基于第一数量和第二数量确定出有向拓扑图的第一队列数。Continuing to describe in conjunction with FIG. 3 , it is determined that the complex node is a firewall node, that is, the first number is 1. Further, the number of nodes (corresponding to the second number) in the longest node link may also be determined, for example, the second number in FIG. 3 is 5. Then determine the first number of queues in the directed topology graph based on the first number and the second number.

在一示例中,有向拓扑图的列数可以是第一数量与第二数量之和,对于图3所述的实施例而言,确定出的有向拓扑图的第一队列数为1+5=6。在又一种实施例中,有向拓扑图的第一队列数还可以是第一数量和大于第二数量的任意一个正整数的和。在本实施例中,不对有向拓扑图的第一队列数的确定过程作具体限定。In an example, the number of columns in the directed topological graph may be the sum of the first number and the second number. For the embodiment described in FIG. 3 , the determined first number of queues in the directed topological graph is 1+ 5=6. In yet another embodiment, the first number of queues in the directed topology graph may also be the sum of the first number and any positive integer greater than the second number. In this embodiment, the process of determining the first number of queues in the directed topology graph is not specifically limited.

在步骤150中,基于第二长节点链路,确定有向拓扑图的第二队列数,其中,第一队列沿第一方向设置,第二队列沿第二方向设置,第一方向和第二方向呈预设角度。In step 150, based on the second long node link, determine the second queue number of the directed topology graph, wherein the first queue is set along the first direction, the second queue is set along the second direction, the first direction and the second Orientation is at a preset angle.

需要说明的是,预设角度可以根据实际情况进行调整,在本实施例中不对预设角度作具体限定。It should be noted that the preset angle can be adjusted according to actual conditions, and the preset angle is not specifically limited in this embodiment.

在本申请一示例性实施例中,第一方向和第二方向呈预设角度可以采用以下方式实现:In an exemplary embodiment of the present application, the preset angle between the first direction and the second direction may be implemented in the following manner:

第一方向和第二方向呈90度角。其中,第一方向为有向拓扑图的各列所指示的方向且第二方向为有向拓扑图的各行所指示的方向;或者第一方向为有向拓扑图的各行所指示的方向且第二方向为有向拓扑图的各列所指示的方向。可以理解的是,将第一方向和第二方向设置为呈90度角,可以确保得到的拓扑图横平竖直,进一步提高了拓扑图的可读性。The first direction and the second direction form an angle of 90 degrees. Wherein, the first direction is the direction indicated by each column of the directed topological map and the second direction is the direction indicated by each row of the directed topological map; or the first direction is the direction indicated by each row of the directed topological map and the second direction is the direction indicated by each row of the directed topological map The two directions are the directions indicated by the columns of the directed topology graph. It can be understood that setting the first direction and the second direction to form an angle of 90 degrees can ensure that the obtained topological map is horizontal and vertical, further improving the readability of the topological map.

其中,第一队列数可以是指有向拓扑图的列数且第二队列数可以是指有向拓扑图的行数;或者,第一队列数可以是指有向拓扑图的行数且第二队列数可以是指有向拓扑图的列数。Wherein, the first queue number may refer to the column number of the directed topology graph and the second queue number may refer to the row number of the directed topology graph; or, the first queue number may refer to the row number of the directed topology graph and the second queue number may refer to the row number of the directed topology graph The second number of queues may refer to the number of columns in the directed topology graph.

节点的第一方向坐标可以是指沿有向拓扑图的各列所指示的方向的坐标(对应坐标空间中的纵坐标)且节点的第二方向坐标可以是指沿有向拓扑图的各行所指示的方向的坐标(对应坐标空间中的横坐标);或者节点的第一方向坐标可以是指沿有向拓扑图的各行所指示的方向的坐标(对应坐标空间中的横坐标)且节点的第二方向坐标可以是指沿有向拓扑图的各列所指示的方向的坐标(对应坐标空间中的纵坐标)。The first direction coordinates of the nodes may refer to the coordinates along the directions indicated by the columns of the directed topology graph (corresponding to the ordinate in the coordinate space) and the second direction coordinates of the nodes may refer to the coordinates along the directions indicated by the rows of the directed topology graph. The coordinates of the indicated direction (corresponding to the abscissa in the coordinate space); or the first direction coordinates of the node may refer to the coordinates of the direction indicated along the rows of the directed topology graph (corresponding to the abscissa in the coordinate space) and the node's The second direction coordinates may refer to coordinates along the directions indicated by the columns of the directed topology map (corresponding to the ordinate in the coordinate space).

为了便于说明,在本发明中将以第一队列数是指有向拓扑图的列数且第二队列数是指有向拓扑图的行数,以及节点的第一方向坐标是指沿有向拓扑图的各列所指示的方向的坐标(对应坐标空间中的纵坐标)且节点的第二方向坐标是指沿有向拓扑图的各行所指示的方向的坐标(对应坐标空间中的横坐标)为例进行说明。For ease of description, in the present invention, the first queue number refers to the column number of the directed topology graph and the second queue number refers to the row number of the directed topology graph, and the first direction coordinate of the node refers to the row number along the directed topological graph. The coordinates of the direction indicated by each column of the topology map (the ordinate in the corresponding coordinate space) and the second direction coordinates of the node refer to the coordinates along the direction indicated by each row of the directed topology map (the abscissa in the corresponding coordinate space ) as an example for illustration.

在一种实施例中,基于第二长节点链路,确定有向拓扑图的第二队列数可以采用以下方式实现:In one embodiment, based on the second long node link, determining the second queue number of the directed topology graph may be implemented in the following manner:

确定第二长节点链路中节点的第三数量;determining a third number of nodes in the second long node link;

基于第三数量,确定有向拓扑图的第二队列数。Based on the third quantity, the second queue quantity of the directed topology graph is determined.

继续结合图4行说明,可以确定第二长节点链路中的节点数量(对应第三数量),例如,图4中的第三数量为2。进一步的,可以基于第三数量确定出有向拓扑图的第二队列数。在一示例中,有向拓扑图的第二队列数可以为第三数量*2+1。对于图4所示的实施例而言,确定出的有向拓扑图的第二队列数为2*2+1=5。Continuing with the description in FIG. 4 , the number of nodes (corresponding to the third number) in the second long node link may be determined, for example, the third number in FIG. 4 is 2. Further, the second queue number of the directed topology graph may be determined based on the third number. In an example, the second number of queues in the directed topology graph may be the third number*2+1. For the embodiment shown in FIG. 4 , the determined second queue number of the directed topology graph is 2*2+1=5.

在步骤160中,基于第一队列数和第二队列数,确定有向拓扑图的坐标空间,并将节点按照在节点链路中的排序顺序对应落位至坐标空间。In step 160, based on the first number of queues and the second number of queues, the coordinate space of the directed topology graph is determined, and the nodes are correspondingly placed in the coordinate space according to the sort order in the node links.

在步骤170中,将存在连接关系的节点进行连接。In step 170, connect the nodes with connection relationship.

在一种实施例中,基于确定的有向拓扑图的列数和行数,可以确定出有向拓扑图的坐标空间。其中,图9是本发明提供的有向拓扑图布局方法的应用场景示意图,可以基于列数(对应第一队列数)和行数(对应第二队列数),确定坐标空间。在图9所示的坐标空间中,单位长度可以是100。In an embodiment, based on the determined number of columns and rows of the directed topological graph, the coordinate space of the directed topological graph can be determined. Among them, FIG. 9 is a schematic diagram of an application scenario of the directed topological graph layout method provided by the present invention, and the coordinate space can be determined based on the number of columns (corresponding to the number of first queues) and the number of rows (corresponding to the number of second queues). 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 topological graph, all nodes related to the original data can be correspondingly placed in the coordinate space according to the sort order in the respective node links, and the Nodes are connected through the connection piles set on the nodes. In this way, it is possible to realize the layout of the topology map with multiple starting points and multiple connection points, and obtain a more readable topology map with horizontal and vertical node positions and a clear structure.

需要说明的是,存在连接关系的节点包括节点与节点之间,也可以包括节点与空位置之间。连接关系可以由有向连线来体现。结合图9进行说明,关于零信任TAC节点,与该节点存在连线关系的另一端可以是空。It should be noted that the nodes with a connection relationship include between nodes and between nodes, and may also include between nodes and empty positions. A connection relationship can be represented by a directed connection. To illustrate with reference to FIG. 9 , regarding a zero-trust TAC node, the other end of the connection relationship with the node may be empty.

本发明提供的有向拓扑图布局方法,通过在以起始节点为起点的多条节点链路中确定最长节点链路和第二长节点链路;并基于最长节点链路确定有向拓扑图的第一队列数;基于第二长节点链路确定有向拓扑图的第二队列数;再基于第一队列数和第二队列数可以确定出有向拓扑图的坐标空间,并将节点按照在节点链路中的排序顺序对应落位至坐标空间;将存在连接关系的节点进行连接,从而可以得到结构清晰、可读性高的关于原始数据的拓扑图。以此可以实现对多起点、多连接点的拓扑图进行布局,得到具有更高可读性的拓扑图。The directed topological graph layout method provided by the present invention determines the longest node link and the second longest node link among multiple node links starting from the starting node; and determines the directed The first queue number of the topology graph; determine the second queue number of the directed topology graph based on the second long node link; then determine the coordinate space of the directed topology graph based on the first queue number and the second queue number, and The nodes are correspondingly placed in the coordinate space according to the sorting order in the node link; the nodes with connection relationship are connected, so that a topology map of the original data with clear structure and high readability can be obtained. In this way, the layout of the topology diagram with multiple starting points and multiple connection points can be realized, and a topology diagram with higher readability can be obtained.

为了进一步介绍本发明提供的有向拓扑图布局方法,下面将结合下述实施例对将节点按照在节点链路中的排序顺序对应落位至坐标空间的过程进行说明。In order to further introduce the directed topological graph layout method provided by the present invention, the process of placing nodes in the coordinate space correspondingly according to the sort order in the node links will be described below in conjunction with the following embodiments.

图6是本发明提供的将节点按照在节点链路中的排序顺序对应落位至坐标空间的流程示意图。Fig. 6 is a schematic flow chart of placing nodes in the coordinate space according to the sort order in the node link provided by the present invention.

在本发明一示例性实施例中,结合图6可知,将节点按照在节点链路中的排序顺序对应落位至坐标空间可以包括步骤610至步骤680,下面将分别介绍各步骤。In an exemplary embodiment of the present invention, referring to FIG. 6 , it can be known that correspondingly placing nodes in the coordinate space according to the sorting order in the node link may include steps 610 to 680, and the steps will be introduced below.

在步骤610中,在复杂节点的第一数量大于零的情况下,将最长节点链路设置在坐标空间的第二队列中的中间队列。In step 610, in case the first number of complex nodes is greater than zero, the longest node link is set in the middle queue of the second queue in the coordinate space.

在一种实施例中,第二队列以坐标空间的行为例进行说明,因此,坐标空间中的第二队列中的中间队列是指坐标空间的中间行。In one embodiment, the second queue is described by taking the behavior of the coordinate space as an example. Therefore, the middle queue in the second queue in the coordinate space refers to the middle row in the coordinate space.

可以判断复杂节点的第一数量,如果第一数量大于零,即存在复杂节点的情况下,可以将最长节点链路设置在坐标空间的中间行。结合图9进行说明,由于存在复杂节点(防火墙节点),因此,基于前述确定的坐标空间的行数为5行,可以将最长节点链路设置在坐标空间的第三行。The first number of complex nodes can be determined, and if the first number is greater than zero, that is, if there are complex nodes, the longest node link can be set in the middle row of the coordinate space. To illustrate with reference to FIG. 9 , since there are complex nodes (firewall nodes), based on the previously determined number of rows in the coordinate space is 5 rows, the longest node link can be set in the third row of the coordinate space.

在又一种实施例中,如果第一数量为零,即不存在复杂节点。可以理解的是,在此场景下,与复杂节点相连接的其他节点在不遮挡其他节点排布的情况下,均可以在最长节点链路之下排布开,因此,可以将最长节点链路设置在坐标空间的第一行。In yet another embodiment, if the first number is zero, there are no complex nodes. It can be understood that in this scenario, other nodes connected to complex nodes can be arranged under the longest node link without blocking the arrangement of other nodes. Therefore, the longest node can be Links are set on the first row of the coordinate space.

通过本实施例,可以将确保所有的节点有效铺排开而不会被其他节点所遮挡,进而为得到横平竖直、结构清晰、可读性高的关于原始数据的拓扑图打下基础。Through this embodiment, it is possible to ensure that all nodes are effectively laid out without being blocked by other nodes, thereby laying a foundation for obtaining a topological diagram of original data that is horizontal, vertical, clear in structure, and highly readable.

在步骤620中,提取最长节点链路中各节点,并按照节点在最长节点链路中的排序顺序,在中间队列遍历设置节点的坐标,其中,节点的第一方向坐标固定,节点的第二方向坐标按照预设数值递增。In step 620, each node in the longest node link is extracted, and according to the sorting order of the nodes in the longest node link, the coordinates of the nodes are traversed in the intermediate queue, wherein the first direction coordinates of the nodes are fixed, and the coordinates of the nodes are set. The coordinates of the second direction are incremented according to a preset value.

在一种实施例中,可以提取出最长节点链路中的各个节点,并按照节点在最长节点链路中的排列顺序,在坐标空间的中间行遍历设置节点的坐标。在一示例中,可以从最长节点链路中的起始节点为起始,依次设置各个节点至中间行,其中,各个节点的纵坐标相同,横坐标按照预设数值递增。其中,预设数值可以根据实际情况进行调整,例如,可以是100,在本实施例中,不对预设数值作具体限定。In one embodiment, each node in the longest node link can be extracted, and the coordinates of the nodes can be set in the middle row of the coordinate space according to the arrangement order of the nodes in the longest node link. In an example, starting from the starting node in the longest node link, each node can be set in sequence to the middle row, wherein the vertical coordinates of each node are the same, and the horizontal coordinates increase according to a preset value. Wherein, the preset value can be adjusted according to the actual situation, for example, it can be 100, and in this embodiment, the preset value is not specifically limited.

在本发明又一示例性实施例中,按照节点在最长节点链路中的排序顺序,在中间队列遍历设置节点的坐标,还可以采用以下方式实现:In yet another exemplary embodiment of the present invention, according to the sorting order of the nodes in the longest node link, traversing and setting the coordinates of the nodes in the intermediate queue can also be implemented in the following manner:

按照节点在最长节点链路中的排序顺序,确定出复杂节点的下一节点;Determine the next node of the complex node according to the sorting order of the nodes in the longest node link;

相比于复杂节点的第二方向坐标,在中间队列设置复杂节点的下一节点的第二方向坐标时,按照预设数值的预设倍数进行递增。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 intermediate queue, it is incremented according to the preset multiple of the preset value.

在一种实施例中,继续结合图9所示的实施例进行说明,由于复杂节点(例如防火墙节点)的连接桩数量超过了4个,那么在对与该复杂节点进行连接的其他节点,例如SDWA节点,可能存在与该SDWA节点连接有其他节点的情况。为了保证各自连接的节点不会彼此遮挡,在对复杂节点的下一节点(对应图9中的流量计节点)的横坐标进行设置时,可以按照预设数值的两倍进行递增,从而可以在防火墙节点和流量计节点之间空出一个空位,为与SDWA节点相连接的节点提供空间。In one embodiment, continue to describe in conjunction with the embodiment shown in FIG. 9 , since the number of connection stubs of a complex node (such as a firewall node) exceeds four, then other nodes connected to the complex node, such as SDWA node, there may be other nodes connected to the SDWA node. In order to ensure that the connected nodes will not block each other, when setting the abscissa of the next node of the complex node (corresponding to the flow meter node in Figure 9), it can be incremented by twice the preset value, so that the A space is left between the firewall node and the flow meter node to provide space for the node connected to the SDWA node.

在步骤630中,基于最长节点链路中的第一节点的第二方向坐标,确定第二长节点链路中第二节点的第二方向坐标。In step 630, based on the second directional coordinates of the first node in the longest node link, the second directional coordinate of the second node in the second longest node link is determined.

需要说明的是,最长节点链路中的第一节点与第二长节点链路中的第二节点存在连接关系。其中,第一节点可以是最长节点链路上的任意一个节点,第二节点可以理解为是关于第二长节点链路的起始节点。结合图9可知,第一节点可以对应图9中的防火墙节点,第二节点可以对应图9中的ICG节点。It should be noted that there is a connection relationship between the first node in the longest node link and the second node in the second longest node link. Wherein, the first node may be any node on the longest node link, and the second node may be understood as the starting node of the second longest node link. It can be seen from FIG. 9 that 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 an 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, based on the abscissa of the first node in the longest node link, the abscissa of the second node in the second longest node link is determined, which can effectively ensure that the lines in the formed topology diagram are horizontal and vertical Straight, which can improve the readability of the formed topology map.

在步骤640中,将第二长节点链路设置在坐标空间的目标队列,其中,目标队列为第二节点的第二方向坐标所在的队列。In step 640, set the second long node link in the target queue of the coordinate space, wherein the target queue is the queue where the second direction coordinate of the second node is located.

在步骤650中,提取第二长节点链路中各节点,并按照节点在第二长节点链路中的排列顺序,在目标队列遍历设置节点的坐标,其中,节点的第二方向坐标固定,节点的第一方向坐标按照预设数值递增。In step 650, each node in the second long node link is extracted, and according to the arrangement order of the nodes in the second long node link, the coordinates of the set nodes are traversed in the target queue, wherein the second direction coordinates of the nodes are fixed, The first direction coordinate of the node is incremented according to the preset value.

在一种实施例中,可以将第二长节点链路设置在坐标空间的目标队列,其中,目标队列可以是指第二节点的横坐标所在的列。结合图9进行说明,目标队列可以是ICG节点所在的列。In an embodiment, the second long node link may be set in a target queue in the coordinate space, where the target queue may refer to the column where the abscissa of the second node is located. For illustration with reference to FIG. 9 , the target queue may be the column where the ICG node is located.

进一步的,可以提取出第二长节点链路中各节点,并按照节点在第二长节点链路中的排列顺序,在目标队列遍历设置节点的坐标。在一示例中,可以从第二长节点链路中的第二节点为起始,依次设置各个节点至目标队列,其中,各个节点的横坐标相同,纵坐标按照预设数值递增。其中,预设数值可以根据实际情况进行调整,例如,可以是100,在本实施例中,不对预设数值作具体限定。Further, each node in the second long node link may be extracted, and the coordinates of the nodes are traversed in the target queue according to the arrangement order of the nodes in the second long node link. In an example, starting from the second node in the second long node link, each node can be sequentially set to the target queue, wherein the abscissa of each node is the same, and the ordinate increases according to a preset value. Wherein, the preset value can be adjusted according to the actual situation, for example, it can be 100, and in this embodiment, the preset value is not specifically limited.

在步骤660中,提取剩余节点,其中,剩余节点为除最长节点链路的节点和第二长节点链路的节点之外的其他节点。In step 660, the remaining nodes are extracted, wherein the remaining nodes are other nodes except the node of the longest node link and the node of the second longest node link.

在步骤670中,基于最长节点链路的节点的坐标,或第二长节点链路的节点的坐标,确定剩余节点的坐标。In step 670, the coordinates of the remaining nodes are determined based on the coordinates of the nodes of the longest node link, or the coordinates of the nodes of the second longest node link.

在一种实施例中,可以确定剩余节点在坐标空间中的坐标。其中,剩余节点可以理解为是除去最长节点链路的节点和第二长节点链路的节点之外的其他节点。继续结合图9进行说明,剩余节点可以包括零信任TAC节点、CSMP节点、SDWA节点、VCPE节点和大禹节点。In one embodiment, the coordinates of the remaining nodes in the coordinate space can be determined. Wherein, the remaining nodes may be understood as other nodes except the node of the longest node link and the node of the second longest node link. Continuing to describe in conjunction with FIG. 9 , the remaining nodes may include zero-trust TAC nodes, CSMP nodes, SDWA nodes, VCPE nodes, and Dayu nodes.

进一步的,由于剩余节点与最长节点链路中的节点,或与第二长节点链路上的节点相连接,因此,可以基于最长节点链路的节点坐标,或第二长节点链路的节点坐标确定剩余节点的坐标。Further, since the remaining nodes are connected to nodes in the longest node link, or to nodes on the second long node link, it can be based on the node coordinates of the longest node link, or the second long node link The node coordinates of determine the coordinates of the remaining nodes.

在步骤680中,提取游离的起始节点,并将游离的起始节点依次设置在坐标空间的第一队列中的起始队列,其中,游离的起始节点为未与其他节点存在连接关系的起始节点。In step 680, extract the free start node, and set the free start node in the start queue in the first queue in the coordinate space in turn, wherein the free start node is not connected with other nodes starting node.

需要说明的是,若第一队列是指坐标空间中的列,那么,坐标空间的第一队列中的起始队列可以指坐标空间的第一列。在本发明中,为了便于说明,将以第一队列中的起始队列是指坐标空间的第一列为例进行说明。It should be noted that if the first queue refers to a column in the coordinate space, then the starting queue in the first queue in the coordinate space may refer to the first column in the coordinate space. In the present invention, for the convenience of description, it will be described by taking that the starting queue in the first queue refers to the first column in the coordinate space as an example.

在又一种实施例中,还可以在剩余节点中确定出游离的起始节点,例如,零信任TAC节点。可以将游离的起始节点依次设置在坐标空间的第一列。In yet another embodiment, a detached starting node may also be determined among the remaining nodes, for example, a zero-trust TAC node. The free starting nodes can be sequentially set in the first column of the coordinate space.

为了进一步介绍本发明提供的基于最长节点链路的节点的坐标,确定剩余节点的坐标的过程,下面将结合下述实施例进行说明。In order to further introduce the process of determining the coordinates of the remaining nodes based on the coordinates of the longest node link provided by the present invention, the following will be described in conjunction with the following embodiments.

图7是本发明提供的基于最长节点链路的节点的坐标,确定剩余节点的坐标的流程示意图。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 provided by the present invention.

在本发明一示例性实施例中,结合图7可知,基于最长节点链路的节点的坐标,确定剩余节点的坐标可以包括步骤710至步骤740,下面将分别介绍各步骤。In an exemplary embodiment of the present invention, referring to FIG. 7 , it can be seen that based on the coordinates of the node of the longest node link, determining the coordinates of the remaining nodes may include steps 710 to 740, and each step will be introduced below.

在步骤710中,在剩余节点中确定出与最长节点链路中的节点存在连接关系的第一剩余节点,并基于最长节点链路中的节点的第二方向坐标,确定第一剩余节点的第二方向坐标。In step 710, determine the first remaining node that has a connection relationship with the node in the longest node link among the remaining nodes, and determine the first remaining node based on the second direction coordinates of the nodes in the longest node link The second direction coordinates of .

在一种实施例中,可以在剩余节点中确定出与最长节点链路中的节点存在连接关系的第一剩余节点。继续结合图9进行说明,第一剩节点可以是CSMP节点、VCPE节点、大禹节点等。在应用过程中,可以基于最长节点链路中的节点的横坐标确定出第一剩余节点的横坐标。其中,第一剩余节点可以理解为是第一剩余节点链路的起始节点。In an embodiment, the first remaining node that has a connection relationship with the node in the longest node link may be determined among the remaining nodes. Continuing to describe with reference to FIG. 9 , the first remaining node may be a CSMP node, a VCPE node, a Dayu node, and the like. During the application process, the abscissa of the first remaining node may be determined based on the abscissa 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.

在一示例中,对于最长节点链路中的WAF节点,可以基于WAF节点的横坐标确定出VCPE节点的横坐标,例如,最长节点链路中的WAF节点的横坐标与第一剩余节点(VCPE节点)的横坐标相同。In an example, for the WAF node in the longest node link, the abscissa of the VCPE node can be determined based on the abscissa of the WAF node, for example, the abscissa of the WAF node in the longest node link is the same as the first remaining node (VCPE nodes) have the same abscissa.

在又一示例中,对于最长节点链路中的防火墙节点,可以基于防火墙节点的横坐标确定出大禹节点的横坐标。例如,最长节点链路中的防火墙节点的横坐标与第一剩余节点(大禹节点)的横坐标相差单位长度。In yet another example, for the firewall node in the longest node link, the abscissa of the Dayu node may be determined based on the abscissa of the firewall node. For example, the abscissa of the firewall node in the longest node link is different from the abscissa of the first remaining node (Dayu node) by unit length.

在步骤720中,确定包括第一剩余节点的第一剩余节点链路,其中,第一剩余节点链路中的节点为剩余节点中的节点。In step 720, a first remaining node link including the first remaining node is determined, wherein a node in the first remaining node link is a node in the remaining nodes.

在步骤730中,将第一剩余节点链路设置在坐标空间的第一剩余节点链路队列,其中,第一剩余节点链路队列为第一剩余节点的第二方向坐标所在的队列。In step 730, set the first remaining node link in the first remaining node link queue in the coordinate space, wherein the first remaining node link queue is the queue where the second direction coordinates of the first remaining node are located.

在步骤740中,提取第一剩余节点链路中各节点,并按照所述节点在所述第一剩余节点链路中的排列顺序,在第一剩余节点链路队列遍历设置节点的坐标,其中,节点的第二方向坐标固定,节点的第一方向坐标按照预设数值递增或递减。In step 740, each node in the first remaining node link is extracted, and according to the arrangement order of the nodes in the first remaining node link, the coordinates of the nodes are traversed in the first remaining node link queue, wherein , the second direction coordinate of the node is fixed, and the first direction coordinate of the node increases or decreases according to the preset value.

需要说明的是,若第二方向坐标是指横坐标,那么,第一剩余节点链路队列可以理解为是第一剩余节点的横坐标所在的队列。It should be noted that if the second direction coordinate refers to the abscissa, then the first remaining node link queue can be understood as the queue where the abscissa of the first remaining node is located.

在一种实施例中,可以确定出包括第一剩余节点的第一剩余节点链路,其中,第一剩余节点链路中的各节点均为剩余节点中的节点。进一步的,将第一剩余节点链路设置在坐标空间的第一剩余节点链路队列,其中,第一剩余节点链路队列为第一剩余节点的横坐标所在的列。结合图9进行说明,第一剩余节点链路队列可以是VCPE节点所在的列,还可以是大禹节点所在的列。In an embodiment, a first remaining node link including the first remaining node may be determined, where each node in the first remaining node link is a node in the remaining nodes. Further, the first remaining node link is set in the first remaining node link queue in the coordinate space, wherein the first remaining node link queue is the column where the abscissa of the first remaining node is located. For illustration with reference to FIG. 9 , the first remaining node link queue may be the column where the VCPE node is located, and may also be the column where the Dayu node is located.

进一步的,可以提取第一剩余节点链路中各节点,并按照节点在第一剩余节点链路中的排列顺序,在第一剩余节点链路队列遍历设置节点的坐标。Further, each node in the first remaining node link may be extracted, and the coordinates of the nodes are set in the queue of the first remaining node link according to the arrangement sequence of the nodes in the first remaining node link.

在一示例中,可以从第一剩余节点链路中的第一剩余节点为起始,依次设置其他节点至第一剩余节点链路队列,其中,各个节点的横坐标相同,纵坐标按照预设数值递增或递减。其中,预设数值可以根据实际情况进行调整,例如,可以是100,在本实施例中,不对预设数值作具体限定。In an example, starting from the first remaining node in the first remaining node link, other nodes can be sequentially set to the first remaining node link queue, wherein the abscissa of each node is the same, and the ordinate follows the preset The value is incremented or decremented. Wherein, the preset value can be adjusted according to the actual situation, for example, it can be 100, and in this embodiment, the preset value is not specifically limited.

在又一种实施例中,若第一剩余节点是与复杂节点存在连接关系,此时可以将第一剩余节点设置在最长节点链路所在的行之上。继续结合图9进行说明,对于CSMP节点(第一剩余节点),可以将CSMP节点设置在最长节点链路所在的行之上。In yet another embodiment, if the first remaining node has a connection relationship with the complex node, then the first remaining node may be set on the row where the longest node link is located. Continuing to describe with reference to FIG. 9 , for the CSMP node (the first remaining node), the CSMP node may be set above the row where the longest node link is located.

通过本实施例,可以将剩余节点依次设置在有向拓扑图的坐标空间中,并确保各个节点之间不会彼此遮挡,为提高有向拓扑图的可读性打下基础。Through this embodiment, the remaining nodes can be sequentially arranged in the coordinate space of the directed topological graph, and it is ensured that the nodes do not block each other, laying a foundation for improving the readability of the directed topological graph.

为了进一步介绍本发明提供的基于第二长节点链路的节点的坐标,确定剩余节点的坐标的过程,下面将结合下述实施例进行说明。In order to further introduce the process of determining the coordinates of the remaining nodes based on the coordinates of the nodes of the second long node link provided by the present invention, the following will be described in conjunction with the following embodiments.

图8是本发明提供的基于第二长节点链路的节点的坐标,确定剩余节点的坐标的流程示意图。FIG. 8 is a schematic flowchart of determining the coordinates of remaining nodes based on the coordinates of the nodes of the second long node link provided by the present invention.

在本发明一示例性实施例中,结合图8可知,基于第二长节点链路的节点的坐标,确定剩余节点的坐标可以包括步骤810至步骤840,下面将分别介绍各步骤。In an exemplary embodiment of the present invention, it can be known with reference to FIG. 8 that 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, and each step will be introduced below.

在步骤810中,在剩余节点中确定出与第二长节点链路中的节点存在连接关系的第二剩余节点,并基于第二长节点链路中的节点的第一方向坐标,确定第二剩余节点的第一方向坐标。In step 810, a second remaining node that has a connection relationship with a node in the second long node link is determined among the remaining nodes, and based on the first direction coordinates of the nodes in the second long node link, the second The first direction coordinates of the remaining nodes.

在一种实施例中,可以在剩余节点中确定出与第二长节点链路中的节点存在连接关系的第二剩余节点。在应用过程中,可以基于第二长节点链路中的节点的纵坐标确定出第二剩余节点的纵坐标。其中,第二剩余节点可以理解为是第二剩余节点链路的起始节点。In an embodiment, a second remaining node that has a connection relationship with a node in the second long node link may be determined among the remaining nodes. During the application process, the vertical coordinates of the second remaining nodes may be determined based on the vertical coordinates of the nodes in the second long node link. Wherein, the second remaining node may be understood as the starting node of the second remaining node link.

在步骤820中,确定包括第二剩余节点的第二剩余节点链路,其中,第二剩余节点链路中的节点为剩余节点中的节点。In step 820, a second remaining node link including the second remaining node is determined, wherein a node in the second remaining node link is a node in the remaining node.

在步骤830中,将第二剩余节点链路设置在坐标空间的第二剩余节点链路队列,其中,第二剩余节点链路队列为第二剩余节点的第一方向坐标所在的队列。In step 830, set the second remaining node link in the second remaining node link queue in the coordinate space, wherein the second remaining node link queue is the queue where the first direction coordinates of the second remaining node are located.

在步骤840中,提取第二剩余节点链路中的各节点,并按照节点在第二剩余节点链路中的排列顺序,在第二剩余节点链路队列遍历设置节点的坐标,其中,节点的第一方向坐标固定,节点的第二方向坐标按照预设数值递增或递减。In step 840, each node in the second remaining node link is extracted, and according to the order in which the nodes are arranged in the second remaining node link, the coordinates of the nodes are traversed in the second remaining node link queue, wherein the node's The coordinates in the first direction are fixed, and the coordinates in the second direction of the node increase or decrease according to the preset value.

需要说明的是,若第一方向坐标表示纵坐标,那么,第一方向坐标所在的队列可以理解为是纵坐标所在的行。为了便于说明,下面将以第一方向坐标所在的队列为纵坐标所在的行为例进行说明。It should be noted that if the first direction coordinate represents the ordinate, then the queue where the first direction coordinate is located can be understood as the row where the ordinate is located. For the convenience of description, the queue where the first direction coordinate is located is taken as an example of the behavior where the vertical coordinate is located.

在一种实施例中,可以确定出包括第二剩余节点的第二剩余节点链路,其中,第二剩余节点链路中的各节点均为剩余节点中的节点。进一步的,将第二剩余节点链路设置在坐标空间的第二剩余节点链路队列,其中,第二剩余节点链路队列为第二剩余节点的纵坐标所在的行。In an embodiment, a second remaining node link including the second remaining node may be determined, where each node in the second remaining node link is a node in the remaining node. Further, the second remaining node link is set in the second remaining node link queue in the coordinate space, wherein the second remaining node link queue is the row where the ordinate of the second remaining node is located.

进一步的,可以提取第二剩余节点链路中各节点,并按照节点在第二剩余节点链路中的排列顺序,在第二剩余节点链路队列遍历设置节点的坐标。Further, each node in the second remaining node link may be extracted, and the coordinates of the nodes are set in the queue of the second remaining node link according to the arrangement order of the nodes in the second remaining node link.

在一示例中,可以从第二剩余节点链路中的第二剩余节点为起始,依次设置其他节点至第二剩余节点链路队列,其中,各个节点的纵坐标相同,横坐标按照预设数值递增或递减。其中,预设数值可以根据实际情况进行调整,例如,可以是100,在本实施例中,不对预设数值作具体限定。In an example, starting from the second remaining node in the second remaining node link, other nodes can be sequentially set to the second remaining node link queue, wherein the vertical coordinates of each node are the same, and the horizontal coordinates follow the preset The value is incremented or decremented. Wherein, the preset value can be adjusted according to the actual situation, for example, it can be 100, and in this embodiment, the preset value is not specifically limited.

通过本实施例,可以将剩余节点依次设置在有向拓扑图的坐标空间中,并确保各个节点之间不会彼此遮挡,为提高有向拓扑图的可读性打下基础。Through this embodiment, the remaining nodes can be sequentially arranged in the coordinate space of the directed topological graph, and it is ensured that the nodes do not block each other, laying a foundation for improving the readability of the directed topological graph.

在本发明又一示例性实施例中,将存在连接关系的节点进行连接可以采用以下方式实现:In yet another exemplary embodiment of the present invention, connecting nodes that have a connection relationship can be implemented in the following manner:

通过设置在节点上的连接桩与有向连线相连,并基于有向连线实现节点与存在连接关系的其他节点进行连接,其中,连接桩在节点上的位置分布可以采用以下方式确定:The connection piles set on the nodes are connected with the directed lines, and based on the directed lines, the nodes are connected with other nodes that have a connection relationship. The position distribution of the connection piles on the nodes can be determined in the following way:

确定节点的连接桩的数量;Determine the number of connected stubs of the node;

基于预先设置的映射表,确定各个节点中各个连接桩在节点上的位置分布,其中,映射表中包括连接桩的数量与各个连接桩在节点上的位置分布的对应关系,连接桩按照预设位置顺序在节点上均匀分布。Based on the preset mapping table, the position distribution of each connection pile on the node in each node is determined. The positional order is evenly distributed over the nodes.

在一种实施例中,为了确保各个节点上的连接桩的位置分布的规整性,可以预先设置映射表,并基于映射表,确定各个节点中各个连接桩在节点上的位置分布,其中,连接桩按照预设位置顺序在节点上均匀分布。在一示例中,映射表可以如表1所示。In one embodiment, in order to ensure the regularity of the position distribution of the connection piles on each node, a mapping table can be set in advance, and based on the mapping table, the position distribution of each connection pile in each node on the node is determined, wherein the connection The piles are evenly distributed on the nodes in a preset position order. In an example, the mapping table may be as shown in Table 1.

表1连接桩的数量与各个连接桩在节点上的位置分布关系Table 1 The relationship between the number of connection piles and the position distribution of each connection pile on the node

连接桩数量Number of connecting piles 连接桩的位置分布(角度)Location distribution of connecting piles (angle) 11 [180][180] 22 [180,0][180,0] 33 [180,270,0][180,270,0] 44 [180,270,0,90][180,270,0,90] 55 [180,270,315,0,90][180,270,315,0,90] 66 [180,270,315,0,45,90][180,270,315,0,45,90] 77 [180,270,315,0,45,90,135][180,270,315,0,45,90,135] 88 [180,270,315,0,45,90,135,225][180,270,315,0,45,90,135,225]

在又一种实施例中,连接桩还可以设置在各个节点的边缘侧。在应用过程中,以节点为圆形形状为例,可以基于节点的半径,以及连接桩的位置分布,确定出连接桩的坐标。进一步的,将存在连接关系的节点通过设置在节点上的连接桩进行连接。In yet another embodiment, the connecting piles may also be arranged on the edge side of each node. 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 nodes and the position distribution of the connecting piles. Further, the nodes having the connection relationship are connected through the connection piles set on the nodes.

在又一实施例中,连接桩还可以设置在节点的内部,在本实施例中,不对连接桩的具体设置位置做限定,但要求限定连接桩的位置分布,以确保各个节点不会彼此遮挡,以及连接线不会彼此重叠,从而可以提高最终形成的有向拓扑图的可读性。In yet another embodiment, the connection piles can also be set inside the nodes. In this embodiment, the specific setting positions of the connection piles are not limited, but the position distribution of the connection piles is required to be limited to ensure that each node will not block each other , and the connecting lines do not overlap each other, which improves the readability of the resulting directed topology graph.

根据上述描述可知,本发明提供的有向拓扑图布局方法,通过在以起始节点为起点的多条节点链路中确定最长节点链路和第二长节点链路;并基于最长节点链路确定有向拓扑图的第一队列数;基于第二长节点链路确定有向拓扑图的第二队列数;再基于第一队列数和第二队列数可以确定出有向拓扑图的坐标空间,并将节点按照在节点链路中的排序顺序对应落位至坐标空间;将存在连接关系的节点进行连接,可以得到结构清晰、可读性高的关于原始数据的拓扑图。以此可以实现对多起点、多连接点的拓扑图进行布局,能够得到具有更高可读性的拓扑图。According to the above description, it can be seen that the directed topological graph layout method provided by the present invention determines the longest node link and the second longest node link among multiple node links starting from the starting node; and based on the longest node The link determines the first queue number of the directed topology graph; determines the second queue number of the directed topology graph based on the second long node link; and then determines the directed topology graph based on the first queue number and the second queue number Coordinate space, and the nodes are placed in the coordinate space according to the sort order in the node link; connect the nodes with connection relationship, and you can get a topology map of the original data with clear structure and high readability. In this way, the layout of the topology diagram with multiple starting points and multiple connection points can be realized, and a topology diagram with higher readability can be obtained.

基于相同的构思,本发明还提供一种有向拓扑图布局装置。Based on the same idea, the present invention also provides a directed topological graph layout device.

下面对本发明提供的有向拓扑图布局装置进行描述,下文描述的有向拓扑图布局装置与上文描述的有向拓扑图布局方法可相互对应参照。The directed topological graph layout device provided by the present invention is described below, and the directed topological graph layout device described below and the directed topological graph layout method described above can be referred to in correspondence with each other.

图10是本发明提供的有向拓扑图布局装置的结构示意图。Fig. 10 is a schematic structural diagram of a directed topological graph layout device provided by the present invention.

在本发明一示例性实施例中,结合图10可知,有向拓扑图布局装置可以包括第一模块1010至第七模块1070,下面将分别介绍各模块。In an exemplary embodiment of the present invention, referring to FIG. 10 , it can be known that the directed topology graph layout device may include a first module 1010 to a seventh module 1070 , and each module will be introduced respectively below.

第一模块1010,可以被配置为用于获取原始数据,其中,原始数据包括节点和有向连线,有向连线用于对具有连接关系的节点进行连接得到节点链路;The first module 1010 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 with connection relationships to obtain node links;

第二模块1020,可以被配置为用于基于有向连线,在节点中确定出至少一个起始节点;The second module 1020 may be configured to determine at least one starting node among the nodes based on the directed link;

第三模块1030,可以被配置为用于在以起始节点为起点的多条节点链路中,确定最长节点链路,以及确定第二长节点链路,其中,最长节点链路中包括第一节点,第一节点与第二长节点链路的第二节点存在连接关系,第二节点为第二长节点链路的起始节点;The third module 1030 may be configured to determine the longest node link among multiple node links starting from the starting node, and determine the second long node link, wherein the longest node link Including the first node, the first node has a connection relationship with the second node of the second long node link, and the second node is the starting node of the second long node link;

第四模块1040,可以被配置为用于基于最长节点链路,确定有向拓扑图的第一队列数;The fourth module 1040 may be configured to determine the first number of queues in the directed topology graph based on the longest node link;

第五模块1050,可以被配置为用于基于第二长节点链路,确定有向拓扑图的第二队列数,其中,第一队列沿第一方向设置,第二队列沿第二方向设置,第一方向和第二方向呈预设角度;The fifth module 1050 may be configured to determine the second queue number of the directed topology graph based on the second long node link, wherein the first queue is arranged along the first direction, and the second queue is arranged along the second direction, The first direction and the second direction form a preset angle;

第六模块1060,可以被配置为用于基于第一队列数和第二队列数,确定有向拓扑图的坐标空间,并将节点按照在节点链路中的排序顺序对应落位至坐标空间;The sixth module 1060 may be configured to determine the coordinate space of the directed topology graph based on the first number of queues and the second number of queues, and place the nodes in the coordinate space according to the sort order in the node link;

第七模块1070,可以被配置为用于将存在连接关系的节点进行连接。The seventh module 1070 may be configured to connect nodes that have a connection relationship.

在本发明一示例性实施例中,第四模块1040还可以被配置为用于:In an exemplary embodiment of the present invention, the fourth module 1040 may also be configured to:

在最长节点链路上确定复杂节点,其中,复杂节点为连接桩的数量超过数量阈值的节点,连接桩为节点上固定的点,用于实现节点与有向连线相连;Determine the complex node on the longest node link, wherein the complex node is a node whose number of connection piles exceeds a threshold value, and the connection pile is a fixed point on the node, which is used to realize the connection between the node and the directed connection;

第四模块1040可以采用以下方式基于最长节点链路,确定有向拓扑图的第一队列数:The fourth module 1040 may determine the number of first queues in 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;

基于第一数量和第二数量,确定有向拓扑图的第一队列数。Based on the first quantity and the second quantity, a first queue quantity of the directed topology graph is determined.

在本发明一示例性实施例中,第五模块1050可以采用以下方式基于第二长节点链路,确定有向拓扑图的第二队列数:In an exemplary embodiment of the present invention, the fifth module 1050 may determine the second number of queues in 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 quantity, the second queue quantity of the directed topology graph is determined.

在本发明一示例性实施例中,第六模块1060可以采用以下方式将节点按照在节点链路中的排序顺序对应落位至坐标空间:In an exemplary embodiment of the present invention, the sixth module 1060 can place the nodes in the coordinate space according to the sort order in the node link in the following manner:

在复杂节点的第一数量大于零的情况下,将最长节点链路设置在坐标空间的第二队列中的中间队列;In case the first number of complex nodes is greater than zero, setting the longest node link in the intermediate queue of the second queue in the coordinate space;

提取最长节点链路中各节点,并按照节点在最长节点链路中的排序顺序,在中间队列遍历设置节点的坐标,其中,节点的第一方向坐标固定,节点的第二方向坐标按照预设数值递增;Extract each node in the longest node link, and set the coordinates of the nodes in the intermediate queue according to the sorting order of the nodes in the longest node link. Among them, the coordinates of the first direction of the node are fixed, and the coordinates of the second direction of the node are according to The preset value is incremented;

基于最长节点链路中的第一节点的第二方向坐标,确定第二长节点链路中第二节点的第二方向坐标;determining a second directional coordinate of a second node in the second longest node link based on a second directional coordinate of the first node in the longest node link;

将第二长节点链路设置在坐标空间的目标队列,其中,目标队列为第二节点的第二方向坐标所在的队列;Setting the second long node link in the target queue of the coordinate space, wherein the target queue is the queue where the second direction coordinates of the second node are located;

提取第二长节点链路中各节点,并按照节点在第二长节点链路中的排列顺序,在目标队列遍历设置节点的坐标,其中,节点的第二方向坐标固定,节点的第一方向坐标按照预设数值递增;Extract each node in the second long node link, and traverse the coordinates of the set nodes in the target queue according to the arrangement order of the nodes in the second long node link, wherein, the coordinates of the second direction of the node are fixed, and the coordinates of the first direction of the node The coordinates are incremented according to the preset value;

提取剩余节点,其中,剩余节点为除最长节点链路的节点和第二长节点链路的节点之外的其他节点;Extracting the remaining nodes, wherein the remaining nodes are other nodes except the node of the longest node link and the node of the second longest node link;

基于最长节点链路的节点的坐标,或第二长节点链路的节点的坐标,确定剩余节点的坐标;determining the coordinates of the remaining nodes based on the coordinates of the nodes of the longest node link, or the coordinates of the nodes of the second longest node link;

提取游离的起始节点,并将游离的起始节点依次设置在坐标空间的第一队列中的起始队列,其中,游离的起始节点为未与其他节点存在连接关系的起始节点。Extracting free starting nodes, and sequentially setting the free starting nodes in the starting queue in the first queue in the coordinate space, wherein the free starting nodes are starting nodes that are not connected to other nodes.

在本发明一示例性实施例中,第六模块1060可以采用以下方式按照节点在最长节点链路中的排序顺序,在中间队列遍历设置节点的坐标:In an exemplary embodiment of the present invention, the sixth module 1060 can traverse and set the coordinates of the nodes in the intermediate queue according to the sort order of the nodes in the longest node link in the following manner:

按照节点在最长节点链路中的排序顺序,确定出复杂节点的下一节点;Determine the next node of the complex node according to the sorting order of the nodes in the longest node link;

相比于复杂节点的第二方向坐标,在中间队列设置复杂节点的下一节点的第二方向坐标时,按照预设数值的预设倍数进行递增。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 intermediate queue, it is incremented according to the preset multiple of the preset value.

在本发明一示例性实施例中,第六模块1060可以采用以下方式基于最长节点链路的节点的坐标,确定剩余节点的坐标:In an exemplary embodiment of the present 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:

在剩余节点中确定出与最长节点链路中的节点存在连接关系的第一剩余节点,并基于最长节点链路中的节点的第二方向坐标,确定第一剩余节点的第二方向坐标;Determine the first remaining node that has a connection relationship with the node in the longest node link among the remaining nodes, and determine the second direction coordinates of the first remaining node based on the second direction coordinates of the nodes in the longest node link ;

确定包括第一剩余节点的第一剩余节点链路,其中,第一剩余节点链路中的节点为剩余节点中的节点;determining a first remaining node link including the first remaining node, wherein the nodes in the first remaining node link are nodes in the remaining nodes;

将第一剩余节点链路设置在坐标空间的第一剩余节点链路队列,其中,第一剩余节点链路队列为第一剩余节点的第二方向坐标所在的队列;Setting the first remaining node link in the first remaining node link queue in the coordinate space, wherein the first remaining node link queue is the queue where the second direction coordinates of the first remaining node are located;

提取第一剩余节点链路中各节点,并按照节点在第一剩余节点链路中的排列顺序,在第一剩余节点链路队列遍历设置节点的坐标,其中,节点的第二方向坐标固定,节点的第一方向坐标按照预设数值递增或递减。Extracting each node in the first remaining node link, and traversing the coordinates of the setting node in the first remaining node link queue according to the arrangement order of the nodes in the first remaining node link, wherein the second direction coordinate of the node is fixed, The first direction coordinate of the node is incremented or decremented according to the preset value.

在本发明一示例性实施例中,第六模块1060可以采用以下方式基于第二长节点链路的节点的坐标,确定剩余节点的坐标:In an exemplary embodiment of the present 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:

在剩余节点中确定出与第二长节点链路中的节点存在连接关系的第二剩余节点,并基于第二长节点链路中的节点的第一方向坐标,确定第二剩余节点的第一方向坐标;Determine the second remaining node that has a connection relationship with the node in the second long node link among the remaining nodes, and determine the first direction coordinate of the node in the second long node link based on the first direction coordinate of the second remaining node direction coordinates;

确定包括第二剩余节点的第二剩余节点链路,其中,第二剩余节点链路中的节点为剩余节点中的节点;determining a second remaining node link including a second remaining node, wherein a node in the second remaining node link is a node in the remaining node;

将第二剩余节点链路设置在坐标空间的第二剩余节点链路队列,其中,第二剩余节点链路队列为第二剩余节点的第一方向坐标所在的队列;Setting the second remaining node link in the second remaining node link queue in the coordinate space, wherein the second remaining node link queue is the queue where the first direction coordinates of the second remaining node are located;

提取第二剩余节点链路中的各节点,并按照节点在第二剩余节点链路中的排列顺序,在第二剩余节点链路队列遍历设置节点的坐标,其中,节点的第一方向坐标固定,节点的第二方向坐标按照预设数值递增或递减。Extract each node in the second remaining node link, and traverse and set the coordinates of the nodes in the second remaining node link queue according to the arrangement order of the nodes in the second remaining node link, wherein the first direction coordinates of the nodes are fixed , the second direction coordinate of the node is incremented or decremented according to the preset value.

在本发明一示例性实施例中,第五模块1050可以采用以下方式实现第一方向和第二方向呈预设角度:In an exemplary embodiment of the present invention, the fifth module 1050 can implement the preset angle between the first direction and the second direction in the following manner:

第一方向和第二方向呈90度角,其中,第一方向为有向拓扑图的各列所指示的方向且第二方向为有向拓扑图的各行所指示的方向;或者第一方向为有向拓扑图的各行所指示的方向且第二方向为有向拓扑图的各列所指示的方向。The first direction and the second direction form an angle of 90 degrees, wherein the first direction is the direction indicated by each column of the directed topology map and the second direction is the direction indicated by each row of the directed topology map; or the first direction is The direction indicated by each row of the directed topology map and the second direction is the direction indicated by each column of the directed topology map.

在本发明一示例性实施例中,第七模块1070可以采用以下方式将存在连接关系的节点进行连接:In an exemplary embodiment of the present invention, the seventh module 1070 may use the following method to connect nodes that have a connection relationship:

通过设置在节点上的连接桩与有向连线相连,并基于有向连线实现节点与存在连接关系的其他节点进行连接,其中,The connection piles set on the nodes are connected with the directed lines, and based on the directed lines, the nodes are connected with other nodes that have a connection relationship. Among them,

连接桩在节点上的位置分布采用以下方式确定:The position distribution of connection piles on nodes is determined in the following way:

确定节点的连接桩的数量;Determine the number of connected stubs of the node;

基于预先设置的映射表,确定各个节点中各个连接桩在节点上的位置分布,其中,映射表中包括连接桩的数量与各个连接桩在节点上的位置分布的对应关系,连接桩按照预设位置顺序在节点上均匀分布。Based on the preset mapping table, the position distribution of each connection pile on the node in each node is determined. The positional order is evenly distributed over the nodes.

图11示例了一种电子设备的实体结构示意图,如图11所示,该电子设备可以包括:处理器(processor)1110、通信接口(Communications Interface)1120、存储器(memory)1130和通信总线1140,其中,处理器1110,通信接口1120,存储器1130通过通信总线1140完成相互间的通信。处理器1110可以调用存储器1130中的逻辑指令,以执行有向拓扑图布局方法,该方法包括:获取原始数据,其中,所述原始数据包括节点和有向连线,所述有向连线用于对具有连接关系的节点进行连接得到节点链路;基于所述有向连线,在所述节点中确定出至少一个起始节点;在以所述起始节点为起点的多条节点链路中,确定最长节点链路,以及确定第二长节点链路,其中,所述最长节点链路中包括第一节点,所述第一节点与所述第二长节点链路的第二节点存在连接关系,所述第二节点为所述第二长节点链路的起始节点;基于所述最长节点链路,确定有向拓扑图的第一队列数;基于所述第二长节点链路,确定有向拓扑图的第二队列数,其中,第一队列沿第一方向设置,第二队列沿第二方向设置,所述第一方向和第二方向呈预设角度;基于所述第一队列数和所述第二队列数,确定所述有向拓扑图的坐标空间,并将所述节点按照在节点链路中的排序顺序对应落位至所述坐标空间;将存在连接关系的所述节点进行连接。Figure 11 illustrates a schematic diagram of the physical structure of an electronic device, as shown in Figure 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 through the communication bus 1140 . The processor 1110 may invoke logic instructions in the memory 1130 to execute a directed topological graph layout method. The method includes: obtaining original data, wherein the original data includes nodes and directed links, and the directed links are used Obtaining node links by connecting nodes with a connection relationship; based on the directed connection, at least one starting node is determined among the nodes; multiple node links starting from the starting node , determine the longest node link, and determine the second long node link, wherein the longest node link includes the first node, and the second node between the first node and the second long node link There is a connection relationship between the nodes, and the second node is the starting node of the second long node link; based on the longest node link, determine the first queue number of the directed topology graph; based on the second long node link The node link is to determine the number of second queues in the directed topology graph, wherein the first queue is set along the first direction, and the second queue is set along the second direction, and the first direction and the second direction form a preset angle; based on The first number of queues and the second number of queues determine the coordinate space of the directed topology graph, and place the nodes in the coordinate space according to the order in which they are sorted in the node links; there will be The nodes of the connection relationship are connected.

此外,上述的存储器1130中的逻辑指令可以通过软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。In addition, the above-mentioned logic instructions in the memory 1130 may be implemented in the form of software function units and may be stored in a computer-readable storage medium when sold or used as an independent product. Based on this understanding, the essence of the technical solution of the present invention or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including Several instructions are used to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disc, etc., which can store program codes. .

另一方面,本发明还提供一种计算机程序产品,所述计算机程序产品包括计算机程序,计算机程序可存储在非暂态计算机可读存储介质上,所述计算机程序被处理器执行时,计算机能够执行上述各方法所提供的有向拓扑图布局方法,该方法包括:获取原始数据,其中,所述原始数据包括节点和有向连线,所述有向连线用于对具有连接关系的节点进行连接得到节点链路;基于所述有向连线,在所述节点中确定出至少一个起始节点;在以所述起始节点为起点的多条节点链路中,确定最长节点链路,以及确定第二长节点链路,其中,所述最长节点链路中包括第一节点,所述第一节点与所述第二长节点链路的第二节点存在连接关系,所述第二节点为所述第二长节点链路的起始节点;基于所述最长节点链路,确定有向拓扑图的第一队列数;基于所述第二长节点链路,确定有向拓扑图的第二队列数,其中,第一队列沿第一方向设置,第二队列沿第二方向设置,所述第一方向和第二方向呈预设角度;基于所述第一队列数和所述第二队列数,确定所述有向拓扑图的坐标空间,并将所述节点按照在节点链路中的排序顺序对应落位至所述坐标空间;将存在连接关系的所述节点进行连接。On the other hand, the present invention also provides a computer program product. The computer program product includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can Executing the directed topological graph layout method provided by the above methods, the method includes: obtaining original data, wherein the original data includes nodes and directed links, and the directed links are used to connect nodes with connection relationships performing a connection to obtain a node link; based on the directed connection, determining at least one starting node among the nodes; and determining the longest node chain among multiple node links starting from the starting node and determining a second long node link, wherein 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 The second node is the starting node of the second long node link; based on the longest node link, determine the first queue number of the directed topology graph; based on the second long node link, determine the directed The second number of queues in the topology diagram, wherein the first queue is set along the first direction, the second queue is set along the second direction, and the first direction and the second direction form a preset angle; based on the first number of queues and The second number of queues determines the coordinate space of the directed topological graph, and places the nodes in the coordinate space according to the order in which they are sorted in the node links; connect.

又一方面,本发明还提供一种非暂态计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现以执行上述各方法提供的有向拓扑图布局方法,该方法包括:获取原始数据,其中,所述原始数据包括节点和有向连线,所述有向连线用于对具有连接关系的节点进行连接得到节点链路;基于所述有向连线,在所述节点中确定出至少一个起始节点;在以所述起始节点为起点的多条节点链路中,确定最长节点链路,以及确定第二长节点链路,其中,所述最长节点链路中包括第一节点,所述第一节点与所述第二长节点链路的第二节点存在连接关系,所述第二节点为所述第二长节点链路的起始节点;基于所述最长节点链路,确定有向拓扑图的第一队列数;基于所述第二长节点链路,确定有向拓扑图的第二队列数,其中,第一队列沿第一方向设置,第二队列沿第二方向设置,所述第一方向和第二方向呈预设角度;基于所述第一队列数和所述第二队列数,确定所述有向拓扑图的坐标空间,并将所述节点按照在节点链路中的排序顺序对应落位至所述坐标空间;将存在连接关系的所述节点进行连接。In another aspect, the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it is implemented to execute the directed topology graph layout method provided by the above-mentioned methods. The method includes: obtaining original data, wherein the original data includes nodes and directed links, and the directed links are used to connect nodes with connection relationships to obtain node links; based on the directed links, At least one start node is determined among the nodes; among multiple node links starting from the start node, the longest node link is determined, and a second long node link is determined, wherein the The longest node link includes a first node, the first node has a connection relationship with the second node of the second long node link, and the second node is the start of the second long node link node; based on the longest node link, determine the first queue number of the directed topology graph; based on the second long node link, determine the second queue number of the directed topology graph, wherein the first queue is along the first queue One direction is set, the second queue is set along the second direction, the first direction and the second direction form a preset angle; based on the first number of queues and the second number of queues, determine the number of the directed topology graph coordinate space, and correspondingly place the nodes in the coordinate space according to the sorting order in the node link; connect the nodes with connection relationship.

以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性的劳动的情况下,即可以理解并实施。The device embodiments described above are only illustrative, and the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in One place, or it can be distributed to multiple network elements. Part or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. It can be understood and implemented by those skilled in the art without any creative efforts.

通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到各实施方式可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件。基于这样的理解,上述技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在计算机可读存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行各个实施例或者实施例的某些部分所述的方法。Through the above description of the implementations, those skilled in the art can clearly understand that each implementation can be implemented by means of software plus a necessary general hardware platform, and of course also by hardware. Based on this understanding, the essence of the above technical solution or the part that contributes to the prior art can be embodied in the form of software products, and the computer software products can be stored in computer-readable storage media, such as ROM/RAM, magnetic discs, optical discs, etc., including several instructions to make a computer device (which may be a personal computer, server, or network device, etc.) execute the methods described in various embodiments or some parts of the embodiments.

进一步可以理解的是,本发明实施例中尽管在附图中以特定的顺序描述操作,但是不应将其理解为要求按照所示的特定顺序或是串行顺序来执行这些操作,或是要求执行全部所示的操作以得到期望的结果。在特定环境中,多任务和并行处理可能是有利的。It can be further understood that although operations are described in a specific order in the drawings in the embodiments of the present invention, it should not be understood as requiring that these operations be performed in the specific order shown or in a serial order, or that Perform all operations shown to obtain the desired result. In certain circumstances, multitasking and parallel processing may be advantageous.

最后应说明的是:以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: it can still be Modifications are made to the technical solutions described in the foregoing embodiments, or equivalent replacements are made to some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the various embodiments of the present invention.

Claims (13)

1.一种有向拓扑图布局方法,其特征在于,所述有向拓扑图布局方法包括:1. A directed topological graph layout method, is characterized in that, described directed topological graph layout method comprises: 获取原始数据,其中,所述原始数据包括节点和有向连线,所述有向连线用于对具有连接关系的节点进行连接得到节点链路;Obtaining original data, wherein the original data includes nodes and directed links, and the directed links are used to connect nodes with connection relationships to obtain node links; 基于所述有向连线,在所述节点中确定出至少一个起始节点;determining at least one start node among the nodes based on the directed link; 在以所述起始节点为起点的多条所述节点链路中,确定最长节点链路,以及确定第二长节点链路,其中,所述最长节点链路中包括第一节点,所述第一节点与所述第二长节点链路的第二节点存在连接关系,所述第二节点为所述第二长节点链路的起始节点;Among the plurality of node links starting from the starting node, determining the longest node link, and determining a second long node link, wherein the longest node link includes the 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; 基于所述最长节点链路,确定有向拓扑图的第一队列数;Based on the longest node link, determine the number of first queues in the directed topology graph; 基于所述第二长节点链路,确定有向拓扑图的第二队列数,其中,第一队列沿第一方向设置,第二队列沿第二方向设置,所述第一方向和所述第二方向呈预设角度;Based on the second long node link, determine the second queue number of the directed topology graph, wherein the first queue is set along the first direction, the second queue is set along the second direction, the first direction and the second queue The two directions are at a preset angle; 基于所述第一队列数和所述第二队列数,确定所述有向拓扑图的坐标空间,并将所述节点按照在节点链路中的排序顺序对应落位至所述坐标空间;determining the coordinate space of the directed topology graph based on the first number of queues and the second number of queues, and correspondingly positioning the nodes in the coordinate space according to the sort order in the node link; 将存在连接关系的所述节点进行连接。Connect the nodes that have a connection relationship. 2.根据权利要求1所述的有向拓扑图布局方法,其特征在于,在所述基于所述最长节点链路,确定有向拓扑图的第一队列数之前,所述方法还包括:2. The directed topological graph layout method according to claim 1, wherein, before the first queue number of the directed topological graph is determined based on the longest node link, the method further comprises: 在所述最长节点链路上确定复杂节点,其中,所述复杂节点为连接桩的数量超过数量阈值的节点,所述连接桩为所述节点上固定的点,用于实现所述节点与所述有向连线相连;A complex node is determined on the longest node link, wherein the complex node is a node whose number of connection stakes exceeds a threshold value, and the connection stakes are fixed points on the node for realizing the connection between the node and the node. The directed links are connected; 所述基于所述最长节点链路,确定有向拓扑图的第一队列数,具体包括:The determining the number of first queues in the directed topology graph based on the longest node link specifically includes: 确定所述复杂节点的第一数量;determining a first number of said complex nodes; 确定所述最长节点链路中节点的第二数量;determining a second number of nodes in the longest node link; 基于所述第一数量和所述第二数量,确定所述有向拓扑图的第一队列数。Based on the first number and the second number, determine a first queue number of the directed topology graph. 3.根据权利要求1所述的有向拓扑图布局方法,其特征在于,所述基于所述第二长节点链路,确定有向拓扑图的第二队列数,具体包括:3. The directed topological graph layout method according to claim 1, wherein the second queue number of the directed topological graph is determined based on the second long node link, specifically comprising: 确定所述第二长节点链路中节点的第三数量;determining a third number of nodes in the second long node link; 基于所述第三数量,确定所述有向拓扑图的第二队列数。Based on the third number, a second queue number of the directed topology graph is determined. 4.根据权利要求1所述的有向拓扑图布局方法,其特征在于,所述将所述节点按照在节点链路中的排序顺序对应落位至所述坐标空间,具体包括:4. The directed topological graph layout method according to claim 1, wherein said placing said nodes in said coordinate space correspondingly according to the sort order in the node link, specifically comprises: 在复杂节点的第一数量大于零的情况下,将所述最长节点链路设置在所述坐标空间的所述第二队列中的中间队列;Where the first number of complex nodes is greater than zero, placing said longest node link in an intermediate queue of said second queue in said coordinate space; 提取所述最长节点链路中各节点,并按照所述节点在所述最长节点链路中的排序顺序,在所述中间队列遍历设置所述节点的坐标,其中,所述节点的第一方向坐标固定,所述节点的第二方向坐标按照预设数值递增;Extract each node in the longest node link, and set the coordinates of the nodes in the intermediate queue according to the sorting order of the nodes in the longest node link, wherein the node's No. The coordinates in one direction are fixed, and the coordinates in the second direction of the node are incremented according to a preset 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 the target queue of the coordinate space, wherein the target queue is the queue where the second direction coordinate of the second node is located; 提取所述第二长节点链路中各节点,并按照所述节点在所述第二长节点链路中的排列顺序,在所述目标队列遍历设置所述节点的坐标,其中,所述节点的第二方向坐标固定,所述节点的第一方向坐标按照预设数值递增;extract each node in the second long node link, and traverse and set the coordinates of the nodes in the target queue according to the order in which the nodes are arranged in the second long node link, wherein the nodes The coordinates in the second direction of the node are fixed, and the coordinates in the first direction of the node are incremented according to the preset value; 提取剩余节点,其中,所述剩余节点为除所述最长节点链路的节点和所述第二长节点链路的节点之外的其他节点;extracting remaining nodes, wherein the remaining nodes are nodes other than 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 nodes of the longest node link, or the coordinates of the nodes of the second longest node link; 提取游离的起始节点,并将所述游离的起始节点依次设置在所述坐标空间的所述第一队列中的起始队列,其中,所述游离的起始节点为未与其他节点存在连接关系的起始节点。Extracting the free start node, and setting the free start node in the start queue in the first queue in the coordinate space in turn, wherein the free start node is not existing with other nodes The starting node of the connection relationship. 5.根据权利要求4所述的有向拓扑图布局方法,其特征在于,所述按照所述节点在所述最长节点链路中的排序顺序,在所述中间队列遍历设置所述节点的坐标,具体包括:5. The directed topological graph layout method according to claim 4, characterized in that, according to the sorting order of the nodes in the longest node link, traversing and setting the nodes of the intermediate queues coordinates, including: 按照所述节点在所述最长节点链路中的排序顺序,确定出所述复杂节点的下一节点;determining the next node of the complex node according to the sort order of the nodes in the longest node link; 相比于所述复杂节点的第二方向坐标,在所述中间队列设置所述复杂节点的下一节点的第二方向坐标时,按照预设数值的预设倍数进行递增。Compared with the second direction coordinate of the complex node, when the intermediate queue sets the second direction coordinate of the next node of the complex node, it is incremented according to a preset multiple of a preset value. 6.根据权利要求4所述的有向拓扑图布局方法,其特征在于,所述基于所述最长节点链路的节点的坐标,确定所述剩余节点的坐标,具体包括:6. The directed topological graph layout method according to claim 4, wherein the coordinates of the nodes based on the longest node link are determined to determine the coordinates of the remaining nodes, specifically comprising: 在所述剩余节点中确定出与所述最长节点链路中的节点存在连接关系的第一剩余节点,并基于所述最长节点链路中的节点的第二方向坐标,确定所述第一剩余节点的第二方向坐标;Determine the first remaining node that has a connection relationship with the node in the longest node link among the remaining nodes, and determine the first remaining node based on the second direction coordinates of the nodes in the longest node link a second direction coordinate of the remaining node; 确定包括所述第一剩余节点的第一剩余节点链路,其中,所述第一剩余节点链路中的节点为所述剩余节点中的节点;determining a first remaining node link including the first remaining node, wherein a node in the first remaining node link is a node in the remaining node; 将所述第一剩余节点链路设置在所述坐标空间的第一剩余节点链路队列,其中,所述第一剩余节点链路队列为所述第一剩余节点的第二方向坐标所在的队列;Setting the first remaining node link in the first remaining node link queue in the coordinate space, wherein the first remaining node link queue is the queue where the second direction coordinates of the first remaining node are located ; 提取所述第一剩余节点链路中各节点,并按照所述节点在所述第一剩余节点链路中的排列顺序,在所述第一剩余节点链路队列遍历设置所述节点的坐标,其中,所述节点的第二方向坐标固定,所述节点的第一方向坐标按照预设数值递增或递减。Extracting each node in the first remaining node link, and setting the coordinates of the node in the first remaining node link queue according to the arrangement order 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 increase or decrease according to a preset value. 7.根据权利要求4所述的有向拓扑图布局方法,其特征在于,所述基于所述第二长节点链路的节点的坐标,确定所述剩余节点的坐标,具体包括:7. The directed topological graph layout method according to claim 4, wherein the coordinates of the nodes based on the second long node link are determined to determine the coordinates of the remaining nodes, specifically comprising: 在所述剩余节点中确定出与所述第二长节点链路中的节点存在连接关系的第二剩余节点,并基于所述第二长节点链路中的节点的第一方向坐标,确定所述第二剩余节点的第一方向坐标;Determine a second remaining node that has a connection relationship with a node in the second long node link among the remaining nodes, and determine the second remaining node based on the first direction coordinates of the nodes in the second long node link The first direction coordinates of the second remaining node; 确定包括所述第二剩余节点的第二剩余节点链路,其中,所述第二剩余节点链路中的节点为所述剩余节点中的节点;determining a second remaining node link including the second remaining node, wherein a node in the second remaining node link is a node in the remaining node; 将所述第二剩余节点链路设置在所述坐标空间的第二剩余节点链路队列,其中,所述第二剩余节点链路队列为所述第二剩余节点的第一方向坐标所在的队列;Setting the second remaining node link in the second remaining node link queue in the coordinate space, wherein the second remaining node link queue is the queue where the first direction coordinates of the second remaining node are located ; 提取所述第二剩余节点链路中的各节点,并按照所述节点在所述第二剩余节点链路中的排列顺序,在所述第二剩余节点链路队列遍历设置所述节点的坐标,其中,所述节点的第一方向坐标固定,所述节点的第二方向坐标按照预设数值递增或递减。Extracting each node in the second remaining node link, and setting the coordinates of the node in the second remaining node link queue according to the arrangement order 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 increase or decrease according to a preset value. 8.根据权利要求1至7中任意一项所述的有向拓扑图布局方法,其特征在于,所述第一方向和所述第二方向呈预设角度,具体包括:8. The directed topological graph layout method according to any one of claims 1 to 7, wherein the first direction and the second direction are at a preset angle, specifically comprising: 所述第一方向和所述第二方向呈90度角,其中,所述第一方向为所述有向拓扑图的各列所指示的方向且所述第二方向为所述有向拓扑图的各行所指示的方向;或者所述第一方向为所述有向拓扑图的各行所指示的方向且所述第二方向为所述有向拓扑图的各列所指示的方向。The first direction and the second direction form an angle of 90 degrees, wherein the first direction is the direction indicated by each column of the directed topology map and the second direction is the direction indicated by the directed topology map or the first direction is the direction indicated by the rows of the directed topology map and the second direction is the direction indicated by the columns of the directed topology map. 9.根据权利要求1所述的有向拓扑图布局方法,其特征在于,所述将存在连接关系的所述节点进行连接,具体包括:9. The directed topological graph layout method according to claim 1, wherein the connecting the nodes having a connection relationship specifically comprises: 通过设置在所述节点上的连接桩与所述有向连线相连,并基于所述有向连线实现所述节点与存在连接关系的其他节点进行连接,其中,Connecting to the directed link through the connection stake set on the node, and realizing the connection between the node and other nodes having a connection relationship based on the directed link, wherein, 所述连接桩在所述节点上的位置分布采用以下方式确定:The position distribution of the connecting pile on the node is determined in the following manner: 确定所述节点的连接桩的数量;determining the number of connection stakes of the node; 基于预先设置的映射表,确定各个节点中各个连接桩在节点上的位置分布,其中,所述映射表中包括连接桩的数量与各个连接桩在节点上的位置分布的对应关系,所述连接桩按照预设位置顺序在所述节点上均匀分布。Based on the preset mapping table, the position distribution of each connection pile on the node in each node is determined, wherein the mapping table includes the corresponding relationship between the number of connection piles and the position distribution of each connection pile on the node, and the connection The piles are evenly distributed on the nodes in a preset position order. 10.一种有向拓扑图布局装置,其特征在于,所述有向拓扑图布局装置包括:10. A directed topological graph layout device, characterized in that, the directed topological graph layout device comprises: 第一模块,用于获取原始数据,其中,所述原始数据包括节点和有向连线,所述有向连线用于对具有连接关系的节点进行连接得到节点链路;The first module is used to obtain original data, wherein the original data includes nodes and directed links, and the directed links are used to connect nodes with connection relationships to obtain node links; 第二模块,用于基于所述有向连线,在所述节点中确定出至少一个起始节点;A second module, configured to determine at least one starting node among the nodes based on the directed link; 第三模块,用于在以所述起始节点为起点的多条所述节点链路中,确定最长节点链路,以及确定第二长节点链路,其中,所述最长节点链路中包括第一节点,所述第一节点与所述第二长节点链路的第二节点存在连接关系,所述第二节点为所述第二长节点链路的起始节点;A third module, configured to determine the longest node link among the multiple node links starting from the starting node, and determine a second long node link, wherein the longest node link includes a first node, the first node has a connection relationship with the 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, configured to determine the number of first queues in the directed topology graph based on the longest node link; 第五模块,用于基于所述第二长节点链路,确定有向拓扑图的第二队列数,其中,第一队列沿第一方向设置,第二队列沿第二方向设置,所述第一方向和所述第二方向呈预设角度;The fifth module is configured to determine the second queue number of the directed topology graph based on the second long node link, wherein the first queue is set along the first direction, the second queue is set along the second direction, and the second queue is set along the second direction. A direction and the second direction form a preset angle; 第六模块,用于基于所述第一队列数和所述第二队列数,确定所述有向拓扑图的坐标空间,并将所述节点按照在节点链路中的排序顺序对应落位至所述坐标空间;The sixth module is configured to determine the coordinate space of the directed topological graph based on the first number of queues and the second number of queues, and place the nodes in corresponding positions according to the sort order in the node link said coordinate space; 第七模块,用于将存在连接关系的所述节点进行连接。The seventh module is configured to connect the nodes that have a connection relationship. 11.一种电子设备,包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述程序时实现如权利要求1至9任一项所述的有向拓扑图布局方法。11. An electronic device comprising a memory, a processor, and a computer program stored on the memory and operable on the processor, wherein the processor according to claim 1 is implemented when executing the program. The directed topological graph layout method described in any one of to 9. 12.一种非暂态计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1至9任一项所述的有向拓扑图布局方法。12. A non-transitory computer-readable storage medium, on which a computer program is stored, characterized in that, when the computer program is executed by a processor, the directed topology graph according to any one of claims 1 to 9 is realized layout method. 13.一种计算机程序产品,包括计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1至9任一项所述的有向拓扑图布局方法。13. A computer program product, comprising a computer program, characterized in that, when the computer program is executed by a processor, the directed topology graph layout method according to any one of claims 1 to 9 is implemented.
CN202211390931.8A 2022-11-07 2022-11-07 Directed topology map layout method and device, electronic equipment and storage medium Active CN115913975B (en)

Priority Applications (1)

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

Applications Claiming Priority (1)

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

Publications (2)

Publication Number Publication Date
CN115913975A true CN115913975A (en) 2023-04-04
CN115913975B CN115913975B (en) 2024-10-29

Family

ID=86495810

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211390931.8A Active CN115913975B (en) 2022-11-07 2022-11-07 Directed topology map layout method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115913975B (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) *

Also Published As

Publication number Publication date
CN115913975B (en) 2024-10-29

Similar Documents

Publication Publication Date Title
WO2015119325A1 (en) Terrain rendering method
CN106909552A (en) Image retrieval server, system, coordinate indexing and misarrangement method
WO2023130664A1 (en) Angiography image analysis method and apparatus
CN108509532B (en) Point gathering method and device applied to map
CN116385702A (en) Method, device, electronic equipment and storage medium for bottom surface segmentation of 3D point cloud
Babel et al. The isomorphism problem for directed path graphs and for rooted directed path graphs
US8510703B1 (en) Method and mechanism for implementing PCB routing
US7181377B1 (en) Method of modifying a volume mesh using sheet extraction
CN107045732B (en) Digital ground model simplifying method and device
CN115913975A (en) Directed topology graph layout method, device, electronic equipment and storage medium
CN115081122B (en) Method, equipment and medium for automatically extracting geometric middle plane of plate-shell structure
CN107925702A (en) Method and apparatus for the binder for detecting damage
CN111814605B (en) Main road identification method, main road identification device and storage device based on topological map
CN116383548A (en) Calculation method, system, electronic equipment and medium of a covered area
CN107193656A (en) Method for managing resource, terminal device and the computer-readable recording medium of multiple nucleus system
CN110910242B (en) Block chain generation method and device, terminal equipment and storage medium
CN110032596B (en) Method and system for identifying users with abnormal traffic
CN118095015B (en) A method, device and processing equipment for predicting seepage performance of fractured rock mass
CN115473817B (en) Construction method and system of power information network considering spatial characteristics
CN115361293B (en) A network topology map segmentation method, device, terminal equipment and storage medium
CN111383301A (en) Method, device and terminal device for identifying grid map nodes
CN117807939B (en) Circuit hypergraph determination method, device, computer equipment and storage medium
CN120045594B (en) A distance range connection query visualization method, device, equipment and medium
CN116628119B (en) Road section starting and ending point name assignment method, device, equipment and medium
CN112395310B (en) Method and system for converging background points of electronic map

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
GR01 Patent grant
GR01 Patent grant