A photovoltaic power generation prediction method and system based on convolutional neural network
Through convolutional neural networks and self-update mechanisms, the accuracy and real-time issues of photovoltaic power generation prediction models when they are established in a short time are solved, and efficient prediction effects are achieved.
Patent Information
- Application Number
- CN202411134768.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-19
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2044-08-19
AI Technical Summary
The existing photovoltaic power generation prediction model has low prediction accuracy even though it has been established for a short time. In addition, the graph attention model takes a long time to train, making it difficult to balance dynamic real-time performance.
Convolutional neural networks are used for training, and the model is retrained regularly through a self-update mechanism. Combined with the rules for adding and deleting historical data, the dynamic real-time performance and accuracy of the model are ensured.
The dynamic real-time and high-precision power generation forecast of photovoltaic areas is achieved, which shortens the training time, avoids resource waste, and balances the model update and real-time performance.
Smart Images

Figure CN119134282B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of photovoltaic power generation prediction, and more specifically, to: 1. a photovoltaic power generation prediction method based on a convolutional neural network; 2. a photovoltaic power generation prediction system based on a convolutional neural network. Background Art
[0002] Accurately forecasting photovoltaic power generation is crucial for stable grid operation and energy management. Because photovoltaic power generation comes from solar energy conversion, power generation is closely related to the weather conditions in the area.
[0003] The inventor retrieved a Chinese invention patent with patent number CN202410577212.X, which discloses a distributed photovoltaic intelligent monitoring method, system, device, and medium. The inventor analyzed the patent and found the following problems:
[0004] The prediction model used in this patent is trained using a training set—since the patent doesn't specifically describe the training set, it's generally understood that the training set uses historical data within a unit of time—and once training is complete, the trained prediction model is used continuously. However, the accuracy of the prediction model is closely related to the amount of historical data. For some newly established photovoltaic power stations, the amount of historical data is insufficient, so using this patent's approach will result in consistently low prediction accuracy.
[0005] Therefore, the inventors considered introducing a self-updating method to ensure the accuracy of the prediction model - this method can achieve dynamic real-time prediction; but the model of this patent is a graph attention model (GAT), which takes a long time to train. Moreover, as historical data continues to increase, the training time of the model will be further extended, which will interfere with dynamic real-time performance and make it impossible to achieve a balance between the two. Summary of the Invention
[0006] Based on this, it is necessary to provide a photovoltaic area power generation prediction method and system based on convolutional neural network to address the problem that the existing patent predictions do not have dynamic real-time performance and fail to achieve a balance between model self-update and dynamic real-time performance.
[0007] The present invention is achieved by adopting the following technical solutions:
[0008] In a first aspect, the present invention discloses a photovoltaic power generation prediction method based on a convolutional neural network, comprising the following steps:
[0009] Step 1: Obtain historical data of the target PV area before the current time t0;
[0010] Among them, historical data includes: historical meteorological data, historical power generation data;
[0011] Step 2: linearly normalize the historical data in step 1 to obtain normalized historical data and form a sample data set;
[0012] Step 3: Based on the sample data set in step 2, the pre-built convolutional neural network is trained, and the trained convolutional neural network is used as the power generation prediction model of the substation area;
[0013] Among them, the convolutional neural network includes: convolution part I, convolution part II, convolution part III, expansion layer, fully connected layer I, and fully connected layer II stacked in sequence; convolution part I includes: convolution layer I and pooling layer I stacked in sequence; convolution part II includes: convolution layer II and pooling layer II stacked in sequence; convolution part III includes: convolution layer III and pooling layer III stacked in sequence;
[0014] Step 4: linearly normalize the meteorological data of the target photovoltaic area at the current time t0 and then input it into the area power generation prediction model in step 3; perform inverse normalization on the output value of the area power generation prediction model to obtain the power generation prediction result at the current time t0;
[0015] Step 5: Add the meteorological data and actual power generation data at the current time t0 to the historical data in step 1, and count it as one addition;
[0016] As the current time t0 is updated, when the number of replenishment reaches N*K, restart steps 2 to 4;
[0017] Wherein, N represents a positive integer; K represents the preset replenishment times threshold.
[0018] This convolutional neural network-based photovoltaic area power generation prediction method implements the method or process according to the embodiment of the present disclosure.
[0019] In a second aspect, the present invention discloses a photovoltaic area power generation prediction system based on a convolutional neural network, which uses the photovoltaic area power generation prediction method based on a convolutional neural network disclosed in the first aspect.
[0020] The photovoltaic area power generation prediction system based on convolutional neural network includes: data acquisition module, data set construction module, model training module, power generation prediction module, and model update module.
[0021] The data acquisition module is used to obtain the historical data of the target photovoltaic area before the current time t0. The data set construction module is used to linearly normalize the historical data to obtain the normalized historical data and form a sample data set. The model training module is used to train the pre-built convolutional neural network based on the sample data set, and use the trained convolutional neural network as the area power generation prediction model. The power generation prediction module is used to linearly normalize the meteorological data of the target photovoltaic area at the current time t0, then input it into the area power generation prediction model, and perform inverse normalization on the output value of the area power generation prediction model to obtain the power generation prediction result at the current time t0. The model update module is used to add the meteorological data and actual power generation data at the current time t0 to the historical data, and count it as one addition; it is also used to update with the current time t0, and when the number of additions reaches N*K, the data set construction module, model training module, and power generation prediction module will resume operation.
[0022] This convolutional neural network-based photovoltaic area power generation prediction system implements the method or process according to the embodiment of the present disclosure.
[0023] In a third aspect, the present invention discloses a computer program product, comprising a computer program. When executed by a processor, the computer program implements the steps of the photovoltaic power generation prediction method based on a convolutional neural network as disclosed in the first aspect.
[0024] Compared with the prior art, the present invention has the following beneficial effects:
[0025] 1. The present invention trains a convolutional neural network based on the historical data of the target photovoltaic area to obtain an area power generation prediction model for power generation prediction, and introduces model self-update. By adding the meteorological data and actual power generation data of the current time t0 into the historical data, and regularly retraining the convolutional neural network by judging the number of additions, the update of the area power generation prediction model is completed to ensure the accuracy of the prediction model and realize the dynamic real-time performance of the prediction. In addition, the convolutional neural network with a relatively simple structure is adopted, and its training time can be greatly shortened compared with the graph attention model, reducing the interference with dynamic real-time performance, so as to achieve a balance between model self-update and dynamic real-time performance.
[0026] 2. The present invention also takes into account the problem that the continuous increase of historical data will further prolong the time of model training, and sets relatively complete rules for updating historical data. When the amount of historical data is sufficient, the unlimited growth of historical data is avoided through a one-in-one-out replacement rule, so as to help achieve a balance between model self-update and dynamic real-time performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0028] Figure 1 Flowchart of the photovoltaic power generation prediction method based on convolutional neural network provided in Example 1 of the present invention;
[0029] Figure 2 for Figure 1 Figure 2. The structure of a convolutional neural network. DETAILED DESCRIPTION
[0030] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0031] It should be noted that when a component is referred to as being "mounted on" another component, it may be directly on the other component or there may be a central component. When a component is considered to be "set on" another component, it may be directly set on the other component or there may be a central component. When a component is considered to be "fixed to" another component, it may be directly fixed to the other component or there may be a central component.
[0032] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this invention pertains. The terms used herein in the specification of the present invention are for the purpose of describing specific embodiments only and are not intended to limit the present invention. The term "or / and" as used herein includes any and all combinations of one or more of the associated listed items.
[0033] Example 1
[0034] See Figure 1 , Figure 1 A flow chart of a photovoltaic power generation prediction method based on a convolutional neural network provided in Example 1 is shown, which includes the following steps:
[0035] Step 1: Obtain historical data of the target PV area before the current time t0.
[0036] Generally speaking, historical data is counted once every hour, and its overall time span can be expressed as [t1, t0), where t1 is earlier than t0.
[0037] From the data type point of view, historical data include: historical meteorological data, historical power generation data (in kWh). Among them, historical meteorological data can be further refined, and its types include: temperature (in °C), humidity (in %), wind speed (in m / s), air pressure (in hPa), precipitation (in mm), surface horizontal radiation (in W / m 2 ), normal direct radiation (unit: W / m 2 ), scattered radiation (unit: W / m 2 )wait.
[0038] Meteorological data can be obtained from the data interface of the relevant meteorological platform; power generation data can be retrieved by connecting to the main station database of the target photovoltaic area.
[0039] In this embodiment 1, the types of meteorological data are determined to be: air temperature, humidity, wind speed, air pressure, precipitation, surface horizontal radiation, normal direct radiation, and scattered radiation, a total of 8 types.
[0040] It should be noted that since it is a photovoltaic area, its power generation is closely related to light radiation; and meteorological data introduces more detailed and comprehensive light radiation type data - surface horizontal radiation, normal direct radiation, and scattered radiation, which makes it easier for subsequent area power generation prediction models to construct more accurate internal relationships.
[0041] Step 2: Linearly normalize the historical data in step 1 to obtain normalized historical data and form a sample data set.
[0042] Since different types of historical data have large numerical differences, using them directly will cause the subsequent model to fail to converge, that is, it will not be able to reach the global optimum. The linear normalization in this step is to control the data in the interval (0, 1) to achieve uniformity of magnitude.
[0043] Specifically, in this step, the calculation formula for linear normalization is:
[0044]
[0045] Where X represents any value of the historical data in step 1; X min is the minimum value in the historical data to which X belongs, X max is the maximum value in the historical data to which X belongs; X norm represents the normalized data of X.
[0046] For example, if X is any value of historical temperature data, then X min is the minimum value in the historical temperature data, X max is the maximum value of historical temperature data; X norm represents the normalized data of X. Other cases are similar and will not be repeated here.
[0047] Step three: Based on the sample data set in step two, the pre-built convolutional neural network is trained, and the trained convolutional neural network is used as the substation power generation prediction model.
[0048] See Figure 2 , the convolutional neural network includes: convolution part I, convolution part II, convolution part III, expansion layer, fully connected layer I, and fully connected layer II stacked in sequence.
[0049] Convolutional part I includes: convolutional layer I and pooling layer I stacked in sequence;
[0050] Convolutional part II includes: convolutional layer II and pooling layer II stacked in sequence;
[0051] The convolution part III includes: convolution layer III and pooling layer III stacked in sequence.
[0052] Specifically, convolution layer I, convolution layer II, and convolution layer III contain 16 convolution kernels, 32 convolution kernels, and 64 convolution kernels respectively; the size of the convolution kernel is 3×3, and the stride is 1;
[0053] The pooling window size of pooling layer I, pooling layer II, and pooling layer III is 3×3, and the step size is 1;
[0054] The fully connected layer I contains 50 neurons, and its activation function is the ReLU function; the fully connected layer II contains 1 neuron.
[0055] In this embodiment 1, since 8 types of meteorological data are used, when training the model, the historical meteorological data can be written as an input matrix with a dimension of 1×8; the input matrix is input into the convolutional neural network and first processed by convolution part I, convolution part II, and convolution part III; wherein, the ReLU function is used after convolution layer I, convolution layer II, and convolution layer III to increase the nonlinearity of the data; then it is flattened into a one-dimensional vector through the expansion layer; then it passes through the fully connected layer I and fully connected layer II to obtain an output matrix with a dimension of 1×1, which is the predicted value of power generation.
[0056] Then, when training the pre-built convolutional neural network, the root mean square error (MSE) is used as the loss function; the calculation formula of MSE is as follows:
[0057]
[0058] Where Yi represents the i-th predicted power generation, y i represents the actual power generation, and M is the total number of samples.
[0059] In this embodiment 1, the training process is set as follows:
[0060] The number of samples input each time is 50, the number of training rounds is 200, and the learning rate is 1e -4 , the optimizer uses Adam optimizer.
[0061] Compared with the graph attention model, the convolutional neural network structure used in this method is relatively simple, and its training time can be greatly shortened.
[0062] In step 4, the meteorological data of the target photovoltaic area at the current time t0 is first linearly normalized and then input into the area power generation prediction model in step 3; the output value of the area power generation prediction model is inversely normalized to obtain the power generation prediction result at the current time t0.
[0063] Similar to the process in step 2, the meteorological data at the current time t0 also needs to be converted to the interval (0, 1). Therefore, in this step, the method for linear normalization includes:
[0064] The meteorological data at the current time t0 is added to the historical meteorological data in step 1 to obtain the added historical meteorological data;
[0065] Perform linear normalization on the meteorological data at the current time t0 based on the supplemented historical meteorological data;
[0066] In this step, the linear normalization calculation formula is:
[0067]
[0068] Where, Y represents any value of the historical meteorological data after addition; Y min is the minimum value of the historical meteorological data after filling in, Y max is the maximum value of the historical meteorological data after filling in; Y norm Represents the data after Y normalization.
[0069] Then, the substation power generation prediction model processes the normalized meteorological data at the current time t0 to obtain the output value - the predicted value of power generation; but this predicted value is in the interval (0, 1), so it needs to be inverse normalized to restore it to the magnitude of power generation, so as to obtain the power generation prediction result at the current time t0.
[0070] In this step, the calculation formula for inverse normalization is:
[0071] Z=Z out (Zmax -Z min )+Z min ;
[0072] Where Z represents the power generation forecast result at the current time t0; Z out Represents the output value of the power generation prediction model in the substation area; Z max Indicates the maximum value in the historical power generation data; Z min Indicates the minimum value in historical power generation data.
[0073] Step 5: Add the meteorological data and actual power generation data at the current time t0 to the historical data in step 1, and count it as one addition;
[0074] As the current time t0 is updated, when the number of replenishment reaches N*K, restart steps 2 to 4;
[0075] Wherein, N represents a positive integer; K represents the preset replenishment times threshold.
[0076] This step aims to increase the amount of historical data to improve the accuracy of the prediction model. Of course, considering the time-consuming and practical application significance of model retraining, this step does not adopt a high-frequency retraining method - retraining the model after each addition. Instead, it retrains the convolutional neural network regularly by judging the number of additions. This not only ensures the accuracy of the prediction model and realizes the dynamic real-time nature of the prediction, but also avoids the waste of resources caused by high-frequency retraining.
[0077] Considering that historical data is generally counted once every hour, it is recommended to use 24 for K. In this way, the model is retrained every time the amount of historical data increases by 1 day - which is equivalent to self-updating the model every day.
[0078] In addition, if historical data continues to increase, it will further prolong the model training time, thereby further interfering with dynamic real-time performance. To address this situation, you can take the following actions:
[0079] If the time span of the historical data in step one reaches the preset time span, then in step five, each time the historical data in step one is added, the historical meteorological data and historical power generation data at the earliest moment in the historical data are deleted simultaneously to keep the time span of the historical data at the preset time span.
[0080] Generally, the preset time span can be set to 1 year, 2 years, or 3 years, depending on the hardware resources for model training: if the hardware resources are high, the preset time span is selected to be larger; otherwise, the preset time span is selected to be smaller.
[0081] Taking the preset time span of 3 years as an example, if the initial historical data of the target photovoltaic area is less than 3 years, according to this method, the data can be continuously supplemented over time, accompanied by retraining the model to improve the model prediction accuracy until the historical data reaches 3 years; after that, each time the data is supplemented, the earliest historical meteorological data and historical power generation data will be deleted from the historical data at the same time, realizing an in-and-out replacement update, which not only avoids the extension of model training time caused by the continued increase of historical data, but also can use new data to ensure dynamic real-time performance, and assist in achieving a balance between model self-update and dynamic real-time performance.
[0082] Example 2
[0083] This embodiment 2 simultaneously provides a photovoltaic area power generation prediction system based on a convolutional neural network, which uses the photovoltaic area power generation prediction method based on a convolutional neural network disclosed in embodiment 1.
[0084] The photovoltaic power generation prediction system based on convolutional neural network includes: data acquisition module, data set construction module, model training module and model update module.
[0085] The data acquisition module is configured to acquire historical data of the target photovoltaic area before the current time t0.
[0086] The data set construction module is configured as follows: linearly normalizing the historical data to obtain the normalized historical data and forming a sample data set.
[0087] The model training module is configured as follows: based on the sample data set, the pre-built convolutional neural network is trained, and the trained convolutional neural network is used as the substation power generation prediction model.
[0088] The power generation prediction module is configured as follows: the meteorological data of the target photovoltaic area at the current time t0 is first linearly normalized and then input into the area power generation prediction model, and the output value of the area power generation prediction model is inversely normalized to obtain the power generation prediction result at the current time t0.
[0089] The model update module is configured as:
[0090] 1. Add the meteorological data and actual power generation data at the current time t0 to the historical data, and count it as one addition;
[0091] 2. As the current time t0 is updated, when the number of replenishment reaches N*K, the data set construction module, model training module, and power generation prediction module are restarted;
[0092] In addition, the model update module can also be configured as follows: if the time span of the historical data in the data acquisition module reaches the preset time span, the historical data in the data acquisition module is added once each time, and the historical meteorological data and historical power generation data at the earliest moment in the historical data are deleted simultaneously to keep the time span of the historical data at the preset time span.
[0093] Since this photovoltaic area power generation prediction system based on convolutional neural network uses the photovoltaic area power generation prediction method based on convolutional neural network in Example 1, it has the same effect as Example 1 and will not be repeated here.
[0094] Example 3
[0095] This embodiment 3 discloses a computer device, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the steps of the photovoltaic area power generation prediction method based on convolutional neural network disclosed in embodiment 1 are implemented.
[0096] This embodiment 3 also discloses a readable storage medium, which stores computer program instructions. When the computer program instructions are read and executed by a processor, the steps of the photovoltaic area power generation prediction method based on convolutional neural network disclosed in embodiment 1 are executed.
[0097] This embodiment 3 further discloses a computer program product, including a computer program. When the computer program is executed by a processor, the steps of the photovoltaic power generation prediction method based on convolutional neural network disclosed in embodiment 1 are implemented.
[0098] The above-described embodiments merely illustrate several implementations of the present invention, and while their descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the patent. It should be noted that a person skilled in the art would be able to make numerous variations and improvements without departing from the spirit of the present invention, all of which fall within the scope of protection of the present invention. Therefore, the scope of protection of the patent for this invention shall be determined by the appended claims.
Claims
1. A photovoltaic power generation prediction method based on convolutional neural network, characterized in that: The following steps are involved: Step 1: Obtain historical data of the target PV area before the current time t0; Among them, historical data includes: historical meteorological data, historical power generation data; Step 2: linearly normalize the historical data in step 1 to obtain normalized historical data and form a sample data set; Step 3: Based on the sample data set in step 2, the pre-built convolutional neural network is trained, and the trained convolutional neural network is used as the power generation prediction model of the substation area; Among them, the convolutional neural network includes: convolution part I, convolution part II, convolution part III, expansion layer, fully connected layer I, and fully connected layer II stacked in sequence; convolution part I includes: convolution layer I and pooling layer I stacked in sequence; convolution part II includes: convolution layer II and pooling layer II stacked in sequence; convolution part III includes: convolution layer III and pooling layer III stacked in sequence; Step 4: linearly normalize the meteorological data of the target photovoltaic area at the current time t0 and then input it into the area power generation prediction model in step 3; perform inverse normalization on the output value of the area power generation prediction model to obtain the power generation prediction result at the current time t0; Step 5: Add the meteorological data and actual power generation data at the current time t0 to the historical data in step 1, and count it as one addition; As the current time t0 is updated, when the number of replenishment reaches N*K, restart steps 2 to 4; Wherein, N represents a positive integer; K represents the preset replenishment times threshold.
2. The photovoltaic power generation prediction method based on convolutional neural network according to claim 1 is characterized in that: Types of meteorological data include but are not limited to: temperature, humidity, wind speed, air pressure, precipitation, surface horizontal radiation, normal direct radiation, and diffuse radiation.
3. The photovoltaic power generation prediction method based on convolutional neural network according to claim 1 is characterized in that: In step 2, the linear normalization calculation formula is: Where X represents any value of the historical data in step 1; X min is the minimum value in the historical data to which X belongs, X max is the maximum value in the historical data to which X belongs; X norm represents the normalized data of X.
4. The photovoltaic power generation prediction method based on convolutional neural network according to claim 1 is characterized in that: Convolutional layer I, convolutional layer II, and convolutional layer III contain 16 convolution kernels, 32 convolution kernels, and 64 convolution kernels respectively; the size of the convolution kernel is 3×3, and the stride is 1; The pooling window size of pooling layer I, pooling layer II, and pooling layer III is 3×3, and the step size is 1; The fully connected layer I contains 50 neurons, and its activation function is the ReLU function; the fully connected layer II contains 1 neuron.
5. The photovoltaic power generation prediction method based on convolutional neural network according to claim 1 is characterized in that: In step 3, the root mean square error (MSE) is used as the loss function when training the pre-built convolutional neural network.
6. The photovoltaic power generation prediction method based on convolutional neural network according to claim 1, characterized in that: In step 4, the method of performing linear normalization includes: The meteorological data at the current time t0 is added to the historical meteorological data in step 1 to obtain the added historical meteorological data; Perform linear normalization on the meteorological data at the current time t0 based on the supplemented historical meteorological data; The calculation formula for linear normalization is: Where, Y represents any value of the historical meteorological data after addition; Y min is the minimum value of the historical meteorological data after filling in, Y max is the maximum value of the historical meteorological data after filling in; Y norm Represents the data after Y normalization.
7. The photovoltaic power generation prediction method based on convolutional neural network according to claim 6 is characterized in that: In step 4, the calculation formula for inverse normalization is: Z=Z out (WITH max -WITH min )+Z min ; Where Z represents the power generation forecast result at the current time t0; Z out Represents the output value of the power generation prediction model in the substation area; Z max Indicates the maximum value in the historical power generation data; Z min Indicates the minimum value in historical power generation data.
8. The photovoltaic power generation prediction method based on convolutional neural network according to claim 1 is characterized in that: If the time span of the historical data in step one reaches the preset time span, then in step five, each time the historical data in step one is added, the historical meteorological data and historical power generation data at the earliest moment in the historical data are deleted simultaneously to keep the time span of the historical data at the preset time span.
9. A photovoltaic power generation prediction system based on convolutional neural network, characterized in that: It uses the photovoltaic area power generation prediction method based on convolutional neural network as described in any one of claims 1 to 8; The photovoltaic power generation prediction system based on convolutional neural network includes: A data acquisition module is used to obtain historical data of the target photovoltaic area before the current time t0; The data set construction module is used to perform linear normalization on the historical data to obtain the normalized historical data and form a sample data set; The model training module is used to train the pre-built convolutional neural network based on the sample data set and use the trained convolutional neural network as the power generation prediction model of the substation area; The power generation prediction module is used to linearly normalize the meteorological data of the target photovoltaic area at the current time t0, input it into the area power generation prediction model, and perform inverse normalization on the output value of the area power generation prediction model to obtain the power generation prediction result at the current time t0; as well as The model update module is used to add the meteorological data and actual power generation data at the current time t0 to the historical data, and count it as one addition; it is also used to update with the current time t0, and when the number of additions reaches N*K, the data set construction module, model training module, and power generation prediction module will resume operation.
10. A computer program product, characterized in that The method comprises a computer program; when the computer program is executed by a processor, the method implements the steps of the photovoltaic area power generation prediction method based on a convolutional neural network as described in any one of claims 1 to 8.
Citation Information
Patent Citations
A distributed photovoltaic intelligent monitoring method, system, device and medium
CN118413190B
Photovoltaic micro-grid system power generation prediction method and system based on integrated neural network
CN117650526A
Meteorological data prediction method for photo-thermal power prediction
CN118295044A