This paper proposes a new method based on internal and external joint positioning to solve the problems of low positioning accuracy and large cumulative error of intelligent pipeline detection balls in pipelines.Firstly,positioning accuracy is improved by correcting and calibrating the sphere's position information using external magnetic tags.Secondly,four positioning methods based on inertial sensors are proposed,combined with internal and external joint positioning technology,to achieve segmented positioning and error compensation.This research provides new ideas and methods for the development of intelligent pipeline detection technology,and is of great significance to improving pipeline safety.Through this method,the problems of inaccurate positioning and error accumulation in traditional pipeline detection can be effectively solved,and the accuracy and reliability of pipeline detection can be improved.