A switch status monitoring method and system for remote control
By generating a monitoring tree based on the data structure tree method in the software-defined network, the problem of high resource consumption caused by frequent queries of switch status monitoring is solved, the performance of the software-defined network controller is improved, and resource waste is avoided through flexible configuration of monitoring delays.
Patent Information
- Application Number
- CN202410143984.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-01
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2044-02-01
AI Technical Summary
In software-defined networks, frequent querying of switch status monitoring results in high resource consumption of software-defined network controllers, seriously affecting performance.
By defining the maximum depth of the monitoring tree based on the data structure tree method, calculating the monitoring access priority in the switch topology diagram, and using the depth-first traversal algorithm to generate the tree structure, the resource consumption of the switch status monitor is reduced.
It effectively reduces the resource consumption of the software-defined network controller, improves the performance of the software-defined network controller, and avoids resource waste through flexible configuration of monitoring delays.
Smart Images

Figure CN118018447B
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of switches, and in particular relates to a switch status monitoring method and system for remote control. Background Art
[0002] Software Defined Network (SDN) is a new type of network innovation architecture and a way to implement network virtualization. Its core technology OpenFlow separates the control plane and data plane of network devices, thereby achieving flexible control of network traffic, making the network more intelligent and providing a good platform for innovation of core networks and applications.
[0003] In the prior art, for the field of remote control, data is transmitted through software-defined networks. Software-defined networks are a new type of network mode that separates forwarding and control functions. With a global topology view, it is possible to obtain the resource usage of switching devices (including link status, flow status, port status, etc.), so as to monitor the quality of network services. During the use of software-defined networks, in order to build a network path that can achieve reliable data transmission, the network service quality is monitored by obtaining the network switch status through the software-defined network controller, such as Figure 3 As shown, the software defined network controller sends monitoring rules to the switch state controller, each switch state monitor monitors the state of nearby switches, and sends monitoring results to the software defined network controller according to the rules sent by the software defined network controller.
[0004] The prior art has at least the following problems:
[0005] 1. During the operation of the software-defined network, the software-defined network controller lacks effective control over the switch status monitor that monitors the status of nearby switches. Frequent queries will lead to high resource consumption of the software-defined network controller, seriously affecting the performance of the software-defined network controller. Summary of the invention
[0006] The present invention provides a switch status monitoring method and system for remote control, aiming to solve the technical problems existing in the above-mentioned prior art that during the operation of the software-defined network, the software-defined network controller lacks effective control over the switch status monitor monitoring the status of nearby switches, and frequent queries lead to high resource consumption of the software-defined network controller, seriously affecting the performance of the software-defined network controller.
[0007] The technical solution of the present invention to solve the above technical problem is as follows: A switch status monitoring method for remote control, comprising:
[0008] S1: Based on the data structure tree method, the maximum depth of the monitoring tree for switch monitoring is defined as m;
[0009] S2: Obtain a switch topology map, and define switches in the switch topology map as nodes; wherein the switch topology map includes a plurality of switches and connection relationships between the plurality of switches;
[0010] S3: Calculate and sort the monitoring access priority of each node in the switch topology diagram to obtain a sorting result;
[0011] S4: defining the node with the highest monitoring access priority in the sorting result as a root node, and traversing the switch topology graph from the root node through a depth-first traversal algorithm to obtain a tree structure with the node with the highest monitoring access priority as the root node and a maximum depth of m;
[0012] S5: Delete the nodes containing the tree structure and the edges connecting the nodes of the tree structure in the switch topology graph to obtain the deleted switch topology graph, and connect a switch status monitor to the root node of the deleted tree structure to obtain a monitoring tree; determine whether there are still nodes in the deleted switch topology graph:
[0013] If there are still nodes, return to loop execution S3-S5; if there are no nodes, output the construction result, wherein the construction result is n monitoring trees obtained based on the switch topology diagram, and n is the number of loops.
[0014] The beneficial effect of the present invention is that the present invention defines the node with the highest monitoring access priority as the root node, generates a tree structure with a maximum depth of a preset maximum depth, and then defines the node with the highest monitoring access priority among the remaining nodes of the switch topology as the root node, and continues to generate the tree structure until all nodes of the switch topology are traversed. The final monitoring tree construction result is obtained. After the monitoring tree is constructed in this way, the resource consumption of the software-defined network controller can be reduced during frequent queries, and the performance of the software-defined network controller can be improved.
[0015] Based on the above technical solution, the present invention can also be improved as follows.
[0016] Furthermore, the maximum depth of the monitoring tree is configured based on the monitoring delay.
[0017] The beneficial effect of adopting the above further solution is that the present invention configures the maximum depth by monitoring delay, so that the maximum depth of the monitoring tree is flexible and controllable, and avoids wasting resources by monitoring delay.
[0018] Furthermore, in the above S2, obtaining the switch topology map specifically includes: copying an original switch topology map to generate a temporary switch topology map; wherein the temporary switch topology map is the obtained switch topology map.
[0019] The beneficial effect of adopting the above further scheme is: due to the need for modification, the present invention copies the original switch topology map to generate a temporary switch topology map, and the original switch topology map is not affected during the modification process, which facilitates the subsequent verification of the generated monitoring tree.
[0020] Furthermore, in the above S3, the calculation formula of the monitoring access priority is as follows:
[0021] f(A)=max{l(A,B)|B is in G′}
[0022] Where A represents the node A selected to calculate the monitoring access priority, f(A) represents the monitoring access priority of node A, B represents any node except node A in the switch topology, l(A,B) represents the shortest path length from node A to node B in the switch topology, and G′ represents the switch topology.
[0023] The beneficial effect of adopting the above further solution is that the present invention calculates the monitoring access priority of each node, constructs a monitoring tree according to the order of the monitoring access priorities, and realizes effective monitoring of the nodes.
[0024] Furthermore, in the above S4, the step of obtaining a tree structure with a node having the highest monitoring access priority as the root node and a maximum depth of m is as follows: starting from the root node, traversing the nodes on the switch topology diagram, stopping the traversal when the depth of the current node is m-1 or when there is no node at the next level of the traversed current node, and obtaining a tree structure with a maximum depth of m through all traversed nodes.
[0025] The beneficial effect of adopting the above further solution is that the present invention traverses the nodes connected to the root node starting from the root node based on the priority traversal algorithm, thus saving the time and lines of traversal access.
[0026] In a second aspect, in order to solve the above technical problems, the present invention further provides a switch status monitoring system for remote control, comprising:
[0027] The parameter configuration module is used to define the maximum depth of the monitoring tree for switch monitoring as m based on the data structure tree method;
[0028] A data acquisition module, used to acquire a switch topology map, and define switches in the switch topology map as nodes; wherein the switch topology map includes a plurality of switches and connection relationships between the plurality of switches;
[0029] A monitoring access priority calculation module is used to calculate and sort the monitoring access priority of each node in the switch topology diagram to obtain a sorting result;
[0030] A tree structure generation module is used to define the node with the highest monitoring access priority in the sorting result as a root node, and traverse the switch topology map from the root node through a depth-first traversal algorithm to obtain a tree structure with the node with the highest monitoring access priority as the root node and a maximum depth of m;
[0031] A result output module is constructed, which is used to delete the nodes containing the tree structure and the edges connecting the nodes of the tree structure in the switch topology graph, obtain the switch topology graph after deletion, and connect a switch status monitor to the root node of the deleted tree structure to obtain a monitoring tree; determine whether there are still nodes in the switch topology graph after deletion:
[0032] If there are still nodes, return to the loop to execute the operations from the monitoring access priority calculation module to the construction result output module; if there are no nodes, output the construction result, wherein the construction result is n monitoring trees obtained based on the switch topology diagram, and n is the number of loops.
[0033] In a third aspect, in order to solve the above-mentioned technical problem, the present invention also provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the switch status monitoring method for remote control of the present application is implemented.
[0034] In a fourth aspect, in order to solve the above technical problem, the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the switch status monitoring method for remote control of the present application is implemented.
[0035] Additional aspects and advantages of the present application will be partially given in the following description, which will become apparent from the following description, or will be understood through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 A flow chart of a method for monitoring the state of a switch for remote control provided by an embodiment of the present invention;
[0037] Figure 2 A schematic diagram of the structure of a switch status monitoring system for remote control provided by an embodiment of the present invention;
[0038] Figure 3 A schematic diagram of a distributed monitoring logic structure of a software-defined network in the prior art of the present invention;
[0039] Figure 4 A schematic diagram of a switch topology diagram provided for an embodiment of the present invention;
[0040] Figure 5 A schematic diagram of a monitoring tree constructed according to an embodiment of the present invention. DETAILED DESCRIPTION
[0041] The principles and features of the present invention are described below. The examples given are only used to explain the present invention and are not used to limit the scope of the present invention.
[0042] The technical solution of the present invention and how the technical solution of the present invention solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present invention will be described below in conjunction with the accompanying drawings.
[0043] The embodiment of the present invention provides a possible implementation method, such as Figure 1 As shown, a switch status monitoring method for remote control is provided, and the method may include the following steps:
[0044] S1: Based on the data structure tree method, the maximum depth of the monitoring tree for switch monitoring is defined as m;
[0045] S2: Obtain a switch topology map, and define switches in the switch topology map as nodes; wherein the switch topology map includes a plurality of switches and connection relationships between the plurality of switches;
[0046] S3: Calculate and sort the monitoring access priority of each node in the switch topology diagram to obtain a sorting result;
[0047] S4: defining the node with the highest monitoring access priority in the sorting result as a root node, and traversing the switch topology graph from the root node through a depth-first traversal algorithm to obtain a tree structure with the node with the highest monitoring access priority as the root node and a maximum depth of m;
[0048] S5: Delete the nodes containing the tree structure and the edges connecting the nodes of the tree structure in the switch topology graph to obtain the deleted switch topology graph, and connect a switch status monitor to the root node of the deleted tree structure to obtain a monitoring tree; determine whether there are still nodes in the deleted switch topology graph:
[0049] If there are still nodes, return to loop execution S3-S5; if there are no nodes, output the construction result, wherein the construction result is n monitoring trees obtained based on the switch topology diagram, and n is the number of loops.
[0050] The present invention defines the node with the highest monitoring access priority as the root node, generates a tree structure with a maximum depth of a preset maximum depth, and then defines the node with the highest monitoring access priority among the remaining nodes of the switch topology as the root node, and continues to generate the tree structure until all nodes of the switch topology are traversed. The final monitoring tree construction result is obtained. After the monitoring tree is constructed in this way, the resource consumption of the software-defined network controller can be reduced during frequent queries, and the performance of the software-defined network controller can be improved.
[0051] Optionally, the maximum depth of the monitoring tree is configured based on the monitoring delay.
[0052] The present invention configures the maximum depth through monitoring delay, so that the maximum depth of the monitoring tree is flexible and controllable, and avoids waste of resources through monitoring delay.
[0053] Optionally, in S2, obtaining the switch topology map specifically includes: copying an original switch topology map to generate a temporary switch topology map; wherein the temporary switch topology map is the obtained switch topology map.
[0054] In the present invention, due to the need for modification, the original switch topology is copied to generate a temporary switch topology. The original switch topology is not affected during the modification process, which facilitates the subsequent verification of the generated monitoring tree.
[0055] Optionally, in S3, the calculation formula of the monitoring access priority is as follows:
[0056] f(A)=max{l(A,B)|B is in G′}
[0057] Where A represents the node A selected to calculate the monitoring access priority, f(A) represents the monitoring access priority of node A, B represents any node except node A in the switch topology, l(A,B) represents the shortest path length from node A to node B in the switch topology, G ′ Represents a switch topology diagram.
[0058] The present invention calculates the monitoring access priority of each node, constructs a monitoring tree according to the order of the monitoring access priorities, and realizes effective monitoring of the nodes.
[0059] Optionally, in S4, the step of obtaining a tree structure with a node having the highest monitoring access priority as the root node and a maximum depth of m is as follows: starting from the root node, traversing the nodes on the switch topology map, stopping the traversal when the depth of the current node is m-1 or when there is no node at the next level of the traversed current node, and obtaining a tree structure with a maximum depth of m through all traversed nodes.
[0060] The present invention is based on a priority traversal algorithm, traversing nodes connected to the root node from the root node, thus saving the time and lines of traversal access.
[0061] In this embodiment, the maximum depth of the monitoring tree is defined as 3, and then the switch topology diagram is obtained, such as Figure 4 As shown, the node with the highest monitoring access priority in the switch topology is calculated as switch S14, and then the switch topology is traversed from switch S14 through a depth-first traversal algorithm. When the depth of the traversed node is m-1 or there is no node in the next layer of the traversed node, the traversal of the current node is stopped, and a tree structure with a maximum depth of 3 is obtained; the tree structure includes: switch S14, switch S13, switch S15, switch S12, switch S12, switch S16 and switch S18. Then switch S14 is connected to a switch status monitor, thereby forming a monitoring tree structure, and then the monitoring tree structure is deleted in the switch topology, and S3-S5 is continued to be executed for the remaining switch topologies, and finally the construction result of the monitoring tree is output, as shown in FIG. Figure 5 As shown, when traversing to switch S7, there is no node in the next layer depth, so the traversal is stopped.
[0062] Based on Figure 1 Based on the same principle as the method shown in , the embodiment of the present invention also provides a switch status monitoring system for remote control, such as Figure 2 As shown in , the switch status monitoring system for remote control may include:
[0063] The parameter configuration module is used to define the maximum depth of the monitoring tree for switch monitoring as m based on the data structure tree method;
[0064] A data acquisition module, used to acquire a switch topology map, and define switches in the switch topology map as nodes; wherein the switch topology map includes a plurality of switches and connection relationships between the plurality of switches;
[0065] A monitoring access priority calculation module is used to calculate and sort the monitoring access priority of each node in the switch topology diagram to obtain a sorting result;
[0066] A tree structure generation module is used to define the node with the highest monitoring access priority in the sorting result as a root node, and traverse the switch topology map from the root node through a depth-first traversal algorithm to obtain a tree structure with the node with the highest monitoring access priority as the root node and a maximum depth of m;
[0067] A result output module is constructed, which is used to delete the nodes containing the tree structure and the edges connecting the nodes of the tree structure in the switch topology graph, obtain the switch topology graph after deletion, and connect a switch status monitor to the root node of the deleted tree structure to obtain a monitoring tree; determine whether there are still nodes in the switch topology graph after deletion:
[0068] If there are still nodes, return to the loop to execute the operations from the monitoring access priority calculation module to the construction result output module; if there are no nodes, output the construction result, wherein the construction result is n monitoring trees obtained based on the switch topology diagram, and n is the number of loops.
[0069] The switch state monitoring system for remote control of the embodiment of the present invention can execute the switch state monitoring method for remote control provided by the embodiment of the present invention, and the implementation principle is similar. The actions performed by each module and unit in the switch state monitoring system for remote control in each embodiment of the present invention correspond to the steps in the switch state monitoring method for remote control in each embodiment of the present invention. For the detailed functional description of each module of the switch state monitoring system for remote control, please refer to the description of the corresponding switch state monitoring method for remote control shown in the previous text, which will not be repeated here.
[0070] The above description is only a preferred embodiment of the present invention and an explanation of the technical principles used. Those skilled in the art should understand that the disclosure scope involved in the present invention is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present invention (but not limited to) to form a technical solution.
Claims
1. A switch status monitoring method for remote control, characterized in that: include: S1: Based on the data structure tree method, the maximum depth of the monitoring tree for switch monitoring is defined as m; S2: Obtain a switch topology map, and define switches in the switch topology map as nodes; wherein the switch topology map includes a plurality of switches and connection relationships between the plurality of switches; S3: Calculate and sort the monitoring access priority of each node in the switch topology diagram to obtain a sorting result; S4: defining the node with the highest monitoring access priority in the sorting result as a root node, and traversing the switch topology graph from the root node through a depth-first traversal algorithm to obtain a tree structure with the node with the highest monitoring access priority as the root node and a maximum depth of m; S5: Delete the nodes containing the tree structure and the edges connecting the nodes of the tree structure in the switch topology graph to obtain the deleted switch topology graph, and connect a switch status monitor to the root node of the deleted tree structure to obtain a monitoring tree; determine whether there are still nodes in the deleted switch topology graph: If there are still nodes, return to loop execution S3-S5; if there are no nodes, output the construction result, wherein the construction result is n monitoring trees obtained based on the switch topology diagram, and n is the number of loops.
2. A switch status monitoring method for remote control according to claim 1, characterized in that: The maximum depth of the monitoring tree is configured based on the monitoring delay.
3. A switch status monitoring method for remote control according to claim 1, characterized in that: In S2, obtaining the switch topology map specifically includes: copying an original switch topology map to generate a temporary switch topology map; wherein the temporary switch topology map is the obtained switch topology map.
4. A switch status monitoring method for remote control according to claim 1, characterized in that: In S3, the calculation formula of the monitoring access priority is as follows: f(A)=max{l(A,B)|B is in G′} Where A represents the node A selected to calculate the monitoring access priority, f(A) represents the monitoring access priority of node A, B represents any node except node A in the switch topology, l(A,B) represents the shortest path length from node A to node B in the switch topology, and G′ represents the switch topology.
5. A switch status monitoring method for remote control according to claim 1, characterized in that: In S4, the steps of obtaining a tree structure with a node having the highest monitoring access priority as the root node and a maximum depth of m are as follows: starting from the root node, traversing the nodes on the switch topology diagram, stopping the traversal when the depth of the current node is m-1 or when there is no node in the next layer of the traversed current node, and obtaining a tree structure with a maximum depth of m through all traversed nodes.
6. A switch status monitoring system for remote control, characterized in that: include: The parameter configuration module is used to define the maximum depth of the monitoring tree for switch monitoring as m based on the data structure tree method; A data acquisition module, used to acquire a switch topology map, and define switches in the switch topology map as nodes; wherein the switch topology map includes a plurality of switches and connection relationships between the plurality of switches; A monitoring access priority calculation module is used to calculate and sort the monitoring access priority of each node in the switch topology diagram to obtain a sorting result; A tree structure generation module is used to define the node with the highest monitoring access priority in the sorting result as a root node, and traverse the switch topology map from the root node through a depth-first traversal algorithm to obtain a tree structure with the node with the highest monitoring access priority as the root node and a maximum depth of m; A result output module is constructed, which is used to delete the nodes containing the tree structure and the edges connecting the nodes of the tree structure in the switch topology graph, obtain the switch topology graph after deletion, and connect a switch status monitor to the root node of the deleted tree structure to obtain a monitoring tree; determine whether there are still nodes in the switch topology graph after deletion: If there are still nodes, return to the loop to execute the operations from the monitoring access priority calculation module to the construction result output module; if there are no nodes, output the construction result, wherein the construction result is n monitoring trees obtained based on the switch topology diagram, and n is the number of loops.
7. An electronic device, characterized in that: The method comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method according to any one of claims 1 to 5 when executing the computer program.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
