2. Related Works
This section presents the related works, which consist of UAVaided communication and the AoI in IoT systems.
Table 1 depicts the comparison of the current work with other stateoftheart approaches.
In recent years, there has been a growing interest in leveraging UAVs as an auxiliary method for data collection within the IoT domain. Some articles focus on data transmission in communication. Refs. [
3,
7] proposed UAVassisted intelligent systems that can collect data packets from vehicles. Refs. [
2,
5] analyzed the communication between UAVs and ground sensors.
Some studies focused on the energy consumption of UAVs. Zeng et al. in [
10] proposed that the propulsion energy consumption of UAVs is determined by their flight speed and acceleration. The authors maximized the data transmission rate while minimizing energy consumption, and energyefficient systems could be designed. In addition, Yang et al. in [
11] considered the energy efficiency of the system and also optimized the flight trajectory of the UAV. The team jointly considered the UAV throughput and propulsion energy consumption. The flight path, transmission power, and flight speed of the UAV were optimized to maximize the throughput. Che et al. in [
21] proposed UAVassisted wireless energy transmission and wireless information transmission modes, where the UAV transmitted wireless information and energy to a lowpower terminal. The authors in [
18] proposed a continuous and realtime path planning model and a task allocation model, where heterogeneous teams of UAVs from different BSs are used to collect readings from ground sensors and pass these readings to ground sensors.
UAVs are highly susceptible to cyberattacks due to their open operational characteristics, leading to significant security vulnerabilities, including cyberattacks and eavesdropping on navigation and communication links. Considering the widespread use of UAVs, the demands for UAV communication security escalated significantly. Military UAVs are relatively secure, and in [
22], the authors proposed a secure UAV communication system specifically designed for military environments. This system ensures perfect forward secrecy, maintains secure UAVtoUAV (and UAVtoglobal control system) communications, and supports nonrepudiation. However, all other UAVs are vulnerable to being hijacked or misused, similar to any other connected device. In [
19], the focus was on the security challenges related to UAV usage. They aimed to identify the primary types of security attacks that might target UAVs and explored various countermeasures that could be implemented to address these threats and attacks effectively. The authors in [
23] addressed the issue of secure communication between UAVs and multiple ground users. They proposed a Qlearningbased approach aimed at maximizing the average secrecy rate (ASR) and enhancing the overall security of the communication system.
When UAVs operate with a certain level of autonomy, the careful planning of task execution and resource optimization becomes crucial to achieve specific objectives. In [
20], the authors proposed a UAV swarm communication model for search and rescue applications, utilizing machine learning methods. They analyzed a dataset comprising five triangular swarm formations using the Kmeans clustering method and studied dendrograms to identify correct swarm formations. In [
24], a UAV swarm model was developed with a multilevelbased clustering approach. The authors proposed a treebased multistage scheme employing clustering localization and designed a localization algorithm using a coalitional game framework to explore the model’s features. In [
25], the authors enhanced the multiUAV collaborative tasking algorithm by incorporating fuzzy mean (FCM) clustering and ant colony optimization (ACO) algorithm concepts. Qu et al. in [
26] investigated the challenge of efficient edge intelligence (eEIC) within a UAV swarm network clustering context. They focused on jointly optimizing computation resource allocation and UAV clustering to minimize the total energy consumption of the UAV swarm.
AoI is considered a key performance metric in UAVassisted IoT systems. Dai et al. in [
9] jointly considered the amount of collected data, geographic fairness, and energy consumption and utilized data durability to ensure its freshness. In [
2], Dai et al. proposed using MUMIMO techniques between UAVs and sensor nodes to collect data and minimize the average AoI, characterizing the freshness of the system.
Furthermore, both [
2,
9] focused on optimizing the overall AoI of the system. Zhang et al. in [
6] considered the sensing time, transmission time, and UAV path optimization to minimize the total AoI of the tasks. Liu et al. in [
5] defined the sum of data upload time and UAV flight time for all sensor nodes as AoI and optimized both the peak and average AoI.
However, little research has considered the relative freshness of information from tasks with diverse update periods. We need to consider not only the diverse needs of different tasks and the optimization of the flight trajectories and flight speeds of UAVs. In addition, we need to achieve a tradeoff between the energy consumption and the AoI of tasks.
3. System Model
As shown in
Figure 1, we consider a UAVassisted sensing data collection system consisting of one BS, several UAVs, and multiple sensor nodes. Let
$\mathcal{N}=\{1,2,\dots ,N\}$ and
$\mathcal{M}=\{1,2,\dots ,M\}$ denote the set of UAVs and sensor nodes, respectively. UAVs are scheduled to collect data from sensor nodes and transmit the collected data back to the BS. The location of each sensor node
$j\in \mathcal{M}$ and the BS is represented by three coordinates as
${l}_{j}^{sn}=({x}_{j}^{sn},{y}_{j}^{sn},0)$ and
${l}^{bs}=({x}^{bs},{y}^{bs},{H}^{bs})$, respectively. We consider a timeslotted system with
$\mathcal{T}=\{1,2,\dots ,T\}$, and the time duration of each time slot is denoted as
${t}_{f}$.
We assume that UAVs fly at a fixed altitude H. Then, the UAV trajectory can be considered twodimensional movement on the horizontal plane. At each time slot t, UAV $i\in \mathcal{N}$ has two stop locations denoted as ${l}_{i,1}^{uav}(t)=({x}_{i,1}^{uav}(t),{y}_{i,1}^{uav}(t),H)$ and ${l}_{i,2}^{uav}(t)=({x}_{i,2}^{uav}(t),{y}_{i,2}^{uav}(t),H)$, respectively. At the first stop location ${l}_{i,1}^{uav}(t)$, UAV i is arranged to collect data from sensor nodes. At the second stop location ${l}_{i,2}^{uav}(t)$, UAV i transmits the collected data to the BS.
3.1. Channel Models
Channel model between UAV and sensor node: We consider both lineofsight (LoS) and nonlineofsight (NLoS) channels between UAVs and sensor nodes. According to the channel modeling in [
27], the probability that there exists LoS and NLoS link between UAV
i and sensor node
j can be expressed as
and
respectively, where
a and
b are environment parameters.
${d}_{i}^{j}(t)$ is the distance between UAV
i and sensor node
j, which can be expressed as
The channel gain for the communication channel between UAV
i and sensor node
j can be given as [
27]
where
${f}_{c}$ is the UAVs carrier frequency, and
c is the speed of light.
${\mu}_{los}$ and
${\mu}_{nlos}$ are average additional losses to free space propagation for LoS and NLoS connections, which depend on the environment.
${\beta}_{0}$ is the channel gain at the reference distance
${d}_{0}=1$ m. The data transmission rate of sensor node
j to UAV
i is expressed as [
28]
where
${B}_{i}$ is the bandwidth allocated to UAV
i, and
${\sigma}^{2}$ denotes the noise power.
${P}_{j}(t)$ is the transmission power of sensor node
j.
Channel model between UAV and BS: We consider LoS channels between UAVs and the BS. Therefore, the channel gain between UAV
i and the BS can be expressed as follows [
27]:
where
${d}_{uav,i}^{bs}(t)$ is the distance between UAV
i and the BS,
${d}_{uav,i}^{bs}(t)=\parallel {l}_{i,2}^{uav}(t){l}^{bs}\parallel $. Therefore, the data transmission rate can be expressed as [
28]
where UAV
i transmits data and reuses bandwidth
${B}_{i}$.
${P}_{i}(t)$ is the transmission power of UAV
i.
3.2. UAVs’ Behavior and Features
At each time slot, UAV
i firstly moves to the first stop location to collect data from sensing nodes within its coverage. Then, with the collected sensing data, UAV
i moves to the second stop location and transmits the collected sensing data to the BS. Therefore, we divide the behavior of UAV
i at each time slot into four stages as shown in
Figure 2: the
first movement stage, the
data collection stage, the
second movement stage, and the
data transmission stage.
The energy consumption of UAV i consists of three parts: (1) propulsion energy during two movement stages denoted as ${E}_{i,1}(t)$ and ${E}_{i,3}(t)$ respectively; (2) hovering energy during the data collection stage denoted as ${E}_{i,2}(t)$; and (3) transmission energy during the data transmission stage denoted as ${E}_{i,4}(t)$. The corresponding energy consumption of UAV i at each stage is elaborated in detail as follows.
In summary, when a UAV
$i\in \mathcal{N}$ is arranged to collect data, it either moves or hovers to complete tasks (e.g., data collection or data transmission), consuming different amounts of energy. It is important to note that not all UAVs are assigned to collect sensing data during each time slot. For those UAVs that are not assigned to collect data during a particular time slot (e.g., UAV 1 in
Figure 1), they simply keep hovering with an energy consumption of
${P}_{0}\times {t}_{f}$, where
${P}_{0}$ is the hovering power of each UAV, and
${t}_{f}$ is the duration of one time slot.
3.3. Diverse AoI Requirements of Tasks
In a smart city, government departments have to collect various types of information for a wide range of public services. This information includes environmental monitoring data, traffic information, tourist attractions, the flow of people, parking space information, and so on. Users have different update requirements for each type of information. For example, the parking space availability in the city center may need to be updated more frequently, such as in intervals of minutes. In contrast, environmental monitoring data can be updated periodically, such as in intervals of hours. Due to the diverse AoI requirements of different types of sensing information, corresponding sensing nodes will generate sensing data with varying update periods. The update frequency of sensor node $j\in \mathcal{M}$ is denoted as ${\lambda}_{j}$, and the update period of sensor node j is denoted as ${\nu}_{j}=\frac{1}{{\lambda}_{j}}$. Each sensor node will generate fresh data periodically, and UAVs will be optimally arranged to collect the latest data within one update period ${\nu}_{j}$ for sensor node j. Otherwise, if the data are not collected within the update period, the sensor node will generate new data at the next generation time, and the previous data will become invalid even if they remain uncollected.
In this paper, we propose an efficient scheduling method for sensor nodes to update their sensing data, ensuring the AoI of the data at the BS side and avoiding the invalidity of generated data at the sensor node side. Considering the diverse requirements of different types of information, we optimize the flight trajectories of UAVs to ensure the relative freshness of information according to the specific needs of tasks.
3.4. AoI Evolution
Most of the literature generally focuses on minimizing the age of all information, and a strategy that immediately generates new data once it has been transmitted to its destination can achieve this goal very well. However, minimizing the overall AoI may lead to high costs and significant energy consumption. Moreover, not all types of data need to be updated highly frequently. In this paper, we consider both the diversity of different tasks in terms of the data update period and the AoI of the collected sensing information. We aim to design an efficient data collection scheme that ensures the freshness of information relative to their respective update periods.
Figure 3 depicts the AoI update process of the data generated by sensor node
$j\in \mathcal{M}$. The set of data generation instants is denoted as
${G}_{j}=\{{g}_{j}^{1},{g}_{j}^{2},\dots ,{g}_{j}^{\phi},\dots \}$, where
${g}_{j}^{\phi}=(\phi 1)\times {\nu}_{j}+1$,
$\phi $ is the index of data generated by sensor node
j, and
${\nu}_{j}$ is the time period of sensing data generation for the sensor node
j.
$\{{t}_{j}^{1},{t}_{j}^{2},\dots \}$ is the set of the transmission instants for sensor node
j. For example, for sensor node
j, the data update period
${\nu}_{j}=3$, the first data generation time is
${g}_{j}^{1}=1$, and
${g}_{j}^{\phi}$ will update to
${g}_{j}^{2}={\nu}_{j}+1=4$ when the second sensing data are generated.
All data must be transmitted as soon as possible before new data are generated. Therefore, at time slot
t, based on the uploading decision of sensor node
j, the AoI for sensor node
j will be updated as
As shown in
Figure 3, at the time slot
$t=4$, sensor node
j generates its second sensing data (i.e.,
${g}_{j}^{2}=4$), and it decides not to upload the newly generated data (i.e.,
${\alpha}_{j}(t)=0$). The AoI for sensor node
j increases linearly in this time slot since the BS does not receive new data updates from sensor node
j. Therefore, the corresponding AoI will be updated to
${\Delta}_{j}(t)+1$ at the next time slot
$t+1$. At the time slot
$t=5$, sensor node
j uploads the second sensing data with
${\alpha}_{j}(t)=1$. Thus, at the next time slot
$t+1$, the corresponding AoI is updated to
$t{g}_{j}^{\phi}+1$, which is the time interval from the second data generation instant to the data upload instant plus 1 unit, where
${g}_{j}^{\phi}$ and
t are the second data generation instant and transmission instant, respectively,
${t}_{f}=1$ unit is the time interval from the data transmission instant
t to the time slot
$t+1$, and
$\phi =2$. Therefore at time slot
$t=6$, the AoI is updated to 2.
3.5. Value Function of the Collected Data
For each task, when a sensor node generates new data, the old data become invalid if they are not collected by UAVs. In order to collect more valid data, tasks that need to be updated frequently are more urgent in data collection. At the same time, we aim to minimize the AoI of all tasks. Therefore, we define that the value of the collected data depends on two factors: ${\nu}_{j}$ and ${\Delta}_{j}(t)$, $j\in \mathcal{M}$.
For the sensing data of two tasks with the same update period, the smaller the AoI of the collected sensing data, the higher the value of the sensing data. Additionally, for a task, a smaller update period means that it is more urgent to collect the generated sensing data. Therefore, with the same AoI of the collected sensing data from different tasks, the shorter its update period
${\nu}_{j}$, the higher the value of the collected data. Based on the aforementioned features, we define the value of the collected data from sensor node
j as
where
${\omega}_{1}$ and
${\omega}_{2}$ are parameters used to balance data uploading decisions of sensor nodes with different update periods, for example,
${\omega}_{1}$ can be set to a high value when the update requirements of sensor nodes in the system are more urgent, and vice versa.
$\gamma $ is a scaling parameter about the value of the collected data.
When ${\alpha}_{j}(t)=1$, sensor node j decides to upload sensing data to a UAV, the UAV needs to move to and hover above the sensor node j to collect the sensing data, and the energy consumption during the flight is related to the distance and speed of the flight. As a result, there is a tradeoff between collecting more valid data and minimizing the energy consumption of the UAV.
4. Problem Formulation
Considering the value of all collected data and the energy consumption of all UAVs, we define the system utility function as the value of collected data minus the total energy consumption of all UAVs, which is described as
${\eta}_{i}^{{c}_{k}}(t)=1$ represents that UAV
i is arranged to collect data from sensor nodes of cluster
${c}_{k}$ at time slot
t.
${c}_{k}$ denotes one cluster which covers several sensor nodes. At each time slot
t, the cluster set
$\mathcal{C}(t)=\{{c}_{1},{c}_{2},\dots ,{c}_{k},\dots \}$,
$\forall {c}_{k}\in \mathcal{C}(t)$ is divided according to the upload decisions of sensor nodes, and the details are discussed in
Section 4.2. When UAV
i is not arranged to collect any sensing data (i.e., it will keep hovering at its current location), we have
${\sum}_{{c}_{k}\in C(t)}{\eta}_{i}^{{c}_{k}}(t)=0$.
Our objective is to maximize the system utility given in (
18) while satisfying different data freshness requirements during the whole sensing period. There exists a tradeoff between collecting more valuable data and consuming less energy. Therefore, we optimize the UAVs trajectories, the UAVs flight speeds, and the sensor nodes’ upload decisions with the constraints of diverse AoI requirements. We formulate the whole problem as follows:
The constraint (19a) indicates that each UAV must perform the four stages within a time slot. At time slot t, the data upload decision ${\alpha}_{j}(t),\forall j\in \mathcal{M}$ and the UAV clustermatching decision ${\eta}_{i}^{{c}_{k}}(t),\forall i\in \mathcal{N},\forall {c}_{k}\in \mathcal{C}(t)$ are integer variables in (19b–19d). Sensor node j can only upload data to one UAV at a time, denoted as ${\alpha}_{j}(t)={\sum}_{i\in \mathcal{N}}{\alpha}_{i,j}(t)\le 1$. In case UAV i is arranged to collect data from sensor node j, it is denoted as ${\alpha}_{i,j}(t)=1$; otherwise, ${\alpha}_{i,j}(t)=0$. Therefore, we need to optimize the location of UAVs and try to avoid overlapping coverage of UAVs. The time to collect data ${\tau}_{i,2}(t)$, the time to transmit data ${\tau}_{i,4}(t)$, the movement time ${\tau}_{i,1}(t)$ and ${\tau}_{i,3}(t)$ are noninteger variables no less than zero as are ${v}_{i,1}(t)$ and ${v}_{i,2}(t)$, the flying velocities of UAV i. The speeds of UAVs during the two movement stages cannot exceed the limit in (19f). In order to maintain the freshness of the information, the average AoI cannot exceed the update period of each sensor node as in (19e). The flight speed and flight trajectory require optimal decision making at each time slot. The optimization problem $\mathrm{P}1$ becomes complicated and intractable when all these variables are coupled at each time slot.
Therefore, we decompose problem
$\mathrm{P}1$ into two subproblems
$\mathrm{P}2$ and
$\mathrm{P}3$. As shown in
Figure 4, in problem
$\mathrm{P}2$, we solve the upload decision of sensor nodes given the initial location and flight speed of UAVs. Then, we determine the flight trajectory and flight speed of UAVs in problem
$\mathrm{P}3$, according to the obtained uploading decision of sensor nodes:
Problem $\mathrm{P}3$ is also difficult to solve directly since the variables are complicated. We then decouple problem $\mathrm{P}3$ into two subproblems $\mathrm{P}4$ and $\mathrm{P}5$. $\mathrm{P}4$ is to determine the first stop location of UAVs and the matching outcome $\eta $ while maximizing system utility; the matching algorithm is used to solve this problem. Then we solve the UAVs speed ${v}_{1},{v}_{2}$ and the second stop location in problem $\mathrm{P}5$, which is a convex optimization problem. At last, we perform $\mathrm{P}2$ and $\mathrm{P}3$ iteratively to obtain the solution.
4.1. Data Collection Optimization
The data collection optimization problem
$\mathrm{P}2$ is to solve the uploading decision of sensor nodes as follows:
With distinct requirements for data freshness, each sensor node updates its sensing data with a different update period. To ensure the relative freshness of different types of information, the average AoI must not exceed the update period of sensing data for each sensor node, which is the timeaverage constraint given in (19e). To address this, we employ Lyapunov optimization [
30] and first construct the dynamic virtual queue
${Q}_{j}(t)$, representing the relative update period increment of the AoI for sensor node
j at time slot
t:
where
${\Delta}_{j}(t)$ is the AoI for sensor node
j at time slot
t, and
${\nu}_{j}$ is the time interval between successive data generated at sensor node
j. The larger the difference between them, the lower the freshness of the collected data.
Then, we construct the Lyapunov function denoted as
$L(t)=\frac{1}{2}Q{(t)}^{2}$. In order to keep the virtual queue
$Q(t)$ rate stable at each time slot, the Lyapunov drift [
30] should be minimized as follows:
Our objective is to maximize system utility while ensuring the average AoI constraint in (19e). As the flight speed and the stop location of UAVs are known, we can calculate the energy consumption during the two movement stages of UAVs. Consequently, we only need to focus on energy consumption during the stages of data collection and data transmission. Therefore, at each time slot, our aim is to minimize the Lyapunov drift minus the system utility [
30], which can be expressed as follows:
$\chi $ is a control parameter for a tradeoff between the queue length of the AoI relative increment and the system utility. W is a constant. We assume that UAV i collects data from sensor node j at time slot t.
Theorem 1. At time slot t, given UAV i’s stop location and flight speed, namely ${l}_{i,1}^{uav}(t),{l}_{i,2}^{uav}(t)$, ${v}_{i,1}(t)$, and ${v}_{i,2}(t)$, the optimal uploading decision ${\alpha}_{j}(t)$ is given as Proof of Theorem 1. To minimize the drift minus utility, we need to find the upper bound of the right side of inequality (25). If the virtual queue length ${Q}_{j}(t)$ is no more than $\chi [{F}_{j}(t){P}_{0}\frac{{L}_{j}}{{R}_{i}^{j}(t)}{P}_{i}(t)\frac{{L}_{j}}{{R}_{uav,i}^{bs}(t)}]{(t{g}_{j}^{\phi}{\Delta}_{j}(t))}^{1}{\Delta}_{j}(t)1+{\nu}_{j}$, this means the relative AoI increment of sensor node j is larger, and the urgency of the next data update of sensor node j is much higher. Otherwise, ${\alpha}_{j}(t)=0$. □
4.2. UAV and Cluster Matching Problem
After all sensor nodes decide whether to upload data at time slot
t, we cluster all sensor nodes with
${\alpha}_{j}(t)=1$ using the Kmeans clustering method [
31]. This divides all sensor nodes with
${\alpha}_{j}(t)=1$ into several clusters. The cluster set is denoted as
$\mathcal{C}(t)=\{{c}_{1},{c}_{2},\dots ,{c}_{k},\dots \}$, where each
${c}_{k}\in \mathcal{C}(t)$ includes several sensor nodes. At each time slot, the sensing data from sensor nodes in one cluster are collected by one UAV. Problem
$\mathrm{P}4$ aims to solve the arrangement of the first stop location of UAVs to efficiently collect the sensing data for different clusters:
Since the decision of each sensor node is determined, the problem of maximizing the system utility can be transformed into the problem of minimizing energy consumption. That is, the problem
$\mathrm{P}4$ is equivalent to the following problem:
We apply a onetoone matching algorithm [
32] to solve this problem. With a set of clusters composed of different sensor nodes and a set of UAVs
$\mathcal{N}$, our objective is to decide the outcome of the onetoone matching between the set of clusters and the set of UAVs, denoted as the matching pair set
$\kappa =\{(i,{c}_{k}),\dots \},i\in \mathcal{N},{c}_{k}\in \mathcal{C}(t)$.
The onetoone matching of UAVs and clusters is the result of the first stopping locations of UAVs. UAV i will match with, at most, one of the clusters at each time slot, or fail to match, which means that UAV i keeps hovering at its location in this time slot. If UAV i does not match any cluster, the matching pair is denoted as $(i,{c}_{0})$, where ${c}_{0}$ denotes the unmatched state of each UAV. Cluster ${c}_{k}$ will also match, at most, one UAV, or fail to match, which means that no UAV will go over to cluster ${c}_{k}$ to collect data at this time slot, corresponding to constraint (19c,19d).
Let
${V}_{i}({c}_{k})$ denotes the utility function of UAV
i and the cluster
${c}_{k}$, which is given as
According to the utility function, at each time slot, each UAV can choose one cluster that is most willing to match or stay in place, and the cluster can find the most preferred UAV to pair with. Algorithm 1 gives the detailed process to solve
$\eta (t)$ and matching pair set
$\kappa $. At the beginning, we compute the utility of all UAVs and clusters. Next, for each
$i\in \mathcal{N}$, we find the UAV
i’s preferred cluster
${c}_{k}$ from the set
${\mathcal{C}}^{\u2020}(t)$ based on (29);
${\mathcal{C}}^{\u2020}(t)$ is equivalent to the cluster set
$\mathcal{C}(t)$. Then, for the cluster
${c}_{k}$, when it is successfully matched with UAV
i, UAV
i will move to cluster
${c}_{k}$ for data collection at time slot
t, and
${\eta}_{i}^{{c}_{k}}(t)=1$. Then we remove UAV
i from the set
$\mathcal{N}$ and remove
${c}_{k}$ from
$\mathcal{C}(t)$. If cluster
${c}_{k}$ is not successfully matched with UAV
i, we will delete cluster
${c}_{k}$ from the set
${\mathcal{C}}^{\u2020}(t)$; UAV
i continues to match with the other clusters in the set
${\mathcal{C}}^{\u2020}(t)$ until this set is empty. UAVs that are not successfully matched will stay in place.
Algorithm 1 UAV clustermatching algorithm 
 1:
Compute the utility of all UAVs and clusters based on (29);  2:
Matching pair set $\kappa \leftarrow \varnothing ,{\eta}_{i}^{{c}_{k}}(t)=0,\forall i\in \mathcal{N},\forall {c}_{k}\in \mathcal{C}(t)$;  3:
for each UAV $i\in \mathcal{N}$ do  4:
${\mathcal{C}}^{\u2020}(t)=\mathcal{C}(t)$  5:
while ${\mathcal{C}}^{\u2020}(t)\ne \varnothing $ do  6:
${c}_{k}=argmax\{{V}_{i}({c}_{k}),{c}_{k}\in {\mathcal{C}}^{\u2020}(t)\}$;  7:
$\rho =argmax\{{V}_{i}({c}_{k}),i\in \mathcal{N}\}$;  8:
if $\rho =i$ then  9:
${\eta}_{i}^{{c}_{k}}(t)=1,\kappa \leftarrow (i,{c}_{k})$;  10:
Delete ${c}_{k}$ from $\mathcal{C}(t)$, Delete i from $\mathcal{N}$;  11:
break;  12:
else  13:
Delete ${c}_{k}$ from $\mathcal{C}\u2020(t)$,  14:
end if  15:
end while  16:
end for  17:
return Matching pair set $\kappa $ and $\eta (t)$.

4.3. UAV Trajectory and Speed Optimization
At time slot
t, we obtain the upload decision
$\alpha (t)$ for sensor nodes and the matching variable
$\eta (t)$ for UAVs and sensor clusters. With these determined parameters, the flight speed and flight trajectory of UAVs at each time slot can be solved in the problem
$\mathrm{P}5$:
Since the uploaded decision and matching variable are already determined, we transform the objective function of problem
$\mathrm{P}5$ into minimizing the energy consumption of UAVs with four stages:
It can be proved that the function
${E}_{2}(t)$ is a convex function [
33] and the variables
${v}_{1}$ and
${v}_{2}$ can be solved with the CVX solver. The energy consumption function
${E}_{2}({v}_{i,1},{v}_{i,2})$ of UAV
i is expressed as follows:
Since ${\tau}_{i,2}(t)$ and ${\tau}_{i,4}(t)$ are determined, ${E}_{2}({v}_{i,1},{v}_{i,2})$ is the function with respect to variables ${v}_{i,1}$ and ${v}_{i,2}$.
Theorem 2. The function ${E}_{2}({v}_{i,1},{v}_{i,2})$ is a convex function with respect to ${v}_{i,1},{v}_{i,2}$.
Proof of Theorem 2. The energy consumption function ${E}_{2}({v}_{i,1},{v}_{i,2})$ of UAV i is a function with respect to two variables ${v}_{i,1}$ and ${v}_{i,2}$ with the range $[{v}_{min},{v}_{max}]$. The function ${E}_{2}({v}_{i,1},{v}_{i,2})$ has continuous second derivatives on the definition domain, and $\frac{{\partial}^{2}}{\partial {v}_{i,2}\partial {v}_{i,2}}{E}_{2}$ gives the similar result as in (34).
The secondorder partial derivative matrix of the function
${E}_{2}$ is denoted as follows [
33]:
For
$({v}_{i,1},{v}_{i,2})$ and
$({v}_{o,1},{v}_{o,2})$,
$\forall i,o\in \mathcal{N}$, and
$0\le \theta \le 1$, the following inequality is held [
33]:
□
The firstorder derivative of the function ${E}_{2}$ exists and is continuous, and the secondorder derivative exists and is semipositive definite. We demonstrate that the problem $\mathrm{P}5$ is a convex optimization problem. Therefore, the flight speeds ${v}_{i,1},{v}_{i,2}$ of UAV i can be solved by convex optimization. The second stopping location ${l}_{i,2}^{uav}$ of UAV i can be determined by the flight speeds ${v}_{i,1},{v}_{i,2}$ and movement time ${\tau}_{i,1},{\tau}_{i,3}$ of UAV i.
4.4. Iteration Algorithm
We propose the Algorithm 2 to solve the upload decision
$\alpha (t)$ of the sensor nodes, the trajectories
${l}_{1}^{uav}(t),{l}_{2}^{uav}(t)$, and the flight speeds
${v}_{1}(t),{v}_{2}(t)$ of UAVs at time slot
t. For the first iteration with
$n=1$, the problem
$\mathrm{P}1$ is decoupled into two subproblems:
$\mathrm{P}2$ and
$\mathrm{P}3$. In
$\mathrm{P}2$, we know the initial flight speeds
${v}_{1}^{0}$ and
${v}_{2}^{0}$ of UAVs, which allows us to solve the uploading strategy
${\alpha}^{1}$. Efficient data upload decision for sensor nodes with different update requirements can be achieved using Lyapunov optimization while ensuring the relative AoI for each task.
Algorithm 2 Optimal diversified demands algorithm (ODDA) 
 1:
Input: $Q(t),\Delta (t)$  2:
Output: ${l}_{1}^{uav}(t),{l}_{2}^{uav}(t),U(t)$;  3:
Initialize ${v}_{1}^{0},{v}_{2}^{0}$, ${E}^{0}$, ${l}_{1}^{uav,0},{l}_{2}^{uav,0}$;  4:
$n=1$;  5:
while$\left{E}^{n}{E}^{n1}\right\ge \u03f5$ and $n\le {n}^{max}$ do  6:
Determine the uploading decision ${\alpha}^{n}$ by Lyapunov optimization;  7:
Determine the clusters ${C}^{n}$ for all sensor nodes with ${\alpha}^{n}=1$;  8:
Perform Algorithm 1 to obtain the matching pair set $\kappa $ and the first stop location ${l}_{1}^{uav,n}$ of UAVs;  9:
Perform convex optimization to obtain flight speed ${v}_{1}^{n},{v}_{2}^{n}$ and the second stop location ${l}_{2}^{uav,n}$ of UAVs;  10:
Compute the energy consumption ${E}^{n}$ with (28);  11:
$n=n+1$;  12:
end while  13:
Update the AoI $\Delta (t+1)$ with ( 16);  14:
Update the queue $Q(t+1)$ with (23);  15:
Compute the system utility $U(t)$ with ( 18).

Next, we further decouple the problem $\mathrm{P}3$ into problem $\mathrm{P}4$ and problem $\mathrm{P}5$. Based on the determined upload decision ${\alpha}^{n}$, all sensor nodes with ${\alpha}^{n}=1$ are clustered, and each cluster may serve as the first stop location of UAVs in $\mathrm{P}4$. Notably, each UAV can cover at most one cluster, and sensor nodes in each cluster can upload data to, at most, one UAV. Therefore, by using a onetoone matching algorithm, we can determine the first stop locations ${l}^{uav,n}1$ of UAVs. Subsequently, with the first stop locations of UAVs, the value of the collected data, and the time consumed to upload the data to UAVs, we can transform problem $\mathrm{P}5$ into a convex optimization problem aiming to minimize the energy consumption of UAVs. Solving this convex optimization problem yields the flight speeds ${v}_{1}^{n}$ and ${v}_{2}^{n}$, as well as the second stopping locations of UAVs ${l}^{uav,n}2$.
The first iteration is then completed, and we proceed with subsequent iterations until the difference in energy consumption ${E}^{n}$ of UAVs between two consecutive iterations is less than the given threshold $\u03f5$, or the number of iterations exceeds the maximum specified number of iterations ${n}^{max}$. At that point, the iteration terminates, and we move on to the next time slot $t+1$.
5. Performance Evaluation
In this section, we present simulation results to demonstrate the performance of our proposed method ODDA. We consider a UAVassisted sensing data collection system that consists of one BS,
N UAVs, and
M sensor nodes. The sensor nodes are randomly distributed in a rectangular area with a length of 20 km and a width of 15 km. The whole sensing time is divided into
$T=1000$ time slots. Other parameters are listed in
Table 2.
Figure 5 depicts the average AoI versus different weights
${\omega}_{1}$, where the number of UAVs and the sensor nodes are set as
$N=2$ and
$M=10$, respectively. Each of the ten sensor nodes has a data update period of either 3 or 8.
$\nu =3$ represents the sensor node that requires a higher frequency of information updates, and
$\nu =8$ represents the sensor node that requires a lesser frequency of updates. It is observed that with the increase in
${\omega}_{1}$, the shorter average AoI can be achieved. We define the average AoI as the ratio of the sum of the information ages of the corresponding sensor nodes to the total time slot
T. Meanwhile, the average AoI for sensor nodes with short update periods (e.g.,
$\nu =3$) is smaller than the average AoI for sensor nodes with long update periods (e.g.,
$\nu =8$) since we consider the relative AoI for sensor nodes with different update periods, rather than blindly minimizing the age of all information. With the same value of
${\omega}_{1}$, the average AoI of the sensor node gradually decreases as the weight
${\omega}_{2}$ increases for sensor nodes with
$\nu =3$ or
$\nu =8$. Meanwhile, it is also observed that
${\omega}_{1}$ has more significant impacts on the sensor node with a shorter data update period (e.g.,
$\nu =3$).
To further demonstrate the achieved AoI with respect to the corresponding sensing data update period, we define the relative AoI as the ratio of the achieved average AoI to the update period of the corresponding sensing data denoted as
$\overline{\Delta}/\nu $.
Figure 6 depicts
$\overline{\Delta}/\nu $ for sensor nodes with
$\nu =3$ versus different values of the weight
${\omega}_{2}$ for different sets of the weight
${\omega}_{1}$. It is observed that the relative AoI decreases with the increase in
${\omega}_{2}$. In addition, with the same value of
${\omega}_{2}$, the relative AoI decreases with increases in
${\omega}_{1}$. This is because increasing
${\omega}_{1}$ enhances the importance of sensor nodes with a short update period, resulting in faster data collection and consequently lower relative AoI for sensor nodes with an update period
$\nu =3$.
Figure 7 shows the convergence of relative AoI for sensor nodes with different update periods. We set the update periods for six sensor nodes as
$\nu \in \{2,3,4,5,6,8\}$, indicating that the AoI requirements vary across sensor nodes. It is observed that the relative AoI gradually converges to a constant value. It is also observed that the relative AoI
$\overline{\Delta}/\nu $ for each sensor node is less than 1, demonstrating that our proposed method ensures the relative freshness of information from sensor nodes with various update periods.
Figure 8 demonstrates the algorithm convergence with different settings of
M (i.e., the number of sensor nodes). It is observed that the system utility can quickly converge to a stable value in different settings.
We then compare the performance of our proposed method with the following four methods:
 (1)
Age optimal algorithm (AOA): Based on our proposed method, at each time slot t, we consider a strategy in that sensing data are collected as early as possible after their generation, aiming to minimize the AoI of all sensor nodes without considering the diversity of sensor nodes’ update periods. In computing $F(t)$, we omit the effect of ${\omega}_{1}$. Other parameters are set in the same way as in our method.
 (2)
Diverse requirement optimal algorithm (DROA): Based on our proposed method, at each time slot t, we consider a strategy that only focuses on the diversity of sensor nodes’ update periods. It does not take into account the overall system’s AoI. The effect of weight ${\omega}_{2}$ is omitted. Other parameters are set in the same way as in our method.
 (3)
Energy minimizing algorithm (EMA): Based on our proposed method, at each time slot t, we consider a strategy that focuses on minimizing the energy consumption of UAVs. It disregards the overall system’s AoI and the diversity of sensor nodes’ update periods. We do not consider the effect of data values. The effects of ${\omega}_{1}$ and ${\omega}_{2}$ are ignored. The objective function is to minimize energy consumption. The other parameters are set in the same way as in our method.
 (4)
DRLeFresh [
8]: DRLeFresh guarantees data freshness by setting a deadline in each time slot, aiming to maximize the collected data amount and geographical fairness without considering the diversity of the sensor nodes’ update periods.
Figure 9 depicts the average AoI versus different numbers of UAVs, where the number of sensor nodes is set as
$M=10$. The number of sensor nodes is set to 10, which assumes that when the number of UAVs is 4, it is possible for all UAVs to cover all sensor nodes through scheduling. It is observed that our proposed method ODDA can achieve a shorter average AoI compared with the other four methods. EMA focuses solely on minimizing energy consumption, disregarding the timeliness of information. DROA only considers the urgency of different types of data to ensure timeliness by prioritizing frequently updated data while neglecting the less frequently updated data. It is observed that DROA and EMA perform much worse than our proposed ODDA, AOA, and DRLeFresh when the number of UAVs is 1. AOA aims to reduce the age of all information but overlooks the varying urgency levels of different types of sensing data. DRLeFresh focuses on the collected data amount and geographical fairness but neglects the different levels of data urgency requirements. With the increase in the number of UAVs, the average AoI reduces due to the increased flexibility of the UAVs’ operation, which allows for more dynamic and efficient data collection.
Figure 10 depicts the achieved system utility versus different numbers of UAVs. It is observed that our proposed method ODDA outperforms the other four methods. Specifically, our proposed method can improve the system utility by
$714\%$,
$47\%$,
$124\%$, and
$1088\%$ with the setting of 2 UAVs compared to EMA, AOA, DROA, and DRLeFresh, respectively. It is also observed the system utility with our proposed method increases at first, then decreases with the increasing numbers of UAVs. The change in the number of UAVs will have impacts on both the number of data collected and the energy consumption of UAVs. On the one hand, increasing the number of UAVs leads to an increase in the amount of collected sensing data, which can positively impact the system’s utility. On the other hand, increasing the number of UAVs results in an increase in the energy consumption of UAVs. In the beginning, the positive impacts outweigh the negative impacts of the increasing energy consumption, leading to an increase in the achieved system utility. Gradually, however, the increase in energy consumption starts to outweigh the benefits of collecting more data. Consequently, the system utility tends to decrease. Thus, employing a larger number of UAVs may not be the most efficient approach in terms of system utility performance.
In different application scenarios, the requirements for data freshness can vary. In
Figure 11, we consider four scenarios with different percentages of urgent sensing data:
$\{20\%,40\%,60\%,80\%\}$, where we set the data update period for urgent demand as
$\nu \in \{1,2,3\}$ and the number of sensor nodes as
$M=5$, and
${\nu}_{j},j\in \{1,2,3,4,5\}$ denotes the data update period of sensor node
j. It can be observed in
Figure 11 that the average AoI increases with the increase in the sensor node’s update period. Specifically, the first sensor node with the most urgent update period achieves the shortest AoI, while the 5th sensor node with the longest update period obtains the longest AoI. This is due to the consideration of the relative freshness of sensor nodes at different update periods. As the percentage of urgent data increases, the average AoI for the sensor node with a large update period (e.g.,
${\nu}_{5}=8$) also increases. This is because higher priority is put on the urgent data.
Figure 12 and
Figure 13 depict the average AoI and system utility versus the percentage of data with urgent requirements, respectively. It is observed that our method ODDA can achieve the smallest average AoI among the five methods. As the percentage of sensing data with urgent update requirements increases, more sensor nodes update their sensing data faster, leading to a higher frequency of collecting sensing data. Consequently, the average AoI decreases, and the system utility increases.
Figure 14 shows the average AoI with three scenarios (denoted as multitype, urgent type, and moderate type). In the smart city, the multitype scenario includes diverse types of sensor nodes with the update periods ranging from
$\nu \in [1,8]$. The urgenttype scenario emphasizes relatively urgent update requirements, with the update periods for all sensor nodes set in the range of
$\nu \in [1,3]$. For example, traffic monitoring and public safety require realtime data collection for timely decision making and response to emergencies. In the moderatetype scenario, the update periods of all sensor nodes are relatively lenient, with the update periods set in the range of
$\nu \in [6,8]$. Applications such as environmental monitoring, for example, where data can be updated less frequently, can follow a certain cycle of data collection. It is observed that our proposed method ODDA outperforms the other four counterparts in all three scenarios. Specifically, in the urgenttype scenario, our method can achieve average AoI reductions of
$56\%$,
$40\%$,
$34\%$, and
$26\%$ compared to EMA, AOA, DROA, and DRLeFresh, respectively. It is also observed that the achieved average AoI is the smallest in the urgenttype scenario and the largest in the moderatetype scenario. More sensor nodes update their sensing data faster in the urgenttype scenario, leading to a higher frequency of collecting sensing data.
Our method employs an efficient data collection strategy to meet various information updating requirements. By monitoring the data update period and timeliness requirements of different tasks, we can flexibly adjust the task execution order and path planning of UAVs in each time slot based on the urgency and priority of different tasks. For tasks with relatively urgent update requirements, UAVs can be prioritized for data collection and transmission to ensure timely data transmission. On the other hand, for tasks with lenient update requirements, data collection can be scheduled for subsequent time periods, thereby reducing system energy consumption and improving overall efficiency.
Figure 15 illustrates the relative AoI for sensor nodes with different update periods, where the update periods of sensor nodes 1 to 5 are set as 2, 3, 5, 6, and 7, respectively. The result clearly demonstrates the superior performance of our method compared to the other four methods in terms of the relative AoI of each sensor node. Our method ensures that the relative information freshness
$\overline{\Delta}/\nu $ of each sensor node remains below 1, rather than simply minimizing the overall AoI for the system. This highlights its ability to outperform other methods for tasks with different update requirements.
Figure 16 shows the average AoI versus the maximum flight speeds of UAVs, where the maximum flight speeds of UAVs are set as
${v}_{max}\in \{16,20,25,30\}$. Evidently, our proposed method ODDA outperforms the other four methods. By increasing the maximum UAV flight speed and implementing a scheduling strategy that optimizes data collection, more data can be efficiently collected, resulting in a notable decrease in the average AoI.
Figure 17 shows the system utility versus the maximum flight speeds of UAVs. It is observed that our proposed method ODDA outperforms the other four methods. The maximum UAV flight speed is increased, and our method enables us to optimize both the data collection scheduling and UAV flight speed, resulting in an enhanced system utility. However, the system utility of the other four methods diminishes with rising maximum flight speeds, as higher UAV energy consumption leads to reduced system utility.