Disclosure of Invention
The invention aims to provide a multi-target controller placement method based on evolution sensing in a network aiming at the defects of the prior art, so as to improve the performance of a control network, reduce the propagation delay of the control network, promote the reasonable utilization of the storage resources of a controller and optimize the placement cost of the control network.
In order to achieve the purpose, the technical idea of the invention is as follows: the propagation delay of the control network is obtained by weighting and summing the propagation delay from the controller to the controlled switch and the propagation delay between the controllers, so that the delay performance of the control network is more comprehensively optimized; calculating the load difference of the controller through the extreme difference of the number of the switches to which the controller belongs so as to promote the reasonable utilization of the storage resources of the controller; the placement cost of the control network is balanced by reducing the number of controllers to continuously optimize the placement scheme in subsequent operations, which is implemented by the following steps:
(1) initialize Internet OS3E network information and method settings information:
initializing Internet OS3E network information, including setting network node longitudeλ
iAnd latitude
Network topology node total number N and source node A of direct link
iAnd a sink node O
iI is 1,2, … …, N;
initializing set information, including setting population size Num, upper limit of controller number maxCNum, evolution perception threshold tau, two differential evolution step length F1And F2Neighborhood range delta, weight vector f and maximum evolution algebra Gmax;
(2) Calculating the length L (A) of the links in the Internet OS3E network topologyi,Oi);
(3) Generating an initial population:
3a) generating an initial population P1 of the first half scale according to the initialization setting information;
3b) according to the length L (A) of the link in the Internet OS3E network topologyi,Oi) Initializing setting information to generate an initial population P2 of the second half scale;
3c) combining the initial populations P1 and P2 generated by 3a) and 3b) to obtain a complete initial population: p
0P1 ═ u P2, in the current population
Each representing a controller deployment scenario in which G
eneFor the current evolution algebra, G
eneIs 0,1, 2, … …, G
max;
(4) Iterative evolution of the current population:
4a) for the current population
Performing non-dominant sorting to obtain the current population
Pareto solution set of;
4b) calculating an evolutionary algebra perception coefficient g;
4c) the current population
The coding mode is converted from binary coding to Gray code to obtain the current population in the form of Gray code
4d) Current population in the form of a corresponding gray code
Evolution is carried out:
4d1) judging whether the evolution algebraic perception coefficient g obtained in the step 4b) is less than or equal to an evolution perception threshold tau: if so, perform 4d2), otherwise, perform 4d 3);
4d2) evolving a current population in Gray code form using an evolutionary algorithm based on non-dominated sorting
4d3) Evolving current populations in Gray code form using multi-objective decomposition-based algorithms
5) For the current population
And (3) carrying out validity check, and correcting illegal individuals:
5a) the total number of controllers that need to be deployed for the deployment scenario represented by all individuals, C, is calculated and compared to the number of Internet OS3E network nodes:
if C is larger than half of the total number of the network nodes of Internet OS3E, judging the illegal individual U, and correcting the illegal individual U to obtain a corrected individual U';
if C is less than or equal to half of the total number of the Internet OS3E network nodes, judging the legality of the next individual, and executing 5b) until the legality of all the individuals is judged;
5b) and (3) iteration stop judgment: if the current evolution algebra reaches G
eneTo the maximum algebra G
maxIf so, terminating the iteration to obtain the next generation population
Executing (6), otherwise, returning to (4);
(6) according to the next generation population
And calculating to obtain an approximate optimal controller placement scheme set R, and placing the controller according to each scheme in the placement scheme set.
Compared with the prior art, the invention has the following advantages:
firstly, the initial population P1 of the first half scale is generated according to the initialization setting information, so that the diversity of the initial population is improved; due to the length L (A) of the links in the network topology according to Internet OS3Ei,Oi) Initializing the setting information to generate an initial population P2 of the second half scale, thereby enhancing the convergence of the initial population; in addition, the two parts of initial populations are combined to obtain a complete initial population, so that an initial population with better diversity and convergence can be obtained, and convenience is provided for the next step of evolution operation.
Secondly, a more appropriate evolution mode is selected according to the evolution algebra perception coefficient g, and when the evolution algebra perception coefficient g is smaller, the current population in the form of the Gray code is evolved by using an evolution algorithm based on non-dominated sorting
The distribution of the population is improved; when the evolution algebra perception coefficient g is larger, the current population in the form of Gray code is evolved by using a multi-objective decomposition algorithm
The convergence of the population is improved, so that the population can be promoted to evolve towards a better direction, the performance of a higher control network can be conveniently obtained, and the lower control is realizedThe controller placement scheme set is used for controlling network propagation delay, more reasonably configuring the storage resources of the controller and reducing the placement cost of the controller.
Third, the present invention is in the current population
Before evolution, individual coding modes are converted into Gray codes, so that the global search capability of the current population is enhanced, and the current population is prevented from being searched
Trapping into a local optimal solution; in the current population
After evolution, the coding mode of the individual is converted into binary coding, thereby providing convenience for the selection of the next generation of individual.
Detailed Description
Embodiments and effects of the present invention are described in further detail below with reference to the accompanying drawings.
Referring to fig. 1, the present example is implemented based on various improved mechanisms, and the specific steps are as follows:
step 1: the Internet OS3E network information and method setting information are initialized.
1.1) initializing Internet OS3E network information, which includes setting network node longitude λ
iAnd latitude
Network topology node total number N, source node A of direct link
iAnd a sink node O
iI is a number of 1,2,……,N;
1.2) initializing the setting information, including setting the population size Num, the upper limit of the controller number maxCNum, the evolution perception threshold tau, and two differential evolution steps F1And F2Neighborhood range delta, weight vector f and maximum evolution algebra Gmax。
The example is set according to simulation experiments, but not limited to, Num 100, evolution perception threshold τ 0.4, maximum evolution algebra Gmax100, 34 of total number of network topology nodes N, and differential evolution step length F10.3 and F20.6, 10 neighborhood range δ, 30 weight vector Γ.
Step 2: calculating the length L (A) of the links in the Internet OS3E network topologyi,Oi) And finds the shortest path between any two nodes in the Internet OS3E network topology.
The Internet OS3E network, an american backbone, is widely used for simulation studies of controller placement problems where link lengths need to be calculated.
2.1) calculating the length of the link in the Internet OS3E network topology according to the initialization parameters by using the following hemiversine formula:
in the formula R
earthRepresenting the radius of the earth, by a value R
earth=6400km,
Represents the ith source node A
iThe longitude of (a) is determined,
represents the ith source node A
iThe latitude of (a) is determined,
represents the ith sink node O
iThe longitude of (a) is determined,
represents the ith sink node O
iLatitude, L (A)
i,O
i) Represents the ith source node A
iAnd the ith sink node O
iThe length of the direct link between the two links, i is 1,2, … …, N;
2.2) find the shortest circuit between any two nodes in the Internet OS3E network topology:
the existing method for determining the shortest path between any two nodes in the Internet OS3E network topology includes a Floyd algorithm and a Dijkstra algorithm, and the present embodiment selects, but is not limited to, the Floyd algorithm, which is implemented as follows:
will be input into the Internet OS3E network topology network ith node longitude lambda
iLatitude and longitude
Number N of Internet OS3E network topology nodes, ith source node A
iAnd the ith sink node O
iLength of direct link between L (A)
i,O
i) These parameters are input to the algorithm Floyd algorithm;
calculating and outputting a shortest circuit set S between any two nodes i and d in the Internet OS3E network topology through MATLAB softwareidI, d ≠ 1,2, … …, N, and i ≠ d.
And step 3: and generating an initial population.
Referring to fig. 2, the specific implementation of this step is as follows:
3.1) generating the initial population P1 of the first half scale according to the initialization setting information:
3.1.1) calculating the group number setIndex (q) of the qth individual in the first half-scale initial population P1:
wherein q is 1,2, …, Num' represents half of population scale, and takes value
3.1.2) setting the locus judgment threshold value alpha (q) of the qth individual according to the group number setIndex (q):
3.1.3) determining the ith locus P (q, i) of the individual q on the basis of the locus discrimination threshold α (q):
wherein, er represents a random number ranging between (0,1), all gene positions are sequentially determined, all gene positions P (q, i) of an individual q are determined, i is 1,2, …, and N is the individual q;
3.1.4) repeating steps 3.1.1) -3.1.3) until q equals Num', generating the first half-size initial population P1.
3.2) generating the second half-scale initial population P2:
3.2.1) randomly generating a random number Ccenter in the range of (0, maxNum)qNumber of clustering centers Ccenter for the qth individualq,q=1,2,…,Num';
3.2.2) input Internet OS3E network topology network node longitude λ using k-means clustering algorithm
iLatitude and longitude
Internet OS3E network topology node number N, and clustering center number Ccenter
qSource node A
iAnd a sink node O
iLength of direct link between L (A)
i,O
i) And outputting a controller deployment scheme, namely finishing the initialization of the qth individual, wherein the value of i is 1,2, … …, N,
3.2.3) repeating steps 3.2.1) -3.2.2) until q equals Num', the second half-size initial population P2 is generated.
3.3) combining the initial populations P1 and P2 generated in 3.1) and 3.2), namely taking the union of the two initial populations to obtain the complete populationInitial population of (a): p0=P1∪P2。
And 4, step 4: and (5) iteratively evolving the current population.
Referring to fig. 3, the specific implementation of this step is as follows:
4.1) to the current population
Performing non-dominant sorting to obtain the current population
Pareto solution set of; in the current population
Each representing a controller deployment scenario in which G
eneFor the current evolution algebra, G
eneIs 0,1, 2, … …, G
max;
4.2) calculating an evolutionary algebraic perceptual coefficient g by the following formula:
wherein G iseneRepresenting the current evolution algebra, GmaxRepresenting the maximum evolutionary algebra.
4.3) matching the current population
The coding mode is converted from binary coding to Gray code to obtain the current population in the form of Gray code
4.4) Current population in the form of Pair Gray codes
Evolution is carried out:
4.4.1) judging whether the evolution algebraic perception coefficient g obtained in the step 4.2) is less than or equal to the evolution perception threshold tau:
if so, then 4.4.2 is executed),
otherwise, execute 4.4.3);
4.4.2) evolution of the current population in Gray code form using an evolutionary algorithm based on non-dominated sorting
4.4.2a) sequentially from the current population in Gray code form
Randomly selects two parent individuals y1 in the nt group
ntAnd y2
ntAnd performing single-point crossing and single-point mutation on the two parent individuals to obtain a child individual y1
rt' and y2
nt',nt=1,2,……,Num;
4.4.2b) repeat step 4.4.2a) until nt ═ Num, generating the offspring population PG of size Num gray code formoff={y1nt',nt=1,2,…,Num};
4.4.2c) Subsubstitution PG in Gray code form
offThe encoding mode of the method is converted from Gray code encoding into binary encoding to obtain a filial generation population P
offAnd comparing the current population
And a progeny population P
offThe whole population is obtained by merging,
get the current population immediately
And a progeny population P
offA union of (1);
4.4.2d) Overall population
Performing non-dominant sorting to obtain the next generation population
4.4.3) Using Multi-target decomposition Algorithm based on the present population in the form of Gray codes
Evolution is carried out:
4.4.3a) from the Current population
R1 of the two parent individuals of the nt group
ntAnd r2
ntAnd from the current population
Randomly selecting an individual p in the Pareto solution set, and generating the nt group of evolved individuals r by the following formula
nt':
rnt'=rnt+F1·(r1nt-r2nt)+F2·(p-r1nt),
Wherein r isntRepresents the nt group of individuals to be evolved, nt is 1,2, … …, Num;
4.4.3b) Subjects rntThe coding mode of the' is converted from Gray code coding to binary coding to obtain evolved individual offnt,nt=1,2,…,Num;
4.4.3c) repeat steps 4.4.3a) -4.4.3 b) until nt ═ Num, yielding the next generation population
And 5: for the next generation population
And carrying out validity check to obtain the corrected individual U'.
5.1) calculating the total number C of the controllers needing to be deployed in the deployment scheme represented by all the individuals:
5.1.1) from the Next Generation population
The nth individual is taken out, and the total controller number C required by the deployment scheme represented by the nth individual is calculated
nt:
Cnt=sum(nt),nt=1,2,…,Num;
5.1.2) repeating the step 5.1.1) until nt ═ Num, obtaining the total number of controllers which need to be deployed for the deployment scheme represented by all individuals: c ═ Cnt,nt=1,2,…,Num};
5.2) verifying the legality of all individuals in the current population:
the total number C of the controllers which need to be deployed in the deployment scheme represented by all the individuals is compared with the number of Internet OS3E network nodes:
if C is larger than half of the total number of the network nodes of Internet OS3E, judging the illegal individual U, correcting the illegal individual U, and executing 5.3);
if C is less than or equal to half of the total number of the Internet OS3E network nodes, judging the legality of the next individual, and executing 5.4) until the legality of all the individuals is judged;
5.3) correcting illegal individuals:
5.3.1) calculating the ith locus Dis (i) of the perturbation vector:
5.3.2) according to different gene positions Dis (i) and gene positions U (i) of the illegal individuals, the gene positions of the illegal individuals are corrected as follows:
wherein U ' (i) denotes the ith gene position of the legal individual after correction, U (i) denotes the ith gene position of the illegal individual, U (i) + Dis (i) denotes the sum of the U of the illegal individual and the ith gene position of the perturbation vector Dis, when U (i) + Dis (i) is 1, U ' (i) is 1, that is, the controller is to be placed in the network node corresponding to the ith gene position, otherwise, U ' (i) is 0, that is, the controller is not to be placed in the network node corresponding to the ith gene position;
5.3.3) obtaining the corrected legal individual U ' ═ { U ' (i), i ═ 1,2, …, N } from all the gene positions U ' (i) of the corrected legal individual.
5.4) judging iteration stop: if the current evolution algebra reaches G
eneTo the maximum algebra G
maxIf so, terminating the iteration to obtain the next generation population
Step 6 is executed, otherwise, the
step 4 is returned;
step 6: according to the next generation population
And calculating to obtain an approximate optimal controller placement scheme set R.
6.1) for the next generation population
Performing non-dominant sorting to obtain the next generation population
A corresponding Pareto solution set, namely an approximate optimal controller placement scheme set R;
6.2) selecting kth individual x from the approximate optimal controller placement solution set RktRespectively connecting kth individual xktThe controller placement scheme represented is applied to the Internet OS3E network, kt ═ 1,2, … …, | R |;
6.3) repeat step 6.2) until kt ═ R |, completing the application of all controller placement schemes.
The effects of the present invention can be further illustrated by the following simulations:
firstly, simulation conditions:
condition 1: the population scale Num of the multi-target differential evolution algorithm MOEA/D based on decomposition is set as 100, and an evolution algebra Gmax100, cross probabilityPc0.9, probability of mutation Pm0.9, difference coefficient F10.3 and F2=0.3;
Condition 2: population size Num of multi-objective evolutionary algorithm NSGA-II (non-dominated sorting) based on elite selection strategy is 100, and evolution algebra Gmax100, cross probability Pc0.9, probability of mutation Pm=0.9。
Simulation software: MATLAB software was used.
Secondly, simulation content:
simulation 1, simulating the placement positions of the multi-target controller by using the method, solving the obtained approximate optimal controller placement scheme set R, and calculating all optimal placement scheme optimization target values F (x) through the following steps:
firstly, computing kth individual x in an approximate optimal controller placement scheme set RktThe objective function value of (1):
F(xkt)=(fM(xkt),fD(xkt),fL(xkt))T,
wherein f isM(xkt)=sum(xkt) Representing kth individual xktThe cost of placement of (1), (2), (… …), (R) |;
fD(xkt)=max(xkt)-min(xkt) Representing kth individual xktThe load difference of (2);
representing kth individual x
ktMaximum propagation delay, beta
1And beta
2V represents the average propagation velocity of light in the network for two propagation delay weight coefficients, in this example taken as beta
1=β
2=0.5,v=2×10
8m/s, i, d ≠ 1,2, … …, N, and i ≠ d;
repeating the calculation until kt is equal to | R |, and obtaining the objective function value F of all placement schemes of the simulation approximate optimal controller placement scheme set R1(x)={F(xkt) Is F of the formula1(x) Is aAnd 108 rows and 3 columns of matrix.
Simulating 2, simulating the placement positions of the multi-target controllers by using the existing multi-target differential evolution algorithm MOEA/D based on decomposition under the condition 1, solving the obtained approximate optimal controller placement scheme set R, and calculating all optimal placement scheme optimization target values F of the approximate optimal controller placement scheme set R2(x) The calculation procedure is the same as in simulation 1. Calculated F2(x) Is a matrix of 95 rows and 3 columns.
And 3, simulating the placement positions of the multi-target controllers by using the existing multi-target evolutionary algorithm NSGA-II based on non-dominated sorting and elite selection strategies under the condition 2, solving the obtained approximately optimal controller placement scheme set R, and calculating all optimal target values F of the placement schemes3(x) The calculation procedure is the same as in simulation 1. Calculated F3(x) Is a matrix of 101 rows and 3 columns
Optimizing target values F of three all placement schemes obtained by simulation 1, simulation 2 and simulation 31(x)、F2(x) And F3(x) Inputting the data into MATLAB software, and drawing in the MATLAB software to obtain an optimized target value comparison graph of the approximate optimal controller placement scheme set R obtained by the two methods under the Internet OS3E, as shown in FIG. 4, wherein the abscissa is placement cost, the ordinate is load difference, and the ordinate is maximum propagation delay.
As can be seen from fig. 4, compared with the prior art, the method of the present invention can obtain a shorter maximum propagation delay under the same placement cost and load difference, and when the placement cost is determined, the method of the present invention obtains a placement scheme set with a lower maximum propagation delay and load difference. This shows that the approximate optimal controller placement scheme set R obtained according to the present invention places the controller into the network, which can improve the performance of the control network, reduce the propagation delay of the control network, promote the reasonable utilization of the controller storage resources, and optimize the placement cost of the control network.