Virtual power plant baseline load measuring and calculating method based on multi-dimensional factors
By using the LSTM model to predict baseline load in a virtual power plant and optimizing model parameters using the Sparrow Xunyou algorithm, the problem of difficulty in taking into account efficiency and accuracy in baseline load calculation is solved, and efficient and accurate baseline load calculation is achieved.
Patent Information
- Application Number
- CN202411770413.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-04
- Publication Date
- 2025-03-18
AI Technical Summary
The prior art is difficult to ensure both calculation efficiency and calculation accuracy in baseline load calculation, and the selection of network parameters of deep learning models is very random and complex.
The baseline load calculation method of virtual power plant based on multi-dimensional factors is used to predict baseline load through the LSTM model, and during the model training process, the Sparrow Optimization algorithm is used to optimize parameters to set the LSTM network parameters efficiently and accurately.
It improves the accuracy and efficiency of baseline load calculation, solves the problems of high randomness and complex selection of network parameters in deep learning models, and ensures the accuracy and efficiency of baseline load calculation.
Smart Images

Figure CN119647685A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of power grid dispatching, and in particular to a method for calculating baseline load of a virtual power plant based on multi-dimensional factors. Background Art
[0002] In the demand-side management of virtual power plants, the response potential measurement of user-side flexible resources is a key component for achieving efficient scheduling and optimization. Demand response, as an important means of regulation in addition to the supply-side dispatching resources to adjust the supply and demand balance, can start from the demand side and encourage users to change or adjust their electricity consumption patterns by adjusting electricity prices or incentives, so as to achieve the purpose of load reduction or transfer, thereby promoting the balance of supply and demand in the power system. The baseline load, as the basis for evaluating the response capability of user-side flexible resources, is an important supporting data to ensure the fairness of both parties involved in demand response and improve the satisfaction of both parties involved in demand response. The accuracy of baseline load calculation directly affects the execution effect of demand response.
[0003] At present, the average method is mainly used to estimate the baseline load, but this method has low precision and often only considers the load data, ignoring the impact of meteorological factors such as weather on the load data in the actual process, resulting in inaccurate measurement results and unable to effectively support the refined scheduling of virtual power plants and the optimal use of flexible resources. With the development of artificial intelligence, deep learning methods are gradually used to replace the average method to predict baseline load. Compared with the average method, deep learning algorithms can effectively improve the accuracy of baseline load measurement, but in the application process, they face the problems of large randomness and complex selection of network parameters of deep learning models, and low measurement efficiency. Summary of the invention
[0004] The purpose of the present invention is to overcome the shortcomings of the prior art in the measurement of baseline load, which cannot guarantee both the measurement efficiency and the measurement accuracy. A method for measuring the baseline load of a virtual power plant based on multidimensional factors is provided, in which the baseline load is predicted by an LSTM model, and in the process of model training, the sparrow optimization algorithm is used to perform parameter optimization so as to efficiently and accurately set the LSTM network parameters, thereby improving the accuracy of the baseline load measurement and solving the problems of large randomness and complex selection of LSTM network parameters, thereby ensuring the measurement efficiency.
[0005] The purpose of the present invention is achieved through the following technical solutions:
[0006] The virtual power plant baseline load calculation method based on multi-dimensional factors includes:
[0007] Screening load forecasting related factors based on historical demand response information, and determining the degree of correlation between each load forecasting related factor and load demand;
[0008] The weight coefficient of each load forecast correlation factor is set based on the correlation degree, and the forecast training data set is constructed according to the corresponding weight coefficient;
[0009] Build an LSTM model, train it by predicting the training data set, and optimize the model parameters by using the sparrow optimization algorithm to obtain a baseline load measurement model;
[0010] The baseline load of the virtual power plant during the target time period is calculated based on the baseline load measurement model.
[0011] The baseline load forecast is carried out through the LSTM model, and during the model training process, the sparrow optimization algorithm is used to optimize the parameters to efficiently and accurately set the LSTM network parameters. That is, the deep learning algorithm is used to improve the accuracy of baseline load calculation, and the problem of large randomness and complex selection of network parameters in the deep learning model is solved, which improves the efficiency of baseline load calculation and can simultaneously ensure the accuracy and efficiency of baseline load calculation. And based on the historical data in the demand response scenario, the corresponding load forecast correlation factors are obtained to set the data set for training the LSTM model to ensure the accuracy of the constructed prediction model for the baseline load in the demand response scenario. At the same time, when setting the data set, the weight coefficient of each load forecast correlation factor in the data set is set according to the degree of correlation between the load forecast correlation factor and the load demand, so as to further improve the efficiency of subsequent model training and parameter optimization.
[0012] Furthermore, the step of screening load forecasting related factors based on historical demand response information and determining the degree of correlation between each load forecasting related factor and load demand includes:
[0013] Obtain the execution time point of each demand response according to the historical demand response information, and set the data extraction time period according to the execution time point;
[0014] Obtain historical load information and historical weather information within the data extraction period, cluster the historical load information and historical weather information, and select load forecasting related factors according to the clustering results;
[0015] The Pearson correlation coefficient between each load forecast correlation factor and the load demand is calculated respectively to obtain the correlation degree between each load forecast correlation factor and the load demand.
[0016] Taking into account the impact of weather factors on load data, when screening load forecast-related factors, weather is also taken into consideration as a dimension of baseline load calculation. Starting from multiple dimensions, multi-dimensional load forecast-related factors are set to ensure the accuracy of baseline load calculation.
[0017] Furthermore, the weight coefficient of each load forecast correlation factor is set based on the correlation degree, and a forecast training data set is constructed according to the corresponding weight coefficient, including:
[0018] Classify the load forecasting related factors according to the Pearson correlation coefficient between each load forecasting related factor and the load demand;
[0019] Calculate the average absolute value of the Pearson correlation coefficient corresponding to the load forecast correlation factors in each category, and determine the correlation level of each category based on the average calculation result;
[0020] Based on the number of load forecasting related factors contained in each category and the corresponding correlation level, a weight coefficient of each load forecasting related factor is assigned;
[0021] According to the corresponding weight coefficients, a prediction training data set is constructed.
[0022] Furthermore, constructing a prediction training data set according to corresponding weight coefficients includes:
[0023] Based on the factors associated with load forecasting, the original data set is constructed;
[0024] According to the corresponding weight coefficient, the sampling probability of the data sample corresponding to each load forecast associated factor in the original data set is calculated;
[0025] Based on the calculated sampling probability, a prediction training data set is generated according to the original data set.
[0026] Furthermore, the method of optimizing the model parameters by using the sparrow optimization algorithm to obtain the baseline load measurement model includes:
[0027] The number of unit layers, learning rate and iterations of the LSTM network are optimized, and the parameters of the sparrow optimization algorithm are set and initialized.
[0028] Calculate the fitness value of each sparrow individual in the population, and divide the population into discoverers and joiners according to the fitness value;
[0029] Update the location of the discoverer and the location of the joiner;
[0030] Determine whether the current iteration reaches the preset iteration end condition;
[0031] If the preset iteration end condition is reached, the optimal solution of the current sparrow optimization algorithm is used as the hyperparameter of the LSTM network to obtain the baseline load measurement model;
[0032] If the preset iteration end condition is not met, the next iteration of the sparrow optimization algorithm is performed until the preset iteration end condition is met.
[0033] Furthermore, the step of optimizing the model parameters by using the sparrow optimization algorithm to obtain the baseline load measurement model further includes:
[0034] When updating the positions of the discoverer and joiner, the fitness values of the alert individuals in the sparrow population and the current iteration number are also obtained;
[0035] Based on the fitness value of the alert individual and the current number of iterations, determine whether to trigger the position update condition of the alert individual;
[0036] When the position update condition is triggered, the position of the alert individual is updated according to the anti-predator behavior formula.
[0037] Furthermore, the anti-predator behavior formula is expressed as:
[0038]
[0039] Where t is the current iteration number, is the position information of the I-th alert individual in the J-th dimension space in the t+1 iteration, is the global optimal position of the tth iteration, β is the step size control parameter, is the position information of the I-th alert individual in the J-th dimension space in the t-th iteration, is the global worst position of the tth iteration, ε is a constant to avoid division by zero, and f I is the fitness value of the Ith alert individual, f g is the fitness value of the sparrow individual corresponding to the global optimal position, f w is the fitness value of the sparrow individual corresponding to the global worst position.
[0040] Furthermore, the calculating of the baseline load of the virtual power plant in the target time period according to the baseline load calculation model includes:
[0041] Input the current load information and corresponding weather information of the virtual power plant into the baseline load calculation model to obtain the baseline load forecast curve of the virtual power plant;
[0042] Obtain a demand response strategy and obtain a demand response execution duration period;
[0043] The demand response execution duration period is taken as the target time period, and the corresponding baseline load is intercepted from the baseline load forecast curve.
[0044] Furthermore, the calculating the baseline load of the virtual power plant in the target time period according to the baseline load calculation model also includes:
[0045] Acquire the baseline load before the target time period in real time, and compare the baseline load acquired in real time with the baseline load prediction curve;
[0046] According to the comparison results, a baseline load fluctuation node is selected, and the weather information and load information corresponding to the baseline load reset node are used to randomly replace the data samples in the prediction training data set, and the baseline load estimation model is retrained;
[0047] The baseline load prediction curve is re-output based on the retrained baseline load measurement model to obtain the baseline load of the virtual power plant within the target time period.
[0048] In order to further ensure the accuracy of baseline load calculation, the baseline load calculation model is feedback-adjusted based on the actual baseline load.
[0049] The beneficial effects of the present invention are:
[0050] (1) The baseline load is predicted by the LSTM model, and during the model training process, the sparrow optimization algorithm is used to optimize the parameters to efficiently and accurately set the LSTM network parameters. That is, the deep learning algorithm is used to improve the accuracy of baseline load calculation, and the problem of large randomness and complex selection of network parameters in the deep learning model is solved, which improves the efficiency of baseline load calculation and can simultaneously ensure the accuracy and efficiency of baseline load calculation. Based on the historical data in the demand response scenario, the corresponding load forecast correlation factors are obtained to set the data set for training the LSTM model to ensure the accuracy of the constructed prediction model for the baseline load in the demand response scenario. When setting the data set, the weight coefficient of each load forecast correlation factor in the data set is set according to the degree of correlation between the load forecast correlation factor and the load demand, so as to further improve the efficiency of subsequent model training and parameter optimization.
[0051] (2) Taking into account the impact of weather factors on load data, when screening load forecast related factors, weather is also taken into consideration as a dimension of baseline load calculation. Starting from multiple dimensions, multi-dimensional load forecast related factors are set to ensure the accuracy of baseline load calculation.
[0052] (3) Feedback adjustment is performed on the baseline load calculation model based on the actual baseline load to further ensure the accuracy of baseline load calculation. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] Figure 1 is a schematic diagram of a relationship curve between a baseline load and a load reduction amount in a demand response scenario according to an embodiment of the present invention;
[0054] Figure 2 is a schematic diagram of a flow chart of an embodiment of the present invention;
[0055] Figure 3 Schematic diagram of the network structure of an LSTM model according to an embodiment of the present invention;
[0056] Figure 4This is a LSTM model test and error diagram of an embodiment of the present invention;
[0057] Figure 5 It is a parameter-optimized SSA-LSTM model test and error diagram of an embodiment of the present invention. DETAILED DESCRIPTION
[0058] The present invention is further described below in conjunction with the accompanying drawings and embodiments.
[0059] Example:
[0060] When carrying out demand-side load regulation, load change is one of the important indicators for evaluating the effect of demand response. Load reduction can directly reflect the actual response degree of users after receiving the demand response signal, as well as the effect of users on the load peak relief of the power system. It plays an important role in measuring the user response degree, evaluating the effect of demand response and motivating users to actively participate in demand response.
[0061] Specifically, the load reduction amount is the load consumed when the user does not participate in demand response minus the load actually consumed after participating in demand response, wherein the load consumed when the user does not participate in demand response is the baseline load.
[0062] After the demand response is executed, the baseline load cannot be measured by instruments, but the actual load consumption can be measured directly. Therefore, it is only necessary to calculate the value of the baseline load to further calculate the user's load reduction. Specifically, in the demand response scenario, the relationship curve between the baseline load and the load reduction is as follows: Figure 1 shown.
[0063] Depend on Figure 1 It can be seen that before the demand response is executed, the user does not reduce his load, so the baseline load is exactly equal to the measured load; during the execution of the demand response, the user's load is reduced, and the measured load is lower than the baseline load. The difference between the baseline load and the measured load is the load reduction amount, that is, Figure 1 The area enclosed by the user's baseline load and the measured load after demand response is implemented.
[0064] Therefore, in order to ensure the effectiveness of demand response, accurate baseline load measurement results are required.
[0065] Based on this, this embodiment proposes a virtual power plant baseline load calculation method based on multi-dimensional factors, such as Figure 2 As shown, including:
[0066] Screening load forecasting related factors based on historical demand response information, and determining the degree of correlation between each load forecasting related factor and load demand;
[0067] The weight coefficient of each load forecast correlation factor is set based on the correlation degree, and the forecast training data set is constructed according to the corresponding weight coefficient;
[0068] Build an LSTM model, train it by predicting the training data set, and optimize the model parameters by using the sparrow optimization algorithm to obtain a baseline load measurement model;
[0069] The baseline load of the virtual power plant during the target time period is calculated based on the baseline load measurement model.
[0070] Compared with the traditional method of using a single load factor to calculate the baseline load, this embodiment uses historical load data, date type data and historical meteorological data corresponding to each day as data basis to screen load forecast related factors.
[0071] And considering the gap between load demand under demand response scenarios and load demand under conventional power grid operation scenarios, in order to ensure the accuracy of subsequent baseline load calculation models for baseline load calculation under demand response scenarios, relevant information under corresponding demand response scenarios is retrieved based on historical demand response information to retrieve historical load information and historical weather information that is more correlated with load demand under demand response scenarios.
[0072] Specifically, retrieve the historical load information and historical weather information that are more correlated with the load demand in the demand response scenario, and screen the load forecast correlation factors based on the historical demand response information, and determine the correlation degree between each load forecast correlation factor and the load demand, including:
[0073] Obtain the execution time point of each demand response according to the historical demand response information, and set the data extraction time period according to the execution time point;
[0074] Obtain historical load information and historical weather information within the data extraction period, cluster the historical load information and historical weather information, and select load forecasting related factors according to the clustering results;
[0075] The Pearson correlation coefficient between each load forecast correlation factor and the load demand is calculated respectively to obtain the correlation degree between each load forecast correlation factor and the load demand.
[0076] First, determine the execution time point corresponding to the demand response based on the historical demand response, and take into account the load fluctuations and abnormal weather changes. Set the corresponding data extraction time period with the execution time point as the center of the time period according to the preset time period length. The time period length of the data extraction time period can be set according to information such as the demand response execution duration to ensure that the historical load information and historical weather information within the data extraction time period have relevant information on the load demand characteristics under the demand response scenario.
[0077] Smart meters are easily disturbed during data collection and transmission, which can lead to data loss or anomalies. Therefore, after obtaining the historical load information and historical weather information within the data extraction time period, the average value processing method is used to process the corresponding data for the extracted historical load information.
[0078] Specifically, several non-missing load values with the same characteristics as the day of the missing value are summed and then divided by the number of non-missing values to obtain the average value. Then, the missing values in the historical load information are filled with the average value.
[0079] At the same time, in order to ensure the efficiency of subsequent algorithm and model application, the corresponding data obtained is normalized. In this embodiment, min-max normalization is used for normalization, and its expression is:
[0080]
[0081] Among them, S is the normalized data; S1 is the original data; S min and S max are the minimum and maximum values of the corresponding data respectively.
[0082] After the corresponding data processing is completed, the historical load information and historical weather information are clustered. Clustering can be achieved through K-means clustering algorithm, hierarchical clustering algorithm, etc., so as to obtain the load type and weather type commonly displayed in the clustering scenario. Then, the historical load information or weather information corresponding to each cluster center in the clustering result is used for feature extraction to select the load forecast related factors.
[0083] Among them, the load prediction related factors selected in this embodiment include load value, load change rate, maximum temperature, minimum temperature, average temperature and rainfall, etc.
[0084] Moreover, the impact of each load forecasting associated factor on load demand is different, that is, the impact on the baseline load is different. In order to ensure the accuracy and efficiency of subsequent baseline load calculation, the degree of correlation between each load forecasting associated factor and load demand is further calculated to set the corresponding weight.
[0085] Among them, the Pearson correlation coefficient is used to measure the correlation between load forecasting related factors and load demand.
[0086] The Pearson correlation coefficient is used to measure the correlation between two variables, and its value range is [-1, 1]. The Pearson correlation coefficient between two variables is specifically defined as the quotient of the covariance and standard deviation between the two variables, and its formula is defined as:
[0087]
[0088] Among them, variables X and Y are load forecasting related factors and load demand, E() is the mathematical expectation function, cov(X,Y) is the covariance between variables X and Y, σ X and σ Y are the standard deviations of variables X and Y, respectively, and p X,Y is the Pearson correlation coefficient between variables X and Y.
[0089] The closer the Pearson correlation coefficient is to -1 or 1, the stronger the correlation is; the closer the Pearson correlation coefficient is to 0, the weaker the correlation is.
[0090] On this basis, the weight coefficient of each load forecasting correlation factor is set according to the degree of correlation, and the prediction training data set is constructed according to the corresponding weight coefficient.
[0091] The specific steps include:
[0092] Classify the load forecasting related factors according to the Pearson correlation coefficient between each load forecasting related factor and the load demand;
[0093] Calculate the average absolute value of the Pearson correlation coefficient corresponding to the load forecast correlation factors in each category, and determine the correlation level of each category based on the average calculation result;
[0094] Based on the number of load forecasting related factors contained in each category and the corresponding correlation level, a weight coefficient of each load forecasting related factor is assigned;
[0095] According to the corresponding weight coefficients, a prediction training data set is constructed.
[0096] The size of the Pearson correlation coefficient directly corresponds to the size of the mutual correlation degree. Therefore, the load forecast correlation factors can be classified according to the Pearson correlation coefficient.
[0097] Considering that the value range of the Pearson correlation coefficient is [-1, 1], the absolute value of the Pearson correlation coefficient is used as the classification basis during classification.
[0098] Specific classification can be achieved by setting the upper and lower limits of the absolute value of the Pearson correlation coefficient corresponding to each category.
[0099] Then, the corresponding weight of each load forecasting related factor is set according to the classification situation.
[0100] Taking the classification of ten load forecasting related factors such as load value, load change rate, annual cycle, monthly cycle, daily cycle, hourly cycle, maximum temperature, minimum temperature, average temperature and rainfall as an example, the level with the highest correlation degree includes 5 load forecasting related factors, namely load value, load change rate, hourly cycle, maximum temperature and average temperature; the level with medium correlation degree includes 4 load forecasting related factors, namely monthly cycle, daily cycle, minimum temperature and rainfall; the level with the lowest correlation degree includes 1 load forecasting related factor, which is annual cycle.
[0101] The weight distribution is performed based on the number of load forecasting related factors in each category and the corresponding correlation level. The expression of weight distribution can be:
[0102]
[0103] Among them, a is the weight of each load forecasting associated factor in the level with the highest correlation, b is the weight of each load forecasting associated factor in the level with the medium correlation, and c is the weight of each load forecasting associated factor in the level with the lowest correlation.
[0104] By solving the weight distribution formula, it can be seen that the weights of load value, load change rate, time period, maximum temperature and average temperature should be 0.15, the weights of monthly period, daily period, minimum temperature and rainfall should be 0.06, and the weight of annual period should be 0.01.
[0105] In deep learning, weight initialization is an important step before neural network training begins, which has a profound impact on the performance and convergence speed of the network. Similarly, setting weights for training data can be regarded as a special kind of "weighted initialization", which can affect the model's fit to the data and its generalization ability to a certain extent.
[0106] Specifically, by setting different weights for different training samples, the model's attention to these samples can be adjusted. For important samples, their weights can be increased so that the model pays more attention to these samples during the training process, thereby improving the model's fit to these samples.
[0107] And considering the application of the validation set in the prediction training data set in the iterative process of the sparrow optimization algorithm, by setting the weights of the data samples in the prediction training data set, the sparrow optimization algorithm can be guided to pay more attention to certain specific training data in the parameter optimization process. If the weights of some data are large, the sparrow optimization algorithm will be more inclined to minimize the prediction error of these data when searching for the optimal parameters, so as to optimize the parameter optimization efficiency and convergence speed of the sparrow optimization algorithm.
[0108] Therefore, on the basis of completing the weight allocation of each load forecasting related factor, a forecasting training data set is constructed according to the corresponding weight coefficient, including:
[0109] Based on the factors associated with load forecasting, the original data set is constructed;
[0110] According to the corresponding weight coefficient, the sampling probability of the data sample corresponding to each load forecast associated factor in the original data set is calculated;
[0111] Based on the calculated sampling probability, a prediction training data set is generated according to the original data set.
[0112] The sampling frequency of data samples in a data set can reflect their importance in the overall data set. Therefore, the corresponding sampling frequency can be set through the weight coefficient to show the weight of each sample in the data set.
[0113] Specifically, the calculation expression of the sampling frequency is:
[0114]
[0115] Among them, p i is the sampling frequency of the i-th sample, ω i is the weight coefficient of the i-th sample, ω j is the sampling frequency of the jth sample, and n is the number of samples in the original data set.
[0116] Through the sampling frequency, a prediction training data set can be generated based on the original data set by weighted random sampling and other methods.
[0117] After completing the preliminary data processing, you can build an LSTM model for model training.
[0118] The long short-term neural network (LSTM) is an improved algorithm based on the recurrent neural network (RNN). The structure of LSTM is divided into: forget gate, input gate, output gate, and the internal control can be regarded as a fully connected layer. The forget gate, input gate, output gate, network weight matrix, and network bias vector are represented by f t ,i t , O t , W, b represents. Internal control implements the storage and update of information by LSTM, which is realized by Sigmoid function and point multiplication operation, and does not provide additional information. σ is the Sigmoid function, which is a nonlinear activation function commonly used in deep learning. It can map real values to the interval 0 to 1, indicating the amount of information passing through, 0 means no information passing through, and 1 means all information passing through.
[0119] The function of the forget gate is to decide which information to discard or retain. In short, it is to retain important information and forget unimportant information. It is a key component of the LSTM unit and its value is:
[0120] f t =σ(W f x t +W f h t-1 +b f );
[0121] The input gate is used to control the current input information h of the network t-1 , x t Flow into memory unit C t The value of is:
[0122] i t =σ(W i x t +W i h t-1 +b i );
[0123]
[0124] C t is the memory unit, the new value that LSTM needs to remember, its value is:
[0125] O t =σ(W o x t +W o h t-1 +b o );
[0126] h t =tanh(C t )*O t .
[0127] h t That is the output result. The network structure diagram of the constructed LSTM model is as follows Figure 3 As shown by Figure 3 It can be seen that the forget gate of LSTM forgets useless information, the input gate and candidate information generate new memory information, the output gate is responsible for updating the memory, and each functional module is combined to form a complete LSTM model.
[0128] In order to solve the problem of large randomness and complex selection of LSTM model network parameters, the sparrow optimization algorithm is further used to optimize the model parameters to obtain the final baseline load measurement model.
[0129] The method of optimizing the model parameters by using the sparrow optimization algorithm to obtain the baseline load measurement model includes:
[0130] The number of unit layers, learning rate and iterations of the LSTM network are optimized, and the parameters of the sparrow optimization algorithm are set and initialized.
[0131] Calculate the fitness value of each sparrow individual in the population, and divide the population into discoverers and joiners according to the fitness value;
[0132] Update the location of the discoverer and the location of the joiner;
[0133] Determine whether the current iteration reaches the preset iteration end condition;
[0134] If the preset iteration end condition is reached, the optimal solution of the current sparrow optimization algorithm is used as the hyperparameter of the LSTM network to obtain the baseline load measurement model;
[0135] If the preset iteration end condition is not met, the next iteration of the sparrow optimization algorithm is performed until the preset iteration end condition is met.
[0136] Among them, the discoverer's position update formula is:
[0137]
[0138] Among them, t is the current iteration number; iter max is a constant, indicating the maximum number of iterations; d I,J is the position information of the I-th sparrow in the J-dimensional space; Q is a random number that satisfies the normal distribution; L is a matrix with all elements being 1; the value range of α is (0, 1], and the value ranges of the warning value R2 and the safety value ST are [0, 1] and [0.5, 1] respectively.
[0139] The position update formula of the joiner is:
[0140]
[0141] Among them, d p is the optimal position currently occupied by the discoverer; d worst is the worst position of the population; A is a 1×m matrix, in which each element is assigned a value of 1 or –1.
[0142] The method of optimizing the model parameters by using the sparrow optimization algorithm to obtain the baseline load measurement model also includes:
[0143] When updating the positions of the discoverer and joiner, the fitness values of the alert individuals in the sparrow population and the current iteration number are also obtained;
[0144] Based on the fitness value of the alert individual and the current number of iterations, determine whether to trigger the position update condition of the alert individual;
[0145] When the position update condition is triggered, the position of the alert individual is updated according to the anti-predator behavior formula.
[0146] In the sparrow search algorithm, some individuals are designated as alert individuals (i.e., executors of anti-predator behavior). They are responsible for monitoring the status of the entire population and promptly sounding the alarm when a threat is detected. When alert individuals are aware of the danger, they will take anti-predator behavior to escape from potential threats.
[0147] This danger identification behavior can be achieved by determining whether the location update condition is triggered. The location update condition can be the fitness change of the alert individual, environmental safety and the number of iterations. The environmental safety is identified by the safety value ST set in the sparrow optimization algorithm. If the warning value is greater than or equal to the safety threshold, it indicates that the environment is no longer safe and the location update condition is met.
[0148] When the fitness is no longer significantly improved or the number of iterations reaches a predetermined number, the position update condition is also determined to be met, and the anti-predator behavior of the alert individual needs to be executed.
[0149] The expression of the anti-predator behavior formula is:
[0150]
[0151] Where t is the current iteration number, is the position information of the I-th alert individual in the J-th dimension space in the t+1 iteration, is the global optimal position of the tth iteration, β is the step size control parameter, is the position information of the I-th alert individual in the J-th dimension space in the t-th iteration, is the global worst position of the tth iteration, ε is a constant to avoid division by zero, and f I is the fitness value of the Ith alert individual, f g is the fitness value of the sparrow individual corresponding to the global optimal position, f w is the fitness value of the sparrow individual corresponding to the global worst position.
[0152] By updating the position of alert individuals, the algorithm can converge to the optimal solution more quickly. By exploring new areas and monitoring the foraging environment, alert individuals can provide more diverse information, helping the algorithm to escape from the local optimal solution and find a better global solution, thus providing higher optimization efficiency for the LSTM model network parameter optimization.
[0153] After completing the model training and optimization, evaluation indicators such as mean absolute error (MAE), mean absolute percentage error (MAPE) and root mean square error (RMSE) were selected to evaluate the model performance to ensure the reliability of the acquired model.
[0154] The definition of the above evaluation indicators is:
[0155]
[0156] Where M is the number of load test set data; is the calculated value of the mth calculated data; y m is the true value of the mth test data.
[0157] MAPE can measure the quality of the measurement results, and RMSE and MAE can measure the accuracy of the measurement. The smaller the MAPE, RMSE and MAE in the measurement, the higher the measurement accuracy.
[0158] The calculating of the baseline load of the virtual power plant in the target time period according to the baseline load calculation model includes:
[0159] Input the current load information and corresponding weather information of the virtual power plant into the baseline load calculation model to obtain the baseline load forecast curve of the virtual power plant;
[0160] Obtain a demand response strategy and obtain a demand response execution duration period;
[0161] The demand response execution duration period is taken as the target time period, and the corresponding baseline load is intercepted from the baseline load forecast curve.
[0162] The calculating the baseline load of the virtual power plant in the target time period according to the baseline load calculation model also includes:
[0163] Acquire the baseline load before the target time period in real time, and compare the baseline load acquired in real time with the baseline load prediction curve;
[0164] According to the comparison results, a baseline load fluctuation node is selected, and the weather information and load information corresponding to the baseline load reset node are used to randomly replace the data samples in the prediction training data set, and the baseline load estimation model is retrained;
[0165] The baseline load prediction curve is re-output based on the retrained baseline load measurement model to obtain the baseline load of the virtual power plant within the target time period.
[0166] The baseline load calculation model is feedback-adjusted based on the actual baseline load to further ensure the accuracy of baseline load calculation. The baseline load calculation model is retrained by selecting relevant data at baseline load fluctuation nodes where there is a deviation between the calculated value and the actual value to improve the generalization ability of the baseline load calculation model and further improve the accuracy of baseline load calculation.
[0167] The proposed baseline load estimation method is verified by using the load data (96 points per day) of a certain region from June to September, date type data (year, month, day, hour) and the corresponding daily meteorological data (maximum temperature, minimum temperature, average temperature, relative humidity, rainfall).
[0168] Based on the above data, the corresponding data set is constructed, and the first 90% of the data is used as the training set, the last 10% of the data is used as the test set, and RMSE is used as the evaluation indicator of the model error.
[0169] First, build the LSTM model and set the initial LSTM parameters: L1 is 50, L2 is 30, the learning rate lr is 0.01, and the number of iterations K is 50. The LSTM model test graph and error graph are as follows: Figure 4 shown.
[0170] Then, the sparrow optimization algorithm is used to optimize the LSTM hyperparameters L1, L2, learning rate lr and number of iterations K, and the parameter optimization ranges are [1, 100], [1, 100], [0.001, 0.01], and [1, 100] respectively.
[0171] Set the population size of the sparrow optimization algorithm to 30 and the maximum number of iterations to 10. The results after optimization are: L1 is 86, L2 is 45, the learning rate lr is 0.0067, and the number of iterations K is 40.
[0172] Substitute the optimized parameters, the model test graph and error graph are as follows Figure 5 As shown:
[0173] Depend on Figure 4 and Figure 5 It can be seen that the LSTM parameters optimized by the sparrow optimization algorithm can effectively improve the accuracy of the measurement model, verifying the reliability of the baseline load measurement method described in this embodiment.
[0174] The above-described embodiment is only a preferred solution of the present invention and does not limit the present invention in any form. There are other variations and modifications without exceeding the technical solution described in the claims.
Claims
1. A virtual power plant baseline load calculation method based on multi-dimensional factors, characterized in that: include: Screening load forecasting related factors based on historical demand response information, and determining the degree of correlation between each load forecasting related factor and load demand; The weight coefficient of each load forecast correlation factor is set based on the correlation degree, and the forecast training data set is constructed according to the corresponding weight coefficient; Build an LSTM model, train it by predicting the training data set, and optimize the model parameters by using the sparrow optimization algorithm to obtain a baseline load measurement model; The baseline load of the virtual power plant during the target time period is calculated based on the baseline load measurement model.
2. The method for calculating baseline load of a virtual power plant based on multi-dimensional factors according to claim 1, characterized in that: The step of screening load forecasting related factors based on historical demand response information and determining the degree of correlation between each load forecasting related factor and load demand includes: Obtain the execution time point of each demand response according to the historical demand response information, and set the data extraction time period according to the execution time point; Obtain historical load information and historical weather information within the data extraction period, cluster the historical load information and historical weather information, and select load forecasting related factors according to the clustering results; The Pearson correlation coefficient between each load forecast correlation factor and the load demand is calculated respectively to obtain the correlation degree between each load forecast correlation factor and the load demand.
3. The method for calculating baseline load of a virtual power plant based on multi-dimensional factors according to claim 2 is characterized in that: The step of setting a weight coefficient of each load forecast correlation factor based on the correlation degree and constructing a forecast training data set according to the corresponding weight coefficient includes: Classify the load forecasting related factors according to the Pearson correlation coefficient between each load forecasting related factor and the load demand; Calculate the average absolute value of the Pearson correlation coefficient corresponding to the load forecast correlation factors in each category, and determine the correlation level of each category based on the average calculation result; Based on the number of load forecasting related factors contained in each category and the corresponding correlation level, a weight coefficient of each load forecasting related factor is assigned; According to the corresponding weight coefficients, a prediction training data set is constructed.
4. The method for calculating baseline load of a virtual power plant based on multi-dimensional factors according to claim 3 is characterized in that: The step of constructing a prediction training data set according to corresponding weight coefficients includes: Based on the factors associated with load forecasting, the original data set is constructed; According to the corresponding weight coefficient, the sampling probability of the data sample corresponding to each load forecast associated factor in the original data set is calculated; Based on the calculated sampling probability, a prediction training data set is generated according to the original data set.
5. The method for calculating baseline load of a virtual power plant based on multi-dimensional factors according to claim 1, characterized in that: The method of optimizing the model parameters by using the sparrow optimization algorithm to obtain the baseline load measurement model includes: The number of unit layers, learning rate and iterations of the LSTM network are optimized, and the parameters of the sparrow optimization algorithm are set and initialized. Calculate the fitness value of each sparrow individual in the population, and divide the population into discoverers and joiners according to the fitness value; Update the location of the discoverer and the location of the joiner; Determine whether the current iteration reaches the preset iteration end condition; If the preset iteration end condition is reached, the optimal solution of the current sparrow optimization algorithm is used as the hyperparameter of the LSTM network to obtain the baseline load measurement model; If the preset iteration end condition is not met, the next iteration of the sparrow optimization algorithm is performed until the preset iteration end condition is met.
6. The method for calculating baseline load of a virtual power plant based on multi-dimensional factors according to claim 5, characterized in that: The method of optimizing the model parameters by using the sparrow optimization algorithm to obtain the baseline load measurement model also includes: When updating the positions of the discoverer and joiner, the fitness values of the alert individuals in the sparrow population and the current iteration number are also obtained; Based on the fitness value of the alert individual and the current number of iterations, determine whether to trigger the position update condition of the alert individual; When the position update condition is triggered, the position of the alert individual is updated according to the anti-predator behavior formula.
7. The method for calculating baseline load of a virtual power plant based on multi-dimensional factors according to claim 6, characterized in that: The expression of the anti-predator behavior formula is: Where t is the current iteration number, is the position information of the I-th alert individual in the J-th dimension space in the t+1 iteration, is the global optimal position of the tth iteration, β is the step size control parameter, is the position information of the I-th alert individual in the J-th dimension space in the t-th iteration, is the global worst position of the tth iteration, ε is a constant to avoid division by zero, and f I is the fitness value of the Ith alert individual, f g is the fitness value of the sparrow individual corresponding to the global optimal position, f w is the fitness value of the sparrow individual corresponding to the global worst position.
8. The method for calculating baseline load of a virtual power plant based on multi-dimensional factors according to claim 1, characterized in that: The calculating of the baseline load of the virtual power plant in the target time period according to the baseline load calculation model includes: Input the current load information and corresponding weather information of the virtual power plant into the baseline load calculation model to obtain the baseline load forecast curve of the virtual power plant; Obtain a demand response strategy and obtain a demand response execution duration period; The demand response execution duration period is taken as the target time period, and the corresponding baseline load is intercepted from the baseline load forecast curve.
9. The method for calculating baseline load of a virtual power plant based on multi-dimensional factors according to claim 8, characterized in that: The calculating the baseline load of the virtual power plant in the target time period according to the baseline load calculation model also includes: Acquire the baseline load before the target time period in real time, and compare the baseline load acquired in real time with the baseline load prediction curve; According to the comparison results, a baseline load fluctuation node is selected, and the weather information and load information corresponding to the baseline load reset node are used to randomly replace the data samples in the prediction training data set, and the baseline load estimation model is retrained; The baseline load prediction curve is re-output based on the retrained baseline load measurement model to obtain the baseline load of the virtual power plant within the target time period.
Citation Information
Cited By
Carbon emission trend prediction method and device and nonvolatile storage medium
CN121072848A