A path optimization method and device, electronic equipment and storage medium

By initializing the optimal link set and target queue, and combining the forward and reverse path evaluation values, the link set is determined and updated, thus solving the problem of low path optimization efficiency in the SDN controller and achieving efficient and accurate path planning.

CN119094427BActive Publication Date: 2025-11-04NEW H3C TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411200475.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-29
Publication Date
2025-11-04
Estimated Expiration
2044-08-29

AI Technical Summary

Technical Problem

Existing SDN controllers struggle to simultaneously meet the requirements of forward and reverse path consistency and computational efficiency when planning service traffic paths, resulting in low computational efficiency of path optimization solutions that fail to meet user needs.

Method used

A path optimization method is provided, which initializes the optimal link set and target queue, combines forward and reverse path evaluation values, judges and updates the link set to ensure that the path meets the forward and reverse constraints, and updates and backtracks the optimal path in the optimal link set.

Benefits of technology

This approach achieves consistency between forward and reverse paths while improving the efficiency and accuracy of path optimization, finding better paths to meet actual needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119094427B_ABST
    Figure CN119094427B_ABST
Patent Text Reader

Abstract

The application provides a path optimization method and device, electronic equipment and a storage medium. The path optimization method can find a path between a source node and other nodes that meets forward and reverse constraints and calculate a forward and reverse path evaluation value of the path, perform path optimization based on the forward and reverse path evaluation value, record optimal links corresponding to an optimal link set of an optimal forward and reverse path evaluation value, and finally obtain an optimal path between the source node and a destination node by backtracking the optimal link set. The method simultaneously considers forward constraints from the source node to the destination node and reverse constraints from the destination node to the source node when finding the path, and can find an optimal path that meets the forward and reverse constraints. The method has the characteristics of high efficiency and accuracy, and can output a higher-quality path that meets actual requirements.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of communication technology, and in particular to a path optimization method and device, electronic equipment and storage medium. BACKGROUND

[0002] In recent years, software defined network (SDN) is widely applied in various fields and various user networks. In different fields and user networks, the technologies used by SDN controllers and the problems to be solved are different. For example, in some user networks, the SDN controller needs to not only realize bandwidth and quality guarantee of services, but also guarantee that the forward and reverse traffic paths are completely the same, that is, guarantee that the service nodes of the forward and reverse traffic are consistent.

[0003] In this case, the SDN controller needs to guarantee that the constraints are met and the forward and reverse paths are consistent when planning the traffic path, and performs path optimization under this condition. However, the current traffic path optimization scheme based on the SDN controller has low calculation efficiency and is difficult to meet the user demand. SUMMARY

[0004] To overcome the problems in the related art, the present application provides a path optimization method, device, electronic equipment 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 is applied to an SDN controller, and the method comprises the following steps.

[0006] Initializing an optimal link set as empty, and initializing a target queue including only a source node;

[0007] Obtaining link evaluation values of all links in a network topology, and initializing forward and reverse path evaluation values between the source node and any node in the network topology as the lowest value;

[0008] Taking a node in the target queue as a current node in turn, and modifying a state of the current node as visited;

[0009] judging whether the current node is the destination node to obtain a first judgment result; if the first judgment result is no, judging whether a link between the current node and each neighbor node of the current node which is not visited satisfies a forward constraint condition to obtain a second judgment result, judging whether a link between the neighbor node and the current node satisfies a reverse constraint condition to obtain a third judgment result, calculating a forward and reverse path evaluation value between the source node and the neighbor node according to a forward and reverse path evaluation value between the source node and the current node, a link evaluation value of the link between the current node and the neighbor node, and a link evaluation value of the link between the neighbor node and the current node, judging whether the calculated forward and reverse path evaluation value between the source node and the neighbor node is better than a previously recorded forward and reverse path evaluation value between the source node and the neighbor node to obtain a fourth judgment result; if the second judgment result, the third judgment result and the fourth judgment result are all yes, updating the previously recorded forward and reverse path evaluation value between the source node and the neighbor node to the calculated forward and reverse path evaluation value between the source node and the neighbor node, updating an optimal link to the neighbor node in the optimal link set to the link between the current node and the neighbor node, and adding the neighbor node to the target queue, wherein nodes in the target queue are arranged in an order from high to low according to the forward and reverse path evaluation value between the source node and the node;

[0010] judging whether the target queue is empty to obtain a fifth judgment result; if the fifth judgment result is no, returning to execute the step of sequentially taking out a node in the target queue as the current node;

[0011] if the first judgment result is yes, backtracking the optimal link set to obtain an optimal path between the source node and the destination node.

[0012] According to a second aspect of the embodiment of the application, a path optimization device is provided, which is applied to an SDN controller, and the device comprises:

[0013] a first initialization module, configured to initialize an optimal link set as empty and initialize a target queue including only a source node;

[0014] a second initialization module, configured to obtain link evaluation values of all links in a network topology and initialize forward and reverse path evaluation values between the source node and any node in the network topology as the lowest;

[0015] a node taking-out module, configured to sequentially take out a node in the target queue as the current node and modify a state of the current node as visited;

[0016] The cycle module is configured to determine whether the current node is the destination node to obtain a first determination result; if the first determination result is no, for each neighbor node of the current node which is not visited, the cycle module is configured to determine whether a link between the current node and the neighbor node satisfies a forward constraint condition to obtain a second determination result, determine whether a link between the neighbor node and the current node satisfies a reverse constraint condition to obtain a third determination result, calculate a forward and reverse path evaluation value between the source node and the neighbor node according to a forward and reverse path evaluation value between the source node and the current node, a link evaluation value of the link between the current node and the neighbor node, and a link evaluation value of the link between the neighbor node and the current node, determine whether the calculated forward and reverse path evaluation value between the source node and the neighbor node is better than a previously recorded forward and reverse path evaluation value between the source node and the neighbor node to obtain a fourth determination result; if the second determination result, the third determination result and the fourth determination result are all yes, the cycle module is configured to update the previously recorded forward and reverse path evaluation value between the source node and the neighbor node to the calculated forward and reverse path evaluation value between the source node and the neighbor node, update an 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, and nodes in the target queue are arranged in an order from high to low according to the forward and reverse path evaluation value between the source node and the node.

[0017] The determination module is configured to determine whether the target queue is empty to obtain a fifth determination result; if the fifth determination result is no, the node taking-out module is triggered to sequentially take out the nodes in the target queue as the current node.

[0018] The output module is configured to backtrack the optimal link set to obtain an optimal path between the source node and the destination node if the first determination result is yes.

[0019] According to a third aspect of the embodiments of the present application, an electronic device is provided, which includes a processor and a machine readable storage medium, the machine readable storage medium stores machine executable instructions which 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.

[0020] According to a fourth aspect of the embodiments of the present application, a computer readable storage medium is provided, which stores a computer program, and the computer program is executed by a processor to implement the steps of the path optimization method.

[0021] The technical scheme provided by the embodiments of the present application can have the following beneficial effects:

[0022] The embodiment of the present application provides a path optimization method, which simultaneously considers the forward constraint from a source node to a destination node and the reverse constraint from the destination node to the source node when searching for a path, and can find an optimal path satisfying the forward constraint and the reverse constraint. The method has the characteristics of high efficiency and accuracy, and can output a better path meeting actual requirements.

[0023] It should be understood that the foregoing general description and the following detailed description are only exemplary and explanatory and are not restrictive of the present application. BRIEF DESCRIPTION OF DRAWINGS

[0024] The accompanying drawings incorporated in and forming a part of the specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the application.

[0025] Figure 1 A flowchart of a path optimization method provided by the embodiment of the present application is shown in the figure;

[0026] Figure 2 Another flowchart of a path optimization method provided by the embodiment of the present application is shown in the figure;

[0027] Figure 3 A process diagram of a path optimization method provided by the embodiment of the present application is shown in the figure;

[0028] Figure 4 A structure diagram of a path optimization device provided by the embodiment of the present application is shown in the figure;

[0029] Figure 5 A structure diagram of an electronic device provided by the embodiment of the present application is shown in the figure. DETAILED DESCRIPTION

[0030] The exemplary embodiments will be described in detail herein with reference to the attached drawings; figures. The following description is only one of the specific embodiments consistent with the present application. Accordingly, the following detailed description is not representative of all embodiments consistent with the present application.

[0031] The terms used in the present application are only for the purpose of describing specific embodiments, and are not intended to limit the present application. The singular forms "a", "an" and "the" used in the present application and the appended claims are also intended to include the plural forms, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used herein means 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. can be employed in this application to describe various information, the information should not be limited to these terms. These terms are only used to distinguish one piece of information from another piece of information. For example, without departing from the scope of the present application, the first information can also be referred to as the second information, and similarly, the second information can also be referred to as the first information. Depending on the context, the word "if" or "if" as used herein can be interpreted as "when" or "when".

[0033] First, several concepts related to the embodiments of the present application are described:

[0034] Link refers to a directional path between two connected nodes in a network topology;

[0035] Path refers to a set of links between the source node and other nodes (including but not limited to the destination node) in the network topology;

[0036] Constraint condition refers to a restriction condition set for the path / link;

[0037] Evaluation condition refers to an evaluation rule for the link;

[0038] Link evaluation value refers to the evaluation result obtained by evaluating the link according to the given evaluation condition. In the case of link and evaluation condition, the value can be determined;

[0039] Forward and reverse path evaluation value is a value representing the evaluation level of the forward and reverse path from the source node to other nodes. The value is 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 embodiments of the present application provide a path optimization method, which is applied to an SDN controller, as shown in Figure 1 The method can include the following steps:

[0042] S101, initialize the optimal link set to empty, and initialize the target queue including only the source node;

[0043] In the embodiments 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 correspondingly, the optimal path can be understood as a set of optimal links. The optimal path is the path optimization target of the embodiments of the present application, and the optimal link is the path between two adjacent nodes in the optimal path.

[0044] S102, obtain the link evaluation value of all links in the network topology, and initialize the forward and reverse path evaluation value between the source node and any node in the network topology to the lowest value;

[0045] S103, sequentially taking out a node in the target queue as a current node, and modifying a state of the current node to visited;

[0046] S104, judging whether the current node is the destination node to obtain a first judgment result; if the first judgment result is no, then entering S105, otherwise entering S111;

[0047] S105, obtaining a neighbor node of the current node whose state is unvisited, and obtaining one neighbor node at a time until all neighbor nodes of the current node whose state is unvisited are processed, and returning to S103;

[0048] S106, judging whether a link between the current node and the neighbor node satisfies a forward constraint condition to obtain a second judgment result;

[0049] S107, judging whether a link between the neighbor node and the current node satisfies a reverse constraint condition to obtain a third judgment result;

[0050] S108, calculating a forward and reverse path evaluation value between the source node and the neighbor node according to a forward and reverse path evaluation value between the source node and the current node, a link evaluation value of the link between the current node and the neighbor node, and a link evaluation value of the link between the neighbor node and the current node, judging whether the calculated forward and reverse path evaluation value between the source node and the neighbor node is better than a previously recorded forward and reverse path evaluation value between the source node and the neighbor node to obtain a fourth judgment result;

[0051] S109, if the second judgment result, the third judgment result and the fourth judgment result are all yes, then updating the previously recorded forward and reverse path evaluation value between the source node and the neighbor node to the calculated forward and reverse path evaluation value between the source node and the neighbor node, updating an optimal link to the neighbor node in the optimal link set to the link between the current node and the neighbor node, and adding the neighbor node to the target queue;

[0052] The nodes in the target queue are always arranged in an order from high to low of the forward and reverse path evaluation values between the source node and the nodes.

[0053] S110, judging whether the target queue is empty to obtain a fifth judgment result; if the fifth judgment result is no, then returning to execute the step of sequentially taking out a node in the target queue as a current node, and if the fifth judgment result is yes, then indicating that the destination node is not finally reached, i.e. the optimal path between the source node and the destination node is not found, and ending the path optimization process;

[0054] S111, if the first judgment result is yes, then backtracking the optimal link set to obtain the optimal path between the source node and the destination node.

[0055] In the embodiments of the present application, the evaluation condition refers to an evaluation rule for a link. In actual 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 preferred strategy. It can be understood that the link evaluation value obtained by evaluating a link according to different evaluation conditions is different, and the minimum value of the evaluation corresponding to different evaluation conditions is also different. The evaluation condition set for the current path optimization task is referred to as the target evaluation condition in the embodiments of the present application. Therefore, the step of obtaining the link evaluation value 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 minimum value can be specifically as follows:

[0056] According to the target evaluation condition, the link evaluation value of all links in the network topology is calculated, and 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 embodiments of the present application, the constraint condition can be a limit condition set for a path or a limit condition set for a link. In actual applications, any one or more of the following attributes can be selected as the constraint condition: delay, jitter, packet loss rate, bandwidth, and affinity attribute. The affinity attribute refers to optional link, excluded link, and mandatory link. When the constraint condition is set as a constraint condition for a link, the second judgment result and the third judgment result are obtained by the following method:

[0058] It is judged whether the link between the current node and the neighbor node meets the preset forward constraint condition of the link between the current node and the neighbor node, and the second judgment result is obtained. It is judged whether the link between the neighbor node and the current node meets the preset reverse constraint condition of the link between the current node and the neighbor node, and the third judgment result is obtained.

[0059] It can be seen that the subsequent update is continued only when the second judgment result, the third judgment result, and the fourth judgment result are all yes. That is, if any one of the second judgment result, the third judgment result, and the fourth judgment result is no, the other judgment process is unnecessary to be executed. Therefore, the judgment order can be limited to avoid unnecessary judgment process, thereby further improving the path optimization efficiency. Therefore, as a preferred embodiment, the fourth judgment result is obtained by the following method, as shown in Figure 2 .

[0060] S201, a neighbor node whose state is unvisited is obtained, one neighbor node is obtained each time, and all neighbor nodes whose state is unvisited of the current node are processed until all neighbor nodes whose state is unvisited of the current node are processed;

[0061] S202, judging 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, proceeding to S203, otherwise, continuing to process the next neighbor node which is not visited;

[0062] S203, judging whether the link between the neighbor node and the current node satisfies the reverse constraint condition to obtain a third judgment result; if the third judgment result is yes, proceeding to S204, otherwise, continuing to process the next neighbor node which is not visited;

[0063] S204, calculating the forward and reverse path evaluation value between the source node and the neighbor node 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, judging 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; if the fourth judgment result is yes, proceeding to S205, otherwise, continuing to process the next neighbor node which is not visited;

[0064] S205, updating the previously recorded forward and reverse path evaluation value between the source node and the neighbor node as the calculated forward and reverse path evaluation value between the source node and the neighbor node, updating the optimal link to the neighbor node in the optimal link set as the link between the current node and the neighbor node, and adding the neighbor node to the target queue.

[0065] As described above, the forward and reverse path evaluation value between the source node and the neighbor node can be calculated 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. In actual application, different weight values can be set for the forward path and the reverse path to distinguish the importance, therefore, as a preferred embodiment, the forward and reverse path evaluation value between the source node and the neighbor node can be calculated in the following way:

[0066] multiplying the link evaluation value of the link between the current node and the neighbor node by the forward weight to obtain a forward link evaluation value; multiplying the link evaluation value of the link between the neighbor node and the current node by the reverse weight to obtain a reverse link evaluation value; and calculating the forward and reverse path evaluation value between the source node and the neighbor node according to the forward link evaluation value, the reverse link evaluation value, and the forward and reverse path evaluation value between the source node and the current node. As a specific embodiment, the sum of the forward link evaluation value, the reverse link evaluation value, and the forward and reverse path evaluation value between the source node and the current node can be calculated as the forward and reverse path evaluation value between the source node and the neighbor node.

[0067] For link l, let the constraints be C1, C2,..., C n , and the corresponding requirements be S1, S2,..., S n , then link l satisfies the constraint C i . It can be expressed as: C i (l) = S i . Where C i (l) represents the actual value of link l under the constraint C i , and S i represents the ideal value of link l under the constraint C i .

[0068] For the reverse link l R of link l, let the constraints be C R1 , C R2 ,..., C Rn , and the corresponding requirements be S R1 , S R2 ,..., S Rn , then link l R satisfies the constraint C Ri . It can be expressed as: C Ri (l R ) = S Ri . Where C Ri (l R ) represents the actual value of link l R under the constraint C Ri , and S Ri represents the ideal value of link l R under the constraint C Ri .

[0069] An optimal link set is created and initialized as empty. The optimal link set is used to record the optimal link to any node n, which will be 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, which is initialized as the minimum value. Different evaluation conditions set corresponding minimum values. For example, in the case of evaluation condition Metric, the smaller the forward and reverse path evaluation value, the better the path, so Best[n] is initialized as the maximum value.

[0071] Initialize the target queue which only includes the source node. The nodes in the target queue are always arranged in order from high to low according to the forward and reverse path evaluation value. For example, in the case of evaluation condition Metric, the smaller the forward and reverse path evaluation value, the better the path, so the smaller the forward and reverse path evaluation value of a node, the earlier it is in the target queue.

[0072] For link l, after selecting evaluation condition P, the link evaluation value P(l) can be obtained.

[0073] Repeat steps (1) to (5) until the target queue is empty, then proceed to step (6):

[0074] (1) Take the first node in the target queue, that is, the node with the highest evaluation value of the forward and reverse paths, and record it as the current node. Taking the evaluation condition as Metric as an example, take the node with the smallest evaluation value of the forward and reverse paths between the source node as the current node.

[0075] (2) Mark the current node as visited.

[0076] (3) Determine if the current node is the destination node. If it is the destination node, the termination condition is met, and proceed to step (7).

[0077] (4) Get all the neighboring nodes whose status is unvisited for the current node.

[0078] (5) Repeat steps a) to d) until all neighbor nodes in the unvisited state have been traversed, 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 met, proceed to the next step; otherwise, skip the node and continue processing the next neighboring node.

[0080] b) For the reverse link from the neighbor node to the current node curNode... R All constraints C need to be satisfied. Ri (l R ) = S Ri If the condition is met, proceed to the next step; otherwise, skip the node and continue processing the next neighboring 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 l R 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. R}, if the former is better than the latter, then update Best[neighbor] as the forward and backward path evaluation value between the new source node and the neighbor node, i.e. Best[neighbor] = F{Best[curNode], P(l), P(l R}. If the former is not better than the latter, then 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 as the link between the current node and the neighbor node, i.e. cameFrom[neighbor] = l.

[0083] (6) When the target queue is empty, end the path optimization process. The empty target queue indicates that no path from the source node to the destination node satisfying the forward and backward constraint condition is found, and a prompt information that no optimal path is found is outputted.

[0084] (7) Backtrack the path, find the path from the source node to the destination node satisfying the forward and backward constraint condition through the optimal link set, and output the path.

[0085] The following takes the evaluation condition Metric as an example, and further describes the embodiments of the present application with reference to the network topology shown in Figure 3 .

[0086] Figure 3 In the figure, 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, and the smaller the Metric value is, the better the link is; for a path, the path evaluation value in one direction is equal to the sum of the link evaluation values of the links included in the path, and the forward and backward path evaluation value is equal to the weighted sum of the forward path evaluation value and the backward path evaluation value.

[0088] Create the optimal link set and initialize it as an empty set; initialize the forward and backward path evaluation value Best[n] between the source node and any node n as the maximum value; and initialize the target queue including only the source node A.

[0089] Under the evaluation condition Metric, obtain the link evaluation value of each link. For simplifying the calculation process, the embodiment assumes that the link evaluation value of the forward link is equal to the link evaluation value of the backward link. For example, 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 of node A to node B, node C, node D and node E are all initialized to infinity.

[0091] The calculation formula of the forward and reverse path evaluation values between the source node and any node is defined as:

[0092] Best[neighbor] = Best[curNode] + w1M(l) + w2M(l R )

[0093] wherein Best[neighbor] is the forward and reverse path evaluation value between the source node and node neighbor, Best[curNode] is the forward and reverse path evaluation value between the source node and node curNode; link l is the link between node curNode and node neighbor, M(l) is the link evaluation value of the link, i.e. Metric value, 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. Metric value, and w2 is the reverse weight.

[0094] Hereinafter, the forward weight and the reverse weight are both 1.

[0095] The first round of circulation is as follows: taking out node A from the target queue, marking node A as visited, knowing that node A is not the destination node, further obtaining all unvisited neighbor nodes of node A, i.e., node B and node C; for node B, judging whether the link between node A and node B satisfies the preset positive and negative constraint conditions of the link, assuming that the link satisfies the preset positive and negative constraint conditions, calculating the positive and negative path evaluation value between node A and node B according to the above formula, obtaining a calculation result of 20, 20 is less than the previously recorded positive and negative path evaluation value between node A and node B, which is infinite, so node B is added to the target queue, and the link (A, B) is recorded to the optimal link set; for node C, judging whether the link between node A and node C satisfies the preset positive and negative constraint conditions of the link, assuming that the link satisfies the preset positive and negative constraint conditions, calculating the positive and negative path evaluation value between node A and node C according to the above formula, obtaining a calculation result of 4, 4 is less than the previously recorded positive and negative path evaluation value between node A and node C, which is infinite, so node C is added to the target queue, and the link (A, C) is recorded to the optimal link set; at this time, the target queue contains node B and node C, and since the positive and negative path evaluation value between node A and node B is 20, which is greater than the positive and negative path evaluation value between node A and node C, which is 4, node C is located before node B in the target queue.

[0096] The second round of circulation is as follows: taking out node C from the target queue, marking node C as visited, knowing that node C is not the destination node, further obtaining all neighbor nodes of node C, i.e., node B and node A, wherein node A has been marked as visited, so that the only unvisited neighbor node of node C is node B, assuming that the link between node C and node B satisfies the preset positive and negative constraint conditions of the link, calculating the positive and negative path evaluation value between node A and node B, obtaining a calculation result of 14, 14 is less than the previously recorded positive and negative path evaluation value between node A and node B, which is 20, so node B is added to the target queue (in the embodiment of the application, the target queue does not store repeated nodes, so this step is equivalent to no operation), and the link (A, B) in the optimal link set is updated to the link (C, B);

[0097] Taking out node B from the target queue, marking node B as visited, knowing that node B is not the destination node, further obtaining all neighbor nodes of node B, i.e., node A, node C and node D, wherein node A and node C have been marked as visited, so that the only unvisited neighbor node of node B is node D, assuming that the link between node B and node D satisfies the positive and negative constraint conditions of the link, calculating the positive and negative path evaluation value between node A and node D, obtaining a calculation result of 20, 20 is less than the previously recorded positive and negative path evaluation value between node A and node D, which is infinite, so node D is added to the target queue, and the link (B, D) is recorded to the optimal link set. At this time, the round ends.

[0098] The third round of circulation process is as follows: taking out node D from the target queue, marking node D as visited, and knowing that node D is not the destination node, further obtaining all unvisited neighbor nodes of node D, i.e., node E; for node E, judging whether the link between node D and node E satisfies the preset positive and reverse constraint conditions of the link, assuming that it satisfies, calculating the positive and reverse path evaluation value between node A and node E, obtaining the calculation result as 32, which is less than the previously recorded positive and reverse path evaluation value between node A and node E, i.e., infinity, so node E is added to the target queue, and the link (D, E) is recorded to the optimal link set. Thus, this round ends.

[0099] The fourth round of circulation process is as follows: taking out node E from the target queue, marking node E as visited, and knowing that node E is the destination node, satisfying the termination condition. Thus, this round ends.

[0100] Thus, the optimal link set stores the link {(A, C), (C, B), (B, D), (D, E)}, and backtracking is performed on the optimal link set, so that the optimal path between the source node A and the destination node E and satisfying the positive and reverse constraint conditions is obtained, i.e., A->C->B->D->E, which is a positive path, and the corresponding reverse path is E->D->B->C->A.

[0101] As can be seen from the above technical solutions, the embodiment of the application provides a path optimization method, which has at least the following advantages:

[0102] Controllable performance: the path meeting the positive and reverse business consistency is calculated at one time, and on the basis of performance optimization of the algorithm, the efficiency and applicability can be further improved.

[0103] Global optimal path: the global optimal path can be found, which ensures the accuracy of path planning and makes the found path meet the actual demand.

[0104] Comprehensive consideration of bidirectional constraints: the method can calculate the path meeting all the positive and reverse business constraints, and combines the constraint conditions of two directions, so that the found path not only meets the constraint conditions from the source node to the destination node, but also meets the constraint conditions from the destination node to the source node.

[0105] Based on the same inventive concept, the application further provides a path optimization device, which is applied to an SDN controller, and a structure diagram thereof is as shown in Figure 4 The device specifically comprises:

[0106] A first initialization module 401 is configured to initialize the optimal link set as empty and initialize the target queue including only the source node;

[0107] The second initialization module 402 is configured 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 as the lowest;

[0108] The node taking-out module 403 is configured to take out nodes in the target queue as current nodes in sequence, and modify the state of the current node as visited.

[0109] The loop module 404 is configured to determine whether the current node is the destination node, to obtain a first determination result; if the first determination result is no, for each neighbor node of the current node whose state is unvisited, the loop module 404 is configured to 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, calculate the forward and reverse path evaluation values between the source node and the neighbor node 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, determine 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; if the second determination result, the third determination result and the fourth determination result are all yes, the loop module 404 is configured to update the previously recorded forward and reverse path evaluation values between the source node and the neighbor node as 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 as the link between the current node and the neighbor node, and add the neighbor node to the target queue, wherein the nodes in the target queue are arranged in the order of the forward and reverse path evaluation values from the source node to the nodes from high to low.

[0110] The determination module 405 is configured to determine whether the target queue is empty, to obtain a fifth determination result; if the fifth determination result is no, the determination module 405 is configured to trigger the node taking-out module to execute the step of taking out nodes in the target queue as current nodes in sequence.

[0111] The output module 406 is configured to, if the first determination result is yes, backtrack the optimal link set to obtain the optimal path between the source node and 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 by the following manner:

[0113] According to the target evaluation condition, the link evaluation values of all links in the network topology are calculated.

[0114] Correspondingly, the second initialization module 402 initializes the forward and reverse path evaluation values between the source node and any node in the network topology to the lowest value corresponding to the target evaluation condition in the following manner:

[0115] The forward and reverse path evaluation values between the source node and any node in the network topology are initialized to the lowest value corresponding to the target evaluation condition.

[0116] As a specific implementation, the loop module 404 obtains the second judgment result in the following manner:

[0117] The loop module 404 judges whether the link between the current node and the neighbor node meets the preset forward constraint condition of the link between the current node and the neighbor node, and obtains the second judgment result.

[0118] Correspondingly, the loop module 404 obtains the third judgment result in the following manner:

[0119] The loop module 404 judges whether the link between the neighbor node and the current node meets the reverse constraint condition, and obtains the third judgment result.

[0120] As a specific implementation, the loop module 404 obtains the fourth judgment result in the following manner:

[0121] The first judgment unit is configured to, if the first judgment result is no, judge whether the link between the current node and the neighbor node meets the forward constraint condition for each neighbor node whose state is unvisited, and obtain the second judgment result.

[0122] The second judgment unit is configured to, if the second judgment result is yes, judge whether the link between the neighbor node and the current node meets the reverse constraint condition, and obtain the third judgment result.

[0123] The third judgment unit is configured to, if the third judgment result is yes, calculate the forward and reverse path evaluation values between the source node and the neighbor node 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, and judge 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, and obtain the fourth judgment result.

[0124] As a specific implementation, the loop module 404 calculates the forward and reverse path evaluation values between the source node and the neighbor node in the following manner:

[0125] The product of the link evaluation value of the link between the current node and the neighbor node and the forward weight is calculated as a forward link evaluation value; the product of the link evaluation value of the link between the neighbor node and the current node and the reverse weight is calculated as a reverse link evaluation value; and the forward and reverse path evaluation value between the source node and the neighbor node is calculated according to the forward link evaluation value, the reverse link evaluation value, and the forward and reverse path evaluation value between the source node and the current node.

[0126] The embodiments of the present application further provide an electronic device, such as Figure 5 As shown in FIG. 5, the electronic device includes a processor 501 and a machine readable storage medium 502, and the machine readable storage medium 502 stores machine executable instructions which 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 path optimization methods described above.

[0127] The machine readable storage medium described above can include a random access memory (RAM) and can also include a non-volatile memory (NVM), such as at least one disk memory. Optionally, the machine readable storage medium can also be at least one storage device located away from the aforementioned processor.

[0128] The processor described above can be a general processor, including a central processing unit (CPU), a network processor (NP), etc.; can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component.

[0129] In yet another embodiment provided by the present application, a computer readable storage medium is provided, and the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the steps of any of the path optimization methods described above.

[0130] The above merely provides the preferred embodiments of the present application and not for limiting the present application, and any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the scope of protection of the present application.

Claims

1. A path optimization method, characterized in that, The method is applied to an SDN controller, and the method includes: Initialize the optimal link set to empty, and initialize the target queue that only includes source nodes; Obtain the link evaluation value 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; Take out the nodes in the target queue one by one as the current node, and change the status of the current node to "visited"; First, determine if the current node is the destination node, obtaining the first determination result. If the first determination result is not, for each unvisited neighbor node of the current node, determine whether the link between the current node and that neighbor node satisfies the forward constraint condition, obtaining the second determination result. Then, determine whether the link between that neighbor node and the current node satisfies the reverse constraint condition, obtaining the third determination result. Based on the forward and reverse path evaluation values ​​between the source node and the current node, the link evaluation value between the current node and that neighbor node, and the link evaluation value between that neighbor node and the current node, calculate the forward and reverse path evaluation values ​​between the source node and that neighbor node, and determine the calculated link evaluation value between the source node and that neighbor node. The fourth judgment result is obtained by determining whether the forward and reverse path evaluation values ​​between the points are better than the previously recorded forward and reverse path evaluation values ​​between the source node and the neighbor node. If the second, third, and fourth judgment results are all yes, 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. 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. The neighbor node is added to the target queue. The nodes in the target queue are arranged in descending order of forward and reverse path evaluation values ​​between the source node and the node. Determine whether the target queue is empty to obtain the fifth determination result; if the fifth determination result is not, return to the step of sequentially retrieving the nodes in the target queue as the current node; If the first judgment result is yes, then backtrack the optimal link set to obtain the optimal path between the source node and the destination node; The link evaluation value refers to the numerical value obtained by evaluating the link according to the link evaluation rules; The forward and reverse path evaluation values ​​are numerical values ​​that characterize the degree of evaluation of the forward and reverse paths from the source node to other nodes.

2. The method according to claim 1, characterized in that, Obtain the link evaluation values ​​for all links in the network topology, specifically including: Based on the target evaluation conditions, calculate the link evaluation value of all links in the network topology; The evaluation value of the initialization path from the source node to any node in the network topology is minimized in both forward and reverse directions. Specifically, this includes: The evaluation value of the forward and reverse paths from the source node to any node in the network topology is initialized to the lowest value corresponding to the target evaluation condition.

3. The method according to claim 1, characterized in that, Determine whether the link between the current node and its neighboring node satisfies the positive constraint condition to obtain the second determination result, which specifically includes: Determine whether the link between the current node and the neighboring node satisfies the preset positive constraint condition of the link between the current node and the neighboring node, and obtain the second determination result; The third judgment result is obtained by determining whether the link between the neighbor node and the current node satisfies the reverse constraint condition, which specifically includes: Determine whether the link between the neighbor node and the current node satisfies the preset reverse constraint condition of the link between the current node and the neighbor node, and obtain the third judgment result.

4. The method according to claim 1, characterized in that, The fourth judgment result is obtained in the following way: If the first judgment result is negative, then for each neighbor node whose state is unvisited, determine whether the link between the current node and that neighbor node satisfies the positive constraint condition, and obtain the second judgment result. If the second judgment result is yes, then determine whether the link between the neighbor node and the current node satisfies the reverse constraint condition, and obtain the third judgment result; If the third judgment result is yes, then based on the forward and reverse path evaluation values ​​between the source node and the current node, the link evaluation value between the current node and the neighbor node, and the link evaluation value 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 determine 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 the fourth judgment result.

5. The method according to claim 1, characterized in that, Based on the forward and reverse path evaluation values ​​from the source node to the current node, the link evaluation value of the link from the current node to the neighbor node, and the link evaluation value of the link from the neighbor node to the current node, calculate the forward and reverse path evaluation values ​​from the source node to the neighbor node, including: Calculate the link evaluation value of the link from the current node to the neighboring node and the product of the forward weight, as the forward link evaluation value; calculate the link evaluation value of the link from the neighboring node to the current node and the product of the reverse weight, as the reverse link evaluation value; calculate the forward and reverse path evaluation values ​​from the source node to the neighboring node based on the forward link evaluation value, the reverse link evaluation value, and the forward and reverse path evaluation values ​​from the source node to the current node.

6. A path optimization device, characterized in that, The device is used in an SDN controller, and the device includes: The first initialization module is used to initialize the optimal link set to be empty and to initialize the target queue that only includes the source node. The second initialization module is used to obtain the link evaluation value 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 possible value. The node retrieval module is used to sequentially retrieve nodes from the target queue as the current node and modify the status of the current node to "visited". The loop module determines whether the current node is the destination node, obtaining a first determination result. If the first determination result is negative, for each unvisited neighbor node of the current node, it checks whether the link between the current node and that neighbor node satisfies the forward constraint condition, obtaining a second determination result. It then checks whether the link between that neighbor node and the current node satisfies the reverse constraint condition, obtaining a third determination result. Based on the forward and reverse path evaluation values ​​between the source node and the current node, the link evaluation value between the current node and that neighbor node, and the link evaluation value between that neighbor node and the current node, it calculates the forward and reverse path evaluation values ​​between the source node and that neighbor node, and determines the calculated source node to... The fourth judgment result is obtained by determining whether the forward and reverse path evaluation value between the neighboring nodes is better than the previously recorded forward and reverse path evaluation value between the source node and the neighboring node. If the second, third, and fourth judgment results are all yes, the previously recorded forward and reverse path evaluation value between the source node and the neighboring node is updated to the calculated forward and reverse path evaluation value between the source node and the neighboring node. The optimal link to the neighboring node in the optimal link set is updated to the link between the current node and the neighboring node. The neighboring node is added to the target queue. The nodes in the target queue are arranged in descending order of forward and reverse path evaluation value between the source node and the node. The judgment module is used to determine whether the target queue is empty and obtain a fifth judgment result; if the fifth judgment result is not, the node retrieval module is triggered to execute the step of retrieving the nodes in the target queue as the current node in turn; The output module is used to backtrack the optimal link set to obtain the optimal path between the source node and the destination node if the first judgment result is yes. The link evaluation value refers to the numerical value obtained by evaluating the link according to the link evaluation rules; The forward and reverse path evaluation values ​​are numerical values ​​that characterize the degree of evaluation of the forward and reverse paths from the source node to other nodes.

7. The apparatus according to claim 6, characterized in that, The second initialization module obtains the link evaluation values ​​of all links in the network topology in the following ways: Based on the target evaluation conditions, calculate the link evaluation value of all links in the network topology; The second initialization module initializes the forward and reverse path evaluation values ​​between the source node and any node in the network topology to the lowest possible value in the following manner: The evaluation value of the forward and reverse paths from the source node to any node in the network topology is initialized to the lowest value corresponding to the target evaluation condition.

8. The apparatus according to claim 6, characterized in that, The loop module obtains the second judgment result in the following way: Determine whether the link between the current node and the neighboring node satisfies the preset positive constraint condition of the link between the current node and the neighboring node, and obtain the second determination result; The loop module obtains the third judgment result in the following way: Determine whether the link between the neighbor node and the current node satisfies the reverse constraint condition to obtain the third judgment result.

9. The apparatus according to claim 6, characterized in that, The loop module obtains the fourth judgment result through the following unit: The first judgment unit is used to determine whether the link between the current node and each unvisited neighbor node satisfies the positive constraint condition for each unvisited neighbor node of the current node if the first judgment result is negative, and to obtain the second judgment result. The second judgment unit is used to determine whether the link between the neighbor node and the current node satisfies the reverse constraint condition if the second judgment result is yes, and to obtain the 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 between the current node and the neighbor node, and the link evaluation value between the neighbor node and the current node if the third judgment result is yes. It then determines 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 obtains the fourth judgment result.

10. The apparatus according to claim 6, characterized in that, The loop module calculates the forward and reverse path evaluation values ​​between the source node and the neighbor node in the following way: Calculate the link evaluation value of the link from the current node to the neighboring node and the product of the forward weight, as the forward link evaluation value; calculate the link evaluation value of the link from the neighboring node to the current node and the product of the reverse weight, as the reverse link evaluation value; calculate the forward and reverse path evaluation values ​​from the source node to the neighboring node based on the forward link evaluation value, the reverse link evaluation value, and the forward and reverse path evaluation values ​​from the source node to the current node.

11. An electronic device, characterized in that, The method includes a processor and a machine-readable storage medium storing machine-executable instructions that can be executed by the processor, which is prompted by the machine-executable instructions to implement the method of any one of claims 1-5.

12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method of any one of claims 1-5.

Citation Information

Patent Citations

  • Topology control method with high energy efficiency

    CN108616893A

  • Path determination method and device

    CN115277432A