# UAV-Assisted Caching Strategy Based on Content Cache Pricing in Vehicular Networks
## 4 RSU Caching Strategy Considering Content Cache Pricing
### Trajectory Optimization of UAV  
After determining the rental price of the content and the caching decision of the RSU, the utility of the CP is determined, but the utility of the NO can be further enhanced by optimizing the trajectory of the UAV. The optimization problem can be expressed as follows:  
\[ \begin{array}{c}P2:\underset{G}{\max}U^{MNO}\\ s.t.\ (\ref{eq:UAV})0\leq V^{U}\leq V^{U}_{\max}\\ (\ref{eq:UAV})\sum\limits_{i=1}^{I}y_{i}^{U_{i}}s\leq CU\\ (\ref{eq:UAV})y^{U}\in(0,1)\end{array}  \tag{32}\]  
where G denotes the trajectory of the UAV, constraint (C4) is a constraint on the flight speed of the UAV, (C5) indicates that the size of the UAV's cached content data cannot exceed the maximum cache capacity, and (C6) indicates that the UAV's cache decision indicator variable takes the value of 0 or 1. In this paper, we assume that the road is divided into \(Z\) small road segments and the length of each segment is the coverage diameter of the UAV with \(Z=\frac{2I}{C^{2}}\). The UAV stays directly above the center of a block during a trajectory optimization cycle \(T_{x}\) to serve the vehicle users within that block and selects an adjacent block at the end of the current trajectory optimization cycle to serve the vehicles within that block during the next trajectory optimization cycle \(T_{z+1}\). The starting and ending points of the UAV are the same and fixed to facilitate the charging of the UAV. For the optimization period \(T_{x}\), if given the UAV location, the request delay \(d_{i}(l)\) of the vehicle user who makes a request at location \(l\) when the UAV caches content \(f_{i}\) can be calculated based on the analysis of the content delivery policy and content request delay in Sections 3.4 and 3.5; the average request delay of the user who requests \(f_{i}\) at this time is  
\[d_{i}^{U,ave}=\frac{1}{L}\cdot\int_{0}^{L}d_{i}(l) \tag{33}\]  
According to the analysis in Section 4.1.1, the average request delay \(d_{i}^{ave}\) for \(f_{i}\) when the UAV is not caching \(f_{i}\) at this time can be calculated, so the delay saved by the UAV when slowing down \(f_{i}\) can be expressed as  
\[d_{i}^{save}=(N_{l}\cdot PR_{l,i}+N_{r}\cdot PR_{r,i})\cdot\left(d_{i}^{ave}-d _{i}^{U,ave}\right) \tag{34}\]  
Also, the introduction of a UAV can further increase the benefit of NO. When the UAV and one RSU caches \(f_{i}\) and another RSU does not and the UAV stays on the roadway where the RSU that caches \(f_{i}\) is located, with \(R_{l}\) caching \(f_{i}\) and \(R_{r}\) not caching, and the UAV stays on the \(R_{l}\) side, for example, the probability of obtaining the content increases to \(P_{U}\) for the user of the vehicle that drives in from the \(R_{l}\) side. When the UAV and one RSU caches \(f_{i}\) and the other does not and the UAV stays on the roadway where the RSU that does not cache content \(f_{i}\) is located, taking the example that \(R_{l}\) caches \(f_{i}\), \(R_{r}\) does not, and the UAV stays on the \(R_{r}\) side, the probability of obtaining content increases to 1 for the user of thevehicle approaching from the \(R_{l}\) side. Thus, the benefit that caching \(f_{i}\) can bring to the NO is  
\[w_{i}^{save}=\left\{ \begin{array}{c}(P_{U}-P)\cdot N_{l}\cdot PR_{i}\cdot c \cdot y_{l,i}\cdot(1-y_{v,i})+(1-P)\cdot N_{r}\cdot PR_{i}\cdot c\cdot(1-y_{l,i} )\cdot y_{r,i}\text{, if the UAV stays on the }R_{l}\text{ side}\\ (1-P)\cdot N_{l}\cdot PR_{i}\cdot c\cdot y_{l,i}\cdot(1-y_{r,i})+(P_{U}-P) \cdot N_{r}\cdot PR_{i}\cdot c\cdot(1-y_{l,i})\cdot y_{r,i}\text{, if the UAV stays on the }R_{r}\text{ side.}\end{array} \right. \tag{35}\]  
So, the problem can be simplified as follows:  
\[ \begin{split} P3:\underset{\mathbb{G}}{\max}& U^{save}=\sum\limits_{i}^{I}(w_{i}^{save}+\gamma\cdot d_{i}^{save}) \cdot y_{i}^{II}\\ & s.t.\ (\mathbb{C}\mathbb{A})\mathbb{0}\leq V^{UI}\leq V_{\max}^{UI}\\ &(\mathbb{C}\mathbb{5})\sum\limits_{i=1}^{I}y_{i}^{UI}\leq C\mathbb{U}\\ &(\mathbb{C}\mathbb{6})y^{II}\in(0,1)\end{split}