CN111181769B - Network topological graph drawing method, system, device and computer readable storage medium - Google Patents
Network topological graph drawing method, system, device and computer readable storage medium Download PDFInfo
- Publication number
- CN111181769B CN111181769B CN201911267813.6A CN201911267813A CN111181769B CN 111181769 B CN111181769 B CN 111181769B CN 201911267813 A CN201911267813 A CN 201911267813A CN 111181769 B CN111181769 B CN 111181769B
- Authority
- CN
- China
- Prior art keywords
- node
- link
- type
- control parameter
- legend
- 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.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 48
- 238000005516 engineering process Methods 0.000 claims abstract description 23
- 238000004458 analytical method Methods 0.000 claims abstract description 13
- 238000010586 diagram Methods 0.000 claims description 32
- 238000003491 array Methods 0.000 claims description 25
- 238000004590 computer program Methods 0.000 claims description 6
- 230000006870 function Effects 0.000 description 11
- 230000005540 biological transmission Effects 0.000 description 2
- 239000003086 colorant Substances 0.000 description 2
- 238000004891 communication Methods 0.000 description 2
- 239000004973 liquid crystal related substance Substances 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000001514 detection method Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000000802 evaporation-induced self-assembly Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/12—Discovery or management of network topologies
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/14—Network analysis or design
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
本发明实施例涉及IT应用技术领域,公开了一种网络拓扑图绘制方法。本发明对拓扑数据集进行节点解析生成节点控制参数集,根据所述拓扑数据集的链路类型生成链路类型图例集,解析所述节点控制参数集内每个节点之间的链路连接关系得到链路连接线集,解析所述节点控制参数集内每个节点之间的链路端点类型得到链路端点类型集,从所述链路类型图例集中选择与所述链路连接线集及所述链路端点类型集对应的图例集,使用前端网络拓扑图绘制技术并根据所述图例集和所述节点控制参数集,绘制所述拓扑数据集的网络拓扑图。本发明还提出一种网络拓扑图绘制电子设备、装置以及计算机可读存储介质。本发明可有效的解决多链路类型下绘图复杂占用内存空间的问题。
The embodiment of the invention relates to the field of IT application technology, and discloses a method for drawing a network topology map. The present invention performs node analysis on the topology data set to generate a node control parameter set, generates a link type legend set according to the link type of the topology data set, and analyzes the link connection relationship between each node in the node control parameter set Obtain the link connection line set, analyze the link endpoint type between each node in the node control parameter set to obtain the link endpoint type set, select the link connection line set and the link connection line set from the link type legend set and The legend set corresponding to the link endpoint type set uses the front-end network topology map drawing technology to draw the network topology map of the topology data set according to the legend set and the node control parameter set. The invention also proposes an electronic device, device and computer-readable storage medium for drawing a network topology map. The invention can effectively solve the problem of complicated drawing and occupying memory space under the multi-link type.
Description
技术领域technical field
本发明实施例涉及IT应用技术领域,特别涉及一种网络拓扑图绘制的方法、电子设备、装置及计算机可读存储介质。The embodiments of the present invention relate to the field of IT application technology, and in particular to a method for drawing a network topology map, electronic equipment, a device, and a computer-readable storage medium.
背景技术Background technique
拓扑图是指网络节点设备构成的网络结构图,能够直观展现节点之间的关系。目前关于拓扑图的绘制主要有两种方法,传统绘制法和前端技术生成法。The topology diagram refers to the network structure diagram composed of network node devices, which can visually display the relationship between nodes. At present, there are mainly two methods for drawing topology maps, traditional drawing method and front-end technology generation method.
传统绘制法内两个节点之间只由一根链路连接线,链路连接线只能表达连接关系而无法表示链路中传递的不同数据类型,前端技术生成法在不限制节点之间链路连接线数量的前提下进行绘制。In the traditional drawing method, there is only one link connection line between two nodes. The link connection line can only express the connection relationship but cannot express the different data types transmitted in the link. The front-end technology generation method does not limit the link between nodes. Draw under the premise of the number of road connection lines.
然而发明人发现,面对多链路类型时,传统绘制法只能一种链路类型对应一张拓扑图,因此需要占用更多的存储空间和展示空间,且不方便用户查看,前端技术生成法由于节点之间链路连接线数量不确定性,当链路连接线数量过多时,需要处理多连线重叠、交叉、定位等问题,技术实现难度大,且当节点之间存在大量的连接线时,拓扑图负责繁琐不利于观看。However, the inventors found that when faced with multiple link types, the traditional drawing method can only correspond to one topology map for one link type, so it needs to occupy more storage space and display space, and it is inconvenient for users to view. Due to the uncertainty of the number of link connections between nodes, when the number of link connections is too large, it is necessary to deal with problems such as multi-connection overlapping, crossing, and positioning, which makes it difficult to implement the technology, and when there are a large number of connections between nodes When online, the topology map is cumbersome and not conducive to viewing.
发明内容Contents of the invention
本发明实施方式的目的在于提供一种网络拓扑图绘制方法、电子设备、装置及计算机可读存储介质,有效的解决多链路类型下绘图复杂占用内存空间的问题。The purpose of the embodiments of the present invention is to provide a method for drawing a network topology map, an electronic device, a device, and a computer-readable storage medium, which can effectively solve the problem of complex drawing and occupying memory space in a multi-link type.
为解决上述技术问题,本发明的实施方式提供了一种网络拓扑图绘制方法,所述方法包括:In order to solve the above technical problems, an embodiment of the present invention provides a method for drawing a network topology map, the method comprising:
对拓扑数据集进行节点解析生成节点控制参数集;Perform node analysis on the topology data set to generate a node control parameter set;
根据所述拓扑数据集的链路类型生成与所述节点控制参数集对应的链路类型图例集;generating a link type legend set corresponding to the node control parameter set according to the link type of the topology data set;
解析所述节点控制参数集内每个节点之间的链路连接关系得到链路连接线集,解析所述节点控制参数集内每个节点之间的链路端点类型得到链路端点类型集;Analyzing the link connection relationship between each node in the node control parameter set to obtain a link connection line set, and analyzing the link endpoint type between each node in the node control parameter set to obtain a link endpoint type set;
从所述链路类型图例集中选择与所述链路连接线集及所述链路端点类型集对应的图例集,使用前端网络拓扑图绘制技术并根据所述图例集和所述节点控制参数集,绘制所述拓扑数据集的网络拓扑图。Select a legend set corresponding to the link connection line set and the link end point type set from the link type legend set, use the front-end network topology map drawing technology and control the parameter set according to the legend set and the node. , draw a network topology map of the topology dataset.
优选地,所述所述拓扑数据集包括节点ID、节点名称、节点类型、节点位置数据、节点类型、连接节点ID和与所述节点ID对应的链路类型数组。Preferably, the topology data set includes node IDs, node names, node types, node location data, node types, connection node IDs and an array of link types corresponding to the node IDs.
优选地,所述对拓扑数据集进行节点解析生成节点控制参数集,包括:Preferably, performing node analysis on the topology data set to generate a node control parameter set includes:
从所述拓扑数据集中提取所述节点ID、所述节点类型以及所述节点位置数据;extracting the node ID, the node type, and the node location data from the topology dataset;
根据所述节点ID、所述节点类型以及所述节点位置数据,使用所述前端网络拓扑图绘制技术在预构建的原始拓扑图中生成所述节点控制参数集。According to the node ID, the node type, and the node location data, the node control parameter set is generated in a pre-built original topology map using the front-end network topology map drawing technology.
优选地,所述根据所述拓扑数据集的链路类型生成与所述节点控制参数集对应的链路类型图例集,包括:Preferably, the generating a link type legend set corresponding to the node control parameter set according to the link type of the topology data set includes:
统计所述拓扑数据集内不同节点ID对应的链路类型数组得到原始链路类型数组集;Count the link type arrays corresponding to different node IDs in the topology data set to obtain the original link type array set;
在所述原始链路类型数组集内去除重复的链路类型数组得到标准链路类型数组集;removing duplicate link type arrays in the original link type array set to obtain a standard link type array set;
根据所述标准链路类型数组集的数量和数组,从预先构建的链路类型图例库中选择链路类型图例,生成所述链路类型图例集。According to the number and arrays of the standard link type array sets, a link type legend is selected from a pre-built link type legend library to generate the link type legend set.
优选地,所述链路类型图例集中每个链路类型图例均由图形符号数据和类型名称数据组成。Preferably, each link type legend in the link type legend set consists of graphic symbol data and type name data.
优选地,所述解析所述节点控制参数集内每个节点之间的链路连接关系得到链路连接线集,解析所述节点控制参数集内每个节点之间的链路端点类型得到链路端点类型集,包括:Preferably, analyzing the link connection relationship between each node in the node control parameter set to obtain a link connection line set, and analyzing the link endpoint type between each node in the node control parameter set to obtain a link A set of road endpoint types, including:
从所述节点控制参数集中不重复的选择两个节点得到第一节点和第二节点,查询所述第一节点和所述第二节点分别在所述拓扑数据集内各自对应的链路类型数组,得到第一链路类型数组和第二链路类型数组;Select two nodes without repetition from the node control parameter set to obtain the first node and the second node, and query the corresponding link type arrays of the first node and the second node in the topology data set respectively , get the first link type array and the second link type array;
判断所述第一链路类型数组和所述第二链路类型数组之间是否有数组重合,若所述第一链路类型数组和所述第二链路类型数组之间没有数组重合,重新在所述节点控制参数集中不重复的选择两个节点;Judging whether there is overlap of arrays between the array of the first link type and the array of the second link type, if there is no overlap of arrays between the array of the first link type and the array of the second link type, restart Selecting two nodes without repetition in the node control parameter set;
若所述第一链路类型数组和所述第二链路类型数组之间有数组重合,则根据所述数组重合的数据生成所述第一节点和所述第二节点的链路连接线和链路端点,当所述节点控制参数集全部选择完成,汇集所有链路连接线得到所述链路连接线集,汇集所有链路端点得到链路端点类型集。If there is an array overlap between the first link type array and the second link type array, then generate the link connection line and the link connection line between the first node and the second node according to the overlapped data of the array For the link endpoints, when all the node control parameter sets are selected, all the link connection lines are collected to obtain the link connection line set, and all the link endpoints are collected to obtain the link endpoint type set.
优选地,所述第一节点和所述第二节点的链路连接线均为单根连接线。Preferably, the link connecting wires of the first node and the second node are both single connecting wires.
为了解决上述问题,本发明还提供一种网络拓扑图绘制装置,所述装置包括:In order to solve the above problems, the present invention also provides a device for drawing a network topology map, the device comprising:
节点解析模块,用于对拓扑数据集进行节点解析生成节点控制参数集;A node parsing module, used for performing node parsing on the topology data set to generate a node control parameter set;
链路类型图例生成模块,用于根据所述拓扑数据集的链路类型生成与所述节点控制参数集对应的链路类型图例集;A link type legend generation module, configured to generate a link type legend set corresponding to the node control parameter set according to the link type of the topology data set;
链路连接及链路端点生成模块,用于解析所述节点控制参数集内每个节点之间的链路连接关系得到链路连接线集,解析所述节点控制参数集内每个节点之间的链路端点类型得到链路端点类型集;Link connection and link endpoint generation module, used to analyze the link connection relationship between each node in the node control parameter set to obtain a link connection line set, and analyze the connection between each node in the node control parameter set The link endpoint type to get the link endpoint type set;
网络拓扑图绘制模块,用于从所述链路类型图例集中选择与所述链路连接线集及所述链路端点类型集对应的图例集,使用前端网络拓扑图绘制技术并根据所述图例集和所述节点控制参数集,绘制所述拓扑数据集的网络拓扑图。A network topology map drawing module, configured to select a legend set corresponding to the link connection line set and the link end point type set from the link type legend set, use the front-end network topology map drawing technology and according to the legend set and the node control parameter set, and draw the network topology graph of the topology data set.
为了解决上述问题,本发明还提供一种电子设备,所述电子设备包括:In order to solve the above problems, the present invention also provides an electronic device, which includes:
存储器,存储至少一个指令;及a memory storing at least one instruction; and
处理器,执行所述存储器中存储的指令以实现上述所述的网络拓扑图绘制方法。The processor executes the instructions stored in the memory to implement the above-mentioned method for drawing a network topology map.
为了解决上述问题,本发明还提供一种计算机可读存储介质,所述计算机可读存储介质中存储有至少一个指令,所述至少一个指令被电子设备中的处理器执行以实现上述所述的网络拓扑图绘制方法。In order to solve the above problems, the present invention also provides a computer-readable storage medium, at least one instruction is stored in the computer-readable storage medium, and the at least one instruction is executed by a processor in the electronic device to realize the above-mentioned Network topology map drawing method.
本发明根据拓扑数据集的链路类型确定所述拓扑数据集所需要的链路类型图例集,从而提前确定需要使用的链路类型图例,因此不需要开辟更多的存储空间以存储多余的链路类型图例;另外,节点之间的链路类型只需使用链路连接线和链路端点确定,由于链路类型确定方式相较简单,因此解决多链路类型下绘图复杂以及占用更多展示空间的问题。The present invention determines the link type legend set required by the topology data set according to the link type of the topology data set, thereby determining the link type legend that needs to be used in advance, so there is no need to open up more storage space to store redundant links road type legend; in addition, the link type between nodes only needs to be determined by link connection lines and link endpoints. Since the link type determination method is relatively simple, it solves the complex drawing and takes up more display under the multi-link type space problem.
进一步地,节点之间的链路连接线均为单根连接线,限制了节点之间链路连接线数量,可更进一步的解决多链路类型下绘图复杂和占用展示空间问题。Furthermore, the link connection lines between nodes are all single connection lines, which limits the number of link connection lines between nodes, and can further solve the problems of complex drawing and display space occupation under the multi-link type.
附图说明Description of drawings
一个或多个实施例通过与之对应的附图中的图片进行示例性说明,这些示例性说明并不构成对实施例的限定,附图中具有相同参考数字标号的元件表示为类似的元件,除非有特别申明,附图中的图不构成比例限制。One or more embodiments are exemplified by the pictures in the corresponding drawings, and these exemplifications do not constitute a limitation to the embodiments. Elements with the same reference numerals in the drawings represent similar elements. Unless otherwise stated, the drawings in the drawings are not limited to scale.
图1为本发明实施例提供的网络拓扑图绘制方法流程示意图;FIG. 1 is a schematic flowchart of a method for drawing a network topology map provided by an embodiment of the present invention;
图2为本发明实施例提供的网络拓扑图绘制方法中S1的详细实施流程示意图;FIG. 2 is a schematic diagram of a detailed implementation process of S1 in the method for drawing a network topology map provided by an embodiment of the present invention;
图3为本发明实施例提供的网络拓扑图绘制方法中S2的详细实施流程示意图;3 is a schematic diagram of a detailed implementation flow of S2 in the method for drawing a network topology map provided by an embodiment of the present invention;
图4为本发明实施例提供的网络拓扑图绘制方法中图例举例图;FIG. 4 is an example diagram of a legend in a method for drawing a network topology diagram provided by an embodiment of the present invention;
图5为本发明实施例提供的网络拓扑图绘制方法中S3的详细实施流程示意图;FIG. 5 is a schematic diagram of a detailed implementation flow of S3 in the method for drawing a network topology map provided by an embodiment of the present invention;
图6为本发明实施例提供的网络拓扑图绘制装置的模块示意图;FIG. 6 is a block diagram of a device for drawing a network topology diagram provided by an embodiment of the present invention;
图7为本发明实施例提供的实现网络拓扑图绘制方法的电子设备的内部结构示意图;FIG. 7 is a schematic diagram of the internal structure of an electronic device implementing a method for drawing a network topology map provided by an embodiment of the present invention;
本发明目的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The realization of the purpose, function and advantages of the present invention will be further described in conjunction with the embodiments and with reference to the accompanying drawings.
具体实施方式Detailed ways
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合附图对本发明的各实施方式进行详细的阐述。然而,本领域的普通技术人员可以理解,在本发明各实施方式中,为了使读者更好地理解本申请而提出了许多技术细节。但是,即使没有这些技术细节和基于以下各实施方式的种种变化和修改,也可以实现本申请所要求保护的技术方案。In order to make the purpose, technical solutions and advantages of the embodiments of the present invention more clear, various implementation modes of the present invention will be described in detail below in conjunction with the accompanying drawings. However, those of ordinary skill in the art can understand that, in each implementation manner of the present invention, many technical details are provided for readers to better understand the present application. However, even without these technical details and various changes and modifications based on the following implementation modes, the technical solution claimed in this application can also be realized.
本发明的实施方式涉及一种网络拓扑图绘制方法,本实施方式的核心在于根据拓扑数据集进行节点解析、生成链路端点类型及链路连接线,进而完成网络拓扑图绘制,从而有效的解决多链路类型下绘图复杂占用内存空间的问题。下面对本实施方式的网络拓扑图绘制实现细节进行具体的说明,以下内容仅为方便理解提供的实现细节,并非实施本方案的必须。The embodiment of the present invention relates to a method for drawing a network topology map. The core of this embodiment is to analyze the nodes according to the topology data set, generate link endpoint types and link connection lines, and then complete the drawing of the network topology map, thereby effectively solving the problem of The problem of memory space occupied by complex drawing under multi-link type. The implementation details of drawing the network topology diagram in this embodiment will be described in detail below. The following content is only the implementation details provided for the convenience of understanding, and is not necessary for implementing the solution.
参阅图1所示,图1是本发明第一实施方式中网络拓扑图绘制的流程图,包括:Referring to Fig. 1, Fig. 1 is a flowchart of drawing a network topology diagram in the first embodiment of the present invention, including:
S1、获取拓扑数据集,对所述拓扑数据集进行节点解析生成节点控制参数集。S1. Obtain a topology data set, and perform node analysis on the topology data set to generate a node control parameter set.
拓扑是指设备、参数等之间的联系,具体地,如计算机网络领域的拓扑(ComputerNetwork Topology),是指由计算机组成的网络设备之间的分布情况以及相互的连接状态,进一步地,拓扑图是指根据所述拓扑将计算机组成的网络设备画在对应的图上即为所述拓扑图,一般的拓扑图要求在图上要标明设备所处的位置、设备名称类型以及设备间的连接介质类型等。Topology refers to the connection between devices, parameters, etc. Specifically, such as the topology in the field of computer networks (ComputerNetwork Topology), refers to the distribution and mutual connection status of network devices composed of computers. Further, the topology map Refers to drawing the network equipment composed of computers on the corresponding diagram according to the topology, which is the topology diagram. The general topology diagram requires the location of the device, the type of device name and the connection medium between the devices to be marked on the diagram. type etc.
本发明所述拓扑数据集包括但不限于节点ID、节点名称、节点类型、节点位置数据、节点类型、连接节点ID和与所述节点ID对应的链路类型数组,如上述计算机组成的网络设备之间需要绘制拓扑图时,首先需要知道不同网络设备的节点ID、节点名称、节点类型、节点位置数据、节点类型、连接节点ID和与所述节点ID对应的链路类型数组等拓扑数据,汇集不同网络设备的拓扑数据得到拓扑数据集,如工作站节点的拓扑数据、交换机节点的拓扑数据、路由器节点的拓扑数据、服务器组节点的拓扑数据等。The topology data set of the present invention includes but not limited to node ID, node name, node type, node location data, node type, connection node ID and link type array corresponding to the node ID, such as the network equipment composed of the above-mentioned computers When it is necessary to draw a topology map, it is first necessary to know topological data such as node IDs, node names, node types, node location data, node types, connection node IDs, and link type arrays corresponding to the node IDs of different network devices. Gather topology data of different network devices to obtain topology data sets, such as topology data of workstation nodes, topology data of switch nodes, topology data of router nodes, topology data of server group nodes, etc.
较佳地,所述拓扑数据集可采用客户端向后台服务器发送拓扑数据的获取请求,通过所述后台服务器接收所述获取请求并返回拓扑数据集的形式,其中,所述拓扑数据集的格式包括但不限于yaml、xml以及json。Preferably, the topology data set can be in the form that the client sends a topology data acquisition request to the background server, and the background server receives the acquisition request and returns the topology data set, wherein the format of the topology data set is Including but not limited to yaml, xml and json.
详细地,所述对所述拓扑数据集进行节点解析生成节点控制参数集,可参阅图2的详细实施流程示意图,包括:In detail, the generation of node control parameter sets by performing node analysis on the topology data set can refer to the detailed implementation flow diagram in Figure 2, including:
S11、从所述拓扑数据集中提取所述节点ID、所述节点类型以及所述节点位置数据;S11. Extracting the node ID, the node type, and the node location data from the topology data set;
S12、根据所述节点ID、所述节点类型以及所述节点位置数据,使用所述前端网络拓扑图绘制技术在预构建的原始拓扑图中生成所述节点控制参数集。S12. According to the node ID, the node type and the node location data, use the front-end network topology map drawing technology to generate the node control parameter set in the pre-built original topology map.
所述前端网络拓扑图绘制技术可采用基于HTML5的网络拓扑图绘制方法、基于Web的JGraphx的拓扑图方法、echarts的网络拓扑图绘制方法等。The front-end network topology drawing technology may adopt a network topology drawing method based on HTML5, a Web-based JGraphx topology drawing method, an echarts network topology drawing method, and the like.
进一步地,所述原始拓扑图可使用HTML技术提前绘制的一张空白网页,根据上述HTML5、基于Web的JGraphx、echarts等网络拓扑图绘制方法,并以所述节点ID、所述节点类型以及所述节点位置数据为参数,在所述空白网页中绘制节点信息,并记录节点信息得到节点控制参数集,由此可知所述节点控制参数集是绘制在所述空白网页的前端参数。Further, the original topology map can use a blank web page drawn in advance by HTML technology, according to the above-mentioned HTML5, Web-based JGraphx, echarts and other network topology map drawing methods, and use the node ID, the node type and the The node position data is used as a parameter, the node information is drawn in the blank webpage, and the node information is recorded to obtain the node control parameter set, so it can be seen that the node control parameter set is the front-end parameter drawn in the blank webpage.
S2、根据所述拓扑数据集的链路类型生成与所述节点控制参数集对应的链路类型图例集。S2. Generate a link type legend set corresponding to the node control parameter set according to the link type of the topology data set.
详细地,所述S2可参阅图3的详细实施流程示意图,包括:In detail, the S2 can refer to the detailed implementation flow diagram in Figure 3, including:
S21、统计所述拓扑数据集内不同节点ID对应的链路类型数组得到原始链路类型数组集;S21. Count the link type arrays corresponding to different node IDs in the topology data set to obtain the original link type array set;
S22、在所述原始链路类型数组集内去除重复的链路类型数组得到标准链路类型数组集;S22. Remove duplicate link type arrays in the original link type array set to obtain a standard link type array set;
S23、根据所述标准链路类型数组集的数量和数组,生成所述链路类型图例集。S23. Generate the link type legend set according to the number and array of the standard link type array sets.
如在上述网络设备拓扑数据集中,包括工作站的拓扑数据、交换机的拓扑数据、路由器的拓扑数据、服务器组的拓扑数据,分别统计工作站节点、交换机节点、路由器节点及服务器组节点对应的链路类型数组得到原始链路类型数组集。For example, in the above-mentioned network device topology data set, including workstation topology data, switch topology data, router topology data, and server group topology data, respectively count the link types corresponding to workstation nodes, switch nodes, router nodes, and server group nodes array to get the original link type array set.
进一步地,所述链路类型数组可采用多种表现形式,简单来说,如工作站节点的链路类型数组为[(w,530,2)],交换机节点的链路类型数组为[(530,w,2),(530,2621,2)],其中w表示工作站节点,530表示交换机节点(用交换机节点的型号命名),2621表示路由器(同理,2621为路由器型号),因为(w,530)与(530,w)本质表示的都是工作站节点与交换机节点之间的链路,因为重复表示所以剔除,进而得到所述标准链路类型数组集,需进一步说明的是,数字2表示的是交换机节点和工作站节点之间互相有数据传输,数字0表示前者节点传输数据给后者节点,1表示后者节点传输数据给前者节点。Further, the link type array can adopt multiple representation forms. In simple terms, for example, the link type array of the workstation node is [(w, 530, 2)], and the link type array of the switch node is [(530 ,w,2), (530,2621,2)], where w represents the workstation node, 530 represents the switch node (named after the model of the switch node), and 2621 represents the router (similarly, 2621 is the router model), because (w ,530) and (530,w) essentially represent the link between the workstation node and the switch node, which are removed because of repeated representation, and then the standard link type array set is obtained. It should be further explained that the number 2 It means that there is data transmission between the switch node and the workstation node. The number 0 means that the former node transmits data to the latter node, and 1 means that the latter node transmits data to the former node.
详细地,可预先构建链路类型图例库,根据所述标准链路类型数组集的数量和数组,从所述链路类型图例库中选择链路类型图例生成所述链路类型图例集。所述链路类型图例库中的图例均由图形符号数据和类型名称数据组成,所述图形符号数据可以使用不同大小、颜色、形状来表示,目的是让使用者能够对不同的图例进行辨别和区分,所述类型名称数据是节点之间的不同进行对应显示,具体地,所述图形符号数据和类型名称数据在拓扑图中的表示形式请参阅图4的图例举例图。Specifically, a link type legend library may be pre-built, and a link type legend is selected from the link type legend library to generate the link type legend set according to the number and array of the standard link type array sets. The legends in the link type legend library are all composed of graphic symbol data and type name data. The graphic symbol data can be represented by different sizes, colors, and shapes, so that users can distinguish and identify different legends. To distinguish, the type name data is displayed correspondingly according to the difference between nodes. Specifically, for the representation form of the graphic symbol data and type name data in the topology map, please refer to the example diagram of the legend in FIG. 4 .
S3、解析所述节点控制参数集内每个节点之间的链路连接关系及链路端点类型,分别得到链路连接线集和链路端点类型集。S3. Analyzing the link connection relationship and the link endpoint type between each node in the node control parameter set to obtain a link connection line set and a link endpoint type set respectively.
详细地,所述S3的详细步骤可参阅图5的详细实施流程示意图,包括:In detail, the detailed steps of S3 can refer to the detailed implementation flow diagram in Figure 5, including:
S31、从所述节点控制参数集中不重复的选择两个节点得到第一节点和第二节点;S31. Select two nodes without repetition from the node control parameter set to obtain a first node and a second node;
S32、查询所述第一节点和所述第二节点分别在所述拓扑数据集内各自对应的链路类型数组,得到第一链路类型数组和第二链路类型数组;S32. Query the link type arrays corresponding to the first node and the second node respectively in the topology data set, to obtain a first link type array and a second link type array;
S33、判断所述第一链路类型数组和所述第二链路类型数组之间是否有数组重合;S33. Determine whether there is overlap between the first link type array and the second link type array;
S34、若所述第一链路类型数组和所述第二链路类型数组之间没有数组重合,重新在所述节点控制参数集中不重复的选择两个节点;S34. If there is no array overlap between the first link type array and the second link type array, re-select two nodes in the node control parameter set without repetition;
S35、若所述第一链路类型数组和所述第二链路类型数组之间有数组重合,则根据所述数组重合的数据生成链路连接线和链路端点,当所述节点控制参数集全部选择完成,汇集所有链路连接线得到所述链路连接线集,汇集所有链路端点得到链路端点类型集。S35. If there is overlap between the array of the first link type and the array of the second link type, generate link connection lines and link endpoints according to the overlapped data of the arrays, when the node control parameters After the selection of all the sets is completed, all link connecting lines are collected to obtain the link connecting line set, and all link end points are collected to obtain a link end point type set.
所述数据重合的判定标准要依据链路类型数组形式的不同而设定对应的判断标准,如工作站节点的链路类型数组为[(w,530,2)],交换机节点的链路类型数组为[(530,w,2),(530,2621,2)],因为(w,530)与(530,w)本质表示的都是工作站节点与交换机节点之间的链路,而数字2是相同的,因此工作站节点的链路类型数组和交换机节点的链路类型数组在(530,w,2)出有数据重合,因此得知工作站节点与交换机节点的数据重合为(530,w,2),进一步将所述(530,w,2)进行拆分,如将(530,w,2)拆分为(530,w)和(2),其中(530,w)表示工作站节点和交换机节点需要链路连接线,(2)表示工作站节点和交换机节点是相互交互数据的链路端点形式。The judging criteria for said data coincidence will be based on the different forms of the link type arrays and set the corresponding judging criteria, such as the link type array of the workstation node is [(w, 530, 2)], the link type array of the switch node is [(w, 530, 2)]. It is [(530,w,2), (530,2621,2)], because (w,530) and (530,w) essentially represent the link between the workstation node and the switch node, and the number 2 are the same, so the link type array of the workstation node and the link type array of the switch node have data overlap at (530,w,2), so it is known that the data overlap of the workstation node and the switch node is (530,w, 2), further split the (530, w, 2), such as splitting (530, w, 2) into (530, w) and (2), where (530, w) represents the workstation node and The switch node needs a link connection line, and (2) indicates that the workstation node and the switch node are in the form of link endpoints that exchange data with each other.
S4、从所述链路类型图例集中选择与所述链路连接线集及所述链路端点类型集对应的图例集,使用前端网络拓扑图绘制技术并根据所述图例集和所述节点控制参数集绘制所述拓扑数据集的拓扑图。S4. Select a legend set corresponding to the link connection line set and the link end point type set from the link type legend set, use the front-end network topology drawing technology and control according to the legend set and the node The parameter set draws a topology map of the topology dataset.
若各节点之间存在大量的链路连接线,用户面对交错在一起、数量众多的链路连接线时难以快速、准确地识别拓扑图的关系信息,因此所述第一节点和所述第二节点的链路连接线均为单根连接线,如上述(530,w)表示工作站节点和交换机节点需要链路连接线,(2)表示工作站节点和交换机节点是相互交互数据的链路端点形式,进而从所述链路类型图例库中不重复的选择出一个链路类型图例与所述(530,w,2)对应,如链路连接线为粗线加黑、链路端点为箭头且为链路连接线为双箭头的形式,根据上述HTML5、基于Web的JGraphx、echarts等网络拓扑图绘制方法,在所述预构建的空白拓扑图中完成绘制。If there are a large number of link connecting lines between the nodes, it is difficult for the user to quickly and accurately identify the relationship information of the topology map when faced with a large number of intertwined link connecting lines. Therefore, the first node and the second The link connecting lines of the two nodes are all single connecting lines, such as the above (530,w) indicates that the workstation node and the switch node need a link connecting line, (2) indicates that the workstation node and the switch node are the link endpoints for mutual data exchange form, and then select a link type legend corresponding to (530, w, 2) from the link type legend library without repetition, such as the link connecting line is a thick line and blackened, and the link end point is an arrow And the link connection line is in the form of double arrows, and the drawing is completed in the pre-built blank topology map according to the above-mentioned HTML5, Web-based JGraphx, echarts and other network topology map drawing methods.
如图6所示,是本发明网络拓扑图绘制装置的功能模块图。As shown in FIG. 6 , it is a functional block diagram of the device for drawing a network topology diagram according to the present invention.
本发明所述网络拓扑图绘制装置100可以安装于电子设备中。根据实现的功能,所述网络拓扑图绘制装置可以包括节点解析模块101、链路类型图例生成模块102、链路连接及链路端点生成模块103和网络拓扑图绘制模块104。本发所述模块也可以称之为单元,是指一种能够被电子设备处理器所执行,并且能够完成固定功能的一系列计算机程序段,其存储在电子设备的存储器中。The apparatus 100 for drawing a network topology map according to the present invention can be installed in an electronic device. According to the realized functions, the device for drawing the network topology map may include a node analysis module 101 , a link type legend generation module 102 , a link connection and link end point generation module 103 and a network topology
在本实施例中,关于各模块/单元的功能如下:In this embodiment, the functions of each module/unit are as follows:
所述节点解析模块101用于对拓扑数据集进行节点解析生成节点控制参数集。The node parsing module 101 is used for performing node parsing on the topology data set to generate a node control parameter set.
所述链路类型图例生成模块102用于根据所述拓扑数据集的链路类型生成与所述节点控制参数集对应的链路类型图例集。The link type legend generation module 102 is configured to generate a link type legend set corresponding to the node control parameter set according to the link type of the topology data set.
所述链路连接及链路端点生成模块103用于解析所述节点控制参数集内每个节点之间的链路连接关系得到链路连接线集,解析所述节点控制参数集内每个节点之间的链路端点类型得到链路端点类型集。The link connection and link endpoint generation module 103 is used to analyze the link connection relationship between each node in the node control parameter set to obtain a link connection line set, and analyze each node in the node control parameter set The link endpoint types between get the link endpoint type set.
所述网络拓扑图绘制模块104用于从所述链路类型图例集中选择与所述链路连接线集及所述链路端点类型集对应的图例集,使用前端网络拓扑图绘制技术并根据所述图例集和所述节点控制参数集,绘制所述拓扑数据集的网络拓扑图。The network topology
本申请所提供的装置中的模块能够在使用时基于与上述的网络拓扑图绘制方法,在于根据拓扑数据集进行节点解析、生成链路端点类型及链路连接线,进而完成网络拓扑图绘制,其在具体运行时可以取得上述的方法实施例一样的技术效果,即有效的解决多链路类型下绘图复杂占用内存空间的问题。The modules in the device provided by this application can be used based on the above-mentioned network topology map drawing method, which is to perform node analysis according to the topology data set, generate link end point types and link connection lines, and then complete the network topology map drawing, It can achieve the same technical effect as the above-mentioned method embodiments during specific operation, that is, it can effectively solve the problem of complex drawing and occupying memory space under the multi-link type.
如图7所示,是本发明实现网络拓扑图绘制方法的电子设备的结构示意图。As shown in FIG. 7 , it is a schematic structural diagram of an electronic device implementing the method for drawing a network topology map according to the present invention.
所述电子设备1可以包括处理器12、存储器11和总线,还可以包括存储在所述存储器11中并可在所述处理器12上运行的计算机程序。The electronic device 1 may include a processor 12 , a memory 11 and a bus, and may also include a computer program stored in the memory 11 and operable on the processor 12 .
其中,所述存储器11至少包括一种类型的可读存储介质,所述可读存储介质包括闪存、移动硬盘、多媒体卡、卡型存储器(例如:SD或DX存储器等)、磁性存储器、磁盘、光盘等。所述存储器11在一些实施例中可以是电子设备1的内部存储单元,例如该电子设备1的移动硬盘。所述存储器11在另一些实施例中也可以是电子设备1的外部存储设备,例如电子设备1上配备的插接式移动硬盘、智能存储卡(Smart Media Card,SMC)、安全数字(SecureDigital,SD)卡、闪存卡(Flash Card)等。进一步地,所述存储器11还可以既包括电子设备1的内部存储单元也包括外部存储设备。所述存储器11不仅可以用于存储安装于电子设备1的应用软件及各类数据,例如网络拓扑图绘制程序的代码等,还可以用于暂时地存储已经输出或者将要输出的数据。Wherein, the memory 11 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, mobile hard disk, multimedia card, card type memory (for example: SD or DX memory, etc.), magnetic memory, magnetic disk, CD etc. The storage 11 may be an internal storage unit of the electronic device 1 in some embodiments, such as a mobile hard disk of the electronic device 1 . The memory 11 can also be an external storage device of the electronic device 1 in other embodiments, such as a plug-in mobile hard disk equipped on the electronic device 1, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, flash memory card (Flash Card), etc. Further, the memory 11 may also include both an internal storage unit of the electronic device 1 and an external storage device. The memory 11 can not only be used to store application software and various data installed in the electronic device 1 , such as codes of a network topology map drawing program, but also can be used to temporarily store data that has been output or will be output.
所述处理器12在一些实施例中可以由集成电路组成,例如可以由单个封装的集成电路所组成,也可以是由多个相同功能或不同功能封装的集成电路所组成,包括一个或者多个中央处理器(Central Processing unit,CPU)、微处理器、数字处理芯片、图形处理器及各种控制芯片的组合等。所述处理器12是所述电子设备的控制核心(Control Unit),利用各种接口和线路连接整个电子设备的各个部件,通过运行或执行存储在所述存储器11内的程序或者模块(例如执行网络拓扑图绘制程序等),以及调用存储在所述存储器11内的数据,以执行电子设备1的各种功能和处理数据。In some embodiments, the processor 12 may be composed of an integrated circuit, for example, may be composed of a single packaged integrated circuit, or may be composed of multiple integrated circuits with the same function or different functions, including one or more Central processing unit (Central Processing unit, CPU), microprocessor, digital processing chip, graphics processor and a combination of various control chips, etc. The processor 12 is the control core (Control Unit) of the electronic device, and uses various interfaces and lines to connect the various components of the entire electronic device, and runs or executes programs or modules stored in the memory 11 (such as executing network topology drawing program, etc.), and call the data stored in the memory 11 to execute various functions of the electronic device 1 and process data.
所述总线可以是外设部件互连标准(peripheral component interconnect,简称PCI)总线或扩展工业标准结构(extended industry standard architecture,简称EISA)总线等。该总线可以分为地址总线、数据总线、控制总线等。所述总线被设置为实现所述存储器11以及至少一个处理器12等之间的连接通信。The bus may be a peripheral component interconnect standard (PCI for short) bus or an extended industry standard architecture (EISA for short) bus or the like. The bus can be divided into address bus, data bus, control bus and so on. The bus is configured to realize connection and communication between the memory 11 and at least one processor 12 and the like.
图7仅示出了具有部件的电子设备,本领域技术人员可以理解的是,图7示出的结构并不构成对所述电子设备1的限定,可以包括比图示更少或者更多的部件,或者组合某些部件,或者不同的部件布置。FIG. 7 only shows an electronic device with components. Those skilled in the art can understand that the structure shown in FIG. 7 does not constitute a limitation on the electronic device 1, and may include fewer or more components, or combinations of certain components, or different arrangements of components.
例如,尽管未示出,所述电子设备1还可以包括给各个部件供电的电源(比如电池),优选地,电源可以通过电源管理装置与所述至少一个处理器10逻辑相连,从而通过电源管理装置实现充电管理、放电管理、以及功耗管理等功能。电源还可以包括一个或一个以上的直流或交流电源、再充电装置、电源故障检测电路、电源转换器或者逆变器、电源状态指示器等任意组件。所述电子设备1还可以包括多种传感器、蓝牙模块、Wi-Fi模块等,在此不再赘述。For example, although not shown, the electronic device 1 can also include a power supply (such as a battery) for supplying power to various components. Preferably, the power supply can be logically connected to the at least one processor 10 through a power management device, so that the power supply can be controlled by power management. The device implements functions such as charge management, discharge management, and power consumption management. The power supply may also include one or more DC or AC power supplies, recharging devices, power failure detection circuits, power converters or inverters, power status indicators and other arbitrary components. The electronic device 1 may also include various sensors, bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.
进一步地,所述电子设备1还可以包括网络接口,可选地,所述网络接口可以包括有线接口和/或无线接口(如WI-FI接口、蓝牙接口等),通常用于在该电子设备1与其他电子设备之间建立通信连接。Further, the electronic device 1 may also include a network interface, optionally, the network interface may include a wired interface and/or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which are usually used in the electronic device 1 Establish a communication connection with other electronic devices.
可选地,该电子设备1还可以包括用户接口,用户接口可以是显示器(Display)、输入单元(比如键盘(Keyboard)),可选地,用户接口还可以是标准的有线接口、无线接口。可选地,在一些实施例中,显示器可以是LED显示器、液晶显示器、触控式液晶显示器以及OLED(Organic Light-Emitting Diode,有机发光二极管)触摸器等。其中,显示器也可以适当的称为显示屏或显示单元,用于显示在电子设备1中处理的信息以及用于显示可视化的用户界面。Optionally, the electronic device 1 may further include a user interface, which may be a display (Display) or an input unit (such as a keyboard (Keyboard)). Optionally, the user interface may also be a standard wired interface or a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode, organic light-emitting diode) touch device, and the like. Wherein, the display may also be appropriately called a display screen or a display unit, and is used for displaying information processed in the electronic device 1 and for displaying a visualized user interface.
应该了解,所述实施例仅为说明之用,在专利申请范围上并不受此结构的限制。It should be understood that the embodiments are only for illustration, and are not limited by the structure in the scope of the patent application.
所述电子设备1中的所述存储器11存储的请求网络拓扑图绘制程序12是多个指令的组合,在所述处理器10中运行时,可以实现:The request network topology map drawing program 12 stored in the memory 11 in the electronic device 1 is a combination of multiple instructions. When running in the processor 10, it can realize:
步骤一、获取拓扑数据集,对所述拓扑数据集进行节点解析生成节点控制参数集。Step 1: Obtain a topology data set, and perform node analysis on the topology data set to generate a node control parameter set.
拓扑是指设备、参数等之间的联系,具体地,如计算机网络领域的拓扑(ComputerNetwork Topology),是指由计算机组成的网络设备之间的分布情况以及相互的连接状态,进一步地,拓扑图是指根据所述拓扑将计算机组成的网络设备画在对应的图上即为所述拓扑图,一般的拓扑图要求在图上要标明设备所处的位置、设备名称类型以及设备间的连接介质类型等。Topology refers to the connection between devices, parameters, etc. Specifically, such as the topology in the field of computer networks (ComputerNetwork Topology), refers to the distribution and mutual connection status of network devices composed of computers. Further, the topology map Refers to drawing the network equipment composed of computers on the corresponding diagram according to the topology, which is the topology diagram. The general topology diagram requires the location of the device, the type of device name and the connection medium between the devices to be marked on the diagram. type etc.
本发明所述拓扑数据集包括但不限于节点ID、节点名称、节点类型、节点位置数据、节点类型、连接节点ID和与所述节点ID对应的链路类型数组,如上述计算机组成的网络设备之间需要绘制拓扑图时,首先需要知道不同网络设备的节点ID、节点名称、节点类型、节点位置数据、节点类型、连接节点ID和与所述节点ID对应的链路类型数组等拓扑数据,汇集不同网络设备的拓扑数据得到拓扑数据集,如工作站节点的拓扑数据、交换机节点的拓扑数据、路由器节点的拓扑数据、服务器组节点的拓扑数据等。The topology data set of the present invention includes but not limited to node ID, node name, node type, node location data, node type, connection node ID and link type array corresponding to the node ID, such as the network equipment composed of the above-mentioned computers When it is necessary to draw a topology map, it is first necessary to know topological data such as node IDs, node names, node types, node location data, node types, connection node IDs, and link type arrays corresponding to the node IDs of different network devices. Gather topology data of different network devices to obtain topology data sets, such as topology data of workstation nodes, topology data of switch nodes, topology data of router nodes, topology data of server group nodes, etc.
较佳地,所述拓扑数据集可采用客户端向后台服务器发送拓扑数据的获取请求,通过所述后台服务器接收所述获取请求并返回拓扑数据集的形式,其中,所述拓扑数据集的格式包括但不限于yaml、xml以及json。Preferably, the topology data set can be in the form that the client sends a topology data acquisition request to the background server, and the background server receives the acquisition request and returns the topology data set, wherein the format of the topology data set is Including but not limited to yaml, xml and json.
详细地,所述对所述拓扑数据集进行节点解析生成节点控制参数集,包括:Specifically, the performing node analysis on the topology data set to generate a node control parameter set includes:
从所述拓扑数据集中提取所述节点ID、所述节点类型以及所述节点位置数据;extracting the node ID, the node type, and the node location data from the topology dataset;
根据所述节点ID、所述节点类型以及所述节点位置数据,使用所述前端网络拓扑图绘制技术在预构建的原始拓扑图中生成所述节点控制参数集。According to the node ID, the node type, and the node location data, the node control parameter set is generated in a pre-built original topology map using the front-end network topology map drawing technology.
所述前端网络拓扑图绘制技术可采用基于HTML5的网络拓扑图绘制方法、基于Web的JGraphx的拓扑图方法、echarts的网络拓扑图绘制方法等。The front-end network topology drawing technology may adopt a network topology drawing method based on HTML5, a Web-based JGraphx topology drawing method, an echarts network topology drawing method, and the like.
进一步地,所述原始拓扑图可使用HTML技术提前绘制的一张空白网页,根据上述HTML5、基于Web的JGraphx、echarts等网络拓扑图绘制方法,并以所述节点ID、所述节点类型以及所述节点位置数据为参数,在所述空白网页中绘制节点信息,并记录节点信息得到节点控制参数集,由此可知所述节点控制参数集是绘制在所述空白网页的前端参数。Further, the original topology map can use a blank web page drawn in advance by HTML technology, according to the above-mentioned HTML5, Web-based JGraphx, echarts and other network topology map drawing methods, and use the node ID, the node type and the The node position data is used as a parameter, the node information is drawn in the blank webpage, and the node information is recorded to obtain the node control parameter set, so it can be seen that the node control parameter set is the front-end parameter drawn in the blank webpage.
步骤二、根据所述拓扑数据集的链路类型生成与所述节点控制参数集对应的链路类型图例集。Step 2: Generate a link type legend set corresponding to the node control parameter set according to the link type of the topology data set.
详细地,所述根据所述拓扑数据集的链路类型生成与所述节点控制参数集对应的链路类型图例集,包括:Specifically, the generating the link type legend set corresponding to the node control parameter set according to the link type of the topology data set includes:
统计所述拓扑数据集内不同节点ID对应的链路类型数组得到原始链路类型数组集;Count the link type arrays corresponding to different node IDs in the topology data set to obtain the original link type array set;
在所述原始链路类型数组集内去除重复的链路类型数组得到标准链路类型数组集;removing duplicate link type arrays in the original link type array set to obtain a standard link type array set;
根据所述标准链路类型数组集的数量和数组,生成所述链路类型图例集。The link type illustration set is generated according to the quantity and array of the standard link type array sets.
如在上述网络设备拓扑数据集中,包括工作站的拓扑数据、交换机的拓扑数据、路由器的拓扑数据、服务器组的拓扑数据,分别统计工作站节点、交换机节点、路由器节点及服务器组节点对应的链路类型数组得到原始链路类型数组集。For example, in the above-mentioned network device topology data set, including workstation topology data, switch topology data, router topology data, and server group topology data, respectively count the link types corresponding to workstation nodes, switch nodes, router nodes, and server group nodes array to get the original link type array set.
进一步地,所述链路类型数组可采用多种表现形式,简单来说,如工作站节点的链路类型数组为[(w,530,2)],交换机节点的链路类型数组为[(530,w,2),(530,2621,2)],其中w表示工作站节点,530表示交换机节点(用交换机节点的型号命名),2621表示路由器(同理,2621为路由器型号),因为(w,530)与(530,w)本质表示的都是工作站节点与交换机节点之间的链路,因为重复表示所以剔除,进而得到所述标准链路类型数组集,需进一步说明的是,数字2表示的是交换机节点和工作站节点之间互相有数据传输,数字0表示前者节点传输数据给后者节点,1表示后者节点传输数据给前者节点。Further, the link type array can adopt multiple representation forms. In simple terms, for example, the link type array of the workstation node is [(w, 530, 2)], and the link type array of the switch node is [(530 ,w,2), (530,2621,2)], where w represents the workstation node, 530 represents the switch node (named after the model of the switch node), and 2621 represents the router (similarly, 2621 is the router model), because (w ,530) and (530,w) essentially represent the link between the workstation node and the switch node, which are removed because of repeated representation, and then the standard link type array set is obtained. It should be further explained that the number 2 It means that there is data transmission between the switch node and the workstation node. The number 0 means that the former node transmits data to the latter node, and 1 means that the latter node transmits data to the former node.
详细地,可预先构建链路类型图例库,根据所述标准链路类型数组集的数量和数组,从所述链路类型图例库中选择链路类型图例生成所述链路类型图例集。所述链路类型图例库中的图例均由图形符号数据和类型名称数据组成,所述图形符号数据可以使用不同大小、颜色、形状来表示,目的是让使用者能够对不同的图例进行辨别和区分,所述类型名称数据是节点之间的不同进行对应显示,具体地,所述图形符号数据和类型名称数据在拓扑图中的表示形式请参阅图4的图例举例图。Specifically, a link type legend library may be pre-built, and a link type legend is selected from the link type legend library to generate the link type legend set according to the number and array of the standard link type array sets. The legends in the link type legend library are all composed of graphic symbol data and type name data. The graphic symbol data can be represented by different sizes, colors, and shapes, so that users can distinguish and identify different legends. To distinguish, the type name data is displayed correspondingly according to the difference between nodes. Specifically, for the representation form of the graphic symbol data and type name data in the topology map, please refer to the example diagram of the legend in FIG. 4 .
步骤三、解析所述节点控制参数集内每个节点之间的链路连接关系及链路端点类型,分别得到链路连接线集和链路端点类型集。Step 3: Analyzing the link connection relationship and the link end point type between each node in the node control parameter set, and obtaining the link connection line set and the link end point type set respectively.
详细地,所述解析所述节点控制参数集内每个节点之间的链路连接关系及链路端点类型,分别得到链路连接线集和链路端点类型集,包括:Specifically, the parsing of the link connection relationship and link endpoint type between each node in the node control parameter set obtains a link connection line set and a link endpoint type set respectively, including:
从所述节点控制参数集中不重复的选择两个节点得到第一节点和第二节点;Selecting two nodes without repetition from the node control parameter set to obtain a first node and a second node;
查询所述第一节点和所述第二节点分别在所述拓扑数据集内各自对应的链路类型数组,得到第一链路类型数组和第二链路类型数组;Querying the link type arrays corresponding to the first node and the second node respectively in the topology data set to obtain the first link type array and the second link type array;
判断所述第一链路类型数组和所述第二链路类型数组之间是否有数组重合;judging whether there is overlap of arrays between the first link type array and the second link type array;
若所述第一链路类型数组和所述第二链路类型数组之间没有数组重合,重新在所述节点控制参数集中不重复的选择两个节点;If there is no array overlap between the first link type array and the second link type array, re-select two nodes in the node control parameter set without repetition;
若所述第一链路类型数组和所述第二链路类型数组之间有数组重合,则根据所述数组重合的数据生成链路连接线和链路端点,当所述节点控制参数集全部选择完成,汇集所有链路连接线得到所述链路连接线集,汇集所有链路端点得到链路端点类型集。If there is an array overlap between the first link type array and the second link type array, link connection lines and link endpoints are generated according to the overlapped data of the arrays, when the node control parameter set is all If the selection is completed, all link connection lines are collected to obtain the link connection line set, and all link end points are collected to obtain a link end point type set.
所述数据重合的判定标准要依据链路类型数组形式的不同而设定对应的判断标准,如工作站节点的链路类型数组为[(w,530,2)],交换机节点的链路类型数组为[(530,w,2),(530,2621,2)],因为(w,530)与(530,w)本质表示的都是工作站节点与交换机节点之间的链路,而数字2是相同的,因此工作站节点的链路类型数组和交换机节点的链路类型数组在(530,w,2)出有数据重合,因此得知工作站节点与交换机节点的数据重合为(530,w,2),进一步将所述(530,w,2)进行拆分,如将(530,w,2)拆分为(530,w)和(2),其中(530,w)表示工作站节点和交换机节点需要链路连接线,(2)表示工作站节点和交换机节点是相互交互数据的链路端点形式。The judging criteria for said data coincidence will be based on the different forms of the link type arrays and set the corresponding judging criteria, such as the link type array of the workstation node is [(w, 530, 2)], the link type array of the switch node is [(w, 530, 2)]. It is [(530,w,2), (530,2621,2)], because (w,530) and (530,w) essentially represent the link between the workstation node and the switch node, and the number 2 are the same, so the link type array of the workstation node and the link type array of the switch node have data overlap at (530,w,2), so it is known that the data overlap of the workstation node and the switch node is (530,w, 2), further split the (530, w, 2), such as splitting (530, w, 2) into (530, w) and (2), where (530, w) represents the workstation node and The switch node needs a link connection line, and (2) indicates that the workstation node and the switch node are in the form of link endpoints that exchange data with each other.
步骤四、从所述链路类型图例集中选择与所述链路连接线集及所述链路端点类型集对应的图例集,使用前端网络拓扑图绘制技术并根据所述图例集和所述节点控制参数集绘制所述拓扑数据集的拓扑图。Step 4. Select a legend set corresponding to the link connection line set and the link end point type set from the link type legend set, use the front-end network topology drawing technology and according to the legend set and the node A set of control parameters draws a topology map of the topology dataset.
若各节点之间存在大量的链路连接线,用户面对交错在一起、数量众多的链路连接线时难以快速、准确地识别拓扑图的关系信息,因此所述第一节点和所述第二节点的链路连接线均为单根连接线,如上述(530,w)表示工作站节点和交换机节点需要链路连接线,(2)表示工作站节点和交换机节点是相互交互数据的链路端点形式,进而从所述链路类型图例库中不重复的选择出一个链路类型图例与所述(530,w,2)对应,如链路连接线为粗线加黑、链路端点为箭头且为链路连接线为双箭头的形式,根据上述HTML5、基于Web的JGraphx、echarts等网络拓扑图绘制方法,在所述预构建的空白拓扑图中完成绘制。If there are a large number of link connecting lines between the nodes, it is difficult for the user to quickly and accurately identify the relationship information of the topology map when faced with a large number of intertwined link connecting lines. Therefore, the first node and the second The link connecting lines of the two nodes are all single connecting lines, such as the above (530,w) indicates that the workstation node and the switch node need a link connecting line, (2) indicates that the workstation node and the switch node are the link endpoints for mutual data exchange form, and then select a link type legend corresponding to (530, w, 2) from the link type legend library without repetition, such as the link connecting line is a thick line and blackened, and the link end point is an arrow And the link connection line is in the form of double arrows, and the drawing is completed in the pre-built blank topology map according to the above-mentioned HTML5, Web-based JGraphx, echarts and other network topology map drawing methods.
进一步地,所述电子设备1集成的模块/单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。所述计算机可读介质可以包括:能够携带所述计算机程序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(ROM,Read-Only Memory)。Further, if the integrated modules/units of the electronic device 1 are realized in the form of software function units and sold or used as independent products, they can be stored in a computer-readable storage medium. The computer-readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a removable hard disk, a magnetic disk, an optical disk, a computer memory, and a read-only memory (ROM, Read-Only Memory) .
本发明实施例中,所述计算机可读存储介质上存储的请求网络拓扑图绘制程序可被一个或多个处理器执行,以实现如下操作:In the embodiment of the present invention, the program for drawing the request network topology map stored on the computer-readable storage medium may be executed by one or more processors to implement the following operations:
对拓扑数据集进行节点解析生成节点控制参数集;Perform node analysis on the topology data set to generate a node control parameter set;
根据所述拓扑数据集的链路类型生成与所述节点控制参数集对应的链路类型图例集;generating a link type legend set corresponding to the node control parameter set according to the link type of the topology data set;
解析所述节点控制参数集内每个节点之间的链路连接关系得到链路连接线集,解析所述节点控制参数集内每个节点之间的链路端点类型得到链路端点类型集;Analyzing the link connection relationship between each node in the node control parameter set to obtain a link connection line set, and analyzing the link endpoint type between each node in the node control parameter set to obtain a link endpoint type set;
从所述链路类型图例集中选择与所述链路连接线集及所述链路端点类型集对应的图例集,使用前端网络拓扑图绘制技术并根据所述图例集和所述节点控制参数集,绘制所述拓扑数据集的网络拓扑图。Select a legend set corresponding to the link connection line set and the link end point type set from the link type legend set, use the front-end network topology map drawing technology and control the parameter set according to the legend set and the node. , draw a network topology map of the topology dataset.
在本发明所提供的几个实施例中,应该理解到,所揭露的设备,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。In the several embodiments provided by the present invention, it should be understood that the disclosed devices, devices and methods can be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.
所述作为分离部件说明的模块可以是或者也可以不是物理上分开的,作为模块显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
另外,在本发明各个实施例中的各功能模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能模块的形式实现。In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, or each unit may physically exist separately, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware, or in the form of hardware plus software function modules.
对于本领域技术人员而言,显然本发明不限于上述示范性实施例的细节,而且在不背离本发明的精神或基本特征的情况下,能够以其他的具体形式实现本发明。It will be apparent to those skilled in the art that the invention is not limited to the details of the above-described exemplary embodiments, but that the invention can be embodied in other specific forms without departing from the spirit or essential characteristics of the invention.
因此,无论从哪一点来看,均应将实施例看作是示范性的,而且是非限制性的,本发明的范围由所附权利要求而不是上述说明限定,因此旨在将落在权利要求的等同要件的含义和范围内的所有变化涵括在本发明内。不应将权利要求中的任何附关联图标记视为限制所涉及的权利要求。Accordingly, the embodiments should be regarded in all points of view as exemplary and not restrictive, the scope of the invention being defined by the appended claims rather than the foregoing description, and it is therefore intended that the scope of the invention be defined by the appended claims rather than by the foregoing description. All changes within the meaning and range of equivalents of the elements are embraced in the present invention. Any reference sign in a claim should not be construed as limiting the claim concerned.
此外,显然“包括”一词不排除其他单元或步骤,单数不排除复数。系统权利要求中陈述的多个单元或装置也可以由一个单元或装置通过软件或者硬件来实现。第二等词语用来表示名称,而并不表示任何特定的顺序。In addition, it is obvious that the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. A plurality of units or devices stated in the system claims may also be realized by one unit or device through software or hardware. Secondary terms are used to denote names without implying any particular order.
最后应说明的是,以上实施例仅用以说明本发明的技术方案而非限制,尽管参照较佳实施例对本发明进行了详细说明,本领域的普通技术人员应当理解,可以对本发明的技术方案进行修改或等同替换,而不脱离本发明技术方案的精神和范围。Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention without limitation. Although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present invention can be Modifications or equivalent replacements can be made without departing from the spirit and scope of the technical solutions of the present invention.
Claims (8)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911267813.6A CN111181769B (en) | 2019-12-11 | 2019-12-11 | Network topological graph drawing method, system, device and computer readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911267813.6A CN111181769B (en) | 2019-12-11 | 2019-12-11 | Network topological graph drawing method, system, device and computer readable storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111181769A CN111181769A (en) | 2020-05-19 |
CN111181769B true CN111181769B (en) | 2023-04-07 |
Family
ID=70650143
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911267813.6A Active CN111181769B (en) | 2019-12-11 | 2019-12-11 | Network topological graph drawing method, system, device and computer readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111181769B (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111970202B (en) * | 2020-08-28 | 2021-09-10 | 电子科技大学 | Network topology discovery method based on three-way sub-topology measurement |
CN112636988B (en) * | 2020-12-31 | 2023-04-07 | 中电长城网际安全技术研究院(北京)有限公司 | Network topology generation method, electronic device and computer readable medium |
CN113066174A (en) * | 2021-04-27 | 2021-07-02 | 深圳市商汤科技有限公司 | Point cloud data processing method and device, computer equipment and storage medium |
CN113364632B (en) * | 2021-06-16 | 2022-07-01 | 中移(杭州)信息技术有限公司 | Method, device, storage medium and device for generating business system architecture diagram |
Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102855315A (en) * | 2012-08-28 | 2013-01-02 | 曙光信息产业(北京)有限公司 | Cluster network topology presentation method based on HTML5 (HyperText Markup Language 5) |
CN102891765A (en) * | 2012-09-05 | 2013-01-23 | 曙光云计算技术有限公司 | SNMP (Simple Network Management Protocol) and HTML5 (Hypertext Markup Language 5)-based method for realizing web network topology |
CN102932201A (en) * | 2012-09-26 | 2013-02-13 | 迈普通信技术股份有限公司 | Display control system and method for network monitoring data |
CN103873277A (en) * | 2012-12-12 | 2014-06-18 | 中国科学院声学研究所 | Layered network topology visualizing method and system |
CN104243201A (en) * | 2014-08-21 | 2014-12-24 | 东软集团股份有限公司 | Method and system for storing topological graph corresponding to network equipment test case |
CN104378240A (en) * | 2014-11-26 | 2015-02-25 | 浪潮电子信息产业股份有限公司 | Method for flexibly customizing topology view for monitoring |
CN107749803A (en) * | 2017-10-16 | 2018-03-02 | 浙江宇视科技有限公司 | A kind of network topology layout method and device |
CN109783568A (en) * | 2018-12-29 | 2019-05-21 | 咪咕文化科技有限公司 | Method and device for generating network topological graph and storage medium |
CN110086665A (en) * | 2019-04-25 | 2019-08-02 | 北京计算机技术及应用研究所 | A kind of network topological diagram methods of exhibiting based on jTopo |
CN110557288A (en) * | 2019-09-16 | 2019-12-10 | 鹏城实验室 | Network visualization editing and automatic deployment system based on OpenStack |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8027273B2 (en) * | 2008-09-24 | 2011-09-27 | The United States Of America As Represented By The Secretary Of The Army | System and method for visually creating, editing, manipulating, verifying, and/or animating desired topologies of a mobile ad hoc network and/or for generating mobility-pattern data |
-
2019
- 2019-12-11 CN CN201911267813.6A patent/CN111181769B/en active Active
Patent Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102855315A (en) * | 2012-08-28 | 2013-01-02 | 曙光信息产业(北京)有限公司 | Cluster network topology presentation method based on HTML5 (HyperText Markup Language 5) |
CN102891765A (en) * | 2012-09-05 | 2013-01-23 | 曙光云计算技术有限公司 | SNMP (Simple Network Management Protocol) and HTML5 (Hypertext Markup Language 5)-based method for realizing web network topology |
CN102932201A (en) * | 2012-09-26 | 2013-02-13 | 迈普通信技术股份有限公司 | Display control system and method for network monitoring data |
CN103873277A (en) * | 2012-12-12 | 2014-06-18 | 中国科学院声学研究所 | Layered network topology visualizing method and system |
CN104243201A (en) * | 2014-08-21 | 2014-12-24 | 东软集团股份有限公司 | Method and system for storing topological graph corresponding to network equipment test case |
CN104378240A (en) * | 2014-11-26 | 2015-02-25 | 浪潮电子信息产业股份有限公司 | Method for flexibly customizing topology view for monitoring |
CN107749803A (en) * | 2017-10-16 | 2018-03-02 | 浙江宇视科技有限公司 | A kind of network topology layout method and device |
CN109783568A (en) * | 2018-12-29 | 2019-05-21 | 咪咕文化科技有限公司 | Method and device for generating network topological graph and storage medium |
CN110086665A (en) * | 2019-04-25 | 2019-08-02 | 北京计算机技术及应用研究所 | A kind of network topological diagram methods of exhibiting based on jTopo |
CN110557288A (en) * | 2019-09-16 | 2019-12-10 | 鹏城实验室 | Network visualization editing and automatic deployment system based on OpenStack |
Non-Patent Citations (1)
Title |
---|
基于HTML5的网络拓扑展示系统的设计与实现;汪勇孝;《中国优秀博硕士学位论文全文数据库(硕士)信息科技辑》;20180615;参见第4章 * |
Also Published As
Publication number | Publication date |
---|---|
CN111181769A (en) | 2020-05-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111181769B (en) | Network topological graph drawing method, system, device and computer readable storage medium | |
CN112311571A (en) | Network topology generation method and device, electronic equipment and non-transient storage medium | |
CN100382075C (en) | Hardware-level-based test script automatic generation system and method | |
CN113051171B (en) | Interface testing method, device, equipment and storage medium | |
CN116436791A (en) | Industrial Internet scene construction method, system, equipment and storage medium | |
CN113890712A (en) | Data transmission method and device, electronic equipment and readable storage medium | |
CN109871408B (en) | A multi-type database adaptation method, device, electronic equipment and storage medium | |
WO2023134285A1 (en) | Risk management method and risk management apparatus | |
CN114780519A (en) | DBC file generation method, device, equipment and medium based on CAN communication | |
WO2020000657A1 (en) | Method and apparatus for establishing operation and maintenance monitoring connection, terminal device, and medium | |
CN116662123B (en) | Method and device for monitoring server component, electronic equipment and storage medium | |
CN114398282A (en) | Test script generation method, device, device and storage medium | |
CN115002011B (en) | Flow bidirectional test method and device, electronic equipment and storage medium | |
US20250004980A1 (en) | Method and system for communication between processors, storage medium, and processor | |
CN117315081A (en) | Electric single line diagram thematic map generation method based on panoramic electric network diagram data model | |
CN113691403B (en) | Topology node configuration method, related device and computer program product | |
CN111030863B (en) | Node topology information determination method, device, equipment and storage medium | |
CN104243201B (en) | Network equipment detection use-case corresponds to the storage method and system of topological diagram | |
CN115372810A (en) | Construction method, device, storage medium and equipment of relay protection digital twin body | |
CN107609008A (en) | A kind of data importing device and method from relevant database to Kafka based on Apache Sqoop | |
CN116841243B (en) | Intelligent PLC protocol format deducing method, fuzzy test method and device | |
CN113672482B (en) | Log message transmission method, device, equipment and medium of terminal equipment | |
CN116471190A (en) | Method for evaluating server topology architecture and electronic device | |
CN115277469A (en) | Weak network visual control method, device, electronic device and readable storage medium | |
WO2023185185A1 (en) | Network device management method and apparatus |
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 |