Method, device and electronic equipment for network topology layering

CN116938725BActive Publication Date: 2026-10-09XINYANG BRANCH HENAN CO LTD OF CHINA MOBILE COMM CORP +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210326255.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-30
Publication Date
2026-10-09
Estimated Expiration
2042-03-30

AI Technical Summary

Technical Problem

[0004]本申请实施例提供一种网络拓扑分层的方法、装置及电子设备,能够解决无法对包括网元的网络拓扑自动进行分层,导致工作效率低下的问题,能够提高传输网元的维护管理效率

Benefits of technology

[0008]Fourthly, embodiments of this application provide a readable storage medium on which a program or instructions are stored, which, when executed by a processor, implement the steps of the method described in the first aspect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116938725B_ABST
    Figure CN116938725B_ABST
Patent Text Reader

Abstract

The application discloses a network topology layering method and device and electronic equipment, and belongs to the technical field of slice grouping networks, and is used for completing automatic layering of a network topology and improving the maintenance and management efficiency of a transmission network element. The method comprises the following steps: obtaining a graph corresponding to a network topology to be layered according to the network topology to be layered, wherein the graph is one of data structures, and nodes in the graph correspond to network elements in the network topology to be layered; layering the nodes in the graph, and layering the network topology to be layered according to the nodes in the layered graph.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of slice packet networking technology, specifically relating to a method, apparatus, and electronic device for network topology layering. Background Technology

[0002] Statistics show that medium-sized cities currently have approximately 2,000-5,000 network elements, while provincial capital cities have over 10,000. Faced with this rapid growth in network elements, the complexity of the network topology is increasing exponentially. Routine maintenance and management of transmission network elements requires subnetting the entire network and assigning network elements to different subnets. The current method involves transmission maintenance personnel manually creating subnets based on a pre-planned network structure and then manually assigning newly joined network elements to their respective subnets based on their network access information.

[0003] However, this working method cannot automatically assign network elements to various subnets, that is, it cannot automatically hierarchically classify the network topology including network elements, resulting in low working efficiency. Summary of the Invention

[0004] This application provides a method, apparatus, and electronic device for network topology layering, which can solve the problem of low work efficiency caused by the inability to automatically layer network topology including network elements, and can improve the maintenance and management efficiency of transmission network elements.

[0005] In a first aspect, embodiments of this application provide a method for network topology layering, the method comprising: obtaining a graph corresponding to the network topology to be layered based on the network topology to be layered, wherein the graph is a data structure and the nodes in the graph correspond to network elements in the network topology to be layered; layering the nodes in the graph; and layering the network topology to be layered based on the nodes in the layered graph.

[0006] Secondly, embodiments of this application provide a network topology layering apparatus, the apparatus comprising: a construction module, configured to obtain a graph corresponding to the network topology to be layered based on the network topology to be layered, wherein the graph is a data structure and the nodes in the graph correspond to network elements in the network topology to be layered; and a layering module, configured to layer the nodes in the graph and layer the network topology to be layered based on the nodes in the layered graph.

[0007] Thirdly, embodiments of this application provide an electronic device including a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement the steps of the method described in the first aspect.

[0008] Fourthly, embodiments of this application provide a readable storage medium on which a program or instructions are stored, which, when executed by a processor, implement the steps of the method described in the first aspect.

[0009] In this embodiment, a graph corresponding to the network topology to be layered is obtained based on the network topology to be layered. The graph is a data structure, and the nodes in the graph correspond to network elements in the network topology to be layered. The nodes in the graph are layered, and the network topology to be layered is layered based on the nodes in the layered graph. This can automatically assign network elements entering the network to various subnets, complete the automatic layering of the network topology, realize the automatic discovery and automatic resolution of the network structure, and greatly improve the maintenance and management efficiency of transmission network elements. Attached Figure Description

[0010] Figure 1 This is a flowchart illustrating a method for network topology layering provided in an embodiment of this application;

[0011] Figure 2 This is a schematic diagram of a data structure provided in an embodiment of this application;

[0012] Figure 3 This is a schematic diagram of a network element topology connection structure provided in an embodiment of this application;

[0013] Figure 4 This is a flowchart illustrating another method for network topology layering provided in an embodiment of this application;

[0014] Figure 5 This is a flowchart illustrating another method for network topology layering provided in an embodiment of this application;

[0015] Figure 6 This is a flowchart illustrating another method for network topology layering provided in an embodiment of this application;

[0016] Figure 7 This is a flowchart illustrating another method for network topology layering provided in an embodiment of this application;

[0017] Figure 8 This is a flowchart illustrating another method for network topology layering provided in an embodiment of this application;

[0018] Figure 9 This is a flowchart illustrating another method for network topology layering provided in an embodiment of this application;

[0019] Figure 10 This is a schematic diagram of the structure of a network topology layering device according to an embodiment of this application;

[0020] Figure 11This is a schematic diagram of the structure of an electronic device according to another embodiment of this application. Detailed Implementation

[0021] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0022] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.

[0023] The method, apparatus, and electronic equipment for network topology layering provided in this application will be described in detail below with reference to the accompanying drawings and through specific embodiments and application scenarios.

[0024] Figure 1 This invention illustrates a method for network topology layering according to an embodiment of the present invention. This method can be executed by a network-side device, and can be performed by software or hardware installed on the network-side device. The method includes the following steps:

[0025] Step 102: Obtain the graph corresponding to the network topology to be layered.

[0026] In computers, a "graph" data structure is viewed as an abstract network composed of "nodes." Nodes (vertices) in the network are connected to each other via "edges." It primarily describes the connectivity between nodes. In this embodiment of the invention, the network topology can be abstracted as a "graph" in computer data structures. Each network element corresponds to a "node" in the graph, and the nodes between network elements correspond to "edges." The set of nodes adjacent to any given node represents the edges possessed by that node. Thus, the characteristics of the graph can be characterized by a key-value pair data type. Taking Python as an example, a dictionary type can be used to identify the graph. For each key-value pair in the dictionary, the primary key is a node, and the value is a set of nodes connected to that node. For example... Figure 2As shown, its data structure can be represented as:

[0027] {

[0028] “A”: [“B”, “C”],

[0029] "B": ["A", "C"],

[0030] “C”:[“B”,“A”],

[0031] }

[0032] Graph construction requires consideration of two parts: resource data storage and graph parsing. One aspect involves the connection of the transmission topology, for example... Figure 3 As shown.

[0033] On the other hand, regarding the storage format of data such as network elements and ports, data in the system is typically stored in the form of database tables. Figure 3 It can be seen that since the connections between transmission nodes are not one-to-one, the connection relationships between nodes cannot be directly stored in the form of database tables. However, the connections between transmission ports are one-to-one, and the connection relationships between ports and adjacent ports can also be stored in the form of database tables. Therefore, the connection relationships between network elements can be parsed from the port information stored in the database. Generally, the structure of a port in the database is as shown in the following port table:

[0034]

[0035] During the resolution process, the association between two network elements can be completed simply by using the network element information corresponding to the adjacent ports. For example, if port identifier 1 corresponds to adjacent port identifier 7, and port identifier 7 corresponds to adjacent port identifier 1, and the network element identifier corresponding to port identifier 1 is A, and the network element corresponding to port identifier 7 is B, then the connection between network element A and network element B can be established.

[0036] After obtaining the connection relationships between all network elements in the topology, ports with the same network element identifier in the port table are grouped into one category. The information of adjacent ports of each port in this category is removed. For each adjacent port, the network element to which it belongs is found. All found network elements are deduplicated. A key-value pair is constructed with the network element to which any port belongs as the primary key and the set of network elements to which adjacent ports belong as the value. Multiple key-value pairs are constructed in the same way. The set of completed key-value pairs is the "graph" in the embodiments of this application.

[0037] Step 104: Layer the nodes in the graph. Based on the layered nodes in the graph, layer the network topology to be layered.

[0038] Specifically, in the embodiments of this invention, the data structure "graph" corresponds to the network topology to be layered. The nodes in the "graph" are layered, and the network topology to be layered can be layered based on the nodes in the layered "graph".

[0039] This invention provides a method for network topology layering. It obtains a graph corresponding to the network topology to be layered, where the graph is a data structure and the nodes in the graph correspond to network elements in the network topology. The method then layers the nodes in the graph and, based on the resulting layered graph, layers the network topology, thus connecting the graph data structure with the network topology structure. By layering the nodes in the graph and automatically layering the network topology based on the graph's layering results, the method achieves automatic discovery, automatic parsing, and automatic layering of the network structure, improving work efficiency.

[0040] In one implementation, the step of layering the nodes in the graph, and layering the network topology to be layered based on the layered nodes in the graph, includes:

[0041] Disconnect the backbone aggregation nodes from the core layer nodes in the diagram to obtain a core layer subnet diagram and at least one first access aggregation layer subnet diagram. The backbone aggregation nodes correspond to network elements connected to core layer network elements in the network topology to be layered, and the core layer nodes correspond to core layer network elements in the network topology to be layered. Nodes in the core layer subnet diagram correspond to network elements in the core layer of the network to be layered, and nodes in the first access aggregation layer subnet diagram correspond to network elements in the access aggregation layer of the network to be layered. Each first access aggregation layer subnet diagram is layered to determine the level to which the nodes in the access aggregation layer of the diagram belong. The network elements corresponding to the nodes in the core layer subnet diagram are assigned to the core layer level.

[0042] The hierarchical network topology is divided into access layer, aggregation layer, and core layer network elements from bottom to top, enabling service access and layer-by-layer aggregation. The network below the aggregation layer uses a ring network, which has a large number of network elements, potentially leading to multiple layers extending downwards. The core layer has fewer network elements and uses a U-shaped network for network security considerations. The network elements connecting the lower aggregation layer and the upper core layer are backbone aggregation network elements, presented in backbone aggregation pairs in actual network deployments, typically as core nodes in each district / county. Each backbone aggregation pair is independent of other backbone aggregation pairs and does not intersect at the aggregation layer.

[0043] Based on the characteristics of the network topology to be layered and the actual production and maintenance needs, the topology segmentation of the network to be layered should follow the following rules:

[0044] 1) The core layer and the access aggregation layer have different network structures and should be separated.

[0045] 2) Each backbone aggregation point is relatively independent of the following network and should be segmented from each other.

[0046] Based on the above two characteristics, it can be found that by disconnecting the connection between the core layer and the backbone aggregation node, several subnet diagrams can be obtained, and the obtained subnet diagrams conform to the above-mentioned segmentation principle.

[0047] Therefore, for the segmentation of the "graph", the connection between the backbone aggregation nodes and the core layer nodes in the "graph" can be broken; for the key-value pairs in the graph, the connection between nodes can be deleted by deleting the element of the other node from the value of a pair of adjacent nodes. After the connection between the backbone aggregation nodes and the core layer nodes in the "graph" is broken, traversing the "graph" can yield a core layer subnet graph and at least one first access aggregation layer subnet graph.

[0048] The segmented graph can be traversed using the classic depth-first search algorithm in graph theory.

[0049] For example Figure 4 This diagram illustrates a flowchart of traversing the segmented "graph" in an embodiment of this application. The traversal operation of the sub-graph can be reused; therefore, it can be packaged into a traversal submodule, the logical process of which is as follows:

[0050] Given a segmented graph C, create an empty set graph_list. Starting from any node in graph C, perform a depth-first search algorithm to traverse the graph and obtain a sub-graph G. Add the obtained sub-graph G to graph_list and delete all nodes and edges included in all sub-graph Gs in graph C. Check if graph C is empty. If it is empty, return graph_list as the return value. If it is not empty, continue to traverse graph C using the depth-first search algorithm until graph C is empty.

[0051] Through, for example Figure 5 The logical flow shown can be used to obtain the core layer subnet diagram and the access aggregation layer subnet diagram, respectively:

[0052] The above traversal submodule is called to obtain the return value `graph_list`. Two empty sets are created: one to store the core layer subnet diagram and the other to store the access and aggregation layer subnet diagram. The network element attributes corresponding to any subnet diagram in `graph_list` are parsed. If the network element attribute corresponding to the subnet diagram is a core layer network element, then the subnet diagram is assigned to the core layer subnet diagram set and deleted from `graph_list`. If the network element attribute corresponding to the subnet diagram is not a core layer network element, then the subnet diagram is assigned to the access and aggregation layer subnet diagram set and deleted from `graph_list`. The judgment of `graph_list` continues until `graph_list` is empty. Finally, the core layer subnet diagram set and the access and aggregation layer subnet diagram are output.

[0053] A network topology to be layered has only one core layer subnet diagram. Therefore, the network elements corresponding to the nodes in the core layer subnet diagram can be directly extracted and assigned to the core layer subnet layer. That is, the nodes in the core layer subnet diagram are assigned to the core layer level.

[0054] In this way, by disconnecting the backbone aggregation nodes from the core layer nodes in the diagram, a core layer subnet diagram and at least one first access aggregation layer subnet diagram are obtained. Each first access aggregation layer subnet diagram is layered to determine the level to which the nodes in the access aggregation layer of the diagram belong. The nodes in the "graph" can be automatically divided according to the structural characteristics of the network topology, and the obtained access aggregation layer subnet diagrams can be layered. The network topology can be automatically layered according to the level to which the nodes in the access aggregation layer belong, realizing automatic discovery, automatic resolution, and automatic layering of the network structure, thus improving work efficiency.

[0055] In one implementation, before layering each of the first access aggregation layer subnet diagrams and determining the layer to which a node in the access aggregation layer of the diagram belongs, the method further includes:

[0056] By using a preset backbone aggregation ring traversal algorithm, each of the first access aggregation layer sub-network diagrams is traversed to determine the backbone aggregation layer in each of the first access aggregation layer sub-network diagrams, and the nodes of the backbone aggregation layer are assigned to the first level of the first access aggregation layer.

[0057] In one implementation, the preset backbone convergence ring traversal algorithm includes:

[0058] Identify the backbone aggregation nodes in the subnet graph to be traversed that are used to directly connect to the upper-level network;

[0059] Based on the backbone convergence nodes, a backbone convergence layer is determined. In the subgraph to be traversed, the set of nodes on the path with the fewest nodes among all connected paths from one backbone convergence node to another, excluding directly connected paths, is the backbone convergence layer.

[0060] Specifically, the structure of an access aggregation layer subnet diagram has the following characteristics:

[0061] 1) The network will extend downwards in multiple layers in the form of rings or chains;

[0062] 2) When extending downwards in the form of a ring, the extended ring network will return to the upper-level node;

[0063] 3) When the lower-level ring network returns to the upper-level node, it will not form a ring across nodes.

[0064] The backbone aggregation layer is located at the top of the access aggregation layer and is directly connected to the core layer. It enables the aggregation of services to the core layer and typically includes a pair of backbone aggregation nodes and several aggregation network elements. For an access aggregation layer subnet diagram, based on the characteristic that "when a lower-layer ring network is dual-homed to an upper-layer node, it will not form a ring across nodes," the method for determining the backbone aggregation layer can be described as: the set of nodes on the path with the fewest nodes among all connected paths from one backbone aggregation node to another, excluding directly connected paths.

[0065] The first access convergence layer subnet can be viewed as a weighted graph where the weight between any two points is 1. Therefore, the problem of finding the path between two points with the fewest traversal nodes (excluding directly connected paths) is transformed into finding the shortest path between two points in a weighted graph (excluding directly connected paths). Using the classic Dijkstra's algorithm in graph theory, we can solve for the shortest path and the nodes traversed on the shortest path, thus completing the node traversal of the backbone convergence ring.

[0066] In this way, by identifying the backbone aggregation nodes in the sub-network diagram to be traversed that are directly connected to the upper-level network, and based on the backbone aggregation nodes, determining the backbone aggregation layer, traversing each first access aggregation layer sub-network diagram, determining the backbone aggregation layer in each first access aggregation layer sub-network diagram, and assigning the nodes of the backbone aggregation layer to the first level of the first access aggregation layer, the system can automatically traverse the first access aggregation layer and determine the level to which the nodes in the backbone aggregation layer belong. This also automatically determines the level to which the network element corresponding to the node in the backbone aggregation layer belongs in the network topology, thus improving operational efficiency.

[0067] In one implementation, the step of layering each of the first access aggregation layer subnets and determining the layer to which the nodes in the access aggregation layer of the graph corresponding to the network topology belong includes:

[0068] Each of the first access aggregation layer subnet diagrams is divided using a preset division method to obtain at least one second access aggregation layer subnet diagram.

[0069] Determine whether each of the second access aggregation layer subnet diagrams meets the preset conditions, and determine the layer to which the nodes in the second access aggregation layer subnet diagrams belong based on the determination results.

[0070] In one implementation, the preset partitioning method includes:

[0071] Determine the backbone convergence layer of the sub-network graph to be divided, and delete the connections between every two nodes in the backbone convergence layer of the sub-network graph to be divided, so as to divide the sub-network graph to be divided.

[0072] Specifically, at least one second access aggregation layer sub-network diagram can be obtained by deleting the links between every two nodes in the backbone aggregation layer of the first access aggregation layer sub-network diagram. It can then be determined whether each second access aggregation layer sub-network diagram meets the preset conditions. Based on the determination results, the layer to which the nodes in the second access aggregation layer sub-network diagram belong can be determined.

[0073] In this way, the first access aggregation layer subnet diagram is further divided to obtain at least one second access aggregation layer subnet diagram. It is then determined whether each second access aggregation layer subnet diagram meets the preset conditions. Based on the determination results, the level to which the node in the second access aggregation layer subnet diagram belongs is determined. This can automatically and accurately determine the level to which the node in the access aggregation layer subnet diagram belongs, improving the accuracy of layering and increasing work efficiency.

[0074] In one implementation, the preset condition is that it includes only one node belonging to the backbone aggregation layer, and the step of determining the layer to which the node in the second access aggregation layer subnet diagram belongs based on the judgment result includes:

[0075] Determine a second access aggregation layer subnet diagram that meets preset conditions, and assign nodes in the second access aggregation layer subnet diagram that meets preset conditions, excluding nodes in the backbone aggregation layer, to the second level of the access aggregation layer.

[0076] A second access aggregation layer sub-network diagram that does not meet the preset conditions is identified. The second access aggregation layer sub-network diagram that does not meet the preset conditions is traversed and divided using the preset backbone aggregation ring traversal algorithm and the preset division method until all sub-network diagrams obtained meet the preset conditions. In each traversal and division, the layer to which the backbone aggregation layer nodes other than the nodes whose assigned layer has been determined is superimposed as one, and the layer to which the nodes in the sub-network diagram that meet the preset conditions belong, other than the nodes whose assigned layer has been determined, is superimposed as two.

[0077] Specifically, if the second access aggregation subnet diagram includes only one node, then the second access aggregation subnet diagram is an isolated node, and this node must be a node in the backbone aggregation layer. Therefore, the node's level has been determined when the backbone aggregation layer is determined.

[0078] If the second access aggregation subnet diagram includes multiple nodes, but only one node of the backbone aggregation layer is included among the multiple nodes, then the second access aggregation subnet diagram is a chain, and the nodes other than the nodes in the backbone aggregation layer belong to the second level of the access aggregation layer.

[0079] If the second access aggregation sub-network diagram includes two or more access aggregation layer nodes, then the second access aggregation layer sub-network diagram that does not meet the preset conditions is traversed and divided until all the sub-network diagrams obtained meet the preset conditions. In this case, each time the sub-network diagram is traversed and divided, the level to which the backbone aggregation layer nodes other than the nodes whose assigned level has been determined is superimposed as one, and the level to which the nodes other than the nodes whose assigned level has been determined are superimposed as two in the sub-network diagrams that meet the preset conditions.

[0080] In this way, by determining the second access aggregation layer sub-network diagram that meets the preset conditions, nodes in the second access aggregation layer sub-network diagram that meet the preset conditions, excluding nodes in the backbone aggregation layer, are assigned to the second level of the access aggregation layer. For the second access aggregation layer sub-network diagram that does not meet the preset conditions, a preset backbone aggregation ring traversal algorithm and a preset partitioning method are used to traverse and partition the second access aggregation layer sub-network diagram that does not meet the preset conditions until all the sub-network diagrams meet the preset conditions. In each traversal and partitioning, the level to which the backbone aggregation layer nodes, excluding nodes whose assigned level has been determined, are superimposed (level 1), and the level to which the nodes in the sub-network diagram that meet the preset conditions, excluding nodes whose assigned level has been determined, are superimposed (level 2). This allows for the accurate determination of the level to which the nodes in the "graph" belong based on the preset conditions.

[0081] In one implementation, the method further includes:

[0082] If the sub-network graph obtained after traversal partitioning includes two backbone convergence nodes, then the sub-network graph including the two backbone convergence nodes is traversed according to the preset backbone convergence ring traversal algorithm to obtain the backbone convergence layer. The backbone convergence node is the node in the backbone convergence layer before traversal partitioning that is used to directly connect to the upper-level network. The nodes in the backbone convergence layer obtained after the preset backbone convergence ring traversal algorithm are at the same level as the backbone convergence node.

[0083] Specifically, in real-world networks, situations often arise where the same aggregation pair is connected to the upper network. If the subnet graph obtained after traversal partitioning includes two backbone aggregation nodes, then the subnet graph including the two backbone aggregation nodes is traversed according to a preset backbone aggregation ring traversal algorithm to obtain the backbone aggregation layer. Here, the backbone aggregation nodes are the nodes in the backbone aggregation layer before traversal partitioning that are used to directly connect to the upper-level network. The nodes in the backbone aggregation layer obtained after the preset backbone aggregation ring traversal algorithm belong to the same level as the backbone aggregation nodes. This can improve the accuracy of determining the level of the nodes and reduce the occurrence of errors.

[0084] The following provides detailed examples of some functional sub-modules in the embodiments of this application.

[0085] To traverse the access aggregation subnet diagram, a subnet class can be created, and the attributes of this class can be defined as follows:

[0086]

[0087] In order to further enable the reuse of related functions, it is necessary to package some functions into modules. This invention relates to the following sub-modules:

[0088] Shortest path module:

[0089] By invoking Dijkstra's algorithm, the access-convergence layer subnet graph is initialized, and the shortest path in the subnet, excluding paths directly connected to the backbone convergence nodes, is calculated. The resulting logic flow provides the nodes traversed by the shortest path between two fixed points. Figure 6 As shown:

[0090] Given an access aggregation layer subnet graph G0, determine one backbone aggregation node S and another backbone aggregation node G in the access aggregation layer subnet graph; delete the direct path between S and G, use Dijkstra's algorithm to calculate the shortest path from S to G and the set of nodes P on the shortest path, and output P as the return value.

[0091] Subnetting module:

[0092] Determine the shortest path between two points in a first aggregation subnet graph, assign node levels of the backbone aggregation layer in this first access aggregation subnet graph, and transform this first access aggregation layer subnet graph into at least one second aggregation layer subnet graph by disconnecting all connections on the shortest path for further subnetting. The specific logic flow is as follows: Figure 7 As shown:

[0093] Given a set of backbone-gathering layers S, an access-gathering layer sub-network G0(V0, E0), and an initial sub-class, where G0(V0, E0) includes all nodes in P; select all nodes in P from G0 to form the backbone-gathering layer G1(V1, E1); for each node in G1, retain only the connections with nodes in P, and delete the connections with other nodes to form a new graph G1. ’ Increment the subclass by 1 and assign it to G1. ’ The assigned level is subclass. For G0, delete G1. ’ The connection E1 exists in ’ This creates a new set C, and returns C and its subclass as return values.

[0094] Subnet update module:

[0095] Given an instance of the subnet class, update specific attributes according to certain rules. The logical flow is as follows: Figure 8 As shown:

[0096] Input an instantiated subnet class mysub. Increment the level attribute of mysub by 1 and the parentlevel attribute of mysub by 1. Check if parentid is empty. If it is empty, update parentid according to the rules, assign the value of the id attribute to the parentid attribute, and update id according to the rules. If it is not empty, assign the value of the id attribute to the parentid attribute and update id according to the rules.

[0097] Implementation of access aggregation layer subnetting:

[0098] After encapsulating the above sub-modules, the division of the access aggregation layer subnet can be achieved through the formulation of relevant rules and module calls. The logical flow is as follows: Figure 9 As shown:

[0099] 1) Create a new class `subnet` and instantiate it as `mysub`. Also create a collection `subs` to store the pre-defined subnets. Simultaneously create `travel_subs` and `temp_subs`, and add `mysub` to the `travel_subs` collection.

[0100] 2) Loop through travel_subs;

[0101] 3) Using the graph, start, and goal attributes of mysub as parameters, call the shortest path module and assign the return value to the path attribute;

[0102] 4) Using graph, path, and level of mysub as parameters, call the subnetting module to complete the subnetting, and return the set of points C and subclass. Assign the subclass to level and add mysub to subs.

[0103] 5) Call the connected subgraph partitioning module with C as the parameter, and return a set of subgraphs Gn;

[0104] 6) Loop through the subgraph Gn, and set the graph attribute of mysub to the element value at the same time;

[0105] 7) The intersection of all nodes with the P attribute of each element in Gn with the set C is taken;

[0106] 8) Check if the number of elements in the intersection is 1. If yes, continue to execute 9)-11). If no, continue to execute 12)-15).

[0107] 9) Determine the number of nodes in the graph attribute of musub;

[0108] 10) Set start to the intersection node, set goal to null, and assign the element to the graph attribute;

[0109] 11) Call the subnet update module, add the return value to subs, and execute 16);

[0110] 12) Set the start and goal of mysub to the values ​​in intersection, and set graph to this element;

[0111] 13) Is the node with the P attribute a start or goal node? If yes, then execute 15); otherwise, execute 14).

[0112] 14) Call the subnet update module and assign the return value to mysub; execute 15);

[0113] 15) Add mysub to temp_subs; execute 16);

[0114] 16) Has the Gn traversal ended? If not, return to 6) and continue execution; if yes, execute 17).

[0115] 17) Has the travel_subs iteration ended? If not, return to 2) and continue execution; if yes, execute 18).

[0116] 18) Assign temp_subs to travel_subs, then set temp_subs to null;

[0117] 19) Check if travel_subs is empty. If not, return to 2) and continue execution. If yes, execute 20).

[0118] 20) Output subs;

[0119] 21) Complete the node division according to the results of the elements in suns.

[0120] It should be noted that the network topology layering method provided in this application embodiment can be executed by a network topology layering apparatus or a control module within that apparatus for executing the network topology layering method. This application embodiment uses a network topology layering apparatus executing the network topology layering method as an example to illustrate the network topology layering apparatus provided in this application embodiment.

[0121] Figure 10 This is a schematic diagram of a network topology layering device according to an embodiment of the present invention. Figure 10 As shown, the network topology layering device 1000 includes: a construction module 1010 and a layering module 1020.

[0122] The construction module 1010 is used to obtain a graph corresponding to the network topology to be layered based on the network topology to be layered, wherein the graph is a type of data structure and the nodes in the graph correspond to network elements in the network topology to be layered; the layering module 1020 is used to layer the nodes in the graph and to layer the network topology to be layered based on the nodes in the layered graph.

[0123] In one implementation, a layering module 1020 is used to disconnect the backbone aggregation nodes and core layer nodes in the diagram to obtain a core layer sub-network diagram and at least one first access aggregation layer sub-network diagram. The backbone aggregation nodes correspond to network elements connected to core layer network elements in the network topology to be layered, and the core layer nodes correspond to core layer network elements in the network topology to be layered. Nodes in the core layer sub-network diagram correspond to network elements in the core layer of the network to be layered, and nodes in the first access aggregation layer sub-network diagram correspond to network elements in the access aggregation layer of the network to be layered. Each first access aggregation layer sub-network diagram is layered to determine the level to which the nodes in the access aggregation layer of the diagram belong. Nodes in the core layer sub-network diagram are assigned to the core layer level.

[0124] In one implementation, the layering module 1020 is further configured to traverse each of the first access aggregation layer sub-network diagrams using a preset backbone aggregation ring traversal algorithm, determine the backbone aggregation layer in each of the first access aggregation layer sub-network diagrams, and assign the nodes of the backbone aggregation layer to the first level of the first access aggregation layer.

[0125] In one implementation, the layering module 1020 is used to divide each of the first access aggregation layer subnet diagrams using a preset division method to obtain at least one second access aggregation layer subnet diagram; determine whether each of the second access aggregation layer subnet diagrams meets preset conditions, and determine the layer to which the nodes in the second access aggregation layer subnet diagrams belong based on the determination result.

[0126] In one implementation, the layering module 1020 is used to determine the backbone aggregation nodes in the sub-network graph to be traversed that are directly connected to the upper-level network; and to determine the backbone aggregation layer based on the backbone aggregation nodes, wherein, in the sub-network graph to be traversed, the set of nodes on the path with the fewest nodes among all connected paths from one backbone aggregation node to another, excluding directly connected paths, is the backbone aggregation layer.

[0127] In one implementation, the layering module 1020 is used to determine the backbone convergence layer of the sub-network graph to be divided, and delete the connection between every two nodes of the backbone convergence layer in the sub-network graph to be divided, so as to divide the sub-network graph to be divided.

[0128] In one implementation, the layering module 1020 is used to determine a second access aggregation layer sub-network diagram that meets preset conditions, and to assign nodes other than those in the backbone aggregation layer to the second level of the access aggregation layer in the second access aggregation layer sub-network diagram that meets the preset conditions; and to determine a second access aggregation layer sub-network diagram that does not meet the preset conditions, and to traverse and divide the second access aggregation layer sub-network diagram that does not meet the preset conditions through a preset backbone aggregation ring traversal algorithm and a preset partitioning method, until all sub-network diagrams obtained meet the preset conditions. In each traversal and partitioning, the level to which the backbone aggregation layer nodes other than those whose assigned level has been determined is superimposed one, and the level to which the nodes other than those whose assigned level has been determined in the sub-network diagram that meets the preset conditions belong is superimposed two.

[0129] In one implementation, the layering module 1020 is further configured to, if the sub-network graph obtained after traversal partitioning includes two backbone convergence nodes, traverse the sub-network graph including the two backbone convergence nodes according to the preset backbone convergence ring traversal algorithm to obtain a backbone convergence layer. The backbone convergence node is a node in the backbone convergence layer before traversal partitioning that is used to directly connect to the upper-level network. The nodes in the backbone convergence layer obtained after the preset backbone convergence ring traversal algorithm are at the same level as the backbone convergence node.

[0130] The network topology layering device in this application embodiment can be a device, or a component, integrated circuit, or chip in a terminal. The device can be a mobile electronic device or a non-mobile electronic device. For example, mobile electronic devices can be mobile phones, tablets, laptops, PDAs, in-vehicle electronic devices, wearable devices, ultra-mobile personal computers (UMPCs), netbooks, or personal digital assistants (PDAs), etc., while non-mobile electronic devices can be servers, network attached storage (NAS), personal computers (PCs), televisions (TVs), ATMs, or self-service machines, etc. This application embodiment does not impose specific limitations.

[0131] The network topology layering device in this application embodiment can be a device with an operating system. The operating system can be Android, iOS, or other possible operating systems; this application embodiment does not specifically limit the specific operating system used.

[0132] The network topology layering apparatus provided in this application embodiment can achieve Figures 1 to 9 The various processes implemented in the method implementation examples will not be described again here to avoid repetition.

[0133] Optionally, such as Figure 11 As shown in the illustration, this application embodiment also provides an electronic device 1100, including a processor 1101 and a memory 1102. The memory 1102 stores a program or instructions that can run on the processor 1101. When the program or instructions are executed by the processor 1101, they perform the following: obtaining a graph corresponding to the network topology to be layered based on the network topology to be layered, wherein the graph is a type of data structure, and the nodes in the graph correspond to network elements in the network topology to be layered; layering the nodes in the graph; and layering the network topology to be layered based on the nodes in the layered graph.

[0134] In one implementation, the connection between the backbone aggregation node and the core layer node in the diagram is disconnected to obtain a core layer subnet diagram and at least one first access aggregation layer subnet diagram. The backbone aggregation node corresponds to a network element connected to a core layer network element in the network topology to be layered, and the core layer node corresponds to a core layer network element in the network topology to be layered. Nodes in the core layer subnet diagram correspond to network elements in the core layer of the network to be layered, and nodes in the first access aggregation layer subnet diagram correspond to network elements in the access aggregation layer of the network to be layered. Each first access aggregation layer subnet diagram is layered to determine the level to which the nodes in the access aggregation layer of the diagram belong. Nodes in the core layer subnet diagram are assigned to the core layer level.

[0135] In one implementation, a preset backbone aggregation ring traversal algorithm is used to traverse each of the first access aggregation layer sub-network diagrams to determine the backbone aggregation layer in each of the first access aggregation layer sub-network diagrams, and the nodes of the backbone aggregation layer are assigned to the first level of the first access aggregation layer.

[0136] In one implementation, each of the first access aggregation layer subnet diagrams is divided according to a preset partitioning method to obtain at least one second access aggregation layer subnet diagram; it is determined whether each of the second access aggregation layer subnet diagrams meets preset conditions, and the layer to which the nodes in the second access aggregation layer subnet diagrams belong is determined based on the determination result.

[0137] In one implementation, a backbone aggregation node for direct connection to the upper-level network is determined in the sub-network graph to be traversed; based on the backbone aggregation node, a backbone aggregation layer is determined, wherein in the sub-network to be traversed, the set of nodes on the path with the fewest nodes among all connected paths from one backbone aggregation node to another, excluding directly connected paths, is the backbone aggregation layer.

[0138] In one implementation, the backbone convergence layer of the sub-network graph to be divided is determined, and the connections between every two nodes in the backbone convergence layer of the sub-network graph to be divided are deleted to divide the sub-network graph to be divided.

[0139] In one implementation, a second access aggregation layer sub-network diagram that meets preset conditions is determined. Nodes in the second access aggregation layer sub-network diagram that meet the preset conditions, excluding nodes in the backbone aggregation layer, are assigned to the second level of the access aggregation layer. A second access aggregation layer sub-network diagram that does not meet the preset conditions is also determined. This is then traversed and divided using a preset backbone aggregation ring traversal algorithm and a preset partitioning method until all sub-network diagrams meet the preset conditions. Each time the sub-network diagram is traversed and divided, the level to which the backbone aggregation layer nodes (excluding those already assigned to a specific level) belong is superimposed (level 1), and the level to which the nodes in the sub-network diagrams that meet the preset conditions belong (level 2) is superimposed (level 2).

[0140] In one implementation, if the sub-network graph obtained after traversal partitioning includes two backbone convergence nodes, then the sub-network graph including the two backbone convergence nodes is traversed according to the preset backbone convergence ring traversal algorithm to obtain a backbone convergence layer. The backbone convergence node is the node in the backbone convergence layer before traversal partitioning that is used to directly connect to the upper-level network. The nodes in the backbone convergence layer obtained after the preset backbone convergence ring traversal algorithm are at the same level as the backbone convergence node.

[0141] The specific execution steps can be found in the various steps of the above network topology layering method embodiment, and can achieve the same technical effect. To avoid repetition, they will not be repeated here.

[0142] It should be noted that the electronic devices in the embodiments of this application include: servers, terminals, or other devices besides terminals.

[0143] The above electronic device structure does not constitute a limitation on the electronic device. An electronic device may include more or fewer components than illustrated, or combine certain components, or arrange them differently. For example, an input unit may include a Graphics Processing Unit (GPU) and a microphone, and a display unit may use a liquid crystal display (LCD), organic light-emitting diode (OLED), or other similar display panels. User input units include at least one of a touch panel and other input devices. A touch panel is also called a touchscreen. Other input devices may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, power buttons, etc.), trackballs, mice, and joysticks, which will not be elaborated further here.

[0144] Memory can be used to store software programs and various data. Memory can primarily include a first storage area for storing programs or instructions and a second storage area for storing data. The first storage area can store the operating system, application programs or instructions required for at least one function (such as sound playback, image playback, etc.). Furthermore, memory can include volatile memory or non-volatile memory, or both. Non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous linked dynamic random access memory (SynchlinkDRAM, SLDRAM), and direct memory bus RAM (DRRAM).

[0145] The processor may include one or more processing units; optionally, the processor integrates an application processor and a modem processor, wherein the application processor mainly handles operations related to the operating system, user interface, and applications, while the modem processor mainly handles wireless communication signals, such as a baseband processor. It is understood that the aforementioned modem processor may also not be integrated into the processor.

[0146] This application also provides a readable storage medium storing a program or instructions that, when executed by a processor, implement the various processes of the above-described network topology layering method embodiment and achieve the same technical effect. To avoid repetition, these will not be described again here.

[0147] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as ROM, RAM, magnetic disk, or optical disk.

[0148] This application embodiment also provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the various processes of the above-described network topology layering method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be described again here.

[0149] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.

[0150] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.

[0151] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0152] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.

Claims

1. A method for network topology layering, characterized in that, include: Based on the network topology to be layered, a graph corresponding to the network topology to be layered is obtained, wherein the graph is a type of data structure, and the nodes in the graph correspond to network elements in the network topology to be layered; The nodes in the graph are layered, and the network topology to be layered is then layered based on the nodes in the layered graph. The layering of nodes in the graph includes: Disconnect the backbone aggregation nodes from the core layer nodes in the diagram to obtain a core layer subnet diagram and at least one first access aggregation layer subnet diagram. The backbone aggregation nodes correspond to network elements connected to core layer network elements in the network topology to be layered, and the core layer nodes correspond to core layer network elements in the network topology to be layered. The nodes in the core layer subnet diagram correspond to network elements in the core layer of the network to be layered, and the nodes in the first access aggregation layer subnet diagram correspond to network elements in the access aggregation layer of the network to be layered. Each of the first access aggregation layer subnet diagrams is layered to determine the layer to which the nodes in the access aggregation layer of the diagram belong; The nodes in the core layer sub-network diagram are assigned to the core layer level.

2. The method according to claim 1, characterized in that, Before layering each of the first access aggregation layer subnet diagrams and determining the layer to which a node in the access aggregation layer of the diagram belongs, the method further includes: By using a preset backbone aggregation ring traversal algorithm, each of the first access aggregation layer sub-network diagrams is traversed to determine the backbone aggregation layer in each of the first access aggregation layer sub-network diagrams, and the nodes of the backbone aggregation layer are assigned to the first level of the first access aggregation layer.

3. The method according to claim 1 or 2, characterized in that, The step of layering each of the first access aggregation layer subnets to determine the layer to which the nodes in the access aggregation layer of the graph corresponding to the network topology belong includes: Each of the first access aggregation layer subnet diagrams is divided using a preset division method to obtain at least one second access aggregation layer subnet diagram. Determine whether each of the second access aggregation layer subnet diagrams meets the preset conditions, and determine the layer to which the nodes in the second access aggregation layer subnet diagrams belong based on the determination results.

4. The method according to claim 2, characterized in that, The preset backbone convergence loop traversal algorithm includes: Identify the backbone aggregation nodes in the subnet graph to be traversed that are used to directly connect to the upper-level network; Based on the backbone convergence nodes, a backbone convergence layer is determined. In the subgraph to be traversed, the set of nodes on the path with the fewest nodes among all connected paths from one backbone convergence node to another, excluding directly connected paths, is the backbone convergence layer.

5. The method according to claim 3, characterized in that, The preset division methods include: Determine the backbone convergence layer of the sub-network graph to be divided, and delete the connections between every two nodes in the backbone convergence layer of the sub-network graph to be divided, so as to divide the sub-network graph to be divided.

6. The method according to claim 3, characterized in that, The preset condition is that it includes only one node belonging to the backbone aggregation layer. The step of determining the layer to which the node in the second access aggregation layer subnet diagram belongs based on the judgment result includes: Determine a second access aggregation layer subnet diagram that meets preset conditions, and assign nodes in the second access aggregation layer subnet diagram that meets preset conditions, excluding nodes in the backbone aggregation layer, to the second level of the access aggregation layer. A second access aggregation layer sub-network diagram that does not meet the preset conditions is identified. The second access aggregation layer sub-network diagram that does not meet the preset conditions is traversed and divided using the preset backbone aggregation ring traversal algorithm and the preset division method until all sub-network diagrams obtained meet the preset conditions. In each traversal and division, the layer to which the backbone aggregation layer nodes other than the nodes whose assigned layer has been determined is superimposed as one, and the layer to which the nodes in the sub-network diagram that meet the preset conditions belong, other than the nodes whose assigned layer has been determined, is superimposed as two.

7. The method according to claim 5, characterized in that, The method further includes: If the sub-network graph obtained after traversal partitioning includes two backbone convergence nodes, then the sub-network graph including the two backbone convergence nodes is traversed according to the preset backbone convergence ring traversal algorithm to obtain the backbone convergence layer. The backbone convergence node is the node in the backbone convergence layer before traversal partitioning that is used to directly connect to the upper-level network. The nodes in the backbone convergence layer obtained after the preset backbone convergence ring traversal algorithm are at the same level as the backbone convergence node.

8. A network layering device, characterized in that, include: A construction module is used to obtain a graph corresponding to the network topology to be layered, wherein the graph is a data structure and the nodes in the graph correspond to network elements in the network topology to be layered. The layering module is used to layer the nodes in the graph and to layer the network topology to be layered based on the nodes in the layered graph. The layering module, which layers the nodes in the graph, includes: Disconnect the backbone aggregation nodes from the core layer nodes in the diagram to obtain a core layer subnet diagram and at least one first access aggregation layer subnet diagram. The backbone aggregation nodes correspond to network elements connected to core layer network elements in the network topology to be layered, and the core layer nodes correspond to core layer network elements in the network topology to be layered. The nodes in the core layer subnet diagram correspond to network elements in the core layer of the network to be layered, and the nodes in the first access aggregation layer subnet diagram correspond to network elements in the access aggregation layer of the network to be layered. Each of the first access aggregation layer subnet diagrams is layered to determine the layer to which the nodes in the access aggregation layer of the diagram belong; The nodes in the core layer sub-network diagram are assigned to the core layer level.

9. An electronic device, characterized in that, It includes a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement the steps of the method as described in any one of claims 1-7.

Citation Information

Patent Citations

  • Method for detecting extra-large ring hidden dangers based on basic configuration data acquired by network management system of manufacturer

    CN102387036A

  • Network topology division method and device and network topology management equipment

    CN113595750A