The boundary conditions and loading ways of geostress field of oil and gas trap are the difficulties in the numerical simulation and geomechanical analysis. Owing to the limited data of geostress, unclear tectonic movement and complex geological structure, the stress field cannot be solved directly. Boundary load inversion is a very important method to analyze the stress field of rock mass. Based on the measured in-situ stress of S4 member in C41 fault block of Liangjialou oilfield, the boundary loads of the geological body stress field are inversely calculated. Meanwhile, the optimal boundary stress obtained by the inverse modeling is used to study the stress field near the fault. This method can overcome the shortcomings of common back analysis, such as boundary load adjustment method and regression method, and improve the calculation accuracy of stress field. The results show that the inversion method is simple, reliable, accurate and fast. The distribution of stress field can well reflect the in homogeneity of the magnitude and direction of the stress field near the fault. Therefore, this method has a certain application value in boundary load inversion, and the initial stress field distribution of faults provides a precondition for local stability.