Photovoltaic power generation capacity prediction method and device, and storage medium
By performing multi-scale and time-series feature extraction in the photovoltaic power generation prediction model and combining with the classification model processing, the problems of training instability and overfitting in the direct regression model are solved, and the accuracy and stability of photovoltaic power generation prediction are improved. .
Patent Information
- Application Number
- CN202411803711.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-10
- Publication Date
- 2025-01-10
- Estimated Expiration
- 2044-12-10
AI Technical Summary
When using direct regression models to predict photovoltaic power generation in the prior art, there are problems such as instability in the training stage, high risk of overfitting and low prediction robustness.
A photovoltaic power generation prediction method is adopted to input the power generation impact feature to be predicted into the pre-trained photovoltaic power generation prediction model, multi-scale feature extraction and timing feature extraction are performed, and the residual module and advanced feature module are combined to perform features. Fusion and convert it into a classification model for prediction, reducing the risk of overfitting.
The training and prediction stability of the model is improved, the feature extraction ability is enhanced, the prediction accuracy is improved, the risk of overfitting is reduced, and the prediction of photovoltaic power generation is more reliable.
Smart Images

Figure CN119293640A_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 and renewable energy source, solar energy has received more and more attention and importance worldwide. With the continuous development and application of photovoltaic technology, photovoltaic power generation has become an important part of the new energy field. In order to maintain the balance and stability of electricity consumption and stored electricity, accurate prediction of photovoltaic power generation is essential. The accuracy of photovoltaic power generation prediction directly depends on the accuracy of weather forecast (radiation / temperature / humidity / wind speed / cloud cover, etc.). Due to the errors in weather forecast itself, the actual power generation corresponding to the weather forecast and the photovoltaic power generation are blurred. Therefore, the prediction of photovoltaic power generation is not accurate enough and the error is large.
[0003] At present, deep learning technology is the most prominent in photovoltaic power generation prediction. In recent years, the superior performance of direct regression models in photovoltaic power generation prediction has attracted widespread attention. However, these models still have problems such as instability in the training stage, 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 of unstable training phase, high risk of overfitting and low prediction robustness when using direct regression model to predict photovoltaic power generation in the prior art.
[0005] To solve the above technical problems, the present application provides the following technical solutions: According to a first aspect of the present application, a photovoltaic power generation prediction method is provided. Inputting 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 the 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 predicts based on the power generation influencing characteristics to be predicted, and outputs the power generation integer value prediction result and the power generation decimal value prediction result including: Based on multiple convolution kernels, multi-scale feature extraction is performed on the features affecting the power generation to be predicted to obtain a multi-scale feature map; Extracting time series features of the power generation impact features 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 part of photovoltaic power generation from the fused feature map to obtain a coarse-grained feature map; 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; 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.
[0006] Optionally, before the step of fusing the multi-scale feature map and the temporal feature map, the step further includes: Performing a first optimization on the multi-scale feature map by a residual module to obtain a multi-scale optimized feature map; Performing a second optimization on the time series feature graph through an advanced feature module to obtain a time series optimized feature graph having the same feature dimension as the multi-scale optimized feature graph; The multi-scale feature map and the temporal feature map are subjected to feature fusion to obtain a fused feature map, comprising: The multi-scale optimized feature map and the temporal optimized feature map are subjected to feature fusion to obtain a fused feature map.
[0007] Optionally, performing multi-scale feature extraction on the to-be-predicted power generation impact feature based on multiple convolution kernels to obtain a multi-scale feature map includes: 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.
[0008] 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 The feature map is M small value labels {0.0, 1* , 2* ,……,(M-1)* }, where B is the number of sunshine time intervals per day, N and M are positive integers, is the preset integer step value, is the preset decimal step value.
[0009] Optionally, obtaining the power generation integer value prediction result and the power generation decimal value prediction result based on the coarse-grained feature map and the fine-grained feature map includes: Find the integer value label with the largest 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 small value label with the largest classification probability for each time interval from the fine-grained feature map, and use the small value label as the small value prediction result of the power generation for the time interval.
[0010] Optionally, obtaining the predicted photovoltaic power generation of the power generation influencing characteristic to be predicted according to the power generation integer value prediction result and the power generation decimal value prediction result comprises: Based on each time interval, the power generation integer value prediction result and the power generation decimal value prediction result are added together to obtain the initial predicted photovoltaic power generation for the time interval; The predicted photovoltaic power generation at the current time interval is obtained according to the initial predicted photovoltaic power generation at the previous time interval, the initial predicted photovoltaic power generation at the current time interval and the initial predicted photovoltaic power generation at the next time interval.
[0011] Optionally, the photovoltaic power generation prediction model is trained based on the following method: Acquire historical power generation influencing features and real power generation corresponding to the historical power generation influencing features; Splitting the real power generation into a real power generation integer value and a real power generation decimal value, encoding the real power generation integer value based on N integer value labels to obtain an integer value probability vector of the real power generation, and encoding the real power generation decimal value based on M decimal value labels to obtain a decimal value probability vector of the real power generation; 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.
[0012] Optionally, encoding the real power generation integer value based on N integer value tags to obtain the integer value probability vector of the real power generation includes: Encode the classification probability of the integer value label corresponding to the real generated power integer value in the N integer value labels into a first probability value slightly less 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 less than 1, and the remaining probability of 1 minus the second probability value is allocated to other fractional value labels.
[0013] 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, the memory storing instructions executable by the at least one processor, the instructions being executed by the at least one processor so that the at least one processor can execute the photovoltaic power generation prediction method described above.
[0014] 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.
[0015] 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, the power generation influencing feature to be predicted is input into a pre-trained photovoltaic power generation prediction model, and an integer value prediction result of the power generation and a decimal value prediction result of the power generation are obtained, and the predicted photovoltaic power generation is obtained according to 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 feature 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 feature to be predicted based on a long short-term memory network to obtain a time series feature map; then, the multi-scale feature map and the time series feature map are feature fused 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. The method of the present application uses a classification model to predict photovoltaic power generation, converting the continuous value problem into discrete category power generation integer value prediction and power generation decimal value prediction, reducing the risk of overfitting and making the model training and prediction more stable and reliable. In addition, the model structure design uses multi-scale feature extraction branches and time series feature extraction branches to enhance the model's ability to extract features and improve the accuracy of prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.
[0017] Figure 1 It is a schematic diagram of an algorithm framework of a photovoltaic power generation prediction model provided in an embodiment of the present application; Figure 2 is a structural diagram of a multi-scale feature module 102 provided in an embodiment of the present application; Figure 3 is a structural diagram of a residual module 104 provided in an embodiment of the present application; Figure 4 is a structural diagram of a timing feature module 103 provided in an embodiment of the present application; Figure 5 is a structural diagram of an advanced feature module 105 provided in an embodiment of the present application; Figure 6 is a structural diagram of a coarse-grained feature module 107 provided in an embodiment of the present application; Figure 7is a schematic diagram of a coarse-grained feature map provided in an embodiment of the present application; Figure 8 is a schematic diagram of a fine-grained feature map provided in an embodiment of the present application; Fig. 9 It is a flow chart of a training method for a photovoltaic power generation prediction model provided in an embodiment of the present application; Fig.10 It is a flow chart of a photovoltaic power generation prediction method provided in an embodiment of the present application; Fig.11 yes Fig.10 A detailed flowchart of step S1002; Fig.12 It is a structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0018] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0019] 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.
[0020] 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.
[0021] 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 1 As 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.
[0022] 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 characteristic parameter features unique to the equipment. 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 time intervals per day, and C is the number of features that affect power generation. Assuming there are 12 hours of sunshine per day and each time interval is 15 minutes, then B=12x4=48 intervals. Features that affect power generation may include temperature, humidity, air pressure, longitude, latitude, etc.
[0023] The multi-scale feature module 102 is used to extract multi-scale features of the power generation influencing features based on multiple convolution kernels to obtain a multi-scale feature map. Through the multi-scale feature module 102, the model can extract physical features in a wider range, reduce the dependence on the time window, ignore the impact of time series features on the data, focus on the combination of different features, and explore more potential correlations between features, thereby forming richer input features and improving the robustness and accuracy of prediction.
[0024] The residual module 104 is provided after the multi-scale feature module 102 and is used to perform a first optimization on the multi-scale feature map to obtain a multi-scale optimized feature map. Through the 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.
[0025] The time series feature module 103 is used to extract the time series features of the power generation influencing features based on the long short-term memory network (LSTM), capture the changing relationship between the photovoltaic power generation and the power generation influencing features in the time dimension, and obtain the time series feature graph. Through the time series feature module 103, the model can better focus on the following features: 1) the pattern information of the photovoltaic power generation changing over time; 2) the periodic characteristics of the photovoltaic power generation, such as the seasonal variation characteristics of the photovoltaic power generation, and the long-term trend of the photovoltaic power generation; 3) the continuity relationship between the photovoltaic power generation in time; 4) reduce the problems of gradient hour or gradient explosion in the calculation.
[0026] The advanced feature module 105 is arranged after the time series feature module 103, and is used to perform a second optimization on the time series feature map through a CBL (Convolutions with Batch Normalization and Leaky ReLU, convolution + batch normalization + ReLU activation function) module to obtain a time series optimized feature map with the same feature dimension as the multi-scale optimized feature map. Through the advanced feature module 105, on the one hand, the ability of the model to extract features can be improved, and on the other hand, the output structure of the time series feature extraction branch can be changed so that it can be fused with the features extracted by the multi-scale feature branch.
[0027] 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.
[0028] The feature fusion module 106 is used to perform feature fusion on the feature map output by the multi-scale feature extraction branch and the feature map output by the temporal feature extraction branch according to channels to obtain a fused feature map.
[0029] 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.
[0030] 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.
[0031] The integer value output module 109 is used to obtain the integer value prediction result of the power generation according to the coarse-grained characteristic diagram.
[0032] 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.
[0033] 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.
[0034] The loss calculation module 112 is used to calculate the integer value loss of the generated electricity and the decimal value loss of the generated electricity respectively through the cross entropy loss function, and then add the integer value loss of the generated electricity and the decimal value loss of the generated electricity to obtain the total loss of the predicted photovoltaic power generation. This module is mainly used in the training process of the photovoltaic power generation prediction model, aiming to provide guidance for the model's learning direction.
[0035] In one embodiment, the cross entropy loss function is:
[0036] 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 PV power generation corresponding to the power generation influencing characteristics, and N is the number of samples.
[0037] 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) inputting 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.
[0038] 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.
[0039] 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) inputting 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.
[0040] 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 a timing optimized feature graph.
[0041] Through the advanced feature module 105, the feature dimension W_cbl of the timing optimization feature map can be made equal to the feature dimension W_resnet of the multi-scale optimization feature map. The feature fusion module 106 is also used to splice the multi-scale optimization feature map and the timing optimization feature map by channel. For example, assuming that the dimension of the multi-scale optimization feature map is (1*C_resnet*W_resnet), the dimension of the timing optimization 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.
[0042] 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, the processing process of the coarse-grained feature module 107 is as follows: (1) inputting the fused feature map extracted in the previous stage; (2) extracting the coarse-grained features of the integer value part for predicting photovoltaic power generation from the fused feature map through three CBL modules, and outputting the coarse-grained feature map.
[0043] In one embodiment, the coarse-grained feature map is B 1 N feature map, 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:
[0044] in, is the maximum power generation 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, then 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}.
[0045] The integer value output module 109 is also 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, so the integer value of the power generation in the second time interval is 4w.
[0046] 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 extracted through three CBL modules to obtain the fine-grained features for predicting the decimal part of photovoltaic power generation, and the fine-grained feature map is output.
[0047] In one embodiment, the fine-grained feature map is B 1 The feature map of The characteristic graph 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, suppose =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 another example, suppose =0.01w, then M=100, that is, the M small value labels are {0.00, 0.01, 0.02, ...0.1, ..., 0.99}.
[0048] The small value output module 110 is also 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 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. The decimal value of power generation in the second time interval is 0.2w.
[0049] 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 4.2W in the second time interval according to the power generation integer value 4W and the power generation decimal value 0.2W in the second time interval.
[0050] Please refer to Fig. 9 , Fig. 9 1 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: S901, obtaining historical power generation influencing features and actual power generation corresponding to the historical power generation influencing features.
[0051] Collect historical meteorological data, historical power generation data, related time data, etc. of photovoltaic power stations to obtain dimension A B The historical power generation impact characteristics of C and its corresponding real power generation. For example, the historical power generation impact characteristics are: {Date: October 20, 2024, Time interval: 1, temperature: 28℃, humidity: 65%, air pressure: 1008 Pa, ..., Time interval: 2, temperature: 28℃, humidity: 65%, air pressure: 1008 Pa, ..., … Time interval: 48, temperature: 25℃, humidity: 55%, air pressure: 1008 Pa,...,}.
[0052] The actual power generation corresponding to the historical power generation impact feature is: {2.5, ..., 10}, a total of 48 values.
[0053] S902, split the real power generation into a real power generation integer value and a real power generation decimal value, encode the real power generation integer value based on N integer value labels to obtain an integer value probability vector of the real power generation, and encode the real power generation decimal value based on M decimal value labels to obtain a decimal value probability vector of the real power generation.
[0054] In order to convert the regression problem into a classification problem, this application decomposes the photovoltaic power generation prediction into the prediction of the integer value of power generation and the prediction of the decimal value of power generation. Therefore, when training the model, it is necessary to first split the real power generation into the real power generation integer value and the real power generation decimal value. For example, if the real power generation is 20.5w, after the split, the real power generation integer value is 20w, and the real power generation decimal value is 0.5w.
[0055] In the classification model, the traditional label encoding method is one-hot label encoding, that is, the probability of the correct label category is set to 1, and the probability of other label categories is set to 0. For example, after using the traditional one-hot label encoding for 2.5w, the integer value probability vector obtained is {0, 0, 1,0,…, 0}, and the fractional value probability vector is {0, 0, 0, 0, 0,1,…, 0}, where the omitted parts are all 0.
[0056] In the actual training of the model, the historical power generation influencing features come from the predicted weather features provided by the meteorological forecast system, which have errors with the real physical weather features. When the predicted weather features are used as input features and the real power generation is used as the label, the label is inaccurate and fuzzy, resulting in inaccurate prediction of photovoltaic power generation and large errors. To solve this problem, the present application provides a fuzzy label encoding method to encode the real power generation integer value and the real power generation decimal value. Specifically, fuzzy label 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 in a certain label category during the training process. By softening the label, the stability and accuracy of the model training can be improved.
[0057] In one embodiment, encoding the integer value of the actual power generation 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 power generation in the N integer value labels into a first probability value, and assigning the remaining probability of 1 minus the first probability value to other integer value labels. Similarly, encoding the decimal value of the actual power generation 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 power generation in the M decimal value labels into a second probability value, and assigning the remaining probability of 1 minus the second probability value to other decimal value labels. The first probability value and the second probability value are values slightly less than 1 (for example, 0.9), and the two may be the same or different.
[0058] 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, assuming that the real power generation integer value is X, when When , the integer value probability vector 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; 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; When X=N-1, the integer value probability vector 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.
[0059] For example, after encoding 2.5w with 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.
[0060] In one embodiment, the remaining probability of 1 minus the second probability value is evenly distributed to the adjacent decimal value tags of the corresponding decimal value tag. The specific distribution method is the same as the above-mentioned method of distributing the remaining probability of 1 minus the first probability value to the adjacent integer value tags of the corresponding integer value tag, which will not be repeated here.
[0061] Step S903 , training a photovoltaic power generation prediction model by taking historical power generation influencing features as input data, integer probability vectors of real power generation and fractional probability vectors of real power generation as label values.
[0062] 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.
[0063] Please refer to Fig.10 , Fig.10 : 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: Step S1001: inputting the power generation influencing features to be predicted into a pre-trained photovoltaic power generation prediction model.
[0064] Among them, the dimension of the impact characteristics 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.
[0065] 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, the training method of the photovoltaic power generation prediction model is Fig. 9 The training method of the photovoltaic power generation prediction model.
[0066] Step S1002 , the photovoltaic power generation prediction model performs prediction based on the power generation influencing characteristics to be predicted, and outputs the power generation integer value prediction result and the power generation decimal value prediction result.
[0067] Step S1003, obtaining the predicted photovoltaic power generation of the power generation influencing characteristics to be predicted according to the power generation integer value prediction result and the power generation decimal value prediction result.
[0068] In one embodiment, the specific implementation method of step S1003 is: based on each time interval contained 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.
[0069] Since photovoltaic power generation is positively correlated with the power generation influencing characteristics, photovoltaic power generation is linear in time series. In order to further improve the robustness of model prediction, the predicted photovoltaic power generation of the two time intervals adjacent to the current time interval is fused with the predicted photovoltaic power generation of the current time interval to obtain the final predicted photovoltaic power generation of the current time interval. Specifically, first, based on each time interval contained in the power generation influencing characteristics 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 to obtain the initial predicted photovoltaic power generation of the time interval; then, 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. For example, the initial predicted photovoltaic power generation of the first time interval is X1, the initial predicted photovoltaic power generation of the second time interval is X2, and the initial predicted photovoltaic power generation of the third time interval is X3. Then, the predicted photovoltaic power generation of the second time interval is obtained by the average method as (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 of the last time interval may be set to zero.
[0070] Please refer to Fig.11 , Fig.11 yes Fig.10 The detailed flow chart of step S1002 specifically includes the following steps: 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.
[0071] In one embodiment, the specific implementation of step S1002a is 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 processing on the first feature map to obtain a second feature map; (3) performing nonlinear mapping on the second feature map through a ReLU activation function to obtain a third feature map; (4) extracting global features from the third feature map based on the second convolution kernel to obtain a multi-scale feature map. The size of the first convolution kernel is (1, 3, 5, 7, 9), and the size of the second convolution kernel is 17.
[0072] Step S1002b: extracting time series features of the power generation influencing features to be predicted based on the long short-term memory network to obtain a time series feature graph.
[0073] In one embodiment, the specific implementation method 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.
[0074] Step S1002c, performing feature fusion on the multi-scale feature map and the temporal feature map to obtain a fused feature map.
[0075] In one embodiment, before step S1002c, it also 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 time series feature map output by step S1002b through a CBL module to obtain a time series 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 overfitting of the model, and improve the ability to extract abstract features. After the time series feature map is optimized, on the one hand, the ability of the model to extract features can be improved, and on the other hand, the output structure of the time series 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 time series optimized feature map according to the channel to obtain a fused feature map.
[0076] Step S1002d, extracting 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.
[0077] In one embodiment, three CBL modules are used to extract coarse-grained features for predicting the integer value part 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 map, 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:
[0078] in, is the maximum power generation 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, then 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}.
[0079] 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.
[0080] 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 The characteristic graph 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, suppose =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 another example, suppose =0.01w, then M=100, that is, the M small value labels are {0.00, 0.01, 0.02, ...0.1, ..., 0.99}.
[0081] Step S1002f, based on the coarse-grained feature map and the fine-grained feature map, obtain the integer value prediction result of the power generation and the decimal value prediction result of the power generation.
[0082] 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 small value label with the largest classification probability for each time interval is found from the fine-grained feature map, and the largest small value label is output as the small value prediction result of the power generation for the time interval.
[0083] 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 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. The decimal value of power generation in the second time interval is 0.2w.
[0084] The photovoltaic power generation prediction method provided by 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 according to 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 performing feature fusion on the multi-scale feature map and the time series feature map to obtain a fused feature map; then, respectively extracting 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 from the fused feature map, and obtaining an integer value prediction result of the power generation and a decimal value prediction result of the power generation based on the coarse-grained feature map and the fine-grained feature map. The method of the present application uses a classification model to predict photovoltaic power generation, converting the continuous value problem into discrete category power generation integer value prediction and power generation decimal value prediction, reducing the risk of overfitting and making the model training and prediction more stable and reliable. In addition, the model structure design uses multi-scale feature extraction branches and time series feature extraction branches to enhance the model's ability to extract features and improve the accuracy of prediction.
[0085] According to an embodiment of the present application, an electronic device is provided, such as Fig.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, wherein the processor 1201, the communication interface 1202, and the memory 1203 communicate with each other through the communication bus 1204. The processor 1201 may call the logic instructions in the memory 1203 to execute the above-mentioned photovoltaic power generation prediction method.
[0086] In addition, the logic instructions in the above-mentioned memory 1203 can be implemented in the form of software functional units and can be stored in several computer-readable storage media when sold or used as independent products. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions to enable 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, etc. Various media that can store program codes.
[0087] According to an embodiment of the present application, a computer-readable storage medium is provided, the type of which is as described above, the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor executes the steps of the photovoltaic power generation prediction method described above.
[0088] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution, in essence or in other words, the part that contributes to the relevant technology, can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiment.
[0089] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application. Therefore, any modification, equivalent substitution, improvement, etc. made within the spirit and principle of the present application should be included in the protection scope of the present application.
Claims
1. A photovoltaic power generation prediction method, characterized in that: include: Inputting 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 the 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 predicts based on the power generation influencing characteristics to be predicted, and outputs the power generation integer value prediction result and the power generation decimal value prediction result including: Based on multiple convolution kernels, multi-scale feature extraction is performed on the power generation influencing features to be predicted to obtain a multi-scale feature map; Extracting time series features of the power generation impact features 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 part of photovoltaic power generation from the fused feature map to obtain a coarse-grained feature map; 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; 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.
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 by a residual module to obtain a multi-scale optimized feature map; Performing a second optimization on the time series feature graph through an advanced feature module to obtain a time series optimized feature graph having the same feature dimension as the multi-scale optimized feature graph; The multi-scale feature map and the temporal feature map are subjected to feature fusion to obtain a fused feature map, comprising: 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 feature 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, characterized in that: 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 The feature map is M small value labels {0.0,1* , 2* ,……,(M-1)* }, where B is the number of sunshine time intervals per day, N and M are positive integers, is the preset integer step value, is the preset decimal step value.
5. The method according to claim 4, characterized in that The obtaining of the power generation integer value prediction result and the power generation decimal value prediction result based on the coarse-grained feature map and the fine-grained feature map includes: Find the integer value label with the largest 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 small value label with the largest classification probability for each time interval from the fine-grained feature map, and use the small value label as the small value prediction result of the power generation for the time interval.
6. The method according to claim 4, characterized in that The step of obtaining the 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 comprises: Based on each time interval, the power generation integer value prediction result and the power generation decimal value prediction result are added together to obtain the initial predicted photovoltaic power generation for the time interval; The predicted photovoltaic power generation at the current time interval is obtained according to the initial predicted photovoltaic power generation at the previous time interval, the initial predicted photovoltaic power generation at the current time interval and the initial predicted photovoltaic power generation at the next time interval.
7. The method according to any one of claims 4 to 6, characterized in that: The photovoltaic power generation prediction model is trained based on the following method: Acquire historical power generation influencing features and real power generation corresponding to the historical power generation influencing features; Splitting the real power generation into a real power generation integer value and a real power generation decimal value, encoding the real power generation integer value based on N integer value labels to obtain an integer value probability vector of the real power generation, and encoding the real power generation decimal value based on M decimal value labels to obtain a decimal value probability vector of the real power generation; 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.
8. The method according to claim 7, characterized in that The encoding of the real power generation integer value based on N integer value tags to obtain the integer value probability vector of the real power generation includes: Encode the classification probability of the integer value label corresponding to the real generated power integer value in the N integer value labels into a first probability value slightly less 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 less than 1, and the remaining probability of 1 minus the second probability value is allocated to other fractional value labels.
9. 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 as described in any one of claims 1 to 8.
10. 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 executes the photovoltaic power generation prediction method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Photovoltaic power station day-ahead generating capacity prediction method and system based on convolution LSTM
CN113469427A
Photovoltaic power generation power prediction method based on time-sharing gating circulation unit
CN115579858A
Short-time photovoltaic generating capacity prediction method and system considering weather conditions and medium
CN116402203A
Vehicle-mounted screen control method, system, device and equipment and storage medium
CN118219792A
Weighted machine learning agreement system for classification
US20240330413A1
Cited By
Photovoltaic power generation prediction method and device, and storage medium
CN120258257A