Grouping Cooperative Dynamic Task Assignment Method of UAV Swarm

: Aiming at the problem of UAV swarms with distributed subsets performing cooperative reconnaissance-and-attack tasks on multi-targets in complex and uncertain combat scenarios, a distributed grouping cooperative dynamic task assignment method is proposed based on extended contract network protocol. The dynamic task assignment model for the UAV swarm with the topology of distributed subsets is established considering multiple constraints such as task cooperation, performing sequence, dynamic environment, communication topology, payload model, and UAV capability. According to the characteristics of multi-participants and multi-tasks in the process of UAV swarm executing tasks, the determination mechanism on cooperators and the selection mechanism of sequential tasks are proposed, and then the contract network protocol is extended. On the basis of the above, an event-triggered task assignment strategy for dynamic tasks is designed. The simulated results show that the proposed method can achieve the cooperative dynamic assignment of the UAV swarm to perform reconnaissance-and-attack tasks to multi-targets in complex and uncertain combat scenarios, improve the adaptiveness of the swarm under the sudden circumstance, and realize the optimization for task execution efﬁciency of the UAV swarm.


Introduction
The advances of intelligent autonomous systems have led UAV swarm technology and its application to the current scientific research hotspot [1,2]. Cooperative task assignment stands out as an essential component and a precondition of task accomplishment and autonomous control of UAV swarm systems [3].
Cooperative task assignment is to assign a considerable number of different types of subtasks and their order to each UAV in the swarm while meeting the task requirements with UAV capabilities and the multiple constraints involved. In the past few decades, there have been several main sorts of assignment algorithms for UAV swarm cooperative task assignment: the heuristic algorithm and the market-based algorithm, for example [4]. Heuristic algorithms generally search a certain range of solution space in an acceptable time by simulating natural phenomena to obtain feasible solutions to optimization problems. Common methods include the genetic algorithm [5][6][7][8], the particle swarm optimization algorithm [9], the ant colony algorithm [10,11], and the wolf swarm algorithm [12]. For UAV swarms with distributed architecture, heuristic algorithms always need to obtain global information. This process consumes lots of communication and computing resources as well as time to achieve global consensus; it is not suitable to apply heuristic algorithms. Compared with heuristic algorithms, market-based approaches (such as contract network protocol), distinctively characterized by distributed computing of swarms, requires only local information of the swarm and have the advantages of flexibility, robustness, and high operation speed [13] and, hence, are more suitable for distributed UAV swarms. Meanwhile, with strong scalability, market-based approaches can well handle cooperative task assignments with complex constraints such as limited communication [14] and time windows [15] and have been applied to dynamic task assignments [16][17][18]. The algorithms adopted are a part of the assignment approaches for the task assignment in complex and changeable combat scenarios, which are usually modeled as constraints or objectives from different perspectives.
The crucial topics to be investigated in this field include cooperative task assignment with the trajectory coupled [19,20] as well as under dynamic resistant circumstances [21][22][23]. In [24], a scheme to assign tasks in UAV swarms based on the contract network protocol (CNP) is presented, in which an A* algorithm is applied in flight path planning and path length estimation with a no-fly zone and threat considered. Under this scheme, the coupling between task assignment and flight path planning can be solved. However, their work does not take into consideration either pop-up missions or UAV faults. A study [25] has proposed a novel model for UAV coalition and an algorithm derived from basic geometry that generates a path derived from the original Dubins curve for application in remote sensing missions of fixed-wing UAVs. Another study [26] proposed an unmanned air vehicle (UAV) swarm task and a resource dynamic assignment algorithm based on the task sequence mechanism. By establishing a task sequence, each UAV strictly separates the necessary task time and synchronization waiting time. For the newfound targets, each UAV quickly determines its available time period. According to the available time and task resources, an auction algorithm and a consensus algorithm are used to decompose the task assignment into the initial distributed assignment phase and the swarm consensus phase to develop realtime conflict-free task solutions for UAV swarms. However, their work does not take into account the communication topology and time constraints. In [27], a CNP-based approach to a multi-UAV task assignment is proposed, in which a flight path planning method based on PH curves is combined with cooperative particle swarm optimization (PSO), cooperative variables, and cooperative functions to achieve attack synchronization on certain targets. Nevertheless, it does not take into account no-fly zones, threats, communication topology, and time constraints in addition to the task reassignment in the case of UAV faults. On the basis of this, [27,28] introduced local communication constraints with communication distance and information hop times to determine whether other UAVs participate in the local task assignment; however, it neglected the communication constraint caused by the swarm specific topology, which is crucial for certain command structures so as to improve operational effectiveness.
Compared with [21][22][23][24][25][26][27][28], the problem investigated in this paper is the dynamic task assignment for the heterogeneous UAV swarm consisting of distributed subsets with specific topology. In this paper, common constraints such as time windows, the UAV capability model, as well as new constraints such as topology constraints are combined to build the complex model of dynamic task assignment. The key contribution of this paper is that it proposes a solution to rectify the problem of heterogeneous UAV swarm cooperative dynamic task assignments with specific hierarchical communication topologies and other multiple constraints. An extended-CNP-based distributed assignment approach is proposed, along with distributed heterogeneous UAV swarm executing reconnaissance and attack tasks as the main scenario. The swarm consists of several subsets. On the swarm discovering new targets, it firstly assigns each target to subsets according to communication topology, and then each subset assigns subtasks to the UAVs within the group. The modified artificial potential field method is adopted to preplan the threat avoidance flight path, and battlefield survivability and fuel consumption are introduced to describe the flight path's impact on the task assignment. Correspondingly, the consumption penalty and threat penalty functions can be designed so as to solve the coupling between task assignment and path planning. Meanwhile, constraints on time and cooperation are introduced to adjust the task executing sequence.
The rest of paper is organized as follows. The description of distributed grouping UAV swarm task assignment problem with multiple constraints is presented in Section 2. In Section 3, combined with hierarchical communication topologies of the UAV swarm, the distributed assignment algorithm based on extended contract network protocol is thoroughly addressed. In Section 4, the dynamic cooperative task assignment scheme based on an event-trigger strategy is proposed. Section 5 demonstrates the approach's effectiveness, both in uncertain environments and with UAV failure, by numerical examples, and the whole work is concluded in Section 6.

Mission Scenario Analysis
There are heterogeneous UAV swarms consisting of distributed subsets in the mission area. Each subset is composed of several reconnaissance UAVs, attack UAVs, and reconnaissance-attack UAVs. The procedure of task assignment includes target allocation and subtask assignment. The swarm accomplishes the initial assignment, and then the UAVs cooperatively perform tasks. If a UAV discovers a new target, it relays the target information to others within a limited range according to hierarchical communication topologies, which triggers dynamic task assignment and then updates each UAV's task sequence.

Hierarchical Communication Topology
The UAV swarm is divided into several distributed subsets. Communication exists within each subset and among subsets, hence hierarchical communication topology is established. In the application process, the swarm can cooperate to assign and complete tasks through the two-layer mechanism of inter-group cooperation and intra-group coordination based on hierarchical communication topology. The structure of the distributed subsets adopted integrates the advantages of both centralized structure and fully distributed structure to realize "global centralization and local autonomy", which avoids the problems of low redundancy and the heavy central load of the fully centralized structure as well as the disadvantages of high individual capability requirements, communication complexity, and the command conflicts of the fully distributed structure. The structure conforms to the actual combat scenario as well as the development status of UAV swarm technology and will become more normalized and practical [29][30][31][32].
The algebraic graph theory is used to describe the internal interaction of the UAV swarm system. Assume that the UAV swarm has N UAVs, and each UAV is regarded as a node, then the communication relationship is seen as an edge. A directed graph G = {V, E, W} which consists of the node set V = {v 1 ,v 2 , . . . ,v N }, the edge set E ⊆ (v i , v j ) : v i , v j ∈ V, i = j and the adjacency matrix W = [w ij ] ∈ R N×N , with nonnegative entries w ij . The entries in W are defined with w ij = 1 for (v i , v j ) ∈ E and w ij = 0 otherwise. In addition, w ii = 0 for all i = 1, 2, · · · , N. The neighbor set of node v i is described as There is a top leader, N m group leaders, and N f followers in UAV swarms with distributed subsets, as shown in Figure 1. Each subset i has N fi followers. The top leader is the highest leader node and leads the initial task assignment. The group leader, which obtains information of each UAV in the subset, is the leader node of the subset, participates in target allocation on behalf of the subset, and leads subtask assignment; the followers are members of the subset and participate in subtask assignment and execution.
Each node is numbered in the UAV swarm, in which the top leader index is 1, the indexes of group leaders are i = 2, . . . , N m + 1, and the indices of followers are i = N m + 2, . . . , N m + N f + 1. The adjacency matrix W ∈ R N×N has the following form: where W FM i ∈ R N f i ×1 and W MF i ∈ R 1×N f i express the communication topology among group leader and its followers in subset i, and W F i ∈ R N f i ×N f i is the topology among followers in subset i. Each node is numbered in the UAV swarm, in which the top leader index is 1, the indexes of group leaders are i = 2, …, Nm + 1, and the indices of followers are i = Nm + 2,…, Nm + Nf + 1. The adjacency matrix has the following form: is denoted as the communication topology among followers. Assuming that no direct communication exists between each follower and the top leader, the followers of each subset only communicate within UAVs in the subset:

UAV and Payload Model
Denote UAV set V = {V i | i = 1, 2, . . . , N}, in which any UAV V i can be described as a seven-element combination < represents the kinetic parameters of UAV V i , including position, velocity, flight path angle, and flight heading angle; h i ∈ [0, 1] represents the survivability of UAV V i , and h i = 0 indicates V i is destroyed or has encountered faults and then completely loses its mission capability; C i = {C i1 , C i2 , . . . , C inCi } expresses indices of UAVs that communicate with V i ; P i = P i,scout , P i,attack is the executable task type of V i , where P i,scout ∈ {0, 1}, and P i,attack ∈ {0, 1} means reconnaissance capability and attack capability, respectively. When the capability is available, the value is 1, otherwise 0; F i is the fuel consumption rate per unit air-range of V i ; D i,max is the maximum air-range; N vi,max is the maximum number of executable tasks of V i .
The condition that a reconnaissance UAV discovers and confirms the threat or target is that it is located in the detection area of the reconnaissance payload, as shown in Figure 2a. Reference [33] gives the typical mathematic model of the detection area. The condition that an attack UAV can strike a target is that the target is located in the available area of the attack payload, as shown in Figure 2b. References [33,34] give the typical mathematic model of the available area. The condition that a reconnaissance UAV discovers and confirms the threat or target is that it is located in the detection area of the reconnaissance payload, as shown in Figure  2a. Reference [33] gives the typical mathematic model of the detection area. The condition that an attack UAV can strike a target is that the target is located in the available area of the attack payload, as shown in Figure 2b. References [33,34] give the typical mathematic model of the available area.

Threat Model
Any threat can be described by a five-element combination , , , , which is a function of the distance between the point and the threat center, represents the effect evaluation within the threat range; for the convenience of the study, , ,

Threat Model
Any threat can be described by a five-element combination where q o,i is the position vector of the threat O i center, R o.i is the no-fly zone radius of threat O i , and R a.i is the impact radius of threat O i . When a UAV flies into the no-fly zone, it will be destroyed; when the UAV enters the impact area, it will be affected by the threat.
where A i (q, q o,i ) ∈ (0, 1), which is a function of the distance between the point and the threat center, represents the effect evaluation within the threat range; for the convenience of the study, A i (q, q o,i ) can be taken as a constant value. When the UAV approaches threat O i and enters the impact range, its survivability will decrease. We assume the survivability of UAV V j is h j and the survivability becomes h j under the impact of threat O i , of which the process can be expressed as

Dynamic Task Allocation Problem
We adopt a seven-element combination {V, Sg, T, O, M t , R, C} to describe the dynamic task assignment problem. V = {V 1 , V 2 , . . . , V N } is the set of UAVs and N represents the number of UAVs in the swarm; S g = {S g1 , S g2 , . . . , S gNG } is the set of subsets and N G represents the number of UAV subsets in the swarm; T = {T 1 , T 2 , . . . , T NT } is the set of targets, where N T is the number of targets; O = {O 1 , O 2 , . . . , O Nobs } is the set of obstacles, where N obs is the number of obstacles; M t = {M t1 , M t2 , . . . , M t,Ntype } is the task type set of each target, where N type is the number of the types. For the "Reconnaissance-Attack" mission scenario, the task type set includes the reconnaissance and attack of two elements, which can be expressed as M t = {Scout, Attack}; R = {R 1 , R 2 , . . . , R Ntype } is the set of the maximum task values for the "Reconnaissance-Attack" mission scenario R = {R S , R A }; C is the set of multiple constraints, mainly including UAV capacity constraint, time win-dow constraint, sequential constraint, and cooperation constraint. These constraints are described as follows: Definition 1 (UAV capability constraints). The UAV capability constraints are mainly reflected in three aspects: the maximum range, the executable task types, and the maximum number of executable tasks.
(a) (The maximum range constraint) Assume that the initial state of UAV V i is s i0 , and the task sequence is Seq i = {s i1 , s i2 , . . . , s i,Ns,i }, where N s,i is the number of tasks to be executed. From Section 2.3, the maximum range of UAV V i is D i,max and the maximum range constraint can be expressed as where L(s ij , s i,j−1 ), which relates to task s i,j−1 and task s ij , represents the air-range from the position of task s i,j−1 to the position of task s ij . That means the whole air-range couples with the task sequence.
(b) (The executable task type constraint) In the process of the swarm cooperative task execution, different sorts of UAVs perform different types of tasks. There is a mapping between the UAV capability P i = P i,scout , P i,attack and M t = {Scout, Attack}, which can be expressed as (c) (The task number constraint) The payload number and energy carried by UAVs have limits; thus, it is necessary to restrict the maximum number of tasks performed by the UAV. Assuming that the number of tasks assigned to UAV V i is N vt,i and the upper limit is N vi,max , the constraint is expressed as Definition 2 (Sequence constraint). If there is a specific execution order between subtasks Task i and Task j , there is sequence constraint between Task i and Task j . Reference [9] gives the concrete model of sequence constraint.
Definition 3 (Time window constraint). The start time when task s i,j in Seq i = {s i1 , s i2 , . . . , s i,Ns,i } is performed by UAV V i needs to be guaranteed to be in the time window t si,j ∈ [t b,j , t e,j ], where t b,j is the earliest start time and t e,j is the latest one. The start time t si,j has relations with the last task and the preplanned flight path of the UAV. Suppose t e,j−1 the time when UAV accomplishes the last task and the preplanning air-range from s i,j−1 to s i,j , then the time window constraint can be expressed as Definition 4 (Cooperation constraint). For the process of several UAVs cooperatively performing reconnaissance or attack task Task j , the expected number of participants N pe,j is introduced, which means that Task j can be accomplished by N pe,j UAVs at most. The actual number of participants is N p,j and has 0 ≤ N p,j ≤ N pe,j Definition 5 (The dynamic task allocation problem). The objective is to find the best assignment.
To be more concise is to optimize the swarm's reward B s during the task execution, such that: subject to the constraints: where the value of B ij indicates the reward of UAV i performing the task j; the survivability estimation is h i,est , which means more loss to the UAV performing the task; the air-range performing Task j is L ij ; the start time of task j is t task j .
Due to the objective function coupling with the process of contract net protocol, the detailed expression is designed in Section 3.2, where the bidding function of the market mechanism is introduced.

Task Assignment Algorithm Based on Extended CNP
This section designs a distributed dynamic task assignment algorithm based on extended contract network protocol. The core of contract net protocol (CNP) is to simulate the "bid-win" market mechanism and realize the optimization of task assignment based on the interaction of individuals. The classical CNP is not suitable for sequential task assignments with multiple constraints under multiple rounds, which means that it needs extending according to complex task constraints.

Distributed Multi-Constraint Dynamic Task Assignment Algorithm
The algorithm includes four steps: target information release, bidding scheme generation, bid winning authorization, and task execution. The process is shown in Figure 3. The following describes the algorithm process in turn.
Step 1: Release the information of targets Assume that the UAV detects a sudden target T k and reports the target information to the subset leader UAV V i , which becomes the tendering UAV on behalf of the subset, and sends a bidding invitation to each subset in the local communication network.
According to the hierarchical communication topology, the set of other subset lead- composes the potential bidders of assignment for target T k . Tendering UAV V i releases tendering information I i to each UAV in set V p,i , and I i is expressed as where V i is the index of tendering UAV; T k is the index of the sudden target; {Task k } is denoted as the subtask set of target T k ; t now is the releasing time; H b is the information state flag, of which value 0 means no relay, otherwise 1. The information structure of Task k can be denoted as: where M t,k means task type; q t,k is the position coordinates; TimeBar k = [t b,k , t e,k ] is the time window; R x,k is the maximum task value; N pe,j is the expected number of participants; Th k is the negotiation threshold.

Task Assignment Algorithm Based on Extended CNP
This section designs a distributed dynamic task assignment algorithm based on extended contract network protocol. The core of contract net protocol (CNP) is to simulate the "bid-win" market mechanism and realize the optimization of task assignment based on the interaction of individuals. The classical CNP is not suitable for sequential task assignments with multiple constraints under multiple rounds, which means that it needs extending according to complex task constraints.

Distributed Multi-Constraint Dynamic Task Assignment Algorithm
The algorithm includes four steps: target information release, bidding scheme generation, bid winning authorization, and task execution. The process is shown in Figure 3. The following describes the algorithm process in turn. Step 1: Release the information of targets Assume that the UAV detects a sudden target k T and reports the target information to the subset leader UAV i V , which becomes the tendering UAV on behalf of the subset, and sends a bidding invitation to each subset in the local communication network. According to the hierarchical communication topology, the set of other subset leaders composes the potential bidders of assignment for target k T . Tendering UAV i V releases tendering in- where i V is the index of tendering UAV; k T is the index of the sudden target; { } k Task is denoted as the subtask set of target k T ; now t is the releasing time; b H is the information state flag, of which value 0 means no relay, otherwise 1. The information structure of k Task can be denoted as: As attached information during the subtask Task k assignment process, negotiation threshold Th k is applied to preselect bidders from the potential bidder set V p,i , reducing the negotiation scale as well as the consumption of communication resources and improving assignment efficiency. To adjust the threshold adaptively, the reward of subtask Task k in performing the subset to which UAV V i belongs is selected as Th k . If the bidder's bidding value is greater than Th k , it indicates that the swarm efficiency will be optimized and improved after Task k is assigned to the bidder.
In the process of information release, different UAV groups with intersections of local communication topologies may discover the same target, causing multiple bidding UAVs to release information at the same time in their respective local communication topologies, resulting in system conflict and resource waste. In order to avoid this problem, it is necessary to ensure that different UAV subsets reach a consensus on tendering UAVs and tendering information, which is realized by Algorithm 1.
In Algorithm 1, "StopCmd" means to abort the negotiation command, and the operation "." represents the reference to elements in the information structure. For any UAV V i in the local communication topology, the tendering information related to subtask Task k will be released to its directly connected UAV if it is not empty and has not been transmitted (Line 1-4). Meanwhile, the UAV can also receive the tendering information related to Task k transmitted by others directly connected with it (Line 6-11).
Algorithm 1: Release tendering information and achieve information consensus.
broadcast I i to V p,i 4: endif 5: endif 6: forj = 1 to number of tendering Task k invitation received 7: if I i .Task k .Th k < I j .Task k .Th k 8: broadcast StopCmd to V p,i − V p,j 10: endif 11: endfor If UAV V i finds that the negotiation threshold of UAV V j about Task k is greater, V i saves the tendering information I j and issues commands to other UAV groups interacted with V i but not interacted with V j to stop the negotiation so as to make them exit the assignment dominated by UAV V j . After Step 1, the tendering information released in the local communication network achieves consensus, that is I i = I j .
Step 2: Generate bidding scheme On the basis of the target information and various constraints, each potential bidder first determines the bidding scheme for the target of the group, including whether the subset participates in the bidding for target T k , subtasks that can be performed and the corresponding UAVs, and the reward for performing each subtask, and so forth.
Through the contract network in subsets, each subtask of target T k is preassigned to form the bidding scheme for target T k . The specific process is as follows: 1 A subset leader UAV V j releases subtask information to each follower UAV. In order to improve the assignment efficiency and shorten the time, the task concurrency mechanism is introduced to publish the information of each subtask at the same time; 2 For subtask Task k , the follower UAV V m judges whether it has the corresponding type of payload, whether the number of payloads can meet the task execution requirements, and whether it meets the time window TimeBar k according to the subtask information. If any constraint is not satisfied, UAV V m will not bid for subtask Task k ; 3 If the above constraints are met, UAV V m preplans the flight path of Task k based on the modified artificial potential field (MAP) method and substitutes the preplanned range L mk and survivability estimation h m,est into the individual bidding function to calculate the bidding value B mk ; 4 Compare the bidding value B mk with the subtask negotiation threshold Th k . If B mk < Th k , it means that the system efficiency has not been improved when UAV V m is used to perform subtask Task k , and V m actively abandons pre-assignment bidding for Task k ; otherwise, V m participates in the bidding; 5 Each follower UAV respectively performs steps 2 -4 to complete the pre-assignment of each subtask. The subset leader UAV V j generates the subset's bidding scheme for target T k according to the pre-assignment results.
The above is the basic process of bidding scheme generation. Due to the existence of multi-UAV cooperatively performing subtasks and the introduction of the task concurrency mechanism, the generation of the bidding scheme needs to solve a "multi-participantsmulti-tasks" assignment optimization subproblem.
In order to solve the subproblem, an assignment mechanism based on the contract network within subsets is constructed. For the subtasks that need to be executed by multiple UAVs, a cooperator determination mechanism is introduced to complete the task allocation; for the sequential subtasks with time windows, a sequential task selection mechanism is introduced. Details are as follows: (1) The determination mechanism on cooperators The process of the determination mechanism on cooperators is shown in Figure 4. To simplify the assignment process, give the tenderee the initiative, expand the set of bidders, and provide more feasible pre-assignment schemes, the tenderee bidding mechanism is introduced, that is, when the subtask tenderee (subset leader UAV V j ) meets conditions such as capability constraints and time constraints, it can participate in bidding.
where ( ), in descending order. The winner set k Winner is correspondingly: (2) Sequential task selection mechanism Take the sequential task assignment process of a single follower UAV as an example. After receiving the task information, the bidder determines the executable tasks according to the negotiation threshold, UAV capability constraints, and the execution sequence and combines them to generate an alternative sequence without a time window conflict. Based on the bid winning situation, the optimal sequence is selected as the final signing one. The operation process is shown in Figure 5.
Assume that the concurrent task set = { , … , } is received by the follower UAV m V . The set of tasks that m V can execute and determine to participate in bidding is expressed as   If V j meets the constraints for performing Task k and decides to bid with the bidding value B jk , then Th is chosen as B jk . UAV V j sends Task k information and negotiation threshold B jk to each follower UAV. The bidding value of follower UAV V m for Task k is B mk . If B mk > B jk , V m decides to bid and feedback B mk to V j . At the time, the set of all bidders participating in the Task k assignment is If tenderee V j does not participate in the bidding, i.e., B jk = ∅, To sum up, after preselection of negotiation threshold, all bidders participating in the assignment for Task k can be represented as Consider the cooperative constraints of subtask Task k , assume Task k requires the participation of N p,k UAVs, and quickly sort the bidding value set B jk . The greedy algorithm is used to select the N p,k largest bidding values in the set to form the winning bidding value set (reward set) B k where B (x),k represents the x-th order element of {B mk } in descending order. The winner set Winner k is correspondingly: (2) Sequential task selection mechanism Take the sequential task assignment process of a single follower UAV as an example. After receiving the task information, the bidder determines the executable tasks according to the negotiation threshold, UAV capability constraints, and the execution sequence and combines them to generate an alternative sequence without a time window conflict. Based on the bid winning situation, the optimal sequence is selected as the final signing one. The operation process is shown in Figure 5.
where sj N is the number of task sequence alternatives. After the bidding is completed, the set of losing bidding tasks is denoted by   (15) where N a,m is the element number of Task a,m . Denote Comb n (N a,m , N vm,n ) as the combination which consists of random N vm,n elements from set {1, 2, . . . , N a,m }, where N vm,n ≤ N a,m .
Definition 6 (Task Sequence Alternative). If ∀k ∈ Comb n (N a,m , N vm,n ), ∀k ∈ Comb n (N a,m , N vm,n ) − {k}, there is TimeBar k ∩ TimeBar k = ∅. Then, Comb n (N a,m , N vm,n ) is called a sequence alternative. TimeBar k is the time window of subtask Task a,m k . The corresponding task sequence alternative is defined as where N sj is the number of task sequence alternatives.
After the bidding is completed, the set of losing bidding tasks is denoted by Task de,m . After the sequences containing losing bidding tasks are eliminated, the set composed of the remaining sequence alternatives is Assuming that the bidding value of V m for any subtask Task a,m k in Seq m n is B mk , where Seq m n ∈ SeqSet m , the sum of bidding value for each task in Seq m n is and the final signing sequence of follower UAV V m is Through the above mechanism, the subtask pre-assignment scheme of the subset in which V j is located is generated, that is, the bidding scheme of the subset After that, UAV V j calculates the bidding function of the subset according to the bidding scheme and bids to the tenderee V i .
Step 3: Determine the winners After the bidding scheme generation and bidding application in Step 2, the tendering UAV V i selects the scheme of which the efficiency is greatest according to the bidding value of each group so as to determine which subset executes subtasks of target T k .
The set of bidding values of subsets is B g,jk . Apply the greedy algorithm and select the greatest value and corresponding subset as the winning value (reward) B g,k and the winner Winner g,k . The process can be expressed mathematically as After determining the winner, UAV V i authorizes the subset Winner g,k to perform each subtask of target T k .
Step 4: Perform the tasks The winner subset formally authorizes each follower UAV in the subset to perform the subtasks, and the pre-assignment scheme in Step 2 becomes the formal assignment scheme. Follower UAV V m will add the signing subtask sequence Seq win,m to its task sequence to be executed, that is: where A m is the task sequence to be executed, ⊕ expresses the operation that it adds the sequence Seq win,m to the sequence A m . Each UAV performs each task according to sequence A m and the preplanning flight path in the specific time window. The pseudo-code of the whole algorithm 2 process described above is as follows: for i from the first index of leader UAVs to the last one 3.
if V i is a target tenderee UAV 4: {V p,i } = detTargetPotentialBidders(G 0 ,C) /* determine the set of potential bidder subsets. */ 5: for k = 1 to number of targets 6: if T k is tendered by leader UAV i 7: {Task k } = generateSubtasks(T k ) /* Tenderee UAV i generates subtask information. */ 8: end if 9: end for 10: for i from the first index of tenderee leader UAVs to the last one 16: if V j belongs to {V p,i } 17: Receive I i and broadcast it to V j 's followers 18: end if 19: end for 20: for m from the first index of followers of V j to the last one for m = 1 to number of follower UAV m of Subset n 37: A m = A m ⊕ Seq win,m /* Add the signing subtask sequence to task execution sequence A m . */ 38: end for 39: end for Analyze the worst time complexity of the algorithm and take the case of task assignment by the top leader as an example: The time complexity of the top leader issuing N T targets with subtasks bidding information to N G subset leaders is O(N T N G ), the complexity of the initial evaluation of 4 types of constraints presented in Section 2.5 by N G subset leaders is 4O(N T N G ), the complexity of the bidding of potential bidder subsets {V p,i } is O(K), where K is the number of elements in {V p,i }; after K potential bidder subsets are determined, each potential bidder subset needs to pre-assign the subtasks and generate the bidding scheme of the subset.
Assume that each target has N t subtasks, each subtask needs the most N p participants and each subset consists of (N f + 1) UAVs. Each subset will generate the target scheme based on the CNP within the subset. The time complexity of the subset leaders issuing N t subtasks to their N f followers is O(N T N t N f ). The sequential task selection is an arrangement-combination problem, of which the time complexity is N T •O(N t 3 ), and the time complexity of bidding to the subset leader in each subset is O(N T N t N f ). Subset-leader-selecting cooperators can be regarded as a sorting problem, and the quick sort algorithm can be adopted so that the time complexity is N T N t •O(N p log 2 N p ). Therefore, the time complexity of the subtask pre-assignment is 2O (N T N t N After the bidding schemes of each subset are generated, the bidding winner subset will be determined. It is a quick sort process, so the time complexity is N T •O(N G log 2 N G ).
To conclude, the whole worst time complexity is 2O( . It indicates that the algorithm is a polynomial one.

Bidding Function Design
As the core of extended CNP, the bidding function, which needs to be designed on the basis of the concrete task assignment problem in CNP, is a sort of objective function. According to the method process described above, the whole task assignment is divided into the target assignment and the subtask assignment. Both the target assignment and the subtask assignment are based on the extended CNP. Hence, the bidding function of each subset is designed for the target assignment, while the individual bidding function within the group is designed for the subtask assignment.

Individual Bidding Function
The individual bidding function B ij consists of value function Re ij and penalty function Pe ij . Based on the analysis for the UAV swarm task assignment model in Section 2, the individual bidding function mainly relates to: 1 the maximum task values, which is denoted in Section 2.5; 2 the flight path; 3 the time windows and start time of each subtask.
Since the UAV task assignment couples with path planning, the bidding function needs to be designed in combination with the UAV flight path. By analyzing the scenario, it can be seen that the impact of the flight path on task assignment is mainly reflected in UAV survivability estimation h i,est and air-range L ij (fuel consumption), as shown in Figure 6. into the target assignment and the subtask assignment. Both the target assignment and the subtask assignment are based on the extended CNP. Hence, the bidding function of each subset is designed for the target assignment, while the individual bidding function within the group is designed for the subtask assignment.

Individual Bidding Function
The individual bidding function Bij consists of value function Reij and penalty function Peij. Based on the analysis for the UAV swarm task assignment model in Section 2, the individual bidding function mainly relates to: ① the maximum task values, which is denoted in Section 2.5; ② the flight path; ③ the time windows and start time of each subtask.
Since the UAV task assignment couples with path planning, the bidding function needs to be designed in combination with the UAV flight path. By analyzing the scenario, it can be seen that the impact of the flight path on task assignment is mainly reflected in UAV survivability estimation ,     Supposing that UAV V i participates in the bidding process of subtask Task j with time window t task j ∈ [t s,j , t e,j ], where t task j is the start time of task execution, of which the mathematical expression is given in Section 2.5, t s,j is the earliest start time, and t e,j is the latest one.
To evaluate the impact of threats {O k | k = 1, 2, . . . , N obs } on UAV V i performing tasks, it introduces the survivability estimation of V i , which can be expressed as where h i is the current survivability of V i , A k,app is the impact of threats O k,app ∈ {O k } approached by V i , A k,app ∈ (0, 1), and N app is the number of threats approached.
(1) Value function Re ij In the actual scenario, the value of UAVs performing any task is generally related to the start time when the UAV performs the task. The nearer the start time t task j to the time window TimeBar k , the greater the value for UAV V i to perform the task; otherwise, the smaller the value; hence, the item related to the start time t task j is introduced. The value function of V i performing Task j is designed as where R x,j is the maximum value of Task j ; λ is the attenuation factor of the start time t task j on the task value. Apparently, Re ij is a monotonic increasing function of battlefield survivability h i,est and decreases monotonically with the start time t task j . When h i,est : 1 → 0, t task j : t s,j → t e,j , there is Re ij : R x,j → 0 .
(2) Penalty function Pe ij The penalty function is composed of the consumption penalty and the threat penalty. Assuming that the per-unit fuel consumption of UAV V i is F i , the air-range performing Task j is L ij , the estimation of survivability is h i,est , and the penalty function is designed as Obviously, Re ij is a monotonic function of battlefield survivability h i,est . When h i,est : 1 → 0 + , there is Pe ij : F i L ij → +∞ .
The penalty indicates the coupling impact of flight path planning on task assignment. On one hand, the fuel consumption of performing subtask Task j is directly related to the preplanned air-range L ij ; on the other hand, the more threats approached by UAV V i during the task execution, the lower the survivability estimation h i,est , which means more loss when the UAV performs the task.
Combining the value function and the penalty function, the individual bidding function B ij of UAV V i for Task j is denoted by where a greater value of B ij indicates the reward of performing the task. B ij monotonically increases with h i,est and decreases with L ij and t task j , which agrees with the actual scenario, which suggests that B ij has practical significance.

Bidding Function of Each Subset
The bidding function of subsets is based on the individual function. For target T j , supposing that the bidding value set is {B 1 , B 2 } after the subtask assignment in subset G i , B 1 , B 2 respectively express the bidding value of subset G i performing the reconnaissance subtask and the attack one. The bidding function of subsets is defined as the sum of elements in {B 1 , B 2 }, which is

Event Trigger Conditions for Dynamic Tasks
Due to the incomplete perception of the situation at the beginning and the occurrence of emergencies during the task execution, the initial assignment scheme needs to be adjusted. Therefore, the event trigger conditions are introduced to judge whether or not to carry out the dynamic task assignment. Event trigger conditions are the key to realizing dynamic task assignments, which need to be selected in combination with different scenarios. The dynamic task assignment process based on event triggering can be expressed as: where g(s(t), s t,j (t)) ≥ 0 is the triggering condition, s(t) is the state of UAV (such as the position), s t,j (t) is the status of target T j . Target j ← TargetIn f o * j expresses the update of the set of targets, and Task j,k ← TaskIn f o * j,k expresses the update of the set of subtasks. (1) The unknown targets appear The initial target assignment is based on the initial situation awareness information, which can only cover the known targets but is not guaranteed to cover all the targets in the mission area. After the reconnaissance UAV or reconnaissance-attack UAV V i flies near the unknown target T j during task execution, it will detect the target and obtains the target information TargetIn f o new,j and then updates the target set and the subtask set. Event trigger conditions can be described as g(s(t), s t,j (t)) = DA(r i , r nt,j , R detect,i ) where DA(r i , r nt,j , R detect,i ) is defined as the reconnaissance payload constraint, which is the constraint on the relative position and angle relations between UAV V i and target T j . The details are in reference [34]. When target T j is located in the detect area of the reconnaissance-attack UAV or reconnaissance UAV, DA(r i , r nt,j , R detect,i ) ≥ 0; r i is the position vector of UAV V i ; r nt,j is the position vector of target T j ; R detect,i is the detection range of UAV V i . The event-triggering process can be expressed as where Target N target +j ← TargetIn f o new,j indicates the update of target set, N target is the number of targets; Task N target +j,k ← TaskIn f o New,j,k indicates the update of subtask set, N newtask,j is the number of subtasks of T j .
(2) The UAV encounters faults and cannot perform tasks During task execution, UAVs may encounter non-cooperative behaviors such as collision and attack and lose mission capability. Its tasks that have not been executed will be reassigned. Event triggering conditions can be described as where h i is the survivability of V i ; h i,b is the minimum survivability of V i with normal capability and is selected according to the concrete scenario. The event-triggering process can be expressed as where Task j,k ← TaskIn f o i,j,k is the reassignment for the subtasks that V i is to perform.

The Basic Process of Dynamic Task Assignment
Before describing the basic process of cooperative dynamic task assignment, the following assumptions are given for the scenario: 1. Based on the early situation awareness, several targets and pieces of threat information have been obtained, including target location, number of UAVs required to perform each subtask, threat location, and impact range; 2. Due to incomplete situational awareness, there are unknown targets and threats. After the UAV detects an unknown target or threat, it broadcasts the threat information, transmits the target information to the group leader, and triggers the assignment process.
Based on the scenario and assumptions above, the basic process of cooperative dynamic task assignment is shown in Figure 7. The concrete steps are as follows: 1.
Assign the known targets. The top leader assumes the role of the tenderee, dominates the initial assignment, and releases the target information to each group leader based on the inter-group contract network.

2.
Each group leader that has direct communication with the top leader receives the target information, releases the subtask information to their followers, and determines the group's bidding scheme, which is obtained by subtasks pre-assignment based on the group's internal contract network.

3.
The top leader selects the group with the largest bidding value as the bid winner according to the bidding schemes of the group submitted by the group leaders and assigns the target to the group.

4.
According to the assigned target, each subset performs tasks according to the corresponding subtask assignment scheme.

5.
If a UAV fails to perform tasks due to sudden failure, the tasks shall be assigned to other UAVs in this subset first; if no UAV in the subset can continue to perform, the group leader will release the tasks to other subsets, and then others will determine the pre-assignment scheme based on the contract network within the group. The tendering group shall determine the assistance according to each bidding scheme. 6.
If a UAV (including the group leader) detects a sudden target, it shall be reported to the group leader. After receiving the target information, the leader of this subset will release the target to other subsets. Each subset determines the pre-assignment scheme based on the contract network within the group, carries out the bidding based on the inter-group contract network, and, finally, completes the target and subtask assignment. 7.
Repeat steps 4-6 until there is no dynamic change.
Tas Info k ← is the reassignment for the subtasks that i V is to perform.

The Basic Process of Dynamic Task Assignment
Before describing the basic process of cooperative dynamic task assignment, the following assumptions are given for the scenario: 1. Based on the early situation awareness, several targets and pieces of threat information have been obtained, including target location, number of UAVs required to perform each subtask, threat location, and impact range; 2. Due to incomplete situational awareness, there are unknown targets and threats. After the UAV detects an unknown target or threat, it broadcasts the threat information, transmits the target information to the group leader, and triggers the assignment process.
Based on the scenario and assumptions above, the basic process of cooperative dynamic task assignment is shown in Figure 7. The concrete steps are as follows:

Reassign the subtasks of UAV with fault within this group
Bidding Information of each subgroup

Subtasks Information
Each UAV in the group bids for the subtask Bidding Information of each UAV

The Combat Situation of UAV Swarm
Perform tasks Discover the target

Followers
Whether the subgroup takes over ?
Other subgroups determine the preassignment results of subtasks based on the contract network within the group (bidding scheme) The original group determines the assistance subgroup based on the contract network among subgroups

The subgroup releases subtask information to other subgroups
Determine the UAV to take over the subtasks and then complete the reassignment

Yes No
Update the task execution sequence Figure 7. The procedure for cooperative dynamic task assignment.
1. Assign the known targets. The top leader assumes the role of the tenderee, dominates the initial assignment, and releases the target information to each group leader based on the inter-group contract network. 2. Each group leader that has direct communication with the top leader receives the target information, releases the subtask information to their followers, and determines the group's bidding scheme, which is obtained by subtasks pre-assignment

Numerical Simulation
It is assumed that the swarm consists of 1 top leader and 2 subsets, with a total of 11 UAVs, including 2 reconnaissance-attack UAVs, 4 reconnaissance UAVs, and 4 attack UAVs. Among them, reconnaissance-attack UAVs are the group leaders. Consider the UAV swarm communication topology G 0 , as shown in Figure 8. based on the inter-group contract network, and, finally, completes the target and subtask assignment. 7. Repeat steps 4-6 until there is no dynamic change.

Numerical Simulation
It is assumed that the swarm consists of 1 top leader and 2 subsets, with a total of 11 UAVs, including 2 reconnaissance-attack UAVs, 4 reconnaissance UAVs, and 4 attack UAVs. Among them, reconnaissance-attack UAVs are the group leaders. Consider the UAV swarm communication topology G0, as shown in Figure 8. Each UAV can perform no more than two subtasks, and each subtask is performed jointly by, at most, two UAVs. For flight path preplanning, the UAV kinematics model in reference [35] and the modified artificial potential field method [36][37][38] are used to realize the air-range estimation considering threat avoidance. The capability parameters of each UAV under the scenario are shown in Table 1, and the parameters of reconnaissance payload and attack payload are shown in Tables 2 and 3, respectively.  Each UAV can perform no more than two subtasks, and each subtask is performed jointly by, at most, two UAVs. For flight path preplanning, the UAV kinematics model in reference [35] and the modified artificial potential field method [36][37][38] are used to realize the air-range estimation considering threat avoidance. The capability parameters of each UAV under the scenario are shown in Table 1, and the parameters of reconnaissance payload and attack payload are shown in Tables 2 and 3, respectively.  The feasible area of UAV reconnaissance and attack for a target on the ground, based on the above parameter configuration, is shown in Figure 9. The feasible area of UAV reconnaissance and attack for a target on the ground, based on the above parameter configuration, is shown in Figure 9. Consider a 5 × 5 km mission scenario. The information of known targets and the time window constraints of subtasks randomly generated is shown in Table 4.

The Initial Task Assignment for Known Targets
Assume that the UAV swarm performs the reconnaissance-and-attack tasks at six enemy targets. The location of each UAV, threat, and target is shown in Figure 10. Consider a 5 × 5 km mission scenario. The information of known targets and the time window constraints of subtasks randomly generated is shown in Table 4.

The Initial Task Assignment for Known Targets
Assume that the UAV swarm performs the reconnaissance-and-attack tasks at six enemy targets. The location of each UAV, threat, and target is shown in Figure 10. Purple threats represent known threats, and blue threats represent unknown ones, all of which the coordinates are randomly generated. The targets are marked with "T"; Each UAV is marked with "V", where "S" represents the reconnaissance UAV, "A" represents the attack UAV, and "SA" represents the reconnaissance-attack UAV. Purple threats represent known threats, and blue threats represent unknown ones, all of which the coordinates are randomly generated. The targets are marked with "T"; Each UAV is marked with "V", where "S" represents the reconnaissance UAV, "A" represents the attack UAV, and "SA" represents the reconnaissance-attack UAV.
In the simulation, the maximum value of the reconnaissance subtask is set at 100, the maximum value of the attack subtask is set at 150, and the attenuation factor λ is set at 0.9.
Adopting the designed UAV swarm cooperative dynamic task assignment approach, the sequential task assignment results for known targets are shown in Table 5. The task execution plan of each UAV is expressed in the format of (Target, Subtask type, Start time (s), Winning bidding value). According to the known threat information and the unknown threat information detected by reconnaissance UAV during mission execution, the modified artificial potential field method is adopted to avoid local optimization, and the preplanning flight path considering threat avoidance during mission execution can be realized. Combined with the UAV swarm task assignment results, the preplanned path, and the task sequence, the swarm task execution diagram can be obtained, as shown in Figure 11. As can be seen in Figure 11, the cooperative task assignment approaches can realize the "reconnaissance-attack" coverage of known targets under the consideration of flight path planning coupling and task time window constraints.

Dynamic TASK Assignment for Sudden Targets
Considering two unknown targets, T7 and T8, the swarm discovers targets through cooperative detection and then assigns tasks. The information of T7 and T8 is shown in Table 6, and the initial operational situation is shown in Figure 12. As can be seen in Figure 11, the cooperative task assignment approaches can realize the "reconnaissance-attack" coverage of known targets under the consideration of flight path planning coupling and task time window constraints.

Dynamic TASK Assignment for Sudden Targets
Considering two unknown targets, T7 and T8, the swarm discovers targets through cooperative detection and then assigns tasks. The information of T7 and T8 is shown in Table 6, and the initial operational situation is shown in Figure 12. (a) (b) Figure 11. (a) The execution sequence of the UAV swarm; (b) the diagram of the UAV swarm performing tasks.
As can be seen in Figure 11, the cooperative task assignment approaches can realize the "reconnaissance-attack" coverage of known targets under the consideration of flight path planning coupling and task time window constraints.

Dynamic TASK Assignment for Sudden Targets
Considering two unknown targets, T7 and T8, the swarm discovers targets through cooperative detection and then assigns tasks. The information of T7 and T8 is shown in Table 6, and the initial operational situation is shown in Figure 12.  The time when unknown targets are discovered by the UAVs and the corresponding subsets that discover the targets are shown in Table 7. The generated subtask time window constraints are shown in Table 7 as well. The sequential task assignment results for the unknown targets are shown in Table 8. The swarm realizes the coverage of sudden targets through the distributed cooperative dynamic task allocation mechanism after the reconnaissance UAV V8, belonging to Subset 1, and the reconnaissance UAV V5, belonging to Subset 2, detect sudden targets T7 and T8, respectively, during task execution.
The concrete analysis is as follows: The reconnaissance UAV V4 and attack UAV V6, belonging to Subset 1, is assigned to perform the subtasks of sudden target T8 successively in the corresponding time window. The reconnaissance UAV V8 and reconnaissance-attack UAV V3, belonging to Subset 2, successively perform the subtasks of sudden target T7 in the corresponding time window so as to realize the "reconnaissance-strike" coverage of each sudden target. We combine the assignment results with the preplanning flight path and task execution sequence based on the artificial potential field method. The diagrams of UAV swarm task execution and the execution sequence under sudden targets are shown in Figure 13.  Figure 13 indicates that through the dynamic task assignment approach based on the extended CNP, the swarm can mobilize the UAVs with task capability and the best execution effect obtained after bidding negotiation to complete tasks for each sudden target according to the time window.

Reassignment for Subtasks of Failed UAV
During the simulation, the reconnaissance UAV V5, belonging to Subset 1, fails and loses the capability to perform tasks. The failure time is 97.5 s.
According to the assignment results in Section 5.1, the reconnaissance UAV V5 prepares to perform the reconnaissance subtask. The fault of V5 triggers dynamic task assignment, and the tasks (T2, s, 117.5, 62.14) → (T6, s, 167.0, 59.20) of V5 become dynamic tasks. The bidding values of each group of potential bidders (including V2, V4, V3, and V8) are shown in Table 9. The reassignment results of failed UAV subtasks obtained by the designed assignment approach are shown in Table 10.   Figure 13 indicates that through the dynamic task assignment approach based on the extended CNP, the swarm can mobilize the UAVs with task capability and the best execution effect obtained after bidding negotiation to complete tasks for each sudden target according to the time window.

Reassignment for Subtasks of Failed UAV
During the simulation, the reconnaissance UAV V5, belonging to Subset 1, fails and loses the capability to perform tasks. The failure time is 97.5 s.
According to the assignment results in Section 5.1, the reconnaissance UAV V5 prepares to perform the reconnaissance subtask. The fault of V5 triggers dynamic task assignment, and the tasks (T2, s, 117.5, 62.14)→(T6, s, 167.0, 59.20) of V5 become dynamic tasks. The bidding values of each group of potential bidders (including V2, V4, V3, and V8) are shown in Table 9. The reassignment results of failed UAV subtasks obtained by the designed assignment approach are shown in Table 10. The task assignment results in Table 9 show that UAV V4 of Subset 1 and UAV V8 of Subset 2 replace UAV V5 and continue to perform the tasks, respectively.
Combined with the assignment results, the diagrams of UAV swarm task execution and the execution sequence under UAV V5 failure are shown in Figure 14. The explanation of the assignment result is as follows: after the reconnaissance, UAV V5 loses its mission capability, and its subtasks shall be preferentially executed by other reconnaissance UAVs or reconnaissance UAVs (i.e., V2 and V4) in Subset 1. It can be seen from Figure 14 (a) that after the initial assignment in Section 4.1, the number of tasks that can be performed by UAV V4 is 1. Therefore, through the contract network within the group, it can undertake one reconnaissance subtask of V5. At this time, V2 is executing the attack subtask T1(a) according to the initial allocation results. During this execution, it crosses several threat areas, resulting in low survivability estimation, and the bidding value is negative, which is not suitable to continue to perform the subtask. Therefore, the leader UAV V2 of Subset 1 releases the information to Subset 2 for assistance through the contract network among the groups. Subset 2 conducts bidding negotiation through the contract network within the group and finally assigns UAV V8 to assist Subset 1 to take over reconnaissance subtask T6 (s).

The Analysis of the Real-Time Performance of the Assignment Approach
All the simulation experiments have been implemented on a personal PC; the parameters are Intel Core i5-5350U CPU @ 1.80 GHz 8 GB RAM, and the programming environment is MATLAB 2018b. The explanation of the assignment result is as follows: after the reconnaissance, UAV V5 loses its mission capability, and its subtasks shall be preferentially executed by other reconnaissance UAVs or reconnaissance UAVs (i.e., V2 and V4) in Subset 1. It can be seen from Figure 14a that after the initial assignment in Section 4.1, the number of tasks that can be performed by UAV V4 is 1. Therefore, through the contract network within the group, it can undertake one reconnaissance subtask of V5. At this time, V2 is executing the attack subtask T1(a) according to the initial allocation results. During this execution, it crosses several threat areas, resulting in low survivability estimation, and the bidding value is negative, which is not suitable to continue to perform the subtask. Therefore, the leader UAV V2 of Subset 1 releases the information to Subset 2 for assistance through the contract network among the groups. Subset 2 conducts bidding negotiation through the contract network within the group and finally assigns UAV V8 to assist Subset 1 to take over reconnaissance subtask T6 (s).

The Analysis of the Real-Time Performance of the Assignment Approach
All the simulation experiments have been implemented on a personal PC; the parameters are Intel Core i5-5350U CPU @ 1.80 GHz 8 GB RAM, and the programming environment is MATLAB 2018b.

Real-Time Performance with Different Problem Scales
The real-time performance of the assignment approach is mainly influenced by three factors: 1 the number of subsets of the UAV swarm; 2 the number of UAVs in each subset; 3 the number of targets.
To illustrate the impact of the factors above, the variable-controlling method is adopted. The details of simulation cases to be compared are in Table 11. Correspondingly, the comparison of assignment times in different cases is shown in Figure 15. Table 11. The simulation cases to be compared.

Number of Targets
The Size of the UAV Swarm According to the comparison among the simulation, on one hand, due to the slowly increasing tendency of the assignment time in Figure 15a,b, it can be concluded that the real-time performance of the proposed approach has low sensitivity with the size of the UAV swarm. On the other hand, comparing (a) with (b), the task assignment time is more sensitive with the number of subsets than with the number of UAVs of each subset.
Moreover, according to Figure 15c, the task assignment time is sensitive to the number of targets, which indicates that the performance of the approach may become worse with the number of targets increasing. According to the comparison among the simulation, on one hand, due to the slowly increasing tendency of the assignment time in Figure 15a,b, it can be concluded that the real-time performance of the proposed approach has low sensitivity with the size of the UAV swarm. On the other hand, comparing (a) with (b), the task assignment time is more sensitive with the number of subsets than with the number of UAVs of each subset.
Moreover, according to Figure 15c, the task assignment time is sensitive to the number of targets, which indicates that the performance of the approach may become worse with the number of targets increasing.

Algorithm Comparison
In order to verify the effectiveness of the distributed approach based on contract network protocol (CNP) in solving the UAV swarm task assignment problem, it is compared with the centralized task assignment approach used in reference [10]. Scenarios are designed with different sizes of UAV swarm performing multiple task assignments. From the simulation results, both the centralized approach (ACO) and the distributed approach (CNP) are able to obtain the solution to the UAV swarm task assignment problem. However, the distributed approach (CNP) has an obvious advantage in terms of solution efficiency. The solution time for different sized assignment problems is shown in Table 12. Remark: Generally, a global optimal solution to such problems can rarely be obtained. Therefore, feasible solutions to the task assignment problem obtained in the solving process are considered in general.
As a heuristic algorithm, ACO searches in the solution space, learns from the results of each iteration, and finally converges to a feasible solution, which means that ACO requires a lot of computational resources and a much longer time. Simulation results show that this problem becomes more pronounced when the problem size (e.g., size of the UAV swarm, the number of targets) increases.
In contrast to heuristic algorithms such as ACO, CNP merely performs the optimization by bidding on each subset of UAVs as well as UAV individuals without the iterative process of searching for feasible solutions in a large solution space.
The results illustrate that, as a distributed assignment approach, the proposed method in this paper has advantages in real-time performance compared with the ACO proposed in reference [10], which proves the effectiveness of the method to some extent.

Conclusions
Aiming at the problem of the cooperative reconnaissance-attack task assignment of UAV swarms in complex environments, this paper proposes a distributed grouping cooperative dynamic task assignment approach by considering multiple constraints, realizes the effective assignment of cooperative reconnaissance-attack tasks to multiple targets, and optimizes the combat effectiveness of the swarm. The main conclusions include: (1) The proposed extended CNP algorithm, which is based on the determination mechanism of cooperators and the selection mechanism of sequential tasks, with the bidding function considering the constraints of sequence, flight path, and threat; it can