Photovoltaic power generation prediction method, device and storage medium
Through the photovoltaic power generation prediction model that integrates multi-scale and time series features, combined with fuzzy label coding, the problems of unstable and overfitting of photovoltaic power generation prediction in the prior art are solved, and more stable and accurate power generation prediction is achieved.
Patent Information
- Application Number
- CN202411803711.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-10
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2044-12-10
AI Technical Summary
In the prior art, the photovoltaic power generation prediction model is unstable during the training stage, has the risk of overfitting and the prediction robustness is low, resulting in large prediction errors.
A combination of multi-scale feature extraction and timing feature extraction is adopted to extract the power generation impact features through convolution kernels and long and short-term memory networks, and perform multi-scale and timing feature fusion, predict the integer and decimal values of power generation respectively, and use fuzzy label encoding for model training to reduce the risk of overfitting.
It improves the stability and accuracy of photovoltaic power generation prediction, reduces the risk of overfitting, and makes model training and prediction more reliable.
Smart Images

Figure CN119293640B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of power generation prediction, and in particular to a photovoltaic power generation prediction method, device, and storage medium. Background Art
[0002] As a clean, renewable energy source, solar energy is gaining increasing attention and recognition worldwide. With the continuous development and application of photovoltaic technology, photovoltaic power generation has become a crucial component of the new energy sector. Accurately predicting photovoltaic power generation is crucial to maintaining a stable balance between electricity consumption and stored energy. The accuracy of photovoltaic power generation predictions directly depends on the accuracy of weather forecasts (radiation, temperature, humidity, wind speed, cloud cover, etc.). Due to inherent errors in weather forecasts, there is a fuzzy relationship between the actual power generation corresponding to the weather forecast and the photovoltaic power generation. Consequently, photovoltaic power generation predictions are inaccurate and subject to significant errors.
[0003] Deep learning technology is currently the most prominent in photovoltaic power generation forecasting. In recent years, the superior performance of direct regression models in photovoltaic power generation forecasting has attracted widespread attention. However, these models still suffer from problems such as unstable training phase, high risk of overfitting, and low prediction robustness. Summary of the Invention
[0004] The embodiments of the present application aim to provide a photovoltaic power generation prediction method, device and storage medium to solve the problems existing in the prior art when using direct regression models to predict photovoltaic power generation, such as unstable training phase, high risk of overfitting and low prediction robustness.
[0005] To solve the above technical problems, the embodiments of the present application provide the following technical solutions:
[0006] According to the first aspect of the present application, a photovoltaic power generation prediction method is provided.
[0007] Input the power generation influencing features to be predicted into the pre-trained photovoltaic power generation prediction model;
[0008] The photovoltaic power generation prediction model performs prediction based on the power generation influencing characteristics to be predicted, and outputs a power generation integer value prediction result and a power generation decimal value prediction result;
[0009] Obtaining a predicted photovoltaic power generation of the power generation influencing feature to be predicted according to the power generation integer value prediction result and the power generation decimal value prediction result;
[0010] The photovoltaic power generation prediction model performs prediction based on the power generation influencing characteristics to be predicted, and outputs power generation integer value prediction results and power generation decimal value prediction results including:
[0011] Performing multi-scale feature extraction on the power generation influencing features to be predicted based on multiple convolution kernels to obtain a multi-scale feature map;
[0012] Extracting time series features of the power generation impact characteristics to be predicted based on a long short-term memory network to obtain a time series feature graph;
[0013] Performing feature fusion on the multi-scale feature map and the temporal feature map to obtain a fused feature map;
[0014] Extracting coarse-grained features for predicting the integer value portion of photovoltaic power generation from the fused feature map to obtain a coarse-grained feature map;
[0015] Extracting fine-grained features for predicting a fractional value of photovoltaic power generation from the fused feature map to obtain a fine-grained feature map;
[0016] Based on the coarse-grained feature map and the fine-grained feature map, the power generation integer value prediction result and the power generation fractional value prediction result are obtained.
[0017] Optionally, before the step of fusing the multi-scale feature map and the temporal feature map, the step further includes:
[0018] Performing a first optimization on the multi-scale feature map through a residual module to obtain a multi-scale optimized feature map;
[0019] Performing a second optimization on the time series feature map through an advanced feature module to obtain a time series optimized feature map with the same feature dimension as the multi-scale optimized feature map;
[0020] Performing feature fusion on the multi-scale feature map and the temporal feature map to obtain a fused feature map includes:
[0021] The multi-scale optimized feature map and the temporal optimized feature map are subjected to feature fusion to obtain a fused feature map.
[0022] Optionally, performing multi-scale feature extraction on the power generation impact feature to be predicted based on multiple convolution kernels to obtain a multi-scale feature map includes:
[0023] extracting a plurality of local features from the power generation influencing features to be predicted based on a plurality of first convolution kernels, and fusing the plurality of local features to obtain a first feature map;
[0024] Performing batch normalization on the first feature map to obtain a second feature map;
[0025] Performing nonlinear mapping on the second feature map through an activation function to obtain a third feature map;
[0026] A global feature is extracted from the third feature map based on the second convolution kernel to obtain a multi-scale feature map.
[0027] Optionally, the coarse-grained feature map is B 1 N feature maps, the 1 The feature map of N is N integer value labels {0, 1* , 2* ,……,(N-1)* }, the fine-grained feature map is B 1 The feature map of 1 The feature map is M small value labels {0.0, 1* , 2* ,……,(M-1)* }, where B is the number of sunshine intervals per day, N and M are positive integers, is the preset integer step value, The default decimal step value.
[0028] Optionally, obtaining the integer value prediction result of the power generation and the fractional value prediction result of the power generation based on the coarse-grained feature map and the fine-grained feature map includes:
[0029] Find the integer value label with the maximum classification probability for each time interval from the coarse-grained feature map, and use the integer value label as the integer value prediction result of the power generation for the time interval; find the decimal value label with the maximum classification probability for each time interval from the fine-grained feature map, and use the decimal value label as the decimal value prediction result of the power generation for the time interval.
[0030] Optionally, obtaining the predicted photovoltaic power generation of the power generation influencing feature to be predicted based on the power generation integer value prediction result and the power generation decimal value prediction result includes:
[0031] Based on each time interval, the integer value prediction result of the power generation and the decimal value prediction result of the power generation are added together to obtain an initial predicted photovoltaic power generation for the time interval;
[0032] The predicted photovoltaic power generation of the current time interval is obtained according to the initial predicted photovoltaic power generation of the previous time interval, the initial predicted photovoltaic power generation of the current time interval and the initial predicted photovoltaic power generation of the next time interval.
[0033] Optionally, the photovoltaic power generation prediction model is trained based on the following method:
[0034] Obtaining historical power generation impact characteristics and actual power generation corresponding to the historical power generation impact characteristics;
[0035] Splitting the real generated power into a real generated power integer value and a real generated power decimal value, encoding the real generated power integer value based on N integer value labels to obtain an integer value probability vector of the real generated power, and encoding the real generated power decimal value based on M decimal value labels to obtain a decimal value probability vector of the real generated power;
[0036] The photovoltaic power generation prediction model is trained by taking the historical power generation influencing features as input data, the integer probability vector of the actual power generation and the fractional probability vector of the actual power generation as label values.
[0037] Optionally, encoding the real generated power integer value based on N integer value labels to obtain the integer value probability vector of the real generated power includes:
[0038] Encode the classification probability of the integer value label corresponding to the actual generated power integer value in the N integer value labels into a first probability value slightly smaller than 1, and assign the remaining probability of 1 minus the first probability value to other integer value labels;
[0039] The encoding of the actual power generation fractional value based on the M fractional value labels to obtain the fractional value probability vector includes:
[0040] The classification probability of the fractional value label corresponding to the fractional value of the actual generated power among the M fractional value labels is encoded into a second probability value slightly smaller than 1, and the remaining probability of 1 minus the second probability value is allocated to other fractional value labels.
[0041] According to a second aspect of the present application, an electronic device is provided, comprising at least one processor and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the photovoltaic power generation prediction method described above.
[0042] According to a third aspect of the present application, a computer storage medium is provided, wherein the computer storage medium stores instructions or programs, and when the instructions or programs are executed by at least one processor, the at least one processor executes the photovoltaic power generation prediction method described above.
[0043] The beneficial effect of the embodiment of the present application is that, different from the prior art, in the embodiment of the present application, a photovoltaic power generation prediction method is provided, in which the power generation influencing features to be predicted are input into a pre-trained photovoltaic power generation prediction model to obtain an integer power generation prediction result and a decimal power generation prediction result, and the predicted photovoltaic power generation is obtained based on the integer power generation prediction result and the decimal power generation prediction result, wherein the prediction method of the photovoltaic power generation prediction model includes: firstly performing multi-scale feature extraction on the power generation influencing features to be predicted based on multiple convolution kernels to obtain a multi-scale feature map, and performing time series feature extraction on the power generation influencing features to be predicted based on a long short-term memory network to obtain a time series feature map; then, feature fusion is performed on the multi-scale feature map and the time series feature map to obtain a fused feature map; then, a coarse-grained feature map for predicting the integer value part of the photovoltaic power generation and a fine-grained feature map for predicting the decimal value part of the photovoltaic power generation are respectively extracted from the fused feature map, and based on the coarse-grained feature map and the fine-grained feature map, an integer power generation prediction result and a decimal power generation prediction result are obtained. This method uses a classification model to predict photovoltaic power generation, converting continuous-value problems into discrete integer and fractional power generation predictions. This reduces the risk of overfitting and makes model training and prediction more stable and reliable. Furthermore, the model structure design utilizes multi-scale feature extraction branches and time series feature extraction branches, enhancing the model's feature extraction capabilities and improving prediction accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] One or more embodiments are exemplarily illustrated by pictures in the corresponding drawings. These exemplifications do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings are represented as similar elements. Unless otherwise stated, the figures in the drawings do not constitute proportional limitations.
[0045] Figure 1 This is a schematic diagram of an algorithm framework of a photovoltaic power generation prediction model provided in an embodiment of the present application;
[0046] Figure 2 is a structural diagram of a multi-scale feature module 102 provided in an embodiment of the present application;
[0047] Figure 3 is a structural diagram of a residual module 104 provided in an embodiment of the present application;
[0048] Figure 4 is a structural diagram of a timing feature module 103 provided in an embodiment of the present application;
[0049] Figure 5 is a structural diagram of an advanced feature module 105 provided in an embodiment of the present application;
[0050] Figure 6is a structural diagram of a coarse-grained feature module 107 provided in an embodiment of the present application;
[0051] Figure 7 is a schematic diagram of a coarse-grained feature map provided in an embodiment of the present application;
[0052] Figure 8 is a schematic diagram of a fine-grained feature map provided in an embodiment of the present application;
[0053] Figure 9 This is a flow chart of a method for training a photovoltaic power generation prediction model provided in an embodiment of the present application;
[0054] Figure 10 This is a flow chart of a photovoltaic power generation prediction method provided in an embodiment of the present application;
[0055] Figure 11 yes Figure 10 Detailed flow chart of step S1002;
[0056] Figure 12 This is a structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0057] To make the purpose, technical solutions, and advantages of the embodiments of this application more clear, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0058] In addition, the technical features involved in each embodiment of the present application described below can be combined with each other as long as they do not conflict with each other.
[0059] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0060] See also Figure 1 , is a schematic diagram of an algorithm framework of a photovoltaic power generation prediction model provided in an embodiment of the present application. Figure 1As shown, the photovoltaic power generation prediction model includes a feature input module 101, a multi-scale feature module 102, a time series feature module 103, a residual module 104, a high-level feature module 105, a feature fusion module 106, a coarse-grained feature module 107, a fine-grained feature module 108, an integer value output module 109, a decimal value output module 110, a power generation prediction module 111 and a loss calculation module 112.
[0061] The feature input module 101 is used to obtain the power generation influencing features required for the photovoltaic power generation prediction model calculation, mainly including weather features, longitude and latitude features, and device-specific characteristic parameter features. In one embodiment, the dimension of the power generation influencing features is A B C. Where A is the number of days, B is the number of sunshine intervals per day, and C is the number of features that affect power generation. Assuming 12 hours of sunshine per day and 15-minute intervals, then B = 12 x 4 = 48 intervals. Features that affect power generation can include temperature, humidity, air pressure, longitude, latitude, and so on.
[0062] Multi-scale feature module 102 is used to extract multi-scale features from features influencing power generation based on multiple convolution kernels, generating a multi-scale feature map. This allows the model to extract physical features across a wider range, reducing its reliance on time windows and ignoring the impact of temporal features on the data. It focuses on combinations of different features and explores potential correlations between them, thereby generating richer input features and improving the robustness and accuracy of predictions.
[0063] Residual module 104, located after multi-scale feature module 102, is used to perform a first optimization on the multi-scale feature map to obtain a multi-scale optimized feature map. Through residual module 104, the model can increase the depth of the network structure, reduce the risk of model overfitting, and improve the ability to extract abstract features.
[0064] Time series feature module 103 is used to extract time series features from power generation influencing characteristics based on a long short-term memory (LSTM) network. This module captures the temporal relationship between PV power generation and power generation influencing characteristics, generating a time series feature graph. Through this module, the model can better focus on the following features: 1) the temporal variation patterns of PV power generation; 2) the cyclical characteristics of PV power generation, such as its seasonal variations and long-term trends; 3) the temporal continuity of PV power generation; and 4) reduce problems such as gradient shrinkage and gradient explosion in calculations.
[0065] Advanced feature module 105, located after temporal feature module 103, performs a second optimization on the temporal feature map using a CBL (Convolutions with Batch Normalization and Leaky ReLU) module, resulting in a temporal feature map with the same feature dimensions as the multi-scale optimized feature map. Advanced feature module 105 improves the model's feature extraction capabilities and alters the output structure of the temporal feature extraction branch, enabling integration with features extracted by the multi-scale feature branch.
[0066] The photovoltaic power generation prediction model of the present application includes two feature extraction branches: a multi-scale feature extraction branch (including a multi-scale feature module 102 and a residual module 104) and a time series feature extraction branch (including a time series feature module 103 and an advanced feature module 105), which greatly enhances the model's ability to extract features and improves the accuracy of prediction.
[0067] The feature fusion module 106 is used to fuse the feature map output by the multi-scale feature extraction branch and the feature map output by the temporal feature extraction branch according to the channel to obtain a fused feature map.
[0068] The coarse-grained feature module 107 is used to extract the coarse-grained features for predicting the integer value part of the photovoltaic power generation from the fused feature map to obtain a coarse-grained feature map.
[0069] The fine-grained feature module 108 extracts fine-grained features for predicting the fractional value of photovoltaic power generation from the fused feature map to obtain a fine-grained feature map.
[0070] The integer value output module 109 is used to obtain the integer value prediction result of the power generation according to the coarse-grained feature map.
[0071] The small value output module 110 is used to obtain a small value prediction result of the power generation according to the fine-grained feature map.
[0072] The power generation prediction module 111 is used to obtain the predicted photovoltaic power generation according to the power generation integer value prediction result and the power generation decimal value prediction result.
[0073] Loss calculation module 112 is used to calculate the integer loss and fractional loss of generated electricity using a cross-entropy loss function. The module then adds the integer and fractional losses to obtain the total loss of predicted PV power generation. This module is primarily used during the training of the PV power generation prediction model to provide guidance for the model's learning direction.
[0074] In one embodiment, the cross entropy loss function is:
[0075]
[0076] in, is the value of the cross entropy loss function, is the actual photovoltaic power generation corresponding to the power generation influencing characteristics, is the predicted photovoltaic power generation corresponding to the power generation influencing characteristics, and N is the number of samples.
[0077] Please refer to Figure 2 , Figure 2 1 is a structural diagram of a multi-scale feature module 102 provided in an embodiment of the present application. Figure 2 As shown, the processing process of the multi-scale feature module 102 is as follows: (1) Input the original data features (i.e., the dimension is A B C's power generation impact characteristics); (2) extract multiple local features from the original data features through multiple first convolution kernels, and fuse the multiple local features to obtain the first feature map; (3) perform batch normalization on the first feature map to obtain the second feature map; (4) perform nonlinear mapping on the second feature map through the ReLU activation function to obtain the third feature map; (5) extract global features from the third feature map based on the second convolution kernel and output a multi-scale feature map. Among them, the size of the first convolution kernel is (1, 3, 5, 7, 9) and the size of the second convolution kernel is 17.
[0078] Please refer to Figure 3 , Figure 3 1 is a structural diagram of a residual module 104 provided in an embodiment of the present application. Figure 3 As shown, the processing process of the residual module 104 is as follows: (1) input the multi-scale feature map extracted in the previous stage; (2) the multi-scale feature map is passed through a BL module (Batch Normalization and Leaky ReLU, batch normalization + ReLU activation function) to obtain a first optimized feature map; (3) the first optimized feature map is passed through a CBL module to obtain a second optimized feature map; (4) the second optimized feature map is subjected to maximum pooling to obtain a third optimized feature map; (4) the multi-scale feature map is downsampled to obtain a fourth optimized feature map; (5) the third optimized feature map and the fourth optimized feature map are added to obtain a multi-scale optimized feature map.
[0079] Please refer to Figure 4 , is a structural diagram of a timing feature module 103 provided in an embodiment of the present application. Figure 4 As shown, the processing process of the time series feature module 103 is as follows: (1) Input the original data features (i.e., the dimension is A B C’s power generation impact characteristics); (2) The original data features pass through two LSTM structures to output a time series feature graph.
[0080] Please refer to Figure 5 , is a structural diagram of an advanced feature module 105 provided in an embodiment of the present application. Figure 5 As shown, the processing process of the high-level feature module 105 is as follows: (1) inputting the timing feature graph extracted in the previous stage; (2) the timing feature graph passes through two CBL modules and outputs the timing optimized feature graph.
[0081] The high-level feature module 105 can make the feature dimension W_cbl of the time-series optimized feature map equal to the feature dimension W_resnet of the multi-scale optimized feature map. The feature fusion module 106 is also used to splice the multi-scale optimized feature map and the time-series optimized feature map by channel. For example, assuming that the dimension of the multi-scale optimized feature map is (1*C_resnet*W_resnet), the dimension of the time-series optimized feature map is (1*C_cbl*W_cbl), and W_resnet = W_cbl, then the channel dimension after splicing is 1*(C_resnet + C_cbl)*W_resnet.
[0082] Please refer to Figure 6 , is a structural diagram of a coarse-grained feature module 107 provided in an embodiment of the present application. Figure 6 As shown in FIG, the processing process of the coarse-grained feature module 107 is as follows: (1) the fusion feature map extracted in the previous stage is input; (2) the fusion feature map is used to extract the coarse-grained features of the integer value part for predicting photovoltaic power generation through three CBL modules, and the coarse-grained feature map is output.
[0083] In one embodiment, the coarse-grained feature map is B 1 N feature maps, the 1 The feature map of N is N integer value labels {0, 1* , 2* ,……,(N-1)* }. Where N is a positive integer, and its calculation formula is:
[0084]
[0085] in, is the maximum power generation power of the photovoltaic panel, For example, assuming the maximum output power of the photovoltaic panel is 100W, the maximum photoelectric conversion efficiency is 30%, and the hardware loss is 10W, the maximum power generation power of the photovoltaic panel is =100*30%-10=20w. Assume again =1w, then N=21, and the N integer value labels are {0, 1, 2, 3,4,……, 20}.
[0086] The integer value output module 109 is further used to find the integer value label with the largest classification probability for each time interval from the coarse-grained feature map, and output the largest integer value label as the integer value prediction result of the power generation for the time interval. Figure 7 As shown, the coarse-grained feature map is 48 1 21. Taking the second time interval as an example, the classification probability of the integer value label 3 is 0.1, and the classification probability of the integer value label 4 is 0.9. Then the integer value of the power generation in the second time interval is 4w.
[0087] The structure of the fine-grained feature module 108 is the same as that of the coarse-grained feature module 107. The processing process of the fine-grained feature module 108 is as follows: (1) the fused feature map extracted in the previous stage is input; (2) the fused feature map is used to extract fine-grained features for predicting the decimal part of photovoltaic power generation through three CBL modules, and the fine-grained feature map is output.
[0088] In one embodiment, the fine-grained feature map is B 1 The feature map of 1 The feature map is decimal value labels {0.0, 1* , 2* ,……,(M-1)* } classification probability. Among them, is a positive integer, is the preset decimal step value. For example, if =0.1w, then M=10, that is, the M small value labels are {0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9}. For example, suppose =0.01w, then M=100, that is, the M decimal value labels are {0.00, 0.01, 0.02, ...0.1, ..., 0.99}.
[0089] The small value output module 110 is further used to find the small value label with the largest classification probability for each time interval from the fine-grained feature map, and output the largest small value label as the small value prediction result of the power generation in the time interval. Figure 8 As shown, the fine-grained feature map is 48 1 Feature graph of 10. Taking the second time interval as an example, the classification probability of the decimal value label 0.2 is 0.6, the classification probability of the decimal value label 0.3 is 0.1, and the classification probability of the decimal value label 0.4 is 0.3. Therefore, the decimal value of power generation in the second time interval is 0.2w.
[0090] by Figure 7 and Figure 8Taking the second time interval as an example, the power generation prediction module 111 obtains the predicted photovoltaic power generation of the second time interval as 4.2W based on the power generation integer value 4W and the power generation decimal value 0.2W of the second time interval.
[0091] Please refer to Figure 9 , Figure 9 : This is a flow chart of a method for training a photovoltaic power generation prediction model provided in an embodiment of the present application, the method comprising:
[0092] S901: Obtain historical power generation influencing features and actual power generation corresponding to the historical power generation influencing features.
[0093] Collect historical meteorological data, historical power generation data, related time data, etc. of photovoltaic power stations to obtain dimension A B C's historical power generation impact characteristics and their corresponding real power generation. For example, the historical power generation impact characteristics are: {Date: October 20, 2024,
[0094] Time interval: 1, temperature: 28℃, humidity: 65%, air pressure: 1008 Pa, ...,
[0095] Time interval: 2, temperature: 28℃, humidity: 65%, air pressure: 1008 Pa, ...,
[0096] …
[0097] Time interval: 48, temperature: 25℃, humidity: 55%, air pressure: 1008 Pa, ...,}.
[0098] The actual power generation power corresponding to the historical power generation impact feature is: {2.5, ..., 10}, a total of 48 values.
[0099] S902: Split the actual power generation into an integer value of the actual power generation and a decimal value of the actual power generation. Encode the integer value of the actual power generation based on N integer value labels to obtain an integer value probability vector of the actual power generation. Encode the decimal value of the actual power generation based on M decimal value labels to obtain a decimal value probability vector of the actual power generation.
[0100] To convert the regression problem into a classification problem, this application decomposes the photovoltaic power generation prediction into an integer power generation prediction and a decimal power generation prediction. Therefore, when training the model, it is necessary to first split the actual power generation into an integer value of the actual power generation and a decimal value of the actual power generation. For example, if the actual power generation is 20.5W, after splitting, the actual power generation integer value is 20W and the actual power generation decimal value is 0.5W.
[0101] In classification models, the traditional label encoding method is one-hot label encoding, which sets the probability of the correct label category to 1 and the probabilities of other label categories to 0. For example, after using traditional one-hot label encoding for 250,000, the resulting integer probability vector is {0, 0, 1,0,…, 0}, and the fractional probability vector is {0, 0, 0, 0, 0,1,…, 0}, where all omitted values are 0.
[0102] In the actual training of the model, the historical power generation impact characteristics come from the predicted weather characteristics provided by the meteorological forecast system, which have errors with the real physical weather characteristics. When the predicted weather characteristics are used as input features and the real power generation power is used as the label, the label is inaccurate and fuzzy, which leads to inaccurate predictions of photovoltaic power generation and large errors. To solve this problem, the present application provides a fuzzy label encoding method to encode the integer value of the real power generation power and the decimal value of the real power generation power. Specifically, fuzzy labeling refers to introducing a certain degree of uncertainty in the original label distribution, converting the original "hard label" into a "soft label", so that the model will not be overconfident about a certain label category during the training process. By softening the label, the stability and accuracy of the model training can be improved.
[0103] In one embodiment, encoding the integer value of the actual generated power based on N integer value labels to obtain an integer value probability vector includes: encoding the classification probability of the integer value label corresponding to the integer value of the actual generated power in the N integer value labels into a first probability value, and assigning the remaining probability of 1 minus the first probability value to the other integer value labels. Similarly, encoding the decimal value of the actual generated power based on M decimal value labels to obtain a decimal value probability vector includes: encoding the classification probability of the decimal value label corresponding to the decimal value of the actual generated power in the M decimal value labels into a second probability value, and assigning the remaining probability of 1 minus the second probability value to the other decimal value labels. The first probability value and the second probability value are values slightly less than 1 (e.g., 0.9) and may be the same or different.
[0104] In one embodiment, the remaining probability of 1 minus the first probability value is evenly distributed to the adjacent integer value tags of the corresponding integer value tag. Specifically, let the integer value of the actual generated power be X,
[0105] when When , the probability vector of integer values after encoding X is: {0, ……, , P1, , 0,……,0}, where P1 is a value slightly less than 1, the value of the (X+1)th element is P1, and the values of the Xth element and the X+2th element are , the values of the remaining elements are zero;
[0106] When X=0, the integer value probability vector after encoding X is: {P2, , 0,……,0}, where P2 is a value slightly less than 1, the value of the first element is P2, and the value of the second element is , the values of the remaining elements are zero;
[0107] When X=N-1, the probability vector of integer values after encoding X is: {0,……, ,P3}, where P3 is a value slightly less than 1, the value of the Nth element is P3, and the value of the N-1th element is , and the values of the remaining elements are zero.
[0108] For example, after encoding 2.5w using fuzzy labels, the integer value probability vector obtained may be {0, 0.1, 0.8, 0.1, …, 0}, and the fractional value probability vector may be {0, 0, 0, 0, 0.1, 0.8, 0.1, …, 0}, where the omitted parts are all 0.
[0109] In one embodiment, the remaining probability after subtracting the second probability value from 1 is evenly distributed to the adjacent decimal-valued labels of the corresponding decimal-valued label. The specific distribution method is the same as the above-mentioned method of distributing the remaining probability after subtracting the first probability value from 1 to the adjacent integer-valued labels of the corresponding integer-valued label, and will not be repeated here.
[0110] Step S903 : Training a photovoltaic power generation prediction model using historical power generation influencing features as input data, integer probability vectors of actual power generation, and fractional probability vectors of actual power generation as label values.
[0111] The photovoltaic power generation prediction model of the present application is a classification model, which is trained using the aforementioned cross entropy loss. The loss of predicted photovoltaic power generation is calculated based on the cross entropy loss function, and the parameters of the model are adjusted based on the loss until a photovoltaic power generation prediction model that meets the preset conditions is obtained.
[0112] Please refer to Figure 10 , Figure 10 This is a flow chart of a photovoltaic power generation prediction method provided in an embodiment of the present application, which specifically includes the following steps:
[0113] Step S1001: inputting the power generation influencing features to be predicted into a pre-trained photovoltaic power generation prediction model.
[0114] Among them, the dimension of the impact feature of the power generation to be predicted is A B C, A is the number of days, B is the number of sunshine intervals per day, and C is the number of characteristics that affect power generation.
[0115] In one embodiment, the structure of the photovoltaic power generation prediction model is as follows: Figures 1 to 8 The photovoltaic power generation prediction model is trained by Figure 9 The training method of the photovoltaic power generation prediction model.
[0116] Step S1002 : The photovoltaic power generation prediction model performs prediction based on the power generation influencing characteristics to be predicted, and outputs power generation integer value prediction results and power generation decimal value prediction results.
[0117] Step S1003 , obtaining the predicted photovoltaic power generation of the power generation influencing characteristics to be predicted based on the power generation integer value prediction result and the power generation decimal value prediction result.
[0118] In one embodiment, the specific implementation method of step S1003 is: based on each time interval included in the power generation influencing feature to be predicted, the integer value prediction result of the power generation of the time interval and the decimal value prediction result of the power generation are added together to obtain the predicted photovoltaic power generation of the time interval.
[0119] Because photovoltaic power generation is positively correlated with the power generation influencing characteristics, photovoltaic power generation is linear in time series. To further improve the robustness of the model prediction, the predicted photovoltaic power generation for two adjacent time intervals is combined with the predicted photovoltaic power generation for the current time interval to obtain the final predicted photovoltaic power generation for the current time interval. Specifically, for each time interval included in the power generation influencing characteristics to be predicted, the integer power generation prediction result and the decimal power generation prediction result for that time interval are added together to obtain the initial predicted photovoltaic power generation for that time interval. Then, the predicted photovoltaic power generation for the current time interval is calculated based on the initial predicted photovoltaic power generation for the previous time interval, the initial predicted photovoltaic power generation for the current time interval, and the initial predicted photovoltaic power generation for the next time interval. For example, if the initial predicted photovoltaic power generation for the first time interval is X1, the initial predicted photovoltaic power generation for the second time interval is X2, and the initial predicted photovoltaic power generation for the third time interval is X3, the predicted photovoltaic power generation for the second time interval is calculated by averaging (X1+X2+X3) / 3. If the current time interval is the first time interval or the last time interval, the initial predicted photovoltaic power generation of the previous time interval corresponding to the first time interval and the initial predicted photovoltaic power generation of the next time interval corresponding to the last time interval may both be set to zero.
[0120] Please refer to Figure 11 , Figure 11 yes Figure 10 The detailed flow chart of step S1002 specifically includes the following steps:
[0121] Step S1002a: performing multi-scale feature extraction on the features affecting the power generation to be predicted based on multiple convolution kernels to obtain a multi-scale feature map.
[0122] In one embodiment, step S1002a is specifically implemented as follows: (1) extracting multiple local features from the power generation impact feature to be predicted based on multiple first convolution kernels, and fusing the multiple local features to obtain a first feature map; (2) performing batch normalization on the first feature map to obtain a second feature map; (3) performing nonlinear mapping on the second feature map using a ReLU activation function to obtain a third feature map; and (4) extracting global features from the third feature map based on a second convolution kernel to obtain a multi-scale feature map. The sizes of the first convolution kernel are (1, 3, 5, 7, 9) and the size of the second convolution kernel is 17.
[0123] Step S1002b: extracting time series features of the power generation impact features to be predicted based on the long short-term memory network to obtain a time series feature graph.
[0124] In one embodiment, the specific implementation of step S1002b is: extracting time series features from the power generation impact features to be predicted through two LSTM structures to obtain a time series feature graph.
[0125] Step S1002c: perform feature fusion on the multi-scale feature map and the temporal feature map to obtain a fused feature map.
[0126] In one embodiment, before step S1002c, the method further includes: performing a first optimization on the multi-scale feature map output by step S1002a through a residual module to obtain a multi-scale optimized feature map; and performing a second optimization on the temporal feature map output by step S1002b through a CBL module to obtain a temporal optimized feature map with the same feature dimension as the multi-scale optimized feature map. After the multi-scale feature map is optimized, the model can increase the depth of the network structure, reduce the risk of model overfitting, and improve the ability to extract abstract features. After the temporal feature map is optimized, on the one hand, the model's ability to extract features can be improved, and on the other hand, the output structure of the temporal feature map can be changed so that it has the same feature dimension as the multi-scale optimized feature map. Step S1002c also includes: performing feature fusion on the multi-scale optimized feature map and the temporal optimized feature map according to the channel to obtain a fused feature map.
[0127] Step S1002d: extracting coarse-grained features for predicting the integer value portion of photovoltaic power generation from the fused feature map to obtain a coarse-grained feature map.
[0128] In one embodiment, three CBL modules are used to extract coarse-grained features for predicting the integer value of photovoltaic power generation from the fusion feature map to obtain a coarse-grained feature map. The coarse-grained feature map is a probability distribution map of N integer value labels. Specifically, the coarse-grained feature map is B 1 N feature maps, the 1 The feature map of N is N integer value labels {0, 1* , 2* ,……,(N-1)* }. Where N is a positive integer, and its calculation formula is:
[0129]
[0130] in, is the maximum power generation power of the photovoltaic panel, For example, assuming the maximum output power of the photovoltaic panel is 100W, the maximum photoelectric conversion efficiency is 30%, and the hardware loss is 10W, the maximum power generation power of the photovoltaic panel is =100*30%-10=20w. Assume again =1w, then N=21, and the N integer value labels are {0,1,2,3,4,……,20}.
[0131] Step S1002e: extracting fine-grained features for predicting the fractional value of photovoltaic power generation from the fused feature map to obtain a fine-grained feature map.
[0132] In one embodiment, three CBL modules are used to extract fine-grained features for predicting the fractional value of photovoltaic power generation from the fusion feature map to obtain a fine-grained feature map. The fine-grained feature map is a probability distribution map of M fractional value labels. Specifically, the fine-grained feature map is a probability distribution map of B 1 The feature map of 1 The feature map is decimal value labels {0,1* , 2* ,……,(M-1)* } classification probability. Among them, is a positive integer, is the preset decimal step value. For example, if =0.1w, then M=10, that is, the M small value labels are {0.0, 0.1, 0.2, 0.3, 0.4,0.5, 0.6, 0.7, 0.8, 0.9}. For example, suppose =0.01w, then M=100, that is, the M decimal value labels are {0.00, 0.01, 0.02, ...0.1, ..., 0.99}.
[0133] Step S1002f: Based on the coarse-grained feature map and the fine-grained feature map, an integer value prediction result of the power generation and a decimal value prediction result of the power generation are obtained.
[0134] Specifically, the integer value label with the largest classification probability for each time interval is found from the coarse-grained feature map, and the largest integer value label is output as the integer value prediction result of the power generation for the time interval; and the decimal value label with the largest classification probability for each time interval is found from the fine-grained feature map, and the largest decimal value label is output as the decimal value prediction result of the power generation for the time interval.
[0135] like Figure 7 As shown, the coarse-grained feature map is 48 1 21. Taking the second time interval as an example, the classification probability of the integer value label 3 is 0.1, and the classification probability of the integer value label 4 is 0.9, so the integer value of the power generation in the second time interval is 4w. Figure 8 As shown, the fine-grained feature map is 48 1 Feature graph of 10. Taking the second time interval as an example, the classification probability of the decimal value label 0.2 is 0.6, the classification probability of the decimal value label 0.3 is 0.1, and the classification probability of the decimal value label 0.4 is 0.3. Therefore, the decimal value of power generation in the second time interval is 0.2w.
[0136] The photovoltaic power generation prediction method provided in the present application inputs the power generation influencing features to be predicted into a pre-trained photovoltaic power generation prediction model to obtain an integer value prediction result of the power generation and a decimal value prediction result of the power generation, and obtains the predicted photovoltaic power generation based on the integer value prediction result of the power generation and the decimal value prediction result of the power generation, wherein the prediction method of the photovoltaic power generation prediction model includes: firstly performing multi-scale feature extraction on the power generation influencing features to be predicted based on multiple convolution kernels to obtain a multi-scale feature map, and performing time series feature extraction on the power generation influencing features to be predicted based on a long short-term memory network to obtain a time series feature map; then, feature fusion is performed on the multi-scale feature map and the time series feature map to obtain a fused feature map; then, a coarse-grained feature map for predicting the integer value part of the photovoltaic power generation and a fine-grained feature map for predicting the decimal value part of the photovoltaic power generation are respectively extracted from the fused feature map, and based on the coarse-grained feature map and the fine-grained feature map, an integer value prediction result of the power generation and a decimal value prediction result of the power generation are obtained. This method uses a classification model to predict photovoltaic power generation, converting continuous-value problems into discrete integer and fractional power generation predictions. This reduces the risk of overfitting and makes model training and prediction more stable and reliable. Furthermore, the model structure design utilizes multi-scale feature extraction branches and time series feature extraction branches, enhancing the model's feature extraction capabilities and improving prediction accuracy.
[0137] According to an embodiment of the present application, an electronic device is provided, such as Figure 12 , is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device may include a processor 1201, a communication interface 1202, a memory 1203, and a communication bus 1204. The processor 1201, the communication interface 1202, and the memory 1203 communicate with each other via the communication bus 1204. The processor 1201 may call logic instructions in the memory 1203 to execute the above-mentioned photovoltaic power generation prediction method.
[0138] In addition, the logical instructions in the above-mentioned memory 1203 can be implemented in the form of a software functional unit and can be stored in several computer-readable storage media when sold or used as an independent product. Based on this understanding, the technical solution of the present application, or the part that contributes to the existing technology, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the photovoltaic power generation prediction method mentioned above in the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, and other media that can store program code.
[0139] According to an embodiment of the present application, a computer-readable storage medium is provided, the type of which is as described above, and the computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the processor performs the steps of the photovoltaic power generation prediction method described above.
[0140] Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented using software plus a general-purpose hardware platform, or of course, hardware. Based on this understanding, the essence of the above technical solution, or the portion that contributes to the relevant technology, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, or an optical disk, and includes a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods described in each embodiment or certain portions of the embodiments.
[0141] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any person skilled in the art can easily conceive of variations or substitutions within the technical scope disclosed in the present application. Therefore, any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A photovoltaic power generation prediction method, characterized in that: include: Input the power generation influencing features to be predicted into the pre-trained photovoltaic power generation prediction model; The photovoltaic power generation prediction model performs prediction based on the power generation influencing characteristics to be predicted, and outputs a power generation integer value prediction result and a power generation decimal value prediction result; Obtaining a predicted photovoltaic power generation of the power generation influencing feature to be predicted according to the power generation integer value prediction result and the power generation decimal value prediction result; The photovoltaic power generation prediction model performs prediction based on the power generation influencing characteristics to be predicted, and outputs power generation integer value prediction results and power generation decimal value prediction results including: Performing multi-scale feature extraction on the power generation influencing features to be predicted based on multiple convolution kernels to obtain a multi-scale feature map; Extracting time series features of the power generation impact characteristics to be predicted based on a long short-term memory network to obtain a time series feature graph; Performing feature fusion on the multi-scale feature map and the temporal feature map to obtain a fused feature map; Extracting coarse-grained features for predicting the integer value portion of photovoltaic power generation from the fused feature map to obtain a coarse-grained feature map; Extracting fine-grained features for predicting a fractional value of photovoltaic power generation from the fused feature map to obtain a fine-grained feature map; Based on the coarse-grained feature map and the fine-grained feature map, obtaining the power generation integer value prediction result and the power generation fractional value prediction result; The coarse-grained feature map is B 1 N feature maps, the 1 The feature map of N is N integer value labels {0, 1* , 2* ,……,(N-1)* }, the fine-grained feature map is B 1 The feature map of 1 The feature map is M small value labels {0.0, 1* , 2* ,……,(M-1)* }, where B is the number of sunshine intervals per day, N and M are positive integers, is the preset integer step value, The default decimal step value.
2. The method according to claim 1, characterized in that Before the step of fusing the multi-scale feature map and the temporal feature map, the following steps are further included: Performing a first optimization on the multi-scale feature map through a residual module to obtain a multi-scale optimized feature map; Performing a second optimization on the time series feature map through an advanced feature module to obtain a time series optimized feature map with the same feature dimension as the multi-scale optimized feature map; Performing feature fusion on the multi-scale feature map and the temporal feature map to obtain a fused feature map includes: The multi-scale optimized feature map and the temporal optimized feature map are subjected to feature fusion to obtain a fused feature map.
3. The method according to claim 1 or 2, characterized in that The multi-scale feature extraction is performed on the power generation influencing features to be predicted based on multiple convolution kernels to obtain a multi-scale feature map including: extracting a plurality of local features from the power generation influencing features to be predicted based on a plurality of first convolution kernels, and fusing the plurality of local features to obtain a first feature map; Performing batch normalization on the first feature map to obtain a second feature map; Performing nonlinear mapping on the second feature map through an activation function to obtain a third feature map; A global feature is extracted from the third feature map based on the second convolution kernel to obtain a multi-scale feature map.
4. The method according to claim 1, wherein The obtaining of the power generation integer value prediction result and the power generation fractional value prediction result based on the coarse-grained feature map and the fine-grained feature map includes: Find the integer value label with the maximum classification probability for each time interval from the coarse-grained feature map, and use the integer value label as the integer value prediction result of the power generation for the time interval; find the decimal value label with the maximum classification probability for each time interval from the fine-grained feature map, and use the decimal value label as the decimal value prediction result of the power generation for the time interval.
5. The method according to claim 1, wherein The step of obtaining the predicted photovoltaic power generation of the power generation influencing feature to be predicted based on the power generation integer value prediction result and the power generation decimal value prediction result includes: Based on each time interval, the integer value prediction result of the power generation and the decimal value prediction result of the power generation are added together to obtain an initial predicted photovoltaic power generation for the time interval; The predicted photovoltaic power generation of the current time interval is obtained according to the initial predicted photovoltaic power generation of the previous time interval, the initial predicted photovoltaic power generation of the current time interval and the initial predicted photovoltaic power generation of the next time interval.
6. The method according to claim 4 or 5, characterized in that The photovoltaic power generation prediction model is trained based on the following method: Obtaining historical power generation impact characteristics and actual power generation corresponding to the historical power generation impact characteristics; Splitting the real generated power into a real generated power integer value and a real generated power decimal value, encoding the real generated power integer value based on N integer value labels to obtain an integer value probability vector of the real generated power, and encoding the real generated power decimal value based on M decimal value labels to obtain a decimal value probability vector of the real generated power; The photovoltaic power generation prediction model is trained by taking the historical power generation influencing features as input data, the integer probability vector of the actual power generation and the fractional probability vector of the actual power generation as label values.
7. The method according to claim 6, characterized in that The encoding of the real generated power integer value based on N integer value labels to obtain the integer value probability vector of the real generated power includes: Encode the classification probability of the integer value label corresponding to the actual generated power integer value in the N integer value labels into a first probability value slightly smaller than 1, and assign the remaining probability of 1 minus the first probability value to other integer value labels; The encoding of the actual power generation fractional value based on the M fractional value labels to obtain the fractional value probability vector includes: The classification probability of the fractional value label corresponding to the fractional value of the actual generated power among the M fractional value labels is encoded into a second probability value slightly smaller than 1, and the remaining probability of 1 minus the second probability value is allocated to other fractional value labels.
8. An electronic device, characterized in that: The method comprises at least one processor and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the photovoltaic power generation prediction method according to any one of claims 1 to 7.
9. A computer storage medium, characterized in that The computer storage medium stores instructions or programs, and when the instructions or programs are executed by at least one processor, the at least one processor is caused to execute the photovoltaic power generation prediction method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Photovoltaic power generation power prediction method based on time-sharing gating circulation unit
CN115579858A