Digital economy plays an important role in the transformation of traditional industries. It not only provides new impetus for economic growth, but also helps traditional industries to accelerate the pace of transformation and promote the optimization and upgrading of industrial structure. This paper discusses the connotation of digital economy, that is, the mechanism of digital economy affects the integrated development of urban and rural areas, and constructs a seven-index system, which uses the entropy weight method, linear regression model, coupled coordination model and intermediate effect analysis to measure the development of national digital economy from 2016 to 2022. The following conclusions are drawn: In recent years, China's digital economy has been sustainable developed, and the coordination between digital economy and urban-rural integrated development has gradually reached a good level. The digital economy contributes to the integration of urban and rural areas. Every 1% increase in the digital economy, the growth level of urban-rural integration will increase by about 0.4694%. Taking the innovation index of science and technology as the intermediate variable, a model is constructed to detect the development degree of digital economy and urban and rural integration. The results show that scientific and technological innovation passes the intermediate effect test, indicating that digital economy can be promoted through scientific and technological innovation and the process of urban and rural integration development. On this basis, this paper puts forward relevant suggestions, which provides reference for the comprehensive development of urban and rural areas.