Industrial robotic arms have flexible maneuverability and have been widely popularized in various industries, therefore, the study of mobile robotic arm motion planning and control system has very important theoretical and practical value. In this paper, an optimal time-impact trajectory planning method for the robotic arm is proposed, which adopts five times non-uniform B-spline function to construct interpolation curves in the joint space, replaces the motion constraints of the robotic arm with the constraints of the control vertices of the B-spline curves of each order, and uses multi-strategy improved viscous bacterial algorithm to optimize the objective function. Simulation and experimental results show that the proposed improved mucilage algorithm can effectively improve the performance of the SMA algorithm, and the optimal trajectory planner is able to obtain a safe and smooth timeimpact optimal trajectory under the premise of satisfying the joint constraints with the running time less than 15s and the impacts in the range of [10-7 rad, 10-3 rad]. This study ensures that smaller shocks are generated during the motion process, which makes the motion control performance of the robotic arm improved.