CN108900413B - Routing path selection method, device, electronic equipment and storage medium - Google Patents
Routing path selection method, device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN108900413B CN108900413B CN201810570409.5A CN201810570409A CN108900413B CN 108900413 B CN108900413 B CN 108900413B CN 201810570409 A CN201810570409 A CN 201810570409A CN 108900413 B CN108900413 B CN 108900413B
- Authority
- CN
- China
- Prior art keywords
- routing path
- constraint
- shortest
- constraint condition
- iteration
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/02—Topology update or discovery
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/12—Shortest path evaluation
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/22—Alternate routing
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The embodiment of the invention provides a routing path selection method, a routing path selection device, electronic equipment and a storage medium, wherein the method comprises the following steps: the method comprises the steps of obtaining two limiting conditions, taking a first limiting condition of the two limiting conditions as a first limiting condition, judging whether a routing path meeting the first limiting condition meets a second limiting condition of the two limiting conditions or not when a routing path meeting the first limiting condition exists in a network topology, and determining the routing path meeting the first limiting condition as an optimal routing path when the routing path meeting the first limiting condition meets the second limiting condition of the two limiting conditions. Thereby, the routing path selected in the network topology can completely meet the selected limiting condition.
Description
Technical Field
The present invention relates to the field of software-defined networking technologies, and in particular, to a routing path selection method and apparatus, an electronic device, and a storage medium.
Background
With the advent of SDN, expectations of users for networks are gradually increasing, and users expect that networks can provide different service guarantees, i.e., differentiated services, for different types of data flows. Some common data streams have low requirements on QoS (quality of service), and a common routing algorithm can be used for routing path selection, but some important data streams have strict requirements on QoS, and multiple limiting conditions need to be considered, so how to efficiently and quickly select a reliable routing path meeting the multiple limiting conditions in a complex network according to the multiple limiting conditions provided by a user becomes an urgent problem to be solved.
In the prior art, some researchers have proposed a method for selecting a routing path by an analytic hierarchy process, specifically, the method first constructs a decision matrix including a selected constraint condition according to an importance scale, then calculates an eigenvector of the decision matrix, uses the eigenvector of the decision matrix as a weight value corresponding to the selected constraint condition, then calculates a composite value of the selected constraint condition, and selects a routing path according to the composite value,
however, the inventors found that the prior art has the following problems:
when the routing path is selected by the analytic hierarchy process, the method integrates the selected limiting conditions into a comprehensive value, and then performs routing path selection according to the comprehensive value, and the method cannot ensure that the selected routing path completely meets the selected limiting conditions.
Disclosure of Invention
Embodiments of the present invention provide a routing path selection method, an apparatus, an electronic device, and a storage medium, so as to select a routing path that completely satisfies a selected constraint condition in a network topology. The specific technical scheme is as follows:
in a first aspect, an embodiment of the present invention provides a routing path selection method, which is applied to a network topology, and the method includes:
acquiring two limiting conditions, and judging whether a routing path meeting the first limiting condition exists in the network topology by taking the first limiting condition of the two limiting conditions as the first limiting condition, wherein the first limiting condition is any one of the two limiting conditions;
when a routing path meeting a first constraint condition exists in the network topology, judging whether the routing path meeting the first constraint condition meets a second constraint condition of the two constraint conditions, wherein the second constraint condition is the constraint condition except the first constraint condition in the two constraint conditions;
and when the routing path meeting the first constraint condition meets a second constraint condition of the two constraint conditions, determining the routing path meeting the first constraint condition as the optimal routing path.
Optionally, after determining whether a routing path meeting the first constraint condition exists in the network topology, the routing path selection method according to the embodiment of the present invention further includes:
and when the network topology does not have a routing path meeting the first constraint condition, selecting the optimal routing path in the network topology by adopting an analytic hierarchy process according to the two constraint conditions.
Optionally, after determining whether the routing path meeting the first constraint condition meets a second constraint condition of the two constraint conditions, the routing path selection method according to the embodiment of the present invention further includes:
when the routing path meeting the first constraint condition does not meet a second constraint condition of the two constraint conditions, selecting the routing path meeting the second constraint condition in the network topology by taking the second constraint condition as the second constraint condition;
and calculating the optimal routing path by adopting a Lagrange relaxation algorithm according to the routing path meeting the first constraint condition and the routing path meeting the second constraint condition.
Optionally, calculating an optimal routing path by using a lagrangian relaxation algorithm according to the routing path meeting the first constraint condition and the routing path meeting the second constraint condition, where the method includes:
according to the first shortest routing path p selected at the r-th iterationrAnd a second shortest routing path p selected at the s-th iterationsBy the first formula
Calculating an iteration factor lambda of a Lagrange relaxation algorithm in the j iterationjWherein λ isjIs the iteration factor at the j iteration, c (p)r) Is the first shortest routing path prD (p) ofr) Is the first shortest routing path prC (p) ofs) Second shortest routing path psD (p) ofs) Is the second shortest routing path psThe first routing path information and the second routing path information include: the time delay information of the shortest route and the bandwidth information of the shortest route, j, r and s are integers which are more than or equal to 0, r is more than or equal to 0 and is less than j, s is more than or equal to 0 and is less than j, and when r and s are not 0 simultaneously, r and s are different; when r is 0 and s is 0, prTo satisfy a routing path p of a first constraintc,c(pr)=c(pc),c(pc) To satisfy a routing path p of a first constraintcA first limiting condition of d (p)r)=d(pc),d(pc) To satisfy a routing path p of a first constraintcSecond limitation of psTo satisfy the routing path p of the second constraintd,c(ps)=c(pd),c(pd) To satisfy the routing path p of the second constraintdA first limiting condition of d (p)s)=d(pd),d(pd) To satisfy the routing path p of the second constraintdA second limitation of (1);
obtaining link information of each link in the network topology, and according to the link information and the iteration factor, through a second formula:
calculating the weighted value of each link in the j iterationSelecting a third shortest routing path in the jth iteration through a Dijkstra algorithm according to the weighted value of each link;
judging whether a third shortest routing path in the jth iteration meets a first limiting condition and a second limiting condition;
when the third shortest routing path in the jth iteration meets the first limiting condition and the second limiting condition, determining the third shortest routing path in the jth iteration as the optimal routing path;
when the third shortest route in the j iteration only meets the first limiting condition, the third shortest route in the j iteration is used as the first shortest route p selected in the r iterationrAnd repeatedly executing the first shortest routing path p selected according to the r-th iterationrAnd a second shortest routing path p selected at the s-th iterationsCalculating an iteration factor lambda of the Lagrange relaxation algorithm at the j-th iteration through a first formulaj;
When the third shortest route in the jth iteration only meets the second limiting condition, the third shortest route is taken as the second shortest route p selected in the s-th iterationsAnd repeatedly executing the first shortest routing path p selected according to the r-th iterationrAnd a second shortest routing path p selected at the s-th iterationsCalculating an iteration factor lambda of the Lagrange relaxation algorithm at the j-th iteration through a first formulaj。
Optionally, after determining that the first routing path is the optimal routing path when the first routing path satisfies other restriction conditions except the first restriction condition among the two restriction conditions, the method for selecting a routing path according to the embodiment of the present invention further includes:
acquiring a directed graph of a network topology corresponding to the optimal routing path and a source node and a destination node of the optimal routing path;
acquiring a reverse routing path of the optimal routing path, and correcting the directed graph of the network topology through the reverse routing path of the optimal routing path to obtain a corrected graph of the directed graph of the network topology;
searching a fourth shortest routing path in a correction graph of the network topology directed graph through a Dijkstra algorithm according to a source node and a destination node;
acquiring the same link in the optimal routing path and the fourth shortest routing path, and deleting the same link from the optimal routing path and the fourth shortest routing path respectively to obtain the optimal routing path from which the same link is deleted and the shortest routing path from which the same link is deleted;
and forming two paths by deleting all the links of the optimal routing path of the same link and deleting all the links of the shortest routing path of the same link, and taking the two paths as standby routing paths of the optimal routing path.
In a second aspect, an embodiment of the present invention further provides a routing path selecting apparatus, which is applied to a network topology, and includes:
the first path selection module is used for acquiring two limiting conditions, and judging whether a routing path meeting the first limiting condition exists in the network topology by taking the first limiting condition of the two limiting conditions as the first limiting condition, wherein the first limiting condition is any one of the two limiting conditions;
the first judging module is used for judging whether the routing path meeting the first constraint condition meets a second constraint condition of the two constraint conditions when the routing path meeting the first constraint condition exists in the network topology, wherein the second constraint condition is the constraint condition except the first constraint condition in the two constraint conditions;
and the first optimal path selection module is used for determining the routing path meeting the first constraint condition as the optimal routing path when the routing path meeting the first constraint condition meets a second constraint condition of the two constraint conditions.
Optionally, a routing path selecting apparatus according to an embodiment of the present invention further includes:
and the second optimal path selection module is used for selecting the optimal routing path in the network topology by adopting an analytic hierarchy process according to the two limiting conditions when the routing path meeting the first constraint condition does not exist in the network topology.
Optionally, a routing path selecting apparatus according to an embodiment of the present invention further includes:
the second path selection module is used for selecting a routing path meeting the second constraint condition in the network topology by taking the second constraint condition as the second constraint condition when the routing path meeting the first constraint condition does not meet the second constraint condition of the two constraint conditions;
and the third optimal path selection module is used for calculating an optimal routing path by adopting a Lagrange relaxation algorithm according to the routing path meeting the first constraint condition and the routing path meeting the second constraint condition.
Optionally, the third optimal path selecting module includes:
an iteration factor calculation submodule for calculating the first shortest routing path p according to the first shortest routing path p selected in the r-th iterationrAnd a second shortest routing path p selected at the s-th iterationsBy the first formula
Calculating an iteration factor lambda of a Lagrange relaxation algorithm in the j iterationjWherein λ isjIs the iteration factor at the j iteration, c (p)r) Is the first shortest routing path prD (p) ofr) Is the first shortest routing path prC (p) ofs) Second shortest routing path psD (p) ofs) Is the second shortest routing path psThe first routing path information and the second routing path information include: the time delay information of the shortest route and the bandwidth information of the shortest route, j, r and s are integers which are more than or equal to 0, r is more than or equal to 0 and is less than j, s is more than or equal to 0 and is less than j, and when r and s are not 0 simultaneously, r and s are different; when r is 0 and s is 0, prTo satisfy a routing path p of a first constraintc,c(pr)=c(pc),c(pc) To satisfy a routing path p of a first constraintcA first limiting condition of d (p)r)=d(pc),d(pc) To satisfy a routing path p of a first constraintcSecond limitation of psTo satisfy the routing path p of the second constraintd,c(ps)=c(pd),c(pd) To satisfy the routing path p of the second constraintdA first limiting condition of d (p)s)=d(pd),d(pd) To satisfy the routing path p of the second constraintdA second limitation of (1);
the weighted value calculation submodule is used for acquiring link information of each link in the network topology, and according to the link information and the iteration factor, the weighted value calculation submodule is used for:
calculating the weighted value of each link in the j iterationSelecting a third shortest routing path in the jth iteration through a Dijkstra algorithm according to the weighted value of each link;
the first judgment submodule is used for judging whether the third shortest routing path in the jth iteration meets a first limiting condition and a second limiting condition;
the first optimal path selection sub-module determines a third shortest routing path in the jth iteration as an optimal routing path when the third shortest routing path in the jth iteration meets the first limiting condition and the second limiting condition;
when the third shortest route in the j iteration only meets the first limiting condition, the third shortest route in the j iteration is used as the first shortest route p selected in the r iterationrTriggering an iteration factor calculation submodule;
when the third shortest route in the jth iteration only meets the second limiting condition, the third shortest route is taken as the second shortest route p selected in the s-th iterationsAnd triggering an iteration factor calculation submodule.
Optionally, a routing path selecting apparatus according to an embodiment of the present invention further includes:
the directed graph acquisition module is used for acquiring a directed graph of the network topology corresponding to the optimal routing path and a source node and a destination node of the optimal routing path;
the correction module is used for acquiring the reverse routing path of the optimal routing path and correcting the directed graph of the network topology through the reverse routing path of the optimal routing path to obtain a corrected graph of the directed graph of the network topology;
the shortest path searching module is used for searching a fourth shortest routing path in a correction graph of the network topology directed graph through a Dijkstra algorithm according to the source node and the destination node;
a deleting module, configured to obtain the same link in the optimal routing path and the fourth shortest routing path, and delete the same link from the optimal routing path and the fourth shortest routing path, respectively, to obtain the optimal routing path from which the same link is deleted and the shortest routing path from which the same link is deleted;
and the standby path selection module is used for forming two paths by deleting all the links of the optimal routing path of the same link and deleting all the links of the shortest routing path of the same link, and taking the two paths as standby routing paths of the optimal routing path.
In a third aspect, an embodiment of the present invention further provides an electronic device, where the electronic device includes a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete mutual communication through the communication bus;
a memory for storing a computer program;
and a processor for implementing any of the above routing methods when executing the program stored in the memory.
In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements the routing path selection method described above.
In the routing path selection method, apparatus, electronic device, and storage medium provided in the embodiments of the present invention, when an optimal routing path is selected in a network topology, two constraint conditions may be obtained, and a first constraint condition of the two constraint conditions is used as a first constraint condition to determine whether a routing path meeting the first constraint condition exists in the network topology, when a routing path meeting the first constraint condition exists in the network topology, it is determined whether the routing path meeting the first constraint condition meets a second constraint condition of the two constraint conditions, and when the routing path meeting the first constraint condition meets a second constraint condition of the two constraint conditions, it is determined that the routing path meeting the first constraint condition is the optimal routing path. Thereby, the routing path selected in the network topology can completely meet the selected limiting condition. Of course, not all of the advantages described above need to be achieved at the same time in the practice of any one product or method of the invention.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a flowchart of a first implementation manner of a routing path selection method according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a network topology to which a routing path selection method according to an embodiment of the present invention is applied;
fig. 3 is a flowchart of a second implementation manner of a routing path selection method according to an embodiment of the present invention;
fig. 4 is a flowchart of a routing path selecting method according to a third implementation manner of the embodiment of the present invention;
fig. 5 is a flowchart of a fourth implementation manner of a routing path selection method according to an embodiment of the present invention;
FIG. 6a is a schematic structural diagram of a directed graph of the network topology shown in FIG. 2;
FIG. 6b is a schematic diagram of a modified view of the directed graph of the network topology shown in FIG. 6 a;
fig. 7 is a schematic structural diagram of a routing path selection apparatus according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In order to solve the problems in the prior art, embodiments of the present invention provide a routing path selection method, an apparatus, an electronic device, and a storage medium, so as to select a routing path that completely satisfies a selected constraint condition in a network topology.
Next, a routing path selection method according to an embodiment of the present invention is described first, and as shown in fig. 1, is a flowchart of a first implementation manner of a routing path selection method according to an embodiment of the present invention, and in fig. 1, the method may include:
s110, acquiring two limiting conditions, and judging whether a routing path meeting the first limiting condition exists in the network topology by taking the first limiting condition of the two limiting conditions as the first limiting condition.
Wherein the first constraint is any one of two constraints.
Specifically, in order to transmit a file using a network topology, an optimal routing path may be first selected in the network topology, and then the file may be transmitted according to the selected routing path.
For example, an optimal routing path may be selected in a network topology shown in fig. 2, where fig. 2 is a schematic structural diagram of a network topology to which a routing path selection method according to an embodiment of the present invention is applied, and in fig. 2, the optimal routing path may include a first switching device 110, a second switching device 120, a third switching device 130, a fourth switching device 140, a fifth switching device 150, a sixth switching device 160, a seventh switching device 170, an eighth switching device 180, and a ninth switching device 190. The method can also comprise the following steps: a first link 201, a second link 202, a third link 203, a fourth link 204, a fifth link 205, a sixth link 206, a seventh link 207, an eighth link 208, a ninth link 209, a tenth link 210, an eleventh link 211, a twelfth link 212, a thirteenth link 213, a fourteenth link 214, and a fifteenth link 215.
In some examples, in order to guarantee the transmission quality of the file, when the routing path is selected, a limitation condition may be set in advance, and then an optimal routing path may be selected in the network topology according to the limitation condition.
When selecting the optimal routing path in the network topology according to the restriction condition, the routing path selection method of the embodiment of the present invention may be applied to select the optimal routing path.
Specifically, the user may input network topology information and two limiting conditions in advance into the routing path selection device to which the routing path selection method according to the embodiment of the present invention is applied. Wherein, the network topology information may include: node information in the network topology, link information between every two nodes, the node information may include identification information of the node, and the link information between every two nodes may include: time delay information between every two nodes, bandwidth information between every two nodes, and the like. Therefore, the routing path selection device can acquire the network topology and two restriction conditions corresponding to the network topology.
In some examples, the two constraints described above may be a latency constraint and a bandwidth constraint, respectively.
After obtaining the two limiting conditions, the routing path selecting device may select any one of the two limiting conditions as a constraint condition, that is, select a first limiting condition as a first constraint condition from the two limiting conditions, and then find a routing path that satisfies the first constraint condition in the network topology.
For example, the delay constraint may be selected as a constraint, and a routing path satisfying the delay constraint is selected in the network topology shown in fig. 2. Or selecting the bandwidth limitation condition as a constraint condition, and selecting a routing path meeting the bandwidth limitation condition in the network topology shown in fig. 2.
In some examples, when finding a routing path in the network topology that satisfies the first constraint, a routing path may be randomly selected in the network topology, and then it is determined whether the randomly selected routing path satisfies the first constraint, and when the first constraint is satisfied, the randomly selected routing path is determined as the routing path that satisfies the first constraint.
Otherwise, a routing path is randomly selected again, and whether the first constraint condition is met or not is judged.
Specifically, after selecting a routing path, the routing path selection apparatus may obtain information corresponding to the constraint condition in the link information between every two nodes on the routing path, then sum information corresponding to the constraint condition in all link information on the routing path, and then compare the sum information with the constraint condition to determine whether the first constraint condition is satisfied.
If the constraint condition selected by the routing path selection device is a time delay constraint condition, after a routing path is selected, time delay information between every two nodes on the routing path can be acquired, and then all the time delay information on the routing path is summed to determine whether the constraint condition is met.
S120, when the routing path meeting the first constraint condition exists in the network topology, judging whether the routing path meeting the first constraint condition meets a second constraint condition of the two constraint conditions.
The second constraint condition is a constraint condition other than the first constraint condition in the two constraint conditions.
After the routing path selection device determines that a routing path meeting the first constraint condition exists in the network topology, in order to enable the selected optimal routing path to simultaneously meet the two constraint conditions, in this step, it may be determined whether the routing path meeting the first constraint condition meets the second constraint condition.
It is assumed that the first constraint condition selected by the routing path selection device is a delay constraint condition, and the selected routing path satisfying the first constraint condition is: and the routing path is composed of the first switching device 110, the second link 202, the third switching device 130, the seventh link 207, the fifth switching device 150, the tenth link 210, the seventh switching device 170, the thirteenth link 213 and the ninth switching device 190. In this step, it may be determined whether the routing path satisfies a bandwidth limitation condition.
S130, when the routing path meeting the first constraint condition meets the second constraint condition of the two constraint conditions, determining the routing path meeting the first constraint condition as the optimal routing path.
Specifically, when the routing path selection apparatus determines that the routing path satisfying the first constraint satisfies the second constraint of the two constraints, the routing path satisfying the first constraint satisfies both the first constraint and the second constraint, and thus the routing path satisfying the first constraint can be determined as the optimal routing path.
For example, assuming that the routing path selection apparatus described above satisfies the bandwidth limitation condition after summing the bandwidth information of each link in the routing path satisfying the first constraint condition and comparing the sum with the bandwidth limitation condition, in this step, the routing path composed of the first switching device 110, the second link 202, the third switching device 130, the seventh link 207, the fifth switching device 150, the tenth link 210, the seventh switching device 170, the thirteenth link 213, and the ninth switching device 190, which satisfies the first constraint condition, may be determined as the optimal routing path.
By the routing path selection method of the embodiment of the invention, when the optimal routing path is selected in the network topology, two limiting conditions can be obtained, the first limiting condition of the two limiting conditions is taken as the first constraint condition, whether the routing path meeting the first constraint condition exists in the network topology is judged, when the routing path meeting the first constraint condition exists in the network topology, whether the routing path meeting the first constraint condition meets the second constraint condition of the two limiting conditions is judged, and when the routing path meeting the first constraint condition meets the second constraint condition of the two limiting conditions, the routing path meeting the first constraint condition is determined to be the optimal routing path. Thereby, the routing path selected in the network topology can completely meet the selected limiting condition.
In an optional embodiment of the present invention, on the basis of the routing path selection method shown in fig. 1, a possible implementation manner is further provided in the embodiment of the present invention, as shown in fig. 3, which is a flowchart of a second implementation manner of the routing path selection method in the embodiment of the present invention, and in fig. 3, after determining whether a routing path meeting a first constraint condition exists in a network topology at S110, the routing path selection method in the embodiment of the present invention may further include:
s140, when the network topology does not have the routing path meeting the first constraint condition, selecting the optimal routing path in the network topology by adopting an analytic hierarchy process according to the two constraint conditions.
In some examples, when the routing path selection apparatus determines that there is no routing path satisfying the first constraint condition in the network topology, it may indicate that there is no routing path necessarily satisfying both constraints in the network topology. In view of this, the embodiment of the present invention further provides a possible implementation manner to select the best routing path closest to the above-mentioned constraint.
Specifically, the routing path selection device may locally store an importance scale table shown in table 1, then construct a judgment matrix according to the two limiting conditions and the importance scale table shown in table 1, further calculate a feature vector of the judgment matrix, use the feature vector as a weight value of the two limiting conditions, and finally select a routing path according to a comprehensive value of the calculated weight values of the two limiting conditions. To enable selection of the best routing path closest to the constraints described above.
TABLE 1 Scale of importance ratios
Item of importance | Importance index | Item of importance | Importance index |
Of equal importance | 1 | Is obviously more important | 7 |
Of relative importance | 3 | Of absolute importance | 9 |
Of even greater importance | 5 | Median value | 2,4,6,8 |
In an optional embodiment of the present invention, on the basis of the routing path selection method shown in fig. 1, a possible implementation manner is further provided in the embodiment of the present invention, as shown in fig. 4, which is a flowchart of a third implementation manner of the routing path selection method shown in the embodiment of the present invention, and in fig. 4, after determining, at S120, whether a routing path that satisfies a first constraint condition satisfies a second constraint condition of two constraint conditions, the routing path selection method according to the embodiment of the present invention may further include:
s150, when the routing path meeting the first constraint condition does not meet the second constraint condition of the two constraint conditions, selecting the routing path meeting the second constraint condition in the network topology by taking the second constraint condition as the second constraint condition.
In some examples, after determining the routing path satisfying the first constraint condition, the routing path selecting apparatus may determine whether the routing path satisfying the first constraint condition satisfies the second constraint condition in order to find an optimal routing path satisfying both the first constraint condition and the second constraint condition. When the routing path that satisfies the first constraint condition does not satisfy the second constraint condition, the routing path selection method of the embodiment of the present invention further provides a possible implementation manner.
Specifically, when determining that the routing path that satisfies the first constraint does not satisfy the second constraint, the routing path selection apparatus may select, in the network topology, a routing path that satisfies the second constraint using the second constraint as the second constraint.
For example, the first constraint condition selected by the routing path selection device is a delay constraint condition, and the selected routing path satisfying the first constraint condition is: and the routing path is composed of the first switching device 110, the second link 202, the third switching device 130, the seventh link 207, the fifth switching device 150, the tenth link 210, the seventh switching device 170, the thirteenth link 213 and the ninth switching device 190. In this step, it may be determined whether the routing path satisfies a bandwidth limitation condition. When the routing path that satisfies the first constraint does not satisfy the second constraint, the routing path that satisfies the second constraint may be selected in the network topology shown in fig. 2 with the second constraint as the second constraint.
And S160, calculating the optimal routing path by adopting a Lagrange relaxation algorithm according to the routing path meeting the first constraint condition and the routing path meeting the second constraint condition.
Specifically, after selecting the routing path that satisfies the second constraint condition, the routing path selecting apparatus may calculate the routing path that satisfies both the first constraint condition and the second constraint condition by using a lagrangian relaxation algorithm, that is, calculate the routing path that satisfies both the first constraint condition and the second constraint condition.
For example, it is assumed that the routing path that satisfies the second constraint condition selected by the routing path selecting device is: a routing path composed of the first switching device 110, the third link 203, the fourth switching device 140, the ninth link 209, the sixth switching device 160, the twelfth link 212, the eighth switching device 180, the fifteenth link 215 and the ninth switching device 190, in this step, the routing path selecting means may select, according to the routing path composed of the first switching device 110, the second link 202, the third switching device 130, the seventh link 207, the fifth switching device 150, the tenth link 210, the seventh switching device 170, the thirteenth link 213, and the ninth switching device 190, and a routing path composed of the first switching device 110, the third link 203, the fourth switching device 140, the ninth link 209, the sixth switching device 160, the twelfth link 212, the eighth switching device 180, the fifteenth link 215 and the ninth switching device 190, and calculating an optimal routing path by using a lagrangian relaxation algorithm.
By using the lagrangian relaxation algorithm, a routing path that simultaneously satisfies the two constraints can be selected in the network topology shown in fig. 2, so that the selected optimal routing path can simultaneously satisfy the two constraints.
In some examples, when the optimal routing path is calculated by using a lagrangian relaxation algorithm according to the routing path satisfying the first constraint condition and the routing path satisfying the second constraint condition, the calculation may be performed by:
step A, according to the first shortest route p selected in the r iterationrAnd a second shortest routing path p selected at the s-th iterationsBy the first formula
Calculating an iteration factor lambda of a Lagrange relaxation algorithm in the j iterationj。
Wherein λ isjIs the iteration factor at the j iteration, c (p)r) Is the first shortest routing path prD (p) ofr) Is the first shortest routing path prC (p) ofs) Second shortest routing path psD (p) ofs) Is the second shortest routing path psThe second way ofFrom the path information. j. r and s are integers greater than or equal to 0, r is greater than or equal to 0 and is less than j, s is greater than or equal to 0 and is less than j, and when r and s are not 0 simultaneously, r and s are different.
When r is 0 and s is 0, it means that the routing path selection device has not iterated yet, and p isrTo satisfy a routing path p of a first constraintc,c(pr)=c(pc),c(pc) To satisfy a routing path p of a first constraintcA first limiting condition of d (p)r)=d(pc),d(pc) To satisfy a routing path p of a first constraintcSecond limitation of psTo satisfy the routing path p of the second constraintd,c(ps)=c(pd),c(pd) To satisfy the routing path p of the second constraintdA first limiting condition of d (p)s)=d(pd),d(pd) To satisfy the routing path p of the second constraintdThe second limitation condition of (1).
Step B, link information of each link in the network topology is obtained, and according to the link information and the iteration factor, a second formula is used for:
calculating the weighted value of each link in the j iterationAnd selecting a third shortest routing path in the jth iteration through a Dijkstra algorithm according to the weighted value of each link.
And C, judging whether the third shortest routing path in the jth iteration meets the first limiting condition and the second limiting condition.
And D, when the third shortest route in the jth iteration meets the first limiting condition and the second limiting condition, determining the third shortest route in the jth iteration as the optimal route.
Step E, the third shortest routing path in the jth iteration only meets the first limiting conditionTaking the third shortest route in the jth iteration as the first shortest route p selected in the r iterationrAnd repeatedly executing the first shortest routing path p selected according to the r-th iterationrAnd a second shortest routing path p selected at the s-th iterationsCalculating an iteration factor lambda of the Lagrange relaxation algorithm at the j-th iteration through a first formulaj。
Step F, when the third shortest route in the jth iteration only meets the second limiting condition, taking the third shortest route as the second shortest route p selected in the s-th iterationsAnd repeatedly executing the first shortest routing path p selected according to the r-th iterationrAnd a second shortest routing path p selected at the s-th iterationsCalculating an iteration factor lambda of the Lagrange relaxation algorithm at the j-th iteration through a first formulaj。
In order to more clearly illustrate the embodiment of the present invention, a process of calculating an optimal routing path by using a lagrangian relaxation algorithm according to a routing path satisfying a first constraint and a routing path satisfying a second constraint is described below by taking a first iteration and a second iteration as examples.
When r is 0 and s is 0, it means that when the optimal routing path is calculated by using the lagrange algorithm, no iteration is performed, and p isrTo satisfy a routing path p of a first constraintc,psTo satisfy a routing path p of a first constraintdThus, the first formula described above may be equivalent to the following formula:
wherein, c (p)r)=c(pc),c(pc) To satisfy a routing path p of a first constraintcA first limiting condition of d (p)r)=d(pc),d(pc) To satisfy a routing path p of a first constraintcSecond limitation, c (p)s)=c(pd),c(pd) To satisfy the second approximationBundle conditioned routing path pdA first limiting condition of d (p)s)=d(pd),d(pd) To satisfy the routing path p of the second constraintdA second limitation of (1);
through the formula, the routing path selection device can calculate the initial iteration factor lambda0Then, at least two pieces of link information on each link can be obtained, and the following formula is used for obtaining:
Wherein, ciFirst link information for the ith link, diSecond link information of the ith link.
The routing path selection device calculates the weighted value of each linkThereafter, the weight of each link at iteration 0 may be based onIn the network topology, the shortest routing path is selected by Dijkstra's algorithm.
For example, the routing path selection device may obtain bandwidth information and latency information of fifteen links in the first link 201, the second link 202, the third link 203, the fourth link 204, the fifth link 205, the sixth link 206, the seventh link 207, the eighth link 208, the ninth link 209, the tenth link 210, the eleventh link 211, the twelfth link 212, the thirteenth link 213, the fourteenth link 214, and the fifteenth link 215 in the network topology shown in fig. 2, then perform weighting processing on the latency information and the bandwidth information of each link through the above formula, and further may select the shortest routing path at the 0 th iteration in the network topology shown in fig. 2 through Dijkstra algorithm.
When the routing path selection device determines that the shortest routing path at the 0 th iteration satisfies the first constraint and the second constraint, it indicates that the shortest routing path at the 0 th iteration is the optimal routing path, and therefore, the shortest routing path at the 0 th iteration can be determined as the optimal routing path.
In some examples, when the routing path selection apparatus determines that the shortest routing path in the 0 th iteration only satisfies the first constraint, the embodiment of the present invention further provides a possible implementation manner to search, in an iterative manner, a routing path in the network topology that satisfies both the first constraint and the second constraint.
For example, assuming that the above-described routing path selection apparatus determines that the shortest routing path at the 0 th iteration satisfies only the first constraint condition, the shortest routing path at the 0 th iteration may be set as the routing path satisfying the first constraint condition, and the shortest routing path p selected at the 0 th iteration may be executed0And a routing path that satisfies the second constraint by:
calculating an iteration factor lambda of the Lagrange relaxation algorithm at the 1 st iteration1. Wherein, c (p)0) Is the shortest routing path p0D (p) of0) Is the shortest routing path p0The second routing path information of (1). Wherein the first routing path information and the second routing path information may be the shortest routing path p0Any two of the plurality of routing path information, for example, the first routing path information and the second routing path information may be the shortest routing path p, respectively0Delay information and bandwidth information.
Then according to the iteration factor and the link information of each link in the network topology, a second formula is used for:
calculating the weighted value of each link in the 1 st iterationAnd according to the weighted value of each linkSelecting the shortest routing path p at the 1 st iteration by Dijkstra algorithm1;
Assume that the shortest routing path p of the routing path selection apparatus described above when obtaining the 1 st iteration1And determining the shortest routing path p at the 1 st iteration1If only the second limiting condition is satisfied, the shortest routing path p in the 1 st iteration can be used1As a routing path satisfying the second constraint condition, and the shortest routing path p selected according to the 1 st iteration is executed1And shortest routing path p at iteration 00By the following formula:
calculating an iteration factor lambda at the 2 nd iteration of the Lagrange relaxation algorithm2. Wherein, c (p)1) Is the shortest routing path p1D (p) of1) Is the shortest routing path p1Then according to the iteration factor and the link information of each link in the network topology, according to a second formula:
calculating the weight of each link at iteration 2And according toWeight per linkSelecting the shortest routing path p at the 2 nd iteration by Dijkstra algorithm2。
Suppose that the routing path selection device determines the shortest routing path p in the 2 nd iteration2When the first and second constraints are satisfied, the shortest routing path p at the 2 nd iteration can be determined2And determining as the optimal routing path.
Compared with the mode that only the routing path meeting one limiting condition can be calculated by adopting the Lagrange relaxation algorithm in the prior art, the routing path selecting method can realize that the routing path meeting two limiting conditions simultaneously can be calculated by adopting the Lagrange relaxation algorithm.
In an optional embodiment of the present invention, on the basis of the routing path selection method shown in fig. 1, a possible implementation manner is further provided in the embodiment of the present invention, as shown in fig. 5, which is a flowchart of a fourth implementation manner of the routing path selection method shown in the embodiment of the present invention, in fig. 5, in S130, after determining that the first routing path is the optimal routing path when the first routing path satisfies other restriction conditions except the first restriction condition among the two restriction conditions, the routing path selection method according to the embodiment of the present invention may further include:
s170, obtaining the directed graph of the network topology corresponding to the optimal routing path and the source node and the destination node of the optimal routing path.
In some examples, after determining the optimal routing path, in order to provide a service to a user in time when the optimal routing path fails, the routing path selection apparatus in the embodiment of the present invention may further select a backup path in the network topology, so as to prevent the network topology from being unable to provide a service to the user after the optimal routing path fails.
Specifically, the routing path selection apparatus may obtain a directed graph of a network topology corresponding to the optimal routing path, and a source node and a destination node of the optimal routing path.
For example, if the optimal routing path obtained by the routing path selection apparatus is a routing path composed of routing paths composed of the first switch device 110, the second link 202, the third switch device 130, the eighth link 208, the sixth switch device 160, the twelfth link 212, the eighth switch device 180, the fifteenth link 215, and the ninth switch device 190, and the directed graph of the network topology is shown in fig. 6a, the source node of the optimal routing path is the first switch device 110, and the destination node is the ninth switch device 190.
S180, obtaining the reverse routing path of the optimal routing path, and correcting the directed graph of the network topology through the reverse routing path of the optimal routing path to obtain a corrected graph of the directed graph of the network topology.
Specifically, after obtaining the directed graph of the network topology corresponding to the optimal routing path and the source node and the destination node of the optimal routing path, the routing path selecting apparatus may obtain the reverse routing path of the optimal routing path from the directed graph of the network topology, and modify the directed graph of the network topology through the reverse routing path of the optimal routing path to obtain a modified graph of the directed graph of the network topology.
For example, as shown in fig. 6b, which is a structural diagram of a modified graph of the directed graph of the network topology shown in fig. 6a, in fig. 6b, a reverse routing path may be included, which is composed of the first switching device 110, the reverse link 202 'of the second link 202, the third switching device 130, the reverse link 208' of the eighth link 208, the sixth switching device 160, the reverse link 212 'of the twelfth link 212, the eighth switching device 180, the fifteenth link 215, the reverse link 215', and the ninth switching device 190.
S190, searching a fourth shortest routing path in a correction graph of the network topology directed graph through a Dijkstra algorithm according to the source node and the destination node;
after obtaining the modified graph of the directed graph of the network topology shown in fig. 2, the routing path selection device may search for the fourth shortest routing path in the modified graph of the directed graph of the network topology according to the source node and the destination node through Dijkstra algorithm.
For example, assuming that the modified graph of the directed graph of the network topology is the modified graph shown in fig. 6b, the shortest routing path may be searched in the modified graph shown in fig. 6b by Dijkstra algorithm according to the source node "first switching device 110" and the destination node "ninth switching device 190".
S200, acquiring the same link in the optimal routing path and the shortest routing path, and deleting the same link from the optimal routing path and the shortest routing path respectively to obtain the optimal routing path from which the same link is deleted and the shortest routing path from which the same link is deleted.
Specifically, after finding the fourth shortest routing path from the modified graph of the network topology directed graph, the routing path selecting apparatus may obtain the same link in the optimal routing path and the shortest routing path, and delete the same link from the optimal routing path and the shortest routing path, respectively, to obtain the optimal routing path from which the same link is deleted and the shortest routing path from which the same link is deleted.
For example, assume that the fourth shortest routing path selected by the routing path selection device is: the first switching device 110, the third link 203, the fourth switching device 140, the ninth link 209, the sixth switching device 160, the reverse link 208' of the eighth link 208, the third switching device 130, the seventh link 207, the fifth switching device 150, the tenth link 210, the seventh switching device 170, the thirteenth link 213, and the ninth switching device 190.
The optimal routing path is: and the routing path is composed of routing paths composed of the first switching device 110, the second link 202, the third switching device 130, the eighth link 208, the sixth switching device 160, the twelfth link 212, the eighth switching device 180, the fifteenth link 215 and the ninth switching device 190.
Since the reverse links 208 'of the eighth link 208 and the eighth link 208 are merely opposite in direction, the links can be considered identical, and therefore the reverse links 208' of the eighth link 208 and the eighth link 208 are removed from their respective paths. Resulting in a path that deletes the eighth link 208: first switching device 110, second link 202, third switching device 130, sixth switching device 160, twelfth link 212, eighth switching device 180, fifteenth link 215, ninth switching device 190, deleting the path of reverse link 208' of eighth link 208: first switching device 110, third link 203, fourth switching device 140, ninth link 209, sixth switching device 160, third switching device 130, seventh link 207, fifth switching device 150, tenth link 210, seventh switching device 170, thirteenth link 213, ninth switching device 190.
S210, all links of the optimal routing path with the same links deleted and all links of the shortest routing path with the same links deleted form two paths, and the two paths are used as standby routing paths of the optimal routing path.
After obtaining the optimal routing path from which the same link is deleted and the shortest routing path from which the same link is deleted, the routing path selection apparatus may select two paths as backup routing paths for the optimal routing path according to the optimal routing path from which the same link is deleted and the shortest routing path from which the same link is deleted, so as to provide services by using the backup routing paths when the optimal routing path fails.
For example, the route path selection device described above obtains the path for deleting the eighth link 208: first switching device 110, second link 202, third switching device 130, sixth switching device 160, twelfth link 212, eighth switching device 180, fifteenth link 215, ninth switching device 190. The resulting path of the reverse link 208' with the eighth link 208 deleted is: first switching device 110, third link 203, fourth switching device 140, ninth link 209, sixth switching device 160, third switching device 130, seventh link 207, fifth switching device 150, tenth link 210, seventh switching device 170, thirteenth link 213, ninth switching device 190.
Two paths may be selected as backup routing paths among all links of the path from which eighth link 208 was deleted and all links of the path from which reverse link 208' of eighth link 208 was deleted.
For example, the two paths selected by the routing path selection device may be as shown in the following figures: a path composed of the first switching device 110, the second link 202, the third switching device 130, the seventh link 207, the fifth switching device 150, the tenth link 210, the seventh switching device 170, the thirteenth link 213, and the ninth switching device 190, and a path composed of the first switching device 110, the third link 203, the fourth switching device 140, the ninth link 209, the sixth switching device 160, the twelfth link 212, the eighth switching device 180, the fifteenth link 215, and the ninth switching device 190.
Corresponding to the above method embodiment, an embodiment of the present invention further provides a routing path selecting device, as shown in fig. 7, which is a schematic structural diagram of the routing path selecting device according to the embodiment of the present invention, and in fig. 7, the device may include:
a first path selection module 710, configured to obtain two limiting conditions, and determine whether a routing path meeting the first limiting condition exists in the network topology by using a first limiting condition of the two limiting conditions as the first limiting condition, where the first limiting condition is any one of the two limiting conditions;
a first determining module 720, configured to determine, when a routing path meeting a first constraint condition exists in the network topology, whether the routing path meeting the first constraint condition meets a second constraint condition of the two constraint conditions, where the second constraint condition is a constraint condition, excluding the first constraint condition, of the two constraint conditions;
the first optimal path selecting module 730 is configured to determine, when the routing path that satisfies the first constraint satisfies a second constraint of the two constraints, the routing path that satisfies the first constraint as the optimal routing path.
The routing path selection device provided in the embodiment of the present invention may obtain two limiting conditions when selecting an optimal routing path in a network topology, and determine whether a routing path meeting the first limiting condition exists in the network topology by using a first limiting condition of the two limiting conditions as a first limiting condition, determine whether a routing path meeting the first limiting condition meets a second limiting condition of the two limiting conditions when a routing path meeting the first limiting condition exists in the network topology, and determine that a routing path meeting the first limiting condition is an optimal routing path when a routing path meeting the first limiting condition meets a second limiting condition of the two limiting conditions. Thereby, the routing path selected in the network topology can completely meet the selected limiting condition.
Specifically, the routing path selection apparatus according to the embodiment of the present invention may further include:
and the second optimal path selection module is used for selecting the optimal routing path in the network topology by adopting an analytic hierarchy process according to the two limiting conditions when the routing path meeting the first constraint condition does not exist in the network topology.
Specifically, the routing path selection apparatus according to the embodiment of the present invention may further include:
the second path selection module is used for selecting a routing path meeting the second constraint condition in the network topology by taking the second constraint condition as the second constraint condition when the routing path meeting the first constraint condition does not meet the second constraint condition of the two constraint conditions;
and the third optimal path selection module is used for calculating an optimal routing path by adopting a Lagrange relaxation algorithm according to the routing path meeting the first constraint condition and the routing path meeting the second constraint condition.
Specifically, the third optimal path selecting module may include:
an iteration factor calculation submodule for calculating the first shortest routing path p according to the first shortest routing path p selected in the r-th iterationrAnd a second shortest routing path p selected at the s-th iterationsBy the first formula
Computing an iteration at jth iteration of a Lagrangian relaxation algorithmGeneration factor lambdajWherein λ isjIs the iteration factor at the j iteration, c (p)r) Is the first shortest routing path prD (p) ofr) Is the first shortest routing path prC (p) ofs) Second shortest routing path psD (p) ofs) Is the second shortest routing path psThe first routing path information and the second routing path information include: the time delay information of the shortest route and the bandwidth information of the shortest route, j, r and s are integers which are more than or equal to 0, r is more than or equal to 0 and is less than j, s is more than or equal to 0 and is less than j, and when r and s are not 0 simultaneously, r and s are different; when r is 0 and s is 0, prTo satisfy a routing path p of a first constraintc,c(pr)=c(pc),c(pc) To satisfy a routing path p of a first constraintcA first limiting condition of d (p)r)=d(pc),d(pc) To satisfy a routing path p of a first constraintcSecond limitation of psTo satisfy the routing path p of the second constraintd,c(ps)=c(pd),c(pd) To satisfy the routing path p of the second constraintdA first limiting condition of d (p)s)=d(pd),d(pd) To satisfy the routing path p of the second constraintdA second limitation of (1);
the weighted value calculation submodule is used for acquiring link information of each link in the network topology, and according to the link information and the iteration factor, the weighted value calculation submodule is used for:
calculating the weighted value of each link in the j iterationSelecting a third shortest routing path in the jth iteration through a Dijkstra algorithm according to the weighted value of each link;
the first judgment submodule is used for judging whether the third shortest routing path in the jth iteration meets a first limiting condition and a second limiting condition;
the first optimal path selection sub-module determines a third shortest routing path in the jth iteration as an optimal routing path when the third shortest routing path in the jth iteration meets the first limiting condition and the second limiting condition;
when the third shortest route in the j iteration only meets the first limiting condition, the third shortest route in the j iteration is used as the first shortest route p selected in the r iterationrTriggering an iteration factor calculation submodule;
when the third shortest route in the jth iteration only meets the second limiting condition, the third shortest route is taken as the second shortest route p selected in the s-th iterationsAnd triggering an iteration factor calculation submodule.
Specifically, the routing path selection apparatus according to the embodiment of the present invention may further include:
the directed graph acquisition module is used for acquiring a directed graph of the network topology corresponding to the optimal routing path and a source node and a destination node of the optimal routing path;
the correction module is used for acquiring the reverse routing path of the optimal routing path and correcting the directed graph of the network topology through the reverse routing path of the optimal routing path to obtain a corrected graph of the directed graph of the network topology;
the shortest path searching module is used for searching a fourth shortest routing path in a correction graph of the network topology directed graph through a Dijkstra algorithm according to the source node and the destination node;
a deleting module, configured to obtain the same link in the optimal routing path and the fourth shortest routing path, and delete the same link from the optimal routing path and the fourth shortest routing path, respectively, to obtain the optimal routing path from which the same link is deleted and the shortest routing path from which the same link is deleted;
and the standby path selection module is used for forming two paths by deleting all the links of the optimal routing path of the same link and deleting all the links of the shortest routing path of the same link, and taking the two paths as standby routing paths of the optimal routing path.
An embodiment of the present invention further provides an electronic device, as shown in fig. 8, including a processor 810, a communication interface 820, a memory 830 and a communication bus 840, where the processor 810, the communication interface 820, and the memory 830 complete mutual communication through the communication bus 840,
a memory 830 for storing a computer program;
the processor 810, when executing the program stored in the memory 830, implements the following steps:
acquiring two limiting conditions, and judging whether a routing path meeting the first limiting condition exists in the network topology by taking the first limiting condition of the two limiting conditions as the first limiting condition, wherein the first limiting condition is any one of the two limiting conditions;
when a routing path meeting a first constraint condition exists in the network topology, judging whether the routing path meeting the first constraint condition meets a second constraint condition of the two constraint conditions, wherein the second constraint condition is the constraint condition except the first constraint condition in the two constraint conditions;
and when the routing path meeting the first constraint condition meets a second constraint condition of the two constraint conditions, determining the routing path meeting the first constraint condition as the optimal routing path.
The electronic device provided in the embodiment of the present invention may obtain two limiting conditions when selecting an optimal routing path in a network topology, and determine whether a routing path meeting the first limiting condition exists in the network topology by using a first limiting condition of the two limiting conditions as a first constraint condition, determine whether a routing path meeting the first constraint condition meets a second limiting condition of the two limiting conditions when a routing path meeting the first constraint condition exists in the network topology, and determine that a routing path meeting the first constraint condition is the optimal routing path when a routing path meeting the first constraint condition meets a second limiting condition of the two limiting conditions. Thereby, the routing path selected in the network topology can completely meet the selected limiting condition.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component.
An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the computer program implements any of the above routing path selection methods.
In the computer-readable storage medium provided in the embodiment of the present invention, when an optimal routing path is selected in a network topology, two constraint conditions may be obtained, and a first constraint condition of the two constraint conditions is used as a first constraint condition to determine whether a routing path meeting the first constraint condition exists in the network topology, when a routing path meeting the first constraint condition exists in the network topology, it is determined whether the routing path meeting the first constraint condition meets a second constraint condition of the two constraint conditions, and when the routing path meeting the first constraint condition meets a second constraint condition of the two constraint conditions, the routing path meeting the first constraint condition is determined to be the optimal routing path. Thereby, the routing path selected in the network topology can completely meet the selected limiting condition.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.
Claims (9)
1. A routing path selection method is applied to a network topology, and comprises the following steps:
acquiring two limiting conditions, and judging whether a routing path meeting the first limiting condition exists in the network topology by taking the first limiting condition of the two limiting conditions as the first limiting condition, wherein the first limiting condition is any one of the two limiting conditions;
when a routing path meeting the first constraint condition exists in the network topology, judging whether the routing path meeting the first constraint condition meets a second constraint condition of the two constraint conditions, wherein the second constraint condition is the constraint condition except the first constraint condition in the two constraint conditions;
when the routing path meeting the first constraint condition meets a second constraint condition of the two constraint conditions, determining the routing path meeting the first constraint condition as an optimal routing path;
acquiring a directed graph of the network topology corresponding to the optimal routing path and a source node and a destination node of the optimal routing path;
acquiring a reverse routing path of the optimal routing path, and correcting the directed graph of the network topology through the reverse routing path of the optimal routing path to obtain a corrected graph of the directed graph of the network topology;
searching a fourth shortest routing path in a modified graph of the network topology directed graph through a Dijkstra algorithm according to the source node and the destination node;
obtaining the same link in the optimal routing path and the fourth shortest routing path, and deleting the same link from the optimal routing path and the fourth shortest routing path respectively to obtain the optimal routing path from which the same link is deleted and the shortest routing path from which the same link is deleted;
and forming two paths by using all the links of the optimal routing path with the same links deleted and all the links of the shortest routing path with the same links deleted, and using the two paths as standby routing paths of the optimal routing path.
2. The method of claim 1, wherein after said determining whether a routing path exists in the network topology that satisfies the first constraint, the method further comprises:
and when the network topology does not have a routing path meeting the first constraint condition, selecting the optimal routing path in the network topology by adopting an analytic hierarchy process according to the two constraint conditions.
3. The method according to claim 1, wherein after said determining whether the routing path satisfying the first constraint satisfies a second constraint of the two constraints, the method further comprises:
when the routing path meeting the first constraint condition does not meet a second constraint condition of the two constraint conditions, selecting the routing path meeting the second constraint condition in the network topology by taking the second constraint condition as the second constraint condition;
and calculating the optimal routing path by adopting a Lagrange relaxation algorithm according to the routing path meeting the first constraint condition and the routing path meeting the second constraint condition.
4. The method according to claim 3, wherein said calculating an optimal routing path according to the routing path satisfying the first constraint and the routing path satisfying the second constraint by using a Lagrangian relaxation algorithm comprises:
according to the first shortest routing path p selected at the r-th iterationrAnd a second shortest routing path p selected at the s-th iterationsBy the first formula
Calculating an iteration factor lambda of the Lagrange relaxation algorithm at the jth iterationjWherein, said λjIs an iteration factor at the j iteration, c (p)r) Is the first shortest routing path prThe first routing path information of d (p), the d (p)r) Is the first shortest routing path prThe second routing path information of c (p), saids) Second shortest routing path psThe first routing path information of d (p), the d (p)s) Is the second shortest routing path psThe first routing path information and the second routing path information include: the time delay information of the shortest routing path and the bandwidth information of the shortest routing path, wherein j, r and s are integers which are greater than or equal to 0, r is greater than or equal to 0 and is less than j, s is greater than or equal to 0 and is less than j, and when r is different from s and is not 0, r is different from s; when r is 0 and s is 0, said prFor the routing path p satisfying the first constraint conditioncC (p) ofr)=c(pc) C (p) ofc) For the routing path p satisfying the first constraint conditioncThe first limiting condition of d (p), ther)=d(pc) D (p) ofc) For the routing path p satisfying the first constraint conditioncThe second limiting condition of (1), the psFor the routing path p satisfying the second constraint conditiondC (p) ofs)=c(pd) C (p) ofd) For the routing path p satisfying the second constraint conditiondThe first limiting condition of d (p), thes)=d(pd) D (p) ofd) For the routing path p satisfying the second constraint conditiondA second limitation of (1);
obtaining link information of each link in the network topology, and according to the link information and the iteration factor, through a second formula:
calculate the j-th timeWeight per link in iterationAnd selecting a third shortest routing path in the jth iteration by a Dijkstra algorithm according to the weighted value of each link, wherein c isiFirst link information for the ith link, said diSecond link information of the ith link;
judging whether a third shortest routing path in the jth iteration meets a first limiting condition and a second limiting condition;
determining a third shortest routing path at the jth iteration as the optimal routing path when the third shortest routing path at the jth iteration meets a first constraint and the second constraint;
when the third shortest routing path in the jth iteration only meets the first limiting condition, the third shortest routing path in the jth iteration is taken as the first shortest routing path p selected in the r iterationrAnd repeatedly executing the first shortest routing path p selected according to the r-th iterationrAnd a second shortest routing path p selected at the s-th iterationsCalculating an iteration factor lambda of the Lagrange relaxation algorithm at the j-th iteration through a first formulaj;
When the third shortest route in the jth iteration only meets the second limiting condition, the third shortest route is taken as the second shortest route p selected in the s-th iterationsAnd repeatedly executing the first shortest routing path p selected according to the r-th iterationrAnd a second shortest routing path p selected at the s-th iterationsCalculating an iteration factor lambda of the Lagrange relaxation algorithm at the j-th iteration through a first formulaj。
5. A routing path selection apparatus, applied in a network topology, the apparatus comprising:
a first path selection module, configured to obtain two limiting conditions, and determine whether a routing path meeting the first limiting condition exists in the network topology by using a first limiting condition of the two limiting conditions as a first limiting condition, where the first limiting condition is any one of the two limiting conditions;
a first determining module, configured to determine, when a routing path that satisfies the first constraint condition exists in the network topology, whether the routing path that satisfies the first constraint condition satisfies a second constraint condition of the two constraint conditions, where the second constraint condition is a constraint condition of the two constraint conditions except the first constraint condition;
a first optimal path selection module, configured to determine, when the routing path that satisfies the first constraint satisfies a second constraint of the two constraints, that the routing path that satisfies the first constraint is an optimal routing path;
the directed graph acquisition module is used for acquiring a directed graph of the network topology corresponding to the optimal routing path and a source node and a destination node of the optimal routing path;
the correction module is used for acquiring the reverse routing path of the optimal routing path and correcting the directed graph of the network topology through the reverse routing path of the optimal routing path to obtain a corrected graph of the directed graph of the network topology;
the shortest path searching module is used for searching a fourth shortest routing path in a correction graph of the network topology directed graph through a Dijkstra algorithm according to the source node and the destination node;
a deleting module, configured to obtain the same link in the optimal routing path and the fourth shortest routing path, and delete the same link from the optimal routing path and the fourth shortest routing path, respectively, to obtain the optimal routing path from which the same link is deleted and the shortest routing path from which the same link is deleted;
and the standby path selection module is used for forming two paths by deleting all the links of the optimal routing path of the same link and deleting all the links of the shortest routing path of the same link, and taking the two paths as standby routing paths of the optimal routing path.
6. The apparatus of claim 5, further comprising:
and the second optimal path selection module is used for selecting an optimal routing path in the network topology by adopting an analytic hierarchy process according to the two limiting conditions when no routing path meeting the first constraint condition exists in the network topology.
7. The apparatus of claim 5, further comprising:
a second path selection module, configured to select, when the routing path that satisfies the first constraint condition does not satisfy a second constraint condition of the two constraint conditions, a routing path that satisfies the second constraint condition in the network topology by using the second constraint condition as the second constraint condition;
and the third optimal path selection module is used for calculating an optimal routing path by adopting a Lagrange relaxation algorithm according to the routing path meeting the first constraint condition and the routing path meeting the second constraint condition.
8. An electronic device is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing mutual communication by the memory through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any of claims 1 to 4 when executing a program stored in the memory.
9. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method steps of any one of claims 1 to 4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810570409.5A CN108900413B (en) | 2018-06-05 | 2018-06-05 | Routing path selection method, device, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810570409.5A CN108900413B (en) | 2018-06-05 | 2018-06-05 | Routing path selection method, device, electronic equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108900413A CN108900413A (en) | 2018-11-27 |
CN108900413B true CN108900413B (en) | 2020-10-02 |
Family
ID=64344395
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810570409.5A Active CN108900413B (en) | 2018-06-05 | 2018-06-05 | Routing path selection method, device, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108900413B (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2020142873A1 (en) | 2019-01-07 | 2020-07-16 | 华为技术有限公司 | Method, device and system for controlling route iteration |
CN110611620B (en) * | 2019-09-29 | 2021-11-05 | 新华三信息安全技术有限公司 | Link updating method and device |
CN111404815B (en) * | 2020-03-06 | 2021-03-16 | 武汉大学 | Constrained routing method based on deep learning |
CN113595902A (en) * | 2020-04-30 | 2021-11-02 | 华为技术有限公司 | Routing method and network equipment based on border gateway protocol |
CN111866986B (en) * | 2020-08-03 | 2022-04-29 | 苏州卓智创芯电子科技有限公司 | Route self-adaptive forming method of wireless MESH internet of things |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6996065B2 (en) * | 2000-07-06 | 2006-02-07 | Lucent Technologies Inc. | Dynamic backup routing of network tunnel paths for local restoration in a packet network |
CN102281200A (en) * | 2011-08-24 | 2011-12-14 | 华为技术有限公司 | Method for selecting current backup route and router |
CN103871090A (en) * | 2012-12-17 | 2014-06-18 | 北京大学 | Interactive path generating method and system |
CN105471764A (en) * | 2015-11-16 | 2016-04-06 | 中国科学院信息工程研究所 | Method for guaranteeing end-to-end QoS in SDN network |
US10560367B2 (en) * | 2016-01-18 | 2020-02-11 | Nokia Of America Corporation | Bidirectional constrained path search |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102664802B (en) * | 2012-04-20 | 2014-10-22 | 同济大学 | Self-adaptive multi-constraint path searching method based on feedback |
US9565689B2 (en) * | 2013-10-23 | 2017-02-07 | Texas Instruments Incorporated | Near-optimal QoS-based resource allocation for hybrid-medium communication networks |
CN105357068B (en) * | 2015-11-03 | 2018-06-12 | 华中科技大学 | The OpenFlow method for controlling network flow that a kind of application-oriented QoS is ensured |
CN107896192B (en) * | 2017-11-20 | 2020-09-25 | 电子科技大学 | QoS control method for differentiating service priority in SDN network |
-
2018
- 2018-06-05 CN CN201810570409.5A patent/CN108900413B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6996065B2 (en) * | 2000-07-06 | 2006-02-07 | Lucent Technologies Inc. | Dynamic backup routing of network tunnel paths for local restoration in a packet network |
CN102281200A (en) * | 2011-08-24 | 2011-12-14 | 华为技术有限公司 | Method for selecting current backup route and router |
CN103871090A (en) * | 2012-12-17 | 2014-06-18 | 北京大学 | Interactive path generating method and system |
CN105471764A (en) * | 2015-11-16 | 2016-04-06 | 中国科学院信息工程研究所 | Method for guaranteeing end-to-end QoS in SDN network |
US10560367B2 (en) * | 2016-01-18 | 2020-02-11 | Nokia Of America Corporation | Bidirectional constrained path search |
Also Published As
Publication number | Publication date |
---|---|
CN108900413A (en) | 2018-11-27 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108900413B (en) | Routing path selection method, device, electronic equipment and storage medium | |
Lattimore et al. | An information-theoretic approach to minimax regret in partial monitoring | |
US7072304B2 (en) | Network path selection based on bandwidth | |
CN107454019B (en) | Dynamic bandwidth allocation method, device, equipment and storage medium for software defined network | |
CN107196858B (en) | K shortest path solving method considering multi-type constraints | |
Clímaco et al. | Multicriteria path and tree problems: discussion on exact algorithms and applications | |
CN111083050B (en) | Data stream transmission method and device based on software defined network | |
US5577030A (en) | Data communication routing method and device | |
CN111181792B (en) | SDN controller deployment method and device based on network topology and electronic equipment | |
CN106095974B (en) | Recommendation system score prediction and recommendation algorithm based on network structure similarity | |
Arapostathis et al. | Ergodic diffusion control of multiclass multi-pool networks in the Halfin–Whitt regime | |
CN108400935B (en) | Genetic algorithm-based service path selection method and device and electronic equipment | |
Charilas et al. | A unified network selection framework using principal component analysis and multi attribute decision making | |
US20180349738A1 (en) | Region linear model optimization system, method and program | |
CN109996133B (en) | Optical network planning method and device, electronic equipment and storage medium | |
CN109952742B (en) | Graph structure processing method, system, network device and storage medium | |
JP4136970B2 (en) | Alternative route determination method in wireless mesh network | |
CN114417184A (en) | Seed node screening method, device, equipment and storage medium | |
CN108737902B (en) | Associated video updating method and device and electronic equipment | |
CN110166362B (en) | Service function graph low-delay mapping method based on node screening | |
JP5595342B2 (en) | Multiple path search method and apparatus | |
CN109104453B (en) | Sensor evaluation server and sensor evaluation method | |
Van Bemten et al. | Routing metrics depending on previous edges: The Mn taxonomy and its corresponding solutions | |
TWI637330B (en) | Project management method and system thereof | |
Nakaniwa et al. | Reliability-based mirroring of servers in distributed networks |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |