For the 6R robot, there is no analytical solution for some configurations, so it is necessary to analyse inverse kinematics (IK) by the general solution method, which cannot achieve high precision and high speed as the analytical solution. With the expansion of application fields and the complexity of application scenarios, some robots with special configuration have become the research hotspot, and more high-speed and high-precision general algorithms are still being explored and studied. The present paper optimized two general solutions. Elimination is a numerical solution, which has high accuracy, but the solution process is complex and time-consuming. The present paper optimized the elimination method, derived the final matrix expression directly through complex coefficient extraction and simplifying operation, and realized one-step solution. The solving speed was reduced to 15% of the original, and the integrity of the method was supplemented. This paper proposed a new optimization method for the Gaussian damped least-squares method, in which the variable step-size coefficient is introduced and the machine learning method is used for the research. It was proved that, on the basis of guaranteeing the stability of motion, the average number of iterations can be effectively reduced and was only 4-5 times, effectively improving the solving speed.