Aiming at the problem of high complexity of path planning and difficulty in generating high-quality paths in effective time for UAVs in complex threat environments, a multi-strategy fusion particle swarm-butterfly optimization improvement algorithm (IPSOBOA) was proposed. The initial population was optimized through tent chaotic mapping combined with inverse learning strategy to enhance the diversity of the population; nonlinear parameter adjustment and dynamic conversion probability mechanism were introduced to balance the global search and local exploitation; combined with the particle swarm algorithm, the velocity term was introduced in the local search phase, and the position update equation with dynamic change of velocity was proposed to improve the search efficiency. Based on four benchmark test functions and three different threat scenarios respectively, IPSOBOA was compared with the butterfly optimization algorithm and various other optimization algorithms. The experimental results showed that, compared with the butterfly optimization algorithm in three scenarios of the static environment, IPSOBOA optimized the optimal fitness value by 1.8%, 17%, and 44% respectively, and optimized the path length by 1.8%, 42.4%, and 61.3% respectively; in the dynamic environment, it combined global path tracking and real-time obstacle avoidance to generate smoother and safer paths.