New energy generation, consumption and regulation energy storage system to cope with the reversal of day and night tides

Through intelligent prediction and energy storage units, dynamic trend control units and other technical means, the problem of insufficient power system regulation capability caused by the reversal of new energy generation day and night is solved, the effective smoothing of power generation and the stable operation of the power grid is achieved, and the The overall utilization rate of new energy and the reliability of the power grid.

CN118801484BActive Publication Date: 2024-12-06YUNNAN ELECTRIC POWER TESTING & RES INST (GRP) CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411281851.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-13
Publication Date
2024-12-06
Estimated Expiration
2044-09-13

AI Technical Summary

Technical Problem

The day and night trend of new energy power generation has led to a mismatch between power supply and demand, and it is difficult for existing power grid structures and facilities to fully absorb the rapidly growing new energy power generation, affecting the stable operation of the power system.

Method used

A new energy generation consumption control energy storage system including intelligent prediction and energy storage unit, dynamic trend control unit, automatic operation mode adjustment unit, automatic power generation control unit, emergency response unit and intelligent decision-making unit was designed, and the LSTM model was used, PID control loop, Newton-Ravson method and reinforcement learning algorithm Deep Q-Networks realize power generation prediction, trend control and system autonomous adjustment.

Benefits of technology

Effectively smooth the fluctuations in power generation on the day and night, improve the overall utilization rate of new energy, quickly respond to grid emergencies, and improve the reliability and stability of grid operation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118801484B_ABST
    Figure CN118801484B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of new energy power generation and energy storage technology, and specifically, to a new energy power generation, consumption, regulation and storage system for coping with the reversal of day and night tidal currents. It includes: an intelligent prediction and energy storage unit uses an LSTM model to provide power generation prediction for photovoltaic power generation during the day and wind power generation at night, and sets an energy storage plan according to the predicted power generation; a dynamic tidal current control unit monitors the tidal current changes in the power network during the day and night transition to obtain tidal current change data, and controls the tidal current based on the power generation prediction information of the intelligent prediction and energy storage unit; an automatic operation mode adjustment unit automatically adjusts the operation mode of the power system through a power generation and energy storage adjustment strategy based on the tidal current change data of the dynamic tidal current control unit, and converts the power generation and energy storage adjustment strategy into a control instruction. The present invention is designed to predict the power generation of photovoltaic power during the day and wind power at night through an LSTM model, and combined with energy storage technology, it can effectively smooth the fluctuation of power generation during the day and night and reduce the phenomenon of abandoned light and wind.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of renewable energy power generation and energy storage technology, and in particular to a renewable energy power generation, consumption, regulation and storage system for coping with day and night tidal current reversal. Background Art

[0002] Renewable energy sources such as solar energy and wind energy have significant differences in power generation during the day and at night or under different meteorological conditions. For example, solar power generation can hardly generate electricity at night, while wind power generation may generate more electricity when the wind is strong at night. This imbalance in power generation will lead to a mismatch between power supply and demand; as the installed capacity of renewable energy continues to increase, the power system needs greater flexibility to adapt to the randomness and intermittency of renewable energy power generation, and the existing grid structure and facilities may not be able to fully absorb the rapid growth of renewable energy power generation, especially when power generation surges in local areas, which may lead to power transmission bottlenecks and affect the stable operation of the power system. Therefore, we design a new energy power generation consumption and regulation energy storage system to cope with the day and night tide reversal. Summary of the invention

[0003] The purpose of the present invention is to provide a new energy power generation, consumption, regulation and storage system that can cope with the reversal of day and night tides, so as to solve the problems of unbalanced power generation, low power system regulation ability and insufficient power grid consumption capacity proposed in the above background technology.

[0004] To achieve the above-mentioned purpose, the present invention aims to provide a new energy generation, consumption, regulation and storage system for coping with the day and night tidal current reversal, comprising:

[0005] An intelligent prediction and energy storage unit, which uses an LSTM model to provide power generation forecasts for photovoltaic power generation during the day and wind power generation at night, and sets an energy storage plan based on the predicted power generation;

[0006] A dynamic power flow control unit, which monitors power flow changes in the power network during the day and night period in real time to obtain power flow change data, and controls the power flow based on intelligent prediction and power generation prediction information of the energy storage unit;

[0007] An operation mode automatic adjustment unit, which automatically adjusts the operation mode of the power system through a power generation and energy storage adjustment strategy based on the power flow change data of the dynamic power flow control unit, and converts the power generation and energy storage adjustment strategy into a control instruction;

[0008] An automatic power generation control unit, which receives control instructions from the automatic operation mode adjustment unit, executes the control instructions through a PID control loop feedback mechanism, and introduces air pollution index and sunshine time changes into the PID control loop feedback mechanism to optimize the increase and decrease of power generation during the execution operation;

[0009] An emergency response unit, wherein the emergency response unit establishes a rapid response mechanism in an emergency based on the automatic power generation control unit;

[0010] The intelligent decision-making unit uses the reinforcement learning algorithm Deep Q-Networks to perform analysis, generate intelligent decision-making suggestions, and realize autonomous control and automated operation of the system.

[0011] As a further improvement of the technical solution, the intelligent prediction and energy storage unit uses the LSTM model to provide power generation prediction for photovoltaic power generation during the day and wind power generation at night, including the following steps:

[0012] S1.1. Collect historical data on photovoltaic power generation and wind power generation, including photovoltaic power generation, wind power generation, and weather data;

[0013] S1.2, pre-process the collected historical data;

[0014] S1.3. Select the key features for power generation prediction, including solar radiation intensity, temperature, humidity, wind speed and wind direction;

[0015] S1.4. Build an LSTM model, use historical data to train the LSTM model, and use the trained LSTM model to predict future power generation to obtain the predicted photovoltaic power generation and wind power generation at night.

[0016] As a further improvement of the technical solution, controlling the power flow based on the intelligent prediction and power generation prediction information of the energy storage unit includes the following steps:

[0017] S2.1. Obtain the predicted values ​​of photovoltaic power generation and wind power generation from the intelligent prediction and energy storage unit, and monitor the status data of the entire power network in real time. The status data of the power network includes the voltage, current, power, line parameters, and load data of each node;

[0018] S2.2. Using the real-time monitored network status data, the Newton-Raphson method is used to perform power flow calculation to determine the current power flow distribution of the network, and the influence of load and line damage is considered to optimize the process of power flow calculation using the Newton-Raphson method;

[0019] S2.3. Compare the power generation forecast given by the intelligent forecasting and energy storage unit with the current actual power generation, and evaluate the difference between the two.

[0020] As a further improvement of the technical solution, in S2.2, the process of optimizing the Newton-Raphson method for power flow calculation considering the influence of load and line damage is specifically as follows:

[0021] Active power:

[0022] ;

[0023] Reactive power:

[0024] ;

[0025] in, Representation Node Active power of Representation Node Reactive power; Representation Node The voltage amplitude; Representation Node The voltage amplitude; Representation Node The voltage phase angle; Representation Node The voltage phase angle; Representation Node The real part of the self-admittance of Representation Node The imaginary part of the self-admittance; Representation Node To Node Conductance of the line between Representation Node To Node The susceptance of the line between them; Indicates the current time point; Indicates the current temperature.

[0026] As a further improvement of the technical solution, the power generation and energy storage adjustment strategy includes:

[0027] When the demand in the power grid suddenly increases, the output of the power generation module is increased; when there is excess power generation and demand decreases, the energy storage device is enabled and the power generation module is shut down; when the existing power generation is insufficient to meet the load, the output of the power generation module is increased and the load is adjusted; when there is excess power generation and the energy storage device is fully loaded, but demand decreases, the energy storage device is shut down;

[0028] Control instructions include:

[0029] Increase or decrease power generation, start or stop energy storage devices, shut down power generation modules, and adjust loads.

[0030] As a further improvement of the technical solution, the automatic power generation control unit executes the control instruction through the PID control loop feedback mechanism, including the following steps:

[0031] S3.1. Analyze the received control instructions and clarify the required adjustment actions and parameter settings;

[0032] S3.2, based on the received control instructions, decide on the specific measures to be taken, including increasing or decreasing the power generation, starting or stopping the energy storage device, and shutting down the power generation module;

[0033] S3.3. Send specific control instructions to the energy storage device, execute the control instructions through the PID control loop feedback mechanism, and introduce the air pollution index and sunshine time changes into the PID control loop feedback mechanism to optimize the increase and decrease of power generation during the execution operation.

[0034] As a further improvement of the technical solution, in S3.3, the air pollution index and sunshine time change optimization execution operation are introduced into the PID control loop feedback mechanism as follows:

[0035] ;

[0036] ;

[0037] in, Represents the control amount applied to the energy storage system; Indicates the current time point; represents differential operation; Represents the time from the initial moment to the current moment Any time within the time interval; Represents the proportional gain, which is used to directly respond to the current error size; Represents the integral gain, which is used to accumulate past errors; Represents the differential gain, which is used to predict the changing trend of the error; Indicates the error between the actual frequency and the target frequency; represents the target frequency; Indicates the actual frequency; Indicates the weight coefficient of the influence of sunlight intensity on the error, which is used to adjust the influence of sunlight intensity on the error; Indicates the intensity of sunlight; Indicates the weight coefficient of the impact of the air pollution index on the error, which is used to adjust the impact of the air pollution index on the error; represents the air pollution index;

[0038] As a further improvement of the technical solution, the emergency response unit establishes a rapid response mechanism in an emergency, comprising the following steps:

[0039] S4.1. Identify the type of emergency, which includes grid frequency deviation exceeding the allowable range, voltage level abnormality, and line overload, and set specific numerical thresholds for each emergency, including grid frequency deviation threshold m, voltage level threshold n, and line load threshold p;

[0040] S4.2. When the monitored network status data exceeds the preset threshold, the system will immediately issue an alarm and notify relevant personnel and the automated control system;

[0041] S4.3. Define the power generation and energy storage adjustment strategies adopted by the automatic power generation control unit in different emergency situations;

[0042] S4.4. Through the control program, the automatic power generation control unit automatically executes the predefined power generation and energy storage adjustment strategy when an emergency situation is detected.

[0043] As a further improvement of the technical solution, the intelligent decision-making unit uses the reinforcement learning algorithm Deep Q-Networks to analyze and generate intelligent decision suggestions, including the following steps:

[0044] S5.1. Define the environment in which the intelligent decision-making unit is located, including defining the state space, action space, reward function and environment transition model;

[0045] S5.2. Collect historical data for training the Deep Q-Networks model. The historical data includes past states, actions taken, rewards obtained, and subsequent state changes.

[0046] S5.3. Build a neural network as an approximator of the Q function. The neural network accepts the state as input and outputs the Q value of all possible actions, using the experience replay mechanism, where the Q value represents the expected cumulative reward that can be obtained by performing an action in a given state;

[0047] S5.4. Use two neural networks with different functions: an online network for selecting actions and a target network for calculating target Q values;

[0048] S5.5. Train the neural network and use the loss function to minimize the difference between the predicted Q value and the target Q value. During the training process, the neural network weights are continuously updated.

[0049] S5.6. During training, use the ε-greedy strategy to balance the relationship between exploration and exploitation;

[0050] S5.7. After the model training is completed, the intelligent decision-making unit uses the trained Deep Q-Networks model to select the optimal action according to the current state, thereby realizing autonomous control and automatic operation of the system.

[0051] As a further improvement of the technical solution, in S5.5, the loss function is specifically:

[0052] ;

[0053] in, represents the loss function; Indicates expected value; Indicates that the experience replay pool Uniformly sample an experience in; Indicates the current state; Indicates the current state The action to be performed next; Indicates execution of an action Immediate rewards after Indicates execution of an action The new state that the system enters later; represents the discount factor; In the new state All possible actions The largest Q value in Represents the parameters of the online network; Represents the parameters of the target network, which is used to calculate the target Q value; Indicates the experience replay pool A random sample of Expected value; Indicates the current neural network for the state and actions of value.

[0054] Compared with the prior art, the present invention has the following beneficial effects:

[0055] 1. In the new energy generation, consumption, regulation and storage system that responds to the reversal of day and night power flow, the LSTM model is used to predict the power generation of photovoltaic power during the day and wind power at night. Combined with energy storage technology, it can effectively smooth the fluctuation of power generation during the day and night, reduce the phenomenon of abandoned photovoltaic and wind power, and improve the absorption capacity of renewable energy, thereby improving the overall utilization rate of new energy power generation.

[0056] 2. In the new energy power generation, consumption, regulation and storage system that copes with the reversal of day and night power flow, the control instructions are executed by combining the PID control loop feedback mechanism, and the air pollution index, sunshine time changes and other factors are introduced to optimize the execution operation. It can not only quickly respond to emergency situations such as grid frequency deviation, abnormal voltage level and line overload, but also realize the autonomous control and automatic operation of the system through the reinforcement learning algorithm Deep Q-Networks, thereby improving the reliability and stability of grid operation. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] Figure 1 It is the overall flow chart of the present invention;

[0058] The meaning of each number in the figure is:

[0059] 1. Intelligent prediction and energy storage unit; 2. Dynamic flow control unit; 3. Automatic operation mode adjustment unit; 4. Automatic power generation control unit; 5. Emergency response unit; 6. Intelligent decision-making unit. DETAILED DESCRIPTION

[0060] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. 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 creative work are within the scope of protection of the present invention. Example

[0061] See also Figure 1 As shown, a new energy generation, consumption, regulation and storage system is provided to cope with the day and night power flow reversal, including:

[0062] Intelligent prediction and energy storage unit 1 uses the LSTM model to provide power generation forecasts for photovoltaic power generation during the day and wind power generation at night, and sets energy storage plans based on the predicted power generation;

[0063] In this embodiment, LSTM is a special recurrent neural network (RNN) that is specially designed to process sequence data and is particularly good at capturing long-term dependencies. This means that it can effectively learn and predict power generation patterns based on historical data, whether it is changes in solar irradiance or wind speed, it can be predicted more accurately; the LSTM model can handle complex nonlinear relationships, which is crucial for predicting renewable energy power generation affected by multiple factors (such as weather conditions, seasonal changes, etc.). For example, in photovoltaic power generation forecasts, in addition to light intensity, temperature, humidity, etc. will also affect power generation efficiency; and in wind power generation forecasts, the uncertainty of wind speed and wind direction also needs to be considered; through the accurate forecasts provided by the LSTM model, power system operators can obtain reliable future power generation estimates, thereby making more reasonable scheduling arrangements; the intelligent forecasting and energy storage unit 1 uses the LSTM model to provide power generation forecasts for photovoltaic power generation during the day and wind power generation at night, including the following steps:

[0064] S1.1. Collect historical data on photovoltaic power generation and wind power generation, including photovoltaic power generation (based on historical records, including power generation every hour of every day), wind power generation (similarly, record power generation in each time period), and weather data (including solar radiation intensity, temperature, humidity, wind speed, wind direction, etc.);

[0065] S1.2, pre-process the collected historical data;

[0066] S1.3. Select the key features for power generation prediction, including solar radiation intensity, temperature, humidity, wind speed and wind direction;

[0067] S1.4. Build an LSTM model, use historical data to train the LSTM model, and use the trained LSTM model to predict future power generation to obtain the predicted photovoltaic power generation and wind power generation at night.

[0068] The dynamic power flow control unit 2 monitors the power flow changes in the power network during the day and night period in real time to obtain power flow change data, and controls the power flow based on the intelligent prediction and power generation prediction information of the energy storage unit 1;

[0069] In this embodiment, the power flow is controlled based on the intelligent prediction and power generation prediction information of the energy storage unit 1, including the following steps:

[0070] S2.1, obtain the predicted values ​​of photovoltaic power generation and wind power generation from the intelligent prediction and energy storage unit 1, and monitor the status data of the entire power network in real time. The status data of the power network includes the voltage, current, power, line parameters, and load data of each node;

[0071] S2.2. Using the real-time monitored network status data, the Newton-Raphson method is used to perform power flow calculation to determine the current power flow distribution of the network, and the influence of load and line damage is considered to optimize the process of power flow calculation using the Newton-Raphson method;

[0072] Among them, the Newton-Raphson method is a method for iteratively solving nonlinear equations, which is suitable for solving power flow calculation problems in power systems. This method can quickly converge to a solution and provide high calculation accuracy even in complex power grid models. By real-time monitoring of network status data (such as voltage, current, power, etc.), the system can instantly understand the current operating status of the power network and quickly calculate the power flow distribution through the Newton-Raphson method, which enables the power system to quickly respond to any sudden changes or faults. Accurate power flow calculation results can help power system operators optimize resource allocation, such as reasonably allocating the output of generators, adjusting the status of transmission lines, and controlling the charging and discharging of energy storage systems, thereby ensuring the economy and stability of the power system.

[0073] Furthermore, by considering factors such as load changes and line damage, the results of power flow calculation can be made closer to the actual situation, which is particularly important for renewable energy power generation systems because they are usually intermittent and volatile, which requires the power system to have higher flexibility and response speed to adapt to these changes; the optimized Newton-Raphson method can more accurately simulate the dynamic behavior in the power network, especially when the load changes or there are problems with the line. This improved calculation method can help the system better cope with the power flow reversal phenomenon caused by the change of power generation during the day and night, ensuring that the power grid can maintain stable operation under any circumstances; considering the impact of load and line damage, the direction and magnitude of power flow can be more accurately predicted, so that the system can allocate resources more efficiently. For example, when it is predicted that the load in a certain area will increase, the output of the generator set can be adjusted in advance or the energy storage device can be enabled to meet the demand; considering the impact of load and line damage, the process of optimizing the Newton-Raphson method for power flow calculation is as follows:

[0074] Active power:

[0075] ;

[0076] Reactive power:

[0077] ;

[0078] in, Representation Node Active power of Representation Node Reactive power; Representation Node The voltage amplitude of Representation Node The voltage amplitude of Representation Node The voltage phase angle; Representation Node The voltage phase angle; Representation Node The real part of the self-admittance of Representation Node The imaginary part of the self-admittance; Representation Node To Node Conductance of the line between Representation Node To Node The susceptance of the line between them; Indicates the current time point, reflecting the load changes over time; Indicates the current temperature, reflecting the impact of ambient temperature on the power line;

[0079] Furthermore, in actual calculations, the current load data is obtained through a real-time monitoring system and used as an input parameter. During the calculation process, the change of load over time is treated as a variable, thereby more accurately reflecting the actual load situation; when line damage is detected, the conductivity of the affected line can be adjusted immediately. and electrosusceptor If the line is completely disconnected, the conductance of the line can be set to zero or the line can be removed from the calculation model. If the line is short-circuited, the conductance value can be adjusted accordingly to reflect the resistance in the short-circuit state.

[0080] S2.3. Compare the power generation forecast given by the intelligent forecast and energy storage unit 1 with the current actual power generation, and evaluate the difference between the two.

[0081] The operation mode automatic adjustment unit 3 automatically adjusts the operation mode of the power system through the power generation and energy storage adjustment strategy based on the power flow change data of the dynamic power flow control unit 2, and converts the power generation and energy storage adjustment strategy into a control instruction;

[0082] In this embodiment, the power generation and energy storage adjustment strategy includes:

[0083] When the demand in the power grid suddenly increases, the output of the power generation module is increased; when there is excess power generation and demand decreases, the energy storage device is enabled and the power generation module is shut down; when the existing power generation is insufficient to meet the load, the output of the power generation module is increased and the load is adjusted; when there is excess power generation and the energy storage device is fully loaded, but demand decreases, the energy storage device is shut down;

[0084] Among them, the power generation module includes photovoltaic power generation and wind power generation;

[0085] Control instructions include:

[0086] Increase or decrease power generation, start or stop energy storage devices, shut down power generation modules, and adjust loads.

[0087] The automatic power generation control unit 4 receives the control instruction of the operation mode automatic adjustment unit 3 and executes the control instruction through the PID control loop feedback mechanism;

[0088] In this embodiment, the PID control loop feedback mechanism can quickly respond to deviations in the system, that is, the difference between the actual value and the target value. By adjusting the gains of the proportional (P), integral (I) and differential (D) terms, the PID control can quickly respond to frequency changes, voltage fluctuations or other disturbances in the power grid, and timely adjust the power generation output to ensure the stability of the power system; the integral part (I) in the PID control loop feedback mechanism can accumulate error signals and gradually eliminate steady-state errors over time, which means that even small long-term deviations will be corrected, thereby improving control accuracy; the differential part (D) in the PID control can prevent over-adjustment of the system by predicting the changing trend of the error, thereby suppressing overshoot and making the system response more stable; the automatic power generation control unit 4 executes control instructions through the PID control loop feedback mechanism, including the following steps:

[0089] S3.1. Analyze the received control instructions and clarify the required adjustment actions and parameter settings;

[0090] S3.2, based on the received control instructions, decide on the specific measures to be taken, including increasing or decreasing the power generation, starting or stopping the energy storage device, and shutting down the power generation module;

[0091] S3.3, sending specific control instructions to the energy storage device, executing the control instructions through the PID control loop feedback mechanism, and introducing the air pollution index and sunshine time changes into the PID control loop feedback mechanism to optimize the execution operation;

[0092] Furthermore, air pollution affects the intensity of solar radiation reaching the ground, thereby affecting the efficiency of photovoltaic power generation. By introducing the air pollution index, the PID control loop feedback mechanism can more accurately predict and adjust photovoltaic power generation to avoid power generation fluctuations caused by changes in air quality; sunshine time directly affects photovoltaic power generation. By considering changes in sunshine time, the system can more accurately predict daytime power generation and adjust the charging and discharging strategy of the energy storage system accordingly to ensure sufficient power supply at night; the PID control loop feedback mechanism monitors the changes in these environmental variables in real time and quickly adjusts the control parameters, so that the system can respond to changes in the external environment more quickly, thereby improving the system's response speed and stability; combined with the information of air pollution index and sunshine time changes, the system can allocate resources more reasonably, such as giving priority to photovoltaic power generation during periods of good air quality and sufficient sunshine, and relying on other forms of power generation or energy storage devices to supplement when conditions are poor; the introduction of air pollution index and sunshine time changes in the PID control loop feedback mechanism to optimize the execution of operations is as follows:

[0093] ;

[0094] ;

[0095] in, Represents the control amount applied to the energy storage system; Indicates the current time point; represents differential operation; Represents the time from the initial moment to the current moment Any time within the time interval; Represents the proportional gain, which is used to directly respond to the current error size; Represents the integral gain, which is used to accumulate past errors and eliminate static errors; Represents the differential gain, which is used to predict the changing trend of the error and prevent over-adjustment; represents the error, i.e., the difference between the target value and the actual value; Indicates the target frequency, that is, the ideal value that the grid frequency is expected to maintain; Indicates the actual frequency, that is, the actual frequency of the power grid at the current moment; Indicates the weight coefficient of the influence of sunlight intensity on the error, which is used to adjust the influence of sunlight intensity on the error; Indicates sunshine intensity, that is, the solar radiation intensity at the current moment, reflecting the lighting conditions; Indicates the weight coefficient of the impact of the air pollution index on the error, which is used to adjust the impact of the air pollution index on the error; represents the air pollution index;

[0096] The emergency response unit 5 establishes a rapid response mechanism in emergency situations based on the automatic power generation control unit 4;

[0097] In this embodiment, the automatic power generation control unit 4 establishes a rapid response mechanism in an emergency, including the following steps:

[0098] S4.1. Identify the type of emergency, which includes grid frequency deviation exceeding the allowable range, voltage level abnormality, and line overload, and set specific numerical thresholds for each emergency, including grid frequency deviation threshold m, voltage level threshold n, and line load threshold p;

[0099] S4.2. When the monitored network status data exceeds the preset threshold, the system will immediately issue an alarm and notify relevant personnel and the automated control system;

[0100] S4.3, defining the power generation and energy storage adjustment strategies adopted by the automatic power generation control unit 4 in different emergency situations;

[0101] S4.4, through the control program, the automatic power generation control unit 4 automatically executes a predefined power generation and energy storage adjustment strategy when an emergency situation is detected;

[0102] The control procedure is as follows:

[0103] import time

[0104] def read_sensor_data():

[0105] # Read sensor data

[0106] voltage = get_voltage() # Get voltage

[0107] frequency = get_frequency() # Get frequency

[0108] return voltage, frequency

[0109] def check_threshold(voltage, frequency):

[0110] # Check if the emergency state has been reached

[0111] if voltage < VOLTAGE_THRESHOLD or frequency > FREQUENCY_THRESHOLD:

[0112] return True

[0113] return False

[0114] def execute_emergency_action():

[0115] # Execute emergency actions

[0116] adjust_generator_power(REDUCED_POWER)

[0117] disconnect_non_critical_load()

[0118] activate_backup_power()

[0119] def main():

[0120] while True:

[0121] voltage, frequency = read_sensor_data()

[0122] if check_threshold(voltage, frequency):

[0123] print("Emergency! Executing emergency response...")

[0124] execute_emergency_action()

[0125] else:

[0126] print("The system is running normally")

[0127] time.sleep(CHECK_INTERVAL)

[0128] if __name__ == "__main__":

[0129] main()

[0130] Intelligent decision-making unit 6 uses the reinforcement learning algorithm Deep Q-Networks to analyze and generate intelligent decision-making suggestions to achieve autonomous control and automated operation of the system;

[0131] In this embodiment, Deep Q-Networks is able to continuously learn by interacting with the environment, which means that it can improve its strategy over time without human intervention. This adaptability is particularly useful for dealing with dynamically changing environments, including situations where demand and supply in the system change over time and weather conditions. Deep Q-Networks uses deep neural networks as function approximators, which enables it to process high-dimensional state spaces and find effective strategies even in very complex states. This is very useful for power systems involving large amounts of sensor data and multiple control options. The intelligent decision unit 6 uses the reinforcement learning algorithm Deep Q-Networks for analysis and generates intelligent decision recommendations, including the following steps:

[0132] S5.1. Define the environment in which the intelligent decision-making unit 6 is located, including defining the state space (S), action space (A), reward function (R) and environment transition model (although it is usually unknown in reinforcement learning); for energy storage systems, the state includes the current energy storage level, grid load, weather conditions, etc.; the action is charging, discharging or remaining unchanged; the reward function is designed based on whether it effectively balances supply and demand, maximizes revenue or minimizes cost;

[0133] S5.2. Collect historical data for training the Deep Q-Networks model. The historical data includes past states, actions taken, rewards obtained, and subsequent state changes.

[0134] S5.3. Build a neural network as an approximator of the Q function. The neural network accepts the state as input and outputs the Q value of all possible actions, using the experience replay mechanism, where the Q value represents the expected cumulative reward that can be obtained by performing an action in a given state;

[0135] Among them, building a neural network as an approximator of the Q function includes the following steps:

[0136] S5.31. First, determine the architecture of the neural network, including the input layer, hidden layer, and output layer. The input layer should correspond to the dimension of the state space S. If the state consists of multiple features, then the input layer will have a corresponding number of nodes, and the output layer corresponds to the size of the action space A. Each output node represents a possible action, and its value is the Q value estimate of the action. The hidden layer can be one or more layers, and the ReLU activation function is used to introduce nonlinearity;

[0137] S5.32. Before training begins, all weights of the network are randomly initialized;

[0138] S5.33. Use the ε-greedy strategy to explore the environment and collect experience, which means that part of the time, the best action given by the current network is executed, and the other part of the time, the action is randomly selected;

[0139] S5.34. These experience samples are stored in a buffer called "experience replay" to break the correlation between data and improve the stability and efficiency of training;

[0140] S5.35, randomly select a batch of experience samples from the experience replay pool for training;

[0141] S5.36. For each sample, use the target network to calculate the next state Maximum Q value ,in is the weight of the target network; the target Q value is the immediate reward Add discount factor Multiply by the maximum Q value ;

[0142] S5.37. Use of online network Predict current state The Q value under the target Q value is calculated as the supervision signal to update the weight of the online network. , to minimize the mean square error between the predicted Q value and the target Q value;

[0143] S5.38. Update the weights of the target network periodically or gradually , so that it gradually matches the weight of the online network synchronization, which helps stabilize the training process;

[0144] S5.39. Repeat the above steps until the predetermined number of training rounds R is reached.

[0145] S5.4. Use two neural networks with different functions: an online network for selecting actions and a target network for calculating target Q values. The weights of the target network are periodically or gradually moved closer to the online network, which can stabilize the training process.

[0146] S5.5. Train the neural network, using a loss function to minimize the difference between the predicted Q value and the target Q value. During the training process, the neural network weights are continuously updated, and the learning rate or exploration rate may be adjusted.

[0147] Among them, the loss function quantifies the gap between the predicted Q value and the target Q value, allowing the network to focus on reducing this gap, thereby improving the accuracy of learning. By minimizing the loss, the network can converge to a better strategy faster, because each weight update moves in the direction of reducing errors. The loss function helps the network remain stable during the training process and avoids drastic fluctuations in the predicted value caused by frequent weight updates. The specific loss function is:

[0148] ;

[0149] in, represents the loss function; represents the expected value, that is, taking the average value; Indicates that the experience replay pool Uniformly sample an experience in; Represents the current state, which includes the current characteristics of the system, including energy storage level, grid load, and weather conditions; Indicates the current state The actions performed include charging, discharging, or remaining unchanged; Indicates execution of an action The immediate reward obtained after the transaction is designed based on whether it effectively balances supply and demand, maximizes benefits, or minimizes costs; Indicates execution of an action The new state that the system enters later; Represents the discount factor, which is a value between 0 and 1 that is used to weigh future rewards and determines the importance of future rewards; In the new state All possible actions The largest Q value in the target network is used here. To calculate, the purpose is to stabilize the training process; Represents the parameters of the online network, that is, the parameters of the network being trained; Represents the parameters of the target network, which is used to calculate the target Q value; Indicates the experience replay pool A random sample of Expected value; Indicates the current neural network for the state and actions of value.

[0150] S5.6. During training, use the ε-greedy strategy to balance exploration (trying new actions) and exploitation (taking the action currently considered the best).

[0151] The specific ε-greedy strategy is as follows: whenever the intelligent decision unit 6 needs to select an action, it will throw a uniformly distributed random number between 0 and 1; if this random number is less than ε, the intelligent decision unit 6 will select a random action to explore the part of the environment that is not yet fully understood. If this random number is greater than or equal to ε, the intelligent decision unit 6 will select the action with the highest current Q value, which is the best action considered by the current model.

[0152] S5.7. After the model training is completed, the intelligent decision-making unit 6 uses the trained Deep Q-Networks model to select the optimal action according to the current state, thereby realizing autonomous control and automatic operation of the system.

[0153] The above shows and describes the basic principles, main features and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited by the above embodiments, and the above embodiments and descriptions are only preferred examples of the present invention, and are not intended to limit the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, and these changes and improvements all fall within the scope of the present invention to be protected.

Claims

1. A new energy generation, consumption and regulation energy storage system for coping with the day and night tide reversal, characterized by: include An intelligent prediction and energy storage unit (1), wherein the intelligent prediction and energy storage unit (1) uses an LSTM model to provide power generation prediction for photovoltaic power generation during the day and wind power generation at night, and sets an energy storage plan based on the predicted power generation; A dynamic power flow control unit (2), the dynamic power flow control unit (2) monitors power flow changes in the power network during the day and night transition period in real time to obtain power flow change data, and controls the power flow based on intelligent prediction and power generation prediction information of the energy storage unit (1); An operation mode automatic adjustment unit (3), wherein the operation mode automatic adjustment unit (3) automatically adjusts the operation mode of the power system through a power generation and energy storage adjustment strategy based on the power flow change data of the dynamic power flow control unit (2), and converts the power generation and energy storage adjustment strategy into a control instruction; An automatic power generation control unit (4), the automatic power generation control unit (4) receiving a control instruction from the operation mode automatic adjustment unit (3), executing the control instruction through a PID control loop feedback mechanism, and introducing an air pollution index and a change in sunshine time into the PID control loop feedback mechanism to optimize the execution operation; An emergency response unit (5), wherein the emergency response unit (5) establishes a rapid response mechanism in an emergency situation based on the automatic power generation control unit (4); An intelligent decision-making unit (6), wherein the intelligent decision-making unit (6) uses a reinforcement learning algorithm Deep Q-Networks to perform analysis, generate intelligent decision-making suggestions, and realize autonomous control and automated operation of the system; The automatic power generation control unit (4) executes control instructions through a PID control loop feedback mechanism, including the following steps: S3.

1. Analyze the received control instructions and clarify the required adjustment actions and parameter settings; S3.2, based on the received control instructions, decide on the specific measures to be taken, including increasing or decreasing the power generation, starting or stopping the energy storage device, and shutting down the power generation module; S3.3, sending specific control instructions to the energy storage device, executing the control instructions through the PID control loop feedback mechanism, and introducing the air pollution index and sunshine time changes into the PID control loop feedback mechanism to optimize the increase and decrease of power generation during the execution operation; In S3.3, the air pollution index and sunshine time change optimization execution operation are introduced into the PID control loop feedback mechanism as follows: ; ; in, Represents the control amount applied to the energy storage system; Indicates the current time point; represents differential operation; Represents the time from the initial moment to the current moment Any time within the time interval; Represents the proportional gain, which is used to directly respond to the current error size; Represents the integral gain, which is used to accumulate past errors; Represents the differential gain, which is used to predict the changing trend of the error; Indicates the error between the actual frequency and the target frequency; represents the target frequency; Indicates the actual frequency; Indicates the weight coefficient of the influence of sunlight intensity on the error, which is used to adjust the influence of sunlight intensity on the error; Indicates the intensity of sunlight; Indicates the weight coefficient of the impact of the air pollution index on the error, which is used to adjust the impact of the air pollution index on the error; represents the air pollution index; The intelligent decision-making unit (6) uses the reinforcement learning algorithm Deep Q-Networks to perform analysis and generate intelligent decision-making suggestions, including the following steps: S5.

1. Define the environment in which the intelligent decision-making unit (6) is located, including defining the state space, action space, reward function and environment transition model; S5.

2. Collect historical data for training the Deep Q-Networks model. The historical data includes past states, actions taken, rewards obtained, and subsequent state changes. S5.

3. Build a neural network as an approximator of the Q function. The neural network accepts the state as input and outputs the Q value of all possible actions, using the experience replay mechanism, where the Q value represents the expected cumulative reward that can be obtained by performing an action in a given state; S5.

4. Use two neural networks with different functions: an online network for selecting actions and a target network for calculating target Q values; S5.

5. Train the neural network and use the loss function to minimize the difference between the predicted Q value and the target Q value. During the training process, the neural network weights are continuously updated. S5.

6. During training, use the ε-greedy strategy to balance the relationship between exploration and exploitation; S5.7, after the model training is completed, the intelligent decision-making unit (6) uses the trained Deep Q-Networks model to select the optimal action according to the current state, thereby realizing autonomous control and automatic operation of the system; In S5.5, the loss function is specifically: ; in, represents the loss function; Indicates expected value; Indicates that the experience replay pool Uniformly sample an experience in; Indicates the current state; Indicates the current state The action to be performed next; Indicates execution of an action Immediate rewards after Indicates execution of an action The new state that the system enters later; represents the discount factor; In the new state All possible actions The largest Q value in Represents the parameters of the online network; Represents the parameters of the target network, which is used to calculate the target Q value; Indicates the experience replay pool A random sample of Expected value; Indicates the current neural network for the state and actions of value.

2. The new energy generation, consumption, regulation and storage system for coping with day and night tidal current reversal according to claim 1 is characterized by: The intelligent prediction and energy storage unit (1) uses the LSTM model to provide power generation prediction for photovoltaic power generation during the day and wind power generation at night, including the following steps: S1.

1. Collect historical data on photovoltaic power generation and wind power generation, including photovoltaic power generation, wind power generation, and weather data; S1.2, pre-process the collected historical data; S1.

3. Select the key features for power generation prediction, including solar radiation intensity, temperature, humidity, wind speed and wind direction; S1.

4. Build an LSTM model, use historical data to train the LSTM model, and use the trained LSTM model to predict future power generation to obtain the predicted photovoltaic power generation and wind power generation at night.

3. The new energy generation, consumption, regulation and storage system for coping with day and night tidal current reversal according to claim 1 is characterized by: Controlling the power flow based on the power generation prediction information of the intelligent prediction and energy storage unit (1) comprises the following steps: S2.1, obtaining the predicted values ​​of photovoltaic power generation and wind power generation from the intelligent prediction and energy storage unit (1), and monitoring the status data of the entire power network in real time, the status data of the power network including the voltage, current, power, line parameters, and load data of each node; S2.

2. Using the real-time monitored network status data, the Newton-Raphson method is used to perform power flow calculation to determine the current power flow distribution of the network, and the influence of load and line damage is considered to optimize the process of power flow calculation using the Newton-Raphson method; S2.

3. Compare the power generation forecast given by the intelligent forecasting and energy storage unit (1) with the current actual power generation, and evaluate the difference between the two.

4. The new energy generation, consumption, regulation and storage system for coping with day and night tidal current reversal according to claim 3 is characterized by: In S2.2, the process of optimizing the Newton-Raphson method for power flow calculation considering the influence of load and line damage is as follows: Active power: ; Reactive power: ; in, Representation Node Active power of Representation Node Reactive power; Representation Node The voltage amplitude of Representation Node The voltage amplitude of Representation Node The voltage phase angle; Representation Node The voltage phase angle; Representation Node The real part of the self-admittance of Representation Node The imaginary part of the self-admittance; Representation Node To Node Conductance of the line between Representation Node To Node The susceptance of the line between them; Indicates the current time point; Indicates the current temperature.

5. The new energy generation, consumption, regulation and storage system for coping with day and night tidal current reversal according to claim 1 is characterized by: The power generation and energy storage adjustment strategy includes: When the demand in the power grid suddenly increases, the output of the power generation module is increased; when there is excess power generation and demand decreases, the energy storage device is enabled and the power generation module is shut down; when the existing power generation is insufficient to meet the load, the output of the power generation module is increased and the load is adjusted; when there is excess power generation and the energy storage device is fully loaded, but demand decreases, the energy storage device is shut down; Control instructions include: Increase or decrease power generation, start or stop energy storage devices, shut down power generation modules, and adjust loads.

6. The new energy generation, consumption, regulation and storage system for coping with day and night tidal current reversal according to claim 1 is characterized by: The emergency response unit (5) establishes a rapid response mechanism in an emergency, comprising the following steps: S4.

1. Identify the type of emergency, which includes grid frequency deviation exceeding the allowable range, voltage level abnormality, and line overload, and set specific numerical thresholds for each emergency, including grid frequency deviation threshold m, voltage level threshold n, and line load threshold p; S4.

2. When the monitored network status data exceeds the preset threshold, the system will immediately issue an alarm and notify relevant personnel and the automation control system; S4.3, defining the power generation and energy storage adjustment strategies adopted by the automatic power generation control unit (4) in different emergency situations; S4.

4. By means of a control program, the automatic power generation control unit (4) automatically executes a predefined power generation and energy storage adjustment strategy when an emergency situation is detected.