Unmanned aerial vehicle, generally referred to as UAV, due to its high-performance and low-cost characteristics, it is particularly widely used in both military and civil applications, and is often used to perform a variety of complex missions. Trajectory planning is the basis for UAVs to realize autonomous flight, which ensures that UAVs avoid obstacles and threatening areas when performing tasks, and guarantees the safe execution of tasks. The operation of a UAV requires finding the safest and most efficient trajectory from a starting point to a specified end point based on several specific constraints. Current UAV trajectory planning algorithms, such as swarm algorithm, particle swarm algorithm, and ant colony algorithm, have been widely recognized, but still have many limitations when they are applied to complex and variable terrain. Therefore, this paper proposes an improved UAV trajectory planning algorithm based on simulated bird migration, and uses matlab for simulation and algorithm evaluation. The simulation results indicate that the improved search strategy is effective, the algorithm can find a better solution in each iteration, and the search strategy of the algorithm can effectively guide the algorithm towards a more optimized region. Overall, this algorithm has high research value in both military and civilian fields.