For the path planning of autonomous underwater vehicles (AUVs) in the ocean environment, in addition to the planned path length and safe obstacle avoidance, it is also necessary to pay attention to the impact of ocean currents on the planned path. Therefore, this paper improves the original D* algorithm, and adds the obstacle cost item and the steering angle cost item as constraints on the basis of the original cost function, thus ensuring the navigation safety of the AUV. Considering that ocean currents have a greater impact on the energy consumption of AUVs, this paper establishes a cost model for the impact of ocean currents on AUV energy consumption and applies it to the D* path planning algorithm, so that AUVs can use ocean currents to reduce energy consumption, which can be seen through simulation experiments. The simulation results show that the improvement of the algorithm can plan an optimal energy consumption path.