Joint Optimization on Trajectory, Cache Placement, and Transmission Power for Minimum Mission Time in UAV-Aided Wireless Networks

: In recent years, due to the strong mobility, easy deployment, and low cost of unmanned aerial vehicles (UAV), great interest has arisen in utilizing UAVs to assist in wireless communication, especially for on-demand deployment in emergency situations and temporary events. However, UAVs can only provide users with data transmission services through wireless backhaul links established with a ground base station, and the limited capacity of the wireless backhaul link would limit the transmission speed of UAVs. Therefore, this paper designed a UAV-assisted wireless communication system that used cache technology and realized the transmission of multi-user data by using the mobility of UAVs and wireless cache technology. Considering the limited storage space and energy of UAVs, the joint optimization problem of the UAV’s trajectory, cache placement, and transmission power was established to minimize the mission time of the UAV. Since this problem was a non-convex problem, it was decomposed into three sub-problems: trajectory optimization, cache placement optimization, and power allocation optimization. An iterative algorithm based on the successive convex approximation and alternate optimization techniques was proposed to solve these three optimization problems. Finally, in the power allocation optimization, the proposed algorithm was improved by changing the optimization objective function. Numerical results showed that the algorithm had good performance and could effectively reduce the task completion time of the UAV.


Introduction
Many countries are now using fifth-generation (5G) mobile communications in commercial deployments, and the industry, academia, and regulatory agencies have begun to research and develop next-generation mobile communication networks. As one of the access methods of the sixth-generation (6G) mobile communication network, UAVs are paramount to the goal of building an integrated air-space-ground-sea network to achieve emergency coverage, depth of coverage, and breadth of coverage [1][2][3]. Networked robotics and autonomous systems are typical applications of 6G, and UAV delivery systems are an example. Using drone technology in 6G would also help achieve cellular-free communications [4]. Therefore, UAVs will become important elements in 6G wireless communication, and, therefore, the research on UAV communication systems and related technologies has strategic significance [5].
At present, due to the high mobility, rapid deployment, flexible configuration, and the line-of-sight (LOS) link between UAVs and communication nodes in most cases, UAVs will play an important role in realizing high-speed wireless communications in communication systems [6]. In addition, UAVs can not only serve users on the ground as an air base station (BS), they also can reduce the data flow to the ground BSs in extremely crowded areas, enhance network reliability, and improve the quality of service [7,8]. In terms of mobile relay communication, there is almost no direct communication between the BSs on the ground and the users. UAVs are, therefore, used to transmit information between the BSs and remote users [9]. Compared with a traditional ground-fixed relay, UAVs have more significant advantages as mobile relays [10]. However, for UAV-assisted wireless communications, in addition to consuming circuit power and transmitting power, the UAVs also consume a large amount of propulsion power to maintain flying or hovering at a certain height. Due to the limited energy of UAVs, it is necessary to optimize the deployment of UAVs and reasonably allocate the energy of UAVs.
At the same time, with the rapid development of multimedia services, communication between users has changed from traditional connection-centric communication to contentcentric communication, that is the communication between users depends on large data files, such as videos and images, which bring great challenges to the future 5G/B5G networks. As a feasible technology to reduce network traffic load and improve network capacity, caching technology has been widely used in the field of cloud radio access networks (CRAN) [11]. In CRANs, edge nodes obtain popular content from the core network during off-peak hours and store it in their own hard disks, so that users can directly obtain the required content from the edge nodes, thus transferring the traffic in the backhaul link from peak to off-peak time periods, greatly reducing the traffic load on the backhaul link [12]. Since UAVs can only provide data transmission services to users through wireless backhaul links established with base stations on the ground, the limited capacity of the wireless backhaul link limits the transmission rate of UAVs and reduces the quality of service for the users [13]. UAV-assisted wireless communication using edge caching technology can effectively reduce the load of the wireless backhaul link, improve the performance of the UAV-assisted communication network, and provide users with a better quality of service. Therefore, cache-based UAV-assisted wireless communication is a technology with broad prospects for development, which can well meet the diverse and dynamic data requirements in the future 5G/B5G networks.
With the development of UAV technology and the popularization of civil UAV, UAVs have become an important means to collect geographic distribution data. For example, in the application of geographic information acquisition in a disaster, as the primary task of emergency support from a geographic information service, it is not only key to obtain the disaster distribution and disaster situation in a timely manner, but this is also the basis of emergency rescue, disaster assessment, post-disaster recovery, and reconstruction. In some areas, mountains and hills are widely distributed, the terrain uneven, and the climate complex and changeable. There are many difficulties in obtaining disaster information quickly after an emergency, so the emergency response capacity faces a major test. UAV systems as an important technical means of the rapid acquisition of disaster geographic information have been listed as an important part of the national aviation emergency rescue system. However, there are still many deficiencies in practice for UAV. The major technical problems in UAV disaster geographic information acquisition are the following: (1) the efficiency of UAV disaster information acquisition and on-site rapid processing is low under short-term airspace constraints; (2) the UAV's security, stability, and long-distance realtime transmission capability are insufficient in the context of complex conditions; (3) the capacity of the spatial analysis and dynamic simulation of disasters is poor. In terms of the geographic information industry, a UAV and geographic information system is far from the quality of aerial surveys. A UAV and geographic information system should be based on the applications of the GIS industry. The role of the UAV is not limited to aerial surveys, but it can also serve as an information collection platform. UAV aerial surveys emphasize the accuracy of the results, while GIS-oriented UAV applications emphasize reasonable cost, a flexible acquisition method, appropriate spatial accuracy, close to industry workflow, and good operability. This paper mainly focused on the deployment of emergency situations and temporary events in some complex and dangerous areas. To this end, this paper designed a cache-based UAV-assisted wireless communication network model, in which UAVs with a cache were used as mobile relays to provide data transmission services to users on the ground. The purpose of this research was to minimize the mission completion time of the UAV under the constraints of meeting the maximum energy estimation of the UAV and the user data requirements. We summarized the main contributions of this paper as follows: (1) Firstly, an mathematical model is developed for the UAV-assisted wireless communication using the cache technology. By optimizing the trajectory of the UAV, cache placement and the UAV transmit power, the data transmission service time of the UAV is minimized. In the optimization problem, this paper considers the maximum propulsion energy estimation, the user's minimum data requirements and other constraints and so on. In general, the formulation problem is non-convex, and it is difficult to get the optimal solution; (2) Secondly, to solve the problem of non-convex optimization, an iterative (ITE) algorithm based on successive convex approximation and alternate optimization techniques are proposed. The formulated problem is non-convex with coupled variables.
To facilitate the solution in a larger feasible region, this paper uses the slack variables to deal with the mathematical model of the optimization problem. Then it is divided into three sub-problems, which are cache placement optimization, UAV trajectory optimization, and UAV power optimization. Finally, SCA technology is used to solve three sub-optimal solutions. A sub-optimal solution of the non-convex problem was obtained by alternating solutions of cache placement optimization, UAV trajectory optimization, and UAV launch energy optimization; (3) Finally, in the transmission power optimization process, an improved (IMP) algorithm is proposed by changing the optimization objective function. For the task completion time, there is no direct relationship with the transmission power of the UAV, but the more power the UAV allocates to the user, the higher the data transmission rate. Therefore, in the transmission power optimization process, the optimization objective function is changed to throughput maximization, where the cache placement and UAV trajectory are fixed. Simulation results show that the capacity-limited wireless backhaul link problem can be solved by optimizing cache placement, task completion time can be reduced by optimizing UAV trajectory, and system throughput can be maximized by optimizing transmit power. Through experimental comparison, the excellent performance of the improved algorithm is verified.
The rest of this paper is organized as follows. Section 2 introduces the system model. Section 3 introduces the formulation of minimizing task completion time problem. Section 4 proposes an effective iterative algorithm to solve the optimization problem and improves the algorithm. Section 5 presents the simulation results and some analysis. Finally, the conclusion is drawn in Section 6.

Related Work
At present, in the field of UAV-assisted wireless communication, many scholars have studied and discussed the typical problems of UAV communication systems, such as UAV trajectory, resource allocation, cache, and so on [14].
Trajectory optimization plays a very important role in UAV. By optimizing the flight trajectory of UAV, it has an important impact on improving the flight performance of UAV, and can also ensure the completion of flight tasks. In most realistic scenarios, various design states of UAV have been determined, and optimizing the flight trajectory of UAV is one of the few ways to improve the performance of UAV. Optimizing the trajectory of UAV can not only reduce the fuel consumption of the UAV, thereby further increasing the flight distance, but also shorten the flight time of UAV [15]. Zhang et al. [16] minimized the task completion time by optimizing the trajectory of the UAV. The minimum received signal-tonoise ratio was constrained during the entire mission flight to ensure the connection quality between the ground base station and the UAV link. Wu et al. [17] discussed some basic trade-offs between UAV communication and trajectory design. The result showed that the communication throughput, delay and propulsion energy consumption could be balanced by using different UAV trajectory designs, which provided a new idea in the traditional ground communication. Zhang et al. [18] minimized the interrupt probability of the interrupted network by jointly optimizing the trajectory of the UAV and the transmitting power of the equipment. A low-complexity solution for the non-convexity problem was proposed. Under the requirement of meeting the data rate of all users, the total rate of edge users was maximized by optimizing the UAV trajectory and edge user scheduling strategy [19]. Aiming at the limited energy of UAV, Bian et al. [20] studied a UAV-assisted vehicle network, in which a UAV acted as an intermediary to communicate with a vehicle and the BS on the ground, respectively. In the case of multiple constraints, the trajectory and power allocation of UAV were jointly optimized.
With the development of wireless communication technology, the research on resource allocation has received more and more attention [21]. At present, the main consideration is how to allocate communication resources, such as transmission power and bandwidth to improve the performance of the communication system. In the wireless relay communication system, the power or energy of each node and the overall available bandwidth are limited. Therefore, under the limited resources, the research on power consumption and bandwidth is a very important topic, so optimizing the power and bandwidth allocation is an effective method to improve the energy efficiency of the system. Zhang et al. [22] studied the problem of secure communication and maximized the security rate of the system by optimizing the allocation of power allocation. Wu et al. [23] considered the power control to improve the energy efficiency performance of the system. Zhang et al. [24] minimized the UAV flight time while met the target rate requirements of each ground user by jointly optimizing the UAV's trajectory and the power and bandwidth allocation design methods. Wu et al. [25] studied an orthogonal frequency division multiple access (OFDMA) network supporting a UAV, in which the UAV was deployed as the BS. Serving a group of users on the ground and maximizing average throughput for all users by jointly optimizing the UAV's trajectory and the OFDMA resource allocation.
The UAV can only provide data transmission service to users through the wireless backhaul link established with the BS on the ground. The wireless backhaul link with a limited capacity will limit the transmission speed of the UAV, so it has a great challenge in aided wireless communication [26]. In order to reduce cellular data traffic, [27] researched a device-to-device-based UAV-assisted wireless network, in which the caching technology was applied to the UAV. Based on the two modes of the UAV static and dynamic, an optimization problem was designed to maximize the cache hit probability. In order to improve the quality of user experience, [28] studied a cache-based UAV-assisted wireless communication network. The author formulated a joint optimization problem about UAV cache placement and deployment to maximize the quality of user experience. In [29], Wu et al. maximized the network throughput by jointly optimizing cache and trajectory, and proposed a scheme based on deep supervised learning. For multimedia data, excessive data volume in communication is a major problem encountered by researchers. Ref. [30] proposed a UAV-assisted communication scheme using the cache technology, in which the location of the UAV and cache placement were jointly optimized to maximize system throughput.
Under the above background, based on the wireless cache technology, this paper designed a cache-based UAV-assisted wireless communication network model, in which the UAV with cache was used as a mobile relay to provide data transmission services for ground users. The purpose of this research was to minimize the mission completion time of the UAV under the constraints of meeting the maximum energy estimation of the UAV and the user data requirements.

System Model
This paper designs a cache-based UAV-assisted wireless communication scheme, in which the BS and the UAV cooperate to serve multiple ground users. The system model is shown in Figure 1. In this paper, we assume that there are U ground users, using the set UU = {1, 2. . ., U}, the horizontal position of user u is represented by where the position of each user is known in this paper. In this paper, the UAV with cache technology performs the flight mission according to the designed trajectory at the fixed altitude H. Define the task completion time of the UAV as T, and the horizontal trajectory coordinate at time t is denoted as L u (t) ∈ R 2 , 0 ≤ t ≤ T. In addition, v(t) L u (t) is defined as the speed of the UAV at time t, whereL u (t) represents the derivative of L u (t) with respect to time t, and V m a x is the maximum speed of the UAV, so L u (t) ≤ V m a x , ∀t ∈ [0, T]. However, the continuous variable t means that there will have infinite speed constraints, which is not conducive to the subsequent solution. Therefore, the discrete trajectory approximation technique can generate a finite number of variables and constraints. In this paper, the UAV task completion time T is discretized into N equal interval time slots which are small enough, namely T = Nδ t , where δ t represents the length of time slot. Based on this discretization, UAV trajectory L u (t) can be represented by sequence {L u (n), 1 ≤ n ≤ N}. L [1] = L I is the initial position of the UAV, and L[N + 1] = L D is the destination of the UAV when the mission is completed. The trajectory of UAV is limited by the maximum speed and can be expressed as

Channel Model
Generally, h u [n] denotes the channel coefficient between the UAV and the user u in the nth time slot, i.e., h u [n] =h u [n] · β u [n], where β u [n] denotes large-scale fading effects such as the path loss and the shadow, andh u [n] denotes the complex valued random variable. In time slot n, the distance from the UAV to the user u is D u Assuming that the wireless channel between the user u and the UAV is controlled by the line of sight (LoS), and is based on the free space path loss model, the power gain of the LoS channel from the UAV to the user u in the nth slot can be expressed as [31] where α represents the path loss index, β 0 represents the path loss at the reference distance. Generally, the probability of the LoS depends on the statistical model of the propagation environment, the building density, and height. Therefore, in the nth time slot, the LoS link probability between the UAV and the user u is [32] where the two parameter values of b 1 and b 2 are determined by the external environment. m u [n] is the elevation angle between the UAV and the user u. P u [n] is expressed as the transmission power of UAV, and 0 P u [n] P max , ∀n. Where P max is the maximum transmission power. In time slot n, when the UAV transmits data to the user u, the signal-to-noise ratio (SNR) received by the user u is defined as where σ 2 u is the noise power spectral density at the receiver.

Cache Placement Model
In this paper, a UAV based on caching technology is used to carry out the data transmission service. During the non-peak traffic hours, the UAV can cache some popular contents. There are F contents stored in the BS, and the content sequence is expressed as {1, 2 . . . , F} and each content is of equal size. The content popularity sequence is expressed as f ∈ { f 1 , f 2 , . . . f F }, and the fth content popularity is defined as the probability that the f th content is requested by the user. The following expression can be obtained from the Zipf distribution [33].
where ς is the Zipf distribution parameter.
In order to achieve a higher hit rate under limited storage space, this paper adopts the most commonly used caching strategy, that is, the most popular content caching strategy. Due to the limitation of capacity, the UAV can only cache some popular contents. The definition C r represents the number of contents stored by the UAV, and C r F. In time slot n, the user u can request popular content independently, and the probability of requesting is the cache placement vector of each content. In the n time slot, I f u [n] = 1 indicates that the user u can obtain the required content f from the UAV. In addition, the UAV can only serve one user in a period of time, and the cache constraint is expressed as follows.
If the content requested by the user exists in the UAV, the UAV will directly transmit the content to the user without communicating with the BS, thereby reducing the transmission delay and improving the quality of service of the user; if the UAV does not cache the content requested by the user, the UAV will send a request to the BS, and the BS will first transmit the content to the UAV, and then the UAV will transmit the content to the user. In time slot n, the transmission rate of the f th content transmitted by the UAV to the user u as In this paper, we express the amount of data and data requirement constraint that user u can receive in the nth slot as follows.
the left part of the constraint (10) defines the data that the UAV transmits to the user after receiving the user's request. Where S u represents the data requirements of each user within the completion time of the UAV task.

Energy Consumption Model
In many practical scenarios, the energy consumption during the flight of the UAV is far greater than communication energy consumption of the UAV [34], so this article only considers the flight energy consumption of the UAV. The UAV flight power is expressed as [20].
where P 0 = δ 8 ρsAΩ 3 R 3 represents the power of the blade profile and P 1 = (1 + k) is the induced power in the hovering state. Ω represents the angular velocity of the blade and G g is the weight of the UAV. δ is the profile drag coefficient. U tip represents the blade tip velocity and v 0 is the average blade induced hovering speed. k is a correction factor. d 0 is the drag ratio of the fuselage. s is the rotor stiffness. A is the rotor disk area and ρ is the air density. Therefore, the total flight energy consumption of UAV is expressed as [35] Defining O max as the energy carried by the UAV, and the constraint is expressed as

Problem Formulation for Time Minimization
In order to minimize the task completion time of the UAV, the following optimization problem is established by optimizing the UAV trajectory L = {L u [n], ∀n}, cache placement I = {I 0 P u [n] P max , ∀n Constraint (14) ensures that the UAV can transmit data to the user in any time slot n. Constraints (15)- (17) ensure that the content requested by the user exists in the local cache of the UAV. (18) and (19) are about the trajectory constraint of the UAV. In terms of the speed of the UAV, constraint (19) also restricts the maximum speed and (18)  First, (15) is an integer constraint because there is a binary variable in the constraint (15). Second, the inequalities in (14) and (20) have mutually coupled variables, which is a non-convex constraint. Therefore, due to the above reasons, the optimization problem (P1) in this paper is a mixed-integer non-convex problem, which can not be effectively solved by the existing methods.

Problem Solution
In order to make the problem (P1) easier to deal with, the binary variable in (15) is relaxed into a continuous variable, and then the optimization problem (P1) can be represented by (P2).
This relaxation generally means that the objective value of the problem (P2) is represented as the upper bound of the objective value of the problem (P1). Although the problem (P2) is relaxed, it is still a non-convex optimization problem due to the existence of non-convex constraints. Next, we propose an efficient iterative algorithm for the nonconvex problem (P2) by using the successive convex approximation and the alternating optimization techniques. The core idea is to solve the three sub-problems of (P2) iteratively, that is, to optimize the cache placement by fixing the trajectory and transmission power of the UAV; The trajectory of the UAV is optimized by fixing the cache placement and the transmission power of the UAV; to optimize the transmission power of the UAV by fixing UAV trajectory and cache placement.

Cache Placement Optimization
After fixing the trajectory and transmission power of the UAV, the cache placement is optimized by solving the following problem (P3).
Since the problem (P3) is a standard linear programming form, the cache layout can be optimized by solving the linear programming, and the existing optimization tools (such as CVX) can effectively solve the convex optimization problem.

UAV Trajectory Optimization
After giving cache placement and the transmission power of the UAV, the UAV's trajectory is optimized by solving the following problem (P4).
Since constraint (34) and (37) Because there are new non-convex constraints in (38)-(40), (P5) is still a non-convex problem. In order to solve this problem, the slack variables J = {j u [n], ∀u, n} are introduced to deal with R f u [n]. There are the following questions (P6).
By solving the problem (P6), we can get the optimal solution of the problem (P5). In (P6), J is convex to L u [n] − Z u 2 in constraint (45). Since there are non-convex constraints in (45) and (47), then (P6) is still non-convex. At a given local point, using SCA technology, each iteration can convert the function that needs to be processed into a form that is easy to solve. Based on the given local points δ r t and y r u [n], using the first-order Taylor (FoT) expansion of (δ t + y u [n]) 2 in constraint (47), the global lower bound can be obtained.
It can be seen from (54).
where g u [n] is convex relative to δ t and y u [n].
In constraint (48) For any given local points δ t , y r u [n], v r [n], o r u [n], L r u [n] and the lower bound of (54)-(57), the problem (P6) is represented by (P7).
The analysis shows that (P7) is a convex optimization problem, which can be solved using CVX.

UAV Transmission Power Optimization
After giving the cache placement and the UAV's trajectory, optimize the UAV's transmission power by solving the following problems (P8).
It can be seen from the above expression that the problem (P8) is convex for the transmission power P {P u [n]}. However, we convert the constraint (67) into another form, which is easier to handle. After introducing variables {λ u [n], ∀u, n} and defining ). At this time, the constraint (67) can be expressed as.
Next, the lower bound of χ u [n] is obtained by first-order Taylor expansion, namelỹ For the non-convex term in constraint (68), δ t , and at the same time introduce a slack variable c u [n] ≥ 0 to transform it into a more tractable form.
therefore, the constraint (67) can be transformed into the following form.
The constraint (76) can satisfy the constraint (75) by continuously reducing the value of the slack variable, but (76) is still non-convex. In order to facilitate processing, the constraint (76) is transformed into the following form.
Note that the inequality constraint (78) is still non-convex. The right-hand side of (78) is transformed by first-order Taylor expansion into: where c r u [n] and η r u [n] are the values of c u [n] and η u [n] at the rth iteration. Finally, the transmission power optimization problem can be solved by the following convex problem.
By solving the above convex problems, δ t , P u [n], λ u [n], ξ u [n] and c u [n] can be updated, and it can be effectively solved by CVX.

Joint Flight Trajectory, Cache Placement, and Transmission Power Optimization
Based on the discussion in the previous three sections, this section proposes the ITE algorithm to jointly optimize the trajectory, cache placement, and transmission power of the UAV. The specific iteration process is shown in Algorithm 1.
In the above ITE algorithm, after fixing the cache placement and the trajectory of the UAV, the optimization of the transmission power is mainly to minimize the objective function by optimizing the speed of the UAV. Due to the existence of constraints (27) and (28), when the UAV's trajectory is optimized, the UAV's speed will reach the maximum value. So if there are no energy and speed constraints in the ITE algorithm, the performance will be better. Since the problem (P9) has many optimization variables, it not only increases the computational complexity, but also easily falls into the local optimal value. In fact, the relationship between the optimization of the objective function and the transmission power of the UAV is not very obvious. However, when the UAV is transmitting data, the more power allocated to the user, the higher the data transmission rate. In the case of the same data requirements, the higher the transmission power, the shorter the entire flight time. As the data demand increases, the influence of the transmit power on the objective function becomes more obvious. Therefore, we convert the objective function of minimizing time into maximizing throughput. The details are as follows.
can be updated through the problem (P10). Improve the ITE algorithm by changing the objective function in the problem (P8). The IMP Algorithm 2 is as follows.

Simulation Setup
This section verifies the feasibility and superiority of the algorithm through simulation experiments. In the simulation experiment, the UAV using the caching technology performs the data transmission task, and the users are randomly distributed in the given area. For both ITE and IMP algorithms, the initial trajectory of the UAV is flying in a straight line at a constant speed during the mission. In this section, the performance of the ITE algorithm and the IMP algorithm are compared by using the straight line flight optimization (SLF) [36] and the trajectory optimization scheme (TOS) [34]. In the expression of flight energy consumption of UAV, some parameters are assumed as follows: U tip = 120, v 0 = 4.03, A = 0.503, s = 0.05, Ω = 300, k = 0.01, R = 0.4, δ = 0.012. Other parameters are shown in Table 1.

Simulation Results and Analysis
In this paper, these users are randomly distributed in the area of 1 km × 1 km. Figure 2 shows the comparison of task completion time of four schemes for different data requirements. The ITE algorithm and the IMP algorithm are compared with the other two schemes. In Figure 2, when S u = 1 Mb, the performance of the four algorithms is similar and the task completion time is roughly the same. This is because the data requirements are small and good performance can be achieved without any optimizations. At the same time, when S u = 1 Mb, because there are many optimization variables in the ITE algorithm, compared with the other three schemes, its performance is poor and it takes a long time to complete the task. With the increase in the data requirement, the performance of the ITE algorithm and the IMP algorithm is better than the two external schemes. Compared with the other three algorithms, when the data demand is S u = 25 Mb, the IMP algorithm has the best performance and the data transmission task time is the least. Next, we discuss the convergence of the ITE algorithm and the IMP algorithm in mission completion time and the UAV propulsion energy consumption. In Figure 3, the minimum data requirement of each user is set to S u = 15 Mb. After multiple iterations, the task completion time and the energy consumption of the two schemes converge. From Figure 3a, it can be seen that when the UAV speed reaches the optimal value, the convergence speed of the ITE algorithm starts to slow down. However, the convergence speed of the IMP algorithm is still very fast. Similarly, for the recommended energy consumption, it can be seen from the Figure 3b that as the number of iterations increases, the energy consumption of the IMP algorithm is lower than that of the ITE algorithm, and the convergence speed is faster than that of the ITE algorithm.

Comparison of Data requirements
According to different data requirements, the trajectory and speed of the UAV of the four schemes of the ITE algorithm, the IMP algorithm, the trajectory optimization scheme and the straight-line flight optimization scheme are compared. The results are shown in Figures 4 and 5. It can be seen from Figure 4 that when the data demand of each user is S u = 1 Mb, the UAV chooses to fly straight during the entire data transmission process. When S u = 15 Mb, the flight path of the UAV begins to approach the user. When S u = 25 Mb, the UAV will pass the top of each user, because the closer the UAV is to the user, the higher the communication rate. When the data demand is low, for the other two algorithms, the TOS algorithm needs to be closer to the user. This is because, when the communication rate is high, the TOS algorithm only optimizes the trajectory of the UAV. The ITE algorithm and IMP algorithm proposed in this paper not only optimize the cache placement, but also optimize the UAV's transmission power and trajectory. Combining the Figures 4 and 5, it can be seen that when the data demand is low, the UAV will fly directly to the destination at a faster speed, minimizing the task completion time. When the data demand gradually increases, the UAV will gradually slow down to get closer to the user. When the data demand reaches S u = 25 Mb, the UAV will have two states: flying at maximum speed or hovering on the user. When hovering above the user, the UAV will fly to the position with the best channel link at maximum speed, and then hover there for data transmission. It improves the communication efficiency of the network while reducing the completion time.  Figure 6, it can be seen that the IMP algorithm is smoother than the ITE algorithm and the TOS algorithm. Under different energy constraints, compared with the other three algorithms, it can be seen that the higher the O max , the more drastic the trajectory of the IMP algorithm changes. In Figure 7, the IMP algorithm is relatively stable during the entire flight mission completion process, and the mission completion time is the least. By comparing the three figures in the Figure 7, it can be found that the higher the O max , the higher the speed of the UAV, which is why the trajectory of the UAV becomes sharper.     Figure 8a, it can be seen that when O max = 25 kJ, the trajectory of the UAV is smoother than the trajectory under other energy constraints. It can be seen from the Figure 8b that the higher the energy constraint O max , the higher the speed of the UAV and the shorter the completion time. Conversely, the slower the UAV, the longer it will take to complete.

Transmit Power Allocation for the IMP Algorithm
In this paper, these users are randomly distributed in the given area. When S u = 25 Mb, the power allocation of the UAV in the IMP algorithm is shown in Figure 9. During the entire flight, the UAV will gradually allocate power to users close to it until the user's power reaches the maximum. As the UAV begins to slowly move away from the user, the power allocated to the user will gradually decrease until the power drops to 0. At the same time, the UAV will gradually allocate power to users close to it until the user's power reaches the maximum.

Trajectories for Large-Scale Scenarios
Next, we will verify the performance of the IMP algorithm when the UAV sends data to large-scale users, where the user equipment is randomly distributed in the area of 2 km × 2 km. Figure 10 shows the UAV's trajectory when the data demand of each user is S u = 1 Mb. It can be seen from the figure that the UAV tends to slowly approach the user equipment far away from itself, which can reduce the path loss caused by the long-distance, but will not pass through each user equipment. There is a trade-off between communication rate and completion time to meet minimum data requirements and minimize completion time. The difference from Figure 10a,b is that the UAV returns to the origin after the mission is completed. It can be observed that the UAV is flying in an area with dense user equipment, and the first half and the second half of the UAV's flight trajectory are symmetrical. In order to shorten the completion time as much as possible and meet the minimum data requirements of all user equipment, the UAV tends to allocate half of the data in the first flight and half of the data in the second flight.  Figure 11 shows the effect of different ς values on the completion time of the UAV mission. It can be seen from the figure that when the UAV cache capacity is the same, the larger the ς, the shorter the task completion time. This is because ς represents the skewness of content popularity. The larger the distribution of popular files, the more concentrated the UAV cache hit rate, and the higher the UAV cache hit rate. The content requested by the user is easier to obtain from the UAV without passing through the transmission link from the BS to the UAV. Therefore, the higher transmission performance of the system will reduce the mission completion time of the UAV.

Conclusions
In this paper, a UAV-assisted wireless communication system using caching technology is studied. The UAV can pre-store a part of popular content to provide users with data transmission services. Considering the limited storage space, the goal is to minimize the time for the UAV to serve users by jointly optimizing cache placement, the UAV's trajectory and transmission power under the constraints of maximum energy estimation and data requirements for each user. In order to solve this non-convex optimization problem, an iterative algorithm based on successive convex approximation and alternating optimization techniques is proposed. In addition, we have also improved the proposed iterative algo-rithm to improve the performance of the algorithm. The simulation results show that the performance of the proposed algorithm is verified by comparing with various benchmark schemes. We can also carry out many other research directions in our future work. For example, in the field of UAV-assisted edge computing. Considering several ground users with limited computing power in the target area, when the computing tasks they face exceed their computing power, they use the UAV to deploy edge computing servers over the target area to unload data. At this time, it is necessary to consider the communication rate between the user and the UAV, the UAV computing capability, the calculation data offloading strategy, and the UAV's trajectory optimization problem.