Construction method of photovoltaic power prediction model
By constructing a photovoltaic power prediction model of RBLS and residual prediction networks, combined with semi-supervised learning methods, the challenges of existing photovoltaic power prediction methods in terms of accuracy and computing resource requirements are solved, and high-precision and lightweight photovoltaic power prediction are achieved. .
Patent Information
- Application Number
- CN202411421761.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-12
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2044-10-12
AI Technical Summary
Existing PV power prediction methods have challenges in accuracy and computing resource requirements, especially in photovoltaic cluster scenarios, where high-precision prediction is difficult to achieve and high computing resource requirements.
A photovoltaic power prediction model construction method is adopted, and RBLS (width learning model) is constructed as a power preliminary prediction module, and combined with the residual prediction network, the prediction error of RBLS is compensated and the prediction accuracy is improved. This method uses labelless data during the training process and uses semi-supervised learning method to improve the generalization ability of the model.
It significantly improves the accuracy of photovoltaic power prediction, ensures that the model has high accuracy while ensuring lightweight, and improves the generalization ability of the model, and can more accurately predict photovoltaic power in various situations.
Smart Images

Figure CN119443984A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of microgrid photovoltaic cluster power generation prediction, and more specifically, relates to a method for constructing a photovoltaic power prediction model. Background Art
[0002] As the global demand for sustainable energy grows, photovoltaic cluster power generation, as a clean and renewable energy form, has gradually increased its penetration in the power grid. However, the accuracy of photovoltaic cluster power prediction is affected by many factors, such as weather conditions, equipment performance, etc., which makes photovoltaic data present complex and changeable characteristics. These time series data not only have multidimensional characteristics, but also are accompanied by significant randomness and volatility, which brings considerable challenges to the accurate prediction of photovoltaic power. On the other hand, in reality, there is a small amount of data with power value labels, and few studies have used massive unlabeled data to optimize the effect of prediction models.
[0003] Typical photovoltaic power prediction methods include physical models, mathematical statistics, and artificial intelligence. The physical model constructs a mapping relationship with power through information such as the geographical location of the power station, the characteristic parameters of the photovoltaic panels, and weather forecast data, but it is difficult to model when the photovoltaic cluster scenario and system are complex. Mathematical statistics methods mainly include linear regression and time series. This method uses a large amount of historical data that contains many redundant parts. The model is simple but suitable for occasions where accuracy is not required. In artificial intelligence methods, predictions based on vector machines usually require weather classification of the original data, and then train model parameters under different categories to improve accuracy. The whole process is relatively complicated, especially when applied to photovoltaic cluster scenarios. There are certain difficulties in achieving high-precision predictions; and methods based on deep learning have high requirements on the computing resources of training equipment. However, mobile computing devices in photovoltaic cluster power prediction scenarios usually cannot meet the requirements of deep large models. Summary of the invention
[0004] In view of the defects and improvement needs of the prior art, the present invention provides a method for constructing a photovoltaic power prediction model, the purpose of which is to improve the photovoltaic power prediction accuracy while ensuring the lightweight of the model.
[0005] To achieve the above object, according to one aspect of the present invention, a method for constructing a photovoltaic power prediction model is provided, comprising:
[0006] Construct a training sample set, where the dimension of each training sample is N*w, where N is the characteristic dimension of the photovoltaic time series data and w is the time width;
[0007] The training sample set with power labels is used to construct RBLS as a preliminary power prediction module;
[0008] Construct a residual prediction network: Find the training sample most similar to each training sample X with power label from the training sample set without power label respectively. Input the X and the first q training samples with power labels adjacent to it in time into RBLS respectively to obtain the first predicted power sequence. The first q power-free label data samples adjacent to it in time are input into RBLS to obtain the second predicted power sequence. The first predicted power sequence is input into the residual prediction network to output the residual a of the predicted power of X. o , input the second prediction power sequence into the residual prediction network, and output the The residual of the predicted power With a o is equal to the true residual and a o and Taking equality as the goal, optimizing the residual prediction network parameters;
[0009] The constructed RBLS and residual prediction network are used as the photovoltaic power prediction model to complete the construction, wherein the output of the residual prediction network is used to compensate for the RBLS power prediction error.
[0010] Furthermore, the residual prediction network is a fully connected neural network.
[0011] Furthermore, the mean square error L MSE Indicates a o The deviation from the true residual is expressed as the square error L SQR Indicates a o and The deviation between .
[0012] Furthermore, the most similar training samples are found by the Euclidean distance between samples.
[0013] Further, the implementation method of constructing RBLS is:
[0014] For each training sample X with a power label, learn the N-dimensional features of the current moment and the time series features of the previous moment in the order from the front to the back, and obtain the data time series features in the data sample before the current moment as the time series features of the current moment. The initial time series features are preset to 0. At the same time, learn the word importance of the N-dimensional features at each moment in the data sample. The time series features Z corresponding to the wth moment of each X are calculated. wAnd the word importance of N-dimensional features at each moment is concatenated to form a feature vector; through ridge regression, according to the power label value and feature vector corresponding to each X, the time series feature corresponding to the last moment in the data sample with dimension N*w is calculated to map to the output weight of the RBLS power output layer and the word importance mapping corresponding to each moment to obtain the output weight of the RBLS power output layer, and obtain RBLS.
[0015] Further, cumulative learning is carried out in the following way:
[0016] Z p =f(X p α z +Z p-1 U+β z )
[0017] In the formula, Z p is the data time series feature corresponding to the current moment p, f(·) is the activation function, X p is the N-dimensional feature of p at the current moment, Z p-1 is the data time series feature corresponding to the previous moment p-1, α z and U are randomly generated weight matrices, β z For bias.
[0018] Furthermore, word importance learning is performed in the following way:
[0019] H p =g(X p α h +β h )
[0020] In the formula, H p is the word importance of the N-dimensional feature at time p, X p is the N-dimensional feature at time p, g(·) is the activation function, α h and β h are randomly generated weight matrices and biases.
[0021] Furthermore, the training sample set is constructed by slidingly dividing the normalized photovoltaic time series data containing N-dimensional features with a window of shape N*w along the time axis with a preset step size t to obtain a training sample set; wherein w is the time width of each window.
[0022] The present invention also provides a photovoltaic power prediction method, which uses the photovoltaic power prediction model constructed by the construction method as described above to perform photovoltaic power prediction.
[0023] The present invention also provides a computer-readable storage medium, which includes a stored computer program, wherein when the computer program is executed by a processor, the device where the storage medium is located is controlled to execute the steps of the method described above.
[0024] In general, the above technical solutions conceived by the present invention can achieve the following beneficial effects:
[0025] (1) The method for constructing a photovoltaic power prediction model proposed in the present invention first constructs RBLS as a preliminary power prediction module, and then constructs a residual prediction network to compensate for the RBLS power prediction error, which can significantly improve the accuracy of power prediction. The model composed of RBLS and the residual prediction network has low complexity. Therefore, the method of the present invention can improve the photovoltaic power prediction accuracy while ensuring the lightweight model. Among them, RBLS can effectively extract time series features, introduce a residual prediction network to predict the output residual of RBLS, and further improve the prediction accuracy. When training the residual prediction network, a o The goal is to make the overall prediction result closer to the true value. In addition, when training the residual prediction network, the present invention adopts a semi-supervised learning method, that is, to find the training sample most similar to each training sample X with power label from the training sample set without power label. When optimizing the residual network parameters, a o and With equality as the goal, the model can have high prediction accuracy even when encountering data samples that are not completely consistent with the training samples. Therefore, this training method improves the generalization ability of the entire photovoltaic power prediction model, that is, it has stronger generalization performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 A flowchart of a method for constructing a photovoltaic power prediction model provided by an embodiment of the present invention;
[0027] Figure 2 A flow chart of a method for constructing a photovoltaic power prediction model provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0028] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0029] Embodiment 1
[0030] A method for constructing a photovoltaic power prediction model, such as Figure 1 As shown, including:
[0031] Construct a training sample set, where the dimension of each training sample is N*w, where N is the characteristic dimension of the photovoltaic time series data and w is the time width;
[0032] The training sample set with power labels is used to construct RBLS as a preliminary power prediction module;
[0033] Construct a residual prediction network: Find the training sample most similar to each training sample X with power label from the training sample set without power label respectively. Input the X and the first q training samples with power labels adjacent to it in time into RBLS respectively to obtain the first predicted power sequence. The first q power-free label data samples adjacent to it in time are input into RBLS to obtain the second predicted power sequence. The first predicted power sequence is input into the residual prediction network to output the residual a of the predicted power of X. o , input the second prediction power sequence into the residual prediction network, and output the The residual of the predicted power With a o is equal to the true residual and a o and Taking equality as the goal, optimizing the residual prediction network parameters;
[0034] The constructed RBLS and residual prediction network are used as the photovoltaic power prediction model to complete the construction, wherein the output of the residual prediction network is used to compensate for the RBLS power prediction error.
[0035] The method for constructing a photovoltaic power prediction model proposed in this embodiment first constructs RBLS as a preliminary power prediction module, and then constructs a residual prediction network to compensate for the RBLS power prediction error, which can significantly improve the accuracy of power prediction. The model composed of RBLS and the residual prediction network has low complexity. Therefore, the method of this embodiment can improve the photovoltaic power prediction accuracy while ensuring the lightweight model. Among them, RBLS (width learning model) has high learning efficiency because it only needs to learn and calculate the output weight matrix. At the same time, RBLS can effectively extract time series features. Furthermore, a residual prediction network is introduced to predict the output residual of RBLS, which further improves the prediction accuracy. When training the residual prediction network, a o The goal is to be equal to the true residual, so that the overall prediction result is closer to the true value.
[0036] In addition, when training the residual prediction network, the present invention adopts a semi-supervised learning method, that is, to find the training sample most similar to each training sample X with a power label from the training sample set without power label. When optimizing the residual network parameters, a o and The goal is to make the model have high prediction accuracy when encountering data samples that are not completely consistent with the training samples. Therefore, this training method improves the generalization ability of the entire photovoltaic power prediction model, that is, it has strong generalization performance. Specifically, due to the introduction of unlabeled data, the model can be exposed to more data distribution and feature space, thereby enhancing its adaptability to new data. This means that in practical applications, the model can more accurately predict photovoltaic power under various circumstances, providing strong support for the monitoring and analysis of photovoltaic power stations. In general, in the construction of the photovoltaic power prediction model, on the basis of introducing the residual prediction network, an active perception method is further introduced, and samples are selected from the unlabeled data as random enhancement samples of the labeled data, and the most informative data is actively selected for learning to improve the prediction performance.
[0037] In terms of data utilization efficiency, this embodiment fully utilizes the advantages of semi-supervised learning. Traditional supervised learning requires a large amount of labeled data for training, while the present invention combines labeled data with unlabeled data and uses unlabeled data as random enhanced samples of labeled data to be selected, effectively reducing the demand for training data. This innovation not only reduces the difficulty and cost of data collection, but also greatly shortens the training time and improves the training efficiency of the model.
[0038] Therefore, the method of this embodiment is a semi-supervised learning active perception power prediction method based on the stacking of time series width learning and conventional prediction network applied in the monitoring and analysis system of microgrid photovoltaic cluster power station. The RBLS width learning model is used to extract time series features, and the residual prediction network predicts the residual of RBLS. The random enhancement samples of labeled data are screened out from the unlabeled data and input into the semi-supervised model to improve its prediction accuracy and algorithm generalization.
[0039] Preferably, the training sample set is constructed by slidingly dividing the normalized photovoltaic time series data containing N-dimensional features with a window of shape N*w along the time axis with a preset step size t to obtain a training sample set; wherein w is the time width of each window.
[0040] Specifically, for photovoltaic data with N-dimensional features (temperature, humidity, irradiance, etc.), in order to improve the efficiency of subsequent training models, we first find the maximum value D of each dimensional feature of the photovoltaic data. max and minimum value D min, the one-dimensional feature data is normalized to the [0,1] interval using the following formula:
[0041]
[0042] After standardizing the feature data of all dimensions, we first set the window width w and the sliding step size t, and obtain a window of shape N*w that slides along the time axis on the data set with a step size t. The segmented data sample set is represented as X∈R N·w .
[0043] In one embodiment, the above-mentioned RBLS construction is implemented as follows:
[0044] For each training sample X with a power label, learn the N-dimensional features of the current moment and the time series features of the previous moment in the order from the front to the back, and obtain the data time series features in the data sample before the current moment as the time series features of the current moment. The initial time series features are preset to 0. At the same time, learn the word importance of the N-dimensional features at each moment in the data sample. The time series features Z corresponding to the wth moment of each X are calculated. w And the word importance of N-dimensional features at each moment is concatenated to form a feature vector; through ridge regression, according to the power label value and feature vector corresponding to each X, the time series feature corresponding to the last moment in the data sample with dimension N*w is calculated to map to the output weight of the RBLS power output layer and the word importance mapping corresponding to each moment to obtain the output weight of the RBLS power output layer, and obtain RBLS.
[0045] Preferably, cumulative learning is performed in the following manner:
[0046] Z p =f(X p α z +Z p-1 U+β z )
[0047] In the formula, Z p is the data time series feature corresponding to the current moment p, f(·) is the activation function, X p is the N-dimensional feature of p at the current moment, Z p-1 is the data time series feature corresponding to the previous moment p-1, α z and U are randomly generated weight matrices, β z For bias.
[0048] Preferably, word importance learning is performed in the following manner:
[0049] H p =g(X p α h +β h )
[0050] In the formula, H p is the word importance of the N-dimensional feature at time p, X p is the N-dimensional feature at time p, g(·) is the activation function, α h and β h are randomly generated weight matrices and biases.
[0051] Specifically, RBLS (recurrent broad learning system) needs to learn two features, "temporal features" and "word importance", respectively, and then combine the two features together to obtain the weight matrix mapped to the output layer through ridge regression.
[0052] Step 1: Learn time series features. The vector composed of all features at the pth moment can be expressed as X p ∈R 1×N , let X p Z with the same dimensions p Represents the currently accumulated learned time series information. Z0 is a zero vector, so calculate Z p Not only does it require the current input X p , we also need the time series feature Z of the previous moment p-1 , the specific calculation formula is:
[0053] Z p =f(X p α z +Z p-1 U+β z )
[0054] Among them, f represents the activation function such as sigmoid, α z and U is a randomly generated weight matrix, β z represents the bias. After w iterations, Z w Contains all the time series features learned from w moments, Z w The calculation formula is:
[0055] Z w =f(X w α z +Z w-1 U+β z )
[0056] Z w After the weight matrix W z Connect to output Y, W z It reflects the impact of timing characteristics on the output.
[0057] Step 2: Learn the importance of words. Take time p as an example,p As input, word importance H p ,p=1,2,...,w is calculated as:
[0058] H p =g(X p α h +β h )
[0059] Among them, g is the activation function, α h and β h For randomly generated weights and biases, the obtained H p The dimension is N×m. p ,p=1,2,...w through the weight matrix W h Connected to the output Y, it reflects the influence of each word on the output.
[0060] Step 3: Calculate the weight matrix W.
[0061] Weight matrix W = [W z |W h ] is the weight matrix connecting the features and the output layer. Solving this matrix by ridge regression can simultaneously learn the time series features Z w And the word importance [H1,H2,...,H w ]The influence of the output is calculated as follows:
[0062] W=A + Y
[0063] A + =(A T A) -1 A T
[0064] A=[Z k |H1,...,H w ]
[0065] After training RBLS, the residual of RBLS is predicted by a fully connected neural network (preferably) to further reduce the error. The number of neurons in the input layer of the fully connected layer is equal to the number of inputs q, and the number of neurons in the output layer is 1 to achieve the regression task.
[0066] Take a labeled sample X∈R N·w For example, we first look for the most similar sample X~ from the unlabeled samples, and the similarity measure is the Euclidean distance:
[0067]
[0068] X and the previous q-1 samples, and the previous q-1 samples are simultaneously input into RBLS to obtain the predicted power value sequence [y T-q ,y T-q+1 ,...,y T ]and [y T-q ,y T-q+1 ,...,y T ]The expected output of the fully connected neural network is the residual of X, and the expected output of the latter is [y T-q ,y T-q+1 ,...,y T ] output. Therefore, as a preferred method, the loss value L of the fully connected neural network can be calculated by calculating the mean square error L MSE Sum square error L SQR .
[0069] Step 1: Calculate the mean square error. The input a of the previous layer l The calculation process of passing the vector to the next layer is:
[0070] a l =f(a l-1 w l +b l )
[0071] Among them, w l and b l is the weight matrix and bias between the l-1 and l layers, f is the activation function, and since the last layer has only one neuron, the mean square error loss
[0072] L MSE =(ya o ) 2
[0073] Among them, y is the actual residual of X after RBLS prediction, a o is the output of the fully connected neural network.
[0074] Step 2: Calculate the square difference. T-q ,y T-q+1 ,...,y T ]The output of the fully connected neural network is a o , The corresponding output is because is a random augmented sample of X and the fully connected neural network has dropout, a o and The probability is that they are not equal. The closer the two values are, the stronger the generalization of the model is. The square error is calculated as
[0075]
[0076] Step 3: Fusion loss value. MSE Sum square difference L SQR The loss L of the fully connected neural network is calculated as follows:
[0077] L=λL MSE +μL SQR
[0078] After that, the parameters are updated through the back-propagation algorithm, and steps one to three are repeated until the error is less than the threshold or the set number of cycles is reached.
[0079] Flowchart visible Figure 2 In general, this embodiment proposes to apply the semi-supervised learning active perception algorithm of time series width learning and residual prediction network stacking to photovoltaic cluster power generation prediction. First, the photovoltaic data time series features are extracted through RBLS, and then the semi-supervised learning method is used to train the fully connected neural network to predict the RBLS residual. Active perception is added to find random enhanced samples of labeled data in unlabeled samples, which improves the prediction accuracy and algorithm generalization ability.
[0080] Embodiment 2
[0081] A photovoltaic power prediction method uses the photovoltaic power prediction model constructed by the construction method described in the first embodiment to perform photovoltaic power prediction.
[0082] Power prediction is to use historical photovoltaic data to predict the power at a certain moment in the future. The relevant technical solution is the same as that in Example 1 and will not be repeated here.
[0083] Embodiment 3
[0084] The present application also relates to an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.
[0085] The electronic device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The memory may be used to store computer programs and / or modules, and the processor may perform various functions of the electronic device by running or executing computer programs and / or modules stored in the memory, and calling data stored in the memory.
[0086] The relevant technical solution is the same as that in Embodiment 1 and will not be described in detail here.
[0087] Embodiment 4
[0088] The present application also relates to a computer-readable storage medium having a computer program stored thereon, and the steps of the above method are implemented when the computer program is executed by a processor.
[0089] Specifically, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as a hard disk, an internal memory, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0090] The relevant technical solution is the same as that in Embodiment 1 and will not be described in detail here.
[0091] It will be easily understood by those skilled in the art that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for constructing a photovoltaic power prediction model, characterized in that: include: Construct a training sample set, where the dimension of each training sample is N*w, where N is the characteristic dimension of the photovoltaic time series data and w is the time width; The training sample set with power labels is used to construct RBLS as a preliminary power prediction module; Construct a residual prediction network: Find the training sample most similar to each training sample X with power label from the training sample set without power label respectively. Input the X and the first q training samples with power labels adjacent to it in time into RBLS respectively to obtain the first predicted power sequence. The first q power-free label data samples adjacent to it in time are input into RBLS to obtain the second predicted power sequence. The first predicted power sequence is input into the residual prediction network to output the residual a of the predicted power of X. o , input the second prediction power sequence into the residual prediction network, and output the The residual of the predicted power With a o is equal to the true residual and a o With a~ o Taking equality as the goal, optimizing the residual prediction network parameters; The constructed RBLS and residual prediction network are used as the photovoltaic power prediction model to complete the construction, wherein the output of the residual prediction network is used to compensate for the RBLS power prediction error.
2. The construction method according to claim 1, characterized in that: The residual prediction network is a fully connected neural network.
3. The construction method according to claim 1, characterized in that: The mean square error L MSE Indicates a o The deviation from the true residual is expressed as the square error L SQR Indicates a o and The deviation between .
4. The construction method according to claim 1, characterized in that: Find the most similar training samples by using the Euclidean distance between samples 5. The construction method according to claim 1, characterized in that: The implementation method of constructing RBLS is as follows: For each training sample X with a power label, learn the N-dimensional features of the current moment and the time series features of the previous moment in chronological order, and obtain the data time series features in the data sample before the current moment as the time series features of the current moment. The initial time series features are preset to 0. At the same time, learn the word importance of the N-dimensional features at each moment in the data sample; convert the time series feature Z corresponding to the wth moment of each X w And the word importance of N-dimensional features at each moment is concatenated to form a feature vector; through ridge regression, according to the power label value and feature vector corresponding to each X, the time series feature corresponding to the last moment in the data sample with dimension N*w is calculated to map to the output weight of the RBLS power output layer and the word importance mapping corresponding to each moment to obtain the output weight of the RBLS power output layer, and obtain RBLS.
6. The construction method according to claim 5, characterized in that: The following method is used to learn the N-dimensional features of the current moment and the time series features of the previous moment: Z p =f(X p α z +Z p-1 U+β z ) In the formula, Z p is the data time series feature corresponding to the current moment p, f(·) is the activation function, X p is the N-dimensional feature of p at the current moment, Z p-1 is the data time series feature corresponding to the previous moment p-1, α z and U are randomly generated weight matrices, β z For bias.
7. The construction method according to claim 5, characterized in that: The word importance learning is performed in the following way: H p =g(X p a h +b h ) In the formula, H p is the word importance of the N-dimensional feature at time p, X p is the N-dimensional feature at time p, g(·) is the activation function, α h and β h are randomly generated weight matrices and biases.
8. The construction method according to any one of claims 1 to 6, characterized in that: The training sample set is constructed as follows: the normalized photovoltaic time series data containing N-dimensional features is divided into sliding segments along the time axis with a window of shape N*w at a preset step size t to obtain a training sample set; where w is the time width of each window.
9. A photovoltaic power prediction method, characterized in that: Photovoltaic power prediction is performed using the photovoltaic power prediction model constructed by the construction method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored computer program, wherein when the computer program is executed by a processor, the device where the storage medium is located is controlled to perform the steps of any one of the methods according to claims 1 to 7.
Citation Information
Patent Citations
Weather type index interval-based photovoltaic power prediction method, terminal and medium
CN112862630A
Photovoltaic power prediction method and device and server
CN113191564A
Photovoltaic power generation power prediction method based on combined machine learning model and application thereof
CN115860177A
Smart power grid short-term load prediction method and system and storage medium
CN116054156A
Photovoltaic power prediction method and device, terminal equipment and storage medium
CN116894517A