Ultra-short-term photovoltaic power prediction method based on correlation region photovoltaic power similarity and convolutional layer feature extraction
By using photovoltaic power similarity and convolutional layer feature extraction in photovoltaic power generation prediction, an effective ultra-short-term photovoltaic power prediction method is constructed, which solves the problem of low prediction accuracy in the existing technology and achieves higher prediction Accuracy and adaptability.
Patent Information
- Application Number
- CN202411540944.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-31
- Publication Date
- 2025-02-21
- Estimated Expiration
- 2044-10-31
AI Technical Summary
The existing photovoltaic power prediction methods ignore the correlation between different photovoltaic power stations, resulting in low prediction accuracy.
An ultra-short-term photovoltaic power prediction method based on photovoltaic power similarity and convolutional layer feature extraction in related areas is proposed. By constructing a photovoltaic power prediction model in related areas and this region, the convolutional layer extracts features to enhance the prediction ability of the model.
It significantly improves the prediction accuracy of ultra-short-term photovoltaic power generation power, enhances the model's adaptability under different meteorological conditions, and ensures the validity of data and the reliability of prediction results.
Smart Images

Figure CN119496118A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of photovoltaic power generation prediction, and more specifically, to an ultra-short-term photovoltaic power prediction method based on photovoltaic power similarity in related regions and convolutional layer feature extraction. Background Art
[0002] Photovoltaic power generation forecasting is essential for optimizing energy management and grid stability. Accurate forecasting can enhance the integration of solar energy into the power system, reduce dependence on fossil fuels, and minimize operating costs. By forecasting photovoltaic power generation, power companies can better balance supply and demand and improve the utilization of renewable energy.
[0003] Most of the existing photovoltaic power prediction methods only consider the prediction of a single photovoltaic power station, ignoring the correlation between different photovoltaic power stations. Since different photovoltaic power stations in the same region have similar geographical conditions and weather patterns, there are spatiotemporal coupling characteristics between photovoltaic power stations. If this coupling relationship can be properly considered, it will help improve the prediction accuracy of photovoltaic power. In the field of power forecasting, multi-task learning is considered to be an effective method for mining the coupling relationship between different objects. However, traditional multi-task learning models cannot distinguish between the unique information of different prediction tasks and the coupling information between tasks, resulting in information interference in the prediction process and generally poor prediction results. Summary of the invention
[0004] In order to solve the problem of low prediction accuracy of ultra-short-term photovoltaic power generation, the present invention breaks through the traditional modeling method using limited information, and innovatively proposes an ultra-short-term photovoltaic power prediction method based on the photovoltaic power prediction value of the relevant region as a model reference, and uses the convolution layer to extract features from the data. This method deeply mines the similarities in the photovoltaic power of the relevant region, extracts potential useful information, and uses the convolution layer to extract data features, ensuring the validity of the data and preventing data redundancy, thereby significantly improving the prediction accuracy of ultra-short-term photovoltaic power generation.
[0005] To achieve the above objectives, the present invention provides an ultra-short-term photovoltaic power prediction method based on photovoltaic power similarity in related regions and convolutional layer feature extraction, which specifically includes the following steps:
[0006] Step S1: preprocessing the historical power data and weather data, including missing value processing, normalization and data set division;
[0007] Step S2: performing correlation analysis on the power data of the relevant area and the power data of the current area to ensure that the reference model used has sufficient correlation with the current area;
[0008] Step S3: Construct a photovoltaic power prediction model for related areas, use the characteristics of related areas, pre-train prediction values, and transfer the knowledge of the source model to the new task through the similarity of related areas; the photovoltaic power prediction model for related areas is a feedforward neural network used to process 7-dimensional input features, and the output is a single probability value after passing through several dense layers;
[0009] Step S4: Construct a photovoltaic power prediction model for this region, use adaptive multi-scale feature fusion to extract input layer features, reduce model complexity, use convolution kernels of different sizes, extract features at multiple time scales, and use an adaptive weight mechanism to dynamically adjust the contribution of each feature; the photovoltaic power prediction model for this region takes two inputs as model inputs, passes through convolution and fully connected network layers, and outputs a prediction value;
[0010] Step S5: setting model-related training parameters, using early stopping mechanism and model checkpoints, observing the state of the model training process, ensuring the validity of the model results, and detecting whether gradient explosion occurs, in order to prevent overfitting of the photovoltaic power prediction model of the relevant region and the photovoltaic power prediction model of the region and save the optimal weights in the model training;
[0011] Step S6: Using MAPE, RMSE, R 2 And MAE evaluation indicators are used to evaluate the prediction results.
[0012] Furthermore, the data set division in step S1 is specifically as follows: the last 10% of the data set is used as a test set to verify the effectiveness of the model; the first 80% of the first 90% of the data set is used as a training set for training model parameters and fitting data; the last 20% of the data set is used as a validation set to evaluate the performance of the model on unseen data.
[0013] Furthermore, the normalization in step S1 uses the maximum and minimum normalization method to normalize the data set. For a feature x in a given data set, assume that its minimum value is x min , the maximum value is x max , the normalized formula is:
[0014]
[0015] Where: x is a sample value in the original data, x min is the minimum value of the feature in the data set, x max is the maximum value of the feature in the data set, and x' is the normalized value, usually in the range of [0,1].
[0016] Furthermore, the missing value processing in step S1 is performed by deleting missing values.
[0017] Furthermore, in step S2, the correlation analysis of the power data of the relevant area and the power data of the current area is performed by using the Pearson correlation coefficient to analyze the correlation between the photovoltaic power data of the relevant area and the target area; the Pearson correlation coefficient is used to measure the strength and direction of the linear relationship between two variables, and its value ranges from -1 to 1. A value of 1 indicates a complete positive correlation, -1 indicates a complete negative correlation, and 0 indicates no linear correlation. The calculation formula is as follows:
[0018]
[0019] Where: x i and i are the sample values of the two variables. and are the means of variables x and y respectively. n is the number of samples.
[0020] Furthermore, the photovoltaic power prediction model for the relevant area includes:
[0021] Input layer: The input layer receives an input vector with 7 features;
[0022] The first fully connected layer: This layer is a dense layer containing 128 neurons, the activation function is SELU, and "lecun_normal" is used as the weight initialization method;
[0023] The second fully connected layer: This layer is also a dense layer, containing 64 neurons, the activation function is also SELU, and the same weight initialization method is used. This layer receives the output from the previous layer;
[0024] The third fully connected layer: This layer has 24 neurons, also uses SELU as the activation function, and is initialized with "lecun_normal". This layer receives the output from the previous layer (64 neurons layer);
[0025] Output layer: The output layer is a dense layer containing 1 neuron and uses the Sigmoid activation function; this output layer is used for binary classification tasks; Sigmoid compresses the output value to between 0 and 1 to represent probability.
[0026] Furthermore, the photovoltaic power prediction model for the region combines a pre-trained model with a newly defined convolutional neural network module to process a combination of two input data for classification tasks; establishing the photovoltaic power prediction model for the region specifically includes the following steps:
[0027] (1) Establishing a frozen model: The predefined model is set to a non-trainable state; the pre-trained model processes a 7-dimensional input vector and generates a single probabilistic output through several layers of fully connected networks; the pre-trained model is a frozen model;
[0028] (2) Input data: The model accepts a new 7-dimensional input vector, which is combined with the output of the frozen model;
[0029] (3) Feature concatenation: The output of the frozen model is concatenated with the new input through the Concatenate layer. This operation concatenates the two sets of features together to form a larger feature vector.
[0030] (4) Convolutional layer processing: Use three convolutional layers of different sizes, with convolution kernels of 1, 3, and 5 respectively. The number of output channels of each convolutional layer is 2, the activation function is SELU, and the weight initialization method is "lecun_normal". The convolution results are concatenated on the last dimension through the concatenate layer operation to form a feature tensor that integrates multiple convolutions. The concatenated tensor is flattened into a one-dimensional vector using the flattening layer, ready to enter the adaptive weight module. In the adaptive weight module, three adaptive weights are generated through a fully connected layer, and the softmax activation function is used to ensure that the sum of the weights is 1. The weights are then adjusted to match the dimension of the convolution output. These weights are used to perform weighted fusion on the output of the convolution layer. The weights are multiplied by the corresponding convolution output and the results are summed to obtain the weighted fused feature output.
[0031] (5) Establish a flattening layer: The output after convolution is flattened into a 1D vector through the Flatten layer, ready to be input into the subsequent fully connected layer;
[0032] (6) Establish fully connected layers: the first layer has 128 neurons and uses SELU activation function; the second layer has 64 neurons and uses SELU activation function; the third layer has 24 neurons and uses SELU activation function;
[0033] (7) Establish the output layer: The output layer is a single neuron that uses the Sigmoid activation function to map the output of the previous layer to a predicted value between 0 and 1.
[0034] Furthermore, the early stopping mechanism and model checkpoints are used as follows:
[0035] Set model checkpoint: save the best weights of the model to a specified file, only save when the validation set loss reaches the minimum value, and only save the weights;
[0036] Establish an early stopping mechanism: monitor the validation set loss. If the loss does not improve within 20 epochs, training will stop early and revert to the best model weights.
[0037] Model compilation: The model uses the Adam optimizer and the loss function is the mean square error;
[0038] Model training: The model is trained on the training data with a maximum of 1000 training cycles and 96 samples per batch, and is validated using validation data. The training process uses an early stopping mechanism and model checkpoints to control training.
[0039] Furthermore, in step S6, MAPE measures the average percentage error between the predicted value and the true value, and its formula is:
[0040]
[0041] Where n is the number of samples; y i is the true value of the i-th sample; is the predicted value of the i-th sample; MAPE represents the percentage of the average relative error between the predicted value and the true value; it is applicable when both the predicted value and the actual value are not zero;
[0042] The RMSE measures the standard deviation between the predicted value and the true value, and its formula is:
[0043]
[0044] Where n is the number of samples; y i is the true value of the i-th sample. is the predicted value of the i-th sample;
[0045] R 2 The goodness of fit of the model is measured, indicating how much variance the model explains. The formula is:
[0046]
[0047] in, is the mean of the actual values; n is the number of samples; y i is the true value of the i-th sample; is the predicted value of the i-th sample; R 2 The value range is from 0 to 1. The closer it is to 1, the stronger the explanatory power of the model. 2 If it is negative, it means that the model performs worse than the simple mean model;
[0048] MAE measures the average absolute error between the predicted value and the true value, and its formula is:
[0049]
[0050] in, is the mean of the actual values; n is the number of samples; y i is the true value of the i-th sample; is the predicted value of the i-th sample; MAE is an easy-to-interpret indicator that represents the average error between the predicted value and the true value.
[0051] The beneficial effects of the present invention are as follows:
[0052] 1. The present invention proposes a coupled information separation and extraction multi-task learning prediction method for multi-station photovoltaic power prediction. By introducing the photovoltaic power prediction value of the relevant area as a model reference and using the convolution layer for feature extraction, the present invention effectively mines the potential similarities in the photovoltaic power data. This method ensures the validity of the data and prevents the interference of redundant information, thereby significantly improving the prediction accuracy of ultra-short-term photovoltaic power generation and enhancing the adaptability of the model under different meteorological conditions.
[0053] 2. The training and evaluation process of the optimization model of the present invention: Through the systematic step design, including data preprocessing, correlation analysis and setting of model training parameters, the present invention realizes the comprehensive optimization of model performance. Multiple evaluation indicators (such as MAPE, RMSE, R 2 The application of MAE makes the evaluation of prediction results more comprehensive and reliable, further improving the practicability and generalizability of the model. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for describing the embodiments are briefly introduced below.
[0055] Figure 1 This is a general framework diagram of an ultra-short-term photovoltaic power prediction method based on photovoltaic power similarity in related regions and convolutional layer feature extraction according to an embodiment of the present invention;
[0056] Figure 2 This is a complete structural diagram of the model of an embodiment of the present invention. DETAILED DESCRIPTION
[0057] The technical scheme in the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiment of the present invention. Obviously, the described embodiment is only a part of the embodiment of the present invention, not all of the embodiments. Based on the embodiment of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0058] In the description of the present invention, it should be noted that the terms "center", "up", "down", "left", "right", "vertical", "horizontal", "inside", "outside", etc. indicate directions or positional relationships based on the directions or positional relationships shown in the accompanying drawings. They are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific direction, be constructed and operated in a specific direction. Therefore, they cannot be understood as limitations on the present invention.
[0059] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected" and "connected" should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal connection of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances. In addition, the technical features involved in the different embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0060] like Figure 1 As shown, an embodiment of the present invention provides an ultra-short-term photovoltaic power prediction method based on photovoltaic power similarity in related regions and convolutional layer feature extraction, comprising the following steps:
[0061] Step S1: Preprocess the historical power data and weather data, including missing value processing, normalization, and data set partitioning.
[0062] Dataset division: The last 10% of the dataset is used as a test set to verify the effectiveness of the model. The first 80% of the first 90% of the dataset is used as a training set for training model parameters and fitting data. The last 20% of the dataset is used as a validation set to evaluate the performance of the model on unseen data and help select the optimal model structure and hyperparameter settings (such as learning rate, regularization parameters, etc.). Through the performance of the validation set, researchers can determine whether the model is overfitting or underfitting.
[0063] Normalization: Apply the maximum and minimum normalization method to normalize the data set. Normalization can accelerate model training, improve model performance and generalization, avoid feature dominance problems, and ensure that all features are treated equally at the same scale. It is especially important for algorithms that rely on feature numerical values, such as distance metric algorithms and deep learning.
[0064] Min-Max Normalization is a commonly used data preprocessing method, which is mainly used to scale the data to a specified range (usually [0, 1] or [-1, 1]) to eliminate the impact of different feature scales on model training. After normalization, each feature of the data is in the same range, which facilitates better learning and optimization of the model.
[0065] For a feature x in a given dataset, assume that its minimum value is x min , the maximum value is x max , the normalized formula is:
[0066]
[0067] Where: x is a sample value in the original data. min is the minimum value of the feature in the data set. max is the maximum value of the feature in the data set. x' is the normalized value, usually in the range [0,1].
[0068] The maximum and minimum normalization maintains the relative relationship of the original data, scaling the data in different ranges to a unified range, ensuring that each feature has the same weight during model training. It is sensitive to extreme values, and may cause most of the data to be compressed due to extreme values, affecting the effective learning of the model.
[0069] Missing value processing: Missing value processing methods include deleting missing records or features, filling with mean, median or mode, filling based on neighboring data (such as KNN), and predicting missing values through machine learning models. Other methods include multiple interpolation and encoding missing values as special categories. The specific choice depends on the data characteristics and analysis objectives. In ultra-short-term photovoltaic power forecasting, slight deviations in the filled values will also affect the accuracy of the data. In an embodiment of the present invention, the missing value processing adopts the method of deleting missing values to ensure the validity and rationality of the remaining data, while reducing the difficulty of implementation.
[0070] Step S2: Perform correlation analysis on the power data of the relevant area and the power data of the current area to ensure that the reference model used has sufficient correlation with the current area.
[0071] The Pearson correlation coefficient is used to analyze the correlation of the photovoltaic power data of the two regions (the relevant region and the target region). The Pearson correlation coefficient is used to measure the strength and direction of the linear relationship between two variables, and its value ranges from -1 to 1. A value of 1 indicates a complete positive correlation, -1 indicates a complete negative correlation, and 0 indicates no linear correlation. Its calculation formula is as follows:
[0072]
[0073] Where: x i and i are the sample values of the two variables. and are the means of variables x and y respectively. n is the number of samples.
[0074] The mathematical explanation is the ratio of the covariance to the product of the standard deviation. After standardization, the coefficient range is fixed between -1 and 1. The Pearson correlation coefficient is suitable for measuring the linear relationship between continuous variables, but it is not applicable to nonlinear relationships or categorical data. The distribution characteristics of the data should also be considered when using it.
[0075] Step S3: Construct a photovoltaic power prediction model for related areas, use the characteristics of related areas, pre-train the prediction values, and effectively transfer the knowledge of the source model to the new task through the similarity of related areas, thereby enhancing the generalization ability of the model and avoiding overfitting.
[0076] The photovoltaic power prediction model for the relevant area is a simple feedforward neural network specially designed to process 7-dimensional input features. The specific model structure is as follows Figure 2 As shown, the following is a detailed description of the model structure:
[0077] (1) Input layer: The input layer receives an input vector with 7 features.
[0078] (2) The first fully connected layer: This layer is a dense layer (Dense), containing 128 neurons, the activation function is SELU (Scaled Exponential Linear Unit), and uses "lecun_normal" as the weight initialization method. SELU is usually used with "lecun_normal" initialization to ensure the self-normalization property, which is particularly beneficial for deep networks.
[0079] (3) The second fully connected layer: This layer is also a dense layer, containing 64 neurons, the activation function is also SELU, and the same weight initialization method is used. This layer receives the output from the previous layer (128 neurons layer).
[0080] (4) The third fully connected layer: This layer has 24 neurons, also uses SELU as the activation function, and is initialized with "lecun_normal". This layer receives the output from the previous layer (64 neurons).
[0081] (5) Output layer: The final output layer is a dense layer containing 1 neuron, using the Sigmoid activation function. This output layer is usually used for binary classification tasks because Sigmoid compresses the output value to between 0 and 1, indicating probability.
[0082] Model definition: The model is defined using the Model class, specifying the input as a 7-dimensional feature vector and the output as a single probability value after passing through several dense layers.
[0083] Model summary: This neural network contains three fully connected layers with a moderate number of layers and a gradually decreasing number of neurons, which is suitable for classification tasks with a small number of features. The SELU activation function combined with the "lecun_normal" initialization makes the network more stable in depth. The final output layer uses the Sigmoid function to convert the network output into a probability value between 0 and 1, which is suitable for binary classification tasks, such as the classification of whether a certain feature or event exists.
[0084] Step S4: Construct a photovoltaic power prediction model for this region, use adaptive multi-scale feature fusion to extract input layer features, reduce model complexity, use convolution kernels of different sizes, extract features at multiple time scales, and use an adaptive weight mechanism to dynamically adjust the contribution of each feature, thereby improving the model's ability to respond to complex changes in photovoltaic power.
[0085] This neural network model combines a pre-trained model with a newly defined convolutional neural network module to process the combination of two input data, possibly for classification tasks. The following is a detailed analysis of the model structure:
[0086] (1) Frozen model: The predefined model is set to a non-trainable state, that is, its weights will not be updated during the training process. This is often used for transfer learning, which uses the feature extraction capabilities of an existing model to avoid retraining the entire model. The pre-trained model processes a 7-dimensional input vector and generates a single probability output through several layers of fully connected networks.
[0087] (2) Input data: The model accepts a new 7-dimensional input vector. This input data is combined with the output of the frozen model.
[0088] (3) Feature concatenation: The output of the frozen model is concatenated with the new input through the Concatenate layer. This operation concatenates the two sets of features together to form a larger feature vector.
[0089] (4) Convolutional layer processing: First, three convolutional layers (Conv1D) of different sizes are used, with convolution kernels of 1, 3, and 5 respectively. The number of output channels of each convolutional layer is 2, the activation function is SELU, and the weight initialization method is "lecun_normal". The results of the convolution are concatenated on the last dimension through the concatenate layer operation to form a feature tensor that integrates multiple convolutions. Then, the concatenated tensor is flattened into a one-dimensional vector using the flattening layer, ready to enter the adaptive weight module. In this module, three adaptive weights are generated through a fully connected layer, and the softmax activation function is used to ensure that the sum of the weights is 1. The weights are then adjusted to match the dimension of the convolution output. Finally, these weights are used to perform weighted fusion on the output of the convolution layer. The weights are multiplied by the corresponding convolution output and the results are summed to obtain the weighted fused feature output.
[0090] (5) Flatten layer: The output after convolution is flattened into a 1D vector through the Flatten layer, ready to be input into the subsequent fully connected layer.
[0091] (6) Fully connected layers: The first layer has 128 neurons and uses the SELU activation function. The second layer has 64 neurons and uses the SELU activation function. The third layer has 24 neurons and uses the SELU activation function.
[0092] (7) Output layer: The output layer is a single neuron that uses the Sigmoid activation function to map the output of the previous layer to a predicted value between 0 and 1.
[0093] Overall model definition: The final model takes two inputs as model inputs, passes through the above convolutional and fully connected network layers, and outputs a predicted value.
[0094] Summary: The model is a complex combination model, which is mainly divided into two parts: one is a frozen pre-trained model, and the other is a new network containing convolutional and fully connected layers. Through feature connection, the model combines the feature information of the two inputs, and further extracts temporal or local patterns through convolutional layers, and finally processes the features through several layers of fully connected layers and outputs a classification probability. This model is suitable for complex classification tasks that combine prior knowledge (through frozen models) and new features.
[0095] Step S5: Set model-related training parameters, establish an early stopping mechanism and model checkpoints, observe the state of the model during training, ensure the validity of the model results, detect whether gradient explosion occurs, and prevent model overfitting and save the optimal weights in model training.
[0096] During the training process, the code uses model checkpoints and early stopping mechanisms to optimize the model training process:
[0097] (1) Model checkpoint: Save the best weights of the model to a specified file, only save when the validation set loss reaches the minimum value, and only save the weights.
[0098] (2) Early stopping mechanism: monitor the validation set loss. If the loss does not improve within 20 epochs, training will stop early and restore to the best model weights.
[0099] (3) Model compilation: The model uses the Adam optimizer and the loss function is the mean square error (MSE).
[0100] (4) Model training: The model is trained on the training data, with a maximum of 1000 training cycles and 96 samples per batch, and is validated using the validation data. The training process uses an early stopping mechanism and model checkpoints to control the training.
[0101] Step S6: Using MAPE, RMSE, R 2 And MAE evaluation indicators are used to evaluate the prediction results.
[0102] When evaluating the prediction effect of the regression model, the following four common evaluation indicators can be used: MAPE, RMSE, R 2 , MAE. The definition of the indicator is as follows:
[0103] (1) Mean absolute percentage error (MAPE):
[0104] Definition: MAPE measures the average percentage error between the predicted value and the true value. Its formula is:
[0105]
[0106] Where n is the number of samples. i is the true value of the i-th sample. is the predicted value of the i-th sample. MAPE is an intuitive measurement indicator that represents the percentage of the average relative error between the predicted value and the true value. It is applicable when both the predicted value and the actual value are not zero.
[0107] (2) Root mean square error (RMSE):
[0108] Definition: RMSE measures the standard deviation between the predicted value and the true value. Its formula is:
[0109]
[0110] Where n is the number of samples. i is the true value of the i-th sample. is the predicted value of the ith sample. RMSE is more sensitive to large errors because the errors are amplified by square. Therefore, it can effectively reflect the impact of large errors in the predicted values.
[0111] 1) Coefficient of determination (R 2 ):
[0112] Definition: R 2 It measures the goodness of fit of the model and indicates how much variance the model explains. The formula is:
[0113]
[0114] in, is the mean of the actual values. n is the number of samples. i is the true value of the i-th sample. is the predicted value of the i-th sample. 2 The value range is from 0 to 1. The closer it is to 1, the stronger the explanatory power of the model. 2 If it is negative, it means that the model performs worse than the simple mean model.
[0115] 2) Mean Absolute Error (MAE):
[0116] Definition: MAE measures the mean absolute error between the predicted value and the true value. Its formula is:
[0117]
[0118] in, is the mean of the actual values. n is the number of samples. i is the true value of the i-th sample. is the predicted value of the i-th sample. MAE is an easy-to-interpret indicator that represents the average error between the predicted value and the true value. Compared with RMSE, MAE is less sensitive to outliers.
[0119] Summarize:
[0120] 1) MAPE is suitable for measuring relative errors, especially on data of different scales.
[0121] 2) RMSE focuses more on larger errors, so it has a greater advantage when the error distribution is uneven.
[0122] 3) R 2 Used to measure the overall fit of the model.
[0123] 4) MAE is an easy-to-understand metric that represents the average error and is suitable for scenarios where all errors are equally important.
[0124] Through the comprehensive evaluation of these indicators, we can fully understand the predictive performance of the model and find improvement directions suitable for specific application scenarios.
[0125] Example:
[0126] The actual photovoltaic power in Guangdong No. 1352 area is used as an example for analysis. The data includes photovoltaic power data from June 21, 2022 to September 29, 2022, a total of 101 days of data, of which the last 10% is used as a test set, the first 80% of the first 90% of the data is used as a training set, and the last 20% of the data is used as a validation set. First, the historical power data and weather data are preprocessed, including missing value filling, normalization, and data set division. Then, the correlation between the power data of the target area and the related areas is analyzed by methods such as the Pearson correlation coefficient, and the regional data with strong correlation with this area is screened out. Then, a photovoltaic power prediction model is constructed based on the data of these related areas, and the training set is used for model training and verification. Subsequently, a photovoltaic power prediction model for this area is constructed, combining the weather data, historical power data and prediction results of the related areas in this area as input, using a convolutional neural network (CNN) to extract features, and further processed through the hidden layer to finally output the prediction results. When training the model, you need to set the optimizer (such as Adam), loss function (MSE) and hyperparameters (such as learning rate, batch size, etc.), and use early stopping strategy and hyperparameter tuning to improve model performance. Finally, use MAPE, RMSE, R 2 The model was evaluated by evaluation indicators such as MAE to verify its prediction accuracy and optimize the adjustment. Through this process, the prediction accuracy of photovoltaic power in Guangdong can be effectively improved. A comparative experiment was conducted. The first group had no relevant regional pre-training structure and convolutional layer, the second group had no relevant regional pre-training structure, and the third group had relevant regional photovoltaic power prediction model and local photovoltaic power prediction model. The MAPE results were 32.11%, 32.17% and 30.93% respectively. The RMSE results were 16.67MW, 16.87MW and 15.96MW respectively. It shows that the method of the present invention has higher prediction accuracy.
[0127] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. An ultra-short-term photovoltaic power prediction method based on photovoltaic power similarity in related regions and convolutional layer feature extraction, characterized in that: The specific steps include: Step S1: preprocessing the historical power data and weather data, including missing value processing, normalization and data set division; Step S2: performing correlation analysis on the power data of the relevant area and the power data of the current area to ensure that the reference model used has sufficient correlation with the current area; Step S3: Construct a photovoltaic power prediction model for related areas, use the characteristics of related areas, pre-train prediction values, and transfer the knowledge of the source model to the new task through the similarity of related areas; the photovoltaic power prediction model for related areas is a feedforward neural network used to process 7-dimensional input features, and the output is a single probability value after passing through several dense layers; Step S4: Construct a photovoltaic power prediction model for this region, use adaptive multi-scale feature fusion to extract input layer features, reduce model complexity, use convolution kernels of different sizes, extract features at multiple time scales, and use an adaptive weight mechanism to dynamically adjust the contribution of each feature; the photovoltaic power prediction model for this region takes two inputs as model inputs, passes through convolution and fully connected network layers, and outputs a prediction value; Step S5: setting model-related training parameters, using early stopping mechanism and model checkpoints, observing the state of the model training process, ensuring the validity of the model results, and detecting whether gradient explosion occurs, in order to prevent overfitting of the photovoltaic power prediction model of the relevant region and the photovoltaic power prediction model of the region and save the optimal weights in the model training; Step S6: Using MAPE, RMSE, R 2 And MAE evaluation indicators are used to evaluate the prediction results.
2. The ultra-short-term photovoltaic power prediction method based on photovoltaic power similarity in related regions and convolutional layer feature extraction according to claim 1 is characterized in that: The data set division in step S1 is specifically as follows: the last 10% of the data set is used as a test set to verify the effectiveness of the model; the first 80% of the first 90% of the data set is used as a training set for training model parameters and fitting data; the last 20% of the data set is used as a validation set to evaluate the performance of the model on unseen data.
3. The ultra-short-term photovoltaic power prediction method based on photovoltaic power similarity in related regions and convolutional layer feature extraction according to claim 1 is characterized in that: The normalization in step S1 uses the maximum and minimum normalization method to normalize the data set. For a feature x in a given data set, assume that its minimum value is x m i n , the maximum value is x max , the normalized formula is: Where: x is a sample value in the original data, x min is the minimum value of the feature in the data set, x max is the maximum value of the feature in the data set, and x' is the normalized value, usually in the range of [0,1].
4. The ultra-short-term photovoltaic power prediction method based on photovoltaic power similarity in related regions and convolutional layer feature extraction according to claim 1 is characterized in that: The missing value processing in step S1 is performed by deleting missing values.
5. The ultra-short-term photovoltaic power prediction method based on photovoltaic power similarity in related regions and convolutional layer feature extraction according to claim 1 is characterized in that: In step S2, the correlation analysis of the power data of the relevant area and the power data of the current area is performed by using the Pearson correlation coefficient to analyze the correlation of the photovoltaic power data of the relevant area and the target area; the Pearson correlation coefficient is used to measure the strength and direction of the linear relationship between two variables, and its value ranges from -1 to 1. A value of 1 indicates a complete positive correlation, -1 indicates a complete negative correlation, and 0 indicates no linear correlation. The calculation formula is as follows: Where: x i and i are the sample values of the two variables. and are the means of variables x and y respectively. n is the number of samples.
6. The ultra-short-term photovoltaic power prediction method based on photovoltaic power similarity in related regions and convolutional layer feature extraction according to claim 1 is characterized in that: The photovoltaic power prediction model for the relevant area includes: Input layer: The input layer receives an input vector with 7 features; The first fully connected layer: This layer is a dense layer containing 128 neurons, the activation function is SELU, and "lecun_normal" is used as the weight initialization method; The second fully connected layer: This layer is also a dense layer, containing 64 neurons, the activation function is also SELU, and the same weight initialization method is used. This layer receives the output from the previous layer; The third fully connected layer: This layer has 24 neurons and also uses SELU as the activation function. "lecun_normal" is initialized. This layer receives the output from the previous layer; Output layer: The output layer is a dense layer containing 1 neuron and uses the Sigmoid activation function; this output layer is used for binary classification tasks; Sigmoid compresses the output value to between 0 and 1 to represent probability.
7. The ultra-short-term photovoltaic power prediction method based on photovoltaic power similarity in related regions and convolutional layer feature extraction according to claim 1 is characterized in that: The photovoltaic power prediction model for the region combines a pre-trained model with a newly defined convolutional neural network module to process a combination of two input data for classification tasks; establishing the photovoltaic power prediction model for the region specifically includes the following steps: (1) Establishing a frozen model: The predefined model is set to a non-trainable state; the pre-trained model processes a 7-dimensional input vector and generates a single probabilistic output through several layers of fully connected networks; the pre-trained model is a frozen model; (2) Input data: The model accepts a new 7-dimensional input vector, which is combined with the output of the frozen model; (3) Feature concatenation: The output of the frozen model is concatenated with the new input through the Concatenate layer. This operation concatenates the two sets of features together to form a larger feature vector. (4) Convolutional layer processing: Use three convolutional layers of different sizes, with convolution kernels of 1, 3, and 5 respectively. The number of output channels of each convolutional layer is 2, the activation function is SELU, and the weight initialization method is "lecun_normal". The convolution results are concatenated on the last dimension through the concatenate layer operation to form a feature tensor that integrates multiple convolutions. The concatenated tensor is flattened into a one-dimensional vector using the flattening layer, ready to enter the adaptive weight module. In the adaptive weight module, three adaptive weights are generated through a fully connected layer, and the softmax activation function is used to ensure that the sum of the weights is 1. The weights are then adjusted to match the dimension of the convolution output. These weights are used to perform weighted fusion on the output of the convolution layer, multiplying the weights with the corresponding convolution outputs and summing the results to obtain the weighted fused feature output. (5) Establish a flattening layer: The output after convolution is flattened into a 1D vector through the Flatten layer, ready to be input into the subsequent fully connected layer; (6) Establish fully connected layers: the first layer has 128 neurons and uses SELU activation function; the second layer has 64 neurons and uses SELU activation function; the third layer has 24 neurons and uses SELU activation function; (7) Establish the output layer: The output layer is a single neuron that uses the Sigmoid activation function to map the output of the previous layer to a predicted value between 0 and 1.
8. The ultra-short-term photovoltaic power prediction method based on photovoltaic power similarity in related regions and convolutional layer feature extraction according to claim 1 is characterized by: The use of early stopping mechanism and model checkpoints is as follows: Set model checkpoint: save the best weights of the model to a specified file, only save when the validation set loss reaches the minimum value, and only save the weights; Establish an early stopping mechanism: monitor the validation set loss. If the loss does not improve within 20 epochs, training will stop early and revert to the best model weights. Model compilation: The model uses the Adam optimizer and the loss function is the mean square error; Model training: The model is trained on the training data with a maximum of 1000 training cycles and 96 samples per batch, and is validated using validation data. The training process uses an early stopping mechanism and model checkpoints to control training.
9. The ultra-short-term photovoltaic power prediction method based on photovoltaic power similarity in related regions and convolutional layer feature extraction according to claim 1, characterized in that: In step S6, MAPE measures the average percentage error between the predicted value and the true value, and its formula is: Where n is the number of samples; y i is the true value of the i-th sample; is the predicted value of the i-th sample; MAPE represents the percentage of the average relative error between the predicted value and the true value; it is applicable when both the predicted value and the actual value are not zero; The RMSE measures the standard deviation between the predicted value and the true value, and its formula is: Where n is the number of samples; y i is the true value of the i-th sample. is the predicted value of the i-th sample; R 2 The goodness of fit of the model is measured, indicating how much variance the model explains. The formula is: in, is the mean of the actual values; n is the number of samples; y i is the true value of the i-th sample; is the predicted value of the i-th sample; R 2 The value range is from 0 to 1. The closer it is to 1, the stronger the explanatory power of the model. 2 If it is negative, it means that the model performs worse than the simple mean model; MAE measures the average absolute error between the predicted value and the true value, and its formula is: in, is the mean of the actual values; n is the number of samples; y i is the true value of the i-th sample; is the predicted value of the i-th sample; MAE is an easy-to-interpret indicator that represents the average error between the predicted value and the true value.
Citation Information
Patent Citations
Photovoltaic generation power ultra-short-term prediction method based on similar day fusion intelligent model
CN117290772A
Photovoltaic power station short-term generation power prediction method based on residual neural network
CN117748495A
Distributed photovoltaic power prediction method based on wide-area cooperative training
CN118052338A
Generated power prediction apparatus, server, computer program, and generated power prediction method
JP2018007312A