In this paper, 22 indexes are selected at three levels, including the informatization development level, the Internet development level, and the digital transaction development level, based on China’s provincial panel data from 2011 to 2020, so as to build a digital economy development index system. Moreover, 28 basic indexes are selected from three aspects, including energy construction, energy production and energy consumption, so as to develop an energy economy development evaluation index system. The development index of China’s digital economy and energy economy are measured by using the entropy weight method. The effect of the digital economy on the energy economy and its mechanism are tested by the static panel, the dynamic panel, and the mediating effect and regulating effect models. The results indicate that the digital economy has pronouncedly promoted the development of China’s energy economy, and the development of the digital economy can have an effect on the rationalization of the industrial structure and then affect the development of the energy economy, and there is an intermediary effect. Moreover, the upgrading of the industrial structure is conducive to regulating the digital economy and facilitates the development of the energy economy. The development of the energy economy can be better promoted by focusing on the coordinated regional layout of the digital economy development, building a reliable energy commodity trading platform, and expediting the optimization and upgrading of the industrial structure.