Based on the stochastic medium theory and considered the difference of the properties between rock and soil, the stratum was divided into two parts, rock stratum and soil stratum, and a double-layer medium calculation model was thus established. Firstly, the settlement curve of the geotechnical interface was calculated by using the settlement prediction formula of this model, and then the settlement of the soil layer was obtained by the regarded unequal thickness excavation area surrounded by the settlement curve and the geotechnical interface. The calculation formula of building settlement was derived based on considering the influence of foundation depth and structural stiffness on the deformation of the building. Finally, the calculated value and measured value was compared and analyzed on the backdrop of the underground tunnel project which passed through buildings in engineering case of Guiyang Urban Rail Transit Line 2 at GuanXing Section. The results show that the calculated settlement value of the building is lined with the measured value based on the double-layer medium calculation model considering the difference between rock and soil layers. © 2020, Editorial Board of Journal of Huazhong University of Science and Technology. All right reserved.