As a core technology in the field of modern automation, UAV path planning plays an important role in many fields such as military reconnaissance, disaster rescue, and environmental monitoring. Although traditional path planning algorithms such as Dijkstra’s algorithm can guarantee to find the shortest path, there are problems such as large computation volume, high memory consumption, and easy to fall into local optimization in large-scale map applications. Aiming at the problems of traditional Dijkstra algorithm in UAV path planning, this paper proposes an improved path planning algorithm based on Dijkstra-PSO fusion. The method combines the precise search characteristics of Dijkstra algorithm and the fast convergence ability of particle swarm algorithm, and avoids the algorithm from falling into local optimization by dynamically changing the inertia weight strategy, adaptively adjusting the learning factor, and improving the speed updating mechanism; it constructs a composite fitness function containing the path length and the corner of the turn, and introduces the three times B-spline interpolation for the trajectory smoothing process. Simulation results show that the improved algorithm reduces the number of search nodes by 62.5% to 91.67%, the path length by 9.39% to 16.57%, the turning angle by 90.04% to 92.95%, and the computation consumption time by 85.29% to 93.27% in maps of different sizes from 15×15 to 100×100. Compared with the A* algorithm, the path nodes are reduced by 60% to 91.3% and the search time is reduced by 81.48% to 92.35%. The algorithm in this paper significantly improves the computational efficiency while guaranteeing the path quality, and provides a new solution for real-time path planning of UAVs in complex environments.