Aiming to solve the problem that the significant error between the actual joint torque and the calculated joint torque of a welding robot leads to the vibration of the end-effector, which in turn affects the stability of the end-effector, this paper proposes a identification algorithm based on the Weighted Least Squares Genetic Algorithm (WLS-GA) to construct and solve the dynamical model to obtain the accurate dynamical parameters. Firstly, a linear model of welding robot dynamics is derived. The fifth-order optimal Fourier series excitation trajectory is designed to collect experimental data such as joint torque. Then, a rough solution of the parameters to be recognized is obtained by solving the dynamics model through the Weighted Least Squares (WLS) method, the search space is determined based on the rough solution, and the optimal solution is obtained by using the Genetic Algorithm (GA) to perform a quadratic search in the search space. Finally, the identification data obtained from the algorithm is analyzed and compared with the experimental data. The results show that the error between the identification data obtained using the WLS-GA identification algorithm and the experimental data is relatively small. The results show that the identification data obtained using the WLS-GA identification algorithm have less error than the experimental data, taking the Root Mean Square (RMS) value of the joint torque error obtained using the weighted least squares algorithm as a criterion. The accuracy of the WLS-GA identification algorithm can be improved by up to 66.85% compared with that of the weighted least squares algorithm and by up to 78.0% compared with that of the Ordinary Least Squares (OLS) algorithm. In summary, the WLS-GA identification algorithm can accurately identify the dynamic parameters of the welding robot and more accurately construct a dynamic model to solve the effect of joint torque error on the control characteristics of the welding robot. It can improve the stability of the end-effector of the welding robot to ensure the quality of the automobile body and beam welding and welding speed.