Human survival depends on the sustainable development of agriculture. This study constructs a data-driven evaluation and optimization method of agricultural sustainable development capacity, aiming to better cope with challenges such as environmental pollution and excessive consumption of resources and energy, as well as improve agricultural economic level. Further, an evaluation index system was constructed based on comprehensive consideration of energy and resources utilization, environmental pollution, and agricultural economy. After simplifying and integrating the data, a data envelopment analysis model was constructed to quantitatively evaluate the capability for agricultural sustainable development and its changing trend. Moreover, its influencing factors were analyzed from the perspective of input, which provides accurate countermeasures for improving agricultural sustainable development ability, resource utilization efficiency, and process optimization. This study shows the realization process of the aforementioned method for the agricultural development of six cities in northern Anhui from 2010 to 2019. Our results suggest that the sustainable development ability of northern Anhui is weak, but overall, has a good development trend. Based on our results, some countermeasures were proposed to control production scale reasonably, reduce environmental load, and improve resource efficiency, which provides a reference for policymakers to guide and standardize the development of regional agriculture.