Since the "Thirteenth Five-Year Plan", mainly due to the rapid growth of new energy installed capacity, the overall supply and demand of power system peak regulation has shown a trend of tightening year by year. After the "dual carbon" goal was put forward, "hard" requirements were put forward for the development of new energy sources mainly based on wind power and photovoltaics. The scale growth of new energy sources was further accelerated. Carry out research on the optimal allocation of medium and long-term peak shaving resources in the power system that adapts to the "dual carbon" goal. In this paper, carbon budget constraints are introduced to carry out research on the collaborative optimization of new energy development scale and multi-type peak shaving resource allocation to meet the "dual carbon" goal. Considering that the carbon budget is allocated and assessed in the unit of province (city), this paper takes the provincial power grid as the research object, and is based on a two-stage stochastic programming model. system operation process. Numerical example analysis proves the rationality and effectiveness of the proposed method and model.