The invention relates to a UUV path planning method based on a particle swarm algorithm. The UUV path planning method comprises the following steps: S1, constructing a UUV path planning optimization model f according to a path length f1, a repulsion potential field between a UUV and an obstacle and an attraction potential field f3 between the UUV and a target; S2, initializing PSO related parameters; S3, calculating time-varying acceleration factors c1, c2 and c3 through the related parameters; S4, calculating a nonlinear inertia weight w; S5, calculating a particle speed Vik and a particle position Xik through the time-varying acceleration factors c1, c2 and c3 and the nonlinear inertia weight w; S6, updating the optimal population of the particle individuals and the optimal population ofthe kth generation of particle individuals by evaluating the fitness function f; S7, judging the number of iterations, if the number of iterations k reaches the maximum number T, outputting an optimal result, and stopping operation; otherwise, k = k + 1, and returning to S4; according to the invention, the balance between the global search capability and the local search capability can be realized, and the UUV path planning solution can be efficiently and flexibly realized.