Anti-countercurrent control method, device and equipment of micro-grid and medium

By acquiring power prediction information in the microgrid and combining it with patented technologies, the lag and fluctuation response problems in the anti-reverse flow control of the microgrid are solved through rolling optimization and model predictive control methods. This achieves smooth equipment regulation and economical operation, and improves the system's flexibility and equipment lifespan.

CN121863569APending Publication Date: 2026-04-14CHONGQING XINSHIJIE ELECTRICAL
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-22
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

Existing microgrid anti-reverse flow control technologies suffer from problems such as lag, insufficient ability to cope with intermittent fluctuations, contradiction between economic optimization and safety constraints, and coarse control commands, making it difficult to accurately prevent power reverse flow and maximize the output of distributed energy resources.

Method used

By acquiring power forecast information on renewable energy and load demand within the microgrid, and combining rolling optimization and model predictive control, reference power plans and target adjustment instructions for each controllable device in the future are generated. Dynamic safety margins are used for real-time adjustments to achieve smooth device regulation.

Benefits of technology

It achieves smooth adjustment within tens of seconds to several minutes before a backflow occurs, eliminates backflow events, improves the system's economic operation level and flexibility in responding to renewable energy fluctuations, and extends equipment life.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121863569A_ABST
    Figure CN121863569A_ABST
Patent Text Reader

Abstract

The invention discloses an anti-countercurrent control method, device and equipment for a micro-grid and a medium, and relates to the technical field of micro-grid operation control and energy management. The method comprises the following steps: acquiring power prediction information of output and load demand of renewable energy sources in a micro-grid; executing rolling optimization in a first preset period, and generating a reference power plan of each controllable device in a future time period; executing model prediction control in a second preset period shorter than the first preset period, generating a target adjustment instruction for each controllable device at the current moment, and adjusting the operation state of the controllable device; in the solving process of model prediction control, a reference power plan is used as a tracking target, the condition that the power of a common connection point is larger than the dynamic safety margin is used as a constraint condition, and the dynamic safety margin is adjusted in real time according to the uncertainty of power prediction information. Through the technical scheme of the invention, power countercurrent can be accurately prevented, and maximization and economic operation of distributed energy output in the micro-grid can be realized at the same time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of microgrid operation control and energy management technology, and in particular to a method, device, equipment and medium for preventing backflow control in microgrids. Background Technology

[0002] In grid-connected microgrids, preventing power generation exceeding local load and causing reverse power flow into the upstream grid (reverse flow) is a critical requirement. Currently, anti-reverse flow control mainly relies on real-time monitoring of the instantaneous power at the point of common coupling (PCC) and feedback adjustment. Current technical solutions suffer from the following long-standing unresolved technical challenges: 1. The lag in "post-event remediation": Traditional control based on real-time power feedback is a form of "post-event adjustment." Limiting measures are only initiated when reverse current is detected or power approaches zero, resulting in an inherent control delay. During this period, reverse current may have already occurred or caused drastic power fluctuations.

[0003] 2. Insufficient ability to cope with intermittent fluctuations: The power generation of photovoltaic, wind turbines and other power sources is intermittent and random. Relying solely on feedback information at the current moment makes it impossible to predict power changes several seconds to minutes later (such as a sharp drop in power caused by cloud movement), making it difficult to make forward-looking decisions before fluctuations occur, which can easily lead to control overshoot or undershoot.

[0004] 3. The contradiction between economic optimization and safety constraints: Some schemes, in order to absolutely avoid backflow, adopt overly conservative power generation plans, drastically reducing renewable energy output in advance and sacrificing economic efficiency. On the other hand, another type of scheme pursues economic optimization, but has a long rolling optimization cycle (e.g., 15 minutes), which cannot cope with short-term power surges and has a high risk of backflow.

[0005] 4. Coarse control commands: Most methods provide step-like or fixed-proportion adjustment commands that fail to adapt to future power change trends, resulting in an uneven adjustment process that affects equipment lifespan and power quality. Summary of the Invention

[0006] In view of this, the purpose of this invention is to provide a method, device, equipment, and medium for preventing backflow in microgrids, which can accurately prevent power backflow while maximizing the output of distributed energy sources within the microgrid and achieving economical operation. The specific solution is as follows: In a first aspect, this application discloses a method for preventing reverse current flow in a microgrid, comprising: Obtain power forecasting information on the output and load demand of renewable energy sources within a microgrid; Based on the power prediction information, rolling optimization is performed at a first preset period to generate a reference power plan for each controllable device in the microgrid in the future time period. Based on the reference power plan, model predictive control is executed at a second preset period shorter than the first preset period to generate target adjustment instructions for each of the controllable devices at the current moment; wherein, in the process of solving the model predictive control, the reference power plan is used as the tracking target, and the constraint condition is that the power of the common connection point is greater than the dynamic safety margin; the dynamic safety margin is adjusted in real time according to the uncertainty of the power prediction information. Based on the target adjustment command, the operating state of the controllable device is adjusted.

[0007] Optionally, obtaining power forecast information on the output and load demand of renewable energy sources within the microgrid includes: Obtain photovoltaic power forecast curves and load forecast curves based on weather data within the microgrid.

[0008] Optionally, the step of performing rolling optimization based on the power prediction information at a first preset period to generate a reference power plan for each controllable device in the microgrid in a future time period includes: Based on the power prediction information, with the goal of minimizing the total operating cost of the microgrid in the next minute-level period and with the constraint that the power of the point of common coupling is non-negative, a reference power plan for each controllable device in the microgrid is generated in the future period; wherein, the total operating cost includes at least one of the following: electricity purchase cost, curtailment penalty cost, and energy storage loss cost.

[0009] Optionally, the step of performing model predictive control based on the reference power plan for a second preset period shorter than the first preset period to generate target adjustment instructions for each of the controllable devices at the current moment includes: Establish a system prediction model that includes the state of the energy storage system and the power state of the common connection point; Based on the system prediction model, within each second-level cycle, the reference power plan within multiple future control steps is used as the tracking target, and the power of the common connection point of each future control step is greater than the dynamic safety margin at the corresponding time is used as the constraint condition to generate the target adjustment command for each controllable device at the current time.

[0010] Optionally, the process of determining the dynamic safety margin includes: The historical prediction error between the power prediction information and the actual measurement value within a preset time period is statistically analyzed in real time, and the statistical characteristics of the probability distribution of the historical prediction error are estimated through statistical analysis. Based on the statistical characteristics, the dynamic safety margin of the constraints used for predictive control of the model within the future prediction step size, which varies over time, is determined using the dynamic safety margin calculation formula; wherein, the larger the statistical characteristics, the larger the dynamic safety margin.

[0011] Optionally, the dynamic safety margin calculation formula is as follows: ; in, For the dynamic safety margin of the k-th prediction step, The preset confidence level coefficient, Let be the standard deviation of the historical prediction error at time t.

[0012] Optionally, adjusting the operating state of the controllable device based on the target adjustment command includes: According to the preset adjustment priority, the target adjustment command is converted into a smoothly changing power setpoint and sent to the device controller of the controllable device; wherein, the adjustment priority is to adjust the energy storage system first, then the photovoltaic system, and finally the adjustable load.

[0013] Secondly, this application discloses a reverse current prevention control device for a microgrid, comprising: The forecast information acquisition module is used to acquire power forecast information on the output and load demand of renewable energy sources within the microgrid; The rolling optimization module is used to perform rolling optimization at a first preset period based on the power prediction information to generate a reference power plan for each controllable device in the microgrid in a future time period. The model predictive control tracking module is used to execute model predictive control based on the reference power plan at a second preset period shorter than the first preset period, and generate target adjustment instructions for each of the controllable devices at the current moment; wherein, in the process of solving the model predictive control, the reference power plan is used as the tracking target, and the constraint condition is that the power of the common connection point is greater than the dynamic safety margin; the dynamic safety margin is adjusted in real time according to the uncertainty of the power prediction information. The instruction execution module is used to adjust the operating state of the controllable device based on the target adjustment instruction.

[0014] Thirdly, this application discloses an electronic device, which includes a processor and a memory; wherein the memory is used to store a computer program, which is loaded and executed by the processor to implement the anti-reverse current control method for microgrids as described above.

[0015] Fourthly, this application discloses a computer-readable storage medium for storing a computer program; wherein the computer program, when executed by a processor, implements the anti-reverse current control method for a microgrid as described above.

[0016] The beneficial effects of this application are as follows: First, the longer-cycle rolling optimization, based on predictive information, formulates an economically optimized reference plan for controllable equipment, ensuring overall economic efficiency. Meanwhile, the shorter-cycle model predictive control tracks and executes this plan at a faster pace, proactively constraining point-of-combination power using dynamic safety margins. This two-layer collaboration achieves a shift from "passive response" to "proactive planning and prevention," initiating smooth adjustment tens of seconds to minutes before reverse current occurs, completely eliminating reverse current events. Second, the dynamic safety margin adjusts in real time based on predictive uncertainty, adaptively responding to prediction errors and renewable energy fluctuations, making the system control strategy more intelligent and flexible. Finally, the second-level optimization based on model predictive control generates smooth and continuous optimized adjustment commands for the same group of controllable equipment, avoiding power surges and extending the lifespan of photovoltaic inverters, energy storage batteries, and other equipment.

[0017] Furthermore, the anti-backflow control device, equipment, and storage medium for a microgrid provided in this application correspond to the aforementioned anti-backflow control method for a microgrid and have the same effect. Attached Figure Description

[0018] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0019] Figure 1 This is a flowchart of a microgrid anti-reverse current control method disclosed in this application; Figure 2 This application discloses a general diagram of a microgrid system structure and a predictive anti-reverse control architecture. Figure 3 This is a schematic diagram illustrating the working principle of a second-level model predictive control tracking disclosed in this application. Figure 4 This is a schematic diagram of a dynamic power safety margin variation curve disclosed in this application; Figure 5 This is a flowchart of a multi-timescale rolling optimization control disclosed in this application; Figure 6 This is a simulation comparison timing diagram of a traditional feedback control method disclosed in this application; Figure 7This is a schematic diagram of the anti-reverse current control device for a microgrid disclosed in this application; Figure 8 This is a structural diagram of an electronic device disclosed in this application. Detailed Implementation

[0020] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0021] Currently, backflow prevention control based on real-time feedback is lagging behind, unable to cope with fluctuations in renewable energy, presents a contradiction between security and economy, and results in unsmooth control commands.

[0022] Therefore, this application provides a reverse current prevention control scheme for microgrids, which can achieve forward-looking and precise reverse current prevention, improve economic operation and adaptability, and ensure smooth control and system robustness.

[0023] This invention discloses a method for preventing reverse current flow in a microgrid, see [link to relevant documentation]. Figure 1 As shown, the method includes: Step S11: Obtain power forecast information on the output of renewable energy and load demand within the microgrid.

[0024] In this step, acquiring power prediction information is the decision-making basis and logical starting point for the entire predictive anti-reverse flow control method. Its purpose is to provide forward-looking data input for subsequent optimization and control, thereby transforming the system operation mode from the traditional "passive response" to "active prevention".

[0025] Specifically, this step uses the data acquisition and monitoring module of the microgrid energy management system (EMS) to acquire two key types of ultra-short-term power forecast information in real time: (1) Output forecast of renewable energy: mainly for photovoltaic power generation systems. This forecast information is usually generated by a dedicated power forecasting module (such as...). Figure 2 As shown in the image, this module integrates real-time weather data, historical power generation data, and machine learning models to generate a rolling output of photovoltaic power prediction curves with high time resolution (such as second-level or minute-level) for the next few minutes to hours. For example, for a 1MW photovoltaic system in an industrial park, the prediction module can provide power prediction values ​​for the next 15 minutes, one point every 5 seconds.

[0026] (2) Load demand forecasting: This is for the local electricity load within the microgrid. Load forecasting can be based on historical electricity consumption patterns, workday types, and real-time load change trends to generate future load forecast curves that match the time scale.

[0027] These forecasts represent the system's prediction of power balance trends over a future period. Once these forecasts are obtained, they can be preprocessed and cached as necessary so that subsequent steps can make decisions based on the latest and most reliable forecasts.

[0028] Step S12: Based on the power prediction information, perform rolling optimization at a first preset period to generate a reference power plan for each controllable device in the microgrid in the future time period.

[0029] Understandably, the current technical challenge lies in the fact that long-cycle optimization, while comprehensively considering factors such as electricity prices, photovoltaic forecasts, and energy storage losses to calculate the most cost-effective operating scheme, is economically efficient but has a slow response time. If cloud cover or a sudden drop in photovoltaic power occurs, recalculation and adjustment are necessary, and reverse current may have already occurred. Short-cycle control, on the other hand, offers a fast response, promptly addressing power fluctuations and preventing reverse current, but it is less economical and may waste photovoltaic power in the process of preventing reverse current. Therefore, a single forecasting and control cycle cannot simultaneously achieve both the accuracy of reverse current prevention and the economical operation of the system.

[0030] The core of this step lies in performing a rolling optimization calculation based on the latest ultra-short-term power prediction information obtained in step S11, using a relatively long time period, namely the first preset period. Rolling optimization is a dynamic optimization technique for decision-making in a predictive environment. Its core idea is: "At each decision point, solve a complete plan covering a relatively long future time period, but only execute the initial part of the plan, and then the window rolls forward as time progresses." In this embodiment, the aim is to generate an economically optimal reference power plan for each controllable device in the microgrid over a future period. This step is the key decision-making layer for achieving "global economy" and "forward-looking" control in this invention.

[0031] In a preferred embodiment, the first preset period is set to the minute level, for example, T. r =5 minutes. The system operates every T. r Each period triggers one optimization step. This periodic "rolling" execution means that at each optimization moment, the system uses the latest prediction data and system state up to that moment to recalculate the future T. rThe optimization problem occurs within a time window, but only the plan executed from the current moment is output. At the next optimization moment, the time window rolls forward, and optimization is performed again based on updated information, repeating this cycle. This rolling mechanism continuously corrects plan deviations caused by prediction errors and system disturbances.

[0032] The minute-level rolling optimization implemented in this step is constructed in the form of a mathematical programming problem, with its main input being power prediction information derived from the future T from step S11. r Power and load forecast curves for renewable energy sources such as photovoltaics during the time period, as well as electricity price information, such as real-time electricity purchase price from the upper-level grid and energy storage charging and discharging loss costs.

[0033] Specifically, the optimization objective is designed to minimize the total operating cost of the microgrid over the future Tr period. This total operating cost includes at least one of the following: the cost of purchasing electricity from the upper-level grid, the cost of renewable energy curtailment penalties due to generation restrictions, and the cost of losses from energy storage recycling. By minimizing this objective, the system automatically seeks the most economical operating mode. Furthermore, the non-negative power at the point of common coupling (PCC) (i.e., P...) pcc With ≥0 as the core constraint, after solving the above optimization problem in a rolling manner, the future T is output. r Reference power plan P for each controllable device (energy storage, adjustable load) within minutes. ref (t). The plan clarifies the future of T. r Within a given time period, a sequence of recommended power setpoints for each controllable device, including the energy storage system and adjustable loads. This plan ensures overall economic efficiency. This reference power plan is then passed to step S13, where second-level model predictive control (MPC) uses this plan as one of its tracking targets, while combining more accurate short-term forecasts and dynamic safety margin constraints to generate the final executable and smooth real-time control commands.

[0034] Step S13: Based on the reference power plan, perform model predictive control for a second preset period shorter than the first preset period to generate target adjustment instructions for each of the controllable devices at the current moment; wherein, in the process of solving the model predictive control, the reference power plan is used as the tracking target, and the constraint condition is that the power of the common connection point is greater than the dynamic safety margin; the dynamic safety margin is adjusted in real time according to the uncertainty of the power prediction information.

[0035] This step achieves proactive and precise interception of backflow risks. This step is executed frequently with an extremely short second preset cycle, and is essentially a model predictive control (MPC) process with embedded dynamic safety margin constraints. Its purpose is to transform the reference power plan generated in step S12 into smooth control commands capable of responding to second-level fluctuations in real time and absolutely guaranteeing backflow prevention safety.

[0036] In a preferred embodiment, the second preset period is set to the second level. In specific implementation, firstly, a system prediction model including the energy storage system state and the power state of the point of common coupling (PCC) is established with a control period of the second level (e.g., 1-5 seconds). Subsequently, the controller initiates a rolling optimization calculation. The decision variable for this optimization is a series of consecutive control command sequences in the future time domain. Specifically, based on the system prediction model, within each second-level period, the reference power plan for multiple future control steps is used as the tracking target, and the constraint that the power of the PCC in each future control step is greater than the dynamic safety margin at the corresponding time is used as the constraint condition, generating the target adjustment command for each controllable device at the current time.

[0037] The dual objectives of optimization are: in each control cycle, using the recent (e.g., 1 minute below) reference power plan generated in step S12 as the tracking target, to make the system's predicted power trajectory as close as possible to the recent reference power plan, ensuring global economic optimization; and simultaneously using the power P at point PCC in the next few seconds as the tracking target. pcc A hard constraint, strictly greater than a dynamic safety margin δ, ensures that at every future time t+k throughout the entire prediction time domain, the predicted common connection power P... pcc (t+k) are all strictly greater than a dynamic safety margin δ(t+k), that is, they satisfy constraint P. pcc (t+k)>δ(t+k).

[0038] Understandably, setting a fixed power safety margin (dead zone) is too rigid: a large margin leads to economic losses, while a small margin makes it impossible to avoid backflow when prediction deviations are large. The dynamic safety margin in this embodiment is not a fixed value, but a variable that is calculated in real-time based on the uncertainty of power prediction information and increases with the time step k. The calculation principle is: the greater the prediction uncertainty, the larger the dynamic safety margin.

[0039] In one feasible implementation, the process of online assessment of prediction uncertainty includes: real-time statistical analysis of the historical prediction error e(t) between the power prediction information and the actual measured value within a preset time period (e.g., 15 minutes), and estimating the statistical characteristics (e.g., mean and variance σ) of the probability distribution of the historical prediction error through statistical analysis. 2 Based on the statistical characteristics, the dynamic safety margin of the constraints used for model predictive control within the future prediction step size, which varies with time, is determined using the dynamic safety margin calculation formula.

[0040] Wherein, the dynamic safety margin δ(t+k)=f(σ,k) is an increasing function of the current prediction uncertainty σ and the prediction step size k. In a feasible implementation, the dynamic safety margin is calculated as follows: ;in, For the dynamic safety margin of the k-th prediction step, The preset confidence level coefficient, Let be the standard deviation of the historical prediction error at time t.

[0041] This dynamic constraint δ(t+k) is integrated into the second-level MPC optimization model. When the prediction uncertainty σ increases (such as a sudden change in weather), δ(t+k) automatically increases, and MPC will more "conservatively" reserve more positive power buffer in advance; when the prediction is very accurate (σ is small), δ(t+k) automatically decreases, and MPC can operate more "aggressively" closer to the zero-power line, improving economy. Thus, this design allows the optimization problem to adaptively balance safety and economy: reserving more power buffer in advance when the risk is high, and allowing the system to operate more economically when the risk is low.

[0042] By solving the constrained optimization problem described above, a theoretically optimal sequence of future control commands can be obtained. According to the "rolling time" principle of model predictive control, the controller will not execute the entire sequence of future commands at once. Instead, it will only use the first optimal control command u corresponding to the current time t in the sequence. (t), and immediately output it as the target adjustment command to each actuator (energy storage PCS, photovoltaic inverter).

[0043] As can be seen, this step not only achieves smooth and close tracking of minute-level economic plans, but more importantly, it utilizes a forecast window of several seconds to tens of seconds into the future. This transforms the backflow prevention constraint from a passive requirement of "the current moment must be greater than 0" to an active and forward-looking defense of "the future period must be continuously greater than the dynamic safety boundary." This fundamentally avoids the instantaneous backflow that may occur in traditional feedback control due to detection and execution delays, achieving an adaptive balance between safety and economy. It maximizes benefits when the forecast is reliable and automatically strengthens defenses when the forecast is uncertain, fundamentally improving the robustness and overall economy of the control system in the face of intermittent fluctuations.

[0044] Step S14: Adjust the operating state of the controllable device based on the target adjustment command.

[0045] In this step, u The (t) command, following the priority and economic principle of "adjusting energy storage first, then photovoltaic, and finally calling flexible loads," is transformed into specific, smoothly changing power setpoints and sent to the corresponding equipment controllers.

[0046] Specifically, according to the preset adjustment priority, the target adjustment command is converted into a smoothly changing power setpoint and sent to the device controller of the controllable device; wherein, the adjustment priority is to adjust the energy storage system first, then the photovoltaic system, and finally the adjustable load.

[0047] As can be seen, the above steps construct a three-layer collaborative control architecture of "prediction-rolling optimization-flexible allocation." Through "multi-timescale rolling optimization decision-making" and "dynamic adjustment of power margin based on prediction confidence," the microgrid can anticipate power imbalance trends and smoothly and economically adjust internal resources, maximizing clean energy consumption while strictly ensuring no backflow at the PCC point. This achieves the ultimate goals of proactive prevention, zero backflow, smooth transition, and optimal efficiency.

[0048] The beneficial effects of this application are as follows: First, the longer-cycle rolling optimization, based on predictive information, formulates an economically optimized reference plan for controllable equipment, ensuring overall economic efficiency. Meanwhile, the shorter-cycle model predictive control tracks and executes this plan at a faster pace, proactively constraining point-of-combination power using dynamic safety margins. This two-layer collaboration achieves a shift from "passive response" to "proactive planning and prevention," initiating smooth adjustment tens of seconds to minutes before reverse current occurs, completely eliminating reverse current events. Second, the dynamic safety margin adjusts in real time based on predictive uncertainty, adaptively responding to prediction errors and renewable energy fluctuations, making the system control strategy more intelligent and flexible. Finally, the second-level optimization based on model predictive control generates smooth and continuous optimized adjustment commands for the same group of controllable equipment, avoiding power surges and extending the lifespan of photovoltaic inverters, energy storage batteries, and other equipment.

[0049] like Figure 2 The diagram illustrates a microgrid system architecture and a predictive anti-reverse control architecture. The system generates flexible control commands by real-time monitoring of the power at the PCC point, combined with ultra-short-term power prediction and rolling optimization, achieving zero reverse current and highly economical operation. The microgrid system architecture and predictive anti-reverse control architecture of this invention include the following key components: 1. System Structure: Upstream distribution network and grid connection point circuit breakers, point of common coupling (PCC), and power measurement point P. pcc The internal equipment of a microgrid includes: a photovoltaic system (with photovoltaic inverter INV), an energy storage system (with bidirectional converter PCS), and local loads; 2. Control Architecture: Five Core Modules of the Predictive Anti-Backflow Control System: Data acquisition and monitoring: Real-time acquisition of power data for PCC points and each device; Power prediction module: Receives weather data and performs ultra-short-term power prediction; Rolling optimization module: performs minute-level optimization and second-level model predictive control (MPC); Dynamic margin calculation: Calculate the dynamic safety margin based on the predicted uncertainty; Instruction allocation and execution: Convert optimization results into device instructions.

[0050] 3. Information flow and control flow: Data flow (dashed line): Data transmission from the measurement point to the control system; Control commands (solid line): Control signals from the control system to each actuator; Inter-module communication: Data exchange between various control modules.

[0051] The architecture is clear and can be seamlessly integrated with existing microgrid energy management systems (EMS), and the algorithms can be implemented based on standard industrial computing platforms.

[0052] like Figure 3 The diagram illustrates the working principle of second-level Model Predictive Control (MPC) tracking and dynamic margin management. First, the horizontal axis represents time, starting from the current moment, showing the rolling process of predicting and covering the next Np control cycles over time within the control time domain Nc. In each control cycle (current moment t), the MPC controller receives three key inputs: a reference power plan (P generated from minute-level optimization)... ref (t)), real-time measurement data (such as power at point of common coupling P) pcc Photovoltaic power P pv Energy storage capacity P batt System state x(t) and ultra-short-term forecasts (such as illumination / load ΔP) pred (t+k)). Simultaneously, the dynamic margin calculation module will assess the uncertainty of the current prediction online based on historical prediction errors (e.g., calculating the error variance σ). 2 (t)), and according to the formula Calculate the dynamic power safety margin corresponding to each prediction step size k in the future. This formula ensures that the margin increases with the increase of prediction error. The controller's built-in system prediction model (described by the state equation x(t+1)=f(x,u)) uses the current state x(t) and the control command u(t) to be determined to predict the system state (P) for the next Np control cycles (prediction time domain). pcc A rolling forecast is performed. Based on this forecast, the controller solves a rolling optimization problem online in each cycle. The optimization objective J(u) of this problem is usually designed as a quadratic form, aiming to minimize two costs (min J(u)): tracking the power reference plan so that the predicted state x(t+k) is as close as possible to the reference plan. To ensure economic efficiency, the range of change in control command u(t+k) should be minimized to guarantee control smoothness. The key to this optimization lies in integrating the dynamic safety margin as a hard constraint into the optimization problem. The constraint explicitly requires that at every future time t+k in the prediction time domain, the predicted power of the common connection point must satisfy P. pcc (t+k)>δ(t+k). This constraint is related to the physical limits of the equipment (such as u). min ≤u≤u max These conditions together constitute the boundary conditions for the solution. The controller invokes an efficient mathematical solver (such as a quadratic programming QP solver) to solve for the optimal control sequence u for the next Nc control cycles (control time domain), provided that all the above constraints are satisfied. (t;t+Nc-1). This sequence specifically contains optimized power commands allocated to the power storage converter (PCS), photovoltaic inverter, and adjustable load. According to the rolling time-domain principle of MPC, the system executes only the first set of commands u in this optimal sequence. (t) and sends it to the corresponding actuators (energy storage PCS, photovoltaic inverters, etc.). When the system executes the command and enters the next control cycle (t+1), new real-time measurement data is collected and fed back to the MPC controller. This new data is used to correct the initial state of the prediction model, and combined with updated prediction and margin information, a new round of "prediction-optimization-execution" cycle is restarted. This closed-loop feedback mechanism enables the MPC to continuously overcome model mismatch and unknown disturbances, achieving true adaptive and forward-looking anti-reverse flow control. As shown in the figure, the entire process is interconnected, seamlessly integrating long-cycle economic planning, short-cycle power prediction, dynamic safety assessment, and millisecond-level optimization execution, ultimately achieving accurate, smooth, and economical forward-looking suppression of reverse flow risks in complex and volatile environments.

[0053] Furthermore, Figure 4 This diagram illustrates the dynamic power safety margin δ(t) as a function of prediction uncertainty σ. The graph is a two-dimensional curve, with the horizontal axis representing prediction uncertainty σ (calculated based on historical prediction error variance and divided into low, medium, and high intervals), and the vertical axis representing the dynamic power safety margin δ(t). The core idea is to dynamically adjust the safety margin based on prediction uncertainty, achieving an adaptive balance between safety and economy. The curve exhibits a convex function characteristic: smaller σ (more accurate prediction, such as on a clear day), smaller δ (economic priority zone), allowing photovoltaic power to operate close to the zero-power line at full capacity; medium σ (some prediction error, such as cloudy weather), medium δ (balance zone), balancing safety and economy; larger σ (larger prediction error, such as rapid cloud cover), larger δ (safety priority zone), reserving more positive buffer in advance. Compared to a fixed margin, the dynamic margin can improve renewable energy utilization by 5-15% while ensuring zero backflow.

[0054] like Figure 5 As shown, the complete hierarchical collaborative control architecture of the predictive anti-reverse flow flexible control proposed in this invention is clearly demonstrated. This architecture decomposes the control task into optimization layers at different time dimensions by decreasing time scale and increasing control precision, achieving a perfect balance between long-term economic efficiency and instantaneous safety. As shown, the entire control system has a vertically hierarchical structure. Data flow is injected from top to bottom: the top-level data input module (including load forecasting, ultra-short-term photovoltaic forecasting, real-time electricity prices, etc.) provides decision-making basis for all optimization layers. Control commands are transmitted and refined from top to bottom: long-term plans gradually converge into high-precision, second-level real-time commands, ultimately reaching the bottom-level equipment execution layer (including energy storage PCS, photovoltaic inverters, adjustable loads, etc.). Simultaneously, feedback data flows back from bottom to top: real-time operating data from the equipment execution layer is continuously collected and fed back to the upper-level optimization module, forming a closed loop of "planning downwards, feedback upwards." Day-ahead scheduling layer: Operating on a 24-hour cycle with a 60-minute resolution, it performs global economic optimization calculations based on long-term forecasts and electricity price signals. Its output is a rough daily power generation and consumption plan, aiming to maximize macroeconomic benefits. Hourly optimization layer: Executed within a shorter 4-hour window with a 15-minute resolution, typically on a rolling 1-hour cycle. It receives the day-ahead plan and incorporates the latest short- and medium-term forecasts, making local adjustments and refinements to the plan to respond to anticipated changes in the coming hours. Minute-level optimization layer (core economic guarantee layer): This is the key layer in the invention's architecture. It executes on a rolling cycle with even shorter periods (e.g., 15 minutes) and a minute-level resolution (e.g., 1 minute). Its core optimization objective is to minimize the total operating cost over the next cycle, considering power purchase costs, curtailment penalties, and energy storage losses. Simultaneously, it introduces a backflow prevention safety constraint for the first time, requiring its optimization plan to guarantee the point of common coupling (PCC) power P. pcc ≥0. The output of this layer is a "reference power plan" formulated for each controllable device, balancing economy and basic safety. Second-level model predictive control layer (core safety execution layer): As the lowest level and final execution link of the architecture, it operates at high frequency with a period of seconds (e.g., 1-5 seconds). It receives the "reference power plan" from the minute level as a tracking target, and simultaneously accesses real-time data acquisition streams and system predictive models. Its core innovation lies in moving the anti-reverse current constraint from P... pcc ≥0 dynamic reinforcement to P pcc≥δ(t), where δ(t) is the dynamic safety margin calculated based on real-time prediction uncertainty. By solving an optimization problem with this dynamic constraint online, it generates smooth and accurate optimal control commands, which are immediately sent to the equipment for execution. Each optimization layer executes independently and synchronously on a fixed cycle, continuously incorporating the latest information, refreshing and outputting its plans or commands. Among them: minute-level optimization ensures the overall economic operation framework and resolves the "contradiction between economic optimization and safety constraints"; second-level MPC utilizes ultra-short-term prediction and dynamic margin mechanisms to achieve "proactive and precise interception" of backflow risks and "smooth and flexible control" of power fluctuations, overcoming the difficulties of "post-event remediation lag" and "insufficient ability to cope with intermittent fluctuations".

[0055] like Figure 6 As shown, this is a simulation comparison time series diagram of the PCC point power, energy storage power, and photovoltaic output under the same simulation scenario (photovoltaic power drops sharply from 500kW to 200kW at t=10s, while the load remains constant at 400kW) compared to the traditional feedback control method. The horizontal axis represents time, and the vertical axis represents power (kW), including three curves: PCC point power, energy storage power, and photovoltaic output. On the left, the traditional method: after the photovoltaic power drops sharply, the PCC point power instantly falls below zero (reverse current occurs), the energy storage power fluctuates violently, and the adjustment is coarse; on the right, the method of this invention: through predictive early response (adjustment starts before t<10s), the energy storage increases its discharge power in advance, the PCC point power is always above the dynamic margin (no reverse current), and all power curves transition smoothly without violent fluctuations. The two sets of curves visually compare the advantages of this invention in predictive prevention, zero reverse current, and equipment friendliness, verifying the effectiveness of the technical solution.

[0056] Taking a photovoltaic-storage microgrid in an industrial park as an example: 1. System configuration: 1MW photovoltaic capacity, 500kW / 1MWh energy storage system, main production load, and microgrid connected to the grid via a 10kV line; 2. Controller Setup: Deploy an industrial server as an advanced application host to run the algorithm of this invention; communicate with photovoltaic monitoring systems, energy storage EMS, electricity meters, etc. via IEC 61850; 3. Key parameter settings: Rolling optimization cycle Tr = 5 min, second-level MPC control cycle Ts = 2 s, prediction time domain Np = 30 steps (i.e. 1 minute), confidence coefficient β = 2.0; 4. Typical operating scenarios: Scenario A (Stable Weather): Prediction error is small, σ value is low, and dynamic margin δ is automatically maintained at a low level (e.g., 2kW). MPC controls the power at PCC point to fluctuate smoothly within the range of [δ, δ+10kW], photovoltaic power is basically at full capacity, energy storage is slightly adjusted, and the economic efficiency is optimal. Scenario B (Rapid Cloud Passage): Cloud movement causes a sharp increase in prediction error, leading to a rapid rise in σ. The dynamic margin δ is automatically adjusted to a higher level (e.g., 50kW). MPC anticipates the risk in advance and instructs energy storage to increase discharge power (or reduce charging) before the actual photovoltaic power decreases, raising the PCC point power in advance and maintaining it within a high safety buffer, effectively avoiding even momentary backflow. After the cloud passes and prediction uncertainty decreases, δ automatically recovers, and the system returns to economic mode. 5. Algorithm Implementation: Minute-level rolling optimization uses a mixed-integer linear programming solver; second-level MPC uses a high-efficiency quadratic programming solver, both deployed in a real-time operating system environment.

[0057] Accordingly, this application also discloses a microgrid anti-reverse current control device, see [link to relevant documentation]. Figure 7 As shown, the device includes: The forecast information acquisition module 11 is used to acquire power forecast information of renewable energy output and load demand within the microgrid; The rolling optimization module 12 is used to perform rolling optimization at a first preset period based on the power prediction information to generate a reference power plan for each controllable device in the microgrid in a future time period. The model predictive control tracking module 13 is used to perform model predictive control based on the reference power plan at a second preset period shorter than the first preset period, and generate target adjustment instructions for each of the controllable devices at the current moment; wherein, in the process of solving the model predictive control, the reference power plan is used as the tracking target, and the constraint condition is that the power of the common connection point is greater than the dynamic safety margin; the dynamic safety margin is adjusted in real time according to the uncertainty of the power prediction information. The instruction execution module 14 is used to adjust the operating state of the controllable device based on the target adjustment instruction.

[0058] For more detailed information on the working process of each of the above modules, please refer to the relevant content disclosed in the foregoing embodiments, which will not be repeated here.

[0059] Therefore, through the above-described scheme in this embodiment, firstly, the longer-cycle rolling optimization formulates an economically optimized reference plan for controllable equipment based on predictive information, ensuring overall economic efficiency; while the shorter-cycle model predictive control is responsible for tracking and executing this plan at a faster pace, and can proactively constrain the power of the point of common coupling using dynamic safety margins. This two-layer collaboration achieves a shift from "passive response" to "proactive planning and prevention," initiating smooth adjustment tens of seconds to minutes before a reverse current event occurs, completely eliminating the reverse current event. Secondly, the dynamic safety margin adjusts in real time according to predictive uncertainty, adaptively responding to prediction errors and renewable energy fluctuations, making the system control strategy more intelligent and flexible. Finally, the second-level optimization based on model predictive control can generate smooth and continuous optimized adjustment commands for the same group of controllable equipment, avoiding power surges and helping to extend the service life of photovoltaic inverters, energy storage batteries, and other equipment.

[0060] Furthermore, embodiments of this application also disclose an electronic device, Figure 8 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content of the diagram should not be construed as limiting the scope of this application.

[0061] Figure 8 This is a schematic diagram of the structure of an electronic device 20 provided in an embodiment of this application. Specifically, the electronic device 20 may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 stores a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the anti-reverse current control method for microgrids disclosed in any of the foregoing embodiments.

[0062] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface 25 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.

[0063] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk, or optical disk, etc. The resources stored on it can include an operating system 221, computer programs 222, and data 223, etc. The data 223 can include various types of data. The storage method can be temporary storage or permanent storage.

[0064] The operating system 221 is used to manage and control the various hardware devices on the electronic device 20 and the computer program 222, which may be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program capable of performing the anti-reverse current control method for a microgrid executed by the electronic device 20 as disclosed in any of the foregoing embodiments, the computer program 222 may further include computer programs capable of performing other specific tasks.

[0065] Furthermore, this application also discloses a computer-readable storage medium, which includes random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disks, magnetic disks, optical disks, or any other form of storage medium known in the art. The computer program, when executed by a processor, implements the aforementioned anti-reverse current control method for the microgrid. Specific steps of this method can be found in the corresponding content disclosed in the foregoing embodiments, and will not be repeated here.

[0066] Furthermore, embodiments of this application also provide a computer program product, including a computer program / instruction, which, when executed by a processor, implements any of the above-described methods for the anti-reverse current control method of the microgrid.

[0067] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.

[0068] The steps of the anti-reverse current control method or algorithm for microgrids described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disks, removable disks, CD-ROMs, or any other form of storage medium known in the art.

[0069] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0070] The foregoing has provided a detailed description of the anti-reverse current control method, device, equipment, and medium for a microgrid provided by the present invention. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only intended to help understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A method for preventing backflow control in a microgrid, characterized in that, include: Obtain power forecasting information on the output and load demand of renewable energy sources within a microgrid; Based on the power prediction information, rolling optimization is performed at a first preset period to generate a reference power plan for each controllable device in the microgrid in the future time period. Based on the reference power plan, model predictive control is executed at a second preset period shorter than the first preset period to generate target adjustment instructions for each of the controllable devices at the current moment; wherein, in the process of solving the model predictive control, the reference power plan is used as the tracking target, and the constraint condition is that the power of the common connection point is greater than the dynamic safety margin; the dynamic safety margin is adjusted in real time according to the uncertainty of the power prediction information. Based on the target adjustment command, the operating state of the controllable device is adjusted.

2. The anti-reverse current control method for microgrids according to claim 1, characterized in that, The acquisition of power forecasting information on the output and load demand of renewable energy sources within the microgrid includes: Obtain photovoltaic power forecast curves and load forecast curves based on weather data within the microgrid.

3. The anti-reverse current control method for microgrids according to claim 1, characterized in that, The step of performing rolling optimization based on the power prediction information at a first preset period to generate a reference power plan for each controllable device in the microgrid for a future period includes: Based on the power prediction information, with the goal of minimizing the total operating cost of the microgrid in the next minute-level period and with the constraint that the power of the point of common coupling is non-negative, a reference power plan for each controllable device in the microgrid is generated in the future period; wherein, the total operating cost includes at least one of the following: electricity purchase cost, curtailment penalty cost, and energy storage loss cost.

4. The anti-reverse current control method for microgrids according to claim 1, characterized in that, The step of performing model predictive control based on the reference power plan for a second preset period shorter than the first preset period to generate target adjustment instructions for each of the controllable devices at the current moment includes: Establish a system prediction model that includes the state of the energy storage system and the power state of the common connection point; Based on the system prediction model, within each second-level cycle, the reference power plan within multiple future control steps is used as the tracking target, and the power of the common connection point of each future control step is greater than the dynamic safety margin at the corresponding time is used as the constraint condition to generate the target adjustment command for each controllable device at the current time.

5. The anti-reverse current control method for microgrids according to claim 1, characterized in that, The process of determining the dynamic safety margin includes: The historical prediction error between the power prediction information and the actual measurement value within a preset time period is statistically analyzed in real time, and the statistical characteristics of the probability distribution of the historical prediction error are estimated through statistical analysis. Based on the statistical characteristics, the dynamic safety margin of the constraints used for predictive control of the model within the future prediction step size, which varies over time, is determined using the dynamic safety margin calculation formula; wherein, the larger the statistical characteristics, the larger the dynamic safety margin.

6. The anti-reverse current control method for microgrids according to claim 5, characterized in that, The formula for calculating the dynamic safety margin is as follows: ; in, For the dynamic safety margin of the k-th prediction step, The preset confidence level coefficient, Let be the standard deviation of the historical prediction error at time t.

7. The anti-reverse current control method for a microgrid according to any one of claims 1 to 6, characterized in that, The adjustment of the operating state of the controllable device based on the target adjustment command includes: According to the preset adjustment priority, the target adjustment command is converted into a smoothly changing power setpoint and sent to the device controller of the controllable device; wherein, the adjustment priority is to adjust the energy storage system first, then the photovoltaic system, and finally the adjustable load.

8. A reverse current prevention control device for a microgrid, characterized in that, include: The forecast information acquisition module is used to acquire power forecast information on the output and load demand of renewable energy sources within the microgrid; The rolling optimization module is used to perform rolling optimization at a first preset period based on the power prediction information to generate a reference power plan for each controllable device in the microgrid in a future time period. The model predictive control tracking module is used to execute model predictive control based on the reference power plan at a second preset period shorter than the first preset period, and generate target adjustment instructions for each of the controllable devices at the current moment; wherein, in the process of solving the model predictive control, the reference power plan is used as the tracking target, and the constraint condition is that the power of the common connection point is greater than the dynamic safety margin; the dynamic safety margin is adjusted in real time according to the uncertainty of the power prediction information. The instruction execution module is used to adjust the operating state of the controllable device based on the target adjustment instruction.

9. An electronic device, characterized in that, The electronic device includes a processor and a memory; wherein the memory is used to store a computer program, which is loaded and executed by the processor to implement the anti-reverse current control method for a microgrid as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, Used to store computer programs; wherein the computer programs, when executed by a processor, implement the anti-reverse flow control method for a microgrid as described in any one of claims 1 to 7.