The optimization of the energy structure is a crucial element in the development of green and low-carbon economies and societies. Market-based environmental regulations, such as carbon emissions trading, play a significant role in facilitating this transition. This study analyzes panel data from 30 provinces in China from 2007 to 2020. It empirically examines the impact and mechanism of carbon emissions trading pilot schemes on the transformation of energy consumption structure at the macro level, using the difference-in-differences method. The research findings indicate that provinces with carbon emissions trading pilots have experienced significant reductions in carbon emissions and carbon intensity, demonstrating clear emission reduction effects. Additionally, the transformation process of energy consumption structure has been notably accelerated, highlighting the correlation between initial carbon emissions trading and the regional energy utilization framework. Furthermore, in our extended mechanism analysis, we introduce two new variables - green finance and environmental regulation. Our analysis reveals that the level of green finance in carbon emissions trading pilot provinces significantly influences the degree of carbon emissions in these areas. Additionally, environmental regulation has a significant positive impact on the optimization of energy consumption structure.