Abstract:The electricity-hydrogen coupled distributed energy system with high-penetration photovoltaic integration is an important technology pathway for enhancing renewable energy accommodation capability. However, the stochastic fluctuations of photovoltaic generation and load demand can easily lead to real-time power supply-demand imbalance, thereby affecting the economic and efficient operation of the system. Existing Proximal Policy Optimization (PPO) and Safe Proximal Policy Optimization (SPPO) algorithms mainly focus on maximizing economic benefits, while insufficiently considering the role of supply-demand balance constraints in policy updating and action optimization processes. Consequently, cumulative power deviations and poor coordination between source and load fluctuations may occur during decision-making.To address these issues, this paper proposes a supply-demand balance-oriented reinforcement learning optimization method based on Generalized Advantage Estimation (GAE) weighting. A safety layer is introduced to correct potentially unsafe actions, and dynamically adjusts the weight proportion of the safety regularization term in the policy loss function according to the long-term supply-demand regulation value of actions quantified by GAE, achieving coordinated optimization between economic benefit improvement and supply-demand balance maintenance. Experimental results demonstrate that, compared with PPO and SPPO algorithms, the proposed method achieves faster convergence, higher cumulative economic benefits, significantly reduced power supply-demand deviations, and improved online decision-making efficiency of the safety layer. The proposed method provides an effective solution for real-time intelligent scheduling of electricity-hydrogen coupled distributed energy systems.