1. Introduction
With the rapid development and advancement of internet of things (IoT) technology, numerical wireless connected devices are emerging, and the deployment scale is also growing rapidly [1]. However, certain wireless devices face computing limitations due to cost or size constraints. Additionally, devices located far from external power sources, such as sensors deployed on smart farms, may have limited energy supply. Moreover, the increasing number of wireless devices has given rise to diverse IoT applications [2], including environmental monitoring [3], autonomous vehicles [4-5], consumer robotics [6]. These applications pose challenges to existing mobile communication networks, demanding high real-time performance, security, and other critical indicators.
Mobile edge computing (MEC) technology deploys computing resources at the network edge, offering advantages for delay-sensitive and computing-intensive services closer to devices, thereby reducing the communication overhead of the core network [7]. This approach presents an opportunity to address the aforementioned challenges. However, resource allocation becomes a crucial issue for MEC due to limited resources and the coupling relationship between communication and computing [8]. Existing research on MEC resource allocation focuses on the following optimization objectives: 1) task completion delay [9]; 2) system energy consumption and energy efficiency [10]; 3) weighted sum of delay and energy consumption [11]. Yet, certain scenarios like fire scenes or remote areas, may be beyond MEC service reach, preventing ground devices from utilizing computing services provided by the base station (BS). Moreover, the increasing mobile data traffic necessitates additional deployment of fixed BSs, resulting in long deployment time and high costs. In emergency communication scenarios, such as large-scale sports events, there is a higher demand for network computing capacity.
To address these issues, the unmanned aerial vehicle (UAV) can serve as a mobile communication platform due to its flexibility [12]. Equipped with MEC servers, UAVs can extend the MEC coverage area and provide on-demand services for time-sensitive and computing-intensive devices, surpassing the capabilities of ground-based BSs. In the UAV-assisted MEC systems, it is crucial to develop a resource allocation scheme that caters to the unique characteristics of UAVs, including their special communication channels. Existing literature primarily focuses on device time delay [13-16]. Notably, [13] employed UAVs and MEC for crowd monitoring, while [14] and [15] proposed multi-parameter optimization models using the successive convex approximation (SCA) technique and punishment duality decomposition (PDD) algorithm. Addressing energy consumption, [16] developed an optimization model for MEC mobility management, considering resource allocation, offload decisions, UAV flight scheduling constraints, and utilizing a joint optimization algorithm based on the Lyapunov Method.
While UAV-assisted Mobile Edge Computing (MEC) systems offer advantages for computing offloading, the exponential growth of IoT devices presents challenges like queuing delays and resource contention. Practical limitations in UAV computing resources hinder meeting massive data processing demands. To tackle this, direct device-to-device (D2D) communication is introduced, allowing devices to communicate directly and share task processing [17]. D2D communication enables devices to offload data to nearby devices with available resources, reducing resource consumption and improving processing efficiency. Combining MEC with D2D communication, researchers have studied resource allocation and offloading decisions. Notably, [18] proposed a MEC framework for multi-user collaborative partial offloading. [19] addressed delay and energy consumption minimization using the Lagrange duality method. [20] adopted a combined MEC and D2D strategy to enhance computing capacity, while [21] introduced D2D-MEC technology to improve cellular network computing capacity. However, existing studies often focus on traditional MEC systems, emphasizing the need for research on integrating D2D collaboration into UAV-assisted MEC systems.
In this paper, we study the resource allocation and offload decisions in a D2D collaborative UAV-assisted MEC system, where UAV serves as the MEC platform. The main contributions are summarized as follows:
⦁ A D2D collaborative UAV-assisted MEC system is designed, and a coexistence scheme of UAV offloading and D2D offloading based on partial offloading is proposed.
⦁ We formulate a non-convex optimization problem for the goal of minimizing the maximum device delay. The problem involves optimizing device power allocation, UAV computing resource allocation, and offloading decisions. We obtain a suboptimal solution using an alternate iteration algorithm based on the Lagrange multiplier method.
⦁ In order to solve the problem of minimizing the optimization of UAV computing resources, a joint optimization model for offloading decision and power allocation is established. The model considers the offloading priority of device tasks. Theoretical analysis based on KKT conditions reveals the relationship between computing task size and the optimal resource allocation scheme.
⦁ The in-depth simulation and numerical results verify that the proposed D2D collaboration scheme is effective in reducing time delay and saving UAV computing resources.
2. System Model and Problem Formulation
A single UAV with an MEC server and computing capability serves multiple terminal devices. The UAV obtains channel state information and task data size to make offloading decisions. Terminal devices are classified into three categories: 1) cellular users cu capable of direct communication with the UAV; 2) requesting users i ∈ M = {1, 2,..., M} that lack communication and computing resources to complete tasks within time delay; and 3) idle users k ∈ K = {1, 2,..., K} who either have no computing tasks or can handle their computing tasks. We assume that idle users are devices without their own computing tasks, and requesting users can choose to offload tasks to either the UAV or nearby idle users for computing. This paper adopts a partial offloading model, allowing the division of computing tasks.
As shown in Fig. 1, terminal devices are randomly distributed in the coverage area of the UAV, and each device can be connected to the UAV. It is assumed that each requesting user i ∈ M has a computing task and the CPU instruction cycle required for computing 1 bit of data consistent for all terminal devices. For simplicity, the UAV is denoted as j. Since the cost of task offloading to the UAV is large and the computing resource of the UAV is limited, we assume a predefined group of requesting users offload tasks to the UAV. In this scenario, only idle users are considered to assist requesting users with computing. When the distance between device i ∈ M and k ∈ K is within R (the maximum communication distance between the devices), the two can establish a D2D communication link, and each requesting user can establish one D2D communication link. Since the data size of the task is typically small, the download delay can be neglected.
Fig. 1. The system model
Orthogonal frequency division multiplexing (OFDM) is adopted for channel access with the bandwidth of B. Each device in set M allocates a subchannel for the UAV communication link, and independent subchannels for different D2D communication links. D2D pairs employ channel multiplexing, where uplink spectrum resources of cellular users are multiplexed. The transmit power for cellular users and requesting users in D2D offloading are Pcu and Pd, respectively. The channel gain between a user and the UAV is hcu. The interference from cellular users to idle users in a D2D communication link is Icu, k = Pcuhcu, k, where cu k, h represents the channel gain from the cellular user to device k, and the interference to UAV reception is negligible.
2.1 Minimize the maximum delay of computing tasks
To ensure the fairness between devices with delay-sensitive computing tasks, we jointly optimize the offloading decision, power allocation and UAV computing resource allocation. Our goal is to minimize the maximum task delay for all terminal devices while considering limited computing and communication resources. The task of terminal device i is divided into three parts, i.e., local computing, D2D offloading and UAV offloading. The decision variable of task offloading xi, j is the offloading rate between the requesting user i and the UAV j, and xi, k is between the requesting user i and the idle user k when the computing task offloading to the UAV j and the idle user k, 0 ≤ xi, j ≤ 1, 0 ≤ xi, k ≤ 1.
2.1.1 Wireless channel model
The air-to-ground (A2G) transmission channel follows the LoS probabilistic model [22]. The LoS communication probability between device i and the UAV is determined by
\(\begin{align}p_{i}^{\mathrm{Los}}=\frac{1}{1+\rho \exp \left[-\vartheta\left(\theta_{i}-\rho\right)\right]}\end{align}\), (1)
so the non-line-of-sight (NLoS) communication probability is pNLoSi = 1 - pLoSi, where θi is the elevation angle from device i to UAV j, ϑ and ρ are the constants dependent on environment. The coordinate of device i and UAV j are (xi, yi) and (X, Y, H), respectively, resulting in a distance of di = √(xi - X)2 + (yi - Y)2 + H2 between them. The pass loss of LoS and NLoS link are given by LLoSi = ηLoS(4πfcdi/c)α and LNLoSi = ηNLoS(4πfcdi/c)α, where fc is the communication frequency, α is the path loss index, c is the speed of light, and ηLoS and ηNLoS are the average additional path loss for LoS and NLoS link. The average path loss from device i to UAV j can be expressed as
\(\begin{align}L_{i, j}=\left[p_{i}^{\text {LoS }} \eta_{\mathrm{LoS}}+p_{i}^{N L O S} \eta_{N L O S}\right]\left(\frac{4 \pi f_{c} d_{i}}{c}\right)^{\alpha}\end{align}\), (2)
where the average channel gain between device i and UAV j is hi, j = 1/Li, j.
The requesting user can choose to offload the computing task to the UAV or a nearby idle device. This allows a device to establish both a UAV offloading link and D2D offloading link simultaneously. The achievable rate of UAV offloading link and D2D offloading link of device i are respectively expressed in (3), where σ2n represents the noise power, Pui and Pdi are the transmit power assigned by device i to the UAV offloading and D2D offloading, respectively.
\(\begin{align}R_{i, j}=B \log _{2}\left(1+\frac{P_{i}^{u} h_{i, j}}{\sigma_{n}^{2}}\right), \forall i \in M\end{align}\) (3a)
\(\begin{align}R_{i, k}=B \log _{2}\left(1+\frac{P_{i}^{d} h_{i, k}}{I_{c u, k}+\sigma_{n}^{2}}\right), \forall k \in K\end{align}\) (3b)
The total power of device i is Pmaxi, and the sum of the power allocated to UAV offloading and D2D offloading cannot exceed the total power of the device,
Pui + Pdi ≤ Pmaxi, ∀i ∈ M (4)
Cellular users are the primary users in the system, and D2D communication must satisfy the quality of service (QoS) requirement. The threshold of signal to interference plus noise ratio (SINR) of cellular users is denoted as ε, then the constraint that does not affect the QoS of cellular users is
\(\begin{align}\frac{P^{c u} h_{c u}}{I_{i, c u}+\sigma_{n}^{2}} \geq \varepsilon\end{align}\). (5)
We set Si, j = hi, j/σ2n and Si, k = hi, k/(Icu, k +σ2n), then the transmission time of offloading computing task from device i to UAV j and D2D device k are
\(\begin{align}t_{i, j}^{\text {comm }}=\frac{x_{i, j} I_{i}}{R_{i, j}}=\frac{x_{i, j} I_{i}}{B \log _{2}\left(1+P_{i}^{u} S_{i, j}\right)}\end{align}\) (6a)
\(\begin{align}t_{i, k}^{\text {comm }}=\frac{x_{i, k} I_{i}}{R_{i, k}}=\frac{x_{i, k} I_{i}}{B \log _{2}\left(1+P_{i}^{d} S_{i, k}\right)}\end{align}\) (6b)
2.1.2 Computing model
The number of CPU instruction cycles required by device i is IiC, where Ii is the number of data bits and C is the task computing density. According to first dynamic voltage and frequency scaling (DVFS), the time of device i for local computing, offloading to UAV computing, and offloading to D2D-collaborative device computing are as follows
\(\begin{align}t_{i}^{\text {local }}=\frac{\left(1-x_{i, j}-x_{i, k}\right) I_{i} C}{f_{i}}\end{align}\) (7a)
\(\begin{align}t_{i, j}^{\text {comp }}=\frac{x_{i, j} I_{i} C}{f_{i, j}}\end{align}\) (7b)
\(\begin{align}t_{i, k}^{\text {comp }}=\frac{x_{i, k} I_{i} C}{f_{k}}\end{align}\) (7c)
where fi and fk are the computing resources of device i and k, respectively, and fi, j is the computing resources allocated to device i from UAV j . Due to limited computing resources of UAV, the maximum computing resources that can be allocated are as Fmaxj
\(\begin{align}\sum_{i=1}^{M} f_{i, j} \leq F_{j}^{\max }\end{align}\) (8)
The total delay of device i for offloading the task to UAV and the adjacent D2D device k includes the transmission time and calculation time, given by
\(\begin{align}t_{i, j}^{u a v}=t_{i, j}^{c o m m}+t_{i, j}^{c o m p}\end{align}\) (9a)
\(\begin{align}t_{i, k}^{d 2 d}=t_{i, k}^{c o m m}+t_{i, k}^{c o m p}\end{align}\) (9b)
Considering that the communication and computing processes occur in parallel, each device can decompose the task into three parts and compute them simultaneously. The time of device i for computing task is ti = max{tlocali, tuavi, j, td2di, k}. Assuming that the UAV provides computing services to multiple devices concurrently, the objective function to minimize the maximum delay of all terminal computing tasks can be expressed as
\(\begin{align}\min _{x_{i, j}, x_{i, k}, p_{i}^{u}, P_{i}^{d}, f_{i, j}} \max _{i \in M} t_{i}\end{align}\). (10)
The above objective function is a maximum minimization problem, which is difficult to solve directly. By introducing auxiliary variables t to make t = maxi∈Mti, the optimization problem can be expressed in (11). (11a)-(11e) are constraints formed after the introduction of auxiliary variable, (11h) represents the offloading rate constraint of device i. Moreover, (11j) indicates that the value of each variable must be greater than 0.
\(\begin{align}\begin{array}{l}\text { P1: } & \min t \\ & t_{t} x_{i, j} x_{i, k}, P_{i}^{u}, p_{i}^{d} s_{i, j} \end{array}\end{align}\) (11a)
s.t. ti ≤ t (11b)
\(\begin{align}\frac{\left(1-x_{i, j}-x_{i, k}\right) I_{i} C}{f_{i}} \leq t_{i}\end{align}\) (11c)
\(\begin{align}x_{i, j} I_{i}\left(\frac{1}{B \log _{2}\left(1+P_{i}^{u} S_{i, j}\right)}+\frac{C}{f_{i, j}}\right) \leq t_{i}\end{align}\) (11d)
\(\begin{align}x_{i, k} I_{i}\left(\frac{1}{B \log _{2}\left(1+P_{i}^{d} S_{i, k}\right)}+\frac{C}{f_{k}}\right) \leq t_{i}\end{align}\) (11e)
Pui + Pdi ≤ Pmaxi (11f)
\(\begin{align}\sum_{i=1}^{M} f_{i, j} \leq F_{j}^{\max }\end{align}\) (11g)
xi, j + xi, k ≤ 1, ∀i ∈ M (11h)
\(\begin{align}\frac{P^{c u} h_{c u}}{\sigma_{n}^{2}} \geq \varepsilon\end{align}\) (11i)
xi, j, xi, k, Pui, Pdi, fi, j, ti ≥ 0 (11j)
2.2 Minimize the computing resources of the UAV
Given the limited computing resources of UAVs, this section explores scenarios where the terminal devices prioritize offloading tasks to nearby idle D2D devices only when local computing cannot meet deadline requirements. To maximize computing efficiency, devices are assumed to assist others when they have no computing tasks of their own. The objective is to minimize the average computing resources allocated by the UAV to each device.
The maximum tolerable delay of the device is denoted as T. When the requesting user i ∈ M can complete the task within T, which satisfies IiC/fi < T, there is no need for offloading and the task can be compute locally. The computing tasks of device i are divided into three parts, local computing with data rate xi, L, D2D offloading to adjacent device k with data rate xi, k, and UAV offloading with data rate of 1 - xi, L - xi, k. The device’s computing capability is fixed, so the amount of data that can be processed is determined by the maximum tolerable delay and data size. When offloading is required, i.e, IiC/fi ≥ T, the data rate for local computing can be expressed as
\(\begin{align}x_{i, L}=\min \left\{1, \frac{f_{i} T}{I C}\right\}\end{align}\) (12)
Then, the transmission and computing time for offloading data from device i to UAV j and D2D device k are respectively expressed as
\(\begin{align}t_{i, j}^{\text {coamm }}=\frac{\left(1-x_{i, L}-x_{i, k}\right) I_{i}}{R_{i, j}}=\frac{\left(1-x_{i, L}-x_{i, k}\right) I_{i}}{B \log _{2}\left(1+P_{i}^{u} S_{i, j}\right)}\end{align}\) (13a)
\(\begin{align}t_{i, k}^{\text {comm }}=\frac{x_{i, k} I_{i}}{R_{i, k}}=\frac{x_{i, k} I_{i}}{B \log _{2}\left(1+P_{i}^{d} S_{i, k}\right)}\end{align}\) (13b)
\(\begin{align}t_{i, j}^{\text {comp }}=\frac{\left(1-x_{i, L}-x_{i, k}\right) I_{i} C}{f_{i, j}}\end{align}\) (14a)
\(\begin{align}t_{i, k}^{\text {comp }}=\frac{x_{i, k} I_{i} C}{f_{k}}\end{align}\) (14b)
where fi, j is the computing resources allocated from UAV j to device i. When, fi, j > 0, the task is offloaded from device i to the UAV, and vice versa. Furthermore, since devices in set K can only assist other devices after completing their own tasks, the assumption that idle users of assisting devices have non-computing tasks is reasonable. Based on (13) and (14), the total delay for UAV offloading and D2D offloading are respectively
tuαvi, j = tcommi, j + tcompi, j, (15a)
td2di, k = tcommi, k + tcompi, k. (15b)
Parallel execution of UAV offloading and D2D offloading allows for timely task completion within the maximum tolerable delay. Hence, the following constraint applies:
max{tuαvi, j, td2di, k}. ≤ T (16)
The task can be divided into three parts, thus the objective function of minimizing the UAV computing resources can be expressed as \(\begin{align}\sum_{i=1}^{M} f_{i, j} / M\end{align}\). Due to the independence of computing processes between devices, the optimization problem is formulated as follows:
\(\begin{align}\quad \min _{x_{i, k}, P_{l}^{*}, p_{i}^{d}, f_{i, j}} f_{i, j}\end{align}\) (17a)
\(\begin{align}s.t.\quad\left(1-x_{i, L}-x_{i, k}\right)\left(\frac{I_{i}}{B \log _{2}\left(1+P_{i}^{u} S_{i, j}\right)}+\frac{I_{i} C}{f_{i, j}}\right) \leq T\end{align}\) (17b)
\(\begin{align}x_{i, k}\left(\frac{I_{i}}{B \log _{2}\left(1+P_{i}^{d} S_{i, k}\right)}+\frac{I_{i} C}{f}\right) \leq T\end{align}\) (17c)
Pui + Pdi ≤ Pmaxi (17d)
1 - xi, L - xi, k ≥ 0, ∀i ∈ M (17e)
xi, k, Pui, Pdi, fi, j ≥ 0 (17f)
3. Problem Solving and Analysis
3.1 Solving the problem of minimizing the maximum delay of the task
Due to the mutual coupling between the variables, P1 is a non-convex optimization problem that cannot be solved directly. For this reason, P1 is decomposed into two subproblems: subproblem 1 assumes that all devices have the same offloading decision, and jointly optimizes the device transmit power allocation and UAV computational resource allocation; subproblem 2 assumes that the power allocation and computational resource allocation schemes are known, and optimizes the device offloading decision. The suboptimal solution of the original problem P1 is obtained by alternately iterating subproblem 1 and subproblem 2 until the objective function converges.
3.1.1 Subproblem 1
Given the initial UAV offloading rate xi, j and D2D offloading rate xi, k as known conditions, the objective function and its corresponding transmit power allocation and UAV computing resource allocation scheme are to be solved. However, the optimization problem remains non-convex. To address this, we deform the non-convex constraints by setting Sε = max{(Pcuhcu - εσ2n)/εhi, k, Pmaxi}, transforming the problem into
\(\begin{align}\min _{\substack{t, t_{i}, S_{t}, P, p_{l}^{u}, p_{T}^{d}}} t\end{align}\) (18a)
s.t. ti ≤ t (18b)
\(\begin{align}\frac{\left(1-x_{i, j}-x_{i, k}\right) I_{i} C}{f_{i}} \leq t_{i}\end{align}\) (18c)
\(\begin{align}\frac{x_{i, j}}{t_{i}}-\left(\frac{I_{i}}{B \log _{2}\left(1+P_{i}^{u} S_{i, j}\right)}+\frac{I_{i} C}{f_{i, j}}\right)^{-1} \leq 0\end{align}\) (18d)
\(\begin{align}\frac{x_{i, k}}{t_{i}}-\left(\frac{I_{i}}{B \log _{2}\left(1+P_{i}^{d} S_{i, k}\right)}+\frac{I_{i} C}{f_{k}}\right)^{-1} \leq 0 \\ (11f)-(11j)\end{align}\) (18e)
where (18d) and (18e) are convex constraints, which can be proved in Appendix A. Therefore, P1.1 becomes a convex optimization problem, which can be solved by KKT conditions [23]. The Lagrange function is expressed in (19) and the KKT conditions corresponding to Lagrange function are in (20). By solving (20b) and (20f), fi, j > 0 and Pui > 0 are obtained. Then using (20d) and (20e), we find ξi > 0, λi > 0. Additionally, (20g) provides φi > 0 and µi > 0 as a result. Finally, combining (20a)-(20c), we can get (21).
\(\begin{align}\begin{array}{l}L\left(t, t_{i}, P_{i}^{u}, P_{i}^{d}, f_{i, j}, \lambda_{i}, \mu_{i}, \omega_{i}, \eta_{i}, \varphi_{i}, \xi_{i}\right) \\ =t+\lambda_{i}\left(\frac{x_{i, j}}{t_{i}}-\left(\frac{I_{i}}{B \log _{2}\left(1+P_{i}^{u} S_{i, j}\right)}+\frac{I_{i} C}{f_{i, j}}\right)^{-1}\right)+\mu_{i}\left(\frac{x_{i, k}}{t_{i}}-\left(\frac{I_{i}}{B \log _{2}\left(1+P_{i}^{d} S_{i, k}\right)}+\frac{I_{i} C}{f_{k}}\right)^{-1}\right) \\ +\omega_{i}\left(\frac{\left(1-x_{i, j}-x_{i, k}\right) I_{i} C}{f_{i}}-t_{i}\right)+\eta_{i}\left(t_{i}-t\right)+\varphi_{i}\left(P_{i}^{u}+P_{i}^{d}-P_{i}^{\max }\right) \\ +\xi_{i}\left(\sum_{i=1}^{M} f_{i, j}-F_{j}^{\max }\right)+\delta_{i}\left(P_{i}^{d}-S_{i}\right)\end{array}\\\end{align}\) (19)
φi(Pui + Pdi - Pmaxi) = 0 (20a)
\(\begin{align}\xi_{i}\left(\sum_{i=1}^{M} f_{i, j}-F_{j}^{\max }\right)=0\end{align}\) (20b)
ηi(ti - t) = 0 (20c)
\(\begin{align}\frac{\partial L}{\partial P_{i}^{u}}=\varphi_{i}-\frac{\lambda_{i} f_{i, j}^{2}}{I_{i}\left(f_{i, j}+C B \log _{2}\left(1+P_{i}^{u} S_{i, j}\right)\right)^{2}} \frac{B S_{i, j}}{\ln 2\left(1+P_{i}^{u} S_{i, j}\right)}=\left\{\begin{array}{l}=0 P_{i}^{u}>0 \\ >0 P_{i}^{u}=0\end{array}\right.\end{align}\) (20d)
\(\begin{align}\frac{\partial L}{\partial P_{i}^{d}}=\varphi_{i}-\frac{\mu_{i} f_{k}^{2}}{I_{i}\left(f_{k}+C B \log _{2}\left(1+P_{i}^{d} S_{i, k}\right)\right)^{2}} \frac{B S_{i, k}}{\ln 2\left(1+P_{i}^{d} S_{i, k}\right)}=\left\{\begin{array}{l}=0 P_{i}^{d}>0 \\ >0 P_{i}^{d}=0\end{array}\right.\end{align}\) (20e)
\(\begin{align}\frac{\partial L}{\partial f_{i, j}}=\xi_{i}-\frac{\lambda_{i} C B^{2} \log _{2}^{2}\left(1+P_{i}^{u} S_{i, j}\right)}{I_{i}\left(f_{i, j}+C B \log _{2}\left(1+P_{i}^{u} S_{i, j}\right)\right)^{2}}=\left\{\begin{array}{l}=0 f_{i, j}>0 \\ >0 f_{i, j}=0\end{array}\right.\end{align}\) (20f)
\(\begin{align}\frac{\partial L}{\partial t_{i}}=\eta_{i}-\frac{\lambda_{i} x_{i, j}}{t_{i}^{2}}-\frac{\mu_{i} x_{i, k}}{t_{i}^{2}}-\omega_{i}=0\end{align}\) (20g)
\(\begin{align}\begin{array}{l}P_{i}^{u}+P_{i}^{d}=P_{i}^{\max }, \forall i \in M \\ \sum_{i=1}^{M} f_{i, j}=F_{j}^{\max } \\ t=t_{i}, \forall i \in M\end{array}\end{align}\) (21)
In the final resource allocation scheme, the transmit power of the requesting user’s device is fully allocated for UAV and D2D offloading. The available computing resources of the UAV are assigned to devices with computing task requirements, ensuring equal computation time for each device. We define ψ(Pdi) in (22), and ψ′ is the inverse function of ψ(Pdi).
\(\begin{align}\psi\left(P_{i}^{d}\right)=\varphi_{i}-\frac{\mu_{i} f_{k}^{2}}{I_{i}\left(f_{k}+C B \log _{2}\left(1+P_{i}^{d} S_{i, k}\right)\right)^{2}} \frac{B S_{i, k}}{\ln 2\left(1+P_{i}^{d} S_{i, k}\right)}\end{align}\) (22)
Therefore, the Lagrange dual function and Lagrange dual problem of P1.1 are presented by
g(λi, µi, ωi, ηi, φi, ξi) = mint, ti, pui, pdi, fi, j L(t, ti, pui, pdi, fi, j, λi, µi, ωi, ηi, φi, ξi) (23)
maxλi, µi, ωi, ηi, φi, ξi g(λi, µi, ωi, ηi, φi, ξi) (24)
For a given set of Lagrangian multipliers, the expression of optimization variables t*i, Pd*i, Pu*i and f*i, j, f are denoted as follows, respectively.
\(\begin{align}t_{i}^{*}=\sqrt{\frac{\left(\lambda_{i} x_{i, j}+\mu_{i} x_{i, k}\right) I_{i}}{\eta_{i}-\omega_{i}}}\end{align}\) (25a)
Pd*i = ψ′ (0) (25b)
Pu*i = Pmaxi - Pd*i (25c)
f*i, j = Blog2(1 + PuiSi, j)(√C/ξi - C) (25d)
Since Lagrange dual function (23) is not differentiable, the subgradient algorithm is utilized to update Lagrange multipliers ηi, ωi, λi, µi, φi, ξi and δi, and the updating formulas are
ηi+1i = [ηli - πl1(ti - t))]+ (26a)
\(\begin{align}\omega_{i}^{l+1}=\left[\omega_{i}^{l}-\pi_{2}^{l}\left(\frac{\left(1-x_{i, j}-x_{i, k}\right) I_{i} C}{f_{i}}-t_{i}\right)\right]^{+}\end{align}\) (26b)
\(\begin{align}\lambda_{i}^{l+1}=\left[\lambda_{i}^{l}-\pi_{3}^{l}\left(\frac{x_{i, j}}{t_{i}}-\left(\frac{I_{i}}{B \log _{2}\left(1+P_{i}^{u} S_{i, j}\right)}+\frac{I_{i} C}{f_{i, j}}\right)^{-1}\right)\right]^{+}\end{align}\) (26c)
\(\begin{align}\mu_{i}^{l+1}=\left[\mu_{i}^{l}-\pi_{4}^{l}\left(\frac{x_{i, k}}{t_{i}}-\left(\frac{I_{i}}{B \log _{2}\left(1+P_{i}^{d} S_{i, k}\right)}+\frac{I_{i} C}{f_{k}}\right)^{-1}\right)\right]^{+}\end{align}\) (26d)
φl+1i = [φli - πl5(Pui + Pdi - Pmaxi)]+ (26e)
\(\begin{align}\xi_{i}^{l+1}=\left[\xi_{i}^{l}-\pi_{6}^{l}\left(\sum_{i=1}^{M} f_{i, j}-F_{j}^{\max }\right)\right]^{+}\end{align}\) (26f)
δl+1i = [δli - πl7(Pdi - Sε)]+ (26g)
where x+ = max{x, 0}, l is the number of iterations, πlq = 1/l(1≤q≤7) is the step size. To ensure the convergence of the subgradient algorithm, the step size must satisfy that
\(\begin{align}\sum_{l=1}^{\infty} \pi_{q}^{l}=\infty, \quad \lim _{i \rightarrow \infty} \pi_{q}^{l}=0, \quad 1 \leq q \leq 7\end{align}\) (27)
We can solve the Lagrange dual problem based on equations (25) and (26). By iteratively updating the Lagrange multipliers until convergence, we obtain the final transmit power allocation scheme for the device and UAV computing resource allocation scheme. The convergence condition is expressed as
\(\begin{align}\sum_{i \in M}\left|\eta_{i}^{i+1}-\eta_{i}^{\prime}\right|+\left|\omega_{i}^{I+1}-\omega_{i}^{\prime}\right|+\left|\lambda_{i}^{l+1}-\lambda_{i}^{i}\right|+\left|\mu_{i}^{I+1}-\mu_{i}^{\prime}\right|+\left|\varphi_{i}^{l+1}-\varphi_{i}^{\prime}\right|+\left|\xi_{i}^{l+1}-\xi_{i}^{i}\right|+\left|\delta_{i}^{l+1}-\delta_{i}^{i}\right| \leq \text {Eplison}\end{align}\) (28)
where Eplison1 represents the maximum difference value between two iterations.
3.1.2 Subproblem2: Offloading decision
Given the known transmit power allocation and UAV computing allocation, the original optimization problem P1 is transformed into the subproblem 2, which is expressed as
P1.2: minti, xi, j, xi, kt (29a)
s.t. ti ≤ t (29b)
\(\begin{align}\frac{\left(1-x_{i, j}-x_{i, k}\right) I_{i} C}{f_{i}} \leq t_{i}\end{align}\) (29c)
\(\begin{align}x_{i, j} I_{i}\left(\frac{1}{B \log _{2}\left(1+P_{i}^{u} S_{i, j}\right)}+\frac{C}{f_{i, j}}\right) \leq t_{i}\end{align}\) (29d)
\(\begin{align}x_{i, k} I_{i}\left(\frac{1}{B \log _{2}\left(1+P_{i}^{d} S_{i, k}\right)}+\frac{C}{f_{k}}\right) \leq t_{i}\end{align}\) (29e)
xi, j + xi, k ≤ 1, ∀i ∈ M (29f)
xi, j, xi, k, ti ≥ 0 (29g)
P1.2 is a linear programming (LP) problem about UAV offloading ratio xi, j and D2D offloading ratio xi, k. The closed solution t*i, x*i, j and x*i, k can be obtained based on KKT conditions and the solution process is shown in Appendix B. The expression of P1.2 is
\(\begin{align}t_{i}^{*}=\frac{I_{i} C T_{1} T_{2}}{f_{i} T_{1} T_{2}+I_{i} C\left(T_{1}+T_{2}\right)}\end{align}\) (30a)
\(\begin{align}x_{i, j}^{*}=\frac{I_{i} C T_{2}}{f_{i} T_{1} T_{2}+I_{i} C\left(T_{1}+T_{2}\right)}\end{align}\) (30b)
\(\begin{align}\dot{x}_{i, k}^{*}=\frac{I_{i} C T_{1}}{f_{i} T_{1} T_{2}+I_{i} C\left(T_{1}+T_{2}\right)}\end{align}\) (30c)
where \(\begin{align}T_{1}=I_{i}\left(\frac{1}{B \log _{2}\left(1+P_{i} S_{i, j}\right)}+\frac{C}{f_{i, j}}\right)\end{align}\) and \(\begin{align}T_{2}=I_{i}\left(\frac{1}{B \log _{2}\left(1+P_{i}^{d} S_{i, k}\right)}+\frac{C}{f_{k}}\right)\end{align}\).
By iteratively alternating between subproblem 1 and subproblem 2, the original optimization problem can be solved. Algorithm 1 outlines the implementation process for minimizing the maximum delay of all terminal device computing tasks.
Algorithm 1: Resource allocation algorithm by alternate iterative based on Lagrange multiplier
3.2 Solving the problem of minimizing UAV computing resources
Since P2 is a non-convex optimization problem, (17b) and (17c) can be converted to convex constraints according to Appendix A, which is expressed in (31).
\(\begin{align}1-x_{i, L}-x_{i, k}-T\left(\frac{I_{i}}{B \log _{2}\left(1+P_{i} S_{i, j}\right)}+\frac{I_{i} C}{f_{i, j}}\right)^{-1} \leq 0\end{align}\) (31a)
\(\begin{align}x_{i, e}-T\left(\frac{I_{i}}{B \log _{2}\left(1+P_{i}^{d} S_{i, e}\right)}+\frac{I C}{f}\right)^{-1} \leq 0\end{align}\) (31b)
Therefore, P2 is transformed into a convex optimization problem, and can be solved based on the KKT conditions. The analysis is presented in Appendix C in detail.
(a) KKT conditions determine the relationship between D2D offloading rate xi, k and the transmit power Pdi for D2D offloading link
\(\begin{align}x_{i, k}=T\left(\frac{I_{i}}{B \log _{2}\left(1+P_{i}^{d} S_{i, k}\right)}+\frac{I_{i} C}{f_{k}}\right)^{-1}\end{align}\) (32)
(b) γ(Pui, Pdi) is defined as the power allocation function, representing the trade-off difference of power gain brought by power allocation to UAV offloading and D2D offloading.
\(\begin{align}\gamma\left(P_{i}^{u}, P_{i}^{d}\right)=\left(\frac{\left(1-x_{i, L}-x_{i, k}\right) I_{i}}{R_{i, j}\left(P_{i}^{u}\right)}\right)^{2} \frac{d R_{i, j}\left(P_{i}^{u}\right)}{d P_{i}^{u}}-\left(\frac{x_{i, k} I_{i}}{R_{i, k}\left(P_{i}^{d}\right)}\right)^{2} \frac{d R_{i, i}\left(P_{i}^{d}\right)}{d P_{i}^{d}}\end{align}\) (33)
Due to the fact that Pui = Pmaxi - Pdi, γ(Pui, Pdi) is a unary function of Pdi, thus γ(Pui, Pdi) can be rewritten as γ(Pdi). Then according to (C.13), it can be obtained
\(\begin{align}\frac{\lambda_{i}}{T}\left(\frac{\left(1-x_{i, L}-x_{i, k}\right) I_{i}}{R_{i, j}\left(P_{i}^{u^{*}}\right)}\right)^{2} \frac{d R_{i, j}\left(P_{i}^{u^{*}}\right)}{d P_{i}^{u}}=\frac{\mu_{i}}{T}\left(\frac{x_{i, k} I_{i}}{R_{i, k}\left(P_{i}^{d^{*}}\right)}\right)^{2} \frac{d R_{i, k}\left(P_{i}^{d^{*}}\right)}{d P_{i}^{d}}\end{align}\) (34)
when λ*i = µ*i, γ(Pd*i) = 0 and Pd*i = γ'(0) ; when λ*i > µ*i or λ*i < µ*i, Pd*i < γ′(0), so we can get Pd*i = min(γ'(0)|(pui = pmaxi - pdi)Pmaxi), γ(⋅)′ is the inverse function of γ(⋅).
(c) To determine the upper bound of the system’s data processing capacity, we assume infinite computing resources for the UAV, ignoring the computing time, and only consider data transmission time. Then the upper bound of the data size that the system can process is
\(\begin{align}I_{i, k, j}^{\max }=T\left(\frac{1}{B \log _{2}\left(1+P_{i}^{d^{*}} S_{i, k}\right)}+\frac{C}{f_{k}}\right)^{-1}+\frac{f_{i} T}{C}+T B \log _{2}\left(1+P_{i}^{u^{*}} S_{i, j}\right)\end{align}\) (35)
(d) To assess the advantages of D2D collaborative UAV-assisted MEC system, we consider a scenario where a device can only perform local computing or offload to the UAV. Assuming infinite UAV computing resources, we determine the maximum data size of the system as
\(\begin{align}I_{i, j}^{\max }=\frac{f_{i} T}{C}+T B \log _{2}\left(1+P_{i}^{\max } S_{i, j}\right)\end{align}\). (36)
Due to the fact that ϕ(Pdi) ≥ ϕ(Pdi)|pdi=0 = TB log2(1 + PmaxiSi, j), we can obtain Imaxi, k, j ≥ Imaxi, j. If the data size satisfies Ii ≤ fiT/C, all tasks can be computed locally. If the data size meets fiT/c ≤ Ii ≤ Imaxi, k, the cooperation of adjacent D2D devices is required. In this case, devices in set offload tasks to D2D devices for computing and allocate all power for D2D offloading without requiring UAV computing resources. The optimal power allocation and D2D offloading rate are given by, respectively.
Pd*i = Pmaxi (37a)
\(\begin{align}x_{i, k}^{*} \leq T\left(\frac{I_{i}}{B \log _{2}\left(1+P_{i}^{d} S_{i, k}\right)}+\frac{I_{i} C}{f_{k}}\right)^{-1}\end{align}\) (37b)
When the data size satisfies Imaxi, k ≤ Ii < Imaxi, k, j, only D2D collaborative computing is not sufficient, and offloading to UAV is also required for computing. In this case, the device needs to allocate resources for D2D and UAV offloading effectively, thus the optimal resource allocation scheme can be expressed as
Pd*i = min(γ'(0)|(pui = pmaxi - pdi), Pmaxi) (38a)
Pu*i = Pmaxi - Pdd*i (38b)
\(\begin{align}x_{i, k}^{*}=T\left(\frac{I_{i}}{B \log _{2}\left(1+P_{i}^{d} S_{i, k}\right)}+\frac{I_{i} C}{f_{k}}\right)^{-1}\end{align}\) (38c)
\(\begin{align}f_{i, j}^{*}=I_{i} C\left(\frac{T}{1-x_{i, L}-x_{i, k}^{*}}-\frac{I_{i}}{B \log _{2}\left(1+P_{i}^{u^{*}} S_{i, j}\right)}\right)^{-1}\end{align}\). (38d)
When the data size is too large, i.e., Ii ≥ Imaxi, k, j, no feasible resource allocation scheme exists. Moreover, if a device has numerous requested tasks but no adjacent D2D collaboration, only the allocation of UAV computing resources is possible. The power distribution and UAV computing resources are presented as
Pu*i = Pmaxi (39a)
\(\begin{align}f_{i, j}^{*}=I_{i} C\left(\frac{T}{1-x_{i, L}}-\frac{I_{i}}{B \log _{2}\left(1+P_{i}^{\max } S_{i, j}\right)}\right)^{-1}\end{align}\). (39b)
4. Simulation Results and Discussion
Simulation results analyze the performance enhancement of UAV-assisted MEC systems through D2D collaboration. The scenario consists of a single UAV, multiple users, and a circular area with a radius of 100m. Two optimization problems are considered: minimizing maximum delay of computing tasks and minimizing average computing resources allocated by the UAV. Factors such as task data size, maximum tolerable delay, and device transmit power are analyzed. Table 1 specifies the simulation parameters. "UAV-assisted" refers to only UAV-assisted MEC systems, while "UAV-D2D collaboration" denotes D2D collaborative UAV-assisted MEC systems.
Table 1. Simulation parameter setting
4.1 Maximum Delay of the Task Minimization
Fig. 2 shows the task computing rate as a function of task data size. As task data size increases, more tasks are offloaded to the UAV for computing due to its stronger computing power. The gain from UAV computing outweighs the transmission time for offloading large data. However, the amount of data offloaded to D2D devices is smaller than that computed locally. This is because offloading to adjacent devices adds extra transmission time compared to local computing, especially when the computing capabilities of the devices are similar.
Fig. 2. Offloading decision
Fig. 3 illustrates the changes in transmit power allocation and UAV computing resource allocation with task data size under a total device power of 600mW. As the task data size increases, more power is allocated for UAV offloading, consistent with the trend observed in Fig. 2. Moreover, the device allocates all power for D2D and UAV offloading, while the UAV allocates all computing resources to the user, in line with the theoretical analysis.
Fig. 3. Power allocation and UAV computing resource allocation
In Fig. 4, device transmit power's impact on task completion time is shown. Increasing the total device power reduces the maximum task processing delay for both UAV-assisted and UAV-D2D collaborative systems. Higher transmit power decreases the transmission delay, leading to shorter overall delay. Additionally, smaller average task data size results in lower maximum completion delay. With the introduction of D2D collaboration, the task completion time is reduced due to an optimized power allocation scheme, resulting in greater gains from UAV-D2D collaboration compared to UAV-assisted alone.
Fig. 4. Time delay versus transmitted power
Fig. 5 demonstrates the impact of UAV computing resources on task completion time. Abundant UAV computing resources lead to increased offloading of computing tasks, resulting in shorter completion time for tasks of the same data size. D2D collaboration further enhances the overall computing capability of the system, utilizing idle computing resources from adjacent devices, and reducing task completion time compared to UAV-assisted alone.
Fig. 5. Time delay versus UAV computing resource
Fig. 6 compares task completion time under the proposed joint resource allocation scheme and the average allocation scheme. The joint resource allocation scheme achieves shorter completion time, with the gap narrowing as UAV computing resources increase. Sufficient UAV computing resources reduce differences in task processing time among devices. These findings validate the effectiveness of the proposed resource allocation scheme.
Fig. 6. The computing resources
4.2 UAV Computing Resource Minimization
In Fig. 7, task data size influences offloading decisions with a maximum tolerable delay of T s = 2 . For small data sizes, local computing suffices. As data size increases, local computing fails to meet the delay requirement, prompting offloading to adjacent idle D2D devices. When D2D resources are insufficient, tasks are offloaded to both UAV and idle D2D devices to meet the delay requirement.
Fig. 7. Task data size on offloading decision
Fig. 8 shows the impact of the maximum tolerable delay of the device and the average computing resources provided by UAV. With the increase of the maximum tolerable delay, the UAV computing resources required by the device decrease and finally reach the plateau. This is because if the required delay is low, the computing resources needed for the requirement of delay is shorten. When the maximum task tolerable delay of the device is large enough, the delay requirement can be met without allocating more computing resources. As the task data size increases, the amount of data offloaded to the UAV for computing also increases, thus more computing resources of the UAV are required. D2D collaboration reduces the computing resource consumption of UAVs, since the device preferentially utilizes the resources of adjacent D2D devices.
Fig. 8. UAV computing resource
5. Conclusion
This paper studies resource allocation and offloading decisions in D2D collaborative UAV-assisted MEC systems. Two scenarios are considered: delay-sensitive tasks and limited UAV computing resources. For the first scenario, an optimization model minimizes the maximum task delay using a two-subproblem approach. The second scenario prioritizes task offloading based on maximum tolerable delay. A joint optimization model and theoretical analysis provide optimal resource allocation schemes. Simulation and numerical results demonstrate the effectiveness of the proposed scheme in reducing task completion delay and saving UAV computing resources in D2D collaborative UAV-assisted MEC systems.
Appendix
References
- X. Lyu, H. Tian, L. Jiang, A. Vinel, S. Maharjan, S. Gjessing, and Y. Zhang, "Selective offloading in mobile edge computing for the green internet of things," IEEE network, vol.32, no.1, pp.54-60, 2018. https://doi.org/10.1109/MNET.2018.1700101
- Z. Tan, H. Qu, J. Zhao, S. Zhou and W. Wang, "UAV-Aided Edge/Fog Computing in Smart IoT Community for Social Augmented Reality," IEEE Internet of Things Journal, vol. 7, no. 6, pp. 4872-4884, June 2020. https://doi.org/10.1109/JIOT.2020.2971325
- M. U. Shoukat, L. Yan, J. Zhang, Y. Cheng, M. U. Raza and A. Niaz, "Smart home for enhanced healthcare: exploring human machine interface oriented digital twin model," Multimedia Tools and Applications, pp. 1-19, 2023.
- M. U. Shoukat, S. Yu, S. Shi, Y. Li and J. Yu, "Evaluate the Connected Autonomous Vehicles Infrastructure using Digital Twin Model Based on Cyber-Physical Combination of Intelligent Network," in Proc. of 2021 5th CAA International Conference on Vehicular Control and Intelligence (CVCI), pp. 1-6, 2021.
- M. U. Shoukat, L. Yan, B. Zou, J. Zhang, A. Niaz and M. U. Raza, "Application of Digital Twin Technology in the Field of Autonomous Driving Test," in Proc. of 2022 Third International Conference on Latest trends in Electrical Engineering and Computing Technologies (INTELLECT), pp. 1-6, 2022.
- M. U. Shoukat, L. Yan, W. Liu, F. Hussain, S. A. Nawaz and A. Niaz, "Digital Twin-Driven Virtual Control Technology of Home-Use Robot: Human-Cyber-Physical System," in Proc. of 2022 17th International Conference on Emerging Technologies (ICET), pp. 240-246, 2022.
- Y. Mao, C. You, J. Zhang, K. Huang, and K.B. Letaief, "A survey on mobile edge computing: The communication perspective," IEEE Communications Surveys and Tutorials, vol.19, no.4, pp.2322-2358, 2017. https://doi.org/10.1109/COMST.2017.2745201
- F. Spinelli and V. Mancuso, "Toward enabled industrial verticals in 5g: A survey on mec-based approaches to provisioning and flexibility," IEEE Communications Surveys and Tutorials, vol.23, no.1, pp.596-630, 2021. https://doi.org/10.1109/COMST.2020.3037674
- Y. Song, S.S. Yau, R. Yu, X. Zhang, and G. Xue, "An approach to qos-based task distribution in edge computing networks for iot applications," in Proc. of 2017 IEEE International Conference on Edge Computing (EDGE), pp.32-39, 2017.
- Z. Yang, Y. Du, C. Che, W. Wang, H. Mei, D. Zhou, and K. Yang, "Energy-efficient joint resource allocation algorithms for mec-enabled emotional computing in urban communities," IEEE Access, vol.7, pp.137410-137419, 2019. https://doi.org/10.1109/ACCESS.2019.2942391
- M. Qin, N. Cheng, Z. Jing, T. Yang, W. Xu, Q. Yang, and R.R. Rao, "Service-oriented energy-latency tradeoff for iot task partial offloading in mec-enhanced multi-rat networks," IEEE Internet of Things Journal, vol.8, no.3, pp.1896-1907, 2021. https://doi.org/10.1109/JIOT.2020.3015970
- M. Mozaffari, W. Saad, M. Bennis, Y.H. Nam, and M. Debbah, "A tutorial on uavs for wireless networks: Applications, challenges, and open problems," IEEE communications surveys & tutorials, vol.21, no.3, pp.2334-2360, 2019. https://doi.org/10.1109/COMST.2019.2902862
- N.H. Motlagh, M. Bagaa, and T. Taleb, "Uav-based iot platform: A crowd surveillance use case," IEEE Communications Magazine, vol.55, no.2, pp.128-134, 2017. https://doi.org/10.1109/MCOM.2017.1600587CM
- A.A. Nasir, "Latency optimization of uav-enabled mec system for virtual reality applications under rician fading channels," IEEE Wireless Communications Letters, vol.10, no.8, pp.1633-1637, 2021. https://doi.org/10.1109/LWC.2021.3075762
- Q. Hu, Y. Cai, G. Yu, Z. Qin, M. Zhao, and G.Y. Li, "Joint offloading and trajectory design for uav-enabled mobile edge computing systems," IEEE Internet of Things Journal, vol.6, no.2, pp.1879-1892, 2019. https://doi.org/10.1109/JIOT.2018.2878876
- J. Zhang, L. Zhou, Q. Tang, E.C.H. Ngai, X. Hu, H. Zhao, and J. Wei, "Stochastic computation offloading and trajectory scheduling for uav-assisted mobile edge computing," IEEE Internet of Things Journal, vol.6, no.2, pp.3688-3699, 2019. https://doi.org/10.1109/JIOT.2018.2890133
- Y. Liu, S. Xie, and Y. Zhang, "Cooperative offloading and resource management for uav-enabled mobile edge computing in power iot system," IEEE Transactions on Vehicular Technology, vol.69, no.10, pp.12229-12239, 2020. https://doi.org/10.1109/TVT.2020.3016840
- M. Mehrabi, D. You, V. Latzko, H. Salah, M. Reisslein, and F.H. Fitzek, "Device-enhanced mec: Multi-access edge computing (mec) aided by end device computation and caching: A survey," IEEE Access, vol.7, pp.166079-166108, 2019. https://doi.org/10.1109/ACCESS.2019.2953172
- J. Peng, H. Qiu, J. Cai, W. Xu, and J. Wang, "D2d-assisted multi-user cooperative partial offloading, transmission scheduling and computation allocating for mec," IEEE Transactions on Wireless Communications, vol.20, no.8, pp.4858-4873, 2021. https://doi.org/10.1109/TWC.2021.3062616
- R. Chai, J. Lin, M. Chen, and Q. Chen, "Task execution cost minimization-based joint computation offloading and resource allocation for cellular d2d mec systems," IEEE Systems Journal, vol.13, no.4, pp.4110-4121, 2019. https://doi.org/10.1109/JSYST.2019.2921115
- Y. He, J. Ren, G. Yu, and Y. Cai, "Joint computation offloading and resource allocation in d2d enabled mec networks," in Proc. of ICC 2019-2019 IEEE International Conference on Communications (ICC), pp.1-6, 2019.
- S. Boyd, S.P. Boyd, and L. Vandenberghe, "Convex optimization," Cambridge university press, 2004.
- G. Hu, Y. Jia, and Z. Chen, "Multi-user computation offloading with d2d for mobile edge computing," in Proc. of 2018 IEEE Global Communications Conference (GLOBECOM), pp.1-6, 2018.