Path finding method and device, equipment and storage medium
By determining the set of split points in transmission network management and using a routing algorithm to calculate the working path, avoiding the split points, and combining constraints to calculate the protection path, the problem of co-location of working and protection paths in existing technologies is solved, and service reliability and network management automation are improved.
Patent Information
- Application Number
- CN202510761895.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-09
- Publication Date
- 2025-09-23
AI Technical Summary
Existing technologies make it difficult to calculate the optimal path in which the working and protection paths are strictly non-co-route, resulting in reduced business reliability. In addition, manual intervention is difficult and it is impossible to effectively ensure non-co-route under cluster management.
By determining the set of split points between the source and the sink, the network is divided into two disconnected subgraphs. The working path is calculated to avoid the split point set. The protection path is calculated by combining the path-finding algorithm and constraints to ensure that the working and protection paths are strictly separated.
It achieves the calculation of the optimal solution for working and protection paths without human intervention, improves business reliability, ensures that paths are not shared, and improves the automation and efficiency of network management.
Smart Images

Figure CN120692208A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of transmission network management, and in particular to a routing method, device, equipment and storage medium. Background Art
[0002] When creating a transmission network service, the route from the source to the destination must be calculated, a process known as pathfinding. To improve service reliability, two paths, a working path and a protection path, are typically calculated. If the working path fails, the protection path is immediately switched to. To further enhance service reliability, the working and protection paths can be strictly isolated. This means that the working and protection paths do not intersect at the same network element, disk, or port, often referred to as a shared path point. If a shared path point fails, both the protection and working paths become unavailable, resulting in service interruption. Therefore, a pathfinding strategy that strictly isolates working and protection paths from shared paths is highly desirable in existing engineering networks.
[0003] Existing technologies may not necessarily calculate two paths that are strictly independent of the working and protection paths. This is because the working and protection paths are typically calculated separately, with the working path calculated first and the protection path second, avoiding nodes on the working path when calculating the protection path. However, when the working path is calculated first, it is impossible to predict whether the protection path will become independent of the working path. It is possible that two paths that are strictly independent of the working path exist, but due to improper working path configuration, the protection path may become independent of the working path, or the protection path may be mistakenly determined to not exist.
[0004] To address the aforementioned issue of being unable to calculate the optimal path, existing network management systems offer manual intervention methods: These methods can specify a fiber or port that must be routed or bypassed. After manually identifying issues with the current routing results, intervention and recalculation of the route typically achieve the desired results. However, with the trend toward cluster-based management, network topologies are becoming increasingly complex, making manual intervention increasingly difficult and making it difficult to effectively ensure that work and protection routes are strictly separated.
[0005] Therefore, how to strictly separate the working and protection paths and thus improve business reliability is a technical problem that needs to be solved urgently. Summary of the Invention
[0006] The main purpose of the present invention is to provide a routing method, device, equipment and storage medium, which can effectively ensure that work and protection are strictly non-co-routed, improve business reliability, and calculate the optimal solution for strict non-co-routed work and protection without human intervention.
[0007] In a first aspect, the present application provides a pathfinding method, wherein the method comprises the steps of: Based on the nodes passing through the source and sink, a set of split points between the source and sink is determined. The split point set is to delete all nodes and their edges in the split point set. The source and sink nodes will be split into two disconnected subgraphs. A working path is calculated based on the segmentation point set, so that the working path does not pass through all nodes of the segmentation point set.
[0008] In conjunction with the first aspect above, as an optional implementation, a set of reachable paths from the source to the destination is calculated, and for each path, the source node and the destination node are discarded to obtain multiple first waypoint sets that only include intermediate nodes. Calculate the union of all first waypoint sets to obtain a second waypoint set; Traversing the second set of waypoints, calculating and recording the number of times each waypoint appears in the set of reachable paths, and sorting the nodes in the second set of waypoints in descending order of the number of times each waypoint appears; Based on the sorting results, the node with the most paths is determined as the split node and inserted into the newly generated set to obtain the split point set.
[0009] In conjunction with the first aspect above, as an optional implementation, if it is determined that the sum of the number of times all nodes in the split point set are passed through is less than the total number of reachable paths between the source and the destination, the first set of waypoints is screened to select a set of waypoints that does not include a split node as the pending set of waypoints; Calculating a union of the undetermined waypoint sets to obtain a third waypoint set; Based on the calculated number of passes of each node, the nodes are sorted from most to least according to the number of passes. In the third set of pass points, the node with the largest number of passes is selected as the splitting node and added to the newly generated set of splitting points until it is determined that the sum of the number of passes of all nodes in the newly generated set of splitting points is greater than or equal to the total number of reachable paths between the source and the destination, thereby obtaining a set of splitting points that meets the pathfinding conditions.
[0010] In combination with the first aspect above, as an optional implementation method, if the third waypoint set is determined to be empty, it is determined that no other splitting nodes can be found, the algorithm ends, and the currently calculated splitting point set does not meet the requirements and is directly discarded.
[0011] In combination with the first aspect above, as an optional implementation method, if the number of times multiple nodes are passed through is equal, the nodes with the same number of passes through are randomly sorted.
[0012] In combination with the first aspect above, as an optional implementation, based on a pathfinding algorithm or a set pathfinding rule, the calculated next hop node is matched with a node in the segmentation point set; If the match is successful, the node in the corresponding split point set is marked as used, and the number of unused nodes in each split point set is determined; If the number of remaining unused nodes is 0, the working path and the protection path are determined to be co-located, and a path search failure error is returned. If the number of remaining unused nodes is 1, add a constraint condition, which states that subsequent pathfinding must bypass the last unused node to reserve it for the protection path; If the number of remaining unused nodes is greater than 1, the calculation of the next hop is continued directly until the destination node is obtained to complete the calculation of the working path.
[0013] In combination with the first aspect above, as an optional implementation method, based on the set constraints, the next hop node is calculated until the destination node is obtained to complete the calculation of the protection path, wherein the constraints are: bypassing other nodes in the working path except the source destination.
[0014] In a second aspect, the present application provides a pathfinding device, comprising: A processing module, configured to determine a set of split points between the source and the sink based on the nodes passed through the source and the sink, wherein the split point set is a set of nodes and their edges in the split point set that are deleted, and the source and sink nodes are split into two disconnected subgraphs; The path-finding module is configured to calculate a working path based on a set of segmentation points, so that the working path does not pass through all nodes of the set of segmentation points.
[0015] In a third aspect, the present application further provides an electronic device comprising: a processor; and a memory, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the method described in any one of the first aspects is implemented.
[0016] In a fourth aspect, the present application further provides a computer-readable storage medium storing computer program instructions, which, when executed by a computer, enables the computer to execute any one of the methods described in the first aspect.
[0017] The present application provides a routing method, apparatus, device, and storage medium, wherein the method includes the following steps: determining a set of split points between the source and the destination based on the nodes passed through the split point set, wherein the split point set is a set of nodes and their edges removed from the split point set, and the source and destination nodes are split into two disconnected subgraphs; and calculating a working path based on the split point set so that the working path does not pass through any nodes in the split point set. The present application can effectively ensure that working and protection paths are strictly separated, improve service reliability, and calculate the optimal solution for strictly separating working and protection paths without manual intervention.
[0018] It should be understood that the foregoing general description and the following detailed description are exemplary only and are not restrictive of the invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0020] Figure 1 A flow chart of a pathfinding method provided in an embodiment of the present application; Figure 2 A schematic diagram of a path-finding device provided in an embodiment of the present application; Figure 3 Schematic diagram of the overall process of calculating the segmentation point set provided in the embodiment of the present application; Figure 4 This is a schematic diagram of the source-destination node path provided in an embodiment of the present application; Figure 5 A schematic diagram of the calculation process provided in the embodiment of the present application; Figure 6 A schematic diagram of a flow chart for calculating a protection path provided in an embodiment of the present application; Figure 7 A schematic diagram of an electronic device provided in an embodiment of the present application; Figure 8 A schematic diagram of a computer-readable program medium provided in an embodiment of the present application. DETAILED DESCRIPTION
[0021] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. In the following description, when referring to the drawings, like numbers in different figures represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all possible embodiments consistent with the present invention. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present invention, as detailed in the appended claims.
[0022] Furthermore, the drawings are merely schematic illustrations of the present disclosure and are not necessarily drawn to scale. Some of the blocks shown in the drawings are functional entities that do not necessarily correspond to physically or logically separate entities.
[0023] The embodiments of the present application are further described in detail below with reference to the accompanying drawings.
[0024] Reference Figure 1 , Figure 1 The figure shows a flow chart of a path finding method provided by the present invention, as shown in FIG. Figure 1 As shown, the method includes the steps of: Step S101: Based on the nodes passing through from the source to the sink, a set of split points between the source and the sink is determined. The split point set is to delete all nodes and their edges in the split point set. The source and sink nodes will be split into two disconnected subgraphs.
[0025] Specifically, a set of reachable paths from the source to the destination is calculated, and for each path, the source node and the destination node are discarded to obtain multiple first waypoint sets containing only intermediate nodes. Calculate the union of all first waypoint sets to obtain a second waypoint set; Traversing the second set of waypoints, calculating and recording the number of times each waypoint appears in the set of reachable paths, and sorting the nodes in the second set of waypoints in descending order of the number of times each waypoint appears; Based on the sorting results, the node with the most paths is determined as the split node and inserted into the newly generated set to obtain the split point set.
[0026] In one embodiment, after obtaining the segmentation point set, the method includes: if it is determined that the sum of the number of times all nodes in the segmentation point set pass through is less than the total number of reachable paths between the source and the destination, filtering the first set of waypoints to select a set of waypoints that does not include the segmentation node as the pending set of waypoints; Calculating a union of the undetermined waypoint sets to obtain a third waypoint set; Based on the calculated number of passes of each node, the nodes are sorted from most to least according to the number of passes. In the third set of pass points, the node with the largest number of passes is selected as the splitting node and added to the newly generated set of splitting points until it is determined that the sum of the number of passes of all nodes in the newly generated set of splitting points is greater than or equal to the total number of reachable paths between the source and the destination, thereby obtaining a set of splitting points that meets the pathfinding conditions.
[0027] In one embodiment, after obtaining a third set of waypoints by unioning the undetermined set of waypoints, the following steps are performed: if the third set of waypoints is determined to be empty, it is determined that no additional splitting nodes can be found, the algorithm terminates, and the currently calculated set of splitting points does not meet the requirements and is discarded. If multiple nodes have the same number of pass times, the nodes with the same number of pass times are randomly sorted.
[0028] For easy understanding, an example is given to explain in detail how to obtain the set of segmentation points (see Figure 3 and Figure 4 ): Step 1: There are 9 paths between source node 1 and sink node 10, where N is 9. The 9 paths are as follows: 1-2-6-7-10 1-2-6-5-8-10 1-2-6-5-9-10 1-3-5-6-7-10 1-3-5-8-10 1-3-5-9-10 1-4-5-6-7-10 1-4-5-8-10 1-4-5-9-10 Step 2: Discard the source and sink nodes of the above 9 paths to obtain 9 first waypoint sets: {2, 6, 7} {2, 6, 5, 8} {2, 6, 5, 9} {3, 5, 6, 7} {3, 5, 8} {3, 5, 9} {4, 5, 6, 7} {4, 5, 8} {4, 5, 9} The union of the above 9 first waypoint sets is obtained to obtain the second waypoint set: {2, 3, 4, 5, 6, 7, 8, 9} Step 3: The number of times each node in the second set of waypoints is passed is:
[0029] The second set of waypoints after sorting is: {5, 6, 2, 3, 4, 7, 8, 9}.
[0030] Step 4: In the second set of waypoints, node 5 has the most waypoints, 8 times, meaning M equals 8. Generate a new set of split points and insert node 5, resulting in a set {5}. Because N equals 9, M is less than N, so proceed to step 5.
[0031] Step 5: Filter out the waypoint sets that don't include node 5 from the first set of waypoints, resulting in a set of pending waypoints: {2, 6, 7}. Now, take the union of these pending waypoint sets (there may be multiple pending waypoint sets) to obtain a third set of waypoints: {2, 6, 7}.
[0032] Step 6: Sort the nodes in the third set of waypoints by the number of times they are passed through, and obtain {6, 2, 7}.
[0033] Step 7: In the newly obtained third set of waypoints, node 6 has the most waypoints, reaching 5 times. Insert the newly generated segmentation point set to obtain {5, 6}.
[0034] Because the number of times node 6 is passed is 5 and the number of times node 5 is passed is 8, the sum of the two equals 13, which is greater than the total number of reachable paths, 9. Therefore, {5, 6} is a complete set of partition points. The calculation is complete, skip the subsequent steps, and continue to step 4.
[0035] Continue to step 4: In the second waypoint combination, exclude nodes 5 and 6. The remaining six waypoints have the same number of passes (3). Randomly select node 2 as the new node to be examined. Generate a new split point set and insert node 2, resulting in the set {2}. Because node 2's number of passes (3) is less than the total number of paths (9), continue to step 5. Continue to step 5: For the first segmentation point set in step 1, exclude node 2, and also exclude nodes 5 and 6, which have already been calculated. At this point, no waypoints that meet the requirements can be found, that is, the set of pending waypoints is empty, and the algorithm ends.
[0036] Ultimately, the required set of split points is only {5, 6}. If nodes 5 and 6 and their edges are deleted, the source and sink nodes will be split into two disconnected subgraphs, and no reachable path will exist. Similarly, in the original topology, all reachable paths between the source and sink nodes must pass through at least one node in the split point set {5, 6}.
[0037] Step S102: Calculate a working path based on the segmentation point set, so that the working path does not pass through all nodes in the segmentation point set.
[0038] Specifically, based on a pathfinding algorithm or a set pathfinding rule, the calculated next hop node is matched with the nodes in the segmentation point set; If the match is successful, the node in the corresponding split point set is marked as used, and the number of unused nodes in each split point set is determined; If the number of remaining unused nodes is 0, the working path and the protection path are determined to be co-located, and a path search failure error is returned. If the number of remaining unused nodes is 1, add a constraint condition, which states that subsequent pathfinding must bypass the last unused node to reserve it for the protection path; If the number of remaining unused nodes is greater than 1, the calculation of the next hop is continued directly until the destination node is obtained to complete the calculation of the working path.
[0039] In one embodiment, based on set constraints, the next hop node is calculated until the destination node is obtained to complete the calculation of the protection path, wherein the constraints are: bypassing other nodes in the working path except the source and destination.
[0040] To summarize, first calculate the set of split points between the source and the destination. Then, calculate the working path. Each time a next-hop node is obtained, search the split point set. If the search is successful, mark the node in the split point set as used. If the search is unsuccessful, it means that the node is not a critical node that affects whether the path is shared. You can flexibly choose whether to use it based on other routing strategies such as minimum hops and minimum latency. It is necessary to avoid the working path using all nodes in a split point set. If the number of remaining unused nodes in a split point set is equal to 1, then it is necessary to add routing constraints. Subsequent routing must bypass the last unused node and reserve it for the protection path. Finally, calculate the protection path, and add constraints. It must bypass all nodes in the working path except the source and the destination. That is, when calculating the working path, it must not pass through all nodes in the split point set. Some nodes in the split point set must be reserved for the protection path. This can minimize the possibility of sharing the working and protection paths.
[0041] Reference Figure 2 , Figure 2 FIG. 1 is a schematic diagram of a path-finding device provided by the present invention, as shown in FIG. Figure 2 As shown, the device includes: Processing module 201 is used to determine a set of split points between the source and the sink based on the nodes passed from the source to the sink. The split point set is to delete all nodes and their edges in the split point set, and the source and sink nodes will be split into two disconnected subgraphs.
[0042] Pathfinding module 202: used for calculating a working path based on a set of segmentation points, so that the working path does not pass through all nodes in the set of segmentation points.
[0043] Furthermore, in one possible implementation, the processing module is further configured to calculate a set of reachable paths from the source end to the destination end, and for each path, discard the source end node and the destination end node to obtain a plurality of first waypoint sets that only include intermediate nodes; Calculate the union of all first waypoint sets to obtain a second waypoint set; Traversing the second set of waypoints, calculating and recording the number of times each waypoint appears in the set of reachable paths, and sorting the nodes in the second set of waypoints in descending order of the number of times each waypoint appears; Based on the sorting results, the node with the most paths is determined as the split node and inserted into the newly generated set to obtain the split point set.
[0044] Furthermore, in one possible implementation, the processing module is further configured to, if it is determined that the sum of the number of times all nodes in the split point set are passed through is less than the total number of reachable paths between the source and the destination, filter the first waypoint set to select a waypoint set that does not include a split node as the pending waypoint set; Calculating a union of the undetermined waypoint sets to obtain a third waypoint set; Based on the calculated number of passes of each node, the nodes are sorted from most to least according to the number of passes. In the third set of pass points, the node with the largest number of passes is selected as the splitting node and added to the newly generated set of splitting points until it is determined that the sum of the number of passes of all nodes in the newly generated set of splitting points is greater than or equal to the total number of reachable paths between the source and the destination, thereby obtaining a set of splitting points that meets the pathfinding conditions.
[0045] Furthermore, in a possible implementation, the processing module is further configured to, if it is determined that the third waypoint set is empty, determine that no other segmentation nodes can be found, terminate the algorithm, and directly discard the currently calculated segmentation point set if it does not meet the requirements.
[0046] Furthermore, in a possible implementation manner, the processing module is further configured to arbitrarily sort the nodes with the same number of passes if the number of passes of the multiple nodes is equal.
[0047] Furthermore, in a possible implementation, the pathfinding module is further configured to match the calculated next hop node with a node in the segmentation point set based on a pathfinding algorithm or a set pathfinding rule; If the match is successful, the node in the corresponding split point set is marked as used, and the number of unused nodes in each split point set is determined; If the number of remaining unused nodes is 0, the working path and the protection path are determined to be co-located, and a path search failure error is returned. If the number of remaining unused nodes is 1, add a constraint condition, which states that subsequent pathfinding must bypass the last unused node to reserve it for the protection path; If the number of remaining unused nodes is greater than 1, the calculation of the next hop is continued directly until the destination node is obtained to complete the calculation of the working path.
[0048] Furthermore, in a possible implementation, the routing module is also used to calculate the next hop node based on the set constraints until the destination node is obtained to complete the calculation of the protection path, wherein the constraints are: bypassing other nodes in the working path except the source destination.
[0049] Reference Figure 3 , Figure 3 The figure shows the overall flow chart of calculating the segmentation point set provided by the present invention, as shown in FIG. Figure 3 As shown: Step 301: Use the DFS or BFS algorithm to calculate the set of reachable paths from the source to the sink. If there is only one reachable path, the working path and the protection path must overlap, and the routing failure is immediately returned, without executing subsequent steps. If there is more than one reachable path, the number of reachable paths is recorded as N.
[0050] Step 302: For each path, discard the source node and the destination node to obtain N first waypoint sets containing only intermediate nodes. Calculate the union of all first waypoint sets to obtain one second waypoint set.
[0051] Step 303: Traverse the second set of waypoints and calculate and record the number of times each waypoint appears in the set of reachable paths. Sort the second set of waypoints by number of waypoints, from most to least. If multiple nodes have the same number of waypoints, then sort them arbitrarily.
[0052] Step 304: If this is the first iteration, then no segmentation point set has been generated yet. The pathpoint with the most traversals in the second pathpoint set is directly selected, denoted as V. If this is not the first iteration, then other segmentation point sets may have already been calculated. The selected node V must have the most traversals and not be included in any other segmentation point set. If there is more than one node with the most traversals, a random node is selected. A new empty segmentation point set is generated, and node V is inserted.
[0053] It should be noted that, assuming that the number of times a waypoint V is passed is M, that is, the node is selected by M paths. Considering that no path contains repeated nodes, M is not greater than N, and there are two scenarios: 1) If M is equal to N, then the waypoint V must be a split point. All paths must pass through this node and can form a separate split point set.
[0054] 2) If M is less than N, then other nodes need to be added to form a complete set of segmentation points, and step 305 is continued.
[0055] It should also be noted that if the sum of the number of times all nodes in the newly generated set of split points are passed is greater than or equal to the total number of reachable paths N, then the newly generated set of split points is a valid set, the calculation is complete, and the subsequent steps can be skipped, continuing from step 304 to calculate other sets of split points. If the sum of the number of times all nodes in the newly generated set of split points are passed is less than the total number of reachable paths, step 304 is repeated until the required number is met or no new nodes can be retrieved.
[0056] Step 305: For all first waypoint sets in step 301, select (NM) waypoint sets that do not include waypoint V as the pending waypoint set. If other segmentation point sets have already been calculated, this is not the first iteration, and when selecting the pending waypoint set, all nodes in the existing segmentation point sets must be excluded. There may be multiple pending waypoint sets, and the union of these sets is calculated to obtain a third waypoint set. If the third waypoint set is empty, it indicates that no other segmentation points can be found, and the algorithm terminates. The currently calculated segmentation point set does not meet the requirements and is discarded. If the third segmentation point set is not empty, the algorithm proceeds to step 306.
[0057] Step 306: For the third set of waypoints, sort them from most to least according to the number of passes of each node calculated in step 303. If the number of passes of multiple nodes is equal, then sort them arbitrarily according to the number of the waypoints.
[0058] Step 307: From the third set of waypoints, select the node P with the most waypoints. If there are multiple nodes with the most waypoints, select one randomly and add it to the newly generated set of split points. If the sum of the waypoints for all nodes in the newly generated set is greater than or equal to the total number of reachable paths N, then the newly generated set of split points is a valid set. The calculation is complete, and subsequent steps can be skipped, continuing with step 304 to calculate other sets of split points. If the sum of the waypoints for all nodes in the newly generated set is less than the total number of reachable paths, then proceed to step 308.
[0059] Step 308: Based on the several first waypoint sets obtained in step 301, several new pending waypoint sets are selected. The nodes in these new sets are not included in the currently calculated or currently calculated segmentation point sets. The new pending waypoint sets are then combined to obtain a new third waypoint set. If the new third waypoint set is empty, the currently calculated segmentation point set does not meet the requirements for segmenting the source and sink nodes and is discarded, terminating the algorithm. If the new third waypoint set is not empty, the algorithm proceeds to step 309.
[0060] Step 309: Repeat steps 306 to 309 until the new third waypoint set is empty.
[0061] It should be noted that steps 305 to 309 are a process of calculating a single segmentation point set.
[0062] Reference Figure 4 , Figure 4 The diagram shows the source-destination node path provided by the present invention. Figure 4 As shown: There are 9 paths between source node 1 and sink node 10: 1-2-6-7-10 1-2-6-5-8-10 1-2-6-5-9-10 1-3-5-6-7-10 1-3-5-8-10 1-3-5-9-10 1-4-5-6-7-10 1-4-5-8-10 1-4-5-9-10 1) If the working path selects both nodes 5 and 6, the protection path must co-locate on either 5 or 6.
[0063] 2) If the working path selects only one of node 5 or node 6, the protection path can select the other node, and there will be no co-path.
[0064] Reference Figure 5 , Figure 5 The figure shows a flow chart of the calculation working path provided by the present invention, as shown in FIG. Figure 5 As shown: Step 501: Analyze the split point set: Calculate the split point set. If a set exists with 1 node, then the working path and protection path must share the same path at that node. In this case, there is no need to start pathfinding and the error is returned directly. The working and protection paths must share the same path.
[0065] Step 502: Calculate the next hop according to the routing rule set by the user (such as minimum hop or minimum delay).
[0066] Step 503: Calculate the usage of the split point: Use the next hop node newly calculated in step 502 to search the split point set. If the search is successful, mark the node in the corresponding split point set as used, and default to unused.
[0067] Step 504: Update the path-finding constraints: Determine the number of unused nodes in each segmentation point set: If the number of remaining unused nodes is 0, then the protection path must be a common path, and the path search fails. If the number of remaining unused nodes is 1, then a constraint condition needs to be added. This constraint condition means that subsequent pathfinding must bypass this unused node. Existing mature pathfinding algorithms can be used to complete pathfinding under this constraint condition. If the number of remaining unused nodes is greater than 1, the calculation of the next hop will continue directly.
[0068] Step 505: Repeat steps 502 to 504 until the destination node is obtained.
[0069] Reference Figure 6 , Figure 6 The figure shows a flow chart of calculating the protection path provided by the present invention, as shown in FIG. Figure 6 As shown: Step 601: Based on the set constraint conditions, wherein the constraint conditions are: bypassing other nodes except the source and sink in the working path.
[0070] Step 602: Calculate the next hop using the routing constraints.
[0071] Step 603: Repeat step 601 until the destination node is obtained.
[0072] Refer to the following Figure 7 An electronic device 700 according to this embodiment of the present invention will be described. Figure 7 The electronic device 700 shown is merely an example and should not limit the functions and scope of use of the embodiments of the present invention.
[0073] like Figure 7 As shown, electronic device 700 is implemented as a general-purpose computing device. Components of electronic device 700 may include, but are not limited to, the aforementioned at least one processing unit 710, the aforementioned at least one storage unit 720, and a bus 730 connecting various system components (including storage unit 720 and processing unit 710).
[0074] The storage unit stores program codes, which can be executed by the processing unit 710, so that the processing unit 710 performs the steps according to various exemplary embodiments of the present invention described in the above “Example Method” section of this specification.
[0075] The storage unit 720 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 721 and / or a cache memory unit 722 , and may further include a read-only memory unit (ROM) 723 .
[0076] The storage unit 720 may also include a program / utility 724 having a set (at least one) of program modules 725, such program modules 725 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0077] Bus 730 may represent one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0078] The electronic device 700 may also communicate with one or more external devices (e.g., a keyboard, pointing device, Bluetooth device, etc.), one or more devices that enable a user to interact with the electronic device 700, and / or any device that enables the electronic device 700 to communicate with one or more other computing devices (e.g., a router, modem, etc.). This communication may occur via an input / output (I / O) interface 750. Furthermore, the electronic device 700 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network such as the Internet) via a network adapter 760. As shown, the network adapter 760 communicates with other modules of the electronic device 700 via a bus 730. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 700, including but not limited to microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0079] Through the description of the above embodiments, it will be readily understood by those skilled in the art that the example embodiments described herein can be implemented via software or via a combination of software and necessary hardware. Therefore, the technical solutions according to the embodiments of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, or mobile hard drive) or on a network and includes several instructions for enabling a computing device (such as a personal computer, server, terminal device, or network device) to execute the methods according to the embodiments of the present disclosure.
[0080] According to the solution of the present disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the above-mentioned method of this specification is stored. In some possible implementations, various aspects of the present invention may also be implemented in the form of a program product, which includes program code. When the program product is executed on a terminal device, the program code is used to cause the terminal device to perform the steps according to various exemplary embodiments of the present invention described in the "Exemplary Methods" section of this specification.
[0081] refer to Figure 8, a program product 800 for implementing the above method according to an embodiment of the present invention is described. The program product 800 may be a portable compact disc read-only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto. In this document, a readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0082] The program product may utilize any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination thereof. More specific examples (a non-exhaustive list) of readable storage media include: an electrical connection having one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.
[0083] A computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium that can transmit, propagate, or transfer a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0084] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0085] Program code for performing the operations of the present invention can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, as a stand-alone software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0086] Furthermore, the above-described figures are merely illustrative of the processes included in the method according to exemplary embodiments of the present invention and are not intended to be limiting. It is readily understood that the processes illustrated in the above-described figures do not indicate or limit the temporal order of these processes. Furthermore, it is readily understood that these processes may be executed synchronously or asynchronously, for example, in multiple modules.
[0087] The foregoing is merely a list of specific embodiments of the present application, intended to enable those skilled in the art to understand or implement the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application is not limited to the embodiments shown herein, but is intended to conform to the broadest scope consistent with the principles and novel features of the present application.
[0088] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
Claims
1. A pathfinding method, characterized in that: include: Based on the nodes passing through the source and sink, a set of split points between the source and sink is determined. The split point set is to delete all nodes and their edges in the split point set. The source and sink nodes will be split into two disconnected subgraphs. A working path is calculated based on the segmentation point set, so that the working path does not pass through all nodes of the segmentation point set.
2. The method according to claim 1, characterized in that The determining of a set of split points between the source and the sink based on the nodes passed through from the source to the sink includes: Calculate a set of reachable paths from the source to the destination, and discard the source node and the destination node for each path to obtain multiple first waypoint sets that only include intermediate nodes; Calculate the union of all first waypoint sets to obtain a second waypoint set; Traversing the second set of waypoints, calculating and recording the number of times each waypoint appears in the set of reachable paths, and sorting the nodes in the second set of waypoints in descending order of the number of times each waypoint appears; Based on the sorting results, the node with the most paths is determined as the split node and inserted into the newly generated set to obtain the split point set.
3. The method according to claim 2, characterized in that After obtaining the segmentation point set, the following steps are included: If it is determined that the sum of the number of times all nodes in the split point set are passed is less than the total number of reachable paths between the source and the destination, the first set of waypoints is screened to select a set of waypoints that does not include a split node as the pending set of waypoints; Calculating a union of the undetermined waypoint sets to obtain a third waypoint set; Based on the calculated number of passes of each node, the nodes are sorted from most to least according to the number of passes. In the third set of pass points, the node with the largest number of passes is selected as the splitting node and added to the newly generated set of splitting points until it is determined that the sum of the number of passes of all nodes in the newly generated set of splitting points is greater than or equal to the total number of reachable paths between the source and the destination, thereby obtaining a set of splitting points that meets the pathfinding conditions.
4. The method according to claim 3, characterized in that After obtaining a union of the undetermined waypoint sets to obtain a third waypoint set, the method further comprises: If the third set of waypoints is determined to be empty, it is determined that no other splitting nodes can be found, the algorithm ends, and the currently calculated set of splitting points does not meet the requirements and is directly discarded.
5. The method according to claim 4, characterized in that Also includes: If the number of passes through multiple nodes is equal, the nodes with equal pass times are sorted arbitrarily.
6. The method according to claim 1, wherein The calculating the working path based on the segmentation point set between the source and the sink includes: Matching the calculated next hop node with the nodes in the segmentation point set based on a pathfinding algorithm or a set pathfinding rule; If the match is successful, the node in the corresponding split point set is marked as used, and the number of unused nodes in each split point set is determined; If the number of remaining unused nodes is 0, the working path and the protection path are determined to be co-located, and a path search failure error is returned. If the number of remaining unused nodes is 1, add a constraint condition, which states that subsequent pathfinding must bypass the last unused node to reserve it for the protection path; If the number of remaining unused nodes is greater than 1, the calculation of the next hop is continued directly until the destination node is obtained to complete the calculation of the working path.
7. The method according to claim 1, characterized in that The calculation step of the protection path is also included, which includes: Based on the set constraint conditions, the next hop node is calculated until the sink node is obtained to complete the calculation of the protection path, wherein the constraint conditions are: bypassing other nodes except the source and sink in the working path.
8. A path-finding device, characterized in that: include: A processing module, configured to determine a set of split points between the source and the sink based on the nodes passed through the source and the sink, wherein the split point set is a set of nodes and their edges in the split point set that are deleted, and the source and sink nodes are split into two disconnected subgraphs; The path-finding module is configured to calculate a working path based on a set of segmentation points, so that the working path does not pass through all nodes of the set of segmentation points.
9. An electronic device, characterized in that: The electronic device comprises: processor; A memory having computer-readable instructions stored thereon, wherein when the computer-readable instructions are executed by the processor, the method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium, characterized in that The computer program instructions are stored therein, and when the computer program instructions are executed by a computer, the computer is caused to execute the method according to any one of claims 1 to 7.