In accordance with the present state of gravity anomaly inversion, we use the 2.5 dimensional model construction method to divide the underground density structure into rectangle gridded units to simulate density models with arbitrary interfaces or bodies, then perform gravity forward modeling. This model construction is flexible and adaptable especially for the complicated geological models with horizontal varying densities usually appearing in practical situations. We employ the improved very fast simulated annealing algorithm (VFSA), which has obvious advantage of finding the global optimal solution in inverse problems to perform gravity anomaly inversion. Only the value of each rectangle unit needs to be inversed, the interfaces or shapes and the density distributions can be simultaneously determined during gravity anomaly inversion. Through the complicated model test, this approach is proved effective and practicable. The application in the lower Yangtze area of Jiangsu shows that this inversion approach could increase the accuracy of inversion under the constrained conditions of prior seismic data, the objective strata of Devonian‐Silurian and related geological problems could also be solved efficiently.