A virtual power plant distributed power source output prediction method and system
By employing a combination of grey relational analysis, Euclidean distance, CNN, and LSTM models in a virtual power plant, along with XGBoost ensemble learning, the accuracy problem of distributed power generation output prediction was solved, achieving higher-precision output prediction.
Patent Information
- Application Number
- CN202311844513.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-27
- Publication Date
- 2026-02-27
- Estimated Expiration
- 2043-12-27
AI Technical Summary
In existing methods for predicting the output of distributed power sources in virtual power plants, inaccurate selection of similar variables leads to large prediction errors, and the improvement potential of a single prediction model is limited, especially when the prediction accuracy is insufficient under variable weather conditions.
Grey relational analysis and Euclidean distance model are used to select similar day and time data, and CNN and LSTM models are combined for prediction. Random forest algorithm is used to select influencing factors, and XGBoost ensemble learning model is used to integrate multiple prediction results.
It improves the accuracy and reliability of distributed power output forecasting, making the forecast results closer to the actual situation, adapting to variable weather conditions, and having greater guiding significance.
Smart Images

Figure CN117810977B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of power grid output prediction, and particularly relates to a distributed power output prediction method and system in a virtual power plant. BACKGROUND
[0002] The distributed power source preferably solves the problems of finding a new energy to replace the decreasing traditional fossil energy and improving energy utilization efficiency, is a small, modular, and environment-compatible independent power source with power from kilowatt to megawatt. The distributed power source can fully utilize renewable energy resources such as wind energy and solar energy, and can be independently operated or connected to a power grid. However, the connection of the distributed power source to the power grid has brought many influences to the power system, and under the current technology, the investment cost of the distributed power source is high, and there are certain economic problems after the connection to the power grid. There are many research methods for the distributed power source, and the virtual power plant (VPP) is a new concept. The virtual power plant refers to the management of power sources and loads in the microgrid or active distribution network through distributed power source clusters and load monitoring, so as to realize the stable and economic operation of the system. In order to realize the stable operation of the power grid and reasonably utilize resources, it is necessary to predict the output of the distributed power source.
[0003] The existing output prediction method uses the Euclidean distance, the Pearson correlation coefficient and other methods to use similar variables to obtain similar days of the target day to be predicted, and uses the similar day data to further predict the output. However, the similarity of the similar day data selected by the similar variables and the output of the target day to be predicted is uneven, especially in the case of single similar data or weather conditions that change within a day, there will be a large prediction error; and the prediction result accuracy of the single prediction model has little room for improvement. SUMMARY
[0004] In order to improve the accuracy of the output prediction result, the application provides a distributed power output prediction method and system in a virtual power plant. The method can effectively improve the output prediction accuracy of the power source and obtain more reliable and accurate prediction results.
[0005] In order to achieve the above purpose, the application adopts the following technical scheme:
[0006] In the first aspect, the application provides a distributed power output prediction method in a virtual power plant, comprising:
[0007] S1, obtaining distributed power output data in a virtual power plant, and selecting similar variables affecting the output data;
[0008] S2, inputting the similar variables into a grey correlation analysis model to output similar day data;
[0009] S3, input the similar variables into the Euclidean distance model, and output the similar time data;
[0010] S4, input the similar day data, the similar time data and the similar variables into the CNN model respectively, and output a plurality of first output prediction results;
[0011] S5, input the historical output data of the distributed power supply in the virtual power plant into the LSTM model, and predict the time sequence of the output to obtain a second output prediction result;
[0012] S6, the integrated learning model is used to perform integrated learning analysis on the plurality of first output prediction results and the second output prediction result, and finally obtain the output prediction result.
[0013] As a further improvement of the application, the similar variables affecting the output data are selected by using a random forest algorithm based on a decision tree, and several factors having greater influence on the output are selected as the similar variables.
[0014] As a further improvement of the application, the feature extraction of the random forest algorithm based on the decision tree comprises the following steps:
[0015] For each decision tree, select the corresponding out-of-bag data OOB, calculate the OOB error, and record it as errOOB1;
[0016] Randomly add noise interference to the features X of all output data samples of OOB, calculate the OOB error again, and record it as errOOB2;
[0017] Assuming that there are n trees in the forest, the importance degree of the feature X is:
[0018]
[0019] Calculate the importance of each feature and sort it in descending order;
[0020] Select the features with importance ranking meeting the requirements as the similar variables.
[0021] As a further improvement of the application, the grey correlation analysis model is used to select the similar day data by using the historical measured values and the numerical weather prediction prediction values thereof.
[0022] As a further improvement of the application, the input of the similar variables into the grey correlation analysis model and the output of the similar day data comprise the following steps:
[0023] Extract the historical daily irradiance measured value vector x0(k) and the target day NWP irradiance prediction value vector x i (k):
[0024] x0(k)=[x0(1), x0(2),..., x0(k)]; x i (k)=[x i (1), x i (2), ..., x i (k)]#
[0025] Calculate vector x0(k) and vector x using equation (1) i The grey relational coefficient r between (k) i ;
[0026] Based on the grey relational coefficient r i Sort the historical days from largest to smallest, and select the j historical days with the largest grey relational coefficient as similar days to the target day.
[0027] As a further improvement of the present invention, the Euclidean distance model is based on selecting data from similar time points using historical measured values and numerical weather prediction values.
[0028] As a further improvement of the present invention, the step of inputting similar variables to the Euclidean distance model and outputting similar time data includes the following steps:
[0029] Calculate the Euclidean distance d:
[0030]
[0031] Where n represents an n-dimensional space, x i Let x be a real number, i = 1, 2, ..., n, and x be the i-th coordinate.
[0032] The Euclidean distance for similarity is calculated point-to-point and is based on 1-dimensional data. The steps for selecting similarity using Euclidean distance are as follows:
[0033] Determine the historical measured irradiance values for the target day. Compared with NWP irradiance prediction value
[0034]
[0035] Calculate the historical measured values of irradiance at each time point. Compared with NWP irradiance prediction value The Euclidean distance d between them i :
[0036]
[0037] Based on Euclidean distance d i Sort the historical moments corresponding to each moment from smallest to largest, and take the j historical moments with the smallest Euclidean distance as similar moments to the target moment.
[0038] As a further improvement of the application, the CNN model comprises:
[0039] a convolutional layer for sliding window convolution calculation using a two-dimensional convolution function, sequentially calculating pixel by pixel using a convolution kernel;
[0040] an activation function layer established using a Relu function;
[0041] a pooling layer established by calling a MaxPooling2D() function;
[0042] a Dropout layer that randomly disconnects a certain percentage of input neuron links;
[0043] a Flatten layer for compressing multi-dimensional input data into one dimension;
[0044] a fully connected layer for regression prediction.
[0045] As a further improvement of the application, the LSTM model has a forget gate, an input gate, and an output gate structure, C t-1 , C t are the cell states at t-1 and t moments, respectively; h t-1 , h t are the states of the hidden layer at t-1 and t moments, respectively, and the cell state and the hidden layer state contain the long-term memory and short-term memory of the network unit for time series information; x t is the input at t moment; specifically including:
[0046] The forget gate determines the information forgotten from the cell state:
[0047] f t =σ(W f ×[h t-1 ,x t ]+b f )
[0048] The input gate updates the information of the cell state:
[0049] i t =σ(W i ·[h t-1 ,x t ]+b i )
[0050]
[0051]
[0052] The output gate determines the value of the next hidden state:
[0053] O t = sigma(W o ·[h t-1 , x t ]+b o )
[0054] h t = O t ·tanh(C t )
[0055] In the formula: is the current candidate cell state; sigma is a sigmoid function; f t , i t , O t are the calculation results of the forget gate, the input gate, and the output gate at time t respectively; W f , W i , W o are the weight matrices of the forget gate, the input gate, and the output gate respectively; b f , b i , b o represent the biases of the forget gate, the input gate, and the output gate respectively.
[0056] As a further improvement of the application, the integrated learning model adopts an XGBoost integrated learning model, and the establishment process of the XGBoost integrated learning model is as follows:
[0057] Initialize the prediction value of each sample, and define the loss function;
[0058] Calculate the derivative of the loss function with respect to the prediction value of each sample;
[0059] Establish a new decision tree according to the derivative information;
[0060] Predict the sample value using the new decision tree, and add it to the original value;
[0061] Loop to create decision trees until the stop condition is met.
[0062] As a further improvement of the application, the integrated learning model is used to analyze the integrated learning of the first output prediction result and the second output prediction result, including:
[0063] The XGBoost integrated learning model is used to analyze the integrated learning of the first output prediction result and the second output prediction result, including:
[0064] Calculate the loss function, and the loss function L is represented by the predicted value and the true value y i , where n is the number of samples:
[0065]
[0066] The XGBoost integrated learning model is an additive model composed of k base models, assuming that the decision tree model to be trained in the tth iteration is f t (x), then:
[0067]
[0068] wherein, is the prediction result of sample i after the tth iteration, is the prediction result of the first t-1 trees, f t (x i ) is the model of the tth tree.
[0069] In a second aspect, the present application provides a virtual power plant distributed power output prediction system, comprising:
[0070] An acquisition module is configured to acquire distributed power output data in a virtual power plant and select similar variables affecting the output data.
[0071] A first output module is configured to input the similar variables into a grey correlation analysis model and output similar day data.
[0072] A second output module is configured to input the similar variables into an Euclidean distance model and output similar time data.
[0073] A first prediction module is configured to input the similar day data, the similar time data and the similar variables into a CNN model respectively and output a plurality of first output prediction results.
[0074] A second prediction module is configured to input historical distributed power output data in a virtual power plant into an LSTM model, predict using the time sequence of the output, and obtain second output prediction results.
[0075] An integration module is configured to perform integrated learning analysis on the plurality of first output prediction results and the second output prediction results using an integrated learning model to obtain final output prediction results.
[0076] In a third aspect, the present application provides an electronic device, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to realize the virtual power plant distributed power output prediction method.
[0077] In a fourth aspect, the present application provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program is executed by a processor to realize the virtual power plant distributed power output prediction method.
[0078] Compared with the prior art, the present application has the following beneficial effects:
[0079] The present application comprehensively considers similar day data and similar time data for power output prediction, and uses different prediction models to use the prediction results of different similar data for integrated prediction. Compared with the widely used power output prediction method before, especially the prediction method using similar data and a single prediction model for prediction, the present application can effectively improve the power output prediction accuracy of power supply and obtain more reliable and accurate prediction results. The selection method of similar variables, the consideration of similar day and similar time similar data as the input of different prediction models, and the final integrated learning of multiple prediction results are the solutions of the present application for the distributed power supply in the virtual power plant, which can improve the accuracy of the final prediction results and make the prediction closer to the actual situation, and more meaningful for daily guidance. BRIEF DESCRIPTION OF DRAWINGS
[0080] Figure 1 The flowchart of the power output prediction method of the distributed power supply in the virtual power plant of the present application;
[0081] Figure 2 The technical flowchart of the power output prediction of the present application;
[0082] Figure 3 The sorted graph after the characteristic importance of multiple meteorological factors on the power output of the random forest model is amplified 100 times;
[0083] Figure 4 The similar day curve selected for the target day using grey correlation analysis and the real value curve of the target day;
[0084] Figure 5 The similar time curve selected for the target day using Euclidean distance and the real value curve of the target time;
[0085] Figure 6 The prediction result comparison graph of three prediction methods and integrated learning prediction;
[0086] Figure 7 The schematic diagram of the power output prediction system of the distributed power supply in the virtual power plant of the present application;
[0087] Figure 8 The schematic diagram of an electronic device provided by the embodiment of the present application. DETAILED DESCRIPTION
[0088] In order to make the person skilled in the art better understand the technical scheme of the present application, the technical scheme in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, not all. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor should belong to the scope of protection of the present application.
[0089] It should be noted that the terms "first", "second" and the like in the specification and claims of the present application and the above-described drawings are used to distinguish similar objects, and do not necessarily have to describe a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the application described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not have to be limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0090] The present application relates to the field of output prediction of distributed power sources in virtual power plants, and is a method considering the influence of similar time and integrated learning mode of power source output on output prediction.
[0091] As shown in Figure 1 The first object of the present application is to provide a distributed power source output prediction method in a virtual power plant, comprising the following steps:
[0092] Step S1, acquiring distributed power source output data in a virtual power plant, and selecting similar variables affecting the output data;
[0093] Step S2, inputting the similar variables into a grey correlation analysis model to output similar day data;
[0094] Step S3, inputting the similar variables into a Euclidean distance model to output similar time data;
[0095] Step S4, inputting the similar day data, similar time data and similar variables into a CNN model respectively to output a plurality of first output prediction results;
[0096] Step S5, inputting the historical output data of the distributed power source in the virtual power plant into an LSTM model to predict using the time sequence of the output to obtain a second output prediction result;
[0097] Step S6, the integrated learning model is used for integrated learning analysis on the multiple first output prediction results and the second output prediction results, and a final output prediction result is obtained.
[0098] The idea of selecting the similar variables, considering the similar data of the similar day and the similar time as the input of different prediction models, and finally performing the integrated learning of multiple prediction results is the key content of the application. Especially in combination with the variable weather factors, the prediction result is more accurate and has higher precision.
[0099] The following describes each step in detail, and the virtual power plant distributed power output prediction method considering multiple similar variables and selecting similar day and similar time data for output prediction and integrated by an integrated learning device is as shown in Figure 2 The following steps are shown.
[0100] Step S1, a random forest algorithm is used to determine the similar variables used to select the similar day and the similar time from the many output influencing factors, that is, the similar variables affecting the output data are selected;
[0101] The method for selecting the similar variables in step S1 is as follows.
[0102] A random forest (RF) algorithm based on a decision tree is used to select several factors that have a greater impact on the output. The RF model has important applications in classification, prediction and feature extraction. Random forest mainly extracts features based on the out of bag (OOB) error rate. Important features, after introducing noise to them, the data only changes in this feature is trained by RF, and the accuracy of the model will decrease significantly (i.e. the OOB error rate increases significantly); on the contrary, the unimportant features, after retraining, the accuracy of the model changes little. The RF algorithm is used for feature extraction of the influencing factors as follows.
[0103] (1) For each decision tree, select the corresponding OOB, calculate the OOB error, and record it as errOOB1.
[0104] (2) Randomly add noise to the features X of all samples in OOB, and calculate the OOB error again, and record it as errOOB2.
[0105] (3) Assuming that there are n trees in the forest, the importance of the feature X is:
[0106]
[0107] (4) Calculate the importance of each feature and sort it in descending order.
[0108] (5) Select the top 2 features in importance as the similar variables.
[0109] Step S2, a grey correlation analysis model is established, and similar day data is selected by using the similar variables in step S1;
[0110] In step S2, in order to select data with high correlation and certain complementarity as input data of the prediction model, by using the similar variables selected in step S1, the historical measured values and the numerical weather prediction (NWP) prediction values thereof are used to select similar day data.
[0111] Further, in step S2, the grey correlation analysis model is established, and the similar day data is selected in the following manner:
[0112] The grey correlation coefficient r is calculated:
[0113]
[0114] Wherein, x0(k) is a reference column, and p is a resolution coefficient. p is generally taken as 0.5. In the formula, r i is a grey correlation degree, when r i <0.5, it represents that the correlation is not large; when 0.5≤r i ≤0.7, it represents that there is a certain correlation degree; when r i >0.7, it represents that the correlation is very strong.
[0115] The steps of selecting the similar day by using the grey correlation analysis are as follows:
[0116] (1) Extracting the historical day irradiance measured value vector x0(k) and the target day NWP irradiance prediction value vector x i (k):
[0117] x0(k)=[x0(1), x0(2),..., x0(k)]; x i (k)=[x i (1), x i (2),..., x i (k)]#
[0118] (2) The grey correlation coefficient r i between the vector x0(k) and the vector x i is calculated by using formula (1).
[0119] (3) According to the grey correlation coefficient r i , the historical days are sorted from large to small, and the j historical days with the largest grey correlation coefficient are selected as the similar days of the target day. The value of j can be determined according to the actual situation.
[0120] Step S3, establish the Euclidean distance model, select similar time data by using similar variables in step 1;
[0121] In step S3, in order to select data with high correlation and certain complementarity as input data of the prediction model, through the similar variables selected in step S1, the similar time data is selected by using the historical measured values and the numerical weather prediction (NWP) prediction values thereof.
[0122] Further, in step S3, the Euclidean distance model is established, and the similar time data is selected in the following manner:
[0123] First, the Euclidean distance d is calculated:
[0124]
[0125] Where n represents an n-dimensional space, x i (i = 1, 2,..., n) is a real number, which is the i-th coordinate of x.
[0126] The Euclidean distance at the similar time is a point-to-point calculation, which is a 1-dimensional data, that is, n = 1 in formula (2). The steps of selecting the similar time by using the Euclidean distance are as follows:
[0127] (1) Determine the historical irradiance measured value of the target day and the NWP irradiance prediction value
[0128]
[0129] (2) Calculate the Euclidean distance d i between the historical irradiance measured value and the NWP irradiance prediction value at each time point:
[0130]
[0131] (3) According to the Euclidean distance d i , sort the corresponding historical time points from small to large, and select the j historical time points with the smallest Euclidean distance as the similar time points of the target time point. The value of j can be determined according to the actual situation.
[0132] Step S4, establish a CNN model, and use the similar data selected in steps S2 and S3 and the similar variables determined in step S1 as inputs of the CNN model, and output to obtain multiple output prediction results;
[0133] The process of establishing the CNN model in step S4 is as follows:
[0134] (1) Establish a convolution layer, generally using a 2-dimensional convolution function to calculate the sliding window convolution, using convolution kernel to calculate pixel by pixel and sequentially;
[0135] (2) Activation function layer, the simplest Relu (Rectified Linear Units) function can be used, which has the following mathematical form:
[0136] f(x) = max(0, x)
[0137] This function is very simple, the input less than 0, the output is all 0, the input greater than 0, the output is itself; The advantage of this function is fast convergence;
[0138] (3) Pooling layer, its purpose is to reduce the input feature map and simplify the network calculation complexity; At the same time, feature compression is carried out to highlight the main features. Pooling layer can be established by calling MaxPooling2D() function;
[0139] (4) Dropout layer, randomly disconnecting a certain percentage of input neuron links to prevent overfitting;
[0140] (5) Flatten layer, compressing the input multi-dimensional data into 1 dimension to prepare for entering the fully connected layer;
[0141] (6) Fully connected layer (Dense layer), used for classification or regression, which is used here for regression prediction.
[0142] Further, the output prediction results of the CNN model are obtained by inputting similar days and similar times as input data.
[0143] Further, LSTM has long-term memory ability for time series, which is used to solve the long-term dependence problem and the gradient vanishing / explosion problem in general recurrent neural network. Distributed power sources such as photovoltaic have strong time series correlation in output power, which is time series data. In order to extract the inherent long-term dependence feature, LSTM neural network is selected for prediction.
[0144] Step S5, establish an LSTM model, use the time series of the output to predict, and obtain the prediction result;
[0145] The way to establish the LSTM model in step S5 is as follows:
[0146] LSTM has a forget gate, an input gate and an output gate structure. t-1 , C t are the cell states at t-1 and t time, respectively; h t-1, h t Respectively, the state of the hidden layer at t-1, t time, the cell state and the hidden layer state contain the long-term memory and short-term memory of the network unit to the time series information; x t Is the input at t time.
[0147] (1) The forget gate determines the information forgotten from the cell state:
[0148] f t =σ(W f ·[h t-1 , x t ]+b f )
[0149] (2) The input gate updates the information of the cell state:
[0150] i t =σ(W i ·[h t-1 , x t ]+b i )
[0151]
[0152]
[0153] (3) The output gate determines the value of the next hidden state:
[0154] O t =σ(W o ·[h t-1 , x t ]+b o )
[0155] h t =O t ·tanh(C t )
[0156] In the formula: Is the current candidate cell state; σ is the sigmoid function; f t , i t , O t Respectively, the calculation results of the forget gate, the input gate, and the output gate at t time; W f , W i , W o Respectively, the forget gate, the input gate, and the output gate weight matrix; b f , b i , b o Respectively, the bias of the forget gate, the input gate, and the output gate.
[0157] Further, the output prediction result of the LSTM model using time series prediction is obtained.
[0158] Further, the full name of XGBoost is eXtreme Gradient Boosting, which is an optimized distributed gradient boosting library, with higher accuracy and stronger flexibility, supporting tool parallelism, aiming at high efficiency, flexibility and portability.
[0159] Step S6, establish an XGBoost ensemble learning model, use XGBoost to perform ensemble learning analysis on the multiple output prediction results obtained in steps S4 and S5;
[0160] The XGBoost ensemble learning model establishment process in step S6 is as follows:
[0161] (1) initialize the prediction value of each sample, and define the loss function;
[0162] (2) calculate the derivative of the loss function with respect to the prediction value of each sample;
[0163] (3) establish a new decision tree according to the derivative information;
[0164] (4) use the new decision tree to predict the sample value and add it to the original value;
[0165] (5) loop to create decision trees until the stopping condition is met.
[0166] Further, the loss function L can be represented by the prediction value and the true value y i , where n is the number of samples:
[0167]
[0168] Further, XGBoost is an additive model composed of k base models, assuming that the decision tree model to be trained at the tth iteration is: f t (x), then:
[0169]
[0170] where, is the prediction result of sample i after the tth iteration, is the prediction result of the first t-1 trees, and f t (x i ) is the model (function) of the tth tree.
[0171] Step S7, the ensemble learning obtains better output prediction results.
[0172] Step S7 obtains the final output prediction result of the distributed power supply in the virtual power plant by using the XGBoost integrated learner in the above manner.
[0173] The application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0174] The embodiment provides an integrated prediction method of considering the output prediction values of the distributed photovoltaic power supply in the virtual power plant under different prediction models of similar days and similar time data, and a flow thereof is as shown in Figure 2 The specific steps are as follows:
[0175] Step S1: A random forest algorithm (RF) is used to determine similar variables for selecting output data from among many output influencing factors.
[0176] There are 96 output values in one day, one output value every 15 minutes, and 57 data points in the time period of 5:00-19:00, and the output is 0 in other time periods. Actual data of a photovoltaic power station in actual life is used for analysis, and data of March, April and May 2019 is used as input of the RF model to obtain the meteorological factors most affecting the photovoltaic output in the time period.
[0177] The meteorological factors affecting the output include irradiance, temperature, wind speed, wind direction, air pressure and humidity, and one of the six meteorological factors most affecting the photovoltaic output is selected, as shown in Figure 3 The irradiance has the largest feature importance, and the importance coefficient is much higher than those of other factors, so the irradiance is selected as the similar variable to select similar data.
[0178] The remaining steps are analyzed and described below in combination with specific examples and the accompanying drawings, Figure 4 is an output curve of a similar day and an actual value on May 9, 2019; Figure 5 is an output curve of a similar time and an actual value on May 9, 2019; Figure 6 is a prediction value and an actual value curve on May 9, 2019.
[0179] Step S2: A grey correlation analysis model is established, and the similar day data is selected by using the similar variable in step S1.
[0180] May 9, 2019 is taken as a target day, and data of February to April 2019 is taken as historical data, and similar day data is selected.
[0181] The irradiance is taken as the similar variable, and the grey correlation coefficient f between the irradiance and the photovoltaic output is calculated.
[0182]
[0183] (1) The vector x0(k) of historical measured daily irradiance values is:
[0184] x0(k)=[x0(1),x0(2),...,x0(k)]
[0185] (2) The predicted value vector x of irradiance in the numerical weather prediction (NWP) data for the target date to be predicted. i (k) is:
[0186] x i (k)=[x i (1), x i (2), ..., x i (k)]
[0187] (3) Calculate vector x0(k) and vector x i The grey correlation coefficient r between (k) i And based on r i Sort historical dates from largest to smallest, and select the top 10 historical dates as similar dates to the target date.
[0188] The comparison chart of the actual power output data of the 10 similar days selected in step S2 with the target day is shown below. Figure 4 As shown.
[0189] Step S3: Establish the Euclidean distance model and select similar time data using the similar variables from Step 1.
[0190] Similarly, using May 9, 2019 as the target date, and the data from the three months preceding it, i.e., February to April 2019, as historical data, we selected data from similar times.
[0191] (1) Determine the historical measured values of irradiance for the target day. Compared with NWP irradiance prediction value
[0192]
[0193] (2) Calculate the historical measured values at each time point Compared with NWP forecast value The Euclidean distance d between them i :
[0194]
[0195] Based on Euclidean distance d iSort the historical time corresponding to each time from small to large, and select the 10 historical times with the smallest Euclidean distance as the similar times of the target time.
[0196] The comparison chart of the output data true value of the 10 similar times selected by step S3 for each research time and the target time is shown in FIG. 3. Figure 5
[0197] Step S4: Establish a CNN model, and take the similar data selected in steps S2 and S3 and the irradiance variable as the training data of the CNN model, and output to obtain multiple output prediction results.
[0198] The similar daily photovoltaic output data and the similar time photovoltaic output data selected with the irradiance as the similar variable are taken as the training data of the CNN model; the input of the training set 1 is the irradiance of the similar day, and the output is the output data of the similar day; the input of the training set 2 is the irradiance data of the similar time, and the output is the output data of the similar time; the input of the test set is the irradiance data of May 9, 2019, and the output is the predicted output data of May 9, 2019, so as to obtain the predicted multiple output prediction values of the target day.
[0199] The convolution layer is a 2-dimensional convolution kernel, and the input is N*1 two-dimensional data with length and width, wherein N is the target point number of the data to be predicted (in this embodiment, according to the description in step S1, N=57); the activation function selects the simplest Relu (Rectified Linear Units) function; the other layers including the pooling layer, the Dropout layer, the Flatten layer and the fully connected layer all adopt the default setting to perform regression prediction.
[0200] Step S5: Establish an LSTM model, and use the photovoltaic output time sequence to perform prediction, and the process of establishing the LSTM model is as follows: respectively establish the forgetting gate, the input gate and the output gate structure. t-1 , C t are the cell states at t-1 and t time, respectively; h t-1 , h t are the states of the hidden layer at t-1 and t time, respectively, and the cell state and the hidden layer state respectively contain the long-term memory and the short-term memory of the network unit to the time sequence information; x t is the input at t time.
[0201] (1) The forgetting gate decides the information forgotten from the cell state:
[0202] f t = σ(W f × [h t-1 , x t ] + b f )
[0203] (2) The input gate updates the information of the cell state:
[0204] i t = σ(W i · [h t-1 , x t ] + b i )
[0205]
[0206]
[0207] (3) The output gate determines the value of the next hidden state:
[0208] O t = σ(W o · [h t-1 , x t ] + b o )
[0209] h t = O t · tanh(C t )
[0210] In the formula: is the current candidate cell state; σ is the sigmoid function; f t , i t , O t are the calculation results of the forget gate, the input gate, and the output gate at time t, respectively; W f , W i , W o are the weight matrices of the forget gate, the input gate, and the output gate, respectively; b f , b i , b o represent the biases of the forget gate, the input gate, and the output gate, respectively.
[0211] The photovoltaic output time series data in April 2019 is used as the input of the LSTM model to obtain the output prediction value on May 9, 2019.
[0212] Step S6: Establish an XGBoost ensemble learning model, and use XGBoost to perform ensemble learning analysis on the multiple output prediction results obtained in step 4.
[0213] The prediction result 1 obtained by using CNN with irradiance as the similar variable and using similar day data as the training data, the prediction result 2 obtained by using CNN with similar time data as the training data, and the prediction result 3 obtained by using LSTM for time series prediction are sent into XGBoost for ensemble learning.
[0214] As shown in Figure 6 The CNN prediction, the LSTM prediction and the prediction result after integration by XGBoost are shown.
[0215] In step S7, the integrated learning obtains a better output prediction result.
[0216] Taking the root mean square error (RMSE) as an evaluation index, the prediction accuracy of each model is obtained as shown in Table 1, and the RMSE is defined as follows:
[0217]
[0218] Table 1: Comparison of prediction accuracy of various models
[0219] Model CNN-day CNN-time LSTM Average XGBoost 2019.5.9 9.51% 5.66% 5.68% 6.95% 4.07%
[0220] Among them, CNN-day represents the prediction result obtained by the CNN prediction model using similar days as training data, and CNN-time represents the prediction result of the CNN model using similar time as training data. As can be seen from Table 1, the prediction accuracy after integration is higher than the average of the prediction accuracy of the three models, and is closest to the best prediction result. This is only a specific display of one day, and the present application also predicts the photovoltaic output of other dates in May 2019, and the prediction accuracy of various prediction models is shown in Table 2:
[0221] Table 2: Comparison of model prediction accuracy of some dates in May 2019
[0222] Date CNN-day CNN-time LSTM XGBoost 2019.5.9 9.51% 5.66% 5.68% 4.07% 2019.5.10 8.67% 8.28% 9.21% 7.48% 2019.5.19 16.57% 12.84% 12.39% 12.12% 2019.5.22 15.75% 10.96% 8.57% 7.60% 2019.5.23 12.93% 7.24% 5.06% 5.03% 2019.5.25 15.93% 14.58% 9.96% 9.89% Average 12.56% 9.34% 7.70% 6.82%
[0223] As shown in the table, the average of the photovoltaic output of 6 days (including sunny days and non-sunny days) predicted by the output prediction technology of the present application is better than the prediction results of the previous three single models. The present application uses the CNN model to obtain two prediction results of the target day using similar day irradiance and output data and similar time irradiance and output data as training data; another prediction result is obtained by using the time series data of the output to predict by the LSTM model; finally, the three prediction results are input into the XGBoost integrated learning model for integrated learning to obtain the final output prediction result. The experimental results show that after the integrated learning of the prediction values considering different similar data and different prediction models, the prediction accuracy is obviously improved, which provides a certain reference for the integration of distributed power into the power grid.
[0224] As shown in Figure 7 The second object of the embodiment of the present application is to provide a distributed power output prediction system in a virtual power plant, which comprises:
[0225] The acquisition module is configured to acquire distributed power output data in a virtual power plant and select similar variables affecting the output data.
[0226] The first output module is configured to input the similar variables into a grey correlation analysis model and output similar day data.
[0227] The second output module is configured to input the similar variables into a Euclidean distance model and output similar time data.
[0228] The first prediction module is configured to input the similar day data, the similar time data and the similar variables into a CNN model respectively and output a plurality of first output prediction results.
[0229] The second prediction module is configured to input historical distributed power output data in the virtual power plant into an LSTM model, predict by using a time sequence of the output and obtain second output prediction results.
[0230] The integration module is configured to perform integrated learning analysis on the plurality of first output prediction results and the second output prediction results by using an integrated learning model and obtain final output prediction results.
[0231] As shown in Figure 8 A third object of the embodiments of the present application is to provide an electronic device, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to realize the method for predicting the output of the distributed power in the virtual power plant.
[0232] A fourth object of the embodiments of the present application is to provide a computer readable storage medium, which stores a computer program, wherein the computer program is executed by a processor to realize the method for predicting the output of the distributed power in the virtual power plant.
[0233] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system or a computer program product. Therefore, the present application can be in the form of a completely hardware embodiment, a completely software embodiment or an embodiment combining software and hardware aspects. Moreover, the present application can be in the form of a computer program product implemented on one or more computer usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer usable program code.
[0234] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure One one or more flow or blocks Figure One one or more flow or blocks
[0235] These computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture including instructions which implement the function specified in the flowchart block or blocks. Figure One one or more flow or blocks Figure One one or more flow or blocks
[0236] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure One one or more flow or blocks Figure One one or more flow or blocks
[0237] Finally, it should be noted that the above-mentioned embodiments are merely used to illustrate the technical solutions of the present application, rather than limit the technical solutions of the present application. Although the present application has been described in detail with reference to the above-mentioned embodiments, those skilled in the art should understand that the technical solutions of the present application can be modified or equivalent replaced without departing from the spirit and scope of the present application, and any modification or equivalent replacement should be covered in the protection scope of the present application.
Claims
1. A method for distributed power source output prediction in a virtual power plant, characterized in that, include: Obtain the output data of distributed power sources within the virtual power plant, and select similar variables that affect the output data; Input similar variables into the grey relational analysis model, and output similar daily data; Input similar variables into the Euclidean distance model, and output similar time data; By inputting similar day data, similar time data, and similar variables into the CNN model, various first output prediction results are obtained. Input the historical output data of distributed power sources in the virtual power plant into the LSTM model, and use the time series of output to make predictions to obtain the second output prediction result. An ensemble learning model is used to perform ensemble learning analysis on multiple first and second output prediction results to obtain the final output prediction result. The process of inputting similar variables into the grey relational analysis model and outputting similar daily data includes the following steps: extracting a historical daily irradiance measurement vector a target day NWP irradiance prediction vector : Calculate the vector using the above formula with vector Grey correlation coefficient between ; Based on the grey relational coefficient Sort the historical dates from largest to smallest, and select the dates with the highest grey relational coefficient. j A historical date is used as a similar date to the target date; The process of inputting similar variables into the Euclidean distance model and outputting similar time-time data includes the following steps: Calculate Euclidean distance d : in n Representing n-dimensional space, It is a real number. for x The i One coordinate; The Euclidean distance for similarity is calculated point-to-point and is based on 1-dimensional data. The steps for selecting similarity using Euclidean distance are as follows: Determine the historical measured irradiance values for the target day. Compared with NWP irradiance prediction value : Calculate the historical measured values of irradiance at each time point. Compared with NWP irradiance prediction value Euclidean distance between : Based on Euclidean distance Sort the historical moments corresponding to each moment from smallest to largest, and then select the ones with the smallest Euclidean distance. j A historical moment is a similar moment to the target moment.
2. The method for predicting the output of distributed power sources within a virtual power plant according to claim 1, characterized in that, The similar variables that affect the output data are selected using a random forest algorithm based on decision trees, choosing several factors that have a significant impact on the output as similar variables.
3. The method for predicting the output of distributed power sources within a virtual power plant according to claim 2, characterized in that, Feature extraction based on the decision tree-based random forest algorithm includes the following steps: For each decision tree, select the corresponding out-of-bag (OOB) data, calculate the OOB error, and denot it as . ; Noise interference is randomly added to the feature X of all output data samples of OOB, and the OOB error is calculated again, denoted as . ; Assuming there are n trees in the forest, the importance of feature X is: Calculate the importance of each feature and sort them in descending order; Features that meet the importance ranking requirements are selected as similarity variables.
4. The method for predicting the output of distributed power sources within a virtual power plant according to claim 1, characterized in that, The grey relational analysis model uses historical measured values and numerical weather prediction values to select similar daily data.
5. The method for predicting the output of distributed power sources within a virtual power plant according to claim 1, characterized in that, The Euclidean distance model is based on historical measured values and numerical weather prediction values, selecting data from similar time points.
6. The method for predicting the output of distributed power sources within a virtual power plant according to claim 1, characterized in that, The CNN model includes: Convolutional layers are used to perform sliding window convolution calculations using 2D convolution functions, and the calculations are performed pixel by pixel sequentially using convolution kernels. The activation function layer is established using ReLU functions; The pooling layer is created by calling the MaxPooling2D() function; Dropout layers randomly disconnect a certain percentage of input neurons. The Flatten layer is used to compress multidimensional input data into a 1-dimensional structure. Fully connected layers are used for regression prediction.
7. The method for predicting the output of distributed power sources within a virtual power plant according to claim 1, characterized in that, The LSTM model has a forget gate, input gate, and output gate structure. C t-1 , C t The cell states at times t-1 and t are respectively. h t-1 , h t These represent the states of the hidden layer at times t-1 and t, respectively. The cell state and the hidden layer state contain the network unit's long-term memory and short-term memory of time-series information, respectively. x t The input at time t; specifically including: The forgetting gate determines the information forgotten from the cellular state: The input gate updates the cell state information: The output gate determines the value of the next hidden state: In the formula: This represents the current state of the candidate cells; It is the sigmoid function; , , The results are the calculations of the forget gate, input gate, and output gate at time t, respectively. , , These are the weight matrices for the forget gate, input gate, and output gate, respectively. , , These represent the biases of the forget gate, input gate, and output gate, respectively.
8. The method for predicting the output of distributed power sources within a virtual power plant according to claim 1, characterized in that, The ensemble learning model adopted is the XGBoost ensemble learning model, and the process of establishing the XGBoost ensemble learning model is as follows: Initialize the predicted value for each sample and define the loss function; Calculate the derivative of the loss function with respect to the predicted value of each sample; Build a new decision tree based on the derivative information; The new decision tree is used to predict sample values, which are then added to the original values. Create decision trees in a loop until the stopping condition is met.
9. The method for predicting the output of distributed power sources within a virtual power plant according to claim 1, characterized in that, The method of employing an ensemble learning model to perform ensemble learning analysis on multiple first and second output prediction results includes: An XGBoost ensemble learning model is used to perform ensemble learning analysis on multiple first and second output prediction results, including: Calculate the loss function. L From the predicted value Compared with the true value It means that among them n For the number of samples: The XGBoost ensemble learning model is an additive model consisting of k base models. Assume the decision tree model to be trained in the t-th iteration is: ,but: in, This represents the prediction result for sample i after the t-th iteration. The prediction results are for the first t-1 trees. Let be the model for the t-th tree.
10. A distributed power generation output prediction system within a virtual power plant, implementing the distributed power generation output prediction method within a virtual power plant as described in any one of claims 1-9, characterized in that, include: The acquisition module is used to acquire the output data of distributed power sources in the virtual power plant and select similar variables that affect the output data. The first output module is used to input similar variables into the grey relational analysis model and output similar daily data. The second output module is used to input similar variables into the Euclidean distance model and output similar time data. The first prediction module is used to input similar day data, similar time data, and similar variables into the CNN model, and output various first-output prediction results. The second prediction module is used to input the historical output data of distributed power sources in the virtual power plant into the LSTM model, and use the time series of output to make predictions to obtain the second output prediction results. The integration module is used to perform integrated learning analysis on multiple first and second output prediction results using an ensemble learning model to obtain the final output prediction result.
11. An electronic device, characterized in that, The method includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the distributed power output prediction method in a virtual power plant as described in any one of claims 1-9.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the distributed power output prediction method in a virtual power plant as described in any one of claims 1-9.
Citation Information
Patent Citations
Output control method and device for virtual power plant
CN111667109A
Transformer oil temperature prediction method, device and system based on intra-day similar moment
CN111680712A