To clarify the impact of the structure and function of soil microbial communities in the stage of abandoned farmland, three different stages of land abandoned in desert oasis areas were selected as the research objects. We used metagenomic sequencing technology to research soil microbial community structure and functional diversity characteristics of different stages of abandoned farmland. The results showed that there were significant differences in the relative abundance of the dominant phyla Actinobacteria, Proteobacteria, and Gemmatimonadetes in the soil of the three stages of returning farmland. Compared with that in the early stage of abandoned farmland, the later stage of abandoned farmland restoration increased the gene proportion involved in Quorum sensing, porphyrin and chlorophyll metabolism, pantothenate and CoA biosynthesis, and styrene degradation, and there was a significant difference in relative abundance (