Generation method of network topology structure and computing device
By generating a network topology structure containing logical node objects, the topology complexity problem caused by the expansion of network scale is solved, and the effect of simplifying the network topology structure to reduce the difficulty of operation and maintenance and monitoring is achieved.
Patent Information
- Application Number
- CN202510400448.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-31
- Publication Date
- 2025-06-24
AI Technical Summary
As the network scale expands, the network topology becomes complex, and it is difficult for the existing technology to generate an effective network topology, resulting in increased difficulty in operation and maintenance and monitoring.
By acquiring the connection data of each network device in the target network, a first network topology structure is generated, which includes a logical node object and a link, which represents a set of network devices with the same connection data or devices with independent connection data to reduce the number of nodes in the network topology structure.
It effectively simplifies the complexity of the network topology structure, enables rapid understanding of the network structure of network nodes, and reduces the difficulty of network operation, maintenance and monitoring.
Smart Images

Figure CN120200920A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer network technologies, and in particular, to a method for generating a network topology structure and a computing device. Background Art
[0002] With the rapid development of information technology, the amount of data is growing at an explosive rate. Against this background, the application of big data is becoming more and more extensive, which not only changes the operation mode of enterprises, but also puts forward higher requirements for the data processing capacity and operation and maintenance management of the data center platform.
[0003] However, as the network scale continues to expand, the complexity of the network topology also increases. Specifically, with the growth of bandwidth requirements, the number of nodes in the network topology increases, the scale of the network topology becomes increasingly large, and the network topology structure becomes more and more complex. In the current technology, an effective network topology structure cannot be generated, and it is difficult to quickly understand the networking structure of network nodes from the network topology structure, thereby increasing the difficulty of network operation and maintenance and monitoring. Summary of the Invention
[0004] Embodiments of this application provide a method for generating a network topology structure and a computing device, which can effectively simplify the complexity of the network topology structure and reduce the difficulty of network operation and maintenance and monitoring.
[0005] To achieve the above object, this application adopts the following technical solutions:
[0006] In a first aspect, embodiments of this application provide a method for generating a network topology structure, including: obtaining connection data of each network device in a target network; where the connection data of the network device is data used to represent the connection relationship of the network device, and the connection data of the network device includes: the number of links and the information of the upstream network device connected; generating a first network topology structure corresponding to the target network based on the connection data of each network device; where the first network topology structure includes: a first logical node object and a link between the first logical node objects, and the first logical node object is used to represent a group of network devices with the same connection data or a network device with independent connection data. In the embodiments of this application, the first logical node object is used to represent a group of network devices with the same connection data or a network device with independent connection data, that is, all network devices in the group can be represented by one first logical node object, so as to generate the first network topology structure. The purpose of doing this is to reduce the number of node objects in the global network topology structure on the premise of ensuring that the network topology structure can reflect the network topology, which can effectively simplify the complexity of the network topology structure, so that the networking structure of network nodes can be quickly understood from the network topology structure, and the difficulty of network operation and maintenance and monitoring can be reduced.
[0007] In a possible implementation, based on the connection data of each network device, each network device is divided into multiple network levels; in the order of data uplink transmission, based on the connection data of the network devices in each network level in turn, the network devices in the network level are formed into one or more first logical node objects; based on the connection data of each network device, the connection relationship between one or more first logical node objects is determined to obtain a first network topology corresponding to the target network.
[0008] In a possible implementation, based on the number of links in the connection data of the network devices in a network level, the network devices in the network level are divided into one or more temporary groups; for each temporary group, when the temporary group includes multiple network devices, based on the information of the uplink network devices connected in the connection data of each network device in the temporary group, the multiple network devices in the temporary group are formed into one or more first logical node objects; when the temporary group includes one network device, the one network device in the temporary group is formed into a first logical node object. The number of links of all network devices in a temporary group is the same. Therefore, when the information of the uplink network devices connected in a temporary group is the same, logically, it is considered that the multiple network devices can be abstracted into a first logical node object.
[0009] In a possible implementation, the first logical node object of the first network topology includes: the total number of network devices represented by the first logical node object; the links between the first logical node objects include: the total number of links connected between the network devices represented by the first logical node objects, so as to realize that the network structure of the entire target network can be directly connected through the first network topology.
[0010] In a possible implementation, it is judged whether the number of first logical node objects is less than a first preset number; when the number of first logical node objects is not less than the first preset number, based on the first network topology, the connection data of the first logical node objects in the first network topology is obtained; based on the connection data of the first logical node objects in the first network topology, a second network topology corresponding to the target network is generated; wherein, the second logical node object is used to represent a group of first logical node objects with the same connection data or a first logical node object with independent connection data. When the number of first logical node objects in the first network topology is not less than the first preset number, all the first logical node objects in the first network topology are processed again to further simplify the complexity of the network topology, so that the networking structure of network nodes can be quickly understood from the network topology, and the difficulty of network operation and maintenance and monitoring is reduced.
[0011] In a possible implementation, it is determined whether the number of the first logical node objects at the bottom layer in the first network topology is less than a second preset number; when the number of the first logical node objects at the bottom layer in the first network topology is not less than the second preset number, based on the first network topology, the connection data of the first logical node objects at the bottom layer of the first network topology is obtained; based on the connection data of all the first logical node objects at the bottom layer of the first network topology, the first logical node objects at the bottom layer are formed into one or more second logical node objects to obtain a second network topology corresponding to the target network. When the number of the first logical node objects at the bottom layer of the first network topology is not less than the second preset number, the first logical node objects at the bottom layer of the first network topology are merged again, so that the number of the bottom layer node objects of the second network topology is reduced, further simplifying the complexity of the network topology, so that the networking structure of network nodes can be quickly understood from the network topology, and the difficulty of network operation and maintenance and monitoring is reduced.
[0012] In a possible implementation, based on the connection data of each network device, an initial network topology corresponding to the target network is generated; based on the connection data of each network device represented by the initial network topology, a first network topology corresponding to the target network is generated. By generating the corresponding first network topology through the initial network topology, the relationship between the first network topology and the initial network topology can be understood more intuitively.
[0013] In a possible implementation, in the order of data uplink transmission, each initial node object in each network layer of the initial network topology is traversed in turn to obtain the connection data of the initial node object, and based on the connection data of the initial node object in the network layer, the initial node objects in the network layer are formed into one or more first logical node objects; based on the connection data of each initial node object, the connection relationship between all the first logical node objects is determined to obtain a first network topology corresponding to the target network. Once the formation / generation of the first logical nodes is completed in each layer, based on the abstracted first logical node objects and the connection relationship between them, the first network topology of the entire target network is constructed, reducing the number of nodes in the network topology, thereby simplifying the network topology, so that the networking structure of network nodes can be quickly understood from the network topology, and the difficulty of network operation and maintenance and monitoring is reduced.
[0014] In a possible implementation, when generating an initial network topology corresponding to the target network, the initial network topology is displayed through a connected display device; in response to the generation of the first network topology, the display of the display device is switched from the initial network topology to the first network topology, thereby realizing the display and switching of the initial network topology and the first network topology.
[0015] In a possible implementation, it is determined whether the number of first logical node objects of the corresponding first network topology globally is less than a first preset number; when the number of logical node objects of the corresponding first network topology globally is not less than the first preset number, the corresponding first network topology is used as the initial network topology, and based on the connection data of each network device represented by the initial network topology, a second network topology corresponding to the target network is generated. All the first logical node objects in the first network topology are processed again to further simplify the complexity of the network topology, so that the networking structure of network nodes can be quickly understood from the network topology, and the difficulty of network operation and maintenance and monitoring is reduced.
[0016] In a possible implementation, it is determined whether the number of first logical node objects at the bottom layer of the corresponding first network topology is less than a second preset number; when the number of first logical node objects at the bottom layer of the corresponding first network topology is not less than the second preset number, the link numbers of the first logical node objects at the bottom layer of the first network topology are traversed, and based on the link numbers and the first logical node objects of the upper layer to which they are connected, the first logical node objects at the bottom layer are formed into one or more second logical node objects until all the logical node objects corresponding to the bottom network layer are generated, so as to obtain a second network topology corresponding to the target network again. The complexity of the network topology is further simplified, and the difficulty of network operation and maintenance and monitoring is reduced.
[0017] In a second aspect, an embodiment of the present application provides a computing device, which includes: a processor and a memory, the processor is coupled to the memory; the memory stores computer-executable instructions; the processor executes the computer-executable instructions to implement the method for generating a network topology in the first aspect and its various possible implementations above.
[0018] In a third aspect, an embodiment of the present application provides a computer-readable storage medium, on which computer program instructions are stored. When the computer program instructions run on a computing device, the computing device is enabled to implement the method for generating a network topology in the first aspect and its various possible implementations above.
[0019] In a fourth aspect, an embodiment of the present application provides a computer program product, which includes computer program instructions. When the computer program instructions run on a computing device, the computing device is enabled to implement the method for generating a network topology in the first aspect and its various possible implementations above. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1Schematic flowchart of a method for generating a network topology structure provided by an embodiment of the present application;
[0021] Figure 2 Schematic diagram of the structure of an LLDP agent provided by an embodiment of the present application;
[0022] Figure 3 Schematic flowchart of another method for generating a network topology structure provided by an embodiment of the present application;
[0023] Figure 4 Schematic flowchart of another method for generating a network topology structure provided by an embodiment of the present application;
[0024] Figure 5 Example diagram of an initial network topology structure and a first network topology structure provided by an embodiment of the present application;
[0025] Figure 6 Example diagram of another initial network topology structure and a first network topology structure provided by an embodiment of the present application;
[0026] Figure 7 Example diagram of another initial network topology structure and a first network topology structure provided by an embodiment of the present application;
[0027] Figure 8 Example diagram of a network topology structure for merging and splitting logical node objects provided by an embodiment of the present application;
[0028] Figure 9 Example diagram of a network topology structure for secondary merging provided by an embodiment of the present application. Detailed implementation manners
[0029] Terms such as "first", "second", and "third" in the description of the present application specification, claims, and drawings are used to distinguish different objects, rather than to limit a specific order.
[0030] In the embodiments of the present application, words such as "exemplary" or "for example" are used to represent examples, illustrations, or explanations. Any embodiment or design solution described as "exemplary" or "for example" in the embodiments of the present application should not be construed as being more preferred or having more advantages than other embodiments or design solutions. Rather, the use of words such as "exemplary" or "for example" is intended to present relevant concepts in a specific manner.
[0031] For the sake of clear and concise description of the following embodiments, a brief introduction to the related technologies is first given:
[0032] Network device: It is the basic unit that constitutes a network, including but not limited to routers, switches, servers, firewalls, etc. They perform different tasks in the network, such as routing, data forwarding, security protection, etc.
[0033] Network topology: It refers to the geometric layout or structure formed by nodes (such as computers, routers, switches, etc.) and the links connecting these nodes in a network, which describes how network components are interconnected with each other and how data is transmitted over these connections. Network topology includes physical topology and logical topology. Physical topology refers to the actual physical connection form between network devices, and logical topology refers to the actual path of data transmission in the network.
[0034] Network topology diagram: It is a graphical identification method of network topology, which shows the network topology structure in the form of a diagram, uses diagrams to represent nodes, and uses lines to represent the connections between nodes. The network topology structure provides an intuitive way to understand the layout, structure and complexity of the network, which is convenient for planning, management and troubleshooting.
[0035] Topology object: It is the basic element that constitutes the network topology structure. Specifically, it includes nodes, links and groups.
[0036] Node: In the network topology structure, a node is the most basic component unit used to identify the device to be managed. Each node represents an independent network device in the network. A node can identify a physical device or a virtual device. For example, routers, switches, servers, etc. can all be regarded as nodes. Of course, virtual machines (VMs), virtual network devices, etc. can also be regarded as nodes. Further, a node may contain detailed information about the device, such as name, IP address, etc.
[0037] Link: In the network topology structure, a link refers to the connection line that actually exists or identifies the logical relationship between two nodes. A link shows the data transmission path between nodes and can be a physical cable connection or a logical communication protocol. Further, a link may be marked with information such as bandwidth and delay to provide a more detailed description of the connection characteristics.
[0038] Group: For the convenience of network management and optimization, it is often necessary to decompose a relatively large network structure into several relatively small groups according to a certain division method (such as by device type, geographical location, etc.).
[0039] In summary, the network topology structure is constructed based on topology objects, that is, through reasonable layout and connection of these topology objects such as nodes, links, and groups, a graph / diagram that intuitively reflects the network structure is formed. Nodes represent specific network devices, links show the connection conditions between devices, and groups help to understand the network structure from a macroscopic perspective.
[0040] With the growth of the network scale and the increase in complexity, the network topology structure becomes more and more complex, that is, there are more nodes in the network topology structure. The current technology cannot generate an effective network topology structure, that is, reduce the number of node objects in the global network topology structure, so that the scale of the network topology structure is still large, and it is difficult to quickly understand the networking structure of network nodes from the network topology structure, thus increasing the difficulty of network operation and maintenance and monitoring.
[0041] A method for generating a network topology structure provided by an embodiment of the present application includes: obtaining connection data of each network device in a target network; where the connection data of the network device is data used to characterize the connection relationship of the network device, and the connection data of the network device includes: the number of links and the information of the upstream network device connected; based on the connection data of each network device, generating a first network topology structure corresponding to the target network; where the first network topology structure includes: first logical node objects and links between the first logical node objects, and the first logical node object is used to characterize a group of network devices with the same connection data or a network device with independent connection data. In the embodiment of the present application, the first logical node object is used to characterize a group of network devices with the same connection data or a network device with independent connection data, that is, all network devices in the group can be represented by one first logical node object, so as to generate the first network topology structure. The purpose of doing this is to reduce the number of node objects in the global network topology structure on the premise of ensuring that the network topology structure can reflect the network topology, effectively simplify the complexity of the network topology structure, so that the networking structure of network nodes can be quickly understood from the network topology structure, and the difficulty of network operation and maintenance and monitoring can be reduced.
[0042] Embodiment 1;
[0043] The following combines Figure 1 and Figure 2 , and details a method for generating a network topology structure provided by an embodiment of the present application.
[0044] A method for generating a network topology structure provided by an embodiment of the present application is often used in a computing network scenario. In a large-scale data center or a cloud computing environment, the network topology structure is crucial for effective network operation and maintenance and monitoring, etc. Through the network topology structure, an overview of the entire network can be quickly obtained, key nodes and connections can be identified, so as to accelerate the location and solution of network problems.
[0045] Specifically, a method for generating a network topology structure provided by an embodiment of the present application is applied to a computing device for network management in the field of computing and networking, such as: an SDN controller in a modern data center, a computing device running a cloud management platform in a data center of cloud computing technology, etc.
[0046] As Figure 1 shown, a method for generating a network topology structure provided by an embodiment of the present application includes the following steps:
[0047] S101. Obtain the connection data of each network device in the target network.
[0048] Among them, the target network refers to the network environment for which the network topology structure is to be generated. Specifically, the target network refers to a system formed by all network devices within a specific range and their interconnection methods, which can be an internal small local area network (LAN), or a data center network spanning multiple geographical locations.
[0049] Among them, network devices include but are not limited to: routers, switches, firewalls, wireless access points (WAPs), servers, client devices, load balancers.
[0050] Among them, the connection data of network devices is data used to characterize the connection relationship of network devices. Specifically, the connection data of network devices includes: the number of links and the information of the upstream network devices connected. The number of links of a network device refers to the total number of links connecting the network device to the upstream network devices; the information of the upstream network devices refers to the identifier of the upstream network devices, such as: device ID.
[0051] In a possible implementation manner, while obtaining the connection data of each network device in the target network, obtain the node data of each network device in the target network. The node data of the network device can be understood as network device information, that is, the identifier of the network device.
[0052] In a possible implementation manner, use the LLDP (Link Layer Discovery Protocol) function of the network devices in the target network to obtain the connection data of each network device, and can also obtain the node data of each network device.
[0053] LLDP is a standardized network protocol designed to provide an easy way for adjacent network devices to identify and report their identities and functions. That is, LLDP enables network devices to automatically detect other network devices directly connected to them, and LLDP also supports the exchange of detailed system information of network devices, such as device ID, interface ID, system name, system description, etc.
[0054] Specifically, through the LLDP of network devices, the data of local devices is organized and published to the remote devices connected to itself, and the local devices save the data of the received remote devices in the form of a standard MIB, so that the front end can obtain the connection data of each network device in the target network by reading the data in the MIB (Management Information Base).
[0055] Among them, the MIB (Management Information Base) is a database used to store data of objects that can be queried and set by a network management system (NMS). These objects usually represent various status information, configuration parameters, performance statistics, etc. of network devices.
[0056] For the convenience of understanding, the following combines Figure 2 the LLDP agent of the LLDP module in the network device shown in the figure to illustrate how to obtain the connection data of each network device in the target network.
[0057] Among them, the LLDP module refers to the core component in the network device responsible for processing the LLDP function, including all necessary logics and functions to generate, send, receive and parse LLDP data units (LLDPDUs).
[0058] Among them, the LLDP agent refers to the software or hardware component that actually executes the LLDP protocol interaction running on the network device. The role of the LLDP agent is to manage and coordinate the interaction between the LLDP module and other network management functions.
[0059] Such as Figure 2As shown in the figure, the LLDP agent first collects relevant information from multiple MIBs of the local device, such as the physical topology MIB, entity MIB, interface MIB, etc. The local device information collected includes: device ID, interface ID, system name, system description, interface description, network management address, etc. And it updates its own LLDP local system MIB and the LLDP extended MIB customized by the local device according to the collected local device information. And it encapsulates the collected local device information into an LLDP data unit (Link Layer Discovery Protocol Data Unit, LLDPDU), and sends it to directly adjacent remote devices in a multicast manner through the port, that is, sends the local device information to the remote device.
[0060] Among them, the physical topology MIB usually stores data related to the physical / logical connection and layout of the device, such as the connection relationship between devices, connection type, etc.; the entity MIB usually stores each physical entity in the device, such as modules, fans, power supplies, etc.; the interface MIB usually stores interface-level statistical data and status information, such as: interface ID, interface type, management status of the interface, etc.
[0061] As Figure 2 shown in the figure, when the local device receives the LLDP data unit sent by the remote device, the LLDP agent parses the remote device information in the LLDP data unit. The remote device information includes: device ID, interface ID, system name, system description, interface description, network management address, etc. And it stores / updates the parsed remote device information to the LLDP remote system MIB of the local device. In addition, if the remote device has customized LLDP extension information, it stores / updates the LLDP extension information to the LLDP extended MIB customized by the remote device.
[0062] It can be seen from this that, as Figure 2 shown in the figure, the LLDP agent is responsible for processing the sending and receiving of LLDP data units, and interacting with various MIBs on the device to ensure that the LLDP local system MIB and the LLDP remote system MIB can be updated in a timely manner. And in addition to the standard LLDP information, the LLDP agent also supports processing the LLDP extended MIB customized by the local device and the LLDP extended MIB customized by the remote device, allowing more detailed device characteristics and configuration information (i.e., device information) to be exchanged and recorded.
[0063] The front-end application or management system can query the data in the LLDP local system MIB, the LLDP extended MIB customized by the local device, the LLDP remote system MIB, and the LLDP extended MIB customized by the remote device of all network devices in the network through SNMP (Simple Network Management Protocol) to obtain the node data and connection data of all network devices.
[0064] S102. Generate a first network topology corresponding to the target network based on the connection data of each network device.
[0065] Among them, the first network topology includes: the first logical node object and the link between the first logical node objects.
[0066] The first logical node object is used to represent a group of network devices with the same connection data or a network device with independent connection data. Exemplarily, if there are multiple network devices with the same connection data in the target network, then these multiple network devices are generated into a first logical node object; if there is a network device in the target network whose connection data is different from that of all other network devices, then this one network device is generated into a first logical node object alone. Further, the connection data between different first logical node objects are all different, which may be different in the number of links, different in the information of the connected upstream network devices, or different in both the number of links and the information of the connected upstream network devices.
[0067] Among them, a network device with independent connection data means that the connection data of this network device is different from that of other network devices. It can be simply understood that: in the target network, except that the network device with independent connection data has connection data A, the connection data of all other network devices is not connection data A.
[0068] In a possible implementation manner, based on the connection data of each network device, each network device is divided into multiple network levels; in the order of data transmission from downstream to upstream, based on the connection data of the network devices in each network level in turn, the network devices in the network level are formed into one or more first logical node objects; based on the connection data of each network device, the connection relationship between all first logical node objects is determined to obtain the first network topology corresponding to the target network.
[0069] Specifically, for a network level, based on the number of links in the connection data of network devices in the network level, the network devices in the network level are divided into one or more temporary groups. If a temporary group includes multiple network devices, the number of links of the multiple network devices is the same, and the number of links between each temporary group is different. For example: the number of links of device A1 is 3, the number of links of device A2 is 5, the number of links of device A3 is 5, and the number of links of device A4 is 3. Since the number of links of device A1 and device A4 is both 3, device A1 and device A4 are divided into one temporary group. Since the number of links of device A2 and device A3 is both 5, device A2 and device A3 are divided into one temporary group, thus obtaining two temporary groups. For each temporary group, when the temporary group includes multiple network devices, based on the information of the upstream network devices connected to each network device in the temporary group, the multiple network devices in the temporary group are formed into one or more first logical node objects; when the temporary group includes one network device, the one network device in the temporary group is formed into one first logical node object. For example: when the temporary group includes device B1, device B2, and device B3, if the information of the upstream network devices connected to device B1 and device B2 is the same, and the information of the upstream network devices connected to device B3 is different from that of device B1 and device B2, then device B1 and device B2 generate one first logical node object, and device B3 generates one first logical node object.
[0070] In a possible implementation manner, on the first logical node object of the first network topology structure, there is included: the total number of network devices represented by the first logical node object; on the links between the first logical node objects, there is included: the total number of links of the connections between the network devices represented by the first logical node objects.
[0071] In a possible implementation manner, after obtaining the first network topology structure, it further includes: determining whether the number of first logical node objects is less than a first preset number; when the number of first logical node objects is not less than the first preset number, based on the first network topology structure, obtaining the connection data of all the first logical node objects in the first network topology structure; based on the connection data of all the first logical node objects in the first network topology structure, generating a second network topology structure corresponding to the target network.
[0072] Among them, the connection data of the first logical node object is data used to represent the connection relationship of the first logical node object, and the connection data of the first logical node object includes: the number of links and the information of the upstream first logical node object connected.
[0073] Among them, the second network topology structure includes: links between second logical node objects, and the second logical node objects are used to represent a group of first logical node objects with the same connection data or a first logical node object with independent connection data.
[0074] When the number of global first logical node objects in the first network topology structure is not less than the first preset number, the global of the first network topology structure is processed again to further simplify the complexity of the network topology structure, so that the networking structure of network nodes can be quickly understood from the network topology structure, and the difficulty of network operation and maintenance and monitoring is reduced.
[0075] In the embodiment of the present application, in order to ensure the effectiveness / effect of the generated first network topology structure, after obtaining the first network topology structure, it is judged whether the number of first logical node objects in the first network topology structure is less than the first preset number. If the number of first logical nodes is not less than the first preset number, it means that the initially generated first network topology structure does not meet the expectation. Therefore, the first network topology structure is reprocessed to obtain a second network topology structure, so that the second network topology structure meets the expectation, thereby effectively simplifying the complexity of the network topology structure.
[0076] In another possible implementation, it is judged whether the number of the bottom-layer first logical node objects in the first network topology structure is less than the second preset number; when the number of the bottom-layer first logical node objects in the first network topology structure is not less than the second preset number, based on the first network topology structure, the connection data of all the bottom-layer first logical node objects in the first network topology structure is obtained; based on the connection data of all the bottom-layer first logical node objects in the first network topology structure, the bottom-layer first logical node objects are formed into one or more second logical node objects to obtain a second network topology structure corresponding to the target network.
[0077] When the number of the bottom-layer first logical node objects in the first network topology structure is not less than the second preset number, the bottom-layer first logical node objects in the first network topology structure are merged again, so that the number of the bottom-layer node objects in the second network topology structure is reduced, further simplifying the complexity of the network topology structure, so that the networking structure of network nodes can be quickly understood from the network topology structure, and the difficulty of network operation and maintenance and monitoring is reduced.
[0078] In the embodiments of the present application, to ensure the scalability of the target network, that is, the target network can cope with future business growth and changes, a certain amount of resources can be reserved for the target network. If the number of the first logical node objects at the bottom layer of the first network topology structure is not less than the second preset number, it indicates that the number of the first logical node objects at the bottom layer has approached the bearing limit. Then, if there is a rapid growth of business in the future and the target network does not have enough network resources, it will be unable to cope with the increase and changes of external business. Therefore, if the number of the first logical node objects at the bottom layer of the first network topology structure is not less than the second preset number, it indicates that the initially generated first network topology structure does not reserve enough network resources, and it is necessary to reprocess the first logical object nodes at the bottom layer of the first network topology structure to obtain the second network topology structure, so as to reserve enough network resources.
[0079] Furthermore, in a possible implementation manner, the network topology structure can be embodied in the form of a network topology diagram, that is, the first network topology structure can be embodied through its corresponding first network topology diagram; similarly, the second network topology structure can be embodied through its corresponding second network topology diagram.
[0080] A method for generating a network topology structure provided by an embodiment of the present application includes: obtaining connection data of each network device in a target network; where the connection data of the network device is data used to characterize the connection relationship of the network device, and the connection data of the network device includes: the number of links and the information of the uplink network device connected. Based on the connection data of each network device, a first network topology structure corresponding to the target network is generated; where the first network topology structure includes: first logical node objects and links between the first logical node objects, and the first logical node objects are used to characterize a group of network devices with the same connection data or a network device with independent connection data. In the embodiments of the present application, the first logical node objects are used to characterize a group of network devices with the same connection data or a network device with independent connection data, that is, all network devices in the group can be represented by one first logical node object, so as to generate the first network topology structure. The purpose of doing this is to reduce the number of node objects in the global network topology structure on the premise of ensuring that the network topology structure can reflect the network topology, effectively simplify the complexity of the network topology structure, and thus quickly understand the networking structure of network nodes from the network topology structure, reducing the difficulty of network operation and maintenance and monitoring.
[0081] Embodiment Two:
[0082] Next, in combination with Figures 3 - 8 , a detailed introduction will be given to another method for generating a network topology structure provided by an embodiment of the present application.
[0083] As Figure 3As shown in the figure, a method for generating a network topology structure provided by an embodiment of the present application includes the following steps:
[0084] S301. Obtain the connection data of each network device in the target network.
[0085] It should be noted that the above S301 is the same as S101 in Embodiment 1. Therefore, for the specific implementation details of S301, please refer to S101 in Embodiment 1, which will not be elaborated here.
[0086] S302. Generate an initial network topology structure corresponding to the target network based on the connection data of each network device.
[0087] Among them, the initial network topology structure includes: initial node objects and links between the initial node objects, and the initial node objects are used to represent a network device.
[0088] In a possible implementation manner, the connection data of each network device in the target network is obtained by using the LLDP (Link Layer Discovery Protocol) function of the network device in the target network, and an initial network topology structure corresponding to the connection data of each network device is generated.
[0089] S303. Generate a first network topology structure corresponding to the target network based on the connection data of each network device represented by the initial network topology structure.
[0090] Specifically, in the order from downstream to upstream, the initial node objects in each network layer of the initial network topology structure are traversed in turn to obtain the connection data of the initial node objects, and based on the connection data of the initial node objects in the network layer, the initial node objects in the network layer are formed into one or more first logical node objects; based on the connection data of each initial node object, the connection relationship between all the first logical node objects is determined to obtain a first network topology structure corresponding to the target network.
[0091] In a possible implementation manner, when generating an initial network topology structure corresponding to the target network, the initial network topology structure is displayed through a connected display device; in response to the generation of the first network topology structure, the display of the display device is switched from the initial network topology structure to the first network topology structure. It can be understood that in a data center, the display device can be a monitor connected to a computing device, and the display device can also be a display screen built into the computing device. In addition, the display device can also have a touch function, and the user can perform drag operations on the displayed network topology structure through touch operations.
[0092] For the convenience of understanding, the following will be combined with Figure 4, introduce in detail how to generate the first network topology corresponding to the target network.
[0093] S401. Traverse each initial node object in the corresponding network layer of the initial network topology, and count the number of links of each initial node object.
[0094] Among them, the number of links of an initial node object refers to the number of connections between the initial node object in the corresponding network layer and all initial node objects in the upper layer of the corresponding network layer. Exemplarily, assume that network layer B and network layer A are upper and lower network layers, and network layer C and network layer B are upper and lower network layers. Then the number of links of node b in network layer B is the number of links connecting node b to all initial node objects in network layer C, and does not include the number of links connecting node b to all initial node objects in network layer A.
[0095] Specifically, for the corresponding network layer in the initial network topology, traverse each initial node object in the corresponding network layer and count the number of links (link number) connected by each initial node object.
[0096] In a possible implementation, the corresponding network layers are sequentially set in the order from the bottom layer to the top layer, that is, in the order from the bottom layer to the top layer, traverse each initial node object in the corresponding network layer of the initial network topology in sequence, and count the number of links of each initial node object. When starting to traverse for the first time, traverse each initial node object in the bottom layer of the initial network topology and count the number of links connected by each initial node object.
[0097] S402. Divide the initial node objects with the same number of links into a temporary group to obtain one or more temporary groups.
[0098] Specifically, group the initial node objects with the same number of links into a temporary group to obtain one or more temporary groups. For example: the number of links of node A1 is 3, that is, node A1 has 3 connections with all initial node objects in the upper network layer; the number of links of node A2 is 5, that is, node A2 has 5 connections with all initial node objects in the upper network layer; the number of links of node A3 is 5, that is, node A3 has 5 connections with all initial node objects in the upper network layer; the number of links connected by node A4 is 3, that is, node A4 has 3 connections with all initial node objects in the upper network layer. The number of links of node A1 and node A4 are both 3, so node A1 and node A4 are divided into a temporary group. The number of links of node A2 and node A3 are both 5, so node A2 and node A3 are divided into a temporary group, thus obtaining two temporary groups.
[0099] S403. For each temporary group, based on the information of the upper-layer initial node objects connected to each initial node object in the temporary group, all the initial node objects in the temporary group are formed into one or more first logical node objects.
[0100] Specifically, for each temporary group, traverse all the initial node objects in the temporary group, find and record the information of the upper-layer initial node objects connected to each initial node object; based on the information of the upper-layer initial node objects connected to the initial node objects, group all the nodes in the temporary group until all the nodes in the temporary group are grouped, then the node division of one temporary group is completed. Specifically, when the grouping of all the initial node objects in the corresponding network layer is completed, based on the grouping of all the initial node objects in the corresponding network layer, the initial node objects belonging to the same group are abstracted / merged into the corresponding first logical node objects.
[0101] Exemplarily, the temporary group a includes node a1, node a2, and node a3, and the number of links of node a1, node a2, and node a3 is 3. Traverse all the nodes in the temporary group a, find and record the information of the upper-layer initial node objects connected to each node. Then the initial node objects connected to node a1 are node b1, node b2, and node b3, the initial node objects connected to node a2 are node b2, node b3, and b4, and the initial node objects connected to node a3 are node b1, node b2, and node b3. Among them, the information of the upper-layer initial node objects connected to node a1 and node a3 is the same, so node a1 and node a3 are divided into the same group, and node a2 is divided into a separate group.
[0102] What is found and recorded is the node object connected by each node to the upper-layer network layer. The number of links counted for each node is the number of links of the connection between each node and all the nodes in the upper-layer network layer, and the number of links of all the nodes in a temporary group is the same. Therefore, the number of node objects connected by all the nodes in a temporary group to the upper-layer network layer is the same. Therefore, when the number of links and the information of the upper-layer initial node objects connected by multiple nodes are the same, logically, it is considered that these multiple nodes can be abstracted into one logical node object.
[0103] Furthermore, when the division of the initial node objects in all the temporary groups in the corresponding network layer is completed, the division / grouping of all the initial node objects in the corresponding network layer is completed.
[0104] Exemplarily, node a1 and node a3 are divided into the same group, and node a2 is divided into a separate group. Then, according to the grouping of node a1, node a2, and node a3, node a1 and node a3 are abstracted / merged into the corresponding logical node object ag1, and node a2 is abstracted / merged into the corresponding logical node object ag2.
[0105] In a possible implementation, after abstracting / merging the initial node objects belonging to the same group into corresponding first logical node objects, the number of nodes is marked on the corresponding first logical node objects. Exemplarily, node a4, node a5, and node a6 are abstracted into a corresponding logical node object ag3, and the number of nodes of the corresponding logical node object ag3 is marked as 3.
[0106] S404. Determine whether the network level of the upper layer of the corresponding network level is the topmost layer.
[0107] When the network level of the upper layer of the corresponding network level is not the topmost layer, use the network level of the upper layer of the corresponding network level as the corresponding network level, and repeat S401 - S404 until the network level of the upper layer of the corresponding network level is the topmost layer.
[0108] When the network level of the upper layer of the corresponding network level is the topmost layer, perform S405.
[0109] S405. Obtain the corresponding first network topology according to the initial network topology and all the first logical node objects.
[0110] In the embodiments of the present application, in the order from the bottommost network level to the topmost network level, all the initial node objects in the corresponding network level are grouped and merged in sequence until all the initial node objects in the network level one layer below the topmost network level are grouped and merged. Since generally the number of node objects in the topmost network level is small, and there is no upper layer for the topmost network level, that is, there is no number of links with the nodes in the upper layer network level and the information of the connected initial node objects for the topmost network level, the initial node objects in the topmost network level may not be grouped and merged, and directly obtain the corresponding first network topology according to the initial network topology and all the first logical node objects.
[0111] Specifically, according to the connection relationship shown in the initial network topology, obtain the connection relationship of all the first logical node objects, so as to obtain the corresponding first network topology.
[0112] In a possible implementation, for the topmost network level, there are no initial node objects in the upper layer for reference, so it is processed according to the merging situation of the initial node objects in the network level one layer below it. That is, when the connection relationship between the first logical node objects in the network level one layer below and the initial node objects in the topmost network level shows a certain regularity, the initial node objects in the topmost network level can be merged to simplify the representation form of the entire network topology.
[0113] In a possible implementation, after obtaining the corresponding first network topology, based on the initial network topology, all the initial node objects in the same group corresponding to each first logical node object at each network level, and the number of links connecting all the initial node objects in the same group corresponding to the logical node object at the network level of the upper layer are obtained, and the number of links is marked on the links connecting the logical node objects in the first network topology.
[0114] For ease of understanding, the following combines Figure 5 to introduce, by way of example, a method for generating a network topology provided in an embodiment of the present application.
[0115] As Figure 5 shown in (a) of, the B layer and the A layer are network levels of upper and lower layers, the C layer and the B layer are network levels of upper and lower layers, and the D layer and the C layer are network levels of upper and lower layers.
[0116] First, traverse each node in layer A and count the number of links connected to each node. That is, the number of links of node A-1 is 1, the number of links of node A-2 is 1, the number of links of node A-3 is 2, the number of links of node A-4 is 2, the number of links of node A-5 is 3, the number of links of node A-6 is 1, the number of links of node A-7 is 1, and the number of links of node A-8 is 1. Then, according to the number of links of each node, group the nodes with the same number of links into a temporary group. That is, group node A-1, node A-2, node A-6, node A-7, and node A-8 with a link count of 1 into temporary group At1, group node A-3 and node A-4 with a link count of 2 into temporary group At2, and group node A-5 with a link count of 3 into temporary group At3, obtaining three temporary groups At1, At2, and At3. For temporary group At1, traverse all nodes in temporary group At1, find and record the initial node object connected to layer B for each node. The initial node object connected to layer B for node A-1 is node B-1, the initial node object connected to layer B for node A-2 is node B-1, the initial node object connected to layer B for node A-6 is node B-3, the initial node object connected to layer B for node A-7 is node B-4, and the initial node object connected to layer B for node A-8 is node B-4. Then, merge node A-1 and node A-2 with the initial node object of B-1 into the first logical node object AG1, merge node A-6 with the initial node object of B-3 into the first logical node object AG2, and merge node A-7 and node A-8 with the initial node object of B-4 into the first logical node object AG3. Mark the number of nodes as 2 (node = 2) on the first logical node object AG1, mark the number of nodes as 1 (node = 1) on the first logical node object AG2, and mark the number of nodes as 2 (node = 2) on the first logical node object AG3. For temporary group At2, find and record that the initial node objects connected to layer B for node A-3 are node B-2 and node B-3, and the initial node objects connected to layer B for node A-4 are node B-2 and node B-3. Merge node A-3 and node A-4 with the initial node objects of node B-2 and node B-3 into the first logical node object AG4, and mark the number of nodes as 2 (node = 2) on the first logical node object AG4. For temporary group At3, find and record that the initial node objects connected to layer B for node A-5 are node B-2, node B-3, and node B-4. Merge node A-5 into the first logical node object AG5, and mark the number of nodes as 1 (node = 1) on the first logical node object AG5.
[0117] Subsequently, traverse each node in layer B, and count that the number of links of node B-1 is 1, the number of links of node B-2 is 2, the number of links of node B-3 is 2, and the number of links of node B-4 is 1. Divide node B-1 and node B-4 with the number of links being 1 into a temporary group Bt1, and divide node B-2 and node B-3 with the number of links being 2 into a temporary group Bt2. For the temporary group Bt1, find and record that the initial node object connected by node B-1 to layer C is node C-1, and the initial node object connected by node B-4 to layer C is node C-2. Then merge node B-1 with the initial node object being node C-1 into the first logical node object BG1, and merge node B-4 with the initial node object being node C-2 into the first logical node object BG2, and mark the number of nodes as 1 (node = 1) on the logical object nodes BG1 and BG2. For the temporary group Bt2, find and record that the initial node objects connected by node B-2 to layer C are node C-1 and node C-2, and the initial node objects connected by node B-3 to layer C are node C-1 and node C-2. Merge node B-2 and node B-3 with the initial node objects being node C-1 and node C-2 into the first logical node object BG3, and mark the number of nodes as 2 (node = 2) on the logical object node BG3.
[0118] Subsequently, traverse each node in layer C, and count that the number of links of node C-1 is 1 and the number of links of node C-2 is 1. Divide node C-1 and node C-2 with the number of links being 1 into a temporary group Ct1. For the temporary group Ct1, find and record that the initial node object connected by node C-1 to layer D is node D-1, and the initial node object connected by node C-2 to layer D is node D-1. Then merge node C-1 and node C-2 with the initial node object being node D-1 into a first logical node object CG1, and mark the number of nodes as 2 (node = 2) on the first logical object node CG1.
[0119] According to all the logical node objects in the initial network topology structure shown in (a) of Figure 5 , obtain the corresponding first network topology structure as shown in (b) of Figure 5 , and mark the number of links on the links connecting the logical node objects in the first network topology structure according to the number of links of all the nodes (objects) in each logical node object of each network level and the connections with all the nodes (objects) in the logical node objects of the network level of the previous layer.
[0120] In the method for generating a network topology structure provided by an embodiment of the present application, once each layer is grouped, a first logical node object can be abstracted for each group to represent all the actual nodes within the group; based on the abstracted first logical node objects and the connection relationships between them, a first network topology structure of the entire network (i.e., a simplified network topology structure) is constructed. The purpose of doing this is to reduce the number of nodes in the network topology structure, thereby simplifying the network topology structure, enabling the networking structure of network nodes to be quickly understood from the network topology structure, and reducing the difficulty of network operation and maintenance and monitoring.
[0121] Further, for the convenience of understanding, the method for generating a network topology structure provided by an embodiment of the present application will be described by way of examples in combination with Scenario 1 and Scenario 2 below.
[0122] Scenario 1:
[0123] Combined with Figure 6 , an example is given to introduce the method for generating a network topology structure provided by an embodiment of the present application in the scenario of the Fat-Tree topology structure.
[0124] Fat-Tree is a topology structure widely used in data center networks. It solves the limitations of traditional network topologies in terms of bandwidth, reliability, and cost through a multi-level design. The core idea of Fat-Tree is to create a non-blocking network environment so that there will be no bottlenecks on the communication path between any two servers.
[0125] Specifically, Fat-Tree includes three layers of architecture, namely: the Edge Layer, the Aggregation Layer, and the Core Layer. The Edge Layer contains switches directly connected to servers (also known as ToR, Top-of-Rack switches). Each switch has k ports, a part of which is used to connect to servers, and the other part is used to connect upward to the Aggregation Layer; the Aggregation Layer is responsible for aggregating the data traffic from the Edge Layer and forwarding it to the Core Layer. Similarly, each Aggregation Layer switch also has k ports, a part of which is used to connect to Edge Layer switches, and the other part is used to connect to Core Layer switches; the Core Layer consists of multiple core switches, which are not directly connected to each other but are connected to Edge Layer switches through the Aggregation Layer. The main task of the Core Layer is to ensure that there are no bottlenecks on the communication path between any two servers.
[0126] Such as Figure 6The initial network topology of a Fat-Tree topology shown in (a) of []. First, traverse all the nodes in the edge layer. The link number of all nodes is 1, so it forms a temporary group. For this temporary group, find and record the initial node objects connected to the upper layer for all nodes. The initial node objects connected to nodes E1 and E2 are node B1, the initial node objects connected to nodes E3 and E4 are node B3, the initial node objects connected to nodes E5 and E6 are node B3, the initial node objects connected to nodes E7 and E8 are node B4, the initial node objects connected to nodes E9 and E10 are node B5, the initial node objects connected to nodes E11 and E12 are node B6, the initial node objects connected to nodes E13 and E14 are node B7, and the initial node objects connected to nodes E15 and E16 are node B8. Therefore, merge nodes E1 and E2 into the first logical node object EG1, merge nodes E3 and E4 into the first logical node object EG2, merge nodes E5 and E6 into the first logical node object EG3, merge nodes E7 and E8 into the first logical node object EG4, merge nodes E9 and E10 into the first logical node object EG5, merge nodes E11 and E12 into the first logical node object EG6, merge nodes E13 and node 14 into the first logical node object EG7, merge nodes E15 and E16 into the first logical node object EG8, and mark the number of nodes as 2 (node = 2) on the logical object nodes EG1 - EG8.
[0127] Traverse B1 - B8 in the aggregation layer. The link number of all nodes is 2, so it forms a temporary group. For this temporary group, find and record the initial node objects connected to the upper layer for all nodes. The initial node objects connected to nodes B1 and B2 are nodes A1 and A2, the initial node objects connected to nodes B3 and B4 are nodes A3 and A4, the initial node objects connected to nodes B5 and B6 are nodes A5 and A6, the initial node objects connected to nodes B7 and B8 are nodes A7 and A8. Then, merge nodes B1 and B2 into the first logical node object BG1, merge nodes B3 and B4 into the first logical node object BG2, merge nodes B5 and B6 into the first logical node object BG3, merge nodes B7 and B8 into the first logical node object BG4, and mark the number of nodes as 2 (node = 2) on the logical object nodes BG1 - BG4.
[0128] Traversing the collection layer A1-A8, the number of links of all nodes is 2, so it is a temporary group. For this temporary group, find and record the initial node objects connected to all nodes and the previous layer. The initial node objects connected to nodes A1, A3, A5 and A7 are nodes C1 and C2; the initial node objects connected to nodes A2, A4, A6 and A8 are nodes C3 and C4. Then merge nodes A1, A3, A5 and A7 into the first logical node object AG1, merge nodes A2, A4, A6 and A8 into the first logical node object AG2, and mark the number of nodes as 4 (node=4) on the logical object nodes AG1 and AG2.
[0129] Further, according to the merging of nodes A1-A8 of the clustering layer, nodes C1 and C2 of the core layer are merged into the first logical node object CG1, and nodes C3 and C4 are merged into the first logical node object CG2, and the number of nodes is marked as 2 (node=2) on the logical object nodes CG1 and CG2.
[0130] According to Figure 6 All the first logical node objects in the initial network topology structure shown in (a) are obtained to obtain the corresponding first network topology structure as shown in Figure 6 As shown in (b), according to all nodes (objects) in each first logical node object of each network level and the number of links connected to all nodes (objects) in the first logical node object of the network level of the upper layer, the number of links is marked on the links connected to the first logical node object in the first network topology structure.
[0131] Scenario 2:
[0132] Combination Figure 7 , an example is given to introduce a method for generating a network topology structure provided by an embodiment of the present application in the scenario of a Clos network architecture.
[0133] The Clos network architecture is widely used in scenarios that need to handle large-scale data traffic and high concurrent requests due to its high scalability, low latency, and non-blocking nature.
[0134] Specifically, the Clos network architecture includes: a server layer (Servers), a leaf layer (Leaf Layer), and a spine layer (Spine Layer). The server layer is the bottom layer of the Clos network architecture, directly carrying applications and services. Servers are connected to Leaf switches physically or virtually; the leaf layer is the intermediate layer connecting the servers and the spine layer. Each Leaf switch is directly connected to a group of servers and is also connected upward to all Spine switches; the spine layer is located at the top layer of the network and is responsible for forwarding data packets between different Leaf switches. It is not directly connected to any servers.
[0135] As Figure 7 shown in (a) of [reference], it is the initial network topology of a CloE network architecture. First, traverse all the nodes in the server layer. The link number of all nodes is 1, so it forms a temporary group. For this temporary group, find and record the initial node objects connected to the upper layer by all nodes. The initial node objects connected by node E1, node E2, and node E3 are node L1; the initial node objects connected by node E4, node E5, and node E6 are node L2; the initial node objects connected by node E7, node E8, and node E9 are node L3; the initial node objects connected by node E10, node E11, and node E12 are node L4; the connection node object of node E13, node E14, and node E15 is node L5; the initial node objects connected by node E16, node E17, and node E18 are node L6. Merge node E1, node E2, and node E3 into the first logical node object EG1, merge node E4, node E5, and node E6 into the first logical node object EG2, merge node E7, node E8, and node E9 into the first logical node object EG3, merge node E10, node E11, and node E12 into the first logical node object EG4, merge node E13, node E14, and node E15 into the first logical node object EG5, and merge node E16, node E17, and node E18 into the first logical node object EG6. Mark the number of nodes as 3 (node = 3) on the logical object nodes EG1 - EG6.
[0136] Traverse all the nodes in the leaf layer. The link number of all nodes is 3, so it forms a temporary group. For this temporary group, find and record the temporary group, and find and record the initial node objects connected to the upper layer by all nodes. The initial node objects connected by node L1, node L2, node L3, node L4, node L5, and node L6 are node S1, node S2, and node S3. Merge node L1, node L2, node L3, node L4, node L5, and node L6 into the first logical node object LG1, and mark the number of nodes as 6 (node = 6) on the logical object node LG1.
[0137] Further, according to the merging situation of the nodes L1 - L6 in the leaf layer, the nodes S1, S2, and S3 in the ridge layer are merged into the first logical node object SG1, and the number of nodes is marked as 3 (node = 3) on the logical object node SG1.
[0138] According to all the first logical node objects in the initial network topology structure shown in (a) of Figure 7 , the corresponding first network topology structure is obtained as shown in (b) of Figure 7 . And according to the number of links connecting all the nodes (objects) in each first logical node object of each network level with all the nodes (objects) in the first logical node object of the network level of the previous layer, the number of links is marked on the links connecting the first logical node objects in the first network topology structure.
[0139] In a possible implementation manner, after obtaining the first network topology structure corresponding to the initial network topology structure, the merged logical node objects can also be split or combined according to preset requirements. For example: according to changes in business requirements, improvement of performance and efficiency, cost control principles, etc., the merged logical node objects are split or combined.
[0140] Exemplarily, according to changes in business requirements, the logical node objects in the first network topology structure may be split or combined. For example, some services may need to be independently deployed to improve performance or security, which requires splitting the originally merged logical node objects; on the contrary, if some services can be merged to reduce management complexity or cost, the logical nodes may need to be combined.
[0141] For ease of understanding, the following combines Figure 8 to illustrate the splitting or combination of the merged logical node objects in the embodiments of the present application by way of example.
[0142] As Figure 8 shown in (a) is the first network topology structure. The first network topology structure shown in (a) of Figure 8 is obtained based on the initial network topology structure shown in (a) of Figure 6 , that is, the first network topology structure shown in (a) of Figure 8 is the first network topology structure shown in (b) of Figure 6 .
[0143] When, according to preset requirements, it is necessary to split the logical node object LG1, as Figure 6As shown in (b) therein, the logical node object is split into a logical node object LG1-1 and a logical node object LG1-2. The number of nodes is marked as 2 (node = 2) on the logical node object LG1-1, that is, the logical node object LG1-1 is connected to the logical node object SG1 and the logical node object SG2. The number of nodes is marked as 4 (node = 4) on the logical node object LG1-2, that is, the logical node object LG1-2 is connected to the logical node objects SG3 - SG6.
[0144] Further, as Figure 6 shown in the first network topology structure of (b) therein, when it is necessary to combine the logical node object LG1-1 and the logical node object LG1-2 according to a preset requirement, since the number of links of both the logical node object LG1-1 and the logical node object LG1-2 is 1, and the connection object of the logical node object LG1-1 and the logical node object LG1-2 is the logical node object LG1, the logical node object LG1-1 and the logical node object LG1-2 are re-merged into a logical node object LG1, and the number of nodes is marked as 6 (node = 6) on the logical node object LG1.
[0145] In a possible implementation manner, after obtaining the first network topology structure corresponding to the initial network topology structure, it further includes: determining whether the first network topology structure meets a preset requirement, where the preset requirement may be: the number of node objects in the global network topology structure is less than a first preset number, the number of node objects at the bottom layer of the network topology structure is less than a second preset number, or a combination of the above two, etc. When the first network topology structure does not meet the preset requirement, it indicates that the structure of the first network topology structure is still relatively complex, so the first network topology structure is used as the initial network topology structure again to achieve the re-simplification of the network topology structure.
[0146] Specifically, when the number of logical node objects in the global first network topology structure is not less than the first preset number, the corresponding first network topology structure is used as the initial network topology structure, and based on the connection data of each network device represented by the initial network topology structure, a second network topology structure corresponding to the target network is generated. All the first logical node objects in the first network topology structure are processed again to further simplify the complexity of the network topology structure, so as to quickly understand the networking structure of network nodes from the network topology structure and reduce the difficulty of network operation and maintenance and monitoring.
[0147] Specifically, when the number of first logical node objects at the bottom layer of the corresponding first network topology is not less than a second preset number, traverse the link numbers of the first logical node objects at the bottom layer of the first network topology, and based on the link numbers and the first logical node objects in the upper layer they are connected to, form the first logical node objects at the bottom layer into one or more second logical node objects until the generation of all logical node objects corresponding to the bottom network level is completed, so as to obtain a second network topology corresponding to the target network again. This further simplifies the complexity of the network topology, enabling the network node networking structure to be quickly understood from the network topology and reducing the difficulty of network operation and maintenance and monitoring.
[0148] For the convenience of understanding, the following combines Figure 9 as shown in the figure to introduce how to perform the secondary merging of the first network topology.
[0149] As Figure 9 shown in (a) therein is the obtained first network topology, and this first network topology does not meet the preset conditions.
[0150] In a possible implementation, nodes of the global first network topology are merged. First, all first logical node objects in layer A are traversed. The number of links of the first logical node object A1 is 8, and the number of links of the first logical node objects A2, A3, and A4 is 4. Then, the first logical node object A1 is turned into a temporary group a1, and the first logical node objects A2, A3, and A4 are divided into a temporary group a2. For the temporary group a1, the first logical node object A1 is directly merged into a second logical node object AG1, and the number of nodes is marked as 4 (node = 4) on the second logical node object AG1. For the temporary group a2, the node object connected to the first logical node object A2 is the logical node object B1, and the node objects connected to the first logical node objects A3 and A4 are the first logical node object B2. Therefore, the first logical node object A2 is merged into a second logical node object AG2, and the number of nodes is marked as 4 (node = 4) on the second logical node object AG2. The first logical node objects A3 and A4 are merged into a second logical node object AG3, and the number of nodes is marked as 8 (node = 8) on the second logical node object AG3. All first logical node objects in layer B are traversed. The number of links of both the first logical node object B1 and the first logical node object B2 is 2, so they form a temporary group. For this temporary group, the node objects connected to the first logical node object B1 and the first logical node object B2 are the first logical node object C1 and the first logical node object C2 respectively. Therefore, the first logical node object B1 is merged into a second logical node object BG1, and the number of nodes is marked as 2 (node = 2) on the first logical node object BG1. The first logical node object B2 is merged into a second logical node object BG2, and the number of nodes is marked as 2 (node = 2) on the second logical node object BG2. All logical node objects in layer C are traversed. The number of links of both the first logical node object C1 and the first logical node object C2 is 1, so they form a temporary group. For this temporary group, the node objects connected to both the first logical node object C1 and the first logical node object C2 are D1. Therefore, the first logical node objects C1 and C2 are merged into a second logical node object CG2, and the number of nodes is marked as 2 (node = 2) on the second logical node object CG1.
[0151] According to all first logical node objects of the first network topology shown in (a) as Figure 8 , the second topology after secondary merging is obtained as shown in (b) as Figure 8 . The number of links is marked on the links connected to the second logical node objects in the second network topology.
[0152] In another possible implementation, the first logical node objects at the bottom layer of the first network topology are merged. Then, all the first logical node objects in layer A are traversed. The number of links of the first logical node object A1 is 8, and the number of links of the first logical node objects A2, A3, and A4 is 4. Then, the first logical node object A1 is grouped into the temporary group a1, and the first logical node objects A2, A3, and A4 are grouped into the temporary group a2. For the temporary group a1, the first logical node object A1 is directly merged into the second logical node object AG1, and the number of nodes is marked as 4 (node = 4) on the second logical node object AG1. For the temporary group a2, the node object connected to the first logical node object A2 is the first logical node object B1, and the node objects connected to the first logical node objects A3 and A4 are the first logical node object B2. Therefore, the first logical node object A2 is merged into the second logical node object AG2, and the number of nodes is marked as 4 (node = 4) on the second logical node object AG2. The first logical node objects A3 and A4 are merged into the second logical node object AG3, and the number of nodes is marked as 8 (node = 8) on the second logical node object AG3. The obtained target topology structure after the secondary merge is as shown in Figure 8 (c) in the figure, and the number of links is marked on the links connected to the first logical node objects in the first network topology according to the number of links of all the first logical node objects at the bottom layer and the connections of all the nodes (objects) of the first logical node objects in the network layer of the upper layer.
[0153] In addition, an embodiment of the present application further provides a computing device. The server includes a processor and a memory. The processor is coupled to the memory, and the memory stores computer-executable instructions. When the processor executes the computer-executable instructions, the method for generating the network topology structure in the above embodiment is implemented.
[0154] An embodiment of the present application further provides a computer-readable storage medium. A computer program is stored on the computer-readable storage medium. When the computer program runs on a computer, the computer is caused to execute the method for generating the network topology structure in the above embodiment.
[0155] For the explanations and beneficial effects of the relevant content in any of the above-provided computer-readable storage media, reference can be made to the corresponding embodiments above, and details are not described herein again.
[0156] Embodiments of the present application also provide a computer program product containing instructions. When the instructions run on a computer, the computer is enabled to execute the method for generating any one of the network topologies in the above embodiments. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions according to the embodiments of the present application are generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from a website, a computer, a server, or a data center to another website, computer, server, or data center in a wired manner (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or a wireless manner (such as infrared, wireless, microwave, etc.). The computer-readable storage medium may be any available medium that can be accessed by the computer or a data storage device such as a server or a data center that includes one or more integrated media. The available medium may be a magnetic medium (such as a floppy disk, a hard disk, a magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as an SSD), etc.
[0157] It should be noted that the devices for storing computer instructions or computer programs provided in the embodiments of the present application, such as but not limited to, the above-mentioned memory, computer-readable storage medium, and communication chip, etc., are all non-transitory.
[0158] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using a software program, 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 processes or functions according to the embodiments of the present application are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from a website, a computer, a server, or a data center to another website, computer, server, or data center by wire (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wirelessly (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, a data center, etc. that contains one or more media integrated therein. The available medium can be a magnetic medium (such as a floppy disk, a hard disk, a magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid state disk (SSD)), etc.
[0159] Although the present application has been described in connection with various embodiments, however, in the process of implementing the claimed present application, those skilled in the art can understand and implement other variations of the disclosed embodiments by viewing the drawings, the disclosure, and the appended claims. In the claims, the word "comprising" does not exclude other components or steps, and "a" or "an" does not exclude a plurality. A single processor or other unit can implement several functions recited in the claims. Certain measures are recited in mutually different dependent claims, but this does not mean that these measures cannot be combined to produce good results.
[0160] Although the present application has been described in connection with specific features and their embodiments, it is obvious that various modifications and combinations can be made without departing from the spirit and scope of the present application. Accordingly, the present specification and the drawings are merely exemplary illustrations of the present application defined by the appended claims, and are considered to have covered any and all modifications, variations, combinations, or equivalents within the scope of the present application. Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalent technologies, the present application is also intended to include these changes and modifications.
Claims
1. A method for generating a network topology structure, characterized in that: include: Acquire connection data of each network device in the target network; wherein the connection data of the network device is data used to characterize the connection relationship of the network device, and the connection data of the network device includes: the number of links and the connected uplink network device information; Based on the connection data of each network device, a first network topology structure corresponding to the target network is generated; wherein the first network topology structure includes: a first logical node object and a link between the first logical node objects, and the first logical node object is used to represent a group of network devices with the same connection data or a network device with independent connection data.
2. The method according to claim 1, characterized in that The step of generating a first network topology structure corresponding to the target network based on the connection data of each network device includes: Based on the connection data of each network device, the network devices are divided into a plurality of network levels; In accordance with the order of uplink data transmission, the network devices in each network layer are sequentially constituted into one or more first logical node objects based on the connection data of the network devices in the network layer; Based on the connection data of each network device, a connection relationship between the one or more first logical node objects is determined to obtain a first network topology structure corresponding to the target network.
3. The method according to claim 2, characterized in that The step of forming one or more first logical node objects from the network devices in the network layers based on the connection data of the network devices in the network layers comprises: dividing the network devices in the network hierarchy into one or more temporary groups based on the number of links in the connection data of the network devices in the network hierarchy; For each temporary group, when the temporary group includes multiple network devices, based on the connected uplink network device information in the connection data of each network device in the temporary group, the multiple network devices in the temporary group are constituted into one or more first logical node objects; when the temporary group includes one network device, the one network device in the temporary group is constituted into one first logical node object.
4. The method according to claim 1, characterized in that The first logical node object of the first network topology structure includes: the total number of network devices represented by the first logical node object; the links between the first logical node objects include: the total number of links connected between the network devices represented by the first logical node objects.
5. The method according to claim 1, characterized in that After generating a first network topology structure corresponding to the target network based on the connection data of each network device, the method further includes: Determining whether the number of the first logical node objects is less than a first preset number; When the number of the first logical node objects is not less than a first preset number, based on the first network topology structure, acquiring connection data of the first logical node objects in the first network topology structure; wherein the connection data of the first logical node objects is data used to characterize the connection relationship of the first logical node objects, and the connection data of the first logical node objects includes: the number of links and the uplink first logical node object information of the connection; Based on the connection data of the first logical node object in the first network topology structure, a second network topology structure corresponding to the target network is generated; wherein the second network topology structure includes: a second logical node object and a link between the second logical node object, and the second logical node object is used to represent a group of first logical node objects with the same connection data or a first logical node object with independent connection data.
6. The method according to claim 1, characterized in that After generating a first network topology structure corresponding to the target network based on the connection data of each network device, the method further includes: Determine whether the number of first logical node objects at the bottom layer of the first network topology structure is less than a second preset number; When the number of first logical node objects at the bottom layer of the first network topology structure is not less than a second preset number, based on the first network topology structure, obtaining connection data of the first logical node object at the bottom layer of the first network topology structure; wherein the connection data of the first logical node object is data used to characterize the connection relationship of the first logical node object, and the connection data of the first logical node object includes: the number of links and the uplink first logical node object information of the connection; Based on the connection data of all the first logical node objects at the bottom layer of the first network topology structure, the first logical node objects at the bottom layer are formed into one or more second logical node objects to obtain a second network topology structure corresponding to the target network; wherein the second logical node object is used to represent a group of first logical node objects with the same connection data or a first logical node object with independent connection data.
7. The method according to claim 1, characterized in that The step of generating a first network topology structure corresponding to the target network based on the connection data of each network device includes: Based on the connection data of each network device, an initial network topology structure corresponding to the target network is generated; wherein the initial network topology structure includes: an initial node object and a link between the initial node objects, the initial node object is used to represent a network device; Based on the connection data of each network device represented by the initial network topology structure, the first network topology structure corresponding to the target network is generated.
8. The method according to claim 7, characterized in that The generating the first network topology structure corresponding to the target network based on the connection data of each network device represented by the initial network topology structure includes: According to the order of data uplink transmission, the initial node objects in each network layer of the initial network topology structure are traversed in turn to obtain the connection data of the initial node objects, and based on the connection data of the initial node objects in the network layer, the initial node objects in the network layer are formed into one or more first logical node objects; wherein the connection data of the initial node objects include: the number of links and the initial node object information of the upper layer connected; Based on the connection data of each of the initial node objects, the connection relationship between all the first logical node objects is determined to obtain a first network topology structure corresponding to the target network.
9. The method according to claim 7, characterized in that: The method further comprises: When generating the initial network topology structure corresponding to the target network, displaying the initial network topology structure through a connected display device; In response to the generation of the first network topology structure, the display of the display device is switched from the initial network topology structure to the first network topology structure.
10. A computing device, characterized in that: include: a processor and a memory, the processor being coupled to the memory; The memory stores computer-executable instructions; The processor executes the computer-executable instructions to implement the method for generating a network topology structure according to any one of claims 1 to 9.