Oil and gas pipelines are subject to soil corrosion and medium pressure factors, resulting in stress concentration and pipe rupture and explosion. Non-destructive testing technology can identify the stress concentration and defect corrosion area of the pipeline to ensure the safety of pipeline transportation. In view of the problem that the traditional pipeline inspection cannot identify the stress signal at the defect, this paper proposes a detection method using strong and weak magnetic coupling technology. Based on the traditional J-A (Jiles-Atherton) model, the pinning coefficient is optimized and the stress demagnetization factor is added to establish the defect of the ferromagnetic material. The force-magnetic relationship optimization model is used to calculate the best detection magnetic field strength. The force-magnetic coupling simulation of Q235 steel material is carried out by ANSYS 2019 R1 software based on the improved J-A force-magnetic model. The results show that the effect of the stress on the pipe on the magnetic induction increases first and then decreases with the increase in the excitation magnetic field strength, and the magnetic signal has the maximum proportion of the stress signal during the excitation process; the magnetic induction at the pipe defect increases linearly with the increase in the stress trend. Through the strong and weak magnetic scanning detection of cracked pipeline materials, the correctness of the theoretical analysis and the validity of the engineering application of the strong and weak magnetic detection method are verified.