Network topology discovery method and device, electronic equipment and storage medium

Through multi-dimensional monitoring and data analysis of the equipment, the automated discovery of network topology is realized, and the problems that are difficult to reflect in the dynamic changes of network topology in the existing technology are solved, and operation and maintenance efficiency and accuracy are improved.

CN119865430APending Publication Date: 2025-04-22NAT COMP NETWORK & INFORMATION SECURITY MANAGEMENT CENT +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510072108.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-16
Publication Date
2025-04-22

AI Technical Summary

Technical Problem

In the prior art, dynamic changes in network topology are difficult to accurately reflect, resulting in operation and maintenance personnel need to manually log in to each device, which is inefficient, which can easily lead to information omissions or errors, affecting the quality and efficiency of network operation and maintenance.

Method used

By monitoring the equipment in different dimensions, monitoring data in different dimensions is generated, topological parameters are obtained, target equipment is selected, target topological data is obtained from monitoring data in different dimensions, and network topology is automatically discovered based on target topology data.

Benefits of technology

The automated discovery of network topology is realized, the real-time and accuracy of network topology information is improved, the time and labor cost of manual operations are reduced, and the efficiency and quality of network operation and maintenance are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119865430A_ABST
    Figure CN119865430A_ABST
Patent Text Reader

Abstract

The invention provides a network topology discovery method and device, electronic equipment and a storage medium. Belongs to the technical field of communication. The method comprises the steps of monitoring each device in a device set in different dimensions, generating monitoring data of each device in different dimensions, obtaining topological parameters, selecting at least one target device from the device set based on the topological parameters, obtaining target topological data from the monitoring data in different dimensions for any target device, and sending the target topological data to the device set. And carrying out network topology discovery based on the target topology data. According to the network topology discovery method and device, monitoring of different dimensions is carried out on the equipment, monitoring data of different dimensions are generated, then the target topology data are obtained, network topology discovery is carried out based on the target topology data, and automatic discovery of the network topology can be achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a network topology discovery method, device, electronic device and storage medium. Background Art

[0002] In the current network environment where the digitalization process is accelerating, the network architecture of enterprises and organizations is becoming increasingly complex. Numerous routers, switches, firewalls, servers and other devices are intertwined, and their intricate connections have built a huge and complex network topology. With the continuous expansion of network scale and the continuous updating of business applications, the network topology is in a state of continuous dynamic change. The frequent access of new devices, the upgrade or replacement of old devices, and the adjustment of network links make it increasingly difficult to accurately grasp the real-time network topology information.

[0003] In the related technology, the existing network topology discovery methods mainly rely on manual operation. In the early stage of network construction, the network topology diagram is mainly drawn manually to form static topology data, which is used as the main basis for network topology discovery. However, static topology data is difficult to reflect the dynamic changes of the network. When facing topology changes, operation and maintenance personnel often need to manually log in to each device, check the port connection status, configuration information and other data one by one, and piece together the current network topology structure based on experience. This method is not only extremely inefficient and consumes a lot of manpower and time costs, but also prone to information omissions or errors due to human negligence or lack of experience, which seriously affects the quality and efficiency of network operation and maintenance, and is difficult to meet the needs of modern networks for efficient management. Summary of the invention

[0004] The purpose of the embodiments of the present application is to provide a network topology discovery method, device, electronic device and storage medium to achieve automatic discovery of network topology. The specific technical solution is as follows:

[0005] In a first aspect of an embodiment of the present application, a network topology discovery method is first provided, the method comprising:

[0006] Monitor each device in the device set in different dimensions and generate monitoring data of different dimensions for each device;

[0007] Acquire topology parameters, and select at least one target device from the device set based on the topology parameters;

[0008] For any of the target devices, obtaining target topology data from the monitoring data of different dimensions;

[0009] Based on the target topology data, network topology is discovered.

[0010] In an optional implementation, the parameter type of the topology parameter includes a network segment type and a non-network segment type; the acquiring the topology parameter, selecting at least one target device from the device set based on the topology parameter, includes:

[0011] If the parameter type of the topology parameter is a network segment type, extracting a network segment range from the topology parameter;

[0012] Selecting at least one target device from the device set according to the network segment range;

[0013] If the parameter type of the topology parameter is a non-segment type, extracting a starting point device identifier from the topology parameter;

[0014] At least one of the target devices is selected from the device set according to the starting device identifier.

[0015] In an optional implementation, when the parameter type of the topology parameter is a network segment type, the discovering the network topology based on the target topology data includes:

[0016] A connection device connected to the target device is discovered according to the target topology data.

[0017] In an optional implementation, when the parameter type of the topology parameter is a non-segment type, the discovering the network topology based on the target topology data includes:

[0018] Get the preset hop count value;

[0019] An initial hop value is extracted from the topology parameter, and when the initial hop value is the preset hop value, a connection device connected to the target device is discovered according to the target topology data.

[0020] In an optional embodiment, the method further comprises:

[0021] Get a first preset type;

[0022] In a case where the initial hop value is not the preset hop value, discovering a connection device connected to the target device according to the target topology data;

[0023] Detecting whether the device type of any device among the connected devices is the first preset type;

[0024] In a case where the device type of the device is the first preset type, taking the device as the target device; and

[0025] Execute the step of acquiring target topology data from the monitoring data of different dimensions for any of the target devices.

[0026] In an optional implementation, when the parameter type of the topology parameter is a non-segment type, the discovering the network topology based on the target topology data further includes:

[0027] Get the second preset type;

[0028] Discovering a connection device connected to the target device according to the target topology data;

[0029] Detecting whether the device type of any of the connected devices is the second preset type;

[0030] When the device type of the device is the second preset type, taking the device as the target device; and

[0031] Execute the step of acquiring target topology data from the monitoring data of different dimensions for any of the target devices.

[0032] In an optional embodiment, the method further comprises:

[0033] Draw a topology table or a topology map according to the target topology data;

[0034] The topology map or topology table is visualized.

[0035] In a second aspect of an embodiment of the present application, a network topology discovery device is further provided, the device comprising:

[0036] The monitoring module monitors each device in the device set in different dimensions and generates monitoring data of different dimensions for each device;

[0037] A first acquisition module, acquiring topology parameters, and selecting at least one target device from the device set based on the topology parameters;

[0038] A second acquisition module, for any of the target devices, acquires target topology data from the monitoring data of different dimensions;

[0039] The network topology discovery module discovers the network topology based on the target topology data.

[0040] In a third aspect of the embodiments of the present application, there is further provided an electronic device, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;

[0041] Memory, used to store computer programs;

[0042] The processor is used to implement the network topology discovery method described in any one of the first aspects above when executing the program stored in the memory.

[0043] In a fourth aspect of the embodiments of the present application, a storage medium is further provided, wherein instructions are stored in the storage medium, and when the storage medium is run on a computer, the computer executes any of the network topology discovery methods described in the first aspect above.

[0044] In a fifth aspect of the embodiments of the present application, a computer program product comprising instructions is also provided, which, when executed on a computer, enables the computer to execute any of the network topology discovery methods described in the first aspect above.

[0045] The above technical solution provided by the embodiment of the present application monitors each device in the device set in different dimensions, generates monitoring data of different dimensions for each device, obtains topology parameters, selects at least one target device from the device set based on the topology parameters, obtains target topology data from the monitoring data of different dimensions for any of the target devices, and discovers the network topology based on the target topology data. By monitoring the devices in different dimensions, generating monitoring data of different dimensions, and then obtaining target topology data, and discovering the network topology based on the target topology data, the automatic discovery of the network topology can be achieved. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0047] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0048] Figure 1 A schematic diagram of the structure of a network topology discovery system provided in an embodiment of the present application;

[0049] Figure 2 A schematic diagram of an implementation flow of a network topology discovery method provided in an embodiment of the present application;

[0050] Figure 3 A schematic diagram of an implementation flow of another network topology discovery method provided in an embodiment of the present application;

[0051] Figure 4A schematic diagram of an implementation flow of another network topology discovery method provided in an embodiment of the present application;

[0052] Figure 5 A schematic diagram of an implementation flow of a network topology discovery method based on device type provided in an embodiment of the present application;

[0053] Figure 6 A schematic diagram of an implementation flow of another method for discovering network topology based on device type provided in an embodiment of the present application;

[0054] Figure 7 A network topology discovery device provided in an embodiment of the present application;

[0055] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0056] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0057] The disclosure below provides many different embodiments or examples to realize the different structures of the present application. In order to simplify the disclosure of the present application, the parts and settings of specific examples are described below. Of course, they are only examples, and the purpose is not to limit the present application. In addition, the present application can repeat reference numbers and / or letters in different examples. This repetition is for the purpose of simplification and clarity, and does not itself indicate the relationship between the various embodiments and / or settings discussed.

[0058] In order to solve the problem in the prior art, in the early stage of network construction, the network topology diagram is mainly drawn manually to form static topology data, and this is used as the main basis for network topology discovery. However, static topology data is difficult to reflect the dynamic changes of the network. When facing topology changes, operation and maintenance personnel often need to manually log in to each device, check the port connection status, configuration information and other data one by one, and piece together the current network topology structure based on experience. This method is not only extremely inefficient, but also consumes a lot of manpower and time costs, and is prone to information omissions or errors due to human negligence or lack of experience, which seriously affects the quality and efficiency of network operation and maintenance, and is difficult to meet the needs of modern networks for efficient management. The present application uses a network topology discovery method, device, electronic device and storage medium, which monitors the device in different dimensions, generates monitoring data in different dimensions, and then obtains the target topology data, and discovers the network topology based on the target topology data, so as to realize the automatic discovery of network topology.

[0059] like Figure 1 , which is a schematic diagram of a network topology discovery system provided by an embodiment of the present application. The network topology discovery system 10 includes: a device module 11, a monitoring module 12, a storage module 13, a topology analysis module 14, and a display module 15.

[0060] Among them, the above-mentioned device module 11 is a device information storage module of the network topology discovery system 10, which is used to provide basic information of devices (such as routers, switches, servers, etc.) to the monitoring module 12, so that the monitoring module 12 can accurately monitor specific devices.

[0061] The monitoring module 12 is a key part of the network topology discovery system 10, which is used to comprehensively monitor network devices according to predetermined rules and frequencies. Based on the basic information of the device provided by the device module 11, each device can be accurately located, and a variety of monitoring technologies and protocols can be used for different types of devices. For example, for router devices, the SNMP protocol can be used to monitor its routing table information, interface status, traffic statistics, etc.; for switch devices, in addition to the SNMP protocol monitoring of port status, VLAN configuration and other information, the LLDP protocol can also be used to obtain the information of adjacent devices connected to it; for server devices, the focus is on monitoring its CPU usage, memory occupancy, disk I / O and other performance indicators as well as the running service and process information.

[0062] The storage module 13 is used to store various data generated during the operation of the network topology discovery system 10. It can store detailed device information in the device module 11, and can also save a large amount of real-time monitoring data collected by the monitoring module 12 and topology information and analysis results generated by the topology analysis module 14.

[0063] The topology analysis module 14 uses complex algorithms and logic to perform in-depth network topology analysis based on the data collected by the monitoring module 12 and the equipment and topology information stored in the storage module 13. It can automatically identify key nodes and links in the network, for example, determine the core router or switch by calculating the node's connectivity, betweenness and other indicators; and evaluate the performance of key links by analyzing the link's bandwidth utilization, delay and other parameters. It can also update some change information to the storage module 13 and pass it to the display module 15 so that the administrator can keep abreast of the latest status of the network.

[0064] The display module 15 is responsible for presenting the network topology information generated by the topology analysis module 14 to the network administrator in an intuitive and easy-to-understand manner. It can include a variety of display forms, such as a visual topology map, a table-like device connection list, and a detailed device and link information report. In the visual topology map, different types of devices and link states are distinguished by different graphic symbols and colors, such as a circle for a server, a rectangle for a switch, a straight line for a connection link, green for a normal link, and red for a link failure, so that the administrator can understand the overall structure and operation status of the network at a glance.

[0065] In one embodiment, during the operation of the above-mentioned network topology discovery system 10, the network topology discovery system 10 performs authentication based on the group word input by the user. After successful authentication, the device set is obtained from the device data contained in the storage module 13. The device module 11 provides the basic information of the device to the monitoring module 12 based on the device set. The monitoring module 12 uses a variety of monitoring technologies and protocols to monitor the devices according to different device types, and then obtains monitoring data, and transmits the monitoring data to the topology analysis module 14. The topology analysis module 14 uses complex algorithms and logics to perform in-depth network topology analysis based on the data collected by the monitoring module 12 and the equipment and topology information stored in the storage module 13, automatically identifies key nodes and links in the network, and realizes automatic discovery of network topology.

[0066] like Figure 2 FIG. 1 is a schematic diagram of an implementation process of a network topology discovery method provided in an embodiment of the present application. The method may specifically include the following steps:

[0067] S201, monitor each device in the device set in different dimensions to generate monitoring data of each device in different dimensions.

[0068] In the embodiment of the present application, each device in the device set is monitored in different dimensions to generate monitoring data of each device in different dimensions. Among them, the monitoring of each device in different dimensions may include LLDP monitoring, port monitoring, aggregation port monitoring, vlan port monitoring, mac forwarding table monitoring, arp monitoring, IP address monitoring, etc., wherein LLDP monitoring is performed through LLDP (Link Layer Discovery Protocol). Protocol, referred to as link layer discovery protocol) is used to monitor and discover the information of adjacent devices in the local area network, including the device's identification, connection port, opposite device identification, opposite connection port, etc. Port monitoring is to monitor the status and flow information of all ports of the centralized network device, including the device's identification, connection port, port description, port enablement status, device enablement status, port flow, etc.; Aggregate port monitoring can be a logical port formed by binding a group of physical ports, including the device's identification, aggregate port, physical port, etc.; VLAN port monitoring is used to monitor the physical ports contained in a certain VLAN; MAC forwarding table monitoring is used to monitor the MAC-based forwarding table, so as to find the MAC address of the server connected to the second-layer access switch, and obtain the possible aggregate port and VLAN port. ARP monitoring is used to monitor the corresponding relationship between MAC and IP address, and analyzes the relationship between the second-layer access switch and the server IP in combination with the MAC forwarding table; IP address monitoring is used to monitor the IP addresses configured on the network devices, such as management logs, interconnection addresses, VLAN addresses, etc., which are not limited to the examples of this application.

[0069] For example, by Figure 1 The monitoring module 12 shown monitors each device in the device set in different dimensions and generates monitoring data of different dimensions for each device.

[0070] S202: Acquire topology parameters, and select at least one target device from a device set based on the topology parameters.

[0071] In an embodiment of the present application, a topology parameter is obtained, and at least one target device is selected from a device set based on the topology parameter. The topology parameter can be obtained by manual input by a user or by extracting it from a parameter library pre-configured by the system. At least one target device is selected from a device set based on the topology parameter, and this embodiment of the present application is not limited to this.

[0072] For example, a user manually inputs topology parameters, and two target devices are selected from a device set according to the topology parameters.

[0073] S203, for any target device, obtaining target topology data from monitoring data of different dimensions.

[0074] In the embodiment of the present application, for any target device, target topology data is obtained from monitoring data of different dimensions. Data related to the topology structure can be extracted from the monitoring data according to pre-set rules. This embodiment of the present application is not limited to this.

[0075] For example, for target device 1, the connection relationship information between target device 1 and other devices is extracted from the data of the network connection status dimension, including the connected device IP address, connection port, etc.; for the port status dimension, attention is paid to the port connection device identification and connection stability information, etc. Take a switch device as an example, and obtain from its monitoring data that it is connected to the server with IP 192.168.1.10 through port 1.

[0076] S204: Discover the network topology based on the target topology data.

[0077] In an embodiment of the present application, network topology discovery is performed based on target topology data.

[0078] For example, based on the target topology data, the network topology structure corresponding to the target device 1 is acquired.

[0079] Through the above description of the technical solution provided by the embodiment of the present application, each device in the device set is monitored in different dimensions, monitoring data of different dimensions of each device is generated, topology parameters are obtained, at least one target device is selected from the device set based on the topology parameters, and for any target device, target topology data is obtained from the monitoring data of different dimensions, and network topology is discovered based on the target topology data. By monitoring the devices in different dimensions, generating monitoring data of different dimensions, and then obtaining target topology data, and discovering the network topology based on the target topology data, the automatic discovery of the network topology can be realized.

[0080] like Figure 3 FIG. 1 is a schematic diagram of an implementation process of another network topology discovery method provided in an embodiment of the present application. The method may specifically include the following steps:

[0081] S301, monitor each device in the device set in different dimensions to generate monitoring data of each device in different dimensions.

[0082] In the embodiment of the present application, each device in the device set is monitored in different dimensions to generate monitoring data of each device in different dimensions. Among them, the monitoring of each device in different dimensions may include LLDP monitoring, port monitoring, aggregation port monitoring, vlan port monitoring, mac forwarding table monitoring, arp monitoring, IP address monitoring, etc., wherein LLDP monitoring is performed through LLDP (Link Layer Discovery Protocol). Protocol, referred to as link layer discovery protocol) is used to monitor and discover the information of adjacent devices in the local area network, including the device's identification, connection port, opposite device identification, opposite connection port, etc. Port monitoring is to monitor the status and flow information of all ports of the centralized network device, including the device's identification, connection port, port description, port enablement status, device enablement status, port flow, etc.; Aggregate port monitoring can be a logical port formed by binding a group of physical ports, including the device's identification, aggregate port, physical port, etc.; VLAN port monitoring is used to monitor the physical ports contained in a certain VLAN; MAC forwarding table monitoring is used to monitor the MAC-based forwarding table, so as to find the MAC address of the server connected to the second-layer access switch, and obtain the possible aggregate port and VLAN port. ARP monitoring is used to monitor the corresponding relationship between MAC and IP address, and analyzes the relationship between the second-layer access switch and the server IP in combination with the MAC forwarding table; IP address monitoring is used to monitor the IP addresses configured on the network devices, such as management logs, interconnection addresses, VLAN addresses, etc., which are not limited to the examples of this application.

[0083] For example, by Figure 1 The monitoring module 12 shown monitors each device in the device set in different dimensions and generates monitoring data of different dimensions for each device.

[0084] The device set can be obtained by the user inputting a community word and then authenticated according to the community word. Only after the authentication is successful can the network device attributes or status be monitored. The devices may include routers, switches, servers, etc. For example, Figure 1 As shown, authentication is performed according to the community word input by the user. After the authentication is successful, the device set is obtained from the device data contained in the storage module 13.

[0085] S302, obtaining topology parameters, where parameter types of the topology parameters include network segment types and non-network segment types.

[0086] In an embodiment of the present application, topology parameters are obtained, and parameter types of topology parameters may include network segment type and non-network segment type, wherein the network segment type refers to determining the target device set by specifying an IP address range (i.e., a network segment), while the non-network segment type refers to determining the starting device by specifying a specific device identifier (such as a device IP address, MAC address, etc.).

[0087] For example, the topology parameter of the network segment type can be "192.168.1.0 / 24", which means that all devices with IP addresses in the range of 192.168.1.1 to 192.168.1.254 are selected as target devices. The topology parameter of the non-network segment type can be "192.168.1.1", which means that the device with IP address 192.168.1.1 is used as the starting device for network topology discovery.

[0088] S303: If the parameter type of the topology parameter is a network segment type, extract the network segment range from the topology parameter.

[0089] In an embodiment of the present application, when the parameter type of the topology parameter is a network segment type, a specific network segment range is extracted from the topology parameter. The network segment range may be a range where the IP address corresponding to the device is located, and the extracted network segment range may be used to determine which devices will be included in the scope of network topology discovery.

[0090] For example, if the topology parameter contains "192.168.1.0 / 24", the network segment range is 192.168.1.1 to 192.168.1.254.

[0091] S304: Select at least one target device from the device set according to the network segment range.

[0092] In the embodiment of the present application, according to the extracted network segment range, all devices within the network segment range are selected from the device set as target devices. These target devices will be used in the subsequent network topology discovery process.

[0093] For example, if the network segment range is 192.168.1.1 to 192.168.1.254, and the devices in the network segment are device 2 and device 3, then device 2 and device 3 will be taken as the target devices.

[0094] S305: If the parameter type of the topology parameter is a non-segment type, extract a starting point device identifier from the topology parameter.

[0095] In an embodiment of the present application, when the parameter type of the topology parameter is a non-segment type, the starting device identifier is extracted from the topology parameter. The starting device identifier can be the IP address corresponding to the device or the number corresponding to the device. This application example does not limit this.

[0096] For example, if "192.168.1.1" is extracted from the topology parameters, the starting point device identifier is 192.168.1.1.

[0097] S306: Select at least one target device from the device set according to the starting device identifier.

[0098] In the embodiment of the present application, according to the extracted starting point device identifier, a device corresponding to the starting point device identifier is selected from the device set as the target device.

[0099] For example, if the starting device is identified as 192.168.1.1, the device with the IP address 192.168.1.1 is the target device.

[0100] S307, for any target device, obtaining target topology data from monitoring data of different dimensions.

[0101] In the embodiment of the present application, for any target device, it is necessary to monitor each target device in different dimensions to generate monitoring data in different dimensions. Then, topology data related to the target device, namely target topology data, is extracted from the monitoring data.

[0102] For example, the device identification, connection port, peer device identification, peer connection port, port description, port enablement status, device enablement status, port traffic, aggregate port, physical port, server MAC address, correspondence between MAC and IP address, management log, interconnection address, VLAN address, etc. can be obtained from the monitoring data.

[0103] The target topology data may be as shown in Table 1.

[0104] Table 1

[0105]

[0106]

[0107] S308, discovering the network topology based on the target topology data.

[0108] In an embodiment of the present application, network topology discovery is performed based on the acquired target topology data.

[0109] For example, the network topology is discovered according to the information in the target topology data in Table 1.

[0110] As for how to discover the network topology based on the target topology data, please refer to the following Figure 4 As shown in the method. Figure 4 As shown, it is a schematic diagram of an implementation process of another network topology discovery method provided in an embodiment of the present application, which may specifically include the following steps:

[0111] S401 : When the parameter type of the topology parameter is a network segment type, a connection device connected to a target device is discovered according to target topology data.

[0112] In an embodiment of the present application, when the parameter type of the topology parameter is a network segment type, all devices (connected devices) directly connected to the target device are analyzed and discovered based on the target topology data. The target topology data is data related to the target device extracted from the different dimensional monitoring data of each device in the device set. All devices (connected devices) connected to the target device are discovered by comparing and analyzing the connection information between the target device and the target topology data, and this embodiment of the present application is not limited to this.

[0113] For example, assuming that the target device is a router, its target topology data contains information such as the IP addresses and MAC addresses of other devices connected to its various ports. Based on this information, the corresponding devices are searched in the network and marked as connected devices.

[0114] S402: When the parameter type of the topology parameter is a non-segment type, obtain a preset hop count value.

[0115] In the embodiment of the present application, when the parameter type of the topology parameter is a non-segment type, a preset hop count value is obtained. The preset hop count value is pre-set according to business requirements and is used for network topology discovery. It can be 1, 2, 3, etc., and the present application example does not limit this.

[0116] S403: extracting an initial hop value from the topology parameters, and in the case where the initial hop value is a preset hop value, discovering a connection device connected to the target device according to the target topology data.

[0117] In an embodiment of the present application, when the parameter type of the topology parameter is a non-segment type, an initial hop value is extracted from the topology parameter. When this initial hop value is equal to the preset hop value, then all devices connected to the target device within the initial hop value are discovered and marked according to the target topology data. Among them, the initial hop value is used to determine how many devices should be "jumped" from the starting device (i.e., the target device) during the network topology discovery process to find other devices indirectly connected to the target device. It can be 1, 2, 3, etc., and this application example does not limit this.

[0118] For example, if the preset hop count value is 1 and the initial hop count value extracted from the topology parameters is also 1, then the initial hop count value is the preset hop count value, and then according to the target topology data, all devices directly connected to the target device are marked as connected devices; if the preset hop count value is 2 and the initial hop count value extracted from the topology parameters is also 2, then the initial hop count value is the preset hop count value, and then according to the target topology data, starting from the target device, look for devices directly connected to it (first hop devices), and then look for devices directly connected to them (second hop devices) from these first hop devices, and these first hop devices and second hop devices are the discovered connected devices.

[0119] The above describes the case where the parameter type of the topology parameter is a network segment type and the case where the parameter type of the topology parameter is a non-network segment type and the initial hop value is a preset hop value. When the parameter type of the topology parameter is a non-network segment type and the initial hop value is not a preset hop value, please refer to the following for details. Figure 5 As shown in the method. Figure 5 As shown, it is a schematic diagram of an implementation process of a network topology discovery method based on device type provided in an embodiment of the present application, which may specifically include the following steps:

[0120] S501: Obtain a first preset type.

[0121] In an embodiment of the present application, a first preset type is obtained. The first preset type refers to a specific device type that is preset during the network topology discovery process. This preset type may be a switch.

[0122] S502: When the initial hop value is not a preset hop value, discover a connection device connected to the target device according to the target topology data.

[0123] In the embodiment of the present application, if the initial hop value is not equal to the preset hop value, the connection device is discovered according to the target topology data. That is, according to the target topology data, starting from the target device, the device directly connected to the target device (first hop device) is searched, and these first hop devices are the discovered connection devices.

[0124] For example, if the preset hop count value is 2 and the initial hop count value is 1, then all devices directly connected to the target device (first hop devices) are found according to the target topology data, and these first hop devices are marked as connected devices.

[0125] S503: Detect whether the device type of any device in the connected devices is a first preset type.

[0126] In the embodiment of the present application, for each device marked as a connected device, it is detected whether the device type of the device matches the first preset type.

[0127] For example, if the first preset type is a server, then it is checked whether the device type of any of the connected devices is a server type.

[0128] 504 , when the device type of the device is the first preset type, taking the device as a target device; and executing the step of acquiring target topology data from monitoring data of different dimensions for any target device.

[0129] In the embodiment of the present application, if the device type of a certain device matches the first preset type, then the device is re-marked as a target device and further processed. This includes re-extracting target topology data from the different dimensional monitoring data of the device (now as a new target device), wherein the target topology data needs to remove the previously acquired and processed data related to the target device to avoid data redundancy and repeated processing.

[0130] For example, if a switch device is discovered during the network topology discovery process, which is identified as a connection device and the device type of this switch device is a first preset type, then this switch device needs to be re-marked as a target device and new target topology data needs to be extracted from its monitoring data to further expand the network topology map.

[0131] In addition, when the device type of the device is not the first preset type, it means that the device does not need to perform network topology discovery any more.

[0132] In a possible embodiment, the first parameter type is obtained as a switch type, the initial hop value is 3, and the preset hop value is 1, which satisfies the situation that the initial hop value is not the preset hop value. According to the target topology data 1, it is found that the connected devices connected to the target device 1 are devices 1-1, 1-2, 1-3, 1-4, 1-5, and 1-6 (the first hop is completed). Among the connected devices connected to the target device 1, the device types of devices 1-2 and 1-3 are switches. Then, a second hop is required for devices 1-2 and 1-3: devices 1-2 and 1-3 are taken as new target devices (target device 1-2 and target device 1-3). According to the target device 1-2, target topology data 2 is obtained from monitoring data of different dimensions; according to the target device 1-3, target topology data 3 is obtained from monitoring data of different dimensions. Target topology data 2 includes information about devices directly connected to target device 1-2, but does not include data related to target device 1 that has been acquired and processed; target topology data 3 includes information about devices directly connected to target device 1-3, but does not include data related to target device 1 that has been acquired and processed. Target topology data 2 can be used to obtain the connected devices connected to target device 1-2, namely device 2-1 and device 2-2, while target topology data 3 does not find any connected devices connected to target device 1-3. Therefore, the third hop only needs to discover network topology data for devices 2-1 and 2-2.

[0133] In addition, when the parameter type of the topology parameter is a non-segment type, the network topology discovery based on the target topology data may also include the following: Figure 6 The steps shown are as follows Figure 6 FIG. 1 is a schematic diagram of an implementation process of another network topology discovery method based on device type provided in an embodiment of the present application, which may specifically include the following steps:

[0134] S601: Obtain a second preset type.

[0135] In an embodiment of the present application, a second preset type is obtained. The second preset type refers to a specific device type that is pre-set during the network topology discovery process. This preset type can be a switch, and the present application example does not limit this.

[0136] S602: Discover a connection device connected to the target device according to the target topology data.

[0137] In the embodiment of the present application, the connection device connected to the target device is discovered according to the target topology data, that is, starting from the target device, the device directly connected to the target device is found according to the target topology data, which is the discovered connection device.

[0138] For example, according to the target topology data 1, all devices (device 1, device 2) directly connected to the target device 1 are found to be connected devices.

[0139] S603: Detect whether the device type of any device in the connected devices is a second preset type.

[0140] In the embodiment of the present application, for each device marked as a connected device, it is detected whether the device type of the device matches the second preset type.

[0141] For example, if the second preset type is a server, then it is checked whether the device type of any device in each connected device is a server type.

[0142] S604, when the device type of the device is the second preset type, taking the device as a target device; and executing the step of acquiring target topology data from monitoring data of different dimensions for any target device.

[0143] In the embodiment of the present application, if the device type of a certain device matches the second preset type, then the device is re-marked as a target device and further processed. This includes re-extracting target topology data from the different dimensional monitoring data of the device (now as a new target device), wherein the target topology data needs to remove the previously acquired and processed data related to the target device to avoid data redundancy and repeated processing.

[0144] For example, if a switch device is discovered during the network topology discovery process, which is identified as a connection device and the device type of this switch device is the second preset type, then this switch device needs to be re-marked as a target device and new target topology data needs to be extracted from its monitoring data to further expand the network topology map.

[0145] In addition, when the device type of the device is not the second preset type, it means that the device does not need to perform network topology discovery any more.

[0146] In a possible embodiment, the first parameter type is obtained as a switch type. According to the target topology data 1, it is found that the connection devices connected to the target device 1 are devices 1-1, 1-2, 1-3, 1-4, 1-5, and 1-6. Among the connection devices connected to the target device 1, the device types of devices 1-2 and 1-3 are switches. Then, a second hop is required for devices 1-2 and 1-3: devices 1-2 and 1-3 are taken as new target devices (target device 1-2 and target device 1-3). According to the target device 1-2, target topology data 2 is obtained from monitoring data of different dimensions; according to the target device 1-3, target topology data 3 is obtained from monitoring data of different dimensions. The target topology data 2 includes device information directly connected to the target device 1-2, and does not include data related to the target device 1 that has been obtained and processed; the target topology data 3 includes device information directly connected to the target device 1-3, and does not include data related to the target device 1 that has been obtained and processed. The target topology data 2 can be used to obtain the connected devices connected to the target device 1-2, namely, the devices 2-1 and 2-2, and the target topology data 3 can be used to find the connected devices that are not connected to the target device 1-3, thereby completing the network topology discovery.

[0147] In addition, a topology table or a topology map can be drawn according to the target topology data; at the same time, the topology map or the topology table can be visualized.

[0148] Corresponding to the above method embodiment, the present application embodiment also provides a network topology discovery device, such as Figure 7 As shown, the device may include a monitoring module 701 , a first acquisition module 702 , a second acquisition module 703 , and a network topology discovery module 704 .

[0149] Monitoring module 701 monitors each device in the device set in different dimensions and generates monitoring data of each device in different dimensions;

[0150] A first acquisition module 702 acquires topology parameters and selects at least one target device from a device set based on the topology parameters;

[0151] The second acquisition module 703 acquires target topology data from monitoring data of different dimensions for any target device;

[0152] The network topology discovery module 704 discovers the network topology based on the target topology data.

[0153] The present application also provides an electronic device, such as Figure 8As shown, it includes a processor 801, a communication interface 802, a memory 803 and a communication bus 804, wherein the processor 801, the communication interface 802, and the memory 803 communicate with each other through the communication bus 804.

[0154] Memory 803, used for storing computer programs;

[0155] In one embodiment of the present application, the processor 801, when used to execute the program stored in the memory 803, implements the following steps:

[0156] Monitor each device in the device set in different dimensions, generate monitoring data of different dimensions for each device, obtain topology parameters, select at least one target device from the device set based on the topology parameters, and for any target device, obtain target topology data from the monitoring data of different dimensions, and discover the network topology based on the target topology data.

[0157] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0158] The communication interface is used for communication between the above electronic device and other devices.

[0159] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0160] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0161] In another embodiment provided in the present application, a storage medium is also provided, in which instructions are stored. When the storage medium is executed on a computer, the computer executes the network topology discovery method described in any one of the above embodiments.

[0162] In another embodiment provided by the present application, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute the network topology discovery method described in any one of the above embodiments.

[0163] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a storage medium, or transmitted from one storage medium to another storage medium, for example, the computer instructions may be transmitted from a website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The storage medium may be any available medium that a computer can access or a data storage device such as a server or a data center that includes one or more available media integrations. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive Solid State Disk (SSD)), etc.

[0164] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0165] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0166] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are included in the protection scope of the present application.

Claims

1. A network topology discovery method, characterized in that: The method comprises: Monitor each device in the device set in different dimensions and generate monitoring data of different dimensions for each device; Acquire topology parameters, and select at least one target device from the device set based on the topology parameters; For any of the target devices, obtaining target topology data from the monitoring data of different dimensions; Based on the target topology data, network topology is discovered.

2. The method according to claim 1, characterized in that The parameter types of the topology parameters include network segment type and non-network segment type; The acquiring of topology parameters, and selecting at least one target device from the device set based on the topology parameters, includes: If the parameter type of the topology parameter is a network segment type, extracting a network segment range from the topology parameter; Selecting at least one target device from the device set according to the network segment range; If the parameter type of the topology parameter is a non-segment type, extracting a starting point device identifier from the topology parameter; At least one of the target devices is selected from the device set according to the starting device identifier.

3. The method according to claim 2, characterized in that In a case where the parameter type of the topology parameter is a network segment type, the discovering of the network topology based on the target topology data includes: A connection device connected to the target device is discovered according to the target topology data.

4. The method according to claim 2, characterized in that: In a case where the parameter type of the topology parameter is a non-segment type, the discovering of the network topology based on the target topology data includes: Get the preset hop count value; An initial hop value is extracted from the topology parameter, and when the initial hop value is the preset hop value, a connection device connected to the target device is discovered according to the target topology data.

5. The method according to claim 4, characterized in that The method further comprises: Get a first preset type; In a case where the initial hop value is not the preset hop value, discovering a connection device connected to the target device according to the target topology data; Detecting whether the device type of any device among the connected devices is the first preset type; In a case where the device type of the device is the first preset type, taking the device as the target device; and Execute the step of acquiring target topology data from the monitoring data of different dimensions for any of the target devices.

6. The method according to claim 2, characterized in that In a case where the parameter type of the topology parameter is a non-segment type, the discovering of the network topology based on the target topology data further includes: Get the second preset type; According to the target topology data, discovering a connection device connected to the target device; Detecting whether the device type of any of the connected devices is the second preset type; In a case where the device type of the device is the second preset type, taking the device as the target device; and, Execute the step of acquiring target topology data from the monitoring data of different dimensions for any of the target devices.

7. The method according to claim 1, characterized in that The method further comprises: Draw a topology table or a topology map according to the target topology data; The topology map or topology table is visualized.

8. A network topology discovery device, characterized in that: The device comprises: The monitoring module monitors each device in the device set in different dimensions and generates monitoring data of different dimensions for each device; A first acquisition module, acquiring topology parameters, and selecting at least one target device from the device set based on the topology parameters; A second acquisition module, for any of the target devices, acquires target topology data from the monitoring data of different dimensions; The network topology discovery module discovers the network topology based on the target topology data.

9. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing any of the methods described in claims 1-7 when executing a program stored in a memory.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.