## 2 System Model and Problem Formulation
### Problem Formulation  
In this section, an optimization problem is formulated to minimize the maximum task latency among all vehicles, subject to the constraints of communication rate, UAV energy consumption, and memory capacity.  
Based on (9) and (23), if the task \(\pi_{n}(t)\) of vehicle \(n\) is offloaded to UAV \(u\) at time slot \(t\), its overall processing delay is given by:  
\[T_{n}^{\text{UAV}}(t)=\sum_{u=1}^{U}a_{u,n}(t)(T_{n,u}^{\text{comm}}(t)+T_{n,u }^{\text{comp}}(t)),\forall n\in\mathcal{N}, \tag{26}\]  
Therefore, based on (22) and (26), at the time slot \(t\), the total delay of processing task \(\pi_{n}(t)\) from vehicle \(n\) is expressed by:  
\[T_{n}(t)= T_{n}^{\text{UAV}}(t)+(1-\sum_{u=1}^{U}a_{u,n}(t))T_{n}^{\text{ comp}}(t), \tag{27}\] \[\forall n\in\mathcal{N},\forall t\in\mathcal{T},\]  
This combines the local and offloaded computation delays [45].  
Based on (4) and (24), the total energy consumption of the \(u\)-th UAV at the time slot \(t\) can be given as:  
\[E_{u}^{\text{UAV}}(t)=E_{u}^{\text{comp}}(t)+\kappa E_{u}^{\text{fly}}(t), \tag{28}\]  
where \(\kappa\) is the energy regulation factor balancing the magnitude disparity between computation and propulsion energy costs [25].  
We define the system efficiency for the system at time slot \(t\), denoted as \(SE(t)\). This is a comprehensive metric designed to balance the content cache hit rate, task computation performance, system energy consumption, and resource allocation fairness. Its formula is as follows:  
\[SE(t)=\frac{\Pr_{h}(t)}{\sum_{n=1}^{N}T_{n}(t)}-w_{1}\sum_{u=1}^{U}E_{u}^{\text{ UAV}}(t)+w_{2}P_{Fair}(t) \tag{29}\]  
We jointly optimize the service placement decision \(\mathbf{X_{d}}=\left[x_{u,d}(t)\right]_{u\in\mathcal{U},d\in\mathcal{D}^{\prime}}\), the content cache decision \(\mathbf{X_{k}}=\left[x_{u,k}(t)\right]_{u\in\mathcal{U},k\in\mathcal{K}}\), the vehicle task offloading decision \(\mathbf{A}=\left[a_{u,n}(t)\right]_{u\in\mathcal{U},n\in\mathcal{N}}\), and the locations of UAVs \(\mathbf{L_{u}}=\left[\mathbf{l_{u}}(t)\right]_{u\in\mathcal{U}}\).  
To sum up, the optimization problem can be formulated as:  
\[\max_{\mathbf{x_{d}},\mathbf{X_{k}},\mathbf{L_{u}}}\sum_{t=1}^{T} SE(t)\] s.t. \[\text{C1:}\quad\sum_{d\in\mathcal{D}}x_{u,d}(t)s_{d}+\sum_{k\in \mathcal{K}}x_{u,k}(t)s_{k}\leq Q_{u},\forall u\in\mathcal{U},\forall t\in T, \tag{31}\] \[\text{C2:}\quad a_{u,n}(t)\in\{0,1\},\quad x_{u,d}(t)\in\{0,1\}, \quad x_{u,k}(t)\in\{0,1\},\] (32) \[\qquad\qquad\qquad\forall n\in\mathcal{N},\forall u\in\mathcal{U},\forall d\in\mathcal{D},\forall k\in\mathcal{K},\forall t\in\mathcal{T}\] \[\text{C3:}\quad\sum_{t=1}^{T}E_{u}^{\text{UAV}}(t)\leq E^{\text{ max}},\forall u\in\mathcal{U},\] (33) \[\text{C4:}\quad\|u_{t}(t)-l_{v}(t)\|\geq d_{\text{min}},u\
eq v, \forall u,v\in\mathcal{U},\forall t\in\mathcal{T},\] (34) \[\text{C5:}\quad H_{\text{min}}\leq Z_{u}(t)\leq H_{\text{max}}, \forall u\in\mathcal{U},\forall t\in\mathcal{T},\] (35) \[\text{C6:}\quad\sum_{n=1}^{N}\sum_{d=1}^{D}a_{u,n}^{d}(t)\leq Core ^{UAV},\forall u\in\mathcal{U},\forall t\in\mathcal{T},\] (36) \[\text{C7:}\quad\sum_{u=1}^{U}a_{u,n}^{d}(t)\leq 1,\forall t\in \mathcal{T}, \tag{37}\]  
where \(w_{1}\) and \(w_{2}\) are the weights for energy consumption and fairness, respectively.  
C1 limits the total cached data size for UAV \(u\) at time \(t\) within its storage capacity \(Q_{u}\). C2 enforces binary offloading and caching decisions for \(a_{u,n}(t)\), \(x_{u,d}(t)\), and \(x_{u,k}(t)\). C3 restricts UAV \(u\)'s total energy consumption to not exceed \(E^{\text{max}}\). C4 ensures the minimum safe distance \(d_{\text{min}}\) between any two UAVs. Finally, C5 constrains UAV \(u\)'s flight altitude between \(H_{\text{min}}\) and \(H_{\text{max}}\). C6 limits the maximum number of tasks that can be processed by a single UAV \(u\) at time slot \(t\) to \(Core^{UAV}\)[53]. C7 ensures that for each vehicle \(n\), its task is offloaded to at most one UAV \(u\) at any given time slot \(t\).