Self-adaptive micro-grid operation optimization method, system, equipment and medium
By employing an adaptive microgrid operation optimization method, utilizing state awareness, strategy evolution, and rolling optimization modules, the uncertainties of new energy sources and load fluctuations in microgrid operation are addressed, thereby enhancing the system's adaptive capabilities and stability.
Patent Information
- Application Number
- CN202511599402.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-04
- Publication Date
- 2026-02-27
AI Technical Summary
Microgrids face challenges such as uncertainty of new energy sources, load fluctuations, complexity and dynamism of energy storage systems, and operational risks. Traditional methods are difficult to adapt to the complex and ever-changing operating environment and cannot meet the requirements of real-time performance and reliability.
An adaptive microgrid operation optimization method is adopted. The state perception module performs deep feature encoding and spatiotemporal attention processing, and the strategy evolution module performs online strategy learning and optimization. The new energy uncertainty model generates multi-scenario prediction data, and the predictive control problem is solved through the rolling optimization module. The decision weights are dynamically adjusted to output scheduling instructions.
It significantly improves the stability of the system under conditions of fluctuating renewable energy output and rapid changes in load demand, reduces the failure rate, enhances the reliability of renewable energy output information and the ability to adapt to unknown disturbances, and realizes the intelligence and adaptive learning of the microgrid.
Smart Images

Figure CN121581273A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of micro-grid operation optimization, and particularly relates to a self-adaptive micro-grid operation optimization method, system, device and medium. BACKGROUND
[0002] With the acceleration of energy transformation, micro-grid as an efficient and flexible energy management system has attracted widespread attention. However, its operation faces many challenges, such as the uncertainty of new energy output, the rapid fluctuation of load demand, the complex charging and discharging characteristics of energy storage system, the dynamic operation environment of the system and the potential operation risks. These factors make the stable and efficient operation of micro-grid extremely challenging. Traditional methods, such as fixed rule expert system, static partition strategy system and traditional dynamic reinforcement learning method, although can solve some problems to some extent, have obvious limitations. The fixed rule expert system relies on preset rules and is difficult to adapt to complex and variable operating environments; the static partition strategy system can optimize local areas, but cannot respond to the dynamic changes of the system in real time; the traditional dynamic reinforcement learning method has adaptive ability, but has slow learning speed and poor adaptability to complex environments, which is difficult to meet the real-time and reliability requirements of micro-grid. SUMMARY
[0003] In view of the above problems, the present application is proposed.
[0004] Therefore, the technical problem solved by the present application is the problems of new energy uncertainty, load fluctuation, energy storage system complexity, dynamics and operation risk in micro-grid operation.
[0005] To solve the above technical problems, the present application provides the following technical scheme: a self-adaptive micro-grid operation optimization method, comprising the following steps, acquiring micro-grid operation state data; generating a unified state representation by deep feature coding and spatio-temporal attention processing of the micro-grid operation state data through a state perception module; based on the unified state representation, performing online policy learning and optimization through a policy evolution module, and outputting a policy optimization result; generating multi-scenario prediction data using a new energy uncertainty model, combining the prediction data and the policy optimization result, and solving a prediction control problem through a rolling optimization module; adjusting the decision weights of the policy evolution module and the rolling optimization module according to the real-time risk assessment result, and outputting micro-grid operation scheduling instructions.
[0006] As a preferred scheme of the adaptive micro-grid operation optimization method, wherein: the state perception module first aggregates the features of the distributed power supply and the load node through spatial attention, which is expressed by a mathematical expression as follows: ; ; Then, the time-dependent capture of the spatial aggregated features is performed through time attention, which is expressed by a mathematical expression as follows: ; In the formula, 、 、 are a query matrix, a key matrix and a value matrix respectively, is a neighbor set of node i, is a spatial attention weight, is a spatial aggregated feature of node i, is a time attention weight, is a final state encoding at time t, and T is a historical time window length.
[0007] As a preferred scheme of the adaptive micro-grid operation optimization method, wherein: the strategy evolution module defines a reward function to integrate economy and safety, which is expressed by a formula as follows, ; The proximal policy optimization algorithm is used to realize strategy updating, which is specifically expressed as: ; In the formula, is a reward function, is a power generation cost, is a node voltage, is a weight coefficient, and are a new strategy function parameter and an old strategy function parameter respectively, is a learning rate, and are a new strategy function and an old strategy function, is an advantage function, is a gradient operator of the parameter θ, is a mathematical expectation of the state s and the action a, is a minimum value function, is a clipping function, and ϵ is a clipping parameter.
[0008] The preferred technical scheme has the beneficial effect that the strategy evolution module realizes the adaptive ability of the system through reinforcement learning, and can continuously learn and optimize the decision strategy during operation.
[0009] As a preferred scheme of the adaptive micro-grid operation optimization method, wherein: the rolling optimization module comprises the following steps, Set the prediction time domain and establish a rolling time window from the current time to several future times; Construct a target function considering the generation cost, energy storage cost and voltage deviation cost, and set constraint conditions including power balance constraints and device operation constraints; Solve the optimization problem based on the current system state and prediction data to obtain the optimal control sequence in the future prediction time domain; Execute the first control action in the optimal control sequence, and take the remaining control actions as prediction references; Further forward the time and repeat the optimization solving process.
[0010] The beneficial effects of the preferred technical scheme are that the rolling optimization module provides forward-looking decision-making ability for the system, and by setting the prediction time domain, the optimal control strategy can be formulated based on the prediction information in the future period of time.
[0011] As a preferred scheme of the adaptive micro-grid operation optimization method, wherein: the step of adjusting the decision weight of the strategy evolution module and the rolling optimization module comprises, Real-time monitoring of the risk indicators of the micro-grid, including node voltage out-of-limit conditions and new energy prediction errors; Calculate the comprehensive risk indicator to evaluate the current system risk level through the risk quantification formula; Adjust the decision weight based on the risk indicator, and calculate the weight distribution ratio of the strategy evolution module and the rolling optimization module using the S-shaped function; Wherein, the risk quantification formula is: ; In the formula, is the comprehensive risk indicator at time t, which is used to quantify the risk level of the current system; is the real-time voltage vector of each node at time t, reflecting the current grid voltage state; is the safe voltage threshold vector of each node, which is used as the voltage safety judgment reference; is the safety margin parameter; is the maximum value function; The weight distribution calculation formula is: ; In the formula, is the dynamic weight distribution coefficient at time t, is the S-shaped function, is the risk sensitivity parameter.
[0012] The beneficial effects of the preferred technical solution are that the dynamic weight adjustment mechanism gives the system the ability of risk perception and adaptive adjustment, and by monitoring the risk indicators in real time and calculating the comprehensive risk level, the decision weight can be dynamically allocated between the strategy evolution module and the rolling optimization module.
[0013] As a preferred scheme of the adaptive micro-grid operation optimization method, the step of constructing the new energy uncertainty model comprises, Collecting meteorological feature data as meteorological condition input; Mapping the meteorological features to the probability distribution space through the conditional variational encoder to generate mean And variance parameters of hidden variables ; Sampling hidden variables from the probability distribution space Generating multi-scenario new energy output samples according to the hidden variables and meteorological conditions by using the decoder ; Providing the generated multi-scenario samples to the rolling optimization module to establish robust constraint conditions considering uncertainty; Wherein, Z is a hidden variable, obeys a normal distribution, is a mean function output by the encoder, is a variance function output by the encoder, is an encoder network parameter, is a generated new energy output scenario sample, is a decoder function, is a meteorological feature vector at time t.
[0014] The beneficial effects of the preferred technical solution are that the new energy uncertainty model solves the challenge of renewable energy output volatility to the system, and through the conditional variational encoder, it can generate multiple possible new energy output scenarios based on meteorological features, convert uncertainty from qualitative description to quantitative probability distribution, provide more comprehensive information for rolling optimization, and improve the robustness of coping with new energy fluctuations.
[0015] As a preferred scheme of the adaptive micro-grid operation optimization method, the strategy evolution module further comprises an adversarial training step, specifically comprising, Generating adversarial disturbance samples in the strategy training process, calculating the disturbance direction through the fast gradient sign method ; Constructing an adversarial training objective function, and adding a strategy consistency constraint term to the proximal policy optimization algorithm ; Adopting flat minimization optimization strategy, the generalization ability of the strategy to unknown disturbance is improved through a two-step optimization process. wherein, is an adversarial disturbance vector, is a disturbance intensity, is a sign function, is a gradient of a loss function to a state, is an adversarial loss function, is a proximal policy optimization algorithm, is an adversarial weight, is a KL divergence.
[0016] The beneficial effects of the preferred technical solution are that the adversarial training mechanism enhances the robustness and generalization ability of the strategy, and the strategy network is trained by generating adversarial disturbance samples, so that various unknown disturbances and abnormal conditions in actual operation can be better dealt with.
[0017] Another object of the present application is to provide a system for adaptive micro-grid operation optimization.
[0018] To solve the above technical problems, the present application provides the following technical solutions: a system for adaptive micro-grid operation optimization, comprising a state perception module, a strategy evolution module, a new energy uncertainty model, a rolling optimization module, and a decision fusion module. The state perception module is configured to obtain micro-grid operation state data, generate a unified state representation through deep feature encoding and space-time attention processing. The strategy evolution module is configured to perform online strategy learning and optimization based on the unified state representation, and output a strategy optimization result by fusing economic and safety targets. The new energy uncertainty model is configured to generate multi-scenario new energy output prediction data according to meteorological feature data using a conditional variational encoder. The rolling optimization module is configured to combine the prediction data and the strategy optimization result, and solve a predictive control problem by setting a prediction time domain and a rolling time window. The decision fusion module is configured to dynamically adjust the decision weights of the strategy evolution module and the rolling optimization module according to a risk assessment result, and output a micro-grid operation scheduling instruction.
[0019] The present application provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and wherein the processor implements the steps of the adaptive micro-grid operation optimization method when executing the computer program.
[0020] The application provides a computer readable storage medium, which stores a computer program, and the computer program is characterized by realizing the steps of the adaptive micro-grid operation optimization method when the computer program is executed by a processor.
[0021] The application has the following beneficial effects: Through the dynamic reinforcement learning framework, the micro-grid operation state is perceived in real time and the strategy is adaptively adjusted, so that the stability of the system under the conditions of new energy output fluctuation and rapid load demand change is significantly improved. For example, when the new energy output fluctuation is 20%, the system stability index only decreases by 5%, while the traditional method decreases by 30%, the failure rate is greatly reduced, and the operation challenge under complex working conditions and uncertain environment is effectively coped with.
[0022] The conditional variational autoencoder (CVAE) is used to generate multi-scenario new energy output samples, so that the modeling accuracy of new energy uncertainty is improved. The prediction error is reduced from 15% of the traditional method to 5%, which provides more reliable new energy output information for the optimization operation of the micro-grid and improves the acceptance capacity of the micro-grid to new energy. The adversarial training mechanism is introduced, disturbances are injected in the training process, and the strategy network is adjusted by the optimizer, so that the adaptability to unknown disturbances is improved.
[0023] The new paradigm of "state deep perception-dynamic strategy learning-robust optimization" is constructed, and the application realizes the intelligentization and adaptive learning of the micro-grid. In the complex operation environment, the micro-grid can automatically adjust the strategy without human intervention, adapt to environmental changes, and provide strong support for efficient operation. BRIEF DESCRIPTION OF DRAWINGS
[0024] In order to more clearly illustrate the technical solutions of the embodiments of the application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the application, and other drawings can be obtained by those skilled in the art without creative labor.
[0025] Figure 1 A general flowchart of an adaptive micro-grid operation optimization method provided by an embodiment of the application.
[0026] Figure 2 A structure diagram of an adaptive micro-grid operation optimization method provided by an embodiment of the application.
[0027] Figure 3 A micro-grid operation strategy response time comparison experiment diagram of an adaptive micro-grid operation optimization method provided by an embodiment of the application.
[0028] Figure 4An economic loss comparison diagram of an adaptive micro-grid operation optimization method provided by an embodiment of the present application.
[0029] Figure 5 A control success rate comparison diagram of an adaptive micro-grid operation optimization method provided by an embodiment of the present application.
[0030] Figure 6 A running robustness comparison diagram of an adaptive micro-grid operation optimization method provided by an embodiment of the present application. DETAILED DESCRIPTION
[0031] In order to make the above objectives, characteristics and advantages of the present application more apparent, obvious and easy to understand, the specific embodiments of the present application will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative labor should fall within the scope of protection of the present application.
[0032] Embodiment 1, refer to Figures 1-6 For the first embodiment of the present application, the embodiment provides an adaptive micro-grid operation optimization method, comprising: S1, obtaining micro-grid operation state data.
[0033] The micro-grid operation state data is obtained from the micro-grid monitoring system, including but not limited to load demand, new energy output, energy storage state, weather forecast (wind speed, irradiance).
[0034] Pretreatment of collected data: eliminate measurement noise by sliding window smoothing filter, window length is set to 5 minutes; use Lagrange interpolation method to process data missing problem; all data are standardized by Z-score to ensure the uniformity of different dimension data.
[0035] S2, the state perception module is used to deeply encode and process the spatial and temporal attention of the micro-grid operation state data, and a unified state representation is generated.
[0036] The state perception module first aggregates the features of the distributed power supply and the load node through spatial attention, which is expressed by a mathematical expression as follows: ; ; Then, the time attention is used to capture the time sequence dependence of the spatial aggregated features, which is expressed by a mathematical expression as follows: ; In the formula, , Query matrix, key matrix and value matrix are 256-dimensional vectors respectively, is the neighbor set of node i, is the spatial attention weight, is the spatial aggregated feature of node i, is the temporal attention weight, is the final state encoding at time t, and T is the length of the historical time window.
[0037] It is necessary to know that the calculation of the temporal attention weight takes into account the length of the historical time window T=48 (corresponding to 24 hours of historical data, every 30 minutes as a time step), and the weight calculation formula is designed to first calculate the correlation score of the current time and the historical time, and then normalize it through the softmax function., to ensure the probability distribution characteristics of the temporal attention weight.
[0038] S3, based on the unified state representation, the online policy learning and optimization are carried out through the policy evolution module, and the policy optimization result is output.
[0039] The policy evolution module defines the reward function to combine economy and safety, which is expressed by the formula as ; In reinforcement learning, the goal is to optimize the policy function to maximize the cumulative reward expectation. Based on the policy gradient theorem, the basic form of parameter update is: ; where, is the policy performance function; In order to reduce the variance of gradient estimation, the advantage function A(s,a) is introduced to replace the original action value function: The advantage function quantifies the degree of advantage of taking action a in state s relative to the baseline policy; In the conversion from on-policy to off-policy, the problem of data distribution mismatch is faced at this time. The data collected by the old policy is used to train the new policy , which needs to be corrected by importance sampling: Importance sampling ratio ; Based on importance sampling, the agent objective function can be constructed: ; The implicit trust region constraint is realized through the clipping mechanism, which avoids the complex KL divergence constraint solving in the TRPO algorithm: ; Adopt the idea of pessimistic estimation, select the more conservative estimate between the original target and the clipping target: ; Based on the robust optimization theory, ensure that the monotonicity of policy improvement can still be maintained in the worst case.
[0040] The parameter gradient of the clipping target function is obtained, and the final parameter update rule is obtained, and the proximal policy optimization algorithm realizes policy update, which is specifically expressed as: ; In the formula, is the reward function, is the generation cost, is the node voltage, is the weight coefficient, and are the new policy function parameters and the old policy function parameters, is the learning rate, and are the new policy function and the old policy function, is the advantage function, is the gradient operator to the parameter θ, is the mathematical expectation to the state s and the action a, is the minimum value function, is the clipping function, and ϵ is the clipping parameter.
[0041] The policy evolution module also includes an adversarial training step, which specifically includes S3.1-S3.3: S3.1, generate adversarial perturbation samples in the policy training process, and calculate the perturbation direction by the fast gradient sign method ; The fast gradient sign method is used to realize perturbation calculation in the process of generating adversarial perturbation samples in the policy training process. The current microgrid operating state vector contains key information such as load demand, photovoltaic output, energy storage SOC, and node voltage. Assuming that the current state is s=[120kW, 65kW, 58%, 0.98p.u., 1.01p.u., 0.97p.u.]. First, calculate the loss function L of the current policy in this state, which comprehensively considers policy performance, value function estimation error, and policy entropy and other components. The gradient of the loss function to the state vector s is calculated by the back propagation algorithm , the gradient vector is [0.03, -0.02, 0.01, 0.05, -0.04, 0.02]. The perturbation intensity parameter is set to 0.1, which is determined through a large number of simulation experiments, which can produce sufficient perturbation effect and will not damage the physical meaning of the state. According to the perturbation calculation formula, the adversarial perturbation vector is ξ = [0.1, -0.1, 0.1, 0.1, -0.1, 0.1], and the generated adversarial state is: s+ξ=[120.1kW,64.9kW,58.1%,1.08p.u.,0.91p.u.,1.07p.u.].
[0042] S3.2, Constructing an adversarial training objective function, adding a policy consistency constraint term to the proximal policy optimization algorithm ; The construction of the adversarial training objective function is realized by adding a policy consistency constraint term to the proximal policy optimization algorithm. The original proximal policy optimization algorithm loss function LPPO contains a policy loss, a value function loss and an entropy regularization term. The LPPO calculation value of the current training batch is -0.25. The system simultaneously calculates the KL divergence of the action probability distribution output by the policy network under the original state s and the adversarial state s+ξ. The action probability distribution output by the policy under the original state is =[0.3, 0.4, 0.2, 0.1], corresponding to four possible control action combinations, and the action probability distribution under the adversarial state is =[0.25, 0.45, 0.25, 0.05]. The KL divergence value is 0.068 obtained by the KL divergence calculation formula. The system sets the adversarial weight φ=0.5, which balances the importance of performance optimization and robustness improvement. The final adversarial training objective function calculation is -0.216.
[0043] wherein, is the adversarial perturbation vector, is the perturbation intensity, is the sign function, is the gradient of the loss function to the state, is the adversarial loss function, is the proximal policy optimization algorithm, is the adversarial weight, is the KL divergence.
[0044] S3.3, Adopting a flat minimization optimization strategy to improve the generalization ability of the policy to unknown perturbations through a two-step optimization process.
[0045] S4, Generate multi-scenario prediction data using a new energy uncertainty model, combine the prediction data and the policy optimization results, and solve the predictive control problem through a rolling optimization module.
[0046] The steps of constructing the new energy uncertainty model include: collecting meteorological feature data as meteorological condition input; mapping the meteorological features to a probability distribution space through a conditional variational encoder to generate mean value and variance parameters of hidden variables ; sampling the hidden variables from the probability distribution space , generating multi-scenario new energy output samples according to the hidden variables and the meteorological conditions by using a decoder ; providing the generated multi-scenario samples to a rolling optimization module to establish robust constraint conditions considering uncertainty; wherein Z is a hidden variable, obeys a normal distribution, is a mean value function output by the encoder, is a variance function output by the encoder, is an encoder network parameter, is a generated new energy output scenario sample, is a decoder function, is a meteorological feature vector at time t.
[0047] The rolling optimization module includes the following steps S4.1-S4.5: S4.1, set a prediction time domain and establish a rolling time window from the current time to several future times; S4.2, construct an objective function considering power generation cost, energy storage cost and voltage deviation cost, and set constraint conditions including power balance constraint and device operation constraint; S4.3, solve the optimization problem based on the current system state and prediction data to obtain the optimal control sequence in the future prediction time domain; S4.4, execute the first control action in the optimal control sequence, and take the remaining control actions as prediction references; S4.5, further advance the time and repeat the optimization solving process.
[0048] Step S4 embodiment: taking a certain industrial park microgrid as an example, which includes a 200kW diesel generator, a 100kWh energy storage system and a 100kW rooftop photovoltaic array. The current time is 10am, and the operation of the next 3 hours needs to be optimized and scheduled.
[0049] The new energy uncertainty modeling process starts from the collection of meteorological data. The conditional variational autoencoder generates three main photovoltaic output scenarios based on the current weather forecast information, including cloud cover, irradiance prediction, and wind speed data. The first scenario assumes sunny weather, predicting photovoltaic output of 60kW, 75kW, 85kW, 90kW, 80kW, and 70kW for the next 6 time steps, with a probability of 30%. The second scenario considers cloudy weather conditions, corresponding to output predictions of 45kW, 55kW, 65kW, 70kW, 60kW, and 50kW, with a probability of 50%. The third scenario targets overcast conditions, predicting output of 20kW, 25kW, 30kW, 35kW, 30kW, and 25kW, with a probability of 20%. At the same time, based on historical load patterns and current electricity consumption trends, future load demand is predicted to change according to the trend of 120kW, 130kW, 140kW, 150kW, 145kW, and 135kW.
[0050] The time domain setting of the rolling optimization module uses 30 minutes as a time step, establishing a prediction time domain window covering the next 3 hours. At the current time, the state shows that the energy storage SOC is 60%, the node voltage is 0.98 per unit, the current load is 115kW, and the actual photovoltaic output is 50kW. Therefore, based on this initial state, the optimal control strategy for the next 6 time steps needs to be planned.
[0051] The construction of the objective function considers multiple dimensions of economy and safety. The generation cost is calculated at 0.8 yuan per kilowatt-hour, the energy storage usage cost is set at 0.1 yuan per kilowatt-hour, and the weight coefficient of voltage deviation cost is 100. Under the premise of meeting the power balance constraint, ensure that the diesel generator output does not exceed 200kW, the charging and discharging power of the energy storage system is controlled within 50kW, the SOC is maintained within the safe range of 20% to 90%, and the voltage of each node is maintained between 0.95 and 1.05 per unit.
[0052] The optimization solving process processes the multi-scenario prediction data through a probability-weighted manner to obtain expected photovoltaic output sequences of 46 kW, 57 kW, 67 kW, 72 kW, 62 kW and 52 kW. The optimal control sequence scheme is obtained by solving the multi-objective optimization problem through a mixed integer programming algorithm. Specifically, the output of the diesel generator at the 6 time steps is arranged as 60 kW, 55 kW, 50 kW, 60 kW, 65 kW and 70 kW, the power scheduling of the energy storage system is 14 kW charging, 18 kW charging, 23 kW charging, 18 kW charging, 18 kW charging and 13 kW charging, the corresponding SOC change trajectory is 58%, 55%, 51%, 48%, 45% and 43%, and the voltage level at each time is maintained at 0.99, 1.00, 1.01, 1.00, 0.99 and 0.98 unit values. After cost accounting, the total operation cost of this optimization scheme is 140.2 yuan, including power generation cost of 120 yuan, energy storage use cost of 5.2 yuan and voltage deviation cost of 15 yuan.
[0053] The strategy execution and rolling update mechanism follows the classical idea of model predictive control, and only the first control action in the optimal control sequence is executed, that is, the diesel generator output is set to 60 kW and the energy storage system is charged by 14 kW. The remaining control actions are only reserved as prediction references and are not actually executed. When the time advances to the next time, 10:30, the actual operation data is collected again, and it is found that the energy storage SOC reaches 58.5%, the voltage is 0.995 unit value, the actual load is 125 kW, and the photovoltaic output is 52 kW. Based on these new state information and updated weather forecast data, the future scenario prediction is regenerated, the prediction time domain window is adjusted, and the optimization problem is solved again to obtain a new optimal control sequence.
[0054] The continuous process of closed-loop feedback optimization ensures that the application can continuously adapt to changes in the actual operating environment. Whenever new measurement data and prediction information are available, the rolling optimization module will re-evaluate the current state, update the uncertainty scenario, re-solve the optimization problem, and execute the new optimal control action. This rolling optimization mechanism not only can handle the uncertainty of new energy output and load demand, but also can respond to deviations that occur in actual operation in a timely manner, ensuring the economic and efficient operation of the microgrid in a dynamic environment. Through the combination of intelligent decision support provided by the strategy evolution module and the forward-looking planning capability of the rolling optimization module, adaptive optimization scheduling of complex and variable operating environments is realized.
[0055] S5. According to the real-time risk assessment result, adjust the decision weight of the strategy evolution module and the rolling optimization module, and output the microgrid operation scheduling instruction.
[0056] In the embodiment of the present application, the step of adjusting the decision weight of the strategy evolution module and the rolling optimization module according to the real-time risk assessment result in step S5 includes steps S5.1-S5.3: S5.1, real-time monitoring of risk indicators of the microgrid, including node voltage out-of-limit conditions and new energy prediction errors; Real-time monitoring of risk indicators of the microgrid is continuously performed through a distributed sensor network and a smart meter system. The system mainly monitors node voltage out-of-limit conditions, specifically including real-time voltage amplitude, voltage fluctuation frequency and voltage harmonic content of each distribution node, and real-time voltage data is collected through high-precision voltage transformers installed at key nodes, with a sampling frequency of 1 kHz to ensure capturing voltage transient phenomena. At the same time, the system monitors new energy prediction errors, compares photovoltaic output prediction values with actual measurement values every 15 minutes, calculates relative and absolute errors, and triggers an early warning mechanism when the error exceeds 20%. In addition, the system also real-time monitors key operating parameters such as the degree of deviation of the energy storage SOC from the set operating interval, the load rate of the main transformer, and the system frequency deviation, forming a multi-dimensional risk monitoring system.
[0057] S5.2, calculating a comprehensive risk indicator, and evaluating the current system risk level through a risk quantification formula; The risk quantification formula is expressed as: ; In the formula, is the comprehensive risk indicator at time t, which is used to quantify the risk level of the current system; is the real-time voltage vector of each node at time t, which reflects the current grid voltage state; is the safe voltage threshold vector of each node, which is used as the voltage safety judgment reference; is the safety margin parameter; is the maximum value function; In the embodiment, the current time is collected through the measured voltage value V t =[0.97, 0.92, 0.96, 0.94] per unit, and the corresponding safe voltage threshold vector is set as V threshold =[0.95, 0.95, 0.95, 0.95] per unit. By calculating the two-norm distance between the real-time voltage vector and the safety threshold vector, we get =0.0387. The system sets the safety margin parameter δ=0.01, which reflects the tolerance of the system to small voltage fluctuations. According to the risk quantification formula, the current comprehensive risk indicator is calculated as 0.0287.
[0058] S5.3, dynamically adjusting the decision weight based on the risk indicator, and using an S-shaped function to calculate the weight distribution ratio of the strategy evolution module and the rolling optimization module.
[0059] The weight distribution calculation formula is represented as: ; In the formula, is the dynamic weight distribution coefficient at time t, is an S-shaped function, is a risk sensitivity parameter.
[0060] In the present embodiment, the weight distribution calculation formula is adopted, wherein the risk sensitivity parameter 25 is determined through system debugging and field operation experience, which ensures that the system has appropriate response sensitivity to risk changes. By substituting the current risk index into the S-shaped function calculation, we get ≈0.328. This calculation result shows that the decision weight of the strategy evolution module is 32.8% and the weight of the rolling optimization module is 67.2% under the current risk level. Based on this weight distribution, the system weights and fuses the control instructions suggested by the strategy evolution module (diesel generator 90kW, energy storage discharge 30kW) and the control instructions suggested by the rolling optimization module (diesel generator 105kW, energy storage discharge 20kW), and finally outputs the scheduling instruction as diesel generator output 100kW and energy storage system discharge power 23kW.
[0061] Specifically, the calculation process of the risk quantification formula embodies the integrity of the multi-node voltage safety assessment. The function in the formula ensures the non-negativity of the risk index, which is zero when the overall voltage is within the safe range and has no impact on weight distribution. The setting of the safety margin parameter considers the voltage measurement accuracy and the actual needs of system operation. A too small δ value will make the system too sensitive, and a too large δ value may ignore potential safety hazards.
[0062] Specifically, the mathematical properties of the S-shaped function ensure the continuity and monotonicity of the weight distribution. When the risk index tends to zero, the dynamic weight distribution coefficient tends to 0.5, indicating that the weights of the two modules are equal. When the risk index increases, the dynamic weight distribution coefficient gradually decreases, and the weight of the rolling optimization module increases, tending to conservative control. When the risk index is small, the dynamic weight distribution coefficient increases, and the weight of the strategy evolution module increases, tending to intelligent optimization. The value of the risk sensitivity parameter directly affects the steepness of the weight switching. A larger value makes the weight change more sensitive, and a smaller value makes the weight change more gradual.
[0063] In addition, it also needs to know that, Figure 3This paper presents a comparison of the proposed microgrid operation method based on dynamic reinforcement learning (the method described in this paper) with other comparative algorithms (fixed rule expert systems, static partitioning strategy systems, and traditional dynamic reinforcement learning (DEL)) in terms of policy response time. Experimental results show that the proposed method has a significant advantage in policy response time, can adapt to the dynamic changes of the microgrid more quickly, and provides strong support for the stable operation of the system.
[0064] Figure 4 The proposed method was compared with that of fixed-rule expert systems, static partitioning strategy systems, and traditional dynamic reinforcement learning (DEL) in terms of economic losses. Experimental results show that the proposed method outperforms the proposed method in terms of economic losses, effectively reducing the operating costs of microgrids and improving the economic efficiency of the system.
[0065] Figure 5 This paper compares the proposed method with fixed-rule expert systems, static partitioning strategy systems, and traditional dynamic reinforcement learning (DEL) in terms of control success rate. Experimental results show that the proposed method has a significant advantage in control success rate, can more effectively achieve stable operation of microgrids, reduce the probability of fault occurrence, and provide strong support for the reliable operation of the system.
[0066] Figure 6 The proposed method was compared with fixed-rule expert systems, static partitioning strategy systems, and traditional dynamic reinforcement learning (DEL) in terms of operational robustness. Experimental results show that the proposed method performs excellently in terms of operational robustness, and can better cope with uncertainties such as fluctuations in renewable energy output and changes in load demand, ensuring the stable operation of microgrids under complex operating conditions.
[0067] Example 2 is the second embodiment of the present invention, which differs from the previous embodiment in that: If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0068] The logic and / or steps represented in flow diagrams or otherwise described herein, for example, can be considered as a sequence of executable instructions, and can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For purposes of this specification, a "computer-readable medium" can be any apparatus that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. The computer-readable medium can be, for example but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable medium include the following: an electrical connection (electronic) having one or more wires, a portable computer diskette (magnetic), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber (optical), and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium can even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, for example via an optical scanner, then compiled, interpreted, or otherwise processed, and stored in a computer memory in a form that can be later executed by a computer. In this context, a "computer-readable medium" can be any means that can store the program for use by or in connection with the instruction execution system, apparatus, or device.
[0069] More specific examples (a non-exhaustive list) of the computer-readable medium include the following: an electrical connection (electronic) having one or more wires, a portable computer diskette (magnetic), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber (optical), and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium can even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, for example via an optical scanner, then compiled, interpreted, or otherwise processed, and stored in a computer memory in a form that can be later executed by a computer.
[0070] It should be understood that aspects of the application can be implemented in hardware, software, firmware or combinations thereof. In the above embodiments, the various steps or methods can be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, and in another embodiment, any of the following technologies known in the art, or their combinations, can be used: discrete logic circuitry having logic gates for implementing logic functions on data signals, application specific integrated circuits having appropriate combinational logic gates, programmable gate arrays (PGA), field programmable gate arrays (FPGA), etc.
[0071] Embodiment 3, as a third embodiment of the present application, provides a system for adaptive micro-grid operation optimization, comprising a state perception module, a strategy evolution module, a new energy uncertainty model, a rolling optimization module, and a decision fusion module; The state perception module is configured to obtain micro-grid operation state data, and generate a unified state representation through deep feature coding and space-time attention processing; The strategy evolution module is configured to perform online strategy learning and optimization based on the unified state representation, and output a strategy optimization result by fusing economic and safety targets; A new energy uncertainty model is configured to generate multi-scenario new energy output prediction data according to meteorological feature data by using a conditional variational encoder; A rolling optimization module is configured to combine the prediction data and the strategy optimization result, and solve a prediction control problem by setting a prediction time domain and a rolling time window. A decision fusion module is configured to dynamically adjust decision weights of the strategy evolution module and the rolling optimization module according to the risk assessment result, and output a micro-grid operation scheduling instruction.
[0072] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present application but not limit the present application. Although the present application has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present application can be modified or replaced equivalently without departing from the spirit and scope of the present application, and all should be covered in the scope of the claims of the present application.
Claims
1. An adaptive microgrid operation optimization method, characterized in that: include, Acquire microgrid operating status data; The microgrid operating status data is processed by a state awareness module through deep feature encoding and spatiotemporal attention processing to generate a unified state representation. Based on the unified state representation, online policy learning and optimization are performed through the policy evolution module, and the policy optimization results are output. A new energy uncertainty model is used to generate multi-scenario prediction data. The prediction data is combined with the optimization results of the strategy, and the prediction control problem is solved through a rolling optimization module. Based on the real-time risk assessment results, the decision weights of the strategy evolution module and the rolling optimization module are adjusted, and microgrid operation scheduling instructions are output.
2. The adaptive microgrid operation optimization method as described in claim 1, characterized in that: The state awareness module first performs feature aggregation on distributed power sources and load nodes through spatial attention, which can be expressed mathematically as follows: ; ; Then, temporal dependence is captured on the spatial aggregation features using temporal attention, which can be expressed mathematically as follows: ; In the formula, , , These are the query matrix, key matrix, and value matrix, respectively. Let i be the set of neighbors of node i. Spatial attention weights, For the spatial aggregation features of node i, For time attention weights, This is the final state code at time t, where T is the length of the historical time window.
3. The adaptive microgrid operation optimization method as described in claim 2, characterized in that: The strategy evolution module defines a reward function that integrates economic efficiency and security, expressed by the formula: ; The near-end policy optimization algorithm implements policy updates, specifically as follows: ; In the formula, For the reward function, For the cost of electricity generation, For node voltage, These are the weighting coefficients. and These are the parameters for the new policy function and the parameters for the old policy function, respectively. For learning rate, and For the new policy function and the old policy function, For the dominant function, For the gradient operator with respect to parameter θ, For the mathematical expectation of state s and action a, To find the minimum value function, Let ϵ be the clipping function and ϵ be the clipping parameter.
4. The adaptive microgrid operation optimization method as described in claim 3, characterized in that: The rolling optimization module includes the following steps. Define the prediction time domain and establish a rolling time window from the current moment to several future moments; Construct an objective function that comprehensively considers power generation costs, energy storage costs, and voltage deviation costs, and set constraints including power balance constraints and equipment operation constraints. Based on the current system state and prediction data, an optimization problem is solved to obtain the optimal control sequence in the future prediction time domain; Execute the first control action in the optimal control sequence, and use the remaining control actions as prediction references; As time moves forward one step, the optimization and solution process is repeated.
5. The adaptive microgrid operation optimization method as described in claim 4, characterized in that: The steps for adjusting the decision weights of the strategy evolution module and the rolling optimization module include: Real-time monitoring of microgrid risk indicators, including node voltage exceedances and new energy prediction errors; Calculate the comprehensive risk index and assess the current system risk level using risk quantification formulas; The decision weights are dynamically adjusted based on risk indicators, and the weight allocation ratio between the strategy evolution module and the rolling optimization module is calculated using an S-shaped function. The risk quantification formula is expressed as follows: ; In the formula, It is a comprehensive risk indicator at time t, used to quantify the current risk level of the system; It is the real-time voltage vector of each node at time t, reflecting the current voltage state of the power grid; It is the safe voltage threshold vector of each node, which serves as the benchmark for voltage safety judgment; It is a safety margin parameter; It is a function that takes the maximum value; The weight allocation calculation formula is expressed as follows: ; In the formula, These are the dynamic weight allocation coefficients at time t. It is a sigmoid function. It is a risk-sensitive parameter.
6. The adaptive microgrid operation optimization method as described in claim 5, characterized in that: The steps for constructing the new energy uncertainty model include: Collect meteorological characteristic data as input for meteorological conditions; The meteorological features are mapped to a probability distribution space using a conditional variational encoder, generating the mean of the latent variables. and variance parameter ; Latent variables are obtained by sampling from the probability distribution space. The decoder is used to generate multi-scenario renewable energy output samples based on latent variables and meteorological conditions. ; The generated multi-scenario samples are provided to the rolling optimization module to establish robust constraints that take into account uncertainties. Where Z is a latent variable. To conform to a normal distribution, The average value of the encoder output. The variance parameter of the encoder output. For encoder network parameters, This is a sample of the generated new energy power output scenarios. For decoder functions, Let be the meteorological feature vector at time t.
7. The adaptive microgrid operation optimization method as described in claim 3, characterized in that: The strategy evolution module also includes adversarial training steps, specifically including: During policy training, adversarial perturbation samples are generated using a fast gradient sign method. Calculate the direction of the disturbance; Construct an adversarial training objective function and add a policy consistency constraint term to the proximal policy optimization algorithm. ; A flat minimization optimization strategy is adopted, and the generalization ability of the strategy to unknown perturbations is improved through a two-step optimization process. in, To counteract the disturbance vector, For the disturbance intensity, For symbolic functions, The gradient of the loss function with respect to the state. To counteract the loss function, Algorithm optimization for near-end strategy To counter the weight, Let KL divergence be denoted as KL divergence.
8. A system for adaptive microgrid operation optimization, employing an adaptive microgrid operation optimization method as described in any one of claims 1 to 7, characterized in that, It includes a state awareness module, a strategy evolution module, a new energy uncertainty model, a rolling optimization module, and a decision fusion module; The state perception module is used to acquire microgrid operating state data and generate a unified state representation through deep feature encoding and spatiotemporal attention processing; The strategy evolution module is used to perform online strategy learning and optimization based on the unified state representation, and output the strategy optimization result by integrating economic and security objectives; The new energy uncertainty model is used to generate multi-scenario new energy output prediction data based on meteorological characteristic data using a conditional variational encoder. The rolling optimization module is used to combine the prediction data and the strategy optimization results, and solve the prediction control problem by setting the prediction time domain and the rolling time window; The decision fusion module is used to dynamically adjust the decision weights of the strategy evolution module and the rolling optimization module based on the risk assessment results, and output microgrid operation scheduling instructions.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the adaptive microgrid operation optimization method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the adaptive microgrid operation optimization method according to any one of claims 1 to 7.
Citation Information
Cited By
Prediction and decision-making integrated resource scheduling method and system for electricity-hydrogen-heat integrated energy system
CN122026525A