Path optimization method and device, electronic equipment and storage medium
By initializing the optimal link set and target queue in the SDN controller, optimizing the positive and reverse path evaluation value, the problem of inefficiency of the SDN controller when planning the service traffic path is solved, and efficient and accurate path optimization is achieved.
Patent Information
- Application Number
- CN202411200475.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-29
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2044-08-29
AI Technical Summary
When planning service traffic paths, existing SDN controllers find it difficult to meet the requirements of forward and reverse path consistency and computing efficiency at the same time, resulting in low path optimization efficiency.
Provide a path optimization method, by initializing the optimal link set and target queue, obtaining the network topology link evaluation value, judging and updating the forward and reverse path evaluation value in sequence, ensuring that the path meets the constraints, and implementing it in the SDN controller Path optimization.
It realizes efficient and accurate finding of the optimal path that meets forward and reverse constraints, improving the quality and efficiency of path planning.
Smart Images

Figure CN119094427A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a path optimization method, device, electronic device and storage medium. Background Art
[0002] In recent years, Software Defined Network (SDN) has been widely used in various fields and user networks. In different fields and user networks, the technologies and problems that SDN controllers need to use are different. For example, in some user networks, SDN controllers must not only ensure the bandwidth and quality of services, but also ensure that the forward and reverse service traffic paths are exactly the same, that is, to ensure that the service nodes of the forward and reverse service traffic paths are consistent.
[0003] In this case, when planning the service traffic path, the SDN controller must ensure that the constraints are met and the forward and reverse paths are consistent, and perform path optimization under this condition. However, the current service traffic path optimization solution based on the SDN controller has low computational efficiency and is difficult to meet user needs. Summary of the invention
[0004] In order to overcome the problems existing in the related art, the present application provides a path optimization method, device, electronic device and computer storage medium.
[0005] According to a first aspect of an embodiment of the present application, a path optimization method is provided, the method being applied to an SDN controller, the method comprising:
[0006] Initialize the optimal link set to be empty, and initialize the target queue that only includes the source node;
[0007] Obtain link evaluation values of all links in the network topology, and initialize the forward and reverse path evaluation values between the source node and any node in the network topology to the lowest value;
[0008] Taking out the nodes in the target queue in turn as the current node, and changing the status of the current node to visited;
[0009] Determine whether the current node is the destination node to obtain a first determination result; if the first determination result is no, then for each neighbor node of the current node that is in an unvisited state, determine whether the link between the current node and the neighbor node satisfies the forward constraint condition to obtain a second determination result, determine whether the link between the neighbor node and the current node satisfies the reverse constraint condition to obtain a third determination result, and calculate the forward and reverse path evaluation values between the source node and the current node, the link evaluation value of the link between the current node and the neighbor node, and the link evaluation value of the link between the neighbor node and the current node, and determine the calculated source node to the neighbor node. Whether the forward and reverse path evaluation value between the points is better than the previously recorded forward and reverse path evaluation value between the source node and the neighbor node, and a fourth judgment result is obtained; if the second judgment result, the third judgment result and the fourth judgment result are all yes, then the previously recorded forward and reverse path evaluation value between the source node and the neighbor node is updated to the calculated forward and reverse path evaluation value between the source node and the neighbor node, and the optimal link to the neighbor node in the optimal link set is updated to the link between the current node and the neighbor node, and the neighbor node is added to the target queue, and the nodes in the target queue are arranged in descending order according to the forward and reverse path evaluation value from the source node to the node;
[0010] Determine whether the target queue is empty to obtain a fifth determination result; if the fifth determination result is no, return to the step of sequentially taking out nodes in the target queue as the current node;
[0011] If the first judgment result is yes, the optimal link set is backtracked to obtain the optimal path from the source node to the destination node.
[0012] According to a second aspect of an embodiment of the present application, a path optimization device is provided, the device being applied to an SDN controller, the device comprising:
[0013] A first initialization module is used to initialize the optimal link set to be empty and initialize the target queue including only the source node;
[0014] The second initialization module is used to obtain link evaluation values of all links in the network topology, and initialize the forward and reverse path evaluation values between the source node and any node in the network topology to be the lowest;
[0015] A node extraction module is used to sequentially extract nodes in the target queue as current nodes and modify the status of the current node to visited;
[0016] A loop module is used to determine whether the current node is a destination node and obtain a first judgment result; if the first judgment result is no, for each neighbor node of the current node that is in an unvisited state, determine whether the link between the current node and the neighbor node satisfies the forward constraint condition and obtain a second judgment result, determine whether the link between the neighbor node and the current node satisfies the reverse constraint condition and obtain a third judgment result, and calculate the forward and reverse path evaluation value between the source node and the current node, the link evaluation value of the link between the current node and the neighbor node, and the link evaluation value of the link between the neighbor node and the current node, and determine the calculated source node to the neighbor node. Whether the forward and reverse path evaluation values between the neighbor nodes are better than the previously recorded forward and reverse path evaluation values between the source node and the neighbor node, a fourth judgment result is obtained; if the second judgment result, the third judgment result and the fourth judgment result are all yes, then the previously recorded forward and reverse path evaluation values between the source node and the neighbor node are updated to the calculated forward and reverse path evaluation values between the source node and the neighbor node, and the optimal link to the neighbor node in the optimal link set is updated to the link between the current node and the neighbor node, and the neighbor node is added to the target queue, and the nodes in the target queue are arranged in descending order according to the forward and reverse path evaluation values from the source node to the node;
[0017] A judgment module, used for judging whether the target queue is empty, and obtaining a fifth judgment result; if the fifth judgment result is no, triggering a node extraction module to execute the step of sequentially extracting nodes in the target queue as current nodes;
[0018] The output module is used to trace back the optimal link set to obtain the optimal path from the source node to the destination node if the first judgment result is yes.
[0019] According to a third aspect of an embodiment of the present application, an electronic device is provided, comprising a processor and a machine-readable storage medium, wherein the machine-readable storage medium stores machine-executable instructions that can be executed by the processor, and the processor is prompted by the machine-executable instructions to implement the steps of the path optimization method as described above.
[0020] According to a fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the path optimization method described above are implemented.
[0021] The technical solution provided by the embodiments of the present application may have the following beneficial effects:
[0022] The embodiment of the present application provides a path optimization method, which considers both the forward constraint from the source node to the destination node and the reverse constraint from the destination node to the source node when searching for a path, and can find the optimal path that satisfies both the forward constraint and the reverse constraint. The method is efficient and accurate, and can output a path of higher quality that better meets actual requirements.
[0023] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] The accompanying drawings, which are incorporated in the specification and constitute a part of this application, illustrate embodiments consistent with the application and, together with the description, serve to explain the principles of the application.
[0025] Figure 1 A schematic diagram of a flow chart of a path optimization method provided in an embodiment of the present application;
[0026] Figure 2 Another schematic diagram of a flow chart of a path optimization method provided in an embodiment of the present application;
[0027] Figure 3 A schematic diagram of a path optimization method provided in an embodiment of the present application;
[0028] Figure 4 A schematic diagram of the structure of a path optimization device provided in an embodiment of the present application;
[0029] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0030] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0031] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. The singular forms of "a", "said" and "the" used in this application and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0032] It should be understood that, although the terms first, second, third, etc. may be used in the present application to describe various information, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the words "if" or "if" as used herein may be interpreted as "at the time of" or "when...".
[0033] First, several concepts involved in the embodiments of the present application are explained:
[0034] A link is a directional path between two connected nodes in a network topology;
[0035] A path refers to the set of links between a source node and other nodes in the network topology (including but not limited to the destination node);
[0036] Constraints refer to the restrictions set for paths / links;
[0037] Evaluation conditions refer to an evaluation rule for a link;
[0038] The link evaluation value refers to the evaluation result obtained by evaluating the link according to the given evaluation conditions. The value can be determined when the link and the evaluation conditions are determined;
[0039] The forward and reverse path evaluation values are numerical values that characterize the evaluation levels of the forward and reverse paths from the source node to other nodes. They are initialized to the lowest value and will be updated during the path optimization process.
[0040] Next, the embodiments of the present application are described in detail.
[0041] The present application embodiment provides a path optimization method, which is applied to an SDN controller, such as Figure 1 As shown, the method may include the following steps:
[0042] S101, initializing the optimal link set to be empty, and initializing the target queue including only the source node;
[0043] In the embodiment of the present application, the optimal link set is used to record the optimal link. As described above, the path can be understood as a set of links, and accordingly, the optimal path can be understood as a set of optimal links. The optimal path is the path optimization target of the embodiment of the present application, and the optimal link is the path between two adjacent nodes in the optimal path.
[0044] S102, obtaining link evaluation values of all links in the network topology, and initializing the forward and reverse path evaluation values between the source node and any node in the network topology to the lowest value;
[0045] S103, taking out the nodes in the target queue in turn as the current node, and changing the status of the current node to visited;
[0046] S104, determine whether the current node is the destination node, and obtain a first determination result; if the first determination result is no, proceed to S105, otherwise proceed to S111;
[0047] S105, obtaining neighbor nodes of the current node whose status is unvisited, obtaining one neighbor node at a time, until all neighbor nodes of the current node whose status is unvisited are processed, and then returning to S103;
[0048] S106, determining whether the link between the current node and the neighboring node satisfies the forward constraint condition, and obtaining a second determination result;
[0049] S107, determining whether the link from the neighbor node to the current node satisfies the reverse constraint condition, and obtaining a third determination result;
[0050] S108, calculating the forward and reverse path evaluation values between the source node and the current node, the link evaluation value of the link between the current node and the neighbor node, and the link evaluation value of the link between the neighbor node and the current node, and determining whether the calculated forward and reverse path evaluation values between the source node and the neighbor node are better than the previously recorded forward and reverse path evaluation values between the source node and the neighbor node, to obtain a fourth determination result;
[0051] S109, if the second judgment result, the third judgment result and the fourth judgment result are all yes, then the previously recorded forward and reverse path evaluation values between the source node and the neighbor node are updated to the calculated forward and reverse path evaluation values between the source node and the neighbor node, and the optimal link to the neighbor node in the optimal link set is updated to the link between the current node and the neighbor node, and the neighbor node is added to the target queue;
[0052] The nodes in the target queue are always arranged in descending order according to the forward and reverse path evaluation values from the source node to the node.
[0053] S110, determining whether the target queue is empty, and obtaining a fifth determination result; if the fifth determination result is no, returning to the step of sequentially taking out nodes in the target queue as the current node; if the fifth determination result is yes, it indicates that the destination node is not reached in the end, that is, the optimal path from the source node to the destination node is not found, and the path optimization process ends;
[0054] S111. If the first judgment result is yes, then the optimal link set is backtracked to obtain the optimal path from the source node to the destination node.
[0055] In the embodiment of the present application, the evaluation condition refers to an evaluation rule for the link. In practical applications, any one or more of the following conditions can be selected as the evaluation condition: routing cost metric, link availability, delay, jitter, packet loss rate, bandwidth, and optimization strategy. It can be understood that the link evaluation values obtained by evaluating the link according to different evaluation conditions are different, and the minimum evaluation values corresponding to different evaluation conditions are also different. In the embodiment of the present application, the evaluation conditions set for the current path optimization task are referred to as target evaluation conditions. Therefore, the above steps of obtaining the link evaluation values of all links in the network topology and initializing the forward and reverse path evaluation values between the source node and any node in the network topology to the lowest value can be specifically as follows:
[0056] According to the target evaluation condition, the link evaluation values of all links in the network topology are calculated; the forward and reverse path evaluation values between the source node and any node in the network topology are initialized to the minimum value corresponding to the target evaluation condition.
[0057] In the embodiment of the present application, the constraint condition can be a constraint condition set for the path, or a constraint condition set for the link. In practical applications, any one or more of the following attributes can be selected as the constraint condition: delay, jitter, packet loss rate, bandwidth, affinity attribute. Affinity attributes refer to attributes such as optional links, excluded links, and mandatory links. When the constraint condition is set as a constraint condition for the link, the above second judgment result and the third judgment result are specifically obtained in the following manner:
[0058] Determine whether the link between the current node and the neighboring node satisfies the preset forward constraint condition of the link between the current node and the neighboring node, and obtain a second judgment result; determine whether the link between the neighboring node and the current node satisfies the preset reverse constraint condition of the link between the current node and the neighboring node, and obtain a third judgment result.
[0059] It can be seen that the subsequent update will continue only when and only when the second judgment result, the third judgment result, and the fourth judgment result are all yes. That is to say, as long as any one of the second judgment result, the third judgment result, and the fourth judgment result is no, the other judgment processes do not need to be executed. Therefore, some unnecessary judgment processes can be avoided by limiting the judgment order, thereby further improving the efficiency of path optimization. Therefore, as a preferred implementation, the fourth judgment result is obtained specifically in the following manner, such as Figure 2 As shown:
[0060] S201, obtaining neighbor nodes of the current node whose status is unvisited, obtaining one neighbor node at a time, until all neighbor nodes of the current node whose status is unvisited are processed;
[0061] S202, judging whether the link between the current node and the neighboring node satisfies the forward constraint condition, and obtaining a second judgment result; if the second judgment result is yes, proceeding to S203, otherwise, continuing to process the next neighboring node in the unvisited state;
[0062] S203, judging whether the link between the neighbor node and the current node satisfies the reverse constraint condition, and obtaining a third judgment result; if the third judgment result is yes, proceeding to S204, otherwise, continuing to process the next neighbor node in the unvisited state;
[0063] S204, according to the forward and reverse path evaluation value between the source node and the current node, the link evaluation value of the link between the current node and the neighbor node, and the link evaluation value of the link between the neighbor node and the current node, calculate the forward and reverse path evaluation value between the source node and the neighbor node, and judge whether the calculated forward and reverse path evaluation value between the source node and the neighbor node is better than the previously recorded forward and reverse path evaluation value between the source node and the neighbor node, and obtain a fourth judgment result; if the fourth judgment result is yes, enter S205, otherwise continue to process the next neighbor node whose state is not visited;
[0064] S205. Update the previously recorded forward and reverse path evaluation values between the source node and the neighbor node to the calculated forward and reverse path evaluation values between the source node and the neighbor node, update the optimal link to the neighbor node in the optimal link set to the link between the current node and the neighbor node, and add the neighbor node to the target queue.
[0065] As described above, the forward and reverse path evaluation values between the source node and the current node, the link evaluation value of the link between the current node and the neighbor node, and the link evaluation value of the link between the neighbor node and the current node can be calculated. In practical applications, different weight values can be set for the forward path and the reverse path to distinguish their importance. Therefore, as a preferred implementation, the forward and reverse path evaluation values between the source node and the neighbor node can be calculated in the following manner:
[0066] The product of the link evaluation value of the link from the current node to the neighbor node and the forward weight is calculated as the forward link evaluation value; the product of the link evaluation value of the link from the neighbor node to the current node and the reverse weight is calculated as the reverse link evaluation value; the forward and reverse path evaluation values between the source node and the neighbor node are calculated according to the forward link evaluation value, the reverse link evaluation value, and the forward and reverse path evaluation values between the source node and the current node. As a specific implementation method, the sum of the forward link evaluation value, the reverse link evaluation value, and the forward and reverse path evaluation values between the source node and the current node can be calculated as the forward and reverse path evaluation values between the source node and the neighbor node.
[0067] For link l, let the constraints be C1,C2,...,C n , the corresponding requirements are S1,S2,...,S n , then link l satisfies constraint C i It can be expressed as: C i (l) = S i . Among them, C i (l) indicates that link l is under constraint C i The actual value of S i Link l under constraint C i The ideal value below.
[0068] For the reverse link l of link l R , let the constraint be C R1 ,C R2 ,...,C Rn , the corresponding requirement is S R1 ,S R2 ,...,S Rn , then link l R Satisfy the constraint C Ri It can be expressed as: C Ri (l R )=S Ri . Among them, C Ri (l R ) indicates link l R Under the constraint C Ri The actual value of S Ri Indicates link l R Under the constraint C Ri The ideal value.
[0069] Create an optimal link set and initialize it to empty. The optimal link set is used to record the optimal link to any node n and will be continuously updated during the path optimization process.
[0070] Initialize the forward and reverse path evaluation value Best[n] between the source node and any node n to the minimum value. Set the corresponding minimum value for different evaluation conditions. Taking the evaluation condition as Metric as an example, the smaller the forward and reverse path evaluation value, the better the path, so Best[n] is initialized to the maximum value.
[0071] Initialize the target queue that only includes the source node. The nodes in the target queue are always arranged in descending order of forward and reverse path evaluation values. Taking the evaluation condition as Metric as an example, the smaller the forward and reverse path evaluation value, the better the path. The smaller the forward and reverse path evaluation value of the node, the higher the position in the target queue.
[0072] For link l, after selecting the evaluation condition P, the link evaluation value P(l) of the link can be obtained.
[0073] The following steps (1) to (5) are executed in a loop until the target queue is empty and then step (6) is entered:
[0074] (1) Take the node at the front of the target queue, that is, the node with the highest forward and reverse path evaluation value, and record it as the current node. Taking the evaluation condition as Metric as an example, take the node with the smallest forward and reverse path evaluation value between it and the source node as the current node.
[0075] (2) Mark the status of the current node as visited.
[0076] (3) Determine whether the current node is the destination node. If it is the destination node, the termination condition is met and the process goes to step (7).
[0077] (4) Obtain all neighbor nodes of the current node that are in the unvisited state.
[0078] (5) Loop through the following steps a) to d) until all neighbor nodes that are in the unvisited state are traversed, and then return to step (1):
[0079] a) For the link l from the current node curNode to the neighbor node neighbor, all constraints C must be satisfied. i (l) = S i If the condition is satisfied, go to the next step; if not, skip the node and continue to process the next neighbor node.
[0080] b) For the reverse link l from the neighbor node neighbor to the current node curNode R , all constraints C need to be satisfied Ri (l R )=S Ri If it is satisfied, go to the next step. If it is not satisfied, skip the node and continue to process the next neighbor node.
[0081] c) Based on the forward and reverse path evaluation value Best[curNode] between the source node and the current node curNode, the link evaluation value P(l) of link l, and the link evaluation value P(l) of link l R The link evaluation value P(l R ), calculate the forward and reverse path evaluation values F{Best[curNode],P(l),P(l) between the new source node and the neighbor node neighbor R)}, compare the forward and reverse path evaluation values between the new source node and the neighbor node neighbor with the previous forward and reverse path evaluation values between the source node and the neighbor node neighbor. If the former is better than the latter, update Best[neighber] to the forward and reverse path evaluation value between the new source node and the neighbor node neighbor, that is, Best[neighbor]=F{Best[curNode],P(l),P(l R )}. If the former is not better than the latter, skip the node and continue to process the next neighbor node.
[0082] d) Add the neighbor node to the target queue, and update the optimal link to the neighbor node in the optimal link set to the link from the current node to the neighbor node, that is, cameFrom[neighbor]=l.
[0083] (6) When the target queue is empty, the path optimization process ends. If the target queue is empty, it means that a path from the source node to the destination node that satisfies the forward and reverse constraints cannot be found, and a prompt message indicating that the optimal path cannot be found is output.
[0084] (7) Backtracking path: find the path from the source node to the destination node that satisfies the forward and reverse constraints through the optimal link set, and output it.
[0085] The following takes the evaluation condition as Metric as an example. Figure 3 The network topology shown is used to further illustrate the embodiments of the present application.
[0086] Figure 3 In the example, node A is the source node and node E is the destination node.
[0087] The evaluation condition Metric has the following characteristics: for a link, the link evaluation value is the Metric value of the link. The smaller the Metric value, the better the link. For a path, the path evaluation value in one direction is equal to the sum of the link evaluation values of all links included in the path, and the forward and reverse path evaluation values are equal to the weighted sum of the forward path evaluation value and the reverse path evaluation value.
[0088] Create an optimal link set and initialize it to an empty set; initialize the forward and reverse path evaluation values Best[n] between the source node and any node n to the maximum value; initialize the target queue that only includes the source node A.
[0089] Under the evaluation condition Metric, the link evaluation value of each link is obtained. To simplify the calculation process, this embodiment assumes that the link evaluation value of the forward link is equal to the link evaluation value of the reverse link. Figure 3As shown, the link evaluation value between node A and node B is 10, the link evaluation value between node A and node C is 2, the link evaluation value between node B and node C is 5, the link evaluation value between node B and node D is 3, and the link evaluation value between node D and node E is 6.
[0090] The forward and reverse path evaluation values of node A are initialized to 0, and the forward and reverse path evaluation values between node A and node B, node C, node D, and node E are all initialized to infinity.
[0091] The calculation formula for defining the forward and reverse path evaluation value between the source node and any node is:
[0092] Best[neighbor]=Best[curNode]+w1M(l)+w2M(l R )
[0093] Among them, Best[neighbor] is the forward and reverse path evaluation value between the source node and the node neighbor, Best[curNode] is the forward and reverse path evaluation value between the source node and the node curNode; link l is the link between the node curNode and the node neighbor, M(l) is the link evaluation value of the link, i.e., the metric value, and w1 is the forward weight; link l R is the reverse link between node curNode and node neighbor, M(l R ) is the link evaluation value of the link, i.e., the Metric value, and w2 is the reverse weight.
[0094] The following description assumes that both the forward weight and the reverse weight are 1.
[0095] The first round of loop process is as follows: take out node A from the target queue, mark node A as visited, and know that node A is not the destination node, so further obtain all the unvisited neighbor nodes of node A, namely node B and node C; for node B, determine whether the link between node A and node B meets the preset forward and reverse constraints of the link. Assuming that it meets the conditions, calculate the forward and reverse path evaluation values between node A and node B according to the above formula, and the calculation result is 20, which is smaller than the previously recorded forward and reverse path evaluation values between node A and node B, which are infinite, so add node B to the target queue, and record the link (A, B) to the optimal link set; for node C, determine whether the link between node A and node C meets the preset forward and reverse constraints of the link. Assuming it meets the preset forward and reverse constraints, the forward and reverse path evaluation values between node A and node C are calculated according to the above formula, and the calculation result is 4, which is smaller than the previously recorded forward and reverse path evaluation value between node A and node C, which is infinite. Therefore, node C is added to the target queue, and the link (A, C) is recorded in the optimal link set. This round ends, and there are nodes B and C in the target queue. Since the forward and reverse path evaluation value 20 between node A and node B is greater than the forward and reverse path evaluation value 4 between node A and node C, node C is located before node B in the target queue.
[0096] The second round of loop process is as follows: take out node C from the target queue, mark node C as visited, and it is known that node C is not the destination node, so further obtain all neighbor nodes of node C, namely node B and node A, where node A has been marked as visited, so the only unvisited neighbor node of node C is node B. Assuming that the link between node C and node B meets the preset forward and reverse constraints of the link, the forward and reverse path evaluation values between node A and node B are calculated, and the calculated result is 14, which is less than the previously recorded forward and reverse path evaluation value of 20 between node A and node B, so node B is added to the target queue (in the embodiment of the present application, the target queue does not store duplicate nodes, so this step is equivalent to no operation), and the link (A, B) is updated to the link (C, B) in the optimal link set;
[0097] Take out node B from the target queue and mark it as visited. It is known that node B is not the destination node, so further obtain all neighbor nodes of node B, namely node A, node C, and node D. Node A and node C have been marked as visited, so the only unvisited neighbor node of node B is node D. Assuming that the link between node B and node D meets the forward and reverse constraints of the link, calculate the forward and reverse path evaluation value between node A and node D. The result is 20, which is smaller than the previously recorded forward and reverse path evaluation value between node A and node D, which is infinite. Therefore, add node D to the target queue and record the link (B, D) in the optimal link set. This round ends.
[0098] The third round of loop process is as follows: take out node D from the target queue and mark node D as visited. It is known that node D is not the destination node, so further obtain all the unvisited neighbor nodes of node D, that is, node E; for node E, determine whether the link between node D and node E meets the preset forward and reverse constraints of the link. Assuming that it meets the conditions, calculate the forward and reverse path evaluation values between node A and node E, and the calculation result is 32, which is smaller than the previously recorded forward and reverse path evaluation values between node A and node E, which is infinite. Therefore, add node E to the target queue and record the link (D, E) in the optimal link set. This round ends.
[0099] The fourth round of loop process is as follows: take out node E from the target queue, mark node E as visited, and it is known that node E is the destination node, which satisfies the termination condition. This round ends.
[0100] At this point, the links stored in the optimal link set are {(A,C),(C,B),(B,D),(D,E)}. By backtracing the optimal link set, we can obtain the optimal path between the source node A and the destination node E that satisfies the forward and reverse constraints, that is, A—>C—>B—>D—>E. This path is the forward path. Correspondingly, the reverse path is E—>D—>B—>C—>A.
[0101] It can be seen from the above technical solutions that the embodiment of the present application provides a path optimization method, which has at least the following advantages:
[0102] Controllable performance: The path that is consistent with the forward and reverse businesses can be calculated at one time. On the basis of optimizing the performance of the algorithm, the efficiency and applicability can be further improved.
[0103] Global optimal path: The globally optimal path can be found, which ensures the accuracy of path planning and makes the found path meet actual needs.
[0104] Comprehensive consideration of bidirectional constraints: This method can calculate a path that satisfies all constraints of forward and reverse services. By combining the constraints in both directions, the found path not only satisfies the constraints from the source node to the destination node, but also satisfies the constraints from the destination node to the source node.
[0105] Based on the same inventive concept, the present application also provides a path optimization device, which is applied to an SDN controller. Figure 4 As shown, specifically including:
[0106] A first initialization module 401 is used to initialize the optimal link set to be empty and initialize the target queue including only the source node;
[0107] The second initialization module 402 is used to obtain link evaluation values of all links in the network topology, and initialize the forward and reverse path evaluation values between the source node and any node in the network topology to be the lowest;
[0108] The node extraction module 403 is used to sequentially extract the nodes in the target queue as the current node, and change the status of the current node to visited;
[0109] The loop module 404 is used to determine whether the current node is the destination node and obtain a first determination result; if the first determination result is no, for each neighbor node of the current node that is in an unvisited state, determine whether the link between the current node and the neighbor node satisfies the forward constraint condition and obtain a second determination result, determine whether the link between the neighbor node and the current node satisfies the reverse constraint condition and obtain a third determination result, and calculate the forward and reverse path evaluation value between the source node and the current node, the link evaluation value of the link between the current node and the neighbor node, and the link evaluation value of the link between the neighbor node and the current node, and determine the calculated source node. Whether the forward and reverse path evaluation values between the source node and the neighbor node are better than the previously recorded forward and reverse path evaluation values between the source node and the neighbor node, and a fourth judgment result is obtained; if the second judgment result, the third judgment result and the fourth judgment result are all yes, then the previously recorded forward and reverse path evaluation values between the source node and the neighbor node are updated to be the calculated forward and reverse path evaluation values between the source node and the neighbor node, and the optimal link to the neighbor node in the optimal link set is updated to be the link between the current node and the neighbor node, and the neighbor node is added to the target queue, and the nodes in the target queue are arranged in descending order according to the forward and reverse path evaluation values from the source node to the node;
[0110] The judgment module 405 is used to judge whether the target queue is empty and obtain a fifth judgment result; if the fifth judgment result is no, the node extraction module is triggered to execute the step of sequentially extracting nodes in the target queue as the current node;
[0111] The output module 406 is configured to, if the first judgment result is yes, trace back the optimal link set to obtain an optimal path from the source node to the destination node.
[0112] As a specific implementation, the second initialization module 402 specifically obtains the link evaluation values of all links in the network topology in the following manner:
[0113] According to the target evaluation conditions, the link evaluation values of all links in the network topology are calculated;
[0114] Accordingly, the second initialization module 402 specifically initializes the forward and reverse path evaluation values between the source node and any node in the network topology to the lowest value in the following manner:
[0115] Initialize the forward and reverse path evaluation values between the source node and any node in the network topology to be the lowest values corresponding to the target evaluation conditions.
[0116] As a specific implementation, the loop module 404 obtains the second judgment result in the following manner:
[0117] Determine whether the link between the current node and the neighboring node satisfies a preset forward constraint condition of the link between the current node and the neighboring node, and obtain a second determination result;
[0118] Accordingly, the loop module 404 obtains the third judgment result in the following manner:
[0119] It is determined whether the link from the neighbor node to the current node satisfies the reverse constraint condition to obtain a third determination result.
[0120] As a specific implementation, the loop module 404 obtains the fourth determination result through the following units:
[0121] A first judgment unit is used to judge whether a link between the current node and each neighbor node of the current node that is in an unvisited state satisfies a forward constraint condition if the first judgment result is no, so as to obtain a second judgment result;
[0122] A second judgment unit is used to judge whether the link between the neighbor node and the current node satisfies the reverse constraint condition if the second judgment result is yes, to obtain a third judgment result;
[0123] The third judgment unit is used to calculate the forward and reverse path evaluation value between the source node and the neighbor node based on the forward and reverse path evaluation value between the source node and the current node, the link evaluation value of the link between the current node and the neighbor node, and the link evaluation value of the link between the neighbor node and the current node if the third judgment result is yes, and judge whether the calculated forward and reverse path evaluation value between the source node and the neighbor node is better than the previously recorded forward and reverse path evaluation value between the source node and the neighbor node, to obtain a fourth judgment result.
[0124] As a specific implementation, the loop module 404 specifically calculates the forward and reverse path evaluation values between the source node and the neighbor node in the following manner:
[0125] Calculate the product of the link evaluation value of the link between the current node and the neighbor node and the forward weight as the forward link evaluation value; calculate the product of the link evaluation value of the link between the neighbor node and the current node and the reverse weight as the reverse link evaluation value; calculate the forward and reverse path evaluation values between the source node and the neighbor node based on the forward link evaluation value, the reverse link evaluation value, and the forward and reverse path evaluation values between the source node and the current node.
[0126] The present application also provides an electronic device, such as Figure 5 As shown, it includes a processor 501 and a machine-readable storage medium 502, wherein the machine-readable storage medium 502 stores machine-executable instructions that can be executed by the processor 501, and the processor 501 is prompted by the machine-executable instructions to implement the steps of any of the above-mentioned path optimization methods.
[0127] The machine-readable storage medium may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk storage. Optionally, the machine-readable storage medium may also be at least one storage device located away from the processor.
[0128] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0129] In another embodiment provided in the present application, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned path optimization methods are implemented.
[0130] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A path optimization method, It is characterized in that The method is applied to an SDN controller, and the method includes: Initialize the optimal link set to be empty, and initialize the target queue that only includes the source node; Obtain link evaluation values of all links in the network topology, and initialize the forward and reverse path evaluation values between the source node and any node in the network topology to the lowest value; Taking out the nodes in the target queue in turn as the current node, and changing the status of the current node to visited; Determine whether the current node is the destination node to obtain a first determination result; if the first determination result is no, then for each neighbor node of the current node that is in an unvisited state, determine whether the link between the current node and the neighbor node satisfies the forward constraint condition to obtain a second determination result, determine whether the link between the neighbor node and the current node satisfies the reverse constraint condition to obtain a third determination result, and calculate the forward and reverse path evaluation values between the source node and the current node, the link evaluation value of the link between the current node and the neighbor node, and the link evaluation value of the link between the neighbor node and the current node, and determine the calculated source node to the neighbor node. Whether the forward and reverse path evaluation value between the points is better than the previously recorded forward and reverse path evaluation value between the source node and the neighbor node, and a fourth judgment result is obtained; if the second judgment result, the third judgment result and the fourth judgment result are all yes, then the previously recorded forward and reverse path evaluation value between the source node and the neighbor node is updated to the calculated forward and reverse path evaluation value between the source node and the neighbor node, and the optimal link to the neighbor node in the optimal link set is updated to the link between the current node and the neighbor node, and the neighbor node is added to the target queue, and the nodes in the target queue are arranged in descending order according to the forward and reverse path evaluation value from the source node to the node; Determine whether the target queue is empty to obtain a fifth determination result; if the fifth determination result is no, return to the step of sequentially taking out nodes in the target queue as the current node; If the first judgment result is yes, the optimal link set is backtracked to obtain the optimal path from the source node to the destination node.
2. The method according to claim 1, It is characterized in that Get the link evaluation values of all links in the network topology, including: According to the target evaluation conditions, the link evaluation values of all links in the network topology are calculated; Initialize the forward and reverse path evaluation values between the source node and any node in the network topology to the lowest value, including: Initialize the forward and reverse path evaluation values between the source node and any node in the network topology to be the lowest values corresponding to the target evaluation conditions.
3. The method according to claim 1, It is characterized in that Determine whether the link from the current node to the neighboring node satisfies the forward constraint condition, and obtain a second determination result, which specifically includes: Determine whether the link between the current node and the neighboring node satisfies a preset forward constraint condition of the link between the current node and the neighboring node, and obtain a second determination result; Determine whether the link from the neighbor node to the current node satisfies the reverse constraint condition, and obtain a third determination result, which specifically includes: It is determined whether the link between the neighbor node and the current node satisfies a preset reverse constraint condition of the link between the current node and the neighbor node to obtain a third determination result.
4. The method according to claim 1, It is characterized in that The fourth judgment result is obtained specifically in the following manner: If the first judgment result is no, then for each neighbor node of the current node that is in the unvisited state, determine whether the link between the current node and the neighbor node satisfies the forward constraint condition to obtain a second judgment result; If the second judgment result is yes, then determine whether the link from the neighbor node to the current node meets the reverse constraint condition to obtain a third judgment result; If the third judgment result is yes, then the forward and reverse path evaluation value between the source node and the neighbor node is calculated based on the forward and reverse path evaluation value between the source node and the current node, the link evaluation value of the link between the current node and the neighbor node, and the link evaluation value of the link between the neighbor node and the current node, and it is determined whether the calculated forward and reverse path evaluation value between the source node and the neighbor node is better than the previously recorded forward and reverse path evaluation value between the source node and the neighbor node, to obtain the fourth judgment result.
5. The method according to claim 1, It is characterized in that According to the forward and reverse path evaluation values between the source node and the current node, the link evaluation value of the link between the current node and the neighbor node, and the link evaluation value of the link between the neighbor node and the current node, the forward and reverse path evaluation values between the source node and the neighbor node are calculated, including: Calculate the product of the link evaluation value of the link between the current node and the neighbor node and the forward weight as the forward link evaluation value; calculate the product of the link evaluation value of the link between the neighbor node and the current node and the reverse weight as the reverse link evaluation value; calculate the forward and reverse path evaluation values between the source node and the neighbor node based on the forward link evaluation value, the reverse link evaluation value, and the forward and reverse path evaluation values between the source node and the current node.
6. A path optimization device, It is characterized in that The device is applied to an SDN controller, and the device includes: A first initialization module is used to initialize the optimal link set to be empty and initialize the target queue including only the source node; The second initialization module is used to obtain link evaluation values of all links in the network topology, and initialize the forward and reverse path evaluation values between the source node and any node in the network topology to be the lowest; A node extraction module is used to sequentially extract nodes in the target queue as current nodes and change the status of the current node to visited; A loop module is used to determine whether the current node is a destination node and obtain a first judgment result; if the first judgment result is no, for each neighbor node of the current node that is in an unvisited state, determine whether the link between the current node and the neighbor node satisfies the forward constraint condition and obtain a second judgment result, determine whether the link between the neighbor node and the current node satisfies the reverse constraint condition and obtain a third judgment result, and calculate the forward and reverse path evaluation value between the source node and the current node, the link evaluation value of the link between the current node and the neighbor node, and the link evaluation value of the link between the neighbor node and the current node, and determine the calculated source node to the neighbor node. Whether the forward and reverse path evaluation values between the neighbor nodes are better than the previously recorded forward and reverse path evaluation values between the source node and the neighbor node, a fourth judgment result is obtained; if the second judgment result, the third judgment result and the fourth judgment result are all yes, then the previously recorded forward and reverse path evaluation values between the source node and the neighbor node are updated to the calculated forward and reverse path evaluation values between the source node and the neighbor node, and the optimal link to the neighbor node in the optimal link set is updated to the link between the current node and the neighbor node, and the neighbor node is added to the target queue, and the nodes in the target queue are arranged in descending order according to the forward and reverse path evaluation values from the source node to the node; A judgment module, used for judging whether the target queue is empty, and obtaining a fifth judgment result; if the fifth judgment result is no, triggering a node extraction module to execute the step of sequentially extracting nodes in the target queue as current nodes; The output module is used to trace back the optimal link set to obtain the optimal path from the source node to the destination node if the first judgment result is yes.
7. The device according to claim 6, It is characterized in that The second initialization module specifically obtains the link evaluation values of all links in the network topology in the following manner: According to the target evaluation conditions, the link evaluation values of all links in the network topology are calculated; The second initialization module specifically initializes the forward and reverse path evaluation values between the source node and any node in the network topology to the lowest value in the following manner: Initialize the forward and reverse path evaluation values between the source node and any node in the network topology to be the lowest values corresponding to the target evaluation conditions.
8. The device according to claim 6, It is characterized in that The circulation module obtains the second judgment result specifically in the following manner: Determine whether the link between the current node and the neighboring node satisfies a preset forward constraint condition of the link between the current node and the neighboring node, and obtain a second determination result; The circulation module obtains the third judgment result specifically in the following manner: It is determined whether the link from the neighbor node to the current node satisfies the reverse constraint condition to obtain a third determination result.
9. The device according to claim 6, It is characterized in that The circulation module specifically obtains the fourth judgment result through the following units: A first judgment unit is used to judge whether a link between the current node and each neighbor node of the current node that is in an unvisited state satisfies a forward constraint condition if the first judgment result is no, so as to obtain a second judgment result; A second judgment unit is used to judge whether the link between the neighbor node and the current node satisfies the reverse constraint condition if the second judgment result is yes, to obtain a third judgment result; The third judgment unit is used to calculate the forward and reverse path evaluation value between the source node and the neighbor node based on the forward and reverse path evaluation value between the source node and the current node, the link evaluation value of the link between the current node and the neighbor node, and the link evaluation value of the link between the neighbor node and the current node if the third judgment result is yes, and judge whether the calculated forward and reverse path evaluation value between the source node and the neighbor node is better than the previously recorded forward and reverse path evaluation value between the source node and the neighbor node, to obtain a fourth judgment result.
10. The device according to claim 6, It is characterized in that The loop module specifically calculates the forward and reverse path evaluation values between the source node and the neighbor node in the following way: Calculate the product of the link evaluation value of the link between the current node and the neighbor node and the forward weight as the forward link evaluation value; calculate the product of the link evaluation value of the link between the neighbor node and the current node and the reverse weight as the reverse link evaluation value; calculate the forward and reverse path evaluation values between the source node and the neighbor node based on the forward link evaluation value, the reverse link evaluation value, and the forward and reverse path evaluation values between the source node and the current node.
11. An electronic device, It is characterized in that The method comprises a processor and a machine-readable storage medium, wherein the machine-readable storage medium stores machine-executable instructions that can be executed by the processor, and the processor is prompted by the machine-executable instructions to implement the method steps described in any one of claims 1 to 5.
12. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps of any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Bidirectional constrained path search
CN108476170A
Topology control method with high energy efficiency
CN108616893A
SDN (Software Defined Network)-based path calculation method and device under multi-dimensional constraints
CN109995650A
Network multi-constraint dual-path routing determination method based on reverse deletion strategy
CN110224927A
Route acquisition method and device of software-defined network, and storage medium
CN110572323A
