External damage and geological disasters are two major hidden dangers threatening the safety of oil and gas pipelines. Traditional manual inspection and ground sensor monitoring methods have certain limitations. This article studies the geological risk assessment and early warning algorithm for pipelines based on the BeiDou satellite. Through satellite imagery, various optimized change detection algorithms are studied, and an automatic change detection software integrating multiple algorithms is constructed. The InSAR method is used to analyze the geological deformation along the pipeline, supplemented by satellite optical images, meteorology, ground sensors, hydrology, geology and other multi-source data, Establish a satellite based geological hazard monitoring system and technical identification methods to achieve comprehensive identification and early warning of geological hazards.