A method for preventing electric energy from flowing back into a power grid
By dynamically regulating the discharge power of energy storage equipment through real-time data collection and optimization algorithms, the problems of power reverse flow and insufficient dynamic regulation capabilities in the energy storage system are solved, and efficient and stable power management is achieved.
Patent Information
- Application Number
- CN202411991914.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-09-09
- Estimated Expiration
- 2044-12-31
AI Technical Summary
Existing energy storage systems have difficulty achieving precise anti-backflow control of electricity when load demand fluctuates, and their insufficient dynamic adjustment capabilities lead to uneven power distribution, affecting system stability and efficiency.
By collecting load power, energy storage equipment and grid status data in real time, an optimization model is constructed, and the discharge power of the energy storage equipment is optimized using the gradient descent method and dynamic programming algorithm. Dynamic regulation is achieved by combining power balance, backflow prevention and power change rate limitation.
It achieves precise prevention and control of power backflow, improves the regulation accuracy and operating efficiency of the energy storage system, ensures system stability and equipment safety, and improves the response speed and utilization efficiency of energy management.
Smart Images

Figure CN119787432B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of industrial and commercial energy storage, and in particular to a method for preventing electric energy from flowing back into a power grid. Background Art
[0002] With the widespread application of energy storage technology in industrial and commercial scenarios, energy storage devices have gradually become important regulatory units in power grid operations. However, the bidirectional flow characteristics of electric energy in the interaction between energy storage systems and the power grid pose challenges to grid stability and the operation of energy storage devices. Especially when load demand fluctuates frequently, the output power of energy storage devices may be difficult to adjust in a timely manner, which can easily lead to uneven power distribution or power backflow. In existing technologies, static limiting or switch-type backflow prevention devices are commonly used. These methods often lack dynamic control capabilities and are unable to cope with real-time changes in load power and energy storage device output, thus affecting the safety of system operation.
[0003] Furthermore, the dynamic regulation capability of energy storage devices is crucial to the system's responsiveness. Current technologies often use preset power or simple regulation rules to control the output of energy storage devices. This approach relies on fixed power values or empirically set parameters, and cannot fully reflect the dynamic changes in real-time load demand. When load demand fluctuates dramatically, the output power of energy storage devices often struggles to keep pace, leading to an imbalance in the power distribution between the energy storage device and the grid, reducing the overall system's operating efficiency and stability. Furthermore, during the regulation process, the rate of change of the energy storage device's power is not effectively limited, which can cause the energy storage device to adjust too quickly and cause equipment failure, further limiting the reliability of the energy storage system.
[0004] Most existing energy storage system energy management models are based on step-by-step control, separating data acquisition, optimization calculations, and output regulation, lacking the integrity of closed-loop control. Due to the delay in information transmission between modules and the limitations of local optimization, the system's response speed in dynamic load scenarios is slow. In addition, when multiple energy storage devices operate in coordination, the power allocation mechanism of existing technologies is often relatively simple, failing to fully utilize energy storage resources, resulting in inefficient energy scheduling. These shortcomings severely limit the effectiveness of energy storage systems in complex industrial and commercial application scenarios. There is an urgent need for a solution that can optimize power distribution in real time, dynamically adjust output, and ensure stable grid operation.
[0005] Therefore, the present invention proposes a method for preventing electric energy from flowing back into the power grid to solve the shortcomings of the prior art. Summary of the Invention
[0006] In response to the shortcomings of the existing technology, the present invention provides a method for preventing electric energy from flowing back into the power grid, which solves the problems of inaccurate electric energy backflow prevention and control, delayed dynamic power regulation and low energy management efficiency in existing industrial and commercial energy storage systems.
[0007] To achieve the above objectives, the present invention is implemented through the following technical solutions: A method for preventing electric energy from flowing back into the power grid, comprising the following steps:
[0008] S1. Collect data on the real-time load power of the gateway meter, the discharge power of the energy storage device and its change rate, and the power flow status of the power grid;
[0009] S2. Build an optimization model based on the collected data;
[0010] S3. Based on the constructed optimization model, set the optimization function of the target;
[0011] S4. Solve the optimization function using an optimization algorithm and calculate the optimal discharge power of the energy storage device at the current time using a gradient descent method;
[0012] S5. Sending the calculated optimal discharge power to the energy storage device to adjust the real-time output power of the energy storage device;
[0013] S6. Real-time monitoring of the energy storage device, power grid, and load power flow status, and repeating the above steps at preset time intervals.
[0014] Preferably, the optimization model includes the following constraints:
[0015] Power balance constraints: The discharge power of the energy storage device, the power supplied by the grid, and the load power of the gateway meter must satisfy the total power conservation requirement.
[0016] Anti-backflow constraint: the grid power supply is always greater than or equal to zero;
[0017] Energy storage device power limit: The discharge power of the energy storage device is always less than or equal to its rated maximum discharge power;
[0018] Power change rate limit: The discharge power change rate of the energy storage device is less than or equal to its maximum change rate.
[0019] Preferably, the optimization function is defined in the following manner:
[0020] The goal is to minimize the deviation between the discharge power of the energy storage device and the power required by the load;
[0021] The goal is to minimize the power supply of the power grid;
[0022] The goal is to minimize the rate of change of discharge power of energy storage equipment.
[0023] Preferably, the weight coefficients of the optimization function are set according to actual application requirements, including energy storage power deviation weight, grid power supply weight and power change rate weight.
[0024] Preferably, the optimization algorithm comprises the following steps:
[0025] Construct a Lagrangian function to combine the optimization objective with the power balance constraint;
[0026] Based on the gradient descent method, the discharge power of the energy storage device and the power supply power of the grid are iteratively optimized;
[0027] The time-discretized optimization problem is solved in real time through dynamic programming to adjust the discharge power of the energy storage device.
[0028] Preferably, the gradient update process of the gradient descent method includes:
[0029] Optimization of discharge power of energy storage equipment;
[0030] Optimization of grid power supply.
[0031] Preferably, the process of adjusting the real-time output power of the energy storage device includes:
[0032] Send optimization calculation results to energy storage equipment in real time;
[0033] According to the current state of the energy storage device, the output power is adjusted, the power change rate is updated, and the constraints of the optimization model are ensured to be met.
[0034] Preferably, the real-time monitoring includes:
[0035] The gateway meter detects load power fluctuations in real time and updates the collected data;
[0036] Monitor the power change rate of the energy storage device to ensure it is always within the maximum change rate limit;
[0037] If it is detected that the grid power supply is less than zero, an emergency stop is triggered to discharge the energy storage device.
[0038] Preferably, the time interval for real-time monitoring is set according to load fluctuation characteristics.
[0039] The present invention also provides a system for preventing electric energy from flowing back into the power grid, comprising the following modules:
[0040] Data acquisition module, used to collect the load power of the gateway meter, the discharge power of the energy storage device and the power status of the grid;
[0041] The optimization calculation module is used to build an optimization model and solve the optimal energy storage power in real time based on the gradient descent method and dynamic programming; the power regulation module is used to dynamically adjust the discharge power of the energy storage device according to the optimization results;
[0042] The real-time monitoring module is used to continuously monitor the power flow status to ensure that the power output of the energy storage device meets the anti-backflow constraints.
[0043] The present invention provides a method for preventing electric energy from flowing back into the power grid. It has the following beneficial effects:
[0044] 1. This invention utilizes real-time data collection of energy storage device, grid, and load power status, combined with anti-backflow constraints and optimization algorithms, to achieve the technical effect of strictly controlling the direction of grid power and preventing the reverse flow of stored energy onto the grid. Compared to existing solutions that rely solely on simple power threshold control, this solution solves the problem of delayed response and inability to effectively limit reverse flow.
[0045] 2. This invention achieves dynamic control of the energy storage device's output power by constructing a target optimization function and combining gradient descent with dynamic programming to optimize the energy storage device's discharge power in real time. Compared to existing methods that rely on fixed power settings or manual adjustments, this method overcomes the drawback of slow response to changes in load demand and significantly improves the control accuracy and operational efficiency of the energy storage system.
[0046] 3. This invention ensures system stability and device safety by introducing power balance constraints, backflow prevention constraints, and energy storage device power limits. Prior art often neglects power rate control, leading to instability caused by overly rapid device regulation. This invention addresses this shortcoming and significantly reduces the operational risks of energy storage devices.
[0047] 4. This invention utilizes a closed-loop control mechanism combining real-time monitoring, optimized calculations, output regulation, and cyclic feedback to achieve efficient, coordinated management of energy storage devices, the power grid, and the load. Compared to existing step-by-step or unidirectional control schemes, this solves the problems of low energy management system response efficiency and irrational power allocation, significantly improving the energy storage system's adaptability to load demands and energy utilization efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 A flowchart of the steps of a method for preventing electric energy from flowing back into the power grid according to the present invention;
[0049] Figure 2 This is a module framework diagram of a system for preventing electric energy from flowing back into the power grid according to the present invention. DETAILED DESCRIPTION
[0050] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the present specification. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0051] Please see the attached Figure 1 , an embodiment of the present invention provides a method for preventing electric energy from flowing back into a power grid, comprising the following steps: S1, collecting data on the real-time load power of a gateway meter, the discharge power of an energy storage device and its change rate, and the power flow state of the power grid;
[0052] In this invention, data collection is the core foundation for preventing reverse flow of electricity into the grid. By monitoring the real-time status of energy storage devices, the grid, and the load, dynamic and accurate input data is provided for subsequent optimization model construction and algorithms. Generally, this step achieves a comprehensive understanding of the system's operating status by real-time collection of the load power of the gateway table, the discharge power and rate of change of the energy storage device, and the power flow status of the grid.
[0053] Specifically, the data acquisition module in this embodiment is responsible for acquiring power data from the gateway table, energy storage devices, and grid interfaces. This data can accurately reflect the real-time status of the system and support subsequent dynamic optimization calculations. Each part of the data acquisition is described in detail below.
[0054] In this embodiment, the load power P 负载 (t) is the total power demand that needs to be met by the energy storage equipment and the grid power supply. The gateway meter is installed between the energy storage system and the load, and provides input data for the optimization model by monitoring the load power changes in real time.
[0055] The current I is collected through the load side current transformer and voltage transformer 负载 (t) and voltage U 负载 (t), calculate the load power:
[0056] P 负载 (t) = U 负载 (t)·I 负载 (t)·cosφ
[0057] Among them, U 负载 (t) is the real-time voltage on the load side, I 负载 (t) is the real-time current on the load side, and cosφ is the load power factor.
[0058] In some embodiments, a high-precision smart meter can be used to directly read P 负载 (t), to avoid manual calculation errors.
[0059] Generally, in order to adapt to the dynamic fluctuations of load power, the sampling frequency is set to milliseconds or higher. In some scenarios where the load changes slowly, the sampling frequency can be appropriately reduced, for example, once per second.
[0060] In this embodiment, the discharge power P of the energy storage device 储能(t) is the real-time power provided by the energy storage device to the load at time t. This parameter is one of the core inputs of the optimization model and directly affects the calculation of the power balance constraint.
[0061] Methods for collecting the discharge power of energy storage equipment include:
[0062] Measure the real-time voltage U at the output of the energy storage device 储能 (t) and current I 储能 (t), we can calculate:
[0063] P 储能 (t) = U 储能 (t)·I 储能 (t)·cosφ 储能
[0064] Among them, U 储能 (t) is the voltage at the output of the energy storage device, I 储能 (t) is the current at the output of the energy storage device, cosφ 储能 is the power factor of the energy storage device.
[0065] In some embodiments, the real-time power value P can be directly read through the power measurement module of the energy storage system. 储能 (t), improve data collection efficiency.
[0066] In one possible implementation, to reduce the impact of instantaneous fluctuations, the energy storage device power data can be smoothed using a sliding window averaging method:
[0067]
[0068] in, is the smoothed energy storage power, N is the number of sampling points in the sliding window, and Δt is the time interval between each sampling.
[0069] Energy storage device power change rate ΔP 储能 (t) refers to the change in power of the energy storage device per unit time, which is used to constrain the dynamic adjustment speed of the energy storage device to avoid system instability during the adjustment process. In this embodiment, the energy storage power change rate is calculated by the following formula:
[0070]
[0071] Where ΔP 储能 (t) is the energy storage power change rate, P 储能 (t) is the power of the energy storage device at the current moment, P 储能 (t-Δt) is the power of the energy storage device at the previous moment, and Δt is the time interval.
[0072] In some embodiments, in order to improve the stability of the power change rate, the acquisition module may add a dynamic filtering function during the sampling process to reduce high-frequency interference signals.
[0073] Grid power flow state P 电网 (t) is an important parameter for measuring whether reverse flow occurs in the energy storage device. In this embodiment, a smart meter installed at the connection between the energy storage device and the grid monitors the power flow status of the grid in real time and determines the power direction.
[0074] The grid power flow status is calculated by the following formula:
[0075] P 电网 (t) = P 负载 (t)-P 储能 (t)
[0076] Among them, P 电网 (t) is the power supply of the grid, when P 电网 When (t)<0, it indicates that reverse flow occurs in the energy storage device.
[0077] As an option, the acquisition module can introduce a power direction monitoring mechanism. Once the P 电网 (t)<0, an alarm signal is immediately issued and the system is notified to stop discharging the energy storage device.
[0078] In a further embodiment of the present invention, the data acquisition module can be expanded to:
[0079] Store historical records of collected data for load characteristic analysis and energy storage system operation evaluation;
[0080] Realize the communication function and transmit the collected data to the optimization calculation module through Modbus protocol, CAN bus or Ethernet; support multi-channel redundant acquisition to ensure the reliability and continuity of data acquisition.
[0081] In this embodiment, the data acquisition module provides load power, energy storage power and its rate of change, and grid power flow status data as direct inputs to the optimization model. The accuracy of this data determines the reliability of the subsequent optimization algorithm and the effectiveness of energy storage device regulation.
[0082] S2. Build an optimization model based on the collected data;
[0083] Constructing an optimization model is one of the core technical steps of the present invention and is directly based on the data collected in step S1. The optimization model is used to describe the power relationship between the energy storage device, the power grid, and the load, while converting the physical constraints of the system operation into a mathematical expression that can be used for optimization calculations. By constructing an optimization model, it is possible to ensure that the energy storage device meets the load demand while strictly limiting the reverse flow of stored energy, providing a foundation for setting and solving subsequent optimization goals.
[0084] Generally, building an optimization model requires considering both the real-time and dynamic characteristics of the system, including the physical limitations of energy storage devices, the directional limitations of grid power, and the fluctuating nature of load demand. In some embodiments, to enhance model robustness, constraints can be further enriched by incorporating historical data and external environmental characteristics.
[0085] Specifically, in this embodiment, the optimization model mainly includes the following contents:
[0086] The power balance constraint is the basic condition of the optimization model, which is used to ensure that the energy storage device and the power grid can jointly meet the real-time load demand. The mathematical expression of the power balance constraint is:
[0087] P 储能 (t)+P 电网 (t) = P 负载 (t)
[0088] Among them, P 储能 (t) is the real-time discharge power of the energy storage device at time t, P 电网 (t) is the real-time power supply of the power grid at time t, P 负载 (t) is the real-time load power collected by the gateway meter.
[0089] Generally, this constraint ensures that the power output of the energy storage device and the grid can dynamically meet the real-time demand of the load without insufficient or excessive power supply.
[0090] In a possible implementation, in order to improve the stability of the power balance constraint, P 负载 (t) The data is subjected to noise filtering and smoothing. The specific calculation method is:
[0091]
[0092] in, is the load power after smoothing, N is the number of sampling points in the sliding window, and Δt is the time interval between each sampling.
[0093] Through the above-mentioned smoothing process, the interference of instantaneous load fluctuations on the calculation results of the optimization model can be effectively reduced.
[0094] The anti-backflow constraint is one of the key technologies of this invention, which aims to ensure that the power direction of the grid always maintains a positive flow, that is, the energy storage energy will not flow back to the grid. The mathematical expression of this constraint is:
[0095] P 电网 (t)≥0
[0096] Among them, P 电网 When (t)≥0, it means the power grid is in normal power supply state. 电网 When (t)<0, it means that the excess electric energy of the energy storage device flows backward.
[0097] Specifically, the anti-backflow constraint limits the minimum value of the grid power to zero, thereby avoiding the backflow phenomenon caused by excessive output power of the energy storage device. In some embodiments, a dynamic monitoring mechanism can be introduced. Once P is detected, 电网 If (t)<0, the discharge power of the energy storage device is immediately adjusted through the optimization algorithm to ensure that the anti-backflow constraint is always met.
[0098] Energy storage device power limits include discharge power limits and power change rate limits, which are used to ensure the safe operation of energy storage devices and avoid system instability caused by overly rapid adjustments.
[0099] First, the discharge power limit of the energy storage device can be expressed as:
[0100]
[0101] Among them, P 储能 (t) is the real-time discharge power of the energy storage device, is the rated maximum discharge power of the energy storage device.
[0102] Secondly, the power change rate limit of the energy storage device can be expressed as:
[0103]
[0104] Among them, P 储能 (t) is the real-time discharge power of the energy storage device, is the rated maximum discharge power of the energy storage device.
[0105] Secondly, the power change rate limit of the energy storage device can be expressed as:
[0106]
[0107] Where ΔP 储能 (t) is the power change rate of the energy storage device, ΔP 储能 The calculation formula for (t) is:
[0108]
[0109] As an option, in order to further improve the operational stability of energy storage equipment, it can be dynamically adjusted according to its operating life and health status. and For example, when the battery health status of the energy storage device deteriorates, the upper limit of these parameters can be appropriately lowered to extend the service life of the device.
[0110] In some embodiments, the construction of the optimization model may also be combined with the following extended functions:
[0111] Consider environmental factors, such as the impact of room temperature changes on energy storage devices, and add temperature constraints;
[0112] Load power P 负载 (t) Make short-term forecasts and introduce the forecast values into the optimization model to improve the model’s forward-looking nature;
[0113] In the scenario of multiple energy storage devices working together, power allocation constraints between devices are added to achieve joint optimization of multiple devices.
[0114] The construction of the optimization model is the foundation for setting the objective function and solving the optimization algorithm. By clearly defining constraints such as power balance, reverse flow prevention, and energy storage device power limits, the optimization model accurately describes the dynamic relationship between energy storage devices, the grid, and the load, providing a clear mathematical framework for subsequent optimization calculations.
[0115] S3. Based on the constructed optimization model, set the optimization function of the target;
[0116] Setting the target optimization function is a key step in achieving dynamic control of energy storage devices and preventing reverse energy flow in this invention. Based on the optimization model constructed in step S2, this target optimization function, combined with the system's real-time state, comprehensively considers the energy storage device's power tracking accuracy, minimization of grid power supply, and stability of the energy storage device's power rate of change. The goal is to achieve efficient and safe operation of the energy storage system through optimization calculations. The optimization function provides a specific mathematical target for the subsequent execution of the optimization algorithm.
[0117] Generally, setting a target optimization function requires a trade-off between different optimization objectives, such as accurate tracking of load power and the stability of the energy storage device's power rate of change. In some embodiments, the weight coefficients can be dynamically adjusted based on the actual needs of the operating scenario, thereby achieving flexible control over the optimization objectives.
[0118] Specifically, in this embodiment, the setting of the target optimization function includes the following main contents:
[0119] In this embodiment, the energy storage power deviation refers to the actual discharge P of the energy storage device.储能 (t) and the real-time load power P of the gateway table 负载 (t). In order to ensure that the energy storage device can meet the load demand in real time, the optimization function needs to minimize this deviation. The corresponding deviation loss function can be expressed as:
[0120] f1(t)=α1·(P 储能 (t)-P 负载 (t)) 2
[0121] Among them, f1(t) is the loss function of energy storage power deviation, which represents the loss caused by energy storage power deviation, P 储能 (t) is the real-time discharge power of the energy storage device at time t, P 负载 (t) is the real-time load power of the gateway at time t, and α1 is the weight coefficient of the energy storage power deviation, which is used to adjust the proportion of deviation minimization in the overall optimization objective.
[0122] In general, the value of α1 needs to be reasonably set according to the load fluctuation characteristics of the system and the response capability of the energy storage device. In the case of large load fluctuations, it is recommended to increase the value of α1 appropriately to prioritize the load demand.
[0123] In order to reduce the power supply pressure of the power grid and prevent the stored energy from flowing back to the power grid, the optimization function needs to minimize the power supply power P of the power grid. 电网 (t). The corresponding grid power loss function can be expressed as:
[0124] f2(t)=α2·P 电网 (t) 2
[0125] Among them, f2(t) is the loss function of the power grid, which represents the loss caused by the power supply of the grid, P 电网 (t) is the real-time power supply of the power grid at time t, and α2 is the weight coefficient of the power grid, which is used to adjust the proportion of power grid minimization in the overall optimization objective.
[0126] In some embodiments, to further limit the use of grid power, an upper limit on the grid power supply may be introduced. Right now:
[0127]
[0128] in, The maximum allowed value of the power supplied to the grid.
[0129] Through the above constraints, the instability problem caused by overload of the power grid can be effectively avoided.
[0130] Energy storage power change rate ΔP储能 (t) is an important indicator for measuring the power regulation speed of energy storage equipment. Excessive power change rate may cause system instability and increase the operating pressure of energy storage equipment. Therefore, the optimization function needs to minimize the energy storage power change rate, and its corresponding loss function can be expressed as:
[0131] f3(t)=α3·ΔP 储能 (t) 2
[0132] Among them, f3(t) is the loss function of the energy storage power change rate, which represents the loss caused by the power regulation speed being too fast, ΔP 储能 (t) is the power change rate of the energy storage device at time t, and α3 is the weight coefficient of the energy storage power change rate, which is used to adjust the proportion of this part of the loss in the overall optimization target.
[0133] The calculation formula for the energy storage power change rate is:
[0134]
[0135] Among them, P 储能 (t-Δt) is the discharge power of the energy storage device at the previous moment, and Δt is the time interval.
[0136] Generally speaking, in order to ensure the stability of the energy storage equipment, an upper limit value can be set for the power change rate. Right now:
[0137]
[0138] in, is the maximum power change rate of the energy storage device.
[0139] The target optimization function is defined by combining the above three loss functions:
[0140]
[0141] Specifically expanded as follows:
[0142]
[0143] Among them, J is the target optimization function, the total loss function represents the goal that the optimization algorithm needs to minimize, and T is the optimization time range.
[0144] The values of weight coefficients α1, α2, and α3 are dynamically set based on actual system requirements. For example, when load power tracking is prioritized, the value of α1 can be increased; when the regulation capability of the energy storage device is limited, the value of α3 can be reduced.
[0145] In some embodiments, to further improve the optimization effect, the following extensions can be introduced into the target optimization function:
[0146] Adding an optimization target for the operating efficiency of batteries in energy storage devices, such as introducing a battery charge and discharge efficiency factor;
[0147] Considering the influence of ambient temperature, a temperature correction term is added to the optimization function;
[0148] In a multi-energy storage device system, the optimization goal of power distribution balance between devices is added.
[0149] The target optimization function provides a clear mathematical goal for the subsequent optimization algorithm. By reasonably setting the loss function and weight coefficient, a balance can be achieved between different optimization objectives to ensure the efficient operation of energy storage equipment and the safety and stability of the power grid.
[0150] S4. Solve the optimization function using an optimization algorithm and calculate the optimal discharge power of the energy storage device at the current time using a gradient descent method;
[0151] This step is based on the target optimization function set in step S3, and calculates the optimal discharge power P of the energy storage device at the current time through the optimization algorithm. 储能 (t), and ensure that the calculated results meet the constraints of the optimization model constructed in step S2. The optimization algorithm needs to comprehensively consider the discharge power of the energy storage device, the power change rate, and the power of the grid. It aims to minimize the total system loss through iterative calculation, and ultimately achieve real-time power optimization of the energy storage device and the grid working together.
[0152] Generally, optimization algorithms must meet real-time and high efficiency requirements to adapt to load power fluctuations and the rapidly changing nature of energy storage device operation. In this embodiment, a combination of gradient descent and dynamic programming is used to solve the target optimization function. Gradient descent updates the power value at each time point, while dynamic programming handles the global optimization problem across multiple time steps.
[0153] Specifically, in this embodiment, the solution process of the optimization algorithm includes the following:
[0154] To combine the optimization objective function with the constraints, this embodiment uses the Lagrangian method to construct an optimization solution framework. The goal is to introduce power balance constraints, anti-backflow constraints, and energy storage device power limits into the objective optimization function.
[0155] The optimization objective function is:
[0156]
[0157] After the constraints are introduced, the Lagrangian function is defined:
[0158]
[0159] in, is the Lagrangian function, which represents the objective that the optimization algorithm needs to minimize. λ is the Lagrangian multiplier, which represents the penalty coefficient of the power balance constraint. 储能 (t) is the discharge power of the energy storage device, P 电网 (t) is the power supply of the power grid, P 负载 (t) is the real-time load power of the gateway meter.
[0160] After the constraints are introduced, the optimization solution satisfies the following conditions at the same time:
[0161] Power balance constraints:
[0162] P 储能 (t)+P 电网 (t) = P 负载 (t)
[0163] Anti-backflow constraint:
[0164] P 电网 (t)≥0
[0165] Energy storage device power limit:
[0166]
[0167] Energy storage power change rate limit:
[0168]
[0169] In this embodiment, the Lagrangian function is calculated by gradient descent method. Perform iterative optimization and gradually approach the optimal solution.
[0170] The iterative formula of the gradient descent method is:
[0171]
[0172] in, is the energy storage discharge power after the k+1th iteration, is the energy storage discharge power of the kth iteration, is the grid power after the k+1th iteration, is the grid power supply at the kth iteration, α and β are the learning rates of gradient descent, which control the update step size and are usually in the range of 0.01 to 0.1. and is the partial derivative of the Lagrangian function with respect to the energy storage power and the grid power.
[0173] The specific calculation formula is as follows:
[0174]
[0175] Where ΔP 储能 (t) is the energy storage power change rate, and the calculation formula is:
[0176]
[0177] As a possible implementation, the learning rates α and β can be dynamically adjusted to speed up convergence. For example, when the gradient value is large, the learning rate can be appropriately reduced to prevent the algorithm from diverging.
[0178] The dynamic programming algorithm is used to solve the global optimization problem of multiple time steps, discretizing the time interval [0, T] into multiple time steps t k , and recursively calculate the optimal power value for each time step.
[0179] The discretization expression of the objective function is:
[0180]
[0181] Among them, t k is the kth time step, N is the number of time steps, N = T / Δt; the definitions of other symbols and parameters are consistent with the above content.
[0182] The dynamic programming algorithm starts from the last time step t N Start the reverse recursion, gradually calculate the optimal solution of each time step, and use it as the input of the next time step to achieve global optimization.
[0183] In this embodiment, the final output of the optimization algorithm includes the optimal discharge power of the energy storage device and the optimal power supply of the power grid To ensure the accuracy of the results, the following constraints need to be verified on the output:
[0184]
[0185] In some embodiments, the optimization algorithm may also introduce the following features:
[0186] Combined with machine learning model to predict load power P 负载 (t), improve the foresight of optimization results;
[0187] Use distributed computing technology to improve computing efficiency;
[0188] Different weight coefficients α1, α2, and α3 are dynamically adjusted to adapt to different operating conditions.
[0189] S5. Sending the calculated optimal discharge power to the energy storage device to adjust the real-time output power of the energy storage device;
[0190] In step S4, the optimal discharge power of the energy storage device is calculated using the optimization algorithm. and grid power The core goal of this step is to adjust the actual output power of the energy storage device in real time based on these optimization results, ensuring that the energy storage device operates according to the optimal power output, meeting the load demand while strictly complying with the power balance constraints and anti-backflow constraints.
[0191] The real-time regulation of energy storage equipment needs to be combined with its own physical characteristics, such as the maximum discharge power limit and power rate limit At the same time, the grid status must be taken into consideration to ensure that power reverse flow does not occur.
[0192] Typically, the energy storage device regulation process involves converting optimization results into specific control instructions, updating power output in real time, and verifying the adjustment results through dynamic monitoring. In some embodiments, filtering and feedback mechanisms can also be used to enhance the stability of the adjustment.
[0193] Specifically, the real-time adjustment process of the energy storage device in this embodiment includes the following:
[0194] In this embodiment, the optimal discharge power of the energy storage device is The results of the optimization algorithm calculation need to be converted into actual control instructions for the energy storage device. Energy storage devices usually adjust the output current To achieve power regulation, the calculation formula of the control instruction is:
[0195]
[0196] in, is the control current instruction of the energy storage device, is the optimal discharge power of the energy storage device, U 储能 (t) is the output voltage of the energy storage device.
[0197] Alternatively, the calculated current command can be sent in real time to the energy storage device control module via various communication protocols (e.g., CAN bus, Modbus protocol, etc.). In some embodiments, to improve the reliability of command transmission, dual-channel redundant communication technology can be used to ensure that the command can be accurately and promptly transmitted to the energy storage device.
[0198] After receiving the control command, the energy storage device dynamically adjusts the output power through a power conversion module (such as a DC / DC converter or inverter). In this embodiment, the real-time output power of the energy storage device needs to meet the following constraints:
[0199] Power output limit:
[0200]
[0201] Among them, P 储能 (t) is the actual output power of the energy storage device, is the maximum discharge power of the energy storage device.
[0202] Power change rate limit:
[0203]
[0204] Where ΔP 储能 (t) is the power change rate of the energy storage device, is the maximum power change rate of the energy storage device, ΔP 储能 The calculation formula of (t) is, Δt is the time interval.
[0205] Specifically, subject to the aforementioned constraints, the energy storage device will adjust its power output in real time based on the received control instructions. In some embodiments, the energy storage device may also smooth the output power through an internal low-pass filter to reduce the impact of transient fluctuations on the load and the grid.
[0206] To ensure that the output power of the energy storage device meets the optimization results, a real-time monitoring mechanism is introduced in this embodiment to dynamically monitor the operating status of the energy storage device, power grid and load. The main parameters monitored include: the actual output power of the energy storage device; Grid power supply power P 电网 (t);
[0207] Load power P 负载 (t)
[0208] The monitoring results can be used to verify whether the power adjustment meets the power balance constraints:
[0209]
[0210] At the same time, it is necessary to check whether the anti-backflow constraints are met:
[0211] P 电网 (t)≥0
[0212] In one possible implementation, when it is detected that the power adjustment fails to meet the constraint conditions, the system will immediately trigger the exception handling mechanism, forcibly stop the output power of the energy storage device, and issue an alarm signal.
[0213] In further implementations of the present invention, in order to enhance the intelligence and robustness of power regulation of energy storage devices, the following extended functions may be combined:
[0214] Combined with the short-term forecast model, P负载 (t) Make a prediction and use the prediction result as a reference for adjustment in the next time step;
[0215] Dynamically adjust according to the battery health status of the energy storage device and The value of
[0216] In the multi-energy storage device scenario, distributed control algorithms are used to achieve coordinated regulation of multiple energy storage devices and optimize the overall system performance.
[0217] Real-time output power adjustments of energy storage devices directly impact the grid's ability to meet power and load demands. After adjustments are completed, the monitored real-time operating data is used as input for the next round of optimization calculations, forming a closed-loop control system of optimization, adjustment, and feedback, thereby achieving dynamic system balance.
[0218] S6. Real-time monitoring of the energy storage device, power grid, and load power flow, repeating the above steps at preset intervals. After completing the power output adjustment of the energy storage device in step S5, to ensure the dynamic balance and long-term stable operation of the system, it is necessary to monitor the status of the energy storage device, power grid, and load in real time and repeat steps S1 to S5 at preset intervals. This loop mechanism can dynamically adapt to changes in load demand while ensuring the real-time operation of the energy storage device and the security of the power grid.
[0219] Generally, the core of real-time monitoring is to obtain the latest status data of energy storage devices, the power grid, and loads, and to verify the accuracy of optimization and adjustment through the detection results. In some embodiments, fault detection and exception handling mechanisms can also be combined to take timely measures when the system operating status does not meet expectations, thereby preventing system instability or power reverse flow.
[0220] Specifically, the process of real-time monitoring and cyclic execution in this embodiment includes the following:
[0221] In this embodiment, the operating status of the energy storage device is the focus of real-time monitoring, which mainly includes the output power P of the energy storage device. 储能 (t) and power change rate ΔP 储能 By monitoring these parameters, it is possible to ensure that the output of the energy storage device always meets the optimization results and satisfies the operating constraints.
[0222] Specifically, the real-time output power of the energy storage device must meet the following conditions:
[0223]
[0224] Among them, P 储能 (t) is the real-time output power of the energy storage device, is the maximum discharge power of the energy storage device.
[0225] At the same time, the monitoring formula for the power change rate is:
[0226]
[0227] Its constraints are:
[0228]
[0229] Where ΔP 储能 (t) is the power change rate of the energy storage device, Δt is the time interval, is the maximum power change rate of the energy storage device.
[0230] By monitoring these parameters, operational deviations of energy storage equipment can be discovered and corrected in a timely manner.
[0231] In this embodiment, the power flow state of the power grid is a key monitoring indicator to ensure the realization of the anti-backflow function, which is mainly achieved by monitoring the power supply power P of the power grid. 电网 (t) Implementation. The monitoring results must meet the following constraints:
[0232] P 电网 (t)≥0
[0233] Among them, P 电网 (t) is the real-time power supply of the power grid. When P 电网 When (t)<0, it indicates that the electric energy of the energy storage device has reversed flow. At this time, the system should immediately trigger the emergency processing mechanism, stop the output power of the energy storage device, and record the abnormal situation.
[0234] In one possible implementation, the monitoring of the power flow state of the power grid can be combined with an over-limit alarm function. 电网 When (t) approaches zero, the system will issue a warning signal in advance to remind the energy storage device to reduce the output power to avoid the occurrence of backflow.
[0235] In order to ensure the integrity of system operation and the rationality of power allocation, this embodiment also needs to verify whether the power balance constraint is met. The specific formula is:
[0236] P 储能 (t)+P 电网 (t) = P 负载 (t)
[0237] Among them, P 负载 (t) is the load power monitored in real time by the gateway meter.
[0238] In general, the results of the power balance verification can directly reflect whether the system's operating status meets the expectations of the optimization algorithm. In some embodiments, deviation analysis can also be performed in combination with historical data to determine the accuracy of the energy storage device's output power.
[0239] In this embodiment, the time interval Δt of the cyclic execution is a key parameter that determines the dynamic response speed of the system. Generally, the selection of the time interval needs to comprehensively consider the frequency of load fluctuations and the dynamic response capability of the energy storage device.
[0240] Specifically, the value of the time interval Δt can be estimated by the following formula:
[0241]
[0242] Where Δt is the time interval, f 响应 is the dynamic response frequency of the energy storage device.
[0243] In scenarios where the load changes quickly, a smaller Δt can be selected, such as 0.1s or shorter; in scenarios where the load changes slowly, Δt can be appropriately increased, such as 1s or longer.
[0244] Alternatively, to avoid the loss of energy storage equipment caused by frequent adjustments, the value of Δt can be dynamically adjusted through an adaptive algorithm. For example, when load fluctuations are small, the system can automatically increase the time interval, thereby reducing unnecessary optimization calculations and power adjustments.
[0245] In this embodiment, to further enhance system stability, an exception handling and fault recovery mechanism is also designed. When the following situations are detected during real-time monitoring, the system should trigger the corresponding processing flow: Power balance constraint failure: adjust the output power of the energy storage device or trigger the backup power supply.
[0246] Grid power reverse flow: Stop the output power of the energy storage device and issue an alarm signal.
[0247] The power change rate of the energy storage device exceeds the limit: Reduce the adjustment speed of the energy storage device to avoid equipment loss caused by excessive adjustment.
[0248] In some embodiments, an intelligent diagnostic system may be combined to record and analyze abnormal situations, thereby providing a basis for subsequent system optimization.
[0249] In this embodiment, the results of real-time monitoring serve as input data for the next round of optimization calculations, updating the operating status of the energy storage device, the power grid, and the load. By repeatedly executing steps S1 through S6, the system forms an optimization-adjustment-feedback closed-loop control mechanism, enabling dynamic regulation of the energy storage device and the power grid.
[0250] In summary, the present invention provides a method for preventing electric energy from flowing back into the power grid. By collecting the operating data of the energy storage device, the power grid and the load in real time, an optimization model including power balance, anti-backflow and energy storage device operation restrictions is constructed, and a target optimization function is set to minimize the loss of energy storage power deviation, power grid power and power change rate. By combining the gradient descent method with the dynamic programming algorithm to solve the optimization function, the optimal discharge power of the energy storage device is calculated, and the output of the energy storage device is adjusted in real time to ensure that the load demand is met while strictly preventing electric energy from flowing back into the power grid. The real-time monitoring and closed-loop control mechanism further ensures the safety, stability and efficiency of the system operation, making the present invention suitable for scenarios such as industrial and commercial energy storage systems that require dynamic power regulation, and provides a reliable solution for the efficient collaboration of energy storage systems and power grids.
[0251] Please see the attached Figure 2 The present invention also provides a system for preventing electric energy from flowing back into the power grid, comprising the following modules: a data acquisition module for collecting the load power of the gateway meter, the discharge power of the energy storage device and the power status of the power grid;
[0252] The optimization calculation module is used to build an optimization model and solve the optimal energy storage power in real time based on the gradient descent method and dynamic programming; the power regulation module is used to dynamically adjust the discharge power of the energy storage device according to the optimization results;
[0253] The real-time monitoring module is used to continuously monitor the power flow status to ensure that the power output of the energy storage device meets the anti-backflow constraints.
[0254] The system of this embodiment is executed based on some embodiments of the above method, and its principles and technical effects are similar, so they will not be repeated here.
[0255] While embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions, and variations may be made to these embodiments without departing from the principles and spirit of the invention, and that the scope of the invention is defined by the appended claims and their equivalents.
Claims
1. A method for preventing electric energy from flowing back into a power grid, characterized in that: The following steps are involved: Collect data on the real-time load power of the gateway meter, the discharge power of the energy storage device and its rate of change, and the power flow status of the grid; Build an optimization model based on the collected data; Based on the constructed optimization model, set the optimization function of the target; The optimization function is solved using the optimization algorithm, and the optimal discharge power of the energy storage device at the current time is calculated using the gradient descent method; Send the calculated optimal discharge power to the energy storage device to adjust the real-time output power of the energy storage device; Monitor the energy storage device, grid, and load power flow status in real time, and repeat the above steps at preset time intervals; The optimization model includes the following constraints: Power balance constraints: The discharge power of the energy storage device, the power supplied by the grid, and the load power of the gateway meter must satisfy the total power conservation requirement. Anti-backflow constraint: the grid power supply is always greater than or equal to zero; Energy storage device power limit: The discharge power of the energy storage device is always less than or equal to its rated maximum discharge power; Power change rate limit: The discharge power change rate of the energy storage device is less than or equal to its maximum change rate; The optimization function is a total loss function containing multiple weighted loss functions, which is defined as follows: The goal is to minimize the deviation between the discharge power of the energy storage device and the power required by the load; The goal is to minimize the power supply of the power grid; The goal is to minimize the rate of change of discharge power of energy storage equipment; The specific expression of the optimization function is: Among them, T is the optimization time range, P 储能 (t) is the real-time discharge power of the energy storage device at time t, P 负载 (t) is the real-time load power of the gateway at time t, α1 is the weight coefficient of the energy storage power deviation, P 电网 (t) is the real-time power supply of the power grid at time t, α2 is the weight coefficient of the power grid, ΔP 储能 (t) is the power change rate of the energy storage device at time t, and α3 is the weight coefficient of the energy storage power change rate.
2. A method for preventing electric energy from flowing back into the power grid according to claim 1, characterized in that: The weight coefficients of the optimization function are set according to actual application requirements, including the energy storage power deviation weight, the grid power supply weight and the power change rate weight.
3. The method for preventing electric energy from flowing back into the power grid according to claim 1, characterized in that: The optimization algorithm comprises the following steps: Construct a Lagrangian function to combine the optimization objective with the power balance constraint; Based on the gradient descent method, the discharge power of the energy storage device and the power supply power of the grid are iteratively optimized; The time-discretized optimization problem is solved in real time through dynamic programming to adjust the discharge power of the energy storage device.
4. The method for preventing electric energy from flowing back into the power grid according to claim 1, characterized in that: The gradient update process of the gradient descent method includes: Optimization of discharge power of energy storage equipment; Optimization of grid power supply.
5. The method for preventing electric energy from flowing back into the power grid according to claim 1, characterized in that: The process of adjusting the real-time output power of the energy storage device includes: Send optimization calculation results to energy storage equipment in real time; According to the current state of the energy storage device, the output power is adjusted, the power change rate is updated, and the constraints of the optimization model are ensured to be met.
6. The method for preventing electric energy from flowing back into the power grid according to claim 1, characterized in that: The real-time monitoring includes: The gateway meter detects load power fluctuations in real time and updates the collected data; Monitor the power change rate of the energy storage device to ensure it is always within the maximum change rate limit; If it is detected that the grid power supply is less than zero, an emergency stop is triggered to discharge the energy storage device.
7. A method for preventing electric energy from flowing back into the power grid according to claim 6, characterized in that: The time interval for the real-time monitoring is set according to load fluctuation characteristics.
Citation Information
Patent Citations
Self-adaptive dynamic planning control method and system for large-scale energy storage power station
CN105846461A
Anti-reverse power control method and control device for incremental power distribution network system
CN115395548A