Method and device for formulating energy storage charging and discharging strategy based on multi-factor prediction and medium
By establishing a multi-factor prediction model and optimization algorithm, and formulating energy storage charging and discharging strategies, the power industry has solved the problem of optimizing power consumption strategies in demand response events, improved prediction accuracy and strategy flexibility, and improved economic and social benefits.
Patent Information
- Application Number
- CN202411985982.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-02-07
- Estimated Expiration
- 2044-12-31
AI Technical Summary
In the demand response events of the power industry, it is difficult for enterprises to effectively deal with the uncertainty of power grid scheduling and electricity price fluctuations, which makes it difficult to optimize power consumption strategies and affect economic and social benefits.
Using a multi-factor prediction method, by collecting relevant information on energy storage charging and discharging, establishing production load, living load and distributed photovoltaic prediction models, constructing future electricity usage prediction models, and optimizing them to formulate energy storage charging and discharging strategies.
It improves the accuracy and flexibility of future electricity consumption forecasts, helps enterprises to more effectively respond to changes in power grid demand, optimize power consumption strategies, and improve economic and social benefits.
Smart Images

Figure CN119401513A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the technical field of energy storage economic optimization and scheduling, and specifically relates to a method, device and medium for formulating energy storage charging and discharging strategies based on multi-factor prediction. Background Art
[0002] In the event of demand response in the power industry, facing the uncertainty of grid dispatch, enterprises need to adopt effective strategies to deal with it. This background is similar to the time-of-use electricity price mechanism in the current electricity price system, and both require enterprises to adjust their electricity consumption behavior according to the demand of the grid and the fluctuation of electricity prices.
[0003] In a demand response event, the power grid will notify the enterprise in advance and ask it to reduce or increase electricity consumption within a specific time to balance the load of the power grid. This is similar to the division of peak, flat and off-peak periods in the time-of-use electricity price mechanism, except that demand response events may be more flexible and urgent.
[0004] Companies need to respond to these demands by optimizing the electricity consumption curve, which includes adjusting production plans, rationally dispatching energy storage equipment, etc. Similar to the strategies under the time-of-use electricity price mechanism, companies also need to consider how to maximize economic benefits in demand response events, such as reducing electricity consumption when grid demand is high to avoid high prices, or providing spare capacity to obtain compensation when the grid needs it.
[0005] However, the response to demand response events is more complicated because the time of occurrence and the amount of regulation may not be as fixed and predictable as time-of-use electricity prices. Therefore, enterprises need more advanced forecasting models and optimization algorithms to plan in advance and adjust electricity consumption strategies in real time.
[0006] In general, responding to demand response events is an important way for enterprises to interact with the power grid in the electricity market. Through reasonable strategies, both economic and social benefits can be improved. Summary of the invention
[0007] In order to solve the deficiencies in the prior art, the present application provides a method, device and medium for formulating energy storage charging and discharging strategies based on multi-factor prediction. The method, device and medium provided by the present application.
[0008] According to a first aspect of the present application, a method for formulating an energy storage charging and discharging strategy based on multi-factor prediction is provided, the method comprising the steps of: S1, collects data related to energy storage charging and discharging.
[0009] S2, judging whether the current energy storage charging and discharging strategy needs to be changed based on the collected data of energy storage charging and discharging related information.
[0010] S3, establishing a power consumption prediction model based on the data collected about energy storage charging and discharging, and using the established power consumption prediction model to predict future comprehensive power consumption data to obtain future comprehensive power consumption data, specifically including the following steps: 301, use linear regression to build a production load prediction model. Specifically, use linear regression to perform category prediction on production load data, and the categories include: normal production and abnormal production.
[0011] 302, using random forest regression to build a life load prediction model. Specifically, using random forest regression to perform category prediction on life load data, the categories include: typical working days and special days.
[0012] 303, using ANN to construct a distributed photovoltaic prediction model, specifically, using ANN-1 and ANN-2 to form a weather category prediction model for sunny and cloudy days, and the weather categories include: sunny and cloudy days.
[0013] The present invention proposes to establish a future electricity consumption forecasting model by integrating a production load forecasting model, a life load forecasting model and a distributed photovoltaic forecasting model, which can not only more comprehensively reflect the actual situation of the power system, thereby improving the accuracy of future electricity consumption forecasts; it can also adapt to changes in different types of electricity loads, conduct future electricity consumption forecasts for complex and changeable electricity loads, and improve the accuracy and flexibility of future electricity consumption forecasts.
[0014] S4, optimizing the future comprehensive electricity consumption data according to the constrained electricity load.
[0015] S401, classify the power load and add constraints to the classified power load.
[0016] S402, optimizing the future comprehensive power consumption data according to the power load dispatching plan and the power load constraints to obtain the optimized future comprehensive power consumption data, specifically comprising the steps of: A1, set the objective function of future comprehensive electricity consumption data.
[0017] Specifically, the objective function of the future comprehensive electricity consumption data includes minimizing the total electricity cost and maximizing the load utilization.
[0018] A2, taking the power load constraint as the feasible domain of the objective function of future comprehensive power consumption data.
[0019] A3, using a linear programming solver, solves the objective function of the future comprehensive electricity consumption data.
[0020] A4, based on the solution results of the future comprehensive electricity consumption data, the optimized future comprehensive electricity consumption data is obtained.
[0021] Specifically, the optimized future comprehensive electricity consumption data includes the optimized total load power, the optimized local load power and the optimized external load power.
[0022] S5, establish short-time-scale rolling optimization scheduling, and formulate the scheduling strategy for future power load based on the optimized future comprehensive power consumption data.
[0023] S501, constructing a short-time-scale rolling optimization scheduling model. Specifically, the time-scale rolling optimization scheduling adopts an upper and lower layer structure to respectively manage power fluctuations of different scheduling durations.
[0024] S502, calculating the power consumption in the future peak period and the future peak period according to the peak period power consumption and the peak period power consumption in the optimized future comprehensive power consumption data.
[0025] S503, based on the calculation of the future peak period and the power consumption in the future peak period, and the short-time scale rolling optimization scheduling model, formulate the future power storage charging and discharging scheduling strategy. Specifically, the future power storage charging and discharging scheduling strategy steps are: B1, using the day-ahead scheduling prediction model, which is usually based on historical data and weather forecast information; where the time scale is set to ≥ 24 hours.
[0026] B2, the forecast data is sent to the dispatch center, which starts the start-stop plan and the call plan and outputs the day-ahead dispatch plan; B3, uses an intraday short-time-scale rolling optimization model that is able to process data on shorter time scales.
[0027] Among them, the time scale is set to be ≥4 hours; the day-ahead scheduling prediction model outputs the day-ahead scheduling plan and provides it to the intraday short-time scale rolling optimization model.
[0028] B4, sends the short-term forecast data to the dispatch center, which starts the start-stop plan and the call plan and outputs the intraday dispatch plan.
[0029] S5, establish a day-ahead dispatch prediction model and an intraday dispatch optimization model, and formulate a dispatch strategy for future power load based on the optimized future comprehensive power consumption data.
[0030] S501, constructing a day-ahead scheduling prediction model and an intra-day scheduling optimization model. Specifically, both the day-ahead scheduling prediction model and the day-ahead scheduling prediction model adopt an upper and lower two-layer structure to respectively manage power fluctuations of different scheduling durations.
[0031] S502, calculating the power consumption in the future peak period and the future peak period according to the peak period power consumption and the peak period power consumption in the optimized future comprehensive power consumption data.
[0032] S503, the day-ahead dispatch prediction model generates a day-ahead dispatch reference value, and the day-ahead dispatch reference value, the future peak period and the future peak period electricity consumption are input into the intraday dispatch optimization model to obtain the future electricity consumption energy storage charging and discharging dispatch strategy.
[0033] The specific steps include: B1, using the day-ahead scheduling prediction model, which is usually based on historical data and weather forecast information, and the time scale is set to ≥ 24 hours; B2, the forecast data is sent to the dispatch center, which starts the start-stop plan and the call plan and outputs the day-ahead dispatch plan; B3, uses an intraday short-time-scale rolling optimization model that is able to process data on shorter time scales.
[0034] Among them, the time scale is set to be ≥4 hours; the day-ahead scheduling prediction model outputs the day-ahead scheduling plan and provides it to the intraday short-time scale rolling optimization model.
[0035] B4, sends the short-term forecast data to the dispatch center, which starts the start-stop plan and the call plan and outputs the intraday dispatch plan.
[0036] B5, uses the intraday short-time-scale rolling optimization model, takes the intraday scheduling plan as the initial data, and makes real-time adjustments.
[0037] The contradiction between supply and demand in the power system is a long-standing problem. Through accurate power load forecasting and the formulation of reasonable scheduling strategies, the power supply and demand can be better balanced, and the power shortage or waste caused by the contradiction between supply and demand can be reduced. The present invention proposes to establish a day-ahead scheduling prediction model and an intraday scheduling optimization model, and formulate a scheduling strategy for future power loads based on the optimized future comprehensive power consumption data. According to the method proposed in the present invention, the day-ahead scheduling prediction model and the intraday scheduling optimization model of the upper and lower layers respectively manage power fluctuations of different scheduling durations, which can not only quickly respond to load changes in a short period of time and improve the flexibility and real-time performance of load scheduling, but also the day-ahead scheduling prediction model and the intraday scheduling optimization model can cooperate with each other to form a hierarchical scheduling strategy from long-term to short-term, so as to cope with changes in power demand at different time scales.
[0038] According to the second aspect of the present application, the present application also provides a computer device, which includes a processor and a memory, wherein the memory stores a computer program, and the computer program is loaded and executed by the processor to implement any of the above-mentioned methods for formulating energy storage charging and discharging strategies based on multi-factor prediction.
[0039] According to the third aspect of the present application, the present application also provides a computer-readable storage medium, in which a computer program is stored, and the computer program is loaded and executed by a processor to implement any of the above-mentioned methods for formulating energy storage charging and discharging strategies based on multi-factor prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 It is a schematic diagram of the process of this application; Figure 2 Is a logical relationship diagram in the embodiment of the present application; Figure 3 is a schematic diagram of the control time domain of an embodiment of the present invention; Figure 4 Schematic diagram of the electricity consumption prediction model in an embodiment of the present invention. DETAILED DESCRIPTION
[0041] In order to make the purpose and features of the present application more obvious and easy to understand, the present technical solution is described in detail below through embodiments and in conjunction with the accompanying drawings.
[0042] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments.
[0043] Embodiment 1: like Figure 1 The process and Figure 2 As shown in the logic in, the embodiment of the present application provides a method for formulating energy storage charging and discharging strategies based on multi-factor prediction, and the specific implementation steps are as follows: S1, collects data related to energy storage charging and discharging.
[0044] Optionally, the energy storage charging and discharging related information includes production plans, electricity load, climate conditions, electricity prices, scheduling conditions, etc.
[0045] S2, judging whether the current energy storage charging and discharging strategy needs to be changed based on the collected data of energy storage charging and discharging related information.
[0046] The specific judgment conditions are: A threshold value of energy storage charging and discharging related information is set, and it is judged whether the data collected from the energy storage charging and discharging related information exceeds the threshold value. If the threshold value is exceeded, the current energy storage charging and discharging strategy is changed; otherwise, the current energy storage charging and discharging strategy is not changed.
[0047] For example: setting a monitoring threshold, when the production plan changes by more than a certain percentage, trigger the change of the current energy storage charging and discharging strategy; setting a threshold for electricity price changes, when the electricity price policy changes significantly, trigger the change of the current energy storage charging and discharging strategy.
[0048] S3, establishing a power consumption prediction model based on the data collected on the energy storage charging and discharging related information, and using the established power consumption prediction model to predict the future comprehensive power consumption data to obtain the future comprehensive power consumption data.
[0049] The electricity consumption forecasting model includes production load forecasting model, life load forecasting model and distributed photovoltaic forecasting model.
[0050] In the specific implementation process, the production load prediction model is constructed by linear regression, the life load prediction model is constructed by random forest regression, and the distributed photovoltaic prediction model is constructed by ANN.
[0051] 301, use linear regression to build a production load prediction model. Specifically, use linear regression to perform category prediction on production load data, and the categories include: normal production and abnormal production.
[0052] In the specific implementation process, normal production refers to the normal operation of production equipment, and abnormal production refers to equipment failure, order fluctuations or supply chain disruptions.
[0053] 304, using random forest regression to build a life load prediction model. Specifically, using random forest regression to perform category prediction on life load data, the categories include: typical working days and special days.
[0054] Life load forecasting model Figure 4 shown.
[0055] In the specific implementation process, a typical working day refers to a non-holiday and normal weather situation, and a special day refers to a holiday or extreme weather situation.
[0056] 305, using ANN to construct a distributed photovoltaic prediction model, specifically, using ANN-1 and ANN-2 to form a weather category prediction model for sunny and cloudy days, the weather categories including: sunny and cloudy.
[0057] In this embodiment, ANN refers to artificial neural network.
[0058] It should be pointed out that the production load forecast is affected by the production plan data, and the life load forecast model and distributed photovoltaic forecast model are affected by seasonal weather.
[0059] The present invention proposes to establish a future electricity consumption forecasting model by integrating a production load forecasting model, a life load forecasting model and a distributed photovoltaic forecasting model, which can not only more comprehensively reflect the actual situation of the power system, thereby improving the accuracy of future electricity consumption forecasts; it can also adapt to changes in different types of electricity loads, conduct future electricity consumption forecasts for complex and changeable electricity loads, and improve the accuracy and flexibility of future electricity consumption forecasts.
[0060] In specific implementation, when there is a lack of a specific forecasting model, the forecast data can be replaced by historical typical electricity consumption data, especially for short-term or temporary planned electricity consumption forecasts.
[0061] S4, optimizing the future comprehensive electricity consumption data according to the constrained electricity load.
[0062] S401, classify the power load and add constraints to the classified power load.
[0063] Specifically, the constraints include adjustable power load power constraints, power load transfer constraints, power load transfer upper limit constraints, total power load adjustment constraints, power load power balance constraints and power load cost-benefit constraints.
[0064] Among them, the adjustable power load power constraint includes adjustable power load power constraint one and adjustable power load power constraint two.
[0065] Among them, the formula for the adjustable power load power constraint 1 is: In the formula, t is the time information, m is the level of adjustable power load power, is the adjustable power load power of the mth level at time t, is the maximum adjustable proportion of the mth level adjustable power load in the total power, is the total load power at time t.
[0066] Setting the mth level of adjustable load is to perform corresponding processing and scheduling according to the adjustable level.
[0067] The set adjustable level is determined based on the adjustable urgency, impact on system performance, execution time requirements, etc.
[0068] The larger the value of m is, the greater the impact on system operation stability.
[0069] The formula for the second adjustable power load power constraint is: In the formula, is the power of the mth level adjustable user load at time t, is the preset target threshold of the total power load of the system at the current moment, is the total load power at time t.
[0070] Optionally, The value is set to 5%.
[0071] The power load transfer constraints include the power load transfer upper limit constraints and the power load transferability constraints.
[0072] The formula for the transferability constraint of power load is: In the formula, is the load that can be transferred outwards theoretically at time t, It is the load amount that can be transferred from the outside at time t in theory.
[0073] This constraint is to prevent double transfer, that is, there is no situation where the load is transferred outward and inward at the same time. For example, during peak hours, the energy storage device can only discharge outward and cannot be charged from the outside; and during off-peak hours: the energy storage device can only be charged from the outside and cannot be discharged.
[0074] The formula for the upper limit constraint of power load transfer is: In the formula, is the load that can actually be transferred outward at time t. is the load amount of electricity actually transferred from the outside at time t, is the load that can be transferred outwards theoretically at time t, is the load of the power load theoretically transferred from the actual external environment at time t, is the total load of the electrical load at time t, is the transfer upper limit coefficient.
[0075] The formula for the total power load constraint before and after regulation is: Where C is the total power load, To calculate the sum, The load that can actually be transferred outward is the load amount of the power load. In order to actually receive the load of the electricity load transferred from the outside, Calculate for minimum value.
[0076] The power balance constraint of the electric load is as follows: In the formula, sum(PIL(m,t)) represents the total load of the adjustable power load at time t, Pmgb(t) is the total power consumption of the adjustable power load at time t, is the load that can actually be transferred outward at time t. is the load amount of electricity actually transferred from the outside at time t, is the total load of the electrical load at time t.
[0077] The electricity load cost-benefit constraints include the total electricity load transfer costs and the electricity load compensation costs.
[0078] The calculation formula for the total transfer cost of electricity load is: Where Cshift(t) is the total transfer cost of electricity load at time t, is the load that can actually be transferred outward at time t. is the load actually received from the outside at time t, A is the cost weight of transferring the load to the outside, and B is the cost weight of receiving the transferred load from the outside.
[0079] The calculation formula for electricity load compensation fee is: In the formula, To compensate for the electricity load, As the basic electricity cost, is the adjustment factor, For the electrical load.
[0080] S402, optimizing the future comprehensive power consumption data according to the power load dispatching plan and the power load constraints to obtain the optimized future comprehensive power consumption data, specifically comprising the steps of: A1, set the objective function of future comprehensive electricity consumption data.
[0081] Specifically, the objective function of the future comprehensive electricity consumption data includes minimizing the total electricity cost and maximizing the load utilization.
[0082] Among them, the calculation formula for minimizing the total electricity cost is: In the formula, To minimize the total electricity cost, (t) is the electricity price at time t, is the load that can actually be transferred outward at time t. is the load amount of electricity actually transferred from the outside at time t, , sum represents sum calculation.
[0083] The calculation formula for maximizing load utilization is: In the formula, To maximize load utilization, is the load that can actually be transferred outward at time t. is the load amount of electricity actually transferred from the outside at time t, is the power of the mth level adjustable user load at time t, sum represents the summation calculation, and C is the total power load.
[0084] A2, taking the power load constraint as the feasible domain of the objective function of future comprehensive power consumption data.
[0085] A3, using a linear programming solver, solves the objective function of the future comprehensive electricity consumption data.
[0086] Optionally, the linear programming solver includes a library such as Gurobi, CPLEX, or Python's SciPy.
[0087] A4, based on the solution results of the future comprehensive electricity consumption data, the optimized future comprehensive electricity consumption data is obtained.
[0088] Specifically, the optimized future comprehensive electricity consumption data includes the optimized total load power, the optimized local load power and the optimized external load power.
[0089] Among them, the formula of the optimized total load power is: Poptim(t) = - SHIFTL(t) + SHIFTQ(t) - sum(PIL(m,t)) Where Poptim(t) is the total load power after optimization, is the load that can actually be transferred outward at time t. is the load amount of electricity actually transferred from the outside at time t, is the power of the mth level adjustable user load at time t, and sum represents the summation calculation. is the total load of the electrical load at time t.
[0090] The formula for the optimized local load power is: Plocal(t) = - SHIFTL(t) Where Plocal(t) is the optimized local load power, is the total load of the electrical load at time t, It is the load amount of the power load that can actually be transferred outward at time t.
[0091] The formula for the optimized external load power is: Pexternal(t)=SHIFTQ(t) Where Pexternal(t) is the optimized external load power, which is the load actually transferred from the outside at time t.
[0092] S5, establish a day-ahead dispatch prediction model and an intraday dispatch optimization model, and formulate a dispatch strategy for future power load based on the optimized future comprehensive power consumption data.
[0093] S501, constructing a day-ahead scheduling prediction model and an intra-day scheduling optimization model. Specifically, both the day-ahead scheduling prediction model and the day-ahead scheduling prediction model adopt an upper and lower two-layer structure to respectively manage power fluctuations of different scheduling durations.
[0094] Among them, the upper layer is mainly used to smooth out the fluctuations in cold and hot energy power with longer scheduling time. Its control time domain is 1 hour and the scheduling time window is 2 hours. The lower layer is used to smooth out the fluctuations in electric energy power with shorter scheduling time. Its control time domain is 5 minutes and the scheduling time window is 1 hour.
[0095] Specific as Figure 3 As shown in the figure, at time t0, the system will predict the data of cold and hot energy in the period from t0+1 to t0+3, and adjust the planned output value of each cogeneration equipment in the period from t0+1 to t0+2 accordingly. At the same time, the system will also predict the data of electric energy in the period from t0+N to t0+1+N, and dispatch equipment to smooth the system power fluctuation in the period from t0+N to t0+2N.
[0096] Due to the difference in scheduling time windows, the scheduling of cold and hot energy will be carried out before the scheduling of electric energy, so that the scheduling of electric energy and the scheduling of cold and hot energy can be carried out separately.
[0097] S502, calculating the power consumption in the future peak period and the future peak period according to the peak period power consumption and the peak period power consumption in the optimized future comprehensive power consumption data.
[0098] The calculation formula for future peak-hour electricity consumption is: In the formula, For future peak electricity consumption, is the load power at time t during the future peak period, and For future peak electricity consumption periods.
[0099] The calculation formula for peak power consumption is: In the formula, For future peak hours, is the load power at time t during the future peak period, and For future peak electricity consumption periods.
[0100] S503, the day-ahead dispatch prediction model generates a day-ahead dispatch reference value, and the day-ahead dispatch reference value, the future peak period and the future peak period electricity consumption are input into the intraday dispatch optimization model to obtain the future electricity consumption energy storage charging and discharging dispatch strategy.
[0101] The specific steps include: B1, using the day-ahead scheduling prediction model, which is usually based on historical data and weather forecast information, and the time scale is set to ≥ 24 hours; B2, the forecast data is sent to the dispatch center, which starts the start-stop plan and the call plan and outputs the day-ahead dispatch plan; B3, uses an intraday short-time-scale rolling optimization model that is able to process data on shorter time scales.
[0102] Among them, the time scale is set to be ≥4 hours; the day-ahead scheduling prediction model outputs the day-ahead scheduling plan and provides it to the intraday short-time scale rolling optimization model.
[0103] B4, sends the short-term forecast data to the dispatch center, which starts the start-stop plan and the call plan and outputs the intraday dispatch plan.
[0104] B5, uses the intraday short-time-scale rolling optimization model, takes the intraday scheduling plan as the initial data, and makes real-time adjustments.
[0105] Among them, the time scale is set to ≥15min.
[0106] In an optional implementation, day-ahead scheduling includes reading the data from the previous day at 00:00 every day, making a 24-hour forecast and scheduling, and saving the results; intraday scheduling includes reading the current data at 00:00 every 4 hours, making a 4-hour forecast and scheduling, and saving the results; real-time scheduling includes reading the current data at every 15 minutes, making a 15-minute forecast and scheduling, and saving the results.
[0107] The contradiction between supply and demand in the power system is a long-standing problem. Through accurate power load forecasting and the formulation of reasonable scheduling strategies, the power supply and demand can be better balanced, and the power shortage or waste caused by the contradiction between supply and demand can be reduced. The present invention proposes to establish a day-ahead scheduling prediction model and an intraday scheduling optimization model, and formulate a scheduling strategy for future power loads based on the optimized future comprehensive power consumption data. According to the method proposed in the present invention, the day-ahead scheduling prediction model and the intraday scheduling optimization model of the upper and lower layers respectively manage power fluctuations of different scheduling durations, which can not only quickly respond to load changes in a short period of time and improve the flexibility and real-time performance of load scheduling, but also the day-ahead scheduling prediction model and the intraday scheduling optimization model can cooperate with each other to form a hierarchical scheduling strategy from long-term to short-term, so as to cope with changes in power demand at different time scales.
[0108] The embodiment of the present application also provides a computer device, which can implement the steps in any embodiment of the method for formulating energy storage charging and discharging strategies based on multi-factor prediction provided in the embodiment of the present application. Therefore, the embodiment of the present application can achieve the beneficial effects of the method for formulating energy storage charging and discharging strategies based on multi-factor prediction provided in the embodiment of the present application, which is detailed in the previous embodiment and will not be repeated here.
[0109] Those skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments can be completed by instructions, or by controlling related hardware through instructions, and the instructions can be stored in a computer-readable storage medium and loaded and executed by a processor. To this end, an embodiment of the present application also provides a storage medium storing computer instructions, which can be loaded by a processor to execute the steps of any embodiment of a method for formulating a storage charging and discharging strategy based on multi-factor prediction provided in an embodiment of the present application.
[0110] The storage medium may include: a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc. Since the instructions stored in the storage medium can execute the steps in the solution method embodiment of any distributed collaborative scheduling scheme for a heat storage system provided in the embodiment of the present application, the embodiment of the present application can achieve the beneficial effects that can be achieved by any method for formulating a storage charging and discharging strategy based on multi-factor prediction provided in the embodiment of the present application. For details, please refer to the previous embodiment, which will not be repeated here.
[0111] Embodiment 2: In this embodiment, Python is used as the programming language, and the construction code of the linear regression model is as follows: import pandas as pd import numpy as np from sklearn.linear_model import LinearRegression def production_load_forecast(production_plan): # Read production plan data df = pd.read_csv('production_plan.csv') # Features and target variables X = df[['production_plan']] y = df['production_load'] # Train the linear regression model model = LinearRegression() model.fit(X, y) # Forecasting production load forecast = model.predict(production_plan) return forecast Embodiment 3: In this embodiment, Python is used as the programming language, and the construction code of the random forest regression model is as follows: from sklearn.ensemble import RandomForestRegressor def living_load_forecast(season, weather): # Read life load data df = pd.read_csv('living_load_data.csv') # Features and target variables X = df[['season', 'weather']] y = df['living_load'] # Train a random forest regression model model = RandomForestRegressor(n_estimators=100, random_state=42) model.fit(X, y) # Forecasting life load forecast = model.predict(np.array([season, weather]).reshape(1, -1)) return forecast Embodiment 4: In this embodiment, Python is used as the programming language, and the construction code of ANN is as follows: import tensorflow as tf from tensorflow.keras.models import Sequential from tensorflow.keras.layers import Dense def train_ann_model(weather_data, load_data, model_type): # Create ANN model model = Sequential() model.add(Dense(128, input_dim=weather_data.shape[1], activation='relu')) model.add(Dense(64, activation='relu')) model.add(Dense(1)) # Compile the model model.compile(optimizer='adam', loss='mean_squared_error') # Train the model model.fit(weather_data, load_data, epochs=50, batch_size=32,validation_split=0.2) # Save the model model.save(f'ann_{model_type}.h5') return model def load_ann_model(model_type): return tf.keras.models.load_model(f'ann_{model_type}.h5') def solar_pv_forecast(weather_forecast): # Read weather forecast data df = pd.read_csv('weather_forecast.csv') # Scenario Classification if df['weather'].iloc[0]== 'Sunny': model_type = 'sunny' elif df['weather'].iloc[0]== 'Cloudy': model_type = 'cloudy' else: raise ValueError("Unknown weather conditions") # Load the corresponding ANN model model = load_ann_model(model_type) # Predict PV load forecast = model.predict(df[['temperature', 'humidity']]) return forecast Embodiment 5: In this embodiment, Python is used as the programming language, and the construction code of the day-ahead scheduling prediction model is as follows: import pandas as pd import numpy as np from sklearn.preprocessing import MinMaxScaler # Load data data = pd.read_csv("load_data.csv") load_values = data['load'].values # Assume that the load data is in the 'load' column # Normalization scaler = MinMaxScaler() normalized_load = scaler.fit_transform(load_values.reshape(-1, 1)) # Build training data (for example, use the load of the previous 24 hours to predict the load of the next hour) def create_sequences(data, seq_length): X, y = [], [] for i in range(len(data) - seq_length): X.append(data[i:i+seq_length]) y.append(data[i+seq_length]) return np.array(X), np.array(y) seq_length = 24 # Use the load of the previous 24 hours to predict the load of the next hour X, y = create_sequences(normalized_load, seq_length) # Divide into training set and test set train_size = int(len(X) * 0.8) X_train, X_test = X[:train_size], X[train_size:] y_train, y_test = y[:train_size], y[train_size:] from tensorflow.keras.models import Sequential from tensorflow.keras.layers import Dense, LSTM, Dropout def build_generator(input_dim): model = Sequential() model.add(LSTM(50, input_shape=(input_dim, 1), return_sequences=True)) model.add(Dropout(0.2)) model.add(LSTM(50, return_sequences=False)) model.add(Dropout(0.2)) model.add(Dense(1, activation='tanh')) # Output the normalized load value return model generator = build_generator(seq_length) generator.summary() from tensorflow.keras.models import Sequential from tensorflow.keras.layers import Dense, LSTM, Dropout def build_generator(input_dim): model = Sequential() model.add(LSTM(50, input_shape=(input_dim, 1), return_sequences=True)) model.add(Dropout(0.2)) model.add(LSTM(50, return_sequences=False)) model.add(Dropout(0.2)) model.add(Dense(1, activation='tanh')) # Output the normalized load value return model def build_discriminator(input_dim): model = Sequential() model.add(LSTM(50, input_shape=(input_dim, 1), return_sequences=True)) model.add(Dropout(0.2)) model.add(LSTM(50, return_sequences=False)) model.add(Dropout(0.2)) model.add(Dense(1, activation='sigmoid')) # Output probability return model discriminator = build_discriminator(seq_length) discriminator.summary() from tensorflow.keras.optimizers import Adam # Compile the discriminator discriminator.compile(optimizer=Adam(learning_rate=0.0002), loss='binary_crossentropy', metrics=['accuracy']) # Freeze the weights of the discriminator discriminator.trainable = False # Build the GAN model gan_input = tf.keras.Input(shape=(seq_length, 1)) gan_output = discriminator(generator(gan_input)) gan = tf.keras.Model(gan_input, gan_output) # Compile the GAN gan.compile(optimizer=Adam(learning_rate=0.0002), loss='binary_crossentropy') gan.summary() def train_gan(generator, discriminator, gan, data, epochs=10000,batch_size=128, save_interval=1000): half_batch = int(batch_size / 2) for epoch in range(epochs): # Generate real samples idx = np.random.randint(0, data.shape[0], half_batch) real_samples = data.iloc[idx] # Generate fake samples noise = np.random.normal(0, 1, (half_batch, 100)) fake_samples = generator.predict(noise) # Train the discriminator d_loss_real = discriminator.train_on_batch(real_samples,np.ones((half_batch, 1))) d_loss_fake = discriminator.train_on_batch(fake_samples,np.zeros((half_batch, 1))) d_loss = 0.5 * np.add(d_loss_real, d_loss_fake) # Generate noise for training generator noise = np.random.normal(0, 1, (batch_size, 100)) # Training the generator valid_y = np.array([1] * batch_size) g_loss = gan.train_on_batch(noise, valid_y) # Print progress if epoch % save_interval == 0: print(f"{epoch} [D loss: {d_loss[0]}, acc.: {100*d_loss[1]}] [G loss: {g_loss}]") import tensorflow as tf # Training parameters epochs = 100 batch_size = 32 # Training loop for epoch in range(epochs): # 1. Training the discriminator idx = np.random.randint(0, X_train.shape[0], batch_size) real_samples = X_train[idx] real_labels = y_train[idx] # Generate fake samples noise_input = np.random.normal(0, 1, (batch_size, seq_length, 1)) fake_labels = generator.predict(real_samples) # Generate load using generator # Train the discriminator d_loss_real = discriminator.train_on_batch(np.hstack((real_samples, real_labels.reshape(-1, 1, 1))), np.ones((batch_size, 1))) d_loss_fake = discriminator.train_on_batch(np.hstack((real_samples, fake_labels.reshape(-1, 1, 1))), np.zeros((batch_size, 1))) d_loss = 0.5 * np.add(d_loss_real, d_loss_fake) # 2. Training the generator noise_input = np.random.normal(0, 1, (batch_size, seq_length, 1)) g_loss = gan.train_on_batch(real_samples, np.ones((batch_size,1))) # Print training progress print(f"Epoch {epoch+1} / {epochs} | D loss: {d_loss[0]:.4f}, Daccuracy: {d_loss[1]:.4f} | G loss: {g_loss:.4f}") It should be noted that the serial numbers of the embodiments of the present application are only for description and do not represent the advantages and disadvantages of the embodiments. And the terms "including", "comprising" or any other variants thereof herein are intended to cover non-exclusive inclusion, so that the process, device, article or method including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, device, article or method. In the absence of further restrictions, the elements defined by the sentence "including one..." do not exclude the presence of other identical elements in the process, device, article or method including the element.
[0112] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0113] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A method for formulating energy storage charging and discharging strategies based on multi-factor prediction, characterized in that: Includes steps: S1, collects data related to energy storage charging and discharging; S2, judging whether the current energy storage charging and discharging strategy needs to be adjusted based on the collected data on energy storage charging and discharging related information; S3, constructing a power consumption prediction model based on the data related to energy storage charging and discharging, and using the power consumption prediction model to perform category prediction on future comprehensive power consumption data to obtain future comprehensive power consumption data, specifically including the following steps: 301, using linear regression to build a production load prediction model, specifically, using linear regression to perform category prediction on production load data, the categories include: normal production and abnormal production; 302, using random forest regression to build a life load prediction model, specifically, using random forest regression to perform category prediction on life load data, the categories including: typical working days and special days; 303, using ANN to construct a distributed photovoltaic prediction model, specifically, using ANN-1 and ANN-2 to form a weather category prediction model for sunny and cloudy days, the weather categories including: sunny and cloudy days; S4, optimizing the future comprehensive power consumption data according to the constrained power load; S5, establish a day-ahead dispatch prediction model and an intraday dispatch optimization model, and formulate a dispatch strategy for future power load based on the optimized future comprehensive power consumption data.
2. The method for formulating energy storage charging and discharging strategies by multi-factor prediction according to claim 1 is characterized in that: S2 determines whether the current energy storage charging and discharging strategy needs to be changed. The specific judgment conditions are: Set the threshold of energy storage charging and discharging related information, and judge whether the deviation of the collected energy storage charging and discharging related information and the day-ahead reference value exceeds the threshold. If any data exceeds the preset threshold, it triggers the change of the current energy storage charging and discharging strategy; if all data are within the threshold range, the current strategy remains unchanged.
3. The method for formulating energy storage charging and discharging strategies by multi-factor prediction according to claim 1 is characterized in that: S4 includes the steps: S401, classifying the power load and adding constraints to the classified power load; S402, optimizing the future comprehensive power consumption data according to the power load dispatching plan and the power load constraints to obtain optimized future comprehensive power consumption data.
4. The method for formulating energy storage charging and discharging strategies by multi-factor prediction according to claim 3 is characterized in that: S402 includes the steps of: A1, setting the objective function of future comprehensive electricity consumption data; A2, taking the power load constraint as the feasible domain of the objective function of future comprehensive power consumption data; A3, using a linear programming solver, solves the objective function of future comprehensive electricity consumption data; A4, based on the solution results of the future comprehensive electricity consumption data, the optimized future comprehensive electricity consumption data is obtained.
5. The method for formulating energy storage charging and discharging strategies by multi-factor prediction according to claim 1 is characterized in that: S5 includes the steps of: S501, constructing a day-ahead scheduling prediction model and an intra-day scheduling optimization model. Specifically, both the day-ahead scheduling prediction model and the day-ahead scheduling prediction model adopt an upper and lower two-layer structure to respectively manage power fluctuations of different scheduling durations; S502, calculating the power consumption in the future peak period and the future peak period according to the peak period power consumption and the peak period power consumption in the optimized future comprehensive power consumption data; S503, the day-ahead dispatch prediction model generates a day-ahead dispatch reference value, and the day-ahead dispatch reference value, the future peak period and the future peak period electricity consumption are input into the intraday dispatch optimization model to obtain the future electricity consumption energy storage charging and discharging dispatch strategy.
6. The method for formulating energy storage charging and discharging strategies by multi-factor prediction according to claim 5 is characterized in that: The calculation formula for the future peak period electricity consumption is: In the formula, For future peak electricity consumption, is the load power at time t during the future peak period, and For future peak electricity consumption periods; The calculation formula for the peak period power consumption is: In the formula, For future peak hours, is the load power at time t during the future peak period, and For future peak electricity consumption periods.
7. The method for formulating energy storage charging and discharging strategies by multi-factor prediction according to claim 5 is characterized in that: S503 includes the steps of: B1, using the day-ahead scheduling prediction model, which is based on historical data and weather forecast information, and the time scale is set to ≥ 24 hours; B2, the forecast data is sent to the dispatch center, which starts the start-stop plan and the call plan and outputs the day-ahead dispatch plan; B3, using a rolling optimization model on a short intraday time scale; B4, sending the short-term forecast data to the dispatch center, which starts the start-stop plan and the call plan and outputs the intraday dispatch plan; B5, uses the intraday short-time-scale rolling optimization model, takes the intraday scheduling plan as the initial data, and makes real-time adjustments.
8. A computer device, characterized in that: The computer device includes a processor and a memory, wherein a computer program is stored in the memory, and the computer program is loaded and executed by the processor to implement the method for formulating energy storage charging and discharging strategies by multi-factor prediction as described in any one of claims 1-7.
9. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, which is loaded and executed by a processor to implement the method for formulating energy storage charging and discharging strategies through multi-factor prediction as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Park-level multi-energy complementary system optimization scheduling method and device
CN113255992A
Multi-time-scale hierarchical scheduling method for cogeneration system containing electric vehicle
CN115204673A
Multi-time scale stochastic optimization method and device for photovoltaic charging station containing energy storage system
CN116151486A
Photovoltaic and load prediction-based optical storage micro-grid scheduling operation method and device, and medium
CN118508425A