Dynamic recovery method and system for UAVs and storage medium

11474541 · 2022-10-18

Assignee

Inventors

Cpc classification

International classification

Abstract

The disclosure provides a dynamic recovery method and system for UAVs and storage medium. On the basis of obtaining the environmental information of UAVs, combined with different factors such as the following task quantity of each UAV, the distance from the current position of each UAV to the recovery point, current performance of each UAV, total cost function is constructed, and optimization is carried out through improved particle swarm optimization algorithm. Then on the premise of the lowest recovery cost, the priority of each UAV is obtained. For the ordered UAV, the route to the recovery point is determined. At the same time, it is necessary to consider conflict resolution of UAVs when encountering obstacles in the flight process, as well as the possible failure in line recovery. At this time, it is necessary to reorder some hovering UAVs to ensure flight safety of UAVs and robustness of the algorithm.

Claims

1. A dynamic recovery method for UAVs, comprising the following steps: step 1: in flight environment including a number of obstacles, UAVs obtain their own performance information and task information; step2: according to the performance information and task information of each UAV, the total cost function F of dynamic recovery for UAVs is established, and the total cost function is calculated as follows: F = .Math. i = 1 N ( O i .Math. ( Q i ) α 1 + O i .Math. ( T i p ) α 2 + ( L i ) α 3 O i + ( C i ) α 4 O i + O i .Math. ( D i ) α 5 + O i .Math. ( T i r ) α 6 ) wherein, O.sub.i is a permutation of N UAVs; Q.sub.i is the number of tasks waiting to be completed after UAV i is recovered; α.sub.1 is the intensity parameter of the effect of the number of tasks waiting to be completed Q.sub.i on the cost function; T.sub.i.sup.p is the waiting time needed to complete other tasks after UAV i is recovered; α.sub.2 is the intensity parameter of the effect of the waiting time needed to complete other tasks T.sub.i.sup.p on the cost function; L.sub.i is the distance from the current position of UAV i to the recovery point; α.sub.3 is the intensity parameter of the effect of the distance L.sub.i on the cost function; C.sub.i is the number of obstacles that UAV i may encounter in flight; α.sub.4 is the intensity parameter of the effect of the number of obstacles C.sub.i on the cost function; D.sub.i is the current damage severity of UAV i; α.sub.5 is the intensity parameter of the effect of the current damage severity D.sub.i on the cost function; T.sub.i.sup.r is the current flight time of UAV i; α.sub.6 is the intensity parameter of the effect of the current flight time T.sub.i.sup.r on the cost function; step3: an improved particle swarm optimization algorithm is used to optimize the total cost function F, and the optimal recovery order of UAVs is obtained; in particle swarm optimization algorithm, the speed and position updating formula of the qth position of the sth particle in the (t+1) generation are as follows:
v.sub.sq(t+1)=v.sub.sq(t)+c.sub.1×rand( )×(pbest.sub.sq(t)−x.sub.sq(t))+c.sub.2×rand( )×(gbest.sub.sq(t)−x.sub.sq(t));
x.sub.sq(t+1)=x.sub.sq(t)+v.sub.sq(t+1); wherein s=1, 2, . . . , n, n is the number of particles, each particle is a permutation of (1, 2 . . . , N), and each permutation corresponds to a value of the cost function F; v.sub.sq(t) is the velocity of the qth position of the sth particle in the t generation, c.sub.1 and c.sub.2 are two constants, and rand( ) is the uniform random number in [0,1], pbest.sub.sq(t) is the qth position of the historical optimal solution of the sth particle in the t generation, x.sub.sq (t) is the qth position of the sth particle in the t generation, gbest.sub.sq(t) means that after the historical optimal solutions of the top three particles in the t generation are determined, the q th position corresponding to a solution is randomly selected from the three historical optimal solutions; step4: each UAV is recovered according to priority order, and whether the UAVs encounter conflict in the dynamic recovery process is judged, if conflict is encountered, the UAV carries out conflict resolution and flies back to the recovery point in the priority order, if conflict is not encountered, the UAV flies back to the recovery point in the priority order, the conflict resolution calculation formula of UAV i is as follows: v I .fwdarw. ( t + 1 ) = v .Math. .fwdarw. ( t + 1 ) + w g .Math. .fwdarw. .Math. v .Math. .fwdarw. ( t + 1 ) + w g .Math. .fwdarw. .Math. , where {right arrow over (v.sub.I)}(t+1) is the flight speed of UAV i in the next time step when encountering conflict, w is the influence weight of priority flight direction, {right arrow over (g.sub.l)} is the direction vector of priority flight of UAV i (from current position to the recovery point); {right arrow over (v.sub.l)}(t+1) is the adjustment speed of UAV i in the next time step when encountering conflict; step5: after arriving at a specific recovery area, one or more UAVs among the UAVs wait in line and hover around to judge whether there are UAVs that fail to complete line recovery, if yes, the one or more UAVs are reordered, if not, the one or more UAVs are recycled in the priority order until recovery is completed.

2. The dynamic recovery method for UAVs according to claim 1, wherein the task information described in step 1 comprises: the current position of each UAV, the position of recovery point, the coordinates of obstacles within the detection radius of each UAV and the coordinate positions of other UAVs; its performance information comprises: the current flight time of each UAV before recovery, the number of tasks to be performed by each UAV and whether the UAV is damaged.

3. The dynamic recovery method for UAVs according to claim 1, the formula for adjustment speed in step 4 is: v .Math. .fwdarw. ( t + 1 ) = - .Math. j = 1 n D r .Math. J .fwdarw. ( t ) .Math. r .Math. J .fwdarw. ( t ) .Math. , n.sub.D is the number of obstacles and other UAVs within the detection radius R.sub.D of UAV i at time t, and {right arrow over (r.sub.lJ)}(t) represents the relative position of UAV i, obstacles and other UAV j at time t.

4. The dynamic recovery method for UAVs according to claim 1, wherein the cost formula F.sub.ƒ of reordering in step 5 is as follows:
F.sub.ƒ=Σ.sub.i=1.sup.N.sup.ƒ(O′.sub.i.Math.(Q.sub.i).sup.α.sup.1+O′.sub.1.Math.(T.sub.i.sup.p).sup.α.sup.2+O′.sub.i.Math.(D.sub.i).sup.α.sup.5+O′.sub.i.Math.(T.sub.i.sup.r).sup.α.sup.6), where O′.sub.i is a permutation of N.sub.ƒ hovering UAVs; the improved particle swarm optimization algorithm is used to solve the problem again, and the optimal solution is the optimal recovery order of UAVs hovering around.

5. A non-transitory storage medium comprising instructions that when executed cause a processor of a computing device to: in flight environment including a number of obstacles, obtain their own performance information and task information by UAVs; according to the performance information and task information of each UAV, establish the total cost function F of dynamic recovery for UAVs, and the total cost function is calculated as follows: F = .Math. i = 1 N ( O i .Math. ( Q i ) α 1 + O i .Math. ( T i p ) α 2 + ( L i ) α 3 O i + ( C i ) α 4 O i + O i .Math. ( D i ) α 5 + O i .Math. ( T i r ) α 6 ) wherein, O.sub.i is a permutation of N UAVs; Q.sub.i is the number of tasks waiting to be completed after UAV i is recovered; α.sub.1 is the intensity parameter of the effect of the number of tasks waiting to be completed Q.sub.i on the cost function; T.sub.i.sup.p is the waiting time needed to complete other tasks after UAV i is recovered; α.sub.2 is the intensity parameter of the effect of the waiting time needed to complete other tasks T.sub.i.sup.p on the cost function; L.sub.i is the distance from the current position of UAV i to the recovery point; α.sub.3 is the intensity parameter of the effect of the distance L.sub.i on the cost function; C.sub.i is the number of obstacles that UAV i may encounter in flight; α.sub.4 is the intensity parameter of the effect of the number of obstacles C.sub.i on the cost function; D.sub.i is the current damage severity of UAV i; α.sub.5 is the intensity parameter of the effect of the current damage severity D.sub.i on the cost function; T.sub.i.sup.r is the current flight time of UAV i; α.sub.6, is the intensity parameter of the effect of the current flight time T.sub.i.sup.r on the cost function; by using an improved particle swarm optimization algorithm, optimize the total cost function F, and obtain the optimal recovery order of UAVs; in particle swarm optimization algorithm, the speed and position updating formula of the qth position of the sth particle in the (t+1) generation are as follows:
v.sub.sq(t+1)=v.sub.sq(t)+c.sub.1×rand( )×(pbest.sub.sq(t)−x.sub.sq(t))+c.sub.2×rand( )×(gbest.sub.sq(t)−x.sub.sq(t));
x.sub.sq(t+1)=x.sub.sq(t)+v.sub.sq(t+1); wherein s=1, 2, . . . , n, n is the number of particles, each particle is a permutation of (1, 2, . . . , N), and each permutation corresponds to a value of the cost function F; v.sub.sq(t) is the velocity of the qth position of the sth particle in the t generation, c.sub.1 and c.sub.2 are two constants, and rand( ) is the uniform random number in [0,1], pbest.sub.sq(t) is the qth position of the historical optimal solution of the sth particle in the t generation, x.sub.sq (t) is the qth position of the sth particle in the t generation, gbest.sub.sq(t) means that after the historical optimal solutions of the top three particles in the t generation are determined, the qth position corresponding to a solution is randomly selected from the three historical optimal solutions; recover each UAV according to priority order, and judge whether the UAVs encounter conflict in the dynamic recovery process, if conflict is encountered, the UAV carries out conflict resolution and flies back to the recovery point in priori order, if conflict is not encountered, the UAV flies back to the recovery point in priority order, the conflict resolution calculation formula of UAV i is as follows: v I .fwdarw. ( t + 1 ) = v .Math. .fwdarw. ( t + 1 ) + w g .Math. .fwdarw. .Math. v .Math. .fwdarw. ( t + 1 ) + w g .Math. .fwdarw. .Math. , where {right arrow over (v.sub.I)}(t+1) is the flight speed of UAV i in the next time step when encountering conflict, w is the influence weight of priority flight direction, {right arrow over (g.sub.l)} is the direction vector of priority flight of UAV i (from current position to the recovery point); {right arrow over (v.sub.l)}(t+1) is the adjustment speed of UAV i in the next time step when encountering conflict; judge whether there are UAVs that fail to complete line recovery, after one or more UAVs among the UAVs arriving at a specific recovery area, if yes, the one or more UAVs are reordered, if not, the one or more UAVs are recycled in the priority order until recovery is completed.

6. A dynamic recovery system for UAVs, comprising: the UAVs, a first processor, a second processor, a third processor, and a fourth processor, wherein in flight environment including a number of obstacles, UAVs obtain their own performance information and task information; a first processor, according to the performance information and task information of each UAV, establishes the total cost function F of dynamic recovery for UAVs, and calculates the total cost function as follows: F = .Math. i = 1 N ( O i .Math. ( Q i ) α 1 + O i .Math. ( T i p ) α 2 + ( L i ) α 3 O i + ( C i ) α 4 O i + O i .Math. ( D i ) α 5 + O i .Math. ( T i r ) α 6 ) wherein, O.sub.i is a permutation of N UAVs; Q.sub.i is the number of tasks waiting to be completed after UAV i is recovered; α.sub.1 is the intensity parameter of the effect of the number of tasks waiting to be completed Q.sub.i on the cost function; T.sub.i.sup.p is the waiting time needed to complete other tasks after UAV i is recovered; α.sub.2 is the intensity parameter of the effect of the waiting time needed to complete other tasks T.sub.i.sup.p on the cost function; L.sub.i is the distance from the current position of UAV i to the recovery point; α.sub.3 is the intensity parameter of the effect of the distance L.sub.i on the cost function; C.sub.i is the number of obstacles that UAV i: may encounter in flight; α.sub.4 is the intensity parameter of the effect of the number of obstacles C.sub.i on the cost function; D.sub.i is the current damage severity of UAV i; α.sub.5 is the intensity parameter of the effect of the current damage severity D.sub.i on the cost function; T.sub.i.sup.r is the current flight time of UAV i; α.sub.6 is the intensity parameter of the effect of the current flight time T.sub.i.sup.r on the cost function; the second processor uses an improved particle swarm optimization algorithm to optimize the total cost function F, and obtains the optimal recovery order of UAVs; in particle swarm optimization algorithm, the speed and position updating formula of the qth position of the sth particle in the (t+1) generation are as follows:
v.sub.sq(t+1)=v.sub.sq(t)+c.sub.1×rand( )×(pbest.sub.sq(t)−x.sub.sq(t))+c.sub.2×rand( )×(gbest.sub.sq(t)−x.sub.sq(t));
x.sub.sq(t+1)=x.sub.sq(t)+v.sub.sq(t+1); wherein s=1, 2, . . . n, n is the number of particles, each particle is a permutation of (1, 2, . . . , N), and each permutation corresponds to a value of the cost function F; v.sub.sq(t) is the velocity of the qth position of the sth particle in the t generation, c.sub.1 and c.sub.2 are two constants, and rand( ) is the uniform random number in [0,1], pbest.sub.sq(t) is the qth position of the historical optimal solution of the sth particle in the t generation, x.sub.sq (t) is the qth position of the sth particle in the t generation, gbest.sub.sq(t) means that after the historical optimal solutions of the top three particles in the t generation are determined, the q th position corresponding to a solution is randomly selected from the three historical optimal solutions; the third processor recovers each UAV according to priority order, and judges whether the UAVs encounter conflict in the dynamic recovery process, if conflict is encountered, the UAV carries out conflict resolution and flies back to the recovery point in the priority order, if conflict is not encountered, the UAV flies back to the recovery point in the priority order, the conflict resolution calculation formula of UAV i is as follows: v I .fwdarw. ( t + 1 ) = v .Math. .fwdarw. ( t + 1 ) + w g .Math. .fwdarw. .Math. v .Math. .fwdarw. ( t + 1 ) + w g .Math. .fwdarw. .Math. , where {right arrow over (v.sub.I)}(t+1) is the flight speed of UAV i in the next time step when encountering conflict, w is the influence weight of priority flight direction, {right arrow over (g.sub.l)} is the direction vector of priority flight of UAV i (from current position to the recovery point); {right arrow over (v.sub.l)}(t+1) is the adjustment speed of UAV i in the next time step when encountering conflict; the fourth processor judges whether there are UAVs that fail to complete line recovery when one or more UAVs among the UAVs wait in line and hover around after arriving at a specific recovery area, if yes, the one or more UAVs are reordered, if not, the one or more UAVs are recycled in the priority order until recovery is completed.

7. The dynamic recovery system for UAVs according to claim 6, wherein the task information comprises: the current position of each UAV, the position of recovery point, the coordinates of obstacles within the detection radius of each UAV and the coordinate positions of other UAVs; its performance information comprises: the current flight time of each UAV before recovery, the number of tasks to be performed by each UAV and whether the UAV is damaged.

8. The dynamic recovery system for UAVs according to claim 6, the formula for adjustment speed is: v .Math. .fwdarw. ( t + 1 ) = - .Math. j = 1 n D r .Math. J .fwdarw. ( t ) .Math. r .Math. J .fwdarw. ( t ) .Math. , n.sub.D is the number of obstacles and other UAVs within the detection radius R.sub.D of UAV i at time t, and {right arrow over (r.sub.lJ)}(t) represents the relative position of UAV i, obstacles and other UAV j at time t.

9. The dynamic recovery system for UAVs according to claim 6, wherein the cost formula F.sub.ƒ of reordering is as follows:
F.sub.ƒ=Σ.sub.i=1.sup.N.sup.ƒ(O′.sub.i.Math.(Q.sub.i).sup.α.sup.1+O′.sub.1.Math.(T.sub.i.sup.p).sup.α.sup.2+O′.sub.i.Math.(D.sub.i).sup.α.sup.5+O′.sub.i.Math.(T.sub.i.sup.r).sup.α.sup.6) where O′.sub.i is a permutation of N.sub.ƒ hovering UAVs; the improved particle swarm optimization algorithm is used to solve the problem again, and the optimal solution is the optimal recovery order of UAVs hovering around.

Description

BRIEF DESCRIPTION OF DRAWINGS

(1) FIG. 1 is a flow chart of a dynamic recovery method for UAVs according to the present application;

(2) FIG. 2 is the schematic diagram of conflict resolution of UAV in the recovery process according to the present application.

DESCRIPTION OF EMBODIMENTS

(3) In order to facilitate the understanding and implementation of the disclosure by ordinary technical personnel in the field, the disclosure is further described in detail and in depth in combination with the drawings.

(4) The disclosure provides a dynamic recovery method for UAVs. On the basis of obtaining the environment information of UAVs, combining with factors such as the following task quantity of each UAV, the distance between each UAV and recovery point, the current performance of each UAV and the different environment and so on, the priority of UAVs is carried out by improved particle swarm optimization algorithm, which makes the total recovery cost of UAVs the lowest. After the recovery order is determined, the route of ordered UAVs to the recovery point should be determined. At the same time, if the UAVs encounter obstacles in the flight process, conflict resolution is needed to ensure the flight safety of UAVs. Finally, taking line recovery as an example, it is also necessary to consider the actual recovery failure of UAVs in line recovery. At this time, it is necessary to reorder some hovering UAVs to ensure the flight safety of UAVs and the robustness of the algorithm.

(5) As shown in FIG. 1, the dynamic recovery method for UAVs includes the following steps:

(6) step 1: UAVs obtain environment information and their own performance and task information.

(7) In complex flight environment, UAV may face a variety of static or dynamic threats, such as trees, buildings, motor vehicles or other UAVs, so it is necessary to obtain environmental information.

(8) Each UAV obtains its task information in the flight scene, including: the current position of each UAV, the position of UAV recovery point, so as to determine the flight direction of UAVs; it also includes the coordinates of obstacles within the detection radius of each UAV and the coordinates of other UAVs, so as to avoid obstacles in the flight process of each UAV;

(9) UAV also needs to know its own performance and state information, such as the current flight time of each UAV before recovery, the number of tasks to be performed by each UAV after recovery, and whether the UAV is damaged or not.

(10) Step 2: according to the performance information and task information of each UAV, the total cost function F of dynamic recovery for UAVs is established;

(11) In the process of dynamic recovery of UAVs, we must consider various factors such as the different number of UAVs, the difference of task, the difference of flight environment, the current performance of UAVs and so on. The priority of dynamic recovery process of each UAV among UAVs can be ranked, and then the dynamic recovery can be carried out according to the priority. The optimization index is the result of priority ranking, that is, the recovery order of UAVs.

(12) The disclosure considers the following factors for the recovery order of a single UAV, which are all cost functions related to the recovery order.

(13) 1. The task requirements of UAV.

(14) Assuming that for UAV i, the number of tasks waiting to be completed after recovery is Q.sub.i and the waiting time needed to complete the tasks is T.sub.i.sup.p, then the higher the Q.sub.i and T.sub.i.sup.p, the more backward the recovery order of UAV i is, the greater the recovery order cost is. The cost of recovery order is positively correlated with the size of Q.sub.i and T.sub.i.sup.p.

(15) The recovery order cost of UAV i according to Q.sub.i is defined as ƒ.sub.1i. The specific formula is as follows:
ƒ.sub.1i=O.sub.i.Math.(Q.sub.i).sup.α.sup.1.

(16) Wherein, O.sub.i(i=1, 2, . . . , N) is a permutation of N UAVs; α.sub.1 is the intensity parameter of the effect of Q.sub.i on the cost function. The reason why α.sub.1 is placed in the power exponent is that the more tasks the UAV wait to complete, in addition to the time required to complete the tasks, additional time consumption such as recovery and maintenance should be considered.

(17) Similarly, the recovery order cost of UAV i according to T.sub.i.sup.p is defined as ƒ.sub.2i. The specific formula is as follows:
ƒ.sub.2i=O.sub.i.Math.(T.sub.i.sup.p).sup.α.sup.2.

(18) Where α.sub.2 is the intensity parameter of the effect of T.sub.i.sup.p on the cost function.

(19) 2. The flight environment of UAV.

(20) Assuming that the distance between the current position of UAV and the recovery point is L.sub.i for UAV i, the environmental complexity of flying to the recovery point mainly considers the number of obstacles C.sub.i that may be encountered. Different from the impact of task requirements on the cost, the higher the L.sub.i and C.sub.i are, the more backward the recovery order of UAV i is, the lower the recovery order cost of UAV i is. The cost of recovery order is inversely related to the size of L.sub.i and C.sub.i. This is because the larger the L.sub.i and C.sub.i, the more time it takes for UAV i to fly to the recovery point. If the recovery order is too forward, UAV i cannot fly to the recovery point in a short time. On the contrary, it will affect the recovery of other UAVs among the UAVs and increase the total recovery cost.

(21) The recovery order cost of UAV i according to L.sub.i is defined as ƒ.sub.3i. The specific formula is as follows:

(22) f 3 i = ( L i ) α 3 O i

(23) Where α.sub.3 is the intensity parameter of the effect of L.sub.i on the cost function.

(24) Similarly, the recovery order cost of UAV i according to C.sub.i is defined as ƒ.sub.4i. The specific formula is as follows:

(25) f 4 i = ( C i ) α 4 O i

(26) Where α.sub.4 is the intensity parameter of the effect of C.sub.i on the cost function.

(27) 3. The current performance of UAV.

(28) Assuming that the current damage severity of UAV i is D.sub.i and the current flight time of UAV i is T.sub.i.sup.r. Then, with the increase of D.sub.i and T.sub.i.sup.r, the more backward the recovery order of UAV i is, the greater the recovery order cost will be. The cost of recovery order is positively correlated with the size of D.sub.i and T.sub.i.sup.r. This is because the greater the damage UAV i suffers and the greater the current flight time (the shorter the remaining flight time), the more it needs to be recovered and maintained in time.

(29) The recovery order cost of UAV i according to D.sub.i is defined as ƒ.sub.5i. The specific formula is as follows:
ƒ.sub.5i=O.sub.i.Math.(D.sub.i).sup.α.sup.5

(30) Where α.sub.5 is the intensity parameter of the effect of D.sub.i on the cost function.

(31) Similarly, the recovery order cost of UAV i according to T.sub.i.sup.r is defined as ƒ.sub.6i. The specific formula is as follows:
ƒ.sub.6i=O.sub.i.Math.(T.sub.i.sup.r).sup.α.sup.6

(32) Where α.sub.6 is the intensity parameter of the effect of T.sub.i.sup.r on the cost function.

(33) When the above factors are determined, the total cost of UAV i according to its recovery order O.sub.i is defined as ƒ.sub.i, and the calculation formula of ƒ.sub.i is as follows:
ƒ.sub.i=ƒ.sub.1i+ƒ.sub.2i+ƒ.sub.3i+ƒ.sub.4i+ƒ.sub.5i+ƒ.sub.6i

(34) Assuming that there are N UAVs in the whole UAV group, the total cost F generated by the whole UAV group according to its recovery order is as follows:
F=Σ.sub.i=1.sup.Nƒ.sub.i.

(35) After expansion, the formula is as follows:

(36) F = .Math. i = 1 N ( O i .Math. ( Q i ) α 1 + O i .Math. ( T i p ) α 2 + ( L i ) α 3 O i + ( C i ) α 4 O i + O i .Math. ( D i ) α 5 + O i .Math. ( T i r ) α 6 )

(37) Accordingly, the overall recovery cost corresponding to the priority sequence of the whole UAV group is obtained. The lower the cost, the higher the profit. And the next goal is to optimize the value of the independent variables of the objective function, that is, the final recovery order of UAVs, so that the overall recovery cost is low.

(38) Step 3: The improved particle swarm optimization algorithm is used to optimize the total cost function F, and the optimal recovery order of UAVs is obtained;

(39) Initialize n recovery orders, each recovery order is a permutation of (1, 2, . . . , N) and corresponds to a value of the cost function F. The goal is to iteratively optimize the initial recovery order through particle swarm optimization algorithm, and each recovery order is constantly updated. After a certain number of iterations, an optimal recovery order is finally obtained, that is to make the value of cost function F the lowest.

(40) In particle swarm optimization algorithm, the speed and position updating formula of the qth position of the sth particle (that is the sth recovery order) in the (t+1) generation are as follows:
v.sub.sq(t+1)=v.sub.sq(t)+c.sub.1×rand( )×(pbest.sub.sq(t)−x.sub.sq(t))+c.sub.2×rand( )×(gbest.sub.sq(t)−x.sub.sq(t)).
x.sub.sq(t+1)=x.sub.sq(t)+v.sub.sq(t+1).

(41) Where s=1, 2, . . . , n, v.sub.sq(t) is the velocity of the qth position of the sth particle (that is the sth recovery order) in the t generation, x.sub.sq(t) is the qth position of the sth particle (that is the sth recovery order) in the t generation. The recovery order of each particle is evaluated by the cost function. c.sub.1 and c.sub.2 are two constants, and rand( ) is the uniform random number in [0,1], pbest.sub.sq(t) is the qth position of the historical optimal solution of the sth particle in the t generation, gbest.sub.sq(t) means that after the historical optimal solutions of the top three particles in the t generation are determined, the qth position corresponding to a solution is randomly selected from the three historical optimal solutions. The reason why we don't choose the best solution, but choose the best solution in the first three randomly is to ensure the randomness of the algorithm.

(42) It is worth noting that after the qth position of the sth particle (that is the sth recovery order) is updated by formula, it is necessary to make improvement based on the background of the problem which is different from the original PSO algorithm directly updating the next position. Because each solution is a permutation of (1, 2, . . . , N), after updating a certain position, the original position must be replaced with the new position. This is to ensure that the updated solution is also a permutation of (1, 2, . . . , N) and the algorithm can continue. After all the initial particles are optimized by iteration of generation T, the final optimal solution is the optimal recovery order of UAVs.

(43) Step 4: Each UAV is recovered according to the priority order, and whether the UAVs encounters conflict in the dynamic recovery process is judged. If yes, the UAV carries out conflict resolution and flies back in order. If not, the UAV flies back in order.

(44) As shown in FIG. 2, the UAV has a detection radius R.sub.D. Taking UAV i as an example, it is assumed that the number of obstacles and other UAVs within the detection radius of UAV i at time t is n.sub.D, then the flight speed of UAV i in the next time step is adjusted according to the following formula:

(45) v .Math. .fwdarw. ( t + 1 ) = - .Math. j = 1 n D r ij .fwdarw. ( t ) .Math. r ij .fwdarw. ( t ) .Math. .

(46) Where {right arrow over (r.sub.lJ)}(t) is the relative position of UAV i, obstacles and other UAV j at time t, i.e. UAV i flies away from risk, which is of great significance for the flight safety of UAV.

(47) At the same time, UAV i also has a priority flight direction vector {right arrow over (g.sub.l)}. the direction of vector {right arrow over (g.sub.l)} is the direction that the current position of UAV i points to the recovery point.

(48) Considering the above two factors, when the UAV i encounters a conflict, the flight speed of UAV i in the next time step is:

(49) 0 v .fwdarw. I ( t + 1 ) = v .Math. .fwdarw. ( t + 1 ) + w g .Math. .fwdarw. .Math. v .Math. .fwdarw. ( t + 1 ) + w g .Math. .fwdarw. .Math. .

(50) Where w is the weight of the priority direction. In this way, the UAV i can not only fly to the target direction, but also achieve conflict resolution.

(51) Step 5: After some UAVs arrive at the specific recovery area, they wait in line and hover around to judge whether there are UAVs that fail to complete line recovery. If yes, we reorder some UAVs that failed in recovery. If not, we recycle in order until recovery is completed.

(52) The UAV may encounter the situation of actual recovery failure in line recovery. At this time, it is necessary to reorder some of the UAVs hovering and waiting (assuming its number is N.sub.ƒ) among the UAVs to ensure the robustness of the algorithm.

(53) At this time, because the UAV is near the recovered ship, the UAVs flight environment is not considered, only the UAVs task requirements and current performance are considered, and the UAVs that failed to be recovered and some of the UAVs hovering and waiting are reordered. The cost formula F.sub.ƒ is defined as follows:
F.sub.ƒ=Σ.sub.i=1.sup.N.sup.ƒ(O′.sub.i.Math.(Q.sub.i).sup.α.sup.1+O′.sub.1.Math.(T.sub.i.sup.p).sup.α.sup.2+O′.sub.i.Math.(D.sub.i).sup.α.sup.5+O′.sub.i.Math.(T.sub.i.sup.r).sup.α.sup.6).

(54) Where O′(i=1, 2, . . . , N.sub.ƒ) is a permutation of (1, 2, . . . , N.sub.ƒ).

(55) The improved particle swarm optimization algorithm is used to solve the problem again, and the optimal solution is the optimal recovery order of UAVs hovering and waiting.

(56) The disclosure can realize the dynamic recovery of UAVs under complex conditions, realize the efficient flight and dynamic recovery of UAVs, and complete the assigned tasks cooperatively, which has positive significance.

(57) A storage medium comprising instructions that when executed cause a processor of a computing device to:

(58) in complex environment, obtain their own performance information and task information by UAVs;

(59) wherein the task information comprises: the current position of each UAV, the position of recovery point, the coordinates of obstacles within the detection radius of each UAV and the coordinate positions of other UAVs; its performance information comprises: the current flight time of each UAV before recovery, the number of tasks to be performed by each UAV and whether the UAV is damaged,

(60) according to the performance information and task information of each UAV, establish the total cost function F of dynamic recovery for UAVs, and the total cost function is calculated as follows:

(61) F = .Math. i = 1 N ( O i .Math. ( Q i ) α 1 + O i .Math. ( T i p ) α 2 + ( L i ) α 3 O i + ( C i ) α 4 O i + O i .Math. ( D i ) α 5 + O i .Math. ( T i r ) α 6 )

(62) wherein, O.sub.i is a permutation of N UAVs; Q.sub.i is the number of tasks waiting to be completed after UAV i is recovered; α.sub.1 is the intensity parameter of the effect of the number of tasks waiting to be completed Q.sub.i on the cost function; T.sub.i.sup.p is the waiting time needed to complete other tasks after UAV i is recovered; α.sub.2 is the intensity parameter of the effect of the waiting time needed to complete other tasks T.sub.i.sup.p on the cost function; L.sub.i is the distance from the current position of UAV i to the recovery point; α.sub.3 is the intensity parameter of the effect of the distance L.sub.i on the cost function; C.sub.i is the number of obstacles that UAV i may encounter in flight; α.sub.4 is the intensity parameter of the effect of the number of obstacles C.sub.i on the cost function; D.sub.i is the current damage severity of UAV i; α.sub.5 is the intensity parameter of the effect of the current damage severity D.sub.i on the cost function; T.sub.i.sup.r is the current flight time of UAV i; α.sub.6 is the intensity parameter of the effect of the current flight time T.sub.i.sup.r on the cost function;

(63) by using the improved particle swarm optimization algorithm, optimize the total cost function F, and obtain the optimal recovery order of UAVs;

(64) in particle swarm optimization algorithm, the speed and position updating formula of the qth position of the sth particle in the (t+1) generation are as follows:
v.sub.sq(t+1)=v.sub.sq(t)+c.sub.1×rand( )×(pbest.sub.sq(t)−x.sub.sq(t))+c.sub.2×rand( )×(gbest.sub.sq(t)−x.sub.sq(t));
x.sub.sq(t+1)=x.sub.sq(t)+v.sub.sq(t+1);

(65) wherein s=1, 2, . . . , n is the number of particles, each particle is a permutation of (1, 2, . . . , N), and each permutation corresponds to a value of the cost function F;

(66) v.sub.sq(t) is the velocity of the qth position of the sth particle in the t generation, c.sub.t and c.sub.2 are two constants, and rand( ) is the uniform random number in [0,1], pbest.sub.sq(t) is the qth position of the historical optimal solution of the sth particle in the t generation, x.sub.sq (t) is the qth position of the sth particle in the t generation, gbest.sub.sq(t) means that after the historical optimal solutions of the top three particles in the t generation are determined, the qth position corresponding to a solution is randomly selected from the three historical optimal solutions;

(67) recover each UAV according to the priority order, and judge whether the UAVs encounter conflict in the dynamic recovery process, if yes, the UAV carries out conflict resolution and flies back in order, if not, the UAV flies back in order,

(68) the conflict resolution calculation formula of UAV i is as follows:

(69) v .fwdarw. I ( t + 1 ) = v .Math. .fwdarw. ( t + 1 ) + w g .Math. .fwdarw. .Math. v .Math. .fwdarw. ( t + 1 ) + w g .Math. .fwdarw. .Math. ,

(70) where {right arrow over (v.sub.I)}(t+1) is the flight speed of UAV i in the next time step when encountering conflict, w is the influence weight of priority flight direction, {right arrow over (g.sub.l)} is the direction vector of priority flight of UAV i (from current position to the recovery point); {right arrow over (v.sub.l)}(t+1) is the adjustment speed of UAV i in the next time step when encountering conflict;

(71) judge whether there are UAVs that fail to complete line recovery, after some UAVs arriving at the specific recovery area, if yes, we reorder some UAVs that failed in recovery, if not, we recycle in order until recovery is completed.

(72) A dynamic recovery system for UAVs, comprising: the UAVs, a first processor, a second processor, a third processor, and a fourth processor, wherein

(73) in complex environment, UAVs obtain their own performance information and task information;

(74) a first processor, according to the performance information and task information of each UAV, establishes the total cost function F of dynamic recovery for UAVs, and calculates the total cost function as follows:

(75) F = .Math. i = 1 N ( O i .Math. ( Q i ) α 1 + O i .Math. ( T i p ) α 2 + ( L i ) α 3 O i + ( C i ) α 4 O i + O i .Math. ( D i ) α 5 + O i .Math. ( T i r ) α 6 )

(76) wherein, O.sub.i is a permutation of N UAVs; Q.sub.i is the number of tasks waiting to be completed after UAV i is recovered; α.sub.1 is the intensity parameter of the effect of the number of tasks waiting to be completed Q.sub.i on the cost function; T.sub.i.sup.p is the waiting time needed to complete other tasks after UAV i is recovered; α.sub.2 is the intensity parameter of the effect of the waiting time needed to complete other tasks T.sub.i.sup.p on the cost function; L.sub.i is the distance from the current position of UAV i to the recovery point; α.sub.3 is the intensity parameter of the effect of the distance L.sub.i on the cost function; C.sub.i is the number of obstacles that UAV i may encounter in flight; α.sub.4 is the intensity parameter of the effect of the number of obstacles C.sub.i on the cost function; D.sub.i is the current damage severity of UAV i; α.sub.5 is the intensity parameter of the effect of the current damage severity D.sub.i on the cost function; T.sub.i.sup.r is the current flight time of UAV i; α.sub.6 is the intensity parameter of the effect of the current flight time T.sub.i.sup.r on the cost function;

(77) the second processor uses the improved particle swarm optimization algorithm to optimize the total cost function F, and obtains the optimal recovery order of UAVs;

(78) in particle swarm optimization algorithm, the speed and position updating formula of the qth position of the sth particle in the (t+1) generation are as follows:
v.sub.sq(t+1)=v.sub.sq(t)+c.sub.1×rand( )×(pbest.sub.sq(t)−x.sub.sq(t))+c.sub.2×rand( )×(gbest.sub.sq(t)−x.sub.sq(t)),
x.sub.sq(t+1)=x.sub.sq(t)+v.sub.sq(t+1);

(79) wherein s=1, 2, . . . , n, n is the number of particles, each particle is a permutation of (1, 2, . . . , N), and each permutation corresponds to a value of the cost function F;

(80) v.sub.sq(t) is the velocity of the qth position of the sth particle in the t generation, c.sub.1 and c.sub.2 are two constants, and rand( ) is the uniform random number in [0,1], pbest.sub.sq(t) is the qth position of the historical optimal solution of the sth particle in the t generation, x.sub.sq (t) is the qth position of the sth particle in the t generation, gbest.sub.sq(t) means that after the historical optimal solutions of the top three particles in the t generation are determined, the qth position corresponding to a solution is randomly selected from the three historical optimal solutions;

(81) the third processor recovers each UAV according to the priority order, and judges whether the UAVs encounter conflict in the dynamic recovery process, if yes, the UAV carries out conflict resolution and flies back in order, if not, the UAV flies back in order,

(82) the conflict resolution calculation formula of UAV i is as follows:

(83) v .fwdarw. I ( t + 1 ) = v .Math. .fwdarw. ( t + 1 ) + w g .Math. .fwdarw. .Math. v .Math. .fwdarw. ( t + 1 ) + w g .Math. .fwdarw. .Math. ,

(84) where {right arrow over (v.sub.I)}(t+1) is the flight speed of UAV i in the next time step when encountering conflict, w is the influence weight of priority flight direction, {right arrow over (g.sub.l)} is the direction vector of priority flight of UAV i (from current position to the recovery point); {right arrow over (v.sub.l)}(t+1) is the adjustment speed of UAV i in the next time step when encountering conflict;

(85) The formula for adjustment speed is:

(86) v .Math. .fwdarw. ( t + 1 ) = - .Math. j = 1 n D r .Math. J .fwdarw. ( t ) .Math. r .Math. J .fwdarw. ( t ) .Math. ,

(87) n.sub.D is the number of obstacles and other UAVs within the detection radius R.sub.D of UAV i at time t, and {right arrow over (r.sub.lJ)}(t) represents the relative position of UAV i, obstacles and other UAV j at time t.

(88) the fourth processor judges whether there are UAVs that fail to complete line recovery when they wait in line and hover around, after some UAVs arrive at the specific recovery area, if yes, we reorder some UAVs that failed in recovery, if not, we recycle in order until recovery is completed.

(89) The cost formula F.sub.ƒ of reordering is as follows:

(90) F f = .Math. i = 1 N f ( O i .Math. ( Q i ) α 1 + O i .Math. ( T i p ) α 2 + O i .Math. ( D i ) α 5 + O i .Math. ( T i r ) α 6 )

(91) O′.sub.i is a permutation of N.sub.ƒ hovering UAVs;

(92) the improved particle swarm optimization algorithm is used to solve the problem again, and the optimal solution is the optimal recovery order of UAVs hovering around.

(93) Each of the first processor, the second processor, the third processor and the fourth processor is independent processor, or all of them are integrated in a single processor.

(94) The foregoing descriptions of specific exemplary embodiments of the present application have been presented for purposes of illustration and description. They are not intended to be exhaustive or to limit the application to the precise forms disclosed, and obviously many modifications and variations are possible in light of the above teachings. The exemplary embodiments were chosen and described in order to explain certain principles of the application and their practical application, to thereby enable others skilled in the art to make and utilize various exemplary embodiments of the present application, as well as various alternatives and modifications thereof. It is intended that the scope of the application be defined by the claims appended hereto and their equivalents.