An ultra-short-term photovoltaic power prediction method based on correlation region photovoltaic power similarity and convolution layer feature extraction

By constructing an ultra-short-term photovoltaic power prediction method based on the similarity of photovoltaic power in related regions and the extraction of convolutional layer features, this method solves the problem of unutilized coupling features between photovoltaic power plants by using the predicted photovoltaic power values ​​in related regions and the extracted convolutional layer features, thus achieving higher prediction accuracy and model adaptability.

CN119496118BActive Publication Date: 2025-11-18GUANGXI POWER GRID CO LTD NANNING POWER SUPPLY BUREAU
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411540944.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-31
Publication Date
2025-11-18
Estimated Expiration
2044-10-31

AI Technical Summary

Technical Problem

Existing photovoltaic power generation prediction methods fail to effectively utilize the spatiotemporal coupling characteristics between different photovoltaic power plants, resulting in low accuracy in ultra-short-term predictions. Furthermore, traditional multi-task learning models cannot distinguish between the unique information of different prediction tasks and the coupling information between tasks, leading to poor prediction results.

Method used

By constructing an ultra-short-term photovoltaic power prediction method based on the similarity of photovoltaic power in related regions and feature extraction from convolutional layers, the method uses the predicted photovoltaic power values ​​in related regions as model references, combines convolutional layers to extract data features, ensures data validity, prevents interference from redundant information, constructs feedforward neural network and convolutional neural network models to extract multi-scale features, and dynamically adjusts feature contributions through an adaptive weight mechanism.

Benefits of technology

It significantly improves the prediction accuracy of ultra-short-term photovoltaic power generation, enhances the model's adaptability under different meteorological conditions, optimizes the model training and evaluation process, and improves the comprehensiveness and reliability of the prediction results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119496118B_ABST
    Figure CN119496118B_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on correlation area photovoltaic power similarity and convolution layer feature extraction ultra-short-term photovoltaic power prediction method, including the following steps: step S1: historical power data and weather data are preprocessed;Step S2: correlation analysis is carried out to relevant area power data and this area power data;Step S3: relevant area photovoltaic power prediction model is constructed;Step S4: this area photovoltaic power prediction model is constructed;Step S5: model correlation training parameter is set;Step S6: MAPE, RMSE, R 2 And MAE evaluation index are used to evaluate prediction results.The application extracts potential useful information by deeply mining the similarity in the relevant area photovoltaic power, and uses convolution layer to extract data features, ensures the effectiveness of data, prevents data redundancy, thereby significantly improves the prediction accuracy of ultra-short-term photovoltaic power generation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of photovoltaic power generation prediction, and more specifically, to an ultra-short-term photovoltaic power prediction method based on the similarity of photovoltaic power in relevant regions and the extraction of convolutional layer features. Background Technology

[0002] Photovoltaic (PV) power generation forecasting is crucial for optimizing energy management and grid stability. Accurate forecasts can enhance the integration of solar energy with the power system, reduce reliance on fossil fuels, and minimize operating costs. By forecasting PV power generation, power companies can better balance supply and demand and improve the utilization of renewable energy.

[0003] Most existing photovoltaic (PV) power generation forecasting methods only consider the forecast of a single PV power plant, ignoring the correlation between different PV power plants. Since different PV power plants in the same region share similar geographical conditions and weather patterns, there are spatiotemporal coupling characteristics between them. Appropriately considering this coupling relationship can help improve the accuracy of PV power generation forecasting. In the field of power forecasting, multi-task learning is considered an effective method for uncovering the coupling relationships between different objects. However, traditional multi-task learning models cannot distinguish between the unique information of different forecasting tasks and the coupling information between tasks, leading to mutual interference during the forecasting process and generally poor forecasting results. Summary of the Invention

[0004] To address the issue of low accuracy in ultra-short-term photovoltaic (PV) power prediction, this invention breaks through the traditional modeling approach that utilizes limited information. It innovatively proposes a method for predicting ultra-short-term PV power based on predicted PV power values ​​from relevant regions as a model reference, and employs convolutional layers for feature extraction. This method deeply mines the similarities in PV power across relevant regions to extract potentially useful information, and utilizes convolutional layers for data feature extraction to ensure data validity and prevent data redundancy, thereby significantly improving the prediction accuracy of ultra-short-term PV power.

[0005] To achieve the above objectives, this invention provides an ultra-short-term photovoltaic power prediction method based on the similarity of photovoltaic power in relevant regions and the extraction of convolutional layer features, specifically including the following steps:

[0006] Step S1: Preprocess historical power data and weather data, including handling missing values, normalization, and dataset partitioning;

[0007] Step S2: Perform correlation analysis on the power data of the relevant regions and the power data of this region to ensure that the reference model used has sufficient correlation with this region;

[0008] Step S3: Construct a photovoltaic power prediction model for relevant regions, utilize the features of relevant regions to pre-train prediction values, and transfer the knowledge of the source model to the new task through the similarity of relevant regions; the photovoltaic power prediction model for relevant regions 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 to reduce model complexity. Use convolutional kernels of different sizes to extract features at multiple time scales and use an adaptive weighting 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 convolutional and fully connected network layers, and outputs a predicted value.

[0010] Step S5: Set the relevant training parameters of the model, use the early stopping mechanism and model checkpoints, observe the state of the model during the training process, ensure the effectiveness of the model results, detect whether gradient explosion occurs, and prevent overfitting of the photovoltaic power prediction model in the relevant region and the photovoltaic power prediction model in this region, and save the optimal weights in the model training.

[0011] Step S6: Utilize MAPE, RMSE, and R 2 The MAE evaluation indicators assess and predict the results.

[0012] Furthermore, the dataset partitioning in step S1 is specifically as follows: the last 10% of the dataset is used as a test set for validating the model's effectiveness; the first 80% of the first 90% of the dataset is used as a training set for training and fitting the model parameters; and the last 20% of the dataset is used as a validation set for evaluating the model's performance on unseen data.

[0013] Furthermore, the normalization in step S1 applies the maximum-minimum normalization method to normalize the dataset. For a given feature x in the dataset, it is assumed that its minimum value is x. min The maximum value is x max The normalization formula is:

[0014]

[0015] Where: x is a sample value in the original data, x min It is the minimum value of this feature in the dataset, x max x is the maximum value of the feature in the dataset, and x' is the normalized value, which is usually in the range [0,1].

[0016] Furthermore, the missing value processing in step S1 is performed using a missing value deletion method.

[0017] Furthermore, in step S2, correlation analysis is performed on the power data of the relevant region and the power data of the local region. This is done using the Pearson correlation coefficient to analyze the correlation between the photovoltaic power data of the relevant region and the target region. The Pearson correlation coefficient measures 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 perfect positive correlation, -1 indicates a perfect negative correlation, and 0 indicates no linear correlation. The calculation formula is as follows:

[0018]

[0019] Where: x i and y i These are sample values ​​of two variables. and These 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 region includes, in sequence:

[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, with the activation function being SELU, and "lecun_normal" being 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 using SELU as the activation function and initialized with "lecun_normal". This layer receives the output from the previous layer (64 neurons).

[0025] Output layer: The output layer is a dense layer containing one neuron, using the sigmoid activation function; this output layer is used for binary classification tasks; the sigmoid function compresses the output value to between 0 and 1, representing the probability.

[0026] Furthermore, the local photovoltaic power prediction model combines a pre-trained model with a newly defined convolutional neural network module to process the combination of two input data for classification tasks; establishing the local photovoltaic power prediction model specifically includes the following steps:

[0027] (1) Establishing a frozen model: The predefined model is set to an untrainable state; the pre-trained model processes a 7-dimensional input vector and generates a single probability output through several layers of fully connected networks; this 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: Three convolutional layers of different sizes are used, with kernel sizes of 1, 3, and 5 respectively. Each convolutional layer has 2 output channels, the activation function is SELU, and the weights are initialized as "lecun_normal". The convolution results are concatenated in the last dimension through a concatenation layer to form a feature tensor that integrates multiple convolutions. A flattening layer is used to flatten the concatenated tensor into a one-dimensional vector, 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. Then, the weights are adjusted to match the dimensions of the convolution output. The outputs of the convolutional layers are weighted and fused using these weights. The weights are multiplied by the corresponding convolution outputs, and the results are summed to obtain the weighted and 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 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.

[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 use of early stopping mechanisms and model checkpoints specifically includes:

[0035] Set model checkpoints: Save the model's optimal weights to a specified file, only when the validation set loss reaches its minimum, and only save the weights;

[0036] Establish an early stopping mechanism: monitor the loss on the validation set, and if the loss does not improve within 20 epochs, training will be stopped early and the model weights will be restored to the best.

[0037] Model compilation: The model uses the Adam optimizer, and the loss function is mean squared error;

[0038] Model training: The model is trained on the training data, with a maximum of 1000 training cycles and 96 samples per batch. Validation data is used for validation. The training process uses an early stopping mechanism and model checkpoints to control the training.

[0039] Further, in step S6, MAPE measures the average percentage error between the predicted value and the actual value, and its formula is:

[0040]

[0041] Where n is the number of samples; y i It 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 actual value; it is applicable when neither the predicted value nor the actual value is zero.

[0042] The RMSE measures the standard deviation between the predicted value and the actual value, and its formula is:

[0043]

[0044] Where n is the number of samples; y i It is the true value of the i-th sample. It is the predicted value of the i-th sample;

[0045] R 2 The goodness of fit of a model is measured by the proportion of variance it explains, and the formula is:

[0046]

[0047] in, It is the mean of the actual values; n is the sample size; y i It is the true value of the i-th sample; R is the predicted value of the i-th sample; 2 The value of R ranges from 0 to 1; the closer it is to 1, the stronger the explanatory power of the model. 2 A negative result indicates that the model performs worse than a simple mean model.

[0048] MAE measures the mean absolute error between predicted and actual values, and its formula is:

[0049]

[0050] in, It is the mean of the actual values; n is the sample size; y i It is the true value of the i-th sample; is the predicted value of the i-th sample; MAE is an easily interpreted metric 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. This invention proposes a coupled information separation and extraction multi-task learning prediction method for multi-site photovoltaic power prediction. By introducing photovoltaic power prediction values ​​from relevant regions as model references and utilizing convolutional layers for feature extraction, this invention effectively mines the potential similarities in photovoltaic power data. This method ensures data validity, prevents interference from redundant information, and thus significantly improves the prediction accuracy of ultra-short-term photovoltaic power generation, enhancing the model's adaptability under different meteorological conditions.

[0053] 2. The training and evaluation process of the optimized model in this invention: Through a systematic step design, including data preprocessing, correlation analysis, and model training parameter setting, this invention achieves comprehensive optimization of model performance. Multiple evaluation metrics (such as MAPE, RMSE, R...) are used. 2 The application of MAE (Multi-Evaluation Model) makes the evaluation of prediction results more comprehensive and reliable, further improving the practicality and generalizability of the model. Attached Figure Description

[0054] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below.

[0055] Figure 1 This is a general framework diagram of an ultra-short-term photovoltaic power prediction method based on the similarity of photovoltaic power in related regions and the feature extraction of convolutional layers, according to an embodiment of the present invention.

[0056] Figure 2 This is a complete structural diagram of the model in an embodiment of the present invention. Detailed Implementation

[0057] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.

[0058] In the description of this invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this invention.

[0059] In the description of this invention, it should be noted that, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in this invention based on the specific circumstances. Furthermore, the technical features involved in the different embodiments of this 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, this embodiment of the invention provides an ultra-short-term photovoltaic power prediction method based on the similarity of photovoltaic power in related regions and the feature extraction of convolutional layers, including the following steps:

[0061] Step S1: Preprocess historical power data and weather data, including handling missing values, normalization, and dataset partitioning.

[0062] Dataset partitioning: The last 10% of the dataset is used as a test set to validate the model's effectiveness. The first 80% of the first 90% is used as a training set to train the model parameters and fit the data. The last 20% is used as a validation set to evaluate the model's performance on unseen data, helping to select the optimal model structure and hyperparameter settings (such as learning rate and regularization parameters). The performance on the validation set allows researchers to determine whether the model is overfitting or underfitting.

[0063] Normalization: The dataset is normalized using the min-max normalization method. Normalization can accelerate model training, improve model performance and generalization ability, avoid feature-dominated problems, and ensure that all features are treated equally at the same scale. It is particularly important for algorithms that rely on the numerical value of features, such as distance metric algorithms and deep learning.

[0064] Min-Max Normalization is a commonly used data preprocessing method, primarily used to scale data proportionally to a specified range (usually [0,1] or [-1,1]), thereby eliminating the influence of different feature scales on model training. After normalization, each feature falls within the same range, facilitating better model learning and optimization.

[0065] For a feature x in a given dataset, assume its minimum value is x. min The maximum value is x max The normalization formula is:

[0066]

[0067] Where: x is a sample value in the original data. min It is the minimum value of this feature in the dataset. max x is the maximum value of this feature in the dataset. x' is the normalized value, which is usually in the range [0,1].

[0068] Min-max normalization preserves the relative relationships of the original data, scaling data from different ranges to a uniform range to ensure that each feature has the same weight during model training. However, it is sensitive to extreme values, which may cause most of the data to be compressed, affecting the model's effective learning.

[0069] Missing value handling: Missing value handling methods include deleting missing records or features, imputing using the mean, median, or mode, imputing based on nearest neighbor data (such as KNN), and predicting missing values ​​using machine learning models. Other methods include multiple imputation and encoding missing values ​​into special categories. The specific choice depends on the data characteristics and analysis objectives. In ultra-short-term photovoltaic power prediction, even small deviations in the imputed values ​​can affect the accuracy of the data. In this embodiment of the invention, missing value handling employs a missing value deletion method 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 regions and the power data of this region to ensure that the reference model used has sufficient correlation with this region.

[0071] The Pearson correlation coefficient is used to analyze the correlation of photovoltaic power data between two regions (a related region and a target region). The Pearson correlation coefficient measures the strength and direction of the linear relationship between two variables, with values ​​ranging from -1 to 1. A value of 1 indicates a perfect positive correlation, -1 indicates a perfect negative correlation, and 0 indicates no linear correlation. The calculation formula is as follows:

[0072]

[0073] Where: x i and y i These are sample values ​​of two variables. and These are the means of variables x and y, respectively. n is the number of samples.

[0074] Mathematically, the Pearson correlation coefficient is the ratio of the product of covariance and standard deviation. Standardization fixes the coefficient between -1 and 1. The Pearson correlation coefficient is suitable for measuring linear relationships 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 relevant regions, utilize the characteristics of relevant regions to pre-train the predicted values, and effectively transfer the knowledge of the source model to the new task through the similarity of relevant regions, thereby enhancing the generalization ability of the model and avoiding overfitting.

[0076] The photovoltaic power prediction model for the relevant region is a simple feedforward neural network specifically designed to handle 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) First fully connected layer: This layer is a dense layer containing 128 neurons. The activation function is SELU (Scaled Exponential Linear Unit), and "lecun_normal" is used as the weight initialization method. SELU is usually used with "lecun_normal" initialization to ensure self-normalization properties, which is particularly beneficial for deep networks.

[0079] (3) 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-neuron layer).

[0080] (4) Third fully connected layer: This layer has 24 neurons, also using SELU as the activation function and initialized with "lecun_normal". This layer receives the output from the previous layer (64-neuron layer).

[0081] (5) Output Layer: The final output layer is a dense layer containing one neuron, using the Sigmoid activation function. This output layer is typically used for binary classification tasks because the Sigmoid function compresses the output values ​​to between 0 and 1, representing probabilities.

[0082] Model definition: This model is defined using the Model class, specifying that the input is a 7-dimensional feature vector and the output is a single probability value after passing through several dense layers.

[0083] Model Summary: This neural network consists of three fully connected layers, a moderate number of layers with a gradually decreasing number of neurons, making it suitable for classification tasks with a limited number of features. The SELU activation function combined with "lecun_normal" initialization enhances the network's depth stability. The final output layer uses the Sigmoid function to convert the network output into probability values ​​between 0 and 1, making it suitable for binary classification tasks, such as determining the existence of a certain feature or event.

[0084] Step S4: Construct a photovoltaic power prediction model for this region. Use adaptive multi-scale feature fusion to extract input layer features, reducing model complexity. Use convolution kernels of different sizes to extract features at multiple time scales. Use an adaptive weighting 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 combinations of two input data, potentially for classification tasks. The following is a detailed analysis of the model structure:

[0086] (1) Frozen Model: A predefined model is set to an untrainable state, meaning its weights are not updated during training. This is typically used for transfer learning, leveraging the feature extraction capabilities of an existing model to avoid retraining the entire model. This pre-trained model processes a 7-dimensional input vector and generates a single probability output through several fully connected network layers.

[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 a concatenation 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 were used, with kernel sizes of 1, 3, and 5 respectively. Each convolutional layer had 2 output channels, the activation function was SELU, and the weights were initialized using "lecun_normal". The convolution results were concatenated in the last dimension using a concatenation layer to form a feature tensor that integrates multiple convolutions. Then, a flattening layer was used to flatten the concatenated tensor into a one-dimensional vector, ready to enter the adaptive weight module. In this module, three adaptive weights were generated through a fully connected layer, and the softmax activation function was used to ensure that the sum of the weights was 1. Subsequently, the weights were adjusted to match the dimension of the convolutional output. Finally, these weights were used to perform weighted fusion of the outputs of the convolutional layers. The weights were multiplied by the corresponding convolutional outputs, and the results were summed to obtain the weighted fused feature output.

[0090] (5) Flatten layer: The output after convolution is flattened into a 1D vector by 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 inputs, passes through the above convolutional and fully connected network layers, and outputs a predicted value.

[0094] In summary, the model is a complex composite model, mainly consisting of two parts: a frozen pre-trained model and a new network containing convolutional and fully connected layers. Through feature connections, the model combines feature information from two inputs, further extracts temporal or local patterns through convolutional layers, and finally processes the features through several fully connected layers to output a classification probability. This model is suitable for complex classification tasks that combine prior knowledge (through the frozen model) and new features.

[0095] Step S5: Set the relevant training parameters for the model, establish an early stopping mechanism and model checkpoints, observe the state of the model during training, ensure the effectiveness of the model results, and detect whether gradient explosion occurs, in order to prevent model overfitting and save the optimal weights during model training.

[0096] During training, the code uses model checkpoints and early stopping mechanisms to optimize the model training process:

[0097] (1) Model checkpoint: Save the optimal weights of the model to a specified file, only when the loss on the validation set reaches the minimum value, and only save the weights.

[0098] (2) Early stopping mechanism: Monitor the loss of the validation set. If the loss does not improve within 20 epochs, training will be stopped early and restored to the best model weights.

[0099] (3) Model compilation: The model uses the Adam optimizer and the loss function is the mean squared 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. Validation data is used for validation. The training process uses an early stopping mechanism and model checkpoints to control the training.

[0101] Step S6: Utilize MAPE, RMSE, and R 2 The MAE evaluation indicators assess and predict the results.

[0102] When evaluating the predictive performance of a regression model, the following four common evaluation metrics 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 predicted and actual values. Its formula is:

[0105]

[0106] Where n is the number of samples. i It is the true value of the i-th sample. This is the predicted value for the i-th sample. MAPE is an intuitive metric that represents the percentage of the average relative error between the predicted and actual values. It is applicable when neither the predicted nor the actual value is zero.

[0107] (2) Root Mean Square Error (RMSE):

[0108] Definition: RMSE measures the standard deviation between the predicted value and the actual value. Its formula is:

[0109]

[0110] Where n is the number of samples. i It is the true value of the i-th sample. This is the predicted value of the i-th sample. RMSE is more sensitive to large errors because the error is amplified after being squared. 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 The goodness of fit of a model is measured by how much of the variance it explains. The formula is:

[0113]

[0114] in, This is the mean of the actual values. n is the sample size. y i It is the true value of the i-th sample. R is the predicted value of the i-th sample. 2 The value of R ranges from 0 to 1; the closer it is to 1, the stronger the explanatory power of the model. If R... 2 A negative result indicates that the model performs worse than a simple mean model.

[0115] 2) Mean Absolute Error (MAE):

[0116] Definition: MAE measures the mean absolute error between predicted and actual values. Its formula is:

[0117]

[0118] in, This is the mean of the actual values. n is the sample size. y i It is the true value of the i-th sample. Let be the predicted value of the i-th sample. MAE is an easily interpretable metric that represents the average error between the predicted and actual values. Compared to RMSE, MAE is less sensitive to outliers.

[0119] Summarize:

[0120] 1) MAPE is suitable for measuring relative error, especially for data at 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] By comprehensively evaluating these metrics, we can gain a full understanding of the model's predictive performance and identify areas for improvement suitable for specific application scenarios.

[0125] Example:

[0126] This study uses the actual photovoltaic (PV) power output of region 1352 in Guangdong Province as an example. The data includes PV power data from June 21, 2022 to September 29, 2022, totaling 101 days. The last 10% of the data was used as the test set, the first 80% of the first 90% was used as the training set, and the last 20% was used as the validation set. First, historical power and weather data were preprocessed, including missing value imputation, normalization, and dataset partitioning. Next, the correlation between the target region and related regions' power data was analyzed using methods such as Pearson correlation coefficient, selecting regions with strong correlations to this region. Then, a PV power prediction model was constructed based on the data from these related regions, and the model was trained and validated using the training set. Finally, a PV power prediction model for this region was constructed, combining local weather data, historical power data, and prediction results from related regions as input. A convolutional neural network (CNN) was used to extract features, which were further processed through hidden layers to finally output the prediction results. During model training, it is necessary to set the optimizer (such as Adam), loss function (MSE), and hyperparameters (such as learning rate, batch size, etc.), and use early stopping strategies and hyperparameter tuning to improve model performance. Finally, use MAPE, RMSE, and R... 2 The model was evaluated using metrics such as MAE (Magnitude of Effect) to verify its predictive accuracy and optimize its settings. This process effectively improves the prediction accuracy of photovoltaic power in Guangdong Province. Comparative experiments were conducted: the first group lacked a pre-trained structure for the relevant region and convolutional layers; the second group also lacked a pre-trained structure for the relevant region; and the third group included both a photovoltaic power prediction model for the relevant region and a model for the local region. The MAE results were 32.11%, 32.17%, and 30.93%, respectively. The RMSE results were 16.67MW, 16.87MW, and 15.96MW, respectively. This demonstrates that the method of this invention has higher prediction accuracy.

[0127] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A method for predicting ultra-short-term photovoltaic power based on the similarity of photovoltaic power in relevant regions and the feature extraction of convolutional layers, characterized in that, Specifically, the following steps are included: Step S1: Preprocess historical power data and weather data, including handling missing values, normalization, and dataset partitioning; Step S2: Perform correlation analysis on the power data of the relevant regions and the power data of this region to ensure that the reference model used has sufficient correlation with this region; Step S3: Construct a photovoltaic power prediction model for relevant regions, utilize the features of relevant regions to pre-train prediction values, and transfer the knowledge of the source model to the new task through the similarity of relevant regions; the photovoltaic power prediction model for relevant regions 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 to reduce model complexity. Use convolutional kernels of different sizes to extract features at multiple time scales and use an adaptive weighting 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 convolutional and fully connected network layers, and outputs a predicted value. Step S5: Set the relevant training parameters of the model, use the early stopping mechanism and model checkpoints, observe the state of the model during the training process, ensure the effectiveness of the model results, detect whether gradient explosion occurs, and prevent overfitting of the photovoltaic power prediction model in the relevant region and the photovoltaic power prediction model in this region, and save the optimal weights in the model training. Step S6: Evaluate the prediction results using MAPE, RMSE, R², and MAE evaluation metrics. MAPE measures the average percentage error between the predicted and actual values; RMSE measures the standard deviation between the predicted and actual values; R² measures the goodness of fit of the model; and MAE measures the mean absolute error between the predicted and actual values.

2. The ultra-short-term photovoltaic power prediction method based on the similarity of photovoltaic power in relevant regions and the feature extraction of convolutional layers according to claim 1, characterized in that: The dataset partitioning in step S1 is as follows: the last 10% of the dataset is used as a test set for validating the model's effectiveness; the first 80% of the first 90% of the dataset is used as a training set for training the model parameters and fitting the data; and the last 20% of the dataset is used as a validation set for evaluating the model's performance on unseen data.

3. The ultra-short-term photovoltaic power prediction method based on the similarity of photovoltaic power in relevant regions and the feature extraction of convolutional layers according to claim 1, characterized in that: The normalization step S1 applies the minimum-maximum value normalization method to normalize the dataset. For a feature x in a given dataset, it is assumed that its minimum value is... The maximum value is The normalization formula is: (1) ; in: x It is a sample value from the original data. It is the minimum value of this feature in the dataset. It is the maximum value of this feature in the dataset. It is the normalized value, usually in the range [0, 1].

4. The ultra-short-term photovoltaic power prediction method based on the similarity of photovoltaic power in relevant regions and the feature extraction of convolutional layers according to claim 1, characterized in that: The missing value handling in step S1 is performed using the missing value deletion method.

5. The ultra-short-term photovoltaic power prediction method based on the similarity of photovoltaic power in relevant regions and the feature extraction of convolutional layers according to claim 1, characterized in that: In step S2, correlation analysis is performed on the power data of the relevant region and the power data of the local region. This is done using the Pearson correlation coefficient to analyze the correlation between the photovoltaic power data of the relevant region and the target region. The Pearson correlation coefficient measures 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 perfect positive correlation, -1 indicates a perfect negative correlation, and 0 indicates no linear correlation. The calculation formula is as follows: (2) ; in: and These are sample values ​​of two variables; and They are variables x and y Mean; n It represents the number of samples.

6. The ultra-short-term photovoltaic power prediction method based on the similarity of photovoltaic power in relevant regions and the feature extraction of convolutional layers according to claim 1, characterized in that: The relevant regional photovoltaic power prediction model includes, in sequence: 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, with the activation function being 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, also using SELU as the activation function and initialized with "lecun_normal". This layer receives the output from the previous layer; Output layer: The output layer is a dense layer containing one neuron, using the sigmoid activation function; this output layer is used for binary classification tasks; the sigmoid function compresses the output value to between 0 and 1, representing the probability.

7. The ultra-short-term photovoltaic power prediction method based on the similarity of photovoltaic power in relevant regions and the feature extraction of convolutional layers according to claim 1, characterized in that: The local photovoltaic power prediction model combines a pre-trained model with a newly defined convolutional neural network module to process the combination of two input data for classification tasks. The specific steps for establishing the local photovoltaic power prediction model are as follows: (1) Establishing a frozen model: The predefined model is set to an untrainable state; the pre-trained model processes a 7-dimensional input vector and generates a single probability output through several layers of fully connected networks; this 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 concatenation layer. This operation concatenates the two sets of features together to form a larger feature vector. (4) Convolutional layer processing: Three convolutional layers of different sizes are used, with kernels of sizes 1, 3, and 5 respectively. Each convolutional layer has 2 output channels, the activation function is SELU, and the weights are initialized as "lecun_normal". The convolution results are concatenated in the last dimension through a concatenate layer to form a feature tensor that integrates multiple convolutions. A flattening layer is used to flatten the concatenated tensor into a one-dimensional vector, 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. Then, the weights are adjusted to match the dimensions of the convolution output. The outputs of the convolutional layers are weighted and fused using these weights. The weights are multiplied by the corresponding convolution outputs, and the results are summed to obtain the weighted and fused feature output. (5) Establish 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 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. (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 the similarity of photovoltaic power in relevant regions and the feature extraction of convolutional layers according to claim 1, characterized in that: The specific use of early stopping mechanisms and model checkpoints is as follows: Set model checkpoints: Save the model's optimal weights to a specified file, only when the validation set loss reaches its minimum, and only save the weights; Establish an early stopping mechanism: monitor the loss on the validation set, and if the loss does not improve within 20 epochs, training will be stopped early and the model weights will be restored to the best. Model compilation: The model uses the Adam optimizer, and the loss function is mean squared error; Model training: The model is trained on the training data, with a maximum of 1000 training cycles and 96 samples per batch. Validation data is used for validation. The training process uses an early stopping mechanism and model checkpoints to control the training.

9. The ultra-short-term photovoltaic power prediction method based on photovoltaic power similarity in relevant 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 actual value, and its formula is: (3) ; in, n It is the number of samples; It is the first i The true value of each sample; It is the first i The predicted value of a sample; MAPE represents the percentage of the average relative error between the predicted and actual values; applicable when neither the predicted nor the actual value is zero; The RMSE measures the standard deviation between the predicted value and the actual value, and its formula is: (4) ; in, n It is the number of samples; It is the first i The true value of each sample; It is the first i Predicted values ​​for each sample; R² measures the goodness of fit of a model, indicating how much of the variance the model explains. Its formula is: (5) ; in, It is the average of the actual values; n It is the number of samples; It is the first i The true value of each sample; It is the first i The predicted value of each sample; the value of R² ranges from 0 to 1. The closer it is to 1, the stronger the explanatory power of the model. If R² is negative, it means that the model performs worse than a simple mean model. MAE measures the mean absolute error between predicted and actual values, and its formula is: (6) ; in, n It is the number of samples; It is the first i The true value of each sample; It is the first i The predicted value of a sample; MAE is an easily interpretable indicator that represents the average error between the predicted value and the true value.

Citation Information

Patent Citations

  • 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