The comprehensive evaluation of China’s major function-oriented zoning, grounded in scientific principles, has evolved into a nationwide initiative aimed at promoting regional coordinated sustainable development. A pivotal focus during this transitional phase is the optimization of a “production–living–ecological” spatial pattern within the main national functional areas. This involves a meticulous examination of the main functions, encompassing the distinct categories of production, living, and ecology, as well as prioritizing scenarios aligned with the functional orientation of towns, agriculture, and ecology in land-use simulation. Utilizing the PLUS model’s land-use simulation technology, a detailed investigation into Anhui Province’s main function orientation was conducted to achieve an optimal simulation of the “production–living–ecological” spatial pattern. The findings underscore the inadequacy of a singular scenario in attaining a global optimal solution for simulating the three spaces of production, living, and ecology. However, a gradual stabilization was observed in the overall quantitative structure and spatial transition frequency of these three spaces in Anhui Province. The continuous optimization of local spatial patterns and functional layouts was achieved through a multi-scenario optimization simulation based on main function orientation. Noteworthy improvements were identified in the optimization of the three spaces in specific regions: the northern part of Anhui, urban living spaces around Hefei and Wuhu, and ecological spaces in southern and western Anhui. Crucially, the simulation results align with the strategic goal orientation of the provincial main functional areas, the optimization trajectory of the “production–living–ecological” spatial pattern, and the strategic imperative for the coordinated and sustainable development of territorial space in Anhui Province. These findings furnish a robust scientific foundation for decomposing and transmitting the core indicators of provincial territorial spatial planning, as well as delineating the “three zones and three lines” in municipal territorial spatial planning.