Inertial navigation is widely used in many fields, such as land, underwater and aviation. Aiming at the shortcoming that the cumulative error of the strapdown inertial navigation system is difficult to be effectively corrected during long-term navigation, it cannot meet the accuracy requirements in the long-term navigation process. In this paper, based on the strapdown inertial navigation, according to the global distribution of the geomagnetic field and the unique characteristics of the magnetic field strength, a second-order complementary filter strapdown inertial navigation algorithm is proposed to overcome the shortcoming that a single inertial navigation system cannot satisfy long-term precise navigation. And the improved algorithm is simulated and analyzed.