A method, device, equipment and storage medium for generating network topology

By obtaining and analyzing the identification and connection relationship information of network devices, determining cross-connection relationships and generating network topology, it solves the problem that existing technology cannot find cross-connection relationships at the same level, and realizes the delivery of configuration data to network devices at the same level.

CN116137594BActive Publication Date: 2024-09-13CHINA MOBILE M2M +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111367148.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-18
Publication Date
2024-09-13
Estimated Expiration
2041-11-18

AI Technical Summary

Technical Problem

Existing network topology generation methods cannot find network devices at the same level that have a cross-connection relationship through the topology of network devices, and therefore cannot deliver configuration data to network devices at the same level at the same time.

Method used

By obtaining the device identification and connection relationship information of the same level in different levels, determine the cross-connection relationship information between devices that meet the preset relationship, and generate a network topology including all levels based on these relationships to realize the configuration of network devices at the same level. .

Benefits of technology

Network devices at the same level that have cross-connection relationships can be found through the network topology of the network devices, and configuration data can be delivered to network devices at the same level at the same time, which solves the problem that existing methods cannot find cross-connection relationships.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116137594B
    Figure CN116137594B
Patent Text Reader

Abstract

The embodiments of the present application disclose a method, apparatus, device and storage medium for generating a network topology. The method comprises: obtaining link relationship information, wherein the link relationship information comprises the identifiers of multiple devices at the same level in different levels, and the connection relationship information between each device; when the identifiers of the multiple devices at the same level satisfy a preset relationship, determining the cross-connection relationship information between the multiple devices satisfying the preset relationship according to the identifiers of the multiple devices at the same level and the connection relationship information; generating a network topology according to the cross-connection relationship information of each level. The method provided in the embodiments of the present application can generate a network topology including cross-connection relationship information between network devices.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the technical field of bearer network analysis, and in particular, relates to a method, device, equipment and storage medium for generating a network topology. Background Art

[0002] The network equipment of the metropolitan area network generally adopts hierarchical mesh networking. In the network equipment of different levels, there is an up-down relationship between the network equipment that communicates with each other; in the network equipment of the same level, there is a horizontal relationship between the network equipment that communicates with each other. When sending down the network configuration, it is necessary to find the network equipment of the same level with a horizontal relationship through the network topology of the network equipment, and send the configuration data to the network equipment of the same level at the same time.

[0003] In the existing network topology generation method, the network topology including the up-down relationship of network devices is generated by querying the up-down relationship between network devices. It is impossible to find the same-level network devices with horizontal relationship through the network topology of network devices, so it is impossible to send configuration data to the same-level network devices at the same time through the network topology. Summary of the invention

[0004] Embodiments of the present application provide a method, apparatus, device, and storage medium for generating a network topology, which can generate a network topology including horizontal connection relationship information between network devices.

[0005] In a first aspect, an embodiment of the present application provides a method for generating a network topology, the method comprising:

[0006] Acquire link relationship information, the link relationship information including identifiers of multiple devices at the same level in different levels, and connection relationship information between each device;

[0007] When the identifiers of multiple devices at the same level satisfy a preset relationship, determining the horizontal connection relationship information between the multiple devices satisfying the preset relationship according to the identifiers and connection relationship information of the multiple devices at the same level;

[0008] Generate network topology based on the cross-relationship information at each level.

[0009] In a possible implementation, when the identifiers of multiple devices at the same level satisfy a preset relationship, determining the horizontal connection relationship information between the multiple devices satisfying the preset relationship according to the identifiers and connection relationship information of the multiple devices at the same level includes:

[0010] When the identifiers of any two devices in the same layer satisfy a preset relationship, the two devices are determined to be master and backup devices for each other;

[0011] According to the identification and connection relationship information of the devices which are mutually primary and backup devices in the same layer, the horizontal connection relationship information between the multiple devices is determined.

[0012] In a possible implementation, a network topology is generated according to the cross-connection relationship information of each level, including:

[0013] Determine the uplink relationship information between the multiple devices at different levels according to the identification and connection relationship information of the multiple devices at different levels;

[0014] Generate network topology based on horizontal connection relationship information and upstream connection relationship information.

[0015] In a possible implementation, obtaining link relationship information includes:

[0016] Get the ID of each device in each link in the target network;

[0017] According to the identification of each device in each link, determine the level of each device;

[0018] Generate connection relationship information between devices in each link according to the identifier of each device in each link;

[0019] Link relationship information is generated based on the identification of each device, the level of each device, and the connection relationship information.

[0020] In a possible implementation, the link relationship information further includes port information of each device, and each port information includes physical port information;

[0021] The method also includes:

[0022] When the port information further includes trunk line Truck port information to which the physical port information belongs, determining the Truck port information as the target port information;

[0023] When the port information does not include the Truck port information to which the physical port information belongs, determining the physical port information as the target port information;

[0024] Path information is generated according to the network topology and the destination port information of each device in the network topology.

[0025] In a second aspect, an embodiment of the present application provides a device for generating a network topology, the device comprising:

[0026] An acquisition module, used to acquire link relationship information, the link relationship information including identifiers of multiple devices at the same level in different levels, and connection relationship information between each device;

[0027] A determination module, configured to determine, when the identifiers of multiple devices at the same level satisfy a preset relationship, horizontal connection relationship information between the multiple devices satisfying the preset relationship according to the identifiers and connection relationship information of the multiple devices at the same level;

[0028] The generation module generates the network topology based on the horizontal relationship information of each level.

[0029] In a possible implementation, a module is determined, specifically for:

[0030] When the identifiers of any two devices in the same layer satisfy a preset relationship, the two devices are determined to be master and backup devices for each other;

[0031] According to the identification and connection relationship information of the devices which are mutually primary and backup devices in the same layer, the horizontal connection relationship information between the multiple devices is determined.

[0032] In a possible implementation, the generating module is specifically used for:

[0033] Determine the uplink relationship information between the multiple devices at different levels according to the identification and connection relationship information of the multiple devices at different levels;

[0034] Generate network topology based on horizontal connection relationship information and upstream connection relationship information.

[0035] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, it implements the method in the first aspect or any possible implementation of the first aspect.

[0036] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having computer program instructions stored thereon. When the computer program instructions are executed by a processor, the method in the first aspect or any possible implementation of the first aspect is implemented.

[0037] A network topology generation method, apparatus, device and storage medium provided in an embodiment of the present application first obtain the identifiers of multiple devices at the same level in different levels, as well as the connection relationship information and link relationship information between each device; then, when the identifiers of multiple devices at the same level satisfy a preset relationship, the horizontal connection relationship information between the multiple devices satisfying the preset relationship is determined based on the identifiers and connection relationship information of the multiple devices at the same level, and the horizontal connection relationship information obtained at this time is the horizontal connection relationship information between the multiple devices at the same level; finally, based on the horizontal connection relationship information of each level, a network topology including devices at all levels in the networking is generated, and a network topology including the horizontal connection relationship information between network devices is obtained, so that network devices at the same level with a horizontal connection relationship can be found through the network topology of the network devices, so that configuration data can be sent to the network devices at the same level at the same time. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the technical solution of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0039] Figure 1 It is a flowchart of a method for generating a network topology provided in an embodiment of the present application;

[0040] Figure 2 It is a schematic diagram of the structure of a network topology generation device provided in an embodiment of the present application;

[0041] Figure 3 It is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0042] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only configured to explain the present application and are not configured to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by illustrating the examples of the present application.

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

[0044] The network equipment of the metropolitan area network generally adopts a hierarchical mesh networking. In the network equipment of different levels, there is an up-and-down relationship between the network equipment that communicate with each other; in the network equipment of the same level, there is a horizontal relationship between the network equipment that communicate with each other. When sending down the network configuration, it is necessary to find the network equipment of the same level with a horizontal relationship through the network topology of the network equipment, and send the configuration data to the network equipment of the same level at the same time. In the existing method of generating network topology, by querying the up-and-down relationship between network equipment, a network topology including the up-and-down relationship of network equipment is generated. It is impossible to find the network equipment of the same level with a horizontal relationship through the network topology of the network equipment, so it is impossible to send configuration data to the network equipment of the same level at the same time through the network topology.

[0045] To solve the above problems, the embodiments of the present application provide a method, apparatus, device and storage medium for generating a network topology, which first obtains the identifiers of multiple devices at the same level in different levels, as well as the connection relationship information and link relationship information between each device; then, when the identifiers of multiple devices at the same level satisfy a preset relationship, the horizontal connection relationship information between the multiple devices satisfying the preset relationship is determined according to the identifiers and connection relationship information of the multiple devices at the same level, and the horizontal connection relationship information obtained at this time is the horizontal connection relationship information between the multiple devices at the same level; finally, according to the horizontal connection relationship information of each level, a network topology including devices at all levels in the networking is generated, and a network topology including the horizontal connection relationship information between network devices is obtained, so that network devices at the same level with a horizontal connection relationship can be found through the network topology of the network devices, so that configuration data can be sent to the network devices at the same level at the same time.

[0046] In the method provided in the embodiment of the present application, the end sending the service request may be a terminal capable of data transmission and data processing, such as a server, a computer and other devices.

[0047] In order to more clearly explain the method provided by the embodiment of the present application, the terms involved in the embodiment of the present application are explained below.

[0048] Network level: Among different types of network equipment, three types of network equipment, optical line terminal (OLT), switch and router, are divided into three network levels. The level of network equipment is from low to high: OLT→switch→router. Among the same type of network equipment, according to the fields MA, MB, MC in the switch name, the level of the switch is divided into different network levels, from low to high, MA→MB→MC. Network devices with MA in the name and those with MA in the name are network devices at the same level, network devices with MB in the name and those with MB in the name are network devices at the same level, and network devices with MC in the name and those with MC in the name are network devices at the same level; according to the fields PA, PC, PB in the router name, the level of the router is divided into different network levels, from low to high, PA→PB→PC. Network devices with PA in the name and those with PA in the name are network devices at the same level, network devices with PB in the name and those with PB in the name are network devices at the same level, and network devices with PC in the name and those with PC in the name are network devices at the same level.

[0049] Link relationship information: Link relationship information can be generated by collecting network protocols such as Link Layer Discovery Protocol (LLDP) and Simple Network Management Protocol (SNMP). Link relationship information can be a table including link relationships, that is, a link relationship table. Both devices at both ends of a link will report this link. There will be duplications in the link relationship collection, so it is necessary to distinguish the direction of the link according to the network level of the devices at both ends of the link. In the link relationship table, only the situation where the network level of the local device is not higher than the level of the opposite device is retained. Among them, if the network level of the local device is lower than that of the opposite device, the connection direction is upward connection, and if the network level of the local device is equal to that of the opposite device, the connection direction is horizontal connection. When the local device type is OLT, the connection direction is always upward connection.

[0050] The following will be combined Figure 1 A method for generating a network topology provided in an embodiment of the present application is described in detail.

[0051] like Figure 1 As shown, the method may include the following steps:

[0052] S110, obtaining link relationship information.

[0053] Obtain link relationship information of network devices in the network through network protocols.

[0054] The link relationship information includes the identifiers of multiple devices at the same level in different levels, and the connection relationship information between each device.

[0055] The device identifier may be the name of the device in the network.

[0056] In an example, the identifier of a router in the network is XXXXX-PA-CMNET-BAS01-XXXX-XXX.

[0057] The connection relationship information indicates that two devices are connected to each other. The two devices connected to each other may be in a horizontal connection relationship at the same level or in an up-and-down connection relationship at different levels.

[0058] In one embodiment, obtaining link relationship information includes the following steps:

[0059] First, obtain the identity of each device in each link in the target network.

[0060] The links in the target network are obtained through the network protocol, each link includes at least two network devices connected together, and the identification of the device connected to each link is obtained.

[0061] The target network can be a metropolitan area network.

[0062] Secondly, according to the identification of each device in each link, the level of each device is determined.

[0063] Based on the fields in the identifier of each device in each link, the level of each device is determined.

[0064] In an example, a link includes network devices identified as XXXXX-PA-CMNET-BAS01-XXXX-XXX and XXXXX-PA-CMNET-BAS02-XXXX-XXX. Since the fields included in the two identifiers are both PA, the two network devices are at the same level.

[0065] Thirdly, according to the identification of each device in each link, the connection relationship information between the devices in each link is generated.

[0066] According to the identification of each device in each link, the connection relationship information between devices at the same level is determined as a horizontal connection relationship, and the connection relationship information between devices at different levels is determined as a vertical connection relationship.

[0067] Finally, link relationship information is generated based on the identification of each device, the level of each device, and the connection relationship information.

[0068] By counting the identification of each device, the level of each device and the connection relationship information, the link relationship information between all devices in the target network is obtained.

[0069] The method provided in the embodiment of the present application determines the link relationship information between devices in the target network according to the identification, hierarchy and connection relationship information of the devices in the link of the target network, thereby providing a basis for generating the network topology.

[0070] The above describes a method for obtaining link relationship information. The following describes a method for determining horizontal connection relationship information between devices at the same level in a link.

[0071] S120: When the identifiers of the multiple devices at the same level satisfy a preset relationship, determine the horizontal connection relationship information between the multiple devices satisfying the preset relationship according to the identifiers and connection relationship information of the multiple devices at the same level.

[0072] For multiple devices at the same level, determine whether the identifiers of two of the devices connected together satisfy a preset relationship. When the identifiers of the two devices satisfy the preset relationship, determine the horizontal connection relationship information between the two devices based on the identifiers and connection relationship information of the two devices. In this way, determine the identifiers and connection relationship information of all devices at the same level, and determine the horizontal connection relationship information between multiple devices at the same level that satisfy the preset relationship.

[0073] In one embodiment, when the identifiers of multiple devices at the same level satisfy a preset relationship, determining the horizontal connection relationship information between the multiple devices satisfying the preset relationship according to the identifiers and connection relationship information of the multiple devices at the same level includes the following steps:

[0074] First, when the identifiers of any two devices in a plurality of devices at the same level satisfy a preset relationship, it is determined that the two devices are each other's primary and backup devices.

[0075] In one example, the preset relationship is that in the identifiers of two devices at the same level, the difference in the digital numbers is only 1. The identifiers of the two devices at the same level are XXXXX-PA-CMNET-BAS01-XXXX-XXX and XXXXX-PA-CMNET-BAS02-XXXX-XXX, respectively. The digital numbers in the representations of the two devices are 01 and 02, respectively. The difference between the two digital numbers is only 1, so the two devices meet the preset conditions, and the two devices are each other's primary and backup devices.

[0076] Then, according to the identification and connection relationship information of the devices that are mutually primary and standby devices in the same layer, the horizontal connection relationship information between the multiple devices is determined.

[0077] According to the identification and connection relationship information of two devices that are mutually master-slave devices in the same layer, the horizontal connection relationship information between the two master-slave devices that are mutually connected in the same layer is determined; in this way, the identification and connection relationship information of all devices that are mutually master-slave devices in the same layer are judged, the horizontal connection relationship information between all devices that are mutually master-slave devices in the same layer is determined, and the horizontal connection relationship information of the devices in the same layer is obtained.

[0078] In this step, devices that are mutually active and standby are determined, and only the connection relationship between devices that are mutually active and standby is determined as horizontal connection relationship information, which can avoid broadcast storms.

[0079] The method provided in the embodiment of the present application determines the horizontal connection relationship information between multiple devices at the same level that meet the preset relationship based on the identification and connection relationship information of multiple devices at the same level, thereby avoiding the generation of broadcast storms.

[0080] The above describes a method for determining the horizontal connection relationship information between multiple devices that meet a preset relationship in the same level. The following describes a method for generating a network topology based on the horizontal connection relationship information of each level.

[0081] S130: Generate a network topology according to the horizontal connection relationship information of each level.

[0082] Based on the horizontal connection relationship information of each level, a network topology including all levels in the network is generated.

[0083] In one embodiment, generating a network topology according to the cross-connection relationship information of each level includes the following steps:

[0084] First, based on the identification and connection relationship information of the multiple devices at different levels, the upward connection relationship information between the multiple devices at different levels is determined.

[0085] The connection relationship information includes the horizontal connection relationship between devices at the same level and the vertical connection relationship between devices at different levels. According to the identification of the devices at different levels connected together, the upward connection relationship information between the device at the lower level and the device at the higher level is determined. In this way, according to the identification of the multiple devices at different levels connected together, the upward connection relationship information between the multiple devices at different levels is determined, and the upward connection relationship information of the devices at different levels of the network is obtained.

[0086] Then, the network topology is generated according to the horizontal connection relationship information and the upstream connection relationship information.

[0087] Based on the horizontal connection relationship information of devices at each level and the upward connection relationship information of devices at different levels, a network topology including all levels in the networking is generated.

[0088] The method provided in the embodiment of the present application determines the upward relationship information between multiple devices at different levels based on the identifications of devices connected together at different levels, and generates a network topology including all levels in the networking based on the horizontal relationship information of devices at each level and the upward relationship information of devices at different levels, thereby obtaining a complete network topology.

[0089] The embodiment of the present application first obtains the identification of multiple devices at the same level in different levels, as well as the connection relationship information and link relationship information between each device; then, when the identification of multiple devices at the same level satisfies the preset relationship, the horizontal connection relationship information between the multiple devices that satisfy the preset relationship is determined according to the identification and connection relationship information of the multiple devices at the same level, and the horizontal connection relationship information obtained at this time is the horizontal connection relationship information between the multiple devices at the same level; finally, according to the horizontal connection relationship information of each level, a network topology including devices of all levels in the networking is generated, and a network topology including the horizontal connection relationship information between network devices is obtained, so that network devices at the same level with a horizontal connection relationship can be found through the network topology of the network devices, so that configuration data can be sent to the network devices at the same level at the same time.

[0090] In some embodiments, the link relationship information further includes port information of each device, and each port information includes physical port information; after generating the network topology, that is, S130, the method for generating the network topology further includes the following steps:

[0091] When the port information further includes Truck port information to which the physical port information belongs, the Truck port information is determined to be the target port information.

[0092] When the port information does not include the Truck port information to which the physical port information belongs, the physical port information is determined to be the target port information.

[0093] Path information is generated according to the network topology and the destination port information of each device in the network topology.

[0094] The method provided in the embodiment of the present application generates path information based on the physical port information of each device in the network topology or the Truck port information to which the physical port information belongs, and provides a broadcast path for sending down the network configuration.

[0095] In one embodiment, the method for generating a network topology includes the following steps:

[0096] S1, obtain the IDs, connection relationship information, type of each device and physical port of each device of all devices in the link of the target network, and establish a link relationship table.

[0097] The target network includes an OLT, at least one switch and at least one router.

[0098] Use the local device ID as "A-end device", the local port ID as "A-end physical port", the neighbor device name connected to the A-end device as "Z-end device" and the neighbor port ID as "Z-end physical port".

[0099] In one example, when the Trunk port to which the physical port of the device belongs has a value, a link relationship table is also established according to the Trunk port to which the physical port of the device belongs.

[0100] S2, using the "A-end device" as the OLT to query the link relationship table, and obtain the IDs and physical ports of multiple types of "Z-end devices".

[0101] In one example, the link relationship table of the "Z-end device" including the OLT is shown in Table 1

[0102] Table 1 includes the link relationship table of OLT

[0103]

[0104] S3, if the "Z-end device type" includes routers and switches, the switch is selected first, and the first network topology is generated based on the "A-end device ID" and the switch ID in the "Z-end device", and the ID of each device in the first network topology, as well as the physical port or the Trunk port information to which the physical port belongs, is recorded.

[0105] In an example, the link relationship table is shown in Table 1. "Z-end device type" includes routers and switches. Then, "switch" is filtered in "Z-end device type" to obtain the OLT-MC switch link. "Z-end device ID" is "xx-MC-SW02-xx". If "A-end physical port belongs to Trunk port" is empty, "A-end physical port" is used; if "Z-end physical port belongs to Trunk port" has a value, the value of "Z-end physical port belongs to Trunk port" is used.

[0106] This step obtains a first network topology including an OLT and a switch connected to the OLT.

[0107] S4, using the switch in S3 as the "A-end device" to search the link relationship table, and obtain the IDs and physical ports of multiple types of "Z-end devices".

[0108] In one example, the link relationship table of the "Z-end device" including the switch is shown in Table 2

[0109] Table 2 includes the link relationship table of the "Z-end device" of the switch

[0110]

[0111] S5, filter "router" in "Z-end device type" to obtain the MC-BRAS link, generate the second network topology based on the first network topology and the ID of the router in the "Z-end device", and record the ID of each device in the second network topology, as well as the physical port or the Trunk port information to which the physical port belongs.

[0112] In an example, the link relationship table of the "Z-end device" including the switch is shown in Table 2. After filtering "router" in the "Z-end device type", the "Z-end device ID" obtained is "xx-PA-BAS04-xx". If "Trunk port to which the A-end physical port belongs" has a value, the value of "Trunk port to which the A-end physical port belongs" is taken; if "Trunk port to which the Z-end physical port belongs" has a value, the value of "Trunk port to which the Z-end physical port belongs" is taken.

[0113] This step obtains a second network topology including an OLT, a switch, and a router connected to the switch.

[0114] S6. Select "Switch" in "Z-end device type" to obtain the horizontal device link of the switch.

[0115] In one example, the link relationship table of the "Z-end device" including the switch is shown in Table 2, and the "Z-end device ID" obtained after filtering "Change Machine" in the "Z-end device type" is "xx-MC-SW01-xx".

[0116] S7, determine whether the switch and the cross-connected devices of the switch are each other's primary and backup devices.

[0117] S8: When the switch and the cross-connected device of the switch are not each other's primary and backup devices, the link with the cross-connected device of the switch is abandoned.

[0118] When the switch and the cross-connected device of the switch are active and standby devices for each other, execute S9.

[0119] S9, based on the second network topology and the “Z-end device ID”, generate a third network topology, and record the device ID, and the physical port or the Trunk port information to which the physical port belongs.

[0120] In an example, if "Trunk port to which physical port at end A belongs" has a value, the value of "Trunk port to which physical port at end A belongs" is used; if "Trunk port to which physical port at end Z belongs" has a value, the value of "Trunk port to which physical port at end Z belongs" is used.

[0121] This step obtains a third network topology including an OLT, a switch, a router connected to the switch, and a switch connected to the switch.

[0122] S10, based on the third network topology and the ID of the router in S3, generate a fourth network topology, record the ID of each device in the fourth network topology and the physical port connecting the OLT and the router or the Trunk port information to which the physical port belongs.

[0123] This step obtains a fourth network topology including an OLT, a router connected to the OLT, a switch connected to the OLT, a router connected to the switch, and a switch connected to the switch.

[0124] The method provided in the embodiment of the present application generates a network topology including the horizontal connection relationship and the upward connection relationship of all network devices in the target network by establishing a link relationship table and searching the link relationship table, so that network devices of the same level with horizontal connection relationships can be found through the network topology of the network devices, and configuration data can be sent to the network devices of the same level at the same time.

[0125] The present application also provides a device for generating a network topology, such as Figure 2 As shown, the apparatus may include an acquisition module 210 , a determination module 220 and a generation module 230 .

[0126] The acquisition module 210 acquires link relationship information.

[0127] The link relationship information includes the identifiers of multiple devices at the same level in different levels, and the connection relationship information between each device.

[0128] The determination module 220 is used to determine the horizontal connection relationship information between the multiple devices that meet the preset relationship according to the identifiers and connection relationship information of the multiple devices at the same level when the identifiers of the multiple devices at the same level meet the preset relationship;

[0129] The generation module 230 is used to generate a network topology according to the horizontal connection relationship information of each level.

[0130] The network topology generation device provided in the embodiment of the present application first obtains the identification of multiple devices at the same level in different levels, as well as the connection relationship information and link relationship information between each device; then, when the identification of multiple devices at the same level satisfies the preset relationship, the horizontal connection relationship information between the multiple devices that satisfy the preset relationship is determined according to the identification and connection relationship information of the multiple devices at the same level, and the horizontal connection relationship information obtained at this time is the horizontal connection relationship information between the multiple devices at the same level; finally, according to the horizontal connection relationship information of each level, a network topology including devices of all levels in the networking is generated, and a network topology including the horizontal connection relationship information between network devices is obtained, so that network devices at the same level with a horizontal connection relationship can be found through the network topology of the network devices, so that configuration data can be sent to the network devices at the same level at the same time.

[0131] In some embodiments, the determination module 220 may be specifically configured to:

[0132] When the identifiers of any two devices in the same layer satisfy a preset relationship, the two devices are determined to be master and backup devices for each other;

[0133] According to the identification and connection relationship information of the devices which are mutually primary and backup devices in the same layer, the horizontal connection relationship information between the multiple devices is determined.

[0134] The apparatus provided in the embodiment of the present application determines the horizontal connection relationship information between multiple devices at the same level that meet the preset relationship based on the identification and connection relationship information of multiple devices at the same level, thereby avoiding the generation of broadcast storms.

[0135] In some embodiments, the generating module 230 may be specifically used to:

[0136] Determine the uplink relationship information between the multiple devices at different levels according to the identification and connection relationship information of the multiple devices at different levels;

[0137] Generate network topology based on horizontal connection relationship information and upstream connection relationship information.

[0138] The device provided in the embodiment of the present application determines the upward relationship information between multiple devices at different levels based on the identifications of devices connected together at different levels, and generates a network topology including all levels in the networking based on the horizontal relationship information of devices at each level and the upward relationship information of devices at different levels, thereby obtaining a complete network topology.

[0139] In some embodiments, the acquisition module 210 may be specifically used to:

[0140] Get the ID of each device in each link in the target network;

[0141] According to the identification of each device in each link, determine the level of each device;

[0142] Generate connection relationship information between devices in each link according to the identifier of each device in each link;

[0143] Link relationship information is generated based on the identification of each device, the level of each device, and the connection relationship information.

[0144] The device provided in the embodiment of the present application determines the link relationship information between devices in the target network according to the identification, hierarchy and connection relationship information of the devices in the link of the target network, thereby providing a basis for generating the network topology.

[0145] In some embodiments, the link relationship information further includes port information of each device, and each port information includes physical port information.

[0146] The determination module 220 may also be used to:

[0147] When the port information further includes trunk line Truck port information to which the physical port information belongs, determining the Truck port information as the target port information;

[0148] When the port information does not include the Truck port information to which the physical port information belongs, the physical port information is determined to be the target port information.

[0149] The generating module 230 may also be used to generate path information according to the network topology and the target port information of each device in the network topology.

[0150] The device provided in the embodiment of the present application generates path information based on the physical port information of each device in the network topology or the Truck port information to which the physical port information belongs, and provides a broadcast path for sending down the network configuration.

[0151] The network topology generation device provided in the embodiment of the present application performs Figure 1 Each step in the method shown can obtain a network topology including information on the horizontal connection relationship between network devices, so that network devices of the same level with horizontal connection relationships can be found through the network topology of the network devices, thereby achieving the technical effect of simultaneously sending configuration data to network devices of the same level. For the sake of concise description, it will not be described in detail here.

[0152] Figure 3 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application is shown.

[0153] The electronic device may include a processor 301 and a memory 302 storing computer program instructions.

[0154] Specifically, the processor 301 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.

[0155] The memory 302 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 302 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, the memory 302 may include a removable or non-removable (or fixed) medium. In appropriate cases, the memory 302 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 302 is a non-volatile solid-state memory. In a specific embodiment, the memory 302 includes a read-only memory (ROM). In appropriate cases, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically rewritable ROM (EAROM) or a flash memory or a combination of two or more of these.

[0156] The processor 301 reads and executes the computer program instructions stored in the memory 302 to implement any one of the network topology generation methods in the embodiments shown in the figure.

[0157] In one example, the electronic device may further include a communication interface 303 and a bus 310. Figure 3 As shown, the processor 301, the memory 302, and the communication interface 303 are connected via a bus 310 and communicate with each other.

[0158] The communication interface 303 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.

[0159] Bus 310 includes hardware, software or both, and the parts of electronic equipment are coupled to each other. For example, but not limitation, bus may include accelerated graphics port (AGP) or other graphics bus, enhanced industrial standard architecture (EISA) bus, front side bus (FSB), hypertransport (HT) interconnection, industrial standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 310 may include one or more buses. Although the present application embodiment describes and shows a specific bus, the application considers any suitable bus or interconnection.

[0160] The electronic device can execute the method for generating the network topology in the embodiment of the present application, thereby realizing the combination Figure 1 Describes the method for generating network topology.

[0161] In addition, in combination with the network topology generation method in the above embodiments, the present application embodiment can provide a computer-readable storage medium for implementation. The computer-readable storage medium stores computer program instructions; when the computer program instructions are executed by a processor, any network topology generation method in the above embodiments is implemented.

[0162] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.

[0163] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present application are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.

[0164] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.

[0165] The above is only a specific implementation of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the protection scope of this application.

Claims

1. A method for generating a network topology, characterized in that: The method comprises: Acquire link relationship information, where the link relationship information includes identifiers of multiple devices at the same level in different levels, and connection relationship information between each device; When the identifiers of the multiple devices at the same level satisfy a preset relationship, determining the horizontal connection relationship information between the multiple devices satisfying the preset relationship according to the identifiers of the multiple devices at the same level and the connection relationship information; Generate a network topology according to the horizontal connection relationship information of each level; The obtaining of link relationship information includes: Get the ID of each device in each link in the target network; Determining the level of each device according to the identifier of each device in each link; Generate connection relationship information between devices in each link according to the identifier of each device in each link; generating the link relationship information according to the identifier of each device, the level of each device and the connection relationship information; When the identifiers of the multiple devices at the same level satisfy a preset relationship, determining the horizontal connection relationship information between the multiple devices satisfying the preset relationship according to the identifiers of the multiple devices at the same level and the connection relationship information includes: When the identifiers of any two devices among the multiple devices at the same level satisfy the preset relationship, it is determined that the two devices are each other's primary and backup devices; The horizontal connection relationship information between the multiple devices is determined according to the identifiers of the devices that are mutually primary and standby devices and the connection relationship information in the same layer.

2. The method according to claim 1, characterized in that Generating a network topology according to the horizontal connection relationship information of each level includes: Determining up-link relationship information between the multiple devices at different levels according to the identifiers of the multiple devices at different levels and the connection relationship information; The network topology is generated according to the horizontal connection relationship information and the upward connection relationship information.

3. The method according to any one of claims 1 to 2, characterized in that: The link relationship information also includes port information of each device, and each port information includes physical port information; The method further comprises: When the port information further includes trunk line Truck port information to which the physical port information belongs, determining the Truck port information as target port information; When the port information does not include the Truck port information to which the physical port information belongs, determining the physical port information as the target port information; Path information is generated according to the network topology and target port information of each device in the network topology.

4. A device for generating a network topology, characterized in that: The device comprises: An acquisition module, used to acquire link relationship information, wherein the link relationship information includes identifiers of multiple devices at the same level in different levels, and connection relationship information between each device; a determination module, configured to determine, when the identifiers of the plurality of devices at the same level satisfy a preset relationship, horizontal connection relationship information between the plurality of devices satisfying the preset relationship according to the identifiers of the plurality of devices at the same level and the connection relationship information; A generation module, used to generate a network topology according to the horizontal connection relationship information of each level; The acquisition module is also used for acquiring the link relationship information, including: Get the ID of each device in each link in the target network; Determining the level of each device according to the identifier of each device in each link; Generate connection relationship information between devices in each link according to the identifier of each device in each link; generating the link relationship information according to the identifier of each device, the level of each device and the connection relationship information; The determining module is further configured to determine, when the identifiers of the multiple devices at the same level satisfy the preset relationship, the horizontal connection relationship information between the multiple devices that satisfy the preset relationship according to the identifiers of the multiple devices at the same level and the connection relationship information, including: When the identifiers of any two devices among the multiple devices at the same level satisfy the preset relationship, it is determined that the two devices are each other's primary and backup devices; The horizontal connection relationship information between the multiple devices is determined according to the identifiers of the devices that are mutually primary and standby devices and the connection relationship information in the same layer.

5. The device according to claim 4, characterized in that The generation module is specifically used for: Determining up-link relationship information between the multiple devices at different levels according to the identifiers of the multiple devices at different levels and the connection relationship information; The network topology is generated according to the horizontal connection relationship information and the upward connection relationship information.

6. An electronic device, characterized in that: The device comprises: a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, the method for generating a network topology as described in any one of claims 1 to 3 is implemented.

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