In the process of deep foundation pit construction, the horizontal displacement monitoring of the retaining structure is one of the important measures to ensure the construction safety, and the analysis and prediction of the deformation trend of the retaining structure are the most important. In this regard, this paper conducted a field investigation on the automatic monitoring equipment of the enclosure structure, and proposed a method of multi-step rolling prediction of the horizontal displacement of the enclosure structure combined with the BP artificial neural network model. The real monitoring data of the deep foundation pit construction enclosure structure of the Nanning Metro Line 5 station was taken as the training sample, three modes of learning were performed on the sample data. The first one was to compare the prediction results of different piles at the same time after learning; secondly, one was to compare the prediction results of the same pile at the same time after sample learning at different time intervals; the third was to compare the prediction results of the same pile after multi-step rolling prediction is achieved. The results show that the prediction errors of the three modes can meet the requirements. It provides a method with strong practicability and high credibility to realize the automatic prediction of the deformation of the enclosure structure.