Referring to the phenomenon that the state of the electrical components changes when they are excited by an external force, and at the same time they return to the initial state with the shortest time, this paper compares the real-time change of the dynamic obstacles with the external force, and proposes a path planning algorithm of the dynamic obstacles robot based on the state change. First, the robot around a single fixed obstacle is analyzed in depth. Second, the dynamic obstacle is analyzed by the way of state update. Finally, the mixed task planning area with dynamic and static obstacles is analyzed by using the superposition method, and the obstacle avoidance path is generated. In order to verify the path planning ability of the algorithm in multi-obstacle environment, the numerical simulation experiment is used. The results show that the robot can effectively realize the path planning of static obstacle area, dynamic obstacle area and dynamic static mixed obstacle area.