## 1 Introduction  
As mobile edge computing (MEC) resources are integrated into a unified resource pool and different edge facilities work together, MEC, as an important complement to edge computing, is gradually being more widely used [1]. Unlike traditional fixed edge nodes, MEC provides flexible computing support through mobile devices or nodes, suitable for environments with dynamic network conditions or imperfect infrastructure, especially for future 6G network integrated communication, computing, and caching (3C) [2], such as intelligent transportation, augmented reality, and unmanned aerial vehicle (UAV) communication [3,4].  
UAVs have the characteristics of flexible deployment, strong maneuverability, and efficient line-of-sight communication. By integrating computing resources on UAVs, they can achieve efficient computing task assistance processing for terminal devices, reduce system latency, and improve overall energy efficiency [5]. They are an ideal solution for dealing with environments with limited or missing infrastructure, such as military, rescue, and emergency response. At present, UAVs mainly act as air data relays, mobile access points and temporary base stations in MEC network systems. Due to the limited battery storage of a UAV, energy saving is a key issue in a UAV-assisted MEC system. However, for a low-altitude flying UAV, successful obstacle avoidance is also very necessary. Regardless of its form, its flight trajectory is related to the energy consumption and latency of the network and directly affects computing efficiency and the quality of service. In this context, ways to optimize the flight trajectory of UAVs and offload computing tasks reasonably have gradually become a hot topic in academia and industry research.  
This paper focuses on a UAV-assisted MEC network system, which provides flexible communication services for multiple ground user devices at different heights in a complex three-dimensional (3D) obstacle environment by carrying caching and computing resources on the UAV as an aerial base station.  
The main contributions of this paper are summarized as follows:  
1. We study the MEC model for receiving data offloaded from multiple ground mobile devices in a single UAV multi-user scenario in 3D space, satisfying the constraints of UAV maneuverability and obstacle avoidance. We propose a joint optimization strategy with maximized energy efficiency (OPMEE) for the UAV flight trajectory and user device task offloading rate.
2. To solve this problem, hybrid alternating metaheuristics for energy optimization (HAMEO) are given. Firstly, the Dinkelbach method is used to transform the nonlinear fractional programming problem into a corresponding parameter optimization problem. Then, it is divided into two sub-optimization problems, which are alternately optimized using an improved genetic algorithm and the Arctic puffin algorithm.
3. The experimental results show that the strategy proposed in this paper can enable a UAV to avoid obstacles during flight by detouring or crossing, and the trajectory does not overlap with obstacles, effectively achieving two-dimensional and three-dimensional obstacle avoidance. In addition, compared with related solving methods, the solving method in this paper has significantly higher success than traditional algorithms. In comparison with related optimization strategies, the strategy proposed in this paper can effectively reduce the overall energy consumption of a UAV.  
The organizational structure of this paper is as follows: Section 2 reviews related works. Section 3 gives the system model and problem description. Section 4 solves optimization problems. Section 5 presents the experimental results and analysis. Finally, we summarize the paper and provide prospects for further work in Section 6.