Based on the unit life and death technology, the dynamic evolution process of soil loss is considered, and a pipe-soil nonlinear coupling model of buried pipelines passing through the collapse area is constructed. The analysis shows that after the third layer of soil is lost, the existence of the “pipe-soil separation” phenomenon can be confirmed, which then supplements the assumption that “pipe-soil is always in contact” in the elastic foundation beam theory. Calculation of settlement deformation of buried pipelines It needs to be divided into two stages: cooperative deformation and non-cooperative deformation. Taking the settlement prediction of buried pipelines as the goal, the particle swarm algorithm (PSO) was used to optimize the number of neurons, Dropout, and Batch-size in the long short-term memory network (LSTM) structure. The optimization results were 60, 0.001, and 100, respectively. The PSO-LSTM model proposed in this article can accurately describe the dynamic evolution process of buried pipelines and has better prediction accuracy than the modified Gaussian curve method and LSTM neural network model. The use of this model can provide a reference for safety risk management, disaster early warning, and intelligent monitoring when buried pipelines suffer from soil collapse disasters.