Method and system for generating a network topology map

By using matching models to instantiate the device in the network topology graph generation method and comprehensively judging the connection relationship and style, the problem of insufficient universality and accuracy of network topology graph generation in the prior art is solved, and a more efficient, accurate and economical network topology graph generation is achieved.

CN119316300BActive Publication Date: 2025-05-02ZHEJIANG GUOLI XINAN TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411838273.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-13
Publication Date
2025-05-02
Estimated Expiration
2044-12-13

AI Technical Summary

Technical Problem

When generating network topology maps, the prior art is not very universal, has insufficient accuracy, is costly, and is difficult to effectively deal with complex network structures.

Method used

By matching the model, the devices in the network topology diagram are instantiated, and the connection relationship and connection style of the network topology diagram are comprehensively judged based on the device's node attribute data and connection edge attribute data, thereby generating a network topology diagram.

Benefits of technology

It improves the universality and accuracy of the method of generating network topology maps, reduces costs, and solves the accuracy and universality of network topology map generation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119316300B_ABST
    Figure CN119316300B_ABST
Patent Text Reader

Abstract

The present disclosure provides a method and system for generating a network topology map, the method comprising: establishing a model of a device based on data provided by a supplier, wherein the model comprises node attributes and connection edge attributes associated with the node attributes; scanning all devices in the same network segment to obtain information data of each device; for each of all devices, filling the node attributes and connection edge attributes in the corresponding model with the information data to obtain a corresponding model instance; determining all second devices connected to a first device, the connection type between the second device and the first device, and the connection edge style based on the node attribute data and the connection edge attribute data in the model instance; and generating a network topology map based on the first device and the determined second devices connected to the first device, the connection type, and the connection edge style.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of network information and communication technology, and in particular to a method and system for generating a network topology map. Background Art

[0002] In the field of industrial communication, network topology diagrams play an important role in network architecture design and network management. Therefore, existing solutions provide some methods for drawing network topology diagrams.

[0003] One of the solutions is aimed at cluster management topology management of switches in gateways, and proposes an IP network management cluster topology method based on simple network management. In this method, the command switch first collects the topology data table in the management information base; then draws the cluster network topology map based on the topology data table read from the command switch, so as to quickly establish the topology link data when creating the topology. However, this solution only establishes the cluster network topology map for switches in gateways, and its universality is not high.

[0004] There is also a solution that uses graph theory mathematics to propose a method for generating a multi-layer topology structure of a power communication transmission network. The method includes: drawing a number of concentric auxiliary circles in a rectangular coordinate system to assist in generating a layer of structure in a network topology diagram, evenly laying out network elements on the auxiliary circles, and then calling a graphic generation instruction to directly and automatically generate a topology structure. This method uses the idea of ​​uniform distribution and infinite segmentation, can automatically add network elements to the network topology diagram, perform layout and wiring, facilitates operation, and can meet the needs of increasing the number of layers and network elements in the future transmission network topology structure. However, this solution involves a lot of theoretical calculations, the cost is high, and the accuracy of the generated network topology diagram needs to be improved.

[0005] In addition, there is a solution that proposes a commercial launch site network monitoring method. The method includes: generating a network topology map based on the monitoring information of the commercial launch site; mapping the network topology map to the digital twin model of the commercial launch site to obtain the site twin system; jointly monitoring the status of the commercial launch site based on the monitoring information, the network topology map and the site twin system; when the status is abnormal, determining the abnormal node according to the monitoring information, determining the affected link according to the network topology map, and determining the actual location of the abnormal node according to the site twin system. This solution realizes the network monitoring of commercial launch sites at three levels: data, layer, and twin, forming a multi-dimensional network monitoring effect of data point network line and visual surface. When an abnormality occurs, the fault can be quickly located and checked according to the actual location of the corresponding node in the site twin system, thereby ensuring the stability and safety of the network when performing tasks. However, this solution mainly involves the commercial application of network topology maps, and does not propose improvements to the method of generating network topology maps.

[0006] According to the above content, the current method for generating network topology graphs has certain limitations in practical applications, and there is a problem that the generated network topology graphs are not accurate enough. Therefore, it is necessary to improve the method for generating network topology graphs. Summary of the invention

[0007] In response to the above problems, the present disclosure provides a method and system for generating a network topology map, which instantiates the devices in the network topology map by means of a matching model, and comprehensively judges the connection relationship, connection style and other information of the network topology map based on the node attribute data and connection edge attribute data of the devices, and finally completes the drawing of the network topology map, thereby improving the versatility and accuracy of the method for generating a network topology map and solving the above problems.

[0008] According to a first aspect of the present disclosure, a method for generating a network topology map is provided, the method comprising: establishing a model of a device based on pre-stored data, wherein the model comprises node attributes and connection edge attributes associated with the node attributes; scanning all devices in the same network segment to obtain information of each device; for each of all devices, filling in the node attributes and connection edge attributes in the corresponding model with the information to obtain a corresponding model instance; determining all second devices connected to a first device, the connection type between the second device and the first device, and the connection edge style based on the node attribute data and the connection edge attribute data in the model instance; and generating a network topology map based on the first device and the determined second devices connected to the first device, the connection type, and the connection edge style.

[0009] In one embodiment, establishing a model of a device includes: establishing models of a plurality of devices based on pre-stored data, and classifying the plurality of models according to the type, brand, and model of the device.

[0010] In one embodiment, node attributes include the following items: device ID, type, port information, address information and supported protocols; and connection edge attributes include the following items: connection edge ID, connection type, propagation delay, protocol, source device information and target device information connected to the connection edge.

[0011] In one embodiment, filling the node attributes and connection edge attributes in the corresponding model includes: using the information of the device to identify the model corresponding to the device; matching the information of the device with the node attributes and connection edge attributes in the model in turn; and based on the matching results, filling at least part of the data in the information into the successfully matched items in the node attributes and connection edge attributes in the model.

[0012] In one embodiment, determining a second device connected to a first device includes: identifying a switch device and / or a gateway device among all devices, and treating the switch device and / or the gateway device as the first device; obtaining an ID of the first device, and determining a corresponding model instance based on the ID of the first device; obtaining port ID data in a node attribute of the first device from the model instance, and retrieving corresponding connection edge attribute data from the model instance based on the obtained port ID data; and determining a target device corresponding to the first device based on the connection edge attribute data, and treating the target device as the second device.

[0013] In one embodiment, determining the connection type between the second device and the first device includes: reading node attribute data in a model instance of the first device and a model instance of the second device to obtain the input port node degree and the output port node degree of the port of the first device, and the input port node degree and the output port node degree of the port of the second device.

[0014] When there is a device among all devices whose port has an input port node degree of 0 and an output port node degree of 1, and there is another device whose port has an input port node degree of 1 and an output port node degree of 0, and the input port node degree and output port node degree of the device port between the two are 1, the connection type is determined to be a straight line connection.

[0015] When the output port node degree of the port of the first device is greater than 1, and the input port node degrees of the ports of all the second devices are 1 and the output port node degrees are 0, the connection type is determined to be a star connection.

[0016] And when the output port node degree and the input port node degree of the ports of the first device and the second device are both 1, and after traversing the second device, returning to the first device, it is determined that the connection type is a ring connection.

[0017] In one embodiment, determining the connection edge style between the second device and the first device includes: determining the connection edge style between the second device and the first device based on connection type data in the connection edge attribute data of the first device, wherein the connection edge style includes a point-to-point connection or a link aggregation connection.

[0018] In one embodiment, the method includes: when it is determined based on the connection edge attribute data that any port of the second device is connected to a corresponding port of the first device, when scanning the second device, no longer scanning the port in the second device connected to the first device.

[0019] In one embodiment, generating a network topology diagram includes: traversing model instances of all devices; for each of the first device and the second device, constructing a directed graph from a source port of the source device to a target port of the target device based on node attribute data and connection edge attribute data; determining the position of the second device relative to the first device in the directed graph according to the connection type; and determining the style of the connection between the source port and the target port in the directed graph according to the connection edge style.

[0020] In one embodiment, generating a network topology diagram includes: displaying icons of all devices in a human-computer interaction interface, and when it is determined that the connection type is a straight line connection, arranging the icons of the devices in sequence along the horizontal direction or the vertical direction according to the connection order obtained by scanning, and keeping the vertical data of the icons of the devices arranged in the horizontal direction consistent or the horizontal data of the icons of the devices arranged in the vertical direction consistent; when it is determined that the connection type is a ring connection, evenly distributing the icons of the devices on the ring line according to the number of devices on the ring; and when it is determined that the connection type is a star connection, identifying the first device, arranging the icon of the first device in the center, and arranging the icon of the second device connected to the first device along the vertical direction on one side of the icon of the first device.

[0021] In one embodiment, generating a network topology diagram includes: when determining that the connection type is a star connection, determining the position of the icon of the second device relative to the icon of the first device based on the protocol data in the connection edge attribute data in the model instance of the second device, wherein the icon of the second device with the same protocol data is arranged on the same side of the icon of the first device.

[0022] In one embodiment, generating a network topology diagram includes: displaying icons, names, online status, connection points, and connection line information of all devices in a human-computer interaction interface.

[0023] In one embodiment, generating a network topology map includes: traversing model instances of all devices, and verifying whether the address of each device matches the address of the corresponding device in the directed graph, whether the connection between each device is consistent with the connection of the corresponding device in the directed graph, whether all devices and connections are displayed in the directed graph, and whether the propagation delays between all adjacent devices in the directed graph are consistent; and determining that the generation of the network topology map is completed when it is determined that the addresses match, the connections are consistent, all devices and connections are displayed in the directed graph, and the propagation delays are consistent.

[0024] In one embodiment, the method also includes: obtaining port information of the device from the node attribute data of the model instance; obtaining target ports of multiple target devices corresponding to any port of the device from the connection edge attribute data of the model instance, and connecting the port with the target ports of multiple target devices using lines; and determining the existence of unscanned devices when there are intersections between the lines.

[0025] In one embodiment, the method further includes: when it is determined that there are unscanned devices, obtaining actual propagation delay data of the relative devices on the line where the intersection is located; and determining the number of missing devices between the relative devices based on the actual propagation delay data and the theoretical propagation delay data of the relative devices in their respective model instances.

[0026] In one embodiment, the method also includes: when it is determined that there are unscanned devices, searching for the actual missing devices according to the position of the intersection in the network topology map; manually obtaining the node attribute data and connection edge attribute data of the actual missing devices; and generating a model instance of the actual missing device based on the node attribute data, connection edge attribute data and the model corresponding to the actual missing device, thereby supplementing the actual missing devices into the network topology map according to the model instance.

[0027] According to a second aspect of the present disclosure, a system for generating a network topology map is provided, the system comprising: an acquisition module, configured to acquire pre-stored data and form a model corresponding to the device after cleaning; a scanning module, configured to scan all devices in the same network segment to obtain information of each device; and a control unit, configured to communicate with the acquisition module and the scanning module, and execute the method according to the first aspect of the present disclosure to generate a network topology map.

[0028] According to a third aspect of the present disclosure, a computing device for generating a network topology map is provided, the computing device comprising: one or more processors; and a memory storing computer executable instructions, which, when executed by the one or more processors, cause the one or more processors to execute the method according to the first aspect of the present disclosure.

[0029] According to a fourth aspect of the present disclosure, a non-volatile storage medium having computer executable instructions stored thereon is provided. When the computer executable instructions are executed by a computer, the computer executes the method according to the first aspect or the third aspect of the present disclosure.

[0030] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. In the accompanying drawings, the same or similar reference numerals represent the same or similar elements.

[0032] Figure 1 A flowchart of a method for generating a network topology map according to an embodiment of the present disclosure is shown.

[0033] Figure 2A and Figure 2B A schematic diagram of a generated network topology diagram displayed on a human-computer interaction interface according to an embodiment of the present disclosure is shown.

[0034] Figure 3A and Figure 3B A schematic diagram illustrating intersections between connections when there is a missing device according to an embodiment of the present disclosure.

[0035] Figure 4 A schematic diagram of a system for generating a network topology map according to an embodiment of the present disclosure is shown.

[0036] Figure 5 A schematic block diagram of an electronic device for implementing a method for generating a network topology map according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0037] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0038] As used herein, the term "including" and its variations mean open inclusion, i.e., "including but not limited to". Unless otherwise stated, the term "or" means "and / or". The terms "an example embodiment" and "an embodiment" mean "at least one example embodiment". Other explicit and implicit definitions may also be included below.

[0039] Network topology belongs to the field of ICT (information and communication technology), and plays an important role in network architecture design and network management. As mentioned above, although the existing technical solutions provide a method for generating network topology, they are not generally applicable, the cost is high, and the generated network topology is not accurate enough and has a high error rate.

[0040] Therefore, how to provide a universal method for generating a network topology map and ensure a certain accuracy while generating the network topology map at a low cost becomes a consideration.

[0041] Based on the foregoing, the present disclosure provides an improved method for generating a network topology map, which instantiates the devices in the network topology map by means of a matching model, and comprehensively judges the connection relationship, connection style and other information of the network topology map based on the node attribute data and connection edge attribute data of the devices, and finally completes the drawing of the network topology map, which not only improves the scope of application, but also ensures the accuracy of the generated network topology map, significantly reduces costs, and solves the above problems. The method for generating a network topology map according to various embodiments of the present disclosure will be described in detail below in conjunction with the accompanying drawings. It should be understood that the actual method may also have other method steps, but in order to avoid blurring the focus of the present disclosure, the present disclosure does not discuss and the accompanying drawings do not show these other method steps.

[0042] Figure 1 A method for generating a network topology diagram according to some embodiments of the present disclosure is shown. Figure 1 As shown, the method for generating a network topology map provided by the present disclosure includes: S1, establishing a model of the device based on pre-stored data, wherein the model includes node attributes and connection edge attributes associated with the node attributes; S2, scanning all devices in the same network segment to obtain information of each device; S3, for each of all devices, using the information to fill in the node attributes and connection edge attributes in the corresponding model to obtain a corresponding model instance; S4, based on the node attribute data and connection edge attribute data in the model instance, determining all second devices connected to the first device, the connection type between the second device and the first device, and the connection edge style; and S5, based on the first device, generating a network topology map according to the determined second device connected to the first device, the connection type, and the connection edge style.

[0043] In step S1, establishing a model of the device may include collecting, organizing and storing device data such as technical specifications and configuration files provided by device manufacturers, organizing the device data into a standardized model according to a preset structure, and defining node attributes of nodes (corresponding to devices) in the model and connection edge attributes of connection edges connecting each node.

[0044] Among them, node attributes may include device ID, device type, number of ports on the device, port type, port direction, port bandwidth, address, and protocol support. Device ID refers to the item used by the device manufacturer to uniquely identify the device ID. Device type refers to the type of device, which may include, for example, EPA (Ethernet for Plant Automation) switches, management switches, industrial switches, EPA nodes, PLC nodes, etc. Port type refers to the type of network communication supported by the port, which may include, for example, Ethernet type, Fiber type, and Serial type. Port direction refers to the direction of signal flow at the port, which may include, for example, input port, output port, or bidirectional port. The bandwidth of each port may be 100Mbps, 1Gbps, etc. The address includes the MAC address and IP address of the device. Supported protocols refer to the network protocols supported by the device, which may include, for example, SNMP, HTTP, EtherCAT, etc.

[0045] And wherein, the connection edge attributes may include connection ID, source device ID, source port, target device ID, target port, connection type, link state, link bandwidth, propagation delay and protocol. Connection ID is an ID used to uniquely identify the connection edge. Source device ID and target device ID refer to the IDs of the source device and target device to which the connection edge is connected, respectively. Source port and target port refer to the port information of the source device and the port information of the target device, respectively. Connection type refers to the type of connection edge, including, for example, point-to-point connection or link aggregation. Link state refers to the state information of the link formed by the connection edge, which may include, for example, active, inactive, faulty, etc. Link bandwidth refers to the bandwidth information of the link formed by the connection edge. Propagation delay refers to the delay data information in the link formed by the connection edge. Protocol refers to the communication protocol used in the link, which may include, for example, TCP, UDP, etc.

[0046] When there are many devices, a tree structure or classification index can be used to classify and arrange the models according to the device type, brand, model, etc. to form a model library. To facilitate the use of the model, a database or configuration file can be used to store and manage the model data, thereby supporting the dynamic loading of the model and the update of the model in the database. In addition, the model can be equipped with a user-defined port through a human-computer interaction interface connected to the database, allowing the user to manually add a customized device model or modify the properties of the existing model as needed. Preferably, version control is implemented for the model in the database, and the update history of the model is automatically recorded to support the retrieval and switching of different versions of the model.

[0047] The model library established by the above method improves the diversity of model types and increases the applicability of models in practical applications. Users can call them on demand, with high flexibility and visualization, which significantly reduces the professional level requirements for users.

[0048] In step S2, all devices in the same network segment are scanned by a scanning device such as scanning software to obtain information of each device. It should be understood that the information of the aforementioned device includes node attribute data and connection edge attribute data of the device in the actual network. Preferably, if it is determined that a port of a device is already connected to another device, then in the process of generating the network topology map, the port of the device connected to the other device will no longer be scanned, that is, the port of the device that has confirmed the connection relationship in the network topology map may not be read repeatedly.

[0049] In step S3, obtaining a model instance includes filtering and screening the scanned information including all device attribute information and connection edge attribute information according to the established model, and matching the screened information with the information to be filled in the model, thereby using the screened information to fill in the node attributes and connection edge attributes of the model in sequence based on the matching result. When the information in the node attributes and connection edge attributes in the model is filled in, the instantiation of the device is completed, thereby obtaining the model instance corresponding to the device.

[0050] Specifically, the step of obtaining the model instance of the device includes importing a database containing information about device attributes and connection edge attributes, so as to identify the model corresponding to the device according to the information (e.g., the device ID in the device attributes) and load the corresponding model. In addition, the Enterprise Knowledge Language (EKL) can be used to obtain all the used models (i.e., placeholder models) in the model library, and output the node attributes and connection edge attribute information of the placeholder models into a list. These placeholder models can have been created in the model library in advance.

[0051] Then, the device information is matched with the node attributes and connection edge attributes in the model in turn, and the information of the matching model is processed to fill the processed information into the successfully matched items in the node attributes and connection edge attributes of the model. That is, the information of the scanned device is screened according to the setting content of the model, and each of the following attribute information is extracted: including device ID, device type, number of ports, port type, port direction, bandwidth, MAC address, IP address, node attribute data supported by the protocol and connection edge attribute data including connection ID, source device ID, source port, target device ID, target port, connection type, link status, bandwidth, propagation delay, and protocol. When the extracted attribute information is filled into the model in turn, the model instantiation of each device is completed and the corresponding model instance is obtained.

[0052] In addition, to facilitate the subsequent use of model instances, you can also organize model instances and classify and sort them according to device type. Follow consistent naming rules when naming model instances for easy identification and reference. For example: switch devices start with SW and are named SW+Model 01, SW+Model 02, etc.

[0053] In step S4, firstly, based on the node attribute data and connection edge attribute data in the model instance, all second devices connected to the first device are determined. Specifically, it includes: identifying the switch device and / or gateway device among all devices, and taking the switch device and / or gateway device as the first device; obtaining the ID of the first device, and determining the corresponding model instance based on the ID of the first device; obtaining the port ID data, port quantity data, port type data, port direction data and other port information in the node attribute of the first device from the model instance; then retrieving the corresponding connection edge attribute data from the model instance according to the port ID of each port; and obtaining the target device (i.e., the second device) connected to the first device according to the source device ID, the source port of the source device, the target port ID and the target device ID in the connection edge attribute data.

[0054] The devices connected to each port of the switch device and / or gateway device are obtained in the above manner. For example, the four ports of the gateway device are connected to devices B, C, D and E respectively. Preferably, in the network topology diagram, the gateway device (i.e., device A) can be placed in the human-computer interaction interface, and devices B, C, D and E can be divided and arranged according to the network. For example, if devices B and C are in the same network, devices B and C are arranged on the left side of device A, and devices D and E are in another network, then devices D and E are placed on the other side of device A, i.e., on the right side. This is convenient for the subsequent expansion of connections.

[0055] Then, in step S4, all devices are traversed, the node attribute data in the model instance of the first device and the model instance of the second device are read, and each port of each device is determined to be an input port or an output port according to the port direction in the node attribute data, and then the input port node degree and the output port node degree in each device are calculated based on the number of ports. Then, it is judged whether the condition of straight-line connection is met based on the input port node degree and the output port node degree of the device. If it is met, it is judged that the connection mode is a straight-line connection. If it is not met, it is judged whether the connection mode meets the condition of ring connection. If it is met, it is judged that the connection mode is a ring connection. If it does not meet the straight-line connection mode or the ring connection mode, it is judged whether it meets the condition of star connection based on the input port node degree and the output port node degree of the device. If it is met, it is judged to be a star connection. Finally, according to the connection mode results of all devices, the topology type of the network is determined. In some complex networks, the network is also divided into multiple subgraphs, and the topological structure of each subgraph is detected respectively, so as to obtain the final hybrid network topology.

[0056] Specifically, there are only two endpoint nodes (endpoint devices) in a straight line connection, a starting node with an input port node degree of 0 and an output port node degree of 1, and an end node with an input port node degree of 1 and an output port node degree of 0. The input port node degree and the output port node degree of the other intermediate nodes are both 1. Therefore, when there is a device among all devices whose port has an input port node degree of 0 and an output port node degree of 1, and there is another device whose port has an input port node degree of 1 and an output port node degree of 0, the connection type is determined to be a straight line connection.

[0057] In a ring connection, the input port node degree and output port node degree of all nodes are 1, and there is a loop. Therefore, when the output port node degree and input port node degree of the first device and the second device are both 1, and after traversing the second device and returning to the first device, it is preliminarily determined that the connection type is a ring connection. Preferably, use depth first search (DFS) or breadth first search (BFS) to traverse the devices. If you can return to the starting device and visit all devices, confirm that the connection type is a ring connection.

[0058] In a star connection, there is a central node and the output port node degree of the central node is greater than 1, while the input port node degree of all other nodes is 1 and the output port node degree is 0, and there are no other redundant connections. Therefore, when the output port node degree of the port of the first device is greater than 1, and the input port node degree of all the ports of the second device is 1 and the output port node degree is 0, the connection type is determined to be a star connection.

[0059] Determining the connection edge style between the second device and the first device includes: determining the connection edge style between the second device and the first device based on the connection type data in the connection edge attribute data of the first device. The connection edge style includes a point-to-point connection or a link aggregation connection, and determining whether a single-line or dual-line style should be used to connect the first device and the second device according to the connection type information in the connection attribute.

[0060] In step S5, the network topology is drawn based on the instantiation of the previously established model and device connection. The visualization component library provided in the software may include three types of icons representing switches (first devices), gateways (first devices), and EPA nodes (second devices). The icons are then retrieved and arranged in appropriate locations to complete the drawing (generation) of the network topology. Generating the network topology also includes displaying the icons, names, online status, clock labels, connection points, and connection line information of all devices in the human-computer interaction interface.

[0061] Specifically, in step S5, generating the network topology diagram further includes: traversing the model instances of all devices; for each of the first device and the second device, constructing a directed graph from the source port of the source device to the target port of the target device based on the node attribute data and the connection edge attribute data; determining the position of the second device relative to the first device in the directed graph according to the connection type; and determining the style (straight line / curve) of the connection between the source port and the target port in the directed graph according to the device connection type. Exemplarily, the device connection type may include straight line, star, and ring; the style of the connection may include straight line or curve.

[0062] like Figure 2A and Figure 2B As shown, in a directed graph, when the connection type is determined to be a straight line connection, the icons of the devices are arranged in sequence along the horizontal direction or the vertical direction according to the connection order obtained by scanning, and the vertical data of the icons of the devices arranged in the horizontal direction are kept consistent or the horizontal data of the icons of the devices arranged in the vertical direction are kept consistent.

[0063] In a directed graph, when the connection type is determined to be a ring connection, the device icons are evenly distributed on the ring line according to the number of devices on the ring; the radius of the ring will be set to the initial default value in the software, and the coordinate position of each device will be inferred based on the coordinates of the points on the ring. For example: when there are n devices on the ring, the default radius of the ring is r. At this time, the circumference of the circle C=2πr, C / n=θ, x=r*cos(θ), y=r*sin(θ), thus obtaining the position of each device on the ring.

[0064] And when it is determined that the connection type is a star connection, the first device is identified, the icon of the first device is arranged in the center, and the second device connected to the first device is arranged on one side of the icon of the first device along the longitudinal direction.

[0065] In a directed graph, when the connection type is determined to be a star connection, the position of the icon of the second device relative to the icon of the first device is determined based on the protocol data in the connection edge attribute data in the model instance of the second device, wherein the icons of the second devices with the same protocol data are arranged on the same side of the icon of the first device, and the icons of the second devices with different protocol data are arranged on the other side of the first device.

[0066] Alternatively, if Figure 2A and Figure 2B As shown, when any device in the network topology diagram shown in FIG2A is selected, the icon, model, name and port connection information of the selected device are generated as shown in FIG2B. When any port in the port connection information is selected, the target device connected to the port and the target device port information can be displayed.

[0067] In step S5, generating the network topology map also includes traversing the model instances of all devices, and verifying whether the address of each device matches the address of the corresponding device in the directed graph, whether the connection between each device is consistent with the connection of the corresponding device in the directed graph, whether all devices and connections are displayed in the directed graph, and whether the propagation delays between all adjacent devices in the directed graph are consistent; and determining that the generation of the network topology map is completed when it is determined that the addresses match, the connections are consistent, all devices and connections are displayed in the directed graph, and the propagation delays are consistent.

[0068] Address matching includes matching the actual IP address and MAC address of the device with the IP address and MAC address of the corresponding device in the directed graph, that is, the IP address and MAC address of each device in the network topology diagram are clearly marked and consistent with the network device information in the model. Verifying whether the address matches includes verifying that the physical and logical connections between each device have been correctly drawn, and these connections have been verified to reflect the actual network configuration. The generated network topology diagram includes all nodes and connection edges in the model instance and the data is consistent, that is, all instantiated devices and connections in the model are displayed in the network topology diagram.

[0069] When checking whether the propagation delay data is consistent, the propagation delay data between each device can be regarded as a unit to verify whether the propagation delay between each point-to-point device is a unit. When the above conditions are met, it can be considered that the work of generating the network topology map has been completed. However, even if the initial network topology map generation work is completed, a periodic review mechanism can be set to correspond to changes in the network structure, thereby ensuring the continued accuracy of the network topology map.

[0070] In addition, existing solutions are not smart enough when generating network topology maps, have a high error rate, and are unable to detect missing devices and device types in a timely manner. Manual checks for missing devices and device types are still required one by one, resulting in high labor costs.

[0071] Therefore, the method provided by the present disclosure can also timely discover missing devices and timely determine the type of missing devices, thereby facilitating the filling of the network topology map, making the connection of the network topology map complete, thereby optimizing the integrity and accuracy of the network topology map. In this way, the manual participation of network administrators can be reduced, which not only reduces the workload, but also effectively reduces the error rate and significantly improves the efficiency of network management.

[0072] Specifically, the method for generating a network topology diagram provided by the present disclosure also includes: obtaining port information of a device from node attribute data of a model instance; obtaining target ports of multiple target devices corresponding to any port of the device from connection edge attribute data of the model instance, and connecting the port with the target ports of multiple target devices using lines; and determining the existence of unscanned devices when there are intersections between the lines.

[0073] For example, Figure 3A and Figure 3B As shown, the port connection information such as the number of ports and the port direction of device A, device B, device C and device D is obtained according to the model instance. For example, in the device connection relationship, the following is read:

[0074] Port 1 of device A is connected to port 1 of device B, port 1 of device C, and port 1 of device D;

[0075] Port 1 of device B is connected to port 1 of device A, port 1 of device C, and port 1 of device D;

[0076] Port 1 of device C is connected to port 1 of device A, port 1 of device B, and port 1 of device D;

[0077] Device D port 1 is connected to device A port 1, device B port 1, and device C port 1.

[0078] like Figure 3A As shown in the figure, it can be found that the port lines of these devices have intersections, which means that there are unscanned devices among the four devices A, B, C and D. Figure 3B As shown, after deduction, it is determined that there are unscanned devices among device A, device B, device C and device D, and the result is displayed.

[0079] When it is determined that there are unscanned devices, the method also includes obtaining actual propagation delay data of the relative devices on the line where the intersection is located; and determining the number of missing devices between the relative devices based on the actual propagation delay data and the theoretical propagation delay data of the relative devices in their respective model instances. Propagation delay of the device = transmission channel length / port rate, and the gigabit rate and 100M rate of the port need to be converted into the same unit to ensure that the result is accurate. When two devices are connected in a straight line, the propagation delay between the two devices is theoretically almost 0. When there is one device between the two devices, the propagation delay between them is 1 unit; when there are two devices between the two devices, the propagation delay between them is 2 units. This 1 unit of propagation delay data can be obtained through the theoretical propagation delay data between the devices.

[0080] To determine the type of the actual missing device, the method also includes determining the type of the actual missing device based on the number of device ports, the location of the device in the network topology diagram, and the data flow direction. A switch usually has more ports, which are greater than or equal to 4, and the switch connects multiple devices together to form a shared network segment. Therefore, it can be determined whether the device is a switch by the number of ports of the device, whether the device is located in the access layer or aggregation layer of the network, or between multiple devices and core layer devices (such as routers). In addition, the switch forwards data packets from one port to another, so in the network topology diagram, it can be seen that the data flow enters and exits from multiple ports of the device, and it can be determined that the device is a switch. EPA devices usually have only 4 ports, and only two ports will be occupied without redundancy. Therefore, when a device has no more than 4 ports and only two ports are occupied, it can be determined that the device is, for example, an EPA device.

[0081] The method also includes, when determining that there are unscanned devices, searching for the actual missing devices according to the position of the intersection in the network topology map; manually obtaining the node attribute data and the connection edge attribute data of the actual missing devices; and generating a model instance of the actual missing devices based on the node attribute data, the connection edge attribute data and the model corresponding to the actual missing devices, thereby supplementing the actual missing devices into the network topology map according to the model instance.

[0082] According to the above steps, the missing device location and the missing device type are inferred, and the inference results are placed in the network topology map. At this time, the actual missing device can be given a virtual device type name, IP address, port number (the number of devices already connected in the network topology map) and port direction information in the human-computer interaction interface. The icon of the actual missing device obtained by inference is displayed in the network topology map, and the background color of the device label is displayed in orange.

[0083] Subsequently, engineers can find the actual location of missing devices based on the logical layout of the network topology map, and manually check and confirm the device ID, device type information, number of ports, port type, port direction, MAC address, IP address and other information that needs to be completed in the model of devices that have not been scanned in the actual network, and manually supplement and adjust the model and network topology map according to the above method steps to improve the generated network topology map, thereby ensuring the accuracy of the generated network topology map.

[0084] The present invention instantiates the devices in the network topology diagram by establishing a model, and judges the connection relationship in the network topology diagram by scanning the properties of the devices and the connecting lines in sequence, and finally completes the drawing of the network topology diagram. The system provides multiple models, and users can select appropriate models according to project requirements to improve the efficiency of user operations. The model can be edited and defined freely, and has a certain flexibility. At the same time, by providing clear and customizable views and attribute information, the visualization effect of the network topology diagram is enhanced. A multi-dimensional comparison algorithm is used to perform a comprehensive comparison from node attributes, connection relationships to the overall topological structure. To judge whether the data input and output relationship between each device is coherent, whether there are devices that have not been scanned, and intelligently fill in the network topology diagram, thereby reducing the workload of manual comparison and improving the accuracy and efficiency of comparison.

[0085] In the process of scanning the network topology map, the intelligent algorithm is used to find missing devices and determine the type of missing devices, and fill them in to make the network topology map complete, thereby optimizing the integrity and accuracy of the network topology map and effectively reducing the manual participation of network administrators. In this way, it not only reduces the workload of personnel, but also effectively reduces the error rate and improves the efficiency of network management.

[0086] Moreover, the method for generating a network topology map provided in the disclosure provides a variety of models, expands the diversity of models, improves the flexibility of model library application, and solves the problem that the existing model is single and the expression is not intuitive. Moreover, the device information in the network topology map is displayed through the human-computer interaction interface, which improves the interaction mode when the user views the network topology link information, improves the display and interaction mode of the network topology map, reduces the user's learning cost, improves work efficiency, and provides a simple and easy-to-use experience of generating a network topology map. Moreover, the scanning mode of the network topology map can adapt to large-scale and complex network environments, making the network management more accurate. In addition, unidentified devices can be deduced through intelligent algorithms, reducing manual workload and improving efficiency. For unscanned devices, the properties of the device and the connection are compared with the model to judge and intelligently fill in the network topology map, and the time data of the propagation delay between the connected devices is used to deduce the missing nodes in the network topology map and supplement them, thereby ensuring the integrity and accuracy of the generated network topology map.

[0087] like Figure 4 As shown, the present disclosure also provides a system for generating a network topology map, the system comprising: an acquisition module, configured to acquire pre-stored data and form a model corresponding to the device after cleaning; a scanning module, configured to scan all devices in the same network segment to obtain information of each device; and a control unit, configured to communicate with the acquisition module and the scanning module, and execute the method according to the first aspect of the present disclosure to generate a network topology map.

[0088] The present disclosure also provides a computing device for generating a network topology map, the computing device comprising: one or more processors; and a memory storing computer executable instructions, which, when executed by the one or more processors, causes the one or more processors to execute the method according to the first aspect of the present disclosure.

[0089] The present disclosure also provides a non-transitory storage medium having computer executable instructions stored thereon, and when the computer executable instructions are executed by a computer, the computer executes the method according to the first aspect or the third aspect of the present disclosure.

[0090] Figure 5 Schematic block diagram of an example device that can be used to implement an embodiment of the present disclosure is shown. For example, the aforementioned system can be composed of Figure 5 The device shown is implemented. Figure 5As shown, the device includes a central processing unit (CPU) 501, which can perform various appropriate actions and processes according to computer program instructions stored in a read-only memory (ROM) 502 or computer program instructions loaded from a storage unit 508 to a random access memory (RAM) 503. In the random access memory 503, various programs and data required for the operation of the device can also be stored. The central processing unit 501, the read-only memory 502, and the random access memory 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0091] A number of components in the device are connected to the input / output interface 505, including: an input unit 506, such as a keyboard, a mouse, a microphone, etc.; an output unit 507, such as various types of displays, speakers, etc.; a storage unit 508, such as a disk, an optical disk, etc.; and a communication unit 509, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 509 allows the device to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0092] The various processes and processing described above, such as methods, may be executed by the central processing unit 501. For example, in some embodiments, Figure 1 The method shown may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as storage unit 508. In some embodiments, part or all of the computer program may be loaded and / or installed on the device via read-only memory 502 and / or communication unit 509. When the computer program is loaded into random access memory 503 and executed by central processing unit 501, one or more actions of the method described above may be performed.

[0093] The present disclosure relates to methods, apparatus, systems, electronic devices, computer-readable storage media and / or computer program products. A computer program product may include computer-readable program instructions for executing various aspects of the present disclosure. A computer-readable storage medium may be a tangible device that can hold and store instructions used by an instruction execution device. A computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the above. More specific examples (a non-exhaustive list) of computer-readable storage media include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a protruding structure in a groove on which instructions are stored, and any suitable combination of the above. The computer-readable storage medium used herein is not to be construed as a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., light pulses through a fiber optic cable), or an electrical signal transmitted through wires.

[0094] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.

[0095] The computer program instructions for performing the operations of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. The computer-readable program instructions may be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect through the Internet). In some embodiments, by using the state information of the computer-readable program instructions to personalize an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA) or a programmable logic array (PLA), the electronic circuit may execute the computer-readable program instructions, thereby implementing various aspects of the present disclosure.

[0096] Various aspects of the present disclosure are described herein with reference to flowcharts and / or block diagrams of methods, devices (systems) and computer program products according to embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of boxes in the flowchart and / or block diagram can be implemented by computer-readable program instructions.

[0097] These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processing unit of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0098] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0099] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of a module, program segment or instruction includes one or more executable instructions for realizing the specified logical function. In some alternative implementations, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or action, or can be implemented with a combination of special hardware and computer instructions.

[0100] Those skilled in the art should understand that the present disclosure is not limited to the above-mentioned embodiments, and the present disclosure can be implemented in many other forms without departing from its subject matter and scope. Therefore, the examples and embodiments shown are considered to be illustrative rather than restrictive, and the present disclosure can cover various modifications and substitutions without departing from the spirit and scope of the present disclosure as defined in the appended claims.

Claims

1. A method for generating a network topology diagram, characterized in that: The method comprises: Establishing a model of the device including node attributes and connection edge attributes associated with the node attributes; Scan all devices in the network segment to obtain information about each of the devices; For each of the devices, fill in the node attributes and connection edge attributes in the established model using the acquired information to obtain a model instance, wherein the node attributes at least include the ID, type, port information, address information and supported protocols of the device, and the connection edge attributes at least include the ID, connection type, propagation delay, protocol, source device information and target device information connected to the connection edge; Based on the node attribute data and the connection edge attribute data in the model instance, all second devices connected to the predefined first device, the connection type between the second device and the first device, and the connection edge style are determined, wherein the node attribute data in the model instance of the first device and the model instance of the second device are read to obtain the input port node degree and the output port node degree of the port of the first device and the input port node degree and the output port node degree of the port of the second device, in response to the input port node degree of one device among all the devices being 0 and the output port node degree being 1, the input port node degree of the port of another device being The port node degree is 1 and the output port node degree is 0, and the input port node degree and the output port node degree of the port of the device between the one device and the another device are both 1, the connection type is determined to be a straight line connection, in response to the output port node degree of the port of the first device being greater than 1 and the input port node degree of the ports of all the second devices being 1 and the output port node degree being 0, the connection type is determined to be a star connection, in response to the output port node degree and the input port node degree of the ports of the first device and the second device being both 1 and returning to the first device after traversing the second device, the connection type is determined to be a ring connection; and The network topology diagram is generated based on the first device, the second device, the connection type and the connection edge style, wherein the port information of the device is obtained from the node attribute data of the model instance, the target ports of multiple target devices corresponding to any port of the device are obtained from the connection edge attribute data of the model instance, and the port is connected to the target ports of multiple target devices using lines. When there is an intersection between the lines, it is determined that there are unscanned devices. When it is determined that there are unscanned devices, the actual propagation delay data of the relative devices on the line where the intersection is located is obtained. Based on the actual propagation delay data and the theoretical propagation delay data of the relative devices in the respective model instances, the number of missing devices between the relative devices is determined, and the type of the actual missing device is determined according to the number of device ports, the position of the device in the network topology diagram and the data flow direction.

2. The method according to claim 1, characterized in that: Determining a second device connected to the first device includes: Identify a switch device and / or a gateway device among all devices, so as to use the switch device and / or the gateway device as a first device; Obtaining the ID of the first device, and determining a model instance corresponding to the ID of the first device; Acquire port information in the node attributes of the first device from the determined model instance; Based on the obtained port information, retrieve corresponding connection edge attribute data from the determined model instance; and Based on the connection edge attribute data, a target device corresponding to the first device is determined, so as to use the target device as the second device.

3. The method according to claim 1, characterized in that Specifically, the connection edge pattern between the second device and the first device includes: Based on the connection type data in the connection edge attribute data of the first device, a connection edge style between the second device and the first device is determined, wherein the connection edge style includes a point-to-point connection or a link aggregation connection.

4. The method according to claim 1, characterized in that: Generating the network topology diagram includes: Iterate over the model instances of all the devices; For each of the devices, based on the node attribute data and the connection edge attribute data, establish a directed graph from a source port of the first device to a target port of the second device; Based on the connection type, determining a position of the second device relative to the first device in the directed graph; and Based on the connection edge pattern, a pattern of a connection line between the source port and the target port in the directed graph is determined.

5. The method according to claim 4, characterized in that Generating the network topology diagram includes: Displaying icons of all the devices in the human-computer interaction interface and determining connection types of all the devices; In response to determining that the connection type is a straight line connection, sequentially arranging the icons of the devices in a horizontal direction or a vertical direction according to the connection sequence obtained by scanning, and keeping the vertical data of the icons of the devices arranged in the horizontal direction consistent or the horizontal data of the icons of the devices arranged in the vertical direction consistent; In response to determining that the connection type is a ring connection, evenly distributing the device icons on the ring line according to the number of devices on the ring; and In response to determining that the connection type is a star connection, the first device is identified, an icon of the first device is arranged at the center, and an icon of a second device connected to the first device is arranged on one side of the icon of the first device in a longitudinal direction.

6. The method according to claim 5, characterized in that Generating the network topology diagram also includes: In response to determining that the connection type is a star connection, the position of the icon of the second device relative to the icon of the first device is determined based on the protocol data in the connection edge attribute data in the model instance of the second device, wherein icons of second devices with the same protocol data are arranged on the same side of the icon of the first device, and second devices with different protocols are placed on the opposite side.

7. The method according to claim 6, characterized in that Generating a network topology diagram also includes: Traverse the model instances of all devices and verify that the address of each device matches the address of the corresponding device in the directed graph, that the connections between each device are consistent with the connections of the corresponding devices in the directed graph, that all devices and connections are displayed in the directed graph, and that the propagation delays between all adjacent devices in the directed graph are consistent; and The generation of the network topology graph is completed when it is determined that the addresses match, the connections are consistent, all devices and connections are displayed in the directed graph, and the propagation delays are consistent.

8. The method according to claim 1, characterized in that Generating a network topology diagram also includes: When it is determined that there are devices that have not been scanned, the actual missing devices are found according to the positions of the intersections in the network topology map; Manually obtain the node attribute data and connection edge attribute data of the actual missing device; and Based on the node attribute data, the connection edge attribute data and the model corresponding to the actual missing device, a model instance of the actual missing device is generated, so that the actual missing device is supplemented in the network topology diagram according to the model instance.

9. A computing device for generating a network topology diagram, characterized in that: The computing device comprises: one or more processors; and A memory storing computer executable instructions which, when executed by the one or more processors, cause the one or more processors to perform the method according to any one of claims 1-8.

10. A non-transitory storage medium having computer executable instructions stored thereon, characterized in that: When the computer executable instructions are executed by a computer, the computer is caused to perform the method according to any one of claims 1-8.

Citation Information

Patent Citations

  • Network topological graph generation method and device

    CN114915561A

  • Network topological graph generation method and device, equipment and medium

    CN117857366A