Photovoltaic power prediction method, system, equipment and medium
By preprocessing the photovoltaic power data and building a prediction model based on spectral normalization generation adversarial network, and correcting and optimizing it in combination with external environmental factors, the problem that traditional photovoltaic power prediction methods are difficult to capture complex dynamic features, achieving high-precision Photovoltaic power prediction.
Patent Information
- Application Number
- CN202411435877.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-14
- Publication Date
- 2025-02-11
AI Technical Summary
Traditional photovoltaic power prediction methods are difficult to capture complex dynamic features. Machine learning methods such as neural networks require a large number of parameter adjustments and are easily overfitted. GAN models are prone to pattern crashes and gradient explosions during training.
By preprocessing historical photovoltaic power data, including wavelet transform denoising and normalization processing, a prediction model based on spectral normalization generation adversarial network (SNGAN) is built, and the model is trained to generate realistic photovoltaic power prediction data, and combined with External environmental factors are corrected and optimized.
It effectively solves the nonlinearity and volatility problems in photovoltaic power data, improves the accuracy of short-term and long-term predictions, and avoids the problem of pattern collapse and gradient explosion during model training.
Smart Images

Figure CN119415845A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure belongs to the field of photovoltaic technology, and in particular relates to a photovoltaic power prediction method, system, device and medium. Background Art
[0002] Photovoltaic power output is affected by external factors such as weather, cloud cover, and solar radiation, and has large volatility and nonlinearity. Traditional prediction methods such as statistical models and regression analysis are difficult to capture these complex dynamic characteristics. Although machine learning methods such as neural networks have been applied to this field, they often require a lot of parameter adjustments and are prone to overfitting. Generative adversarial networks (GANs) are widely used in fields such as image generation because they can learn complex distributions and generate realistic output data. Applying them to photovoltaic power prediction can effectively handle nonlinear and non-stationary data. However, problems such as mode collapse and gradient explosion are prone to occur during the training process of GAN models.
[0003] Therefore, it is necessary to provide a new photovoltaic power prediction method, system, device and medium to solve the above technical problems. Summary of the invention
[0004] The purpose of the present disclosure is to provide a photovoltaic power prediction method, system, device and medium in order to solve the above problems.
[0005] The present invention achieves the above-mentioned purpose through the following technical solutions:
[0006] A photovoltaic power prediction method comprises the following steps:
[0007] Preprocessing the acquired historical photovoltaic power data to obtain preprocessed historical data;
[0008] Construct a prediction model based on spectral normalization generative adversarial network;
[0009] Using the preprocessed historical data as input to train the prediction model to obtain a trained prediction model;
[0010] The photovoltaic power is predicted based on the trained prediction model to obtain a prediction result, and the prediction result is corrected and optimized in combination with external environmental factors to obtain a final photovoltaic power prediction value.
[0011] As a further optimization scheme of the present disclosure, the acquired historical photovoltaic power data is preprocessed, and the preprocessed historical data includes:
[0012] De-noising the historical photovoltaic power data using wavelet transform to obtain de-noised data;
[0013] Normalizing the denoised data to ensure that the data have the same scale range, thereby obtaining normalized data;
[0014] Feature extraction is performed on the normalized data to obtain preprocessed historical data.
[0015] As a further optimization scheme of the present disclosure, constructing a prediction model based on spectral normalization generative adversarial network includes:
[0016] A prediction model based on spectral normalization generative adversarial network is constructed through generator and discriminator;
[0017] The generator is used to generate prediction data similar to the real data distribution by inputting the historical photovoltaic power data; the generator network adopts a convolutional neural network structure, and each layer applies spectral normalization technology;
[0018] The discriminator is used to distinguish the predicted data and real data generated by the generator, and the discriminator also applies spectral normalization technology.
[0019] As a further optimization scheme of the present disclosure, the preprocessed historical data is used as input to train the prediction model, and the trained prediction model obtained includes:
[0020] Using the preprocessed historical data as input to train the prediction model, the goal of the prediction model training is to minimize the loss function of the generator and the discriminator;
[0021] The loss function of the generator And the loss function of the discriminator as follows:
[0022]
[0023] Wherein, D(x) represents the judgment result of the discriminator on the real photovoltaic power data, and D(G(z)) represents the judgment result of the discriminator on the output data of the generator; G(z) is the photovoltaic power prediction value generated by the generator based on the noise z, and D(G(z)) represents the evaluation output of the discriminator on the generated data; Represents the real data set P data (x) randomly samples x to determine whether x belongs to the real data set P data The average mathematical expectation of (x); Refers to the dataset P generated based on the noise z z In the above example, we can get whether z belongs to the noise data set P. z The average mathematical expectation of .
[0024] As a further optimization solution of the present disclosure, the external environmental factors include weather conditions, solar irradiance and temperature.
[0025] As a further optimization scheme of the present disclosure, photovoltaic power prediction is performed based on the trained prediction model to obtain a prediction result, and the prediction result is corrected and optimized in combination with external environmental factors to obtain the final photovoltaic power prediction value including:
[0026] Perform photovoltaic power prediction based on the trained prediction model to obtain a prediction result;
[0027] The prediction results are adjusted according to external environmental factors to obtain the final photovoltaic power prediction value, and the formula is as follows:
[0028] P final =P SNGAN +α·W env ;
[0029] Among them, P final is the final photovoltaic power prediction value, P SNGAN is the preliminary power output predicted by the trained prediction model, α·W env is the weight of the influence of external environmental factors on power output, and α is the correction coefficient.
[0030] As a further optimization scheme of the present disclosure, the photovoltaic power prediction method also includes evaluating the performance of the trained prediction model, and the key indicators used include mean square error MSE, mean absolute percentage error MAPE and determination coefficient R 2 ;
[0031] The mean square error (MSE) is used to measure the difference between the predicted value and the true value. The calculation formula is as follows:
[0032]
[0033] Among them, P i is the actual photovoltaic power value, is the PV power value predicted by the model, and n is the total number of samples;
[0034] The mean absolute percentage error (MAPE) is used to evaluate the percentage of the prediction error of the trained prediction model relative to the actual value. The formula is as follows:
[0035]
[0036] Coefficient of determination R 2 Used to measure the goodness of fit of the prediction model after training, R 2 The closer it is to 1, the stronger the prediction ability of the prediction model after training. The calculation formula is as follows:
[0037]
[0038] in, is the average value of PV power data;
[0039] By comparing the above indicators, the fitting degree of the trained prediction model in predicting photovoltaic power is compared, and the further training of the trained prediction model is guided.
[0040] A photovoltaic power prediction system, comprising:
[0041] A data preprocessing module is used to preprocess the acquired historical photovoltaic power data to obtain preprocessed historical data;
[0042] A model building module, used to build a prediction model based on spectral normalization generative adversarial network;
[0043] A model training module, used to train the prediction model using the preprocessed historical data as input to obtain a trained prediction model;
[0044] The correction and optimization module is used to perform photovoltaic power prediction based on the trained prediction model to obtain a prediction result, and to correct and optimize the prediction result in combination with external environmental factors to obtain a final photovoltaic power prediction value.
[0045] An electronic device comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
[0046] Memory, for storing computer programs;
[0047] The processor is used to implement the photovoltaic power prediction method when executing the program stored in the memory.
[0048] A computer-readable storage medium stores a computer program, which implements a photovoltaic power prediction method when executed by a processor.
[0049] The beneficial effects of the present disclosure are:
[0050] The present invention preprocesses historical photovoltaic power data, introduces spectral normalization technology in the generator and discriminator, stabilizes the training process, and uses the spectral normalization generative adversarial network (SNGAN) model to predict photovoltaic power, effectively solving the nonlinearity and volatility problems in photovoltaic power data and improving the accuracy of short-term and long-term predictions. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] Figure 1 is a method flow chart in an embodiment of the present disclosure;
[0052] Figure 2 is a system structure block diagram in an embodiment of the present disclosure;
[0053] Figure 3 It is a block diagram of the device structure in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0054] The present application is further described in detail below in conjunction with the accompanying drawings. It is necessary to point out here that the following specific implementation methods are only used to further illustrate the present application and cannot be understood as limiting the scope of protection of the present application. Technical personnel in this field can make some non-essential improvements and adjustments to the present application based on the above application content.
[0055] like Figure 1 As shown, a photovoltaic power prediction method comprises the following steps:
[0056] Preprocessing the acquired historical photovoltaic power data to obtain preprocessed historical data;
[0057] Construct a prediction model based on spectral normalization generative adversarial network;
[0058] Using the preprocessed historical data as input to train the prediction model to obtain a trained prediction model;
[0059] The photovoltaic power is predicted based on the trained prediction model to obtain a prediction result, and the prediction result is corrected and optimized in combination with external environmental factors to obtain a final photovoltaic power prediction value.
[0060] In this embodiment, it specifically includes:
[0061] 1. Data preprocessing
[0062] In order to improve the accuracy of model prediction, the historical photovoltaic power data is first preprocessed. This step includes data denoising, normalization, and feature extraction. In particular, the wavelet transform is used to denoise the data and filter out irrelevant noise signals. Normalization ensures that the data has the same scale range, thereby avoiding unstable model training due to different data scales.
[0063] The normalization formula is as follows:
[0064]
[0065] Among them, x represents the original data, x ′ Represents the normalized data, min(x) and max(x) are the minimum and maximum values of the data set, respectively.
[0066] 2. GAN model construction
[0067] The present invention adopts a generative adversarial network (GAN) to predict photovoltaic power. The GAN model consists of a generator and a discriminator. The generator is used to generate future photovoltaic power data, and the discriminator determines whether the generated data is true.
[0068] The task of the generator is to generate forecast data similar to the real data distribution by inputting historical photovoltaic power data. The generator network adopts the convolutional neural network (CNN) structure, and spectral normalization technology is applied to each layer.
[0069] The task of the discriminator is to distinguish the data generated by the generator from the real data. Its structure is similar to that of the generator and also uses spectral normalization. The formula for spectral normalization is as follows:
[0070]
[0071] Among them, W is the weight matrix and x is the input feature vector. Through this method, the weight matrix of each layer is ensured to be within a controllable range to avoid gradient explosion or vanishing problems.
[0072] 3. Power prediction
[0073] The preprocessed historical photovoltaic power data is used as input to train the SNGAN model. The goal of model training is to minimize the loss function of the generator and the discriminator. The loss function of the generator And the loss function of the discriminator as follows:
[0074]
[0075] Where D(x) represents the judgment result of the discriminator on the real photovoltaic power data, and D(G(z)) represents the judgment result of the discriminator on the generator output data; Represents the real data set P data (x) randomly samples x to determine whether x belongs to the real data set P data The average mathematical expectation of (x).
[0076]
[0077] G(z) is the photovoltaic power prediction value generated by the generator based on the noise z, and D(G(z)) is the evaluation output of the discriminator on the generated data; Refers to the dataset P generated based on the noise z z In the above example, we can get whether z belongs to the noise data set P. z The average mathematical expectation of .
[0078] During the training process, the generator is continuously optimized to generate predicted values that are close to the distribution of real photovoltaic power data, while the discriminator improves its ability to distinguish generated data. After training, SNGAN can be used for real-time prediction of photovoltaic power.
[0079] 4. Prediction Optimization
[0080] In the prediction process, this method also combines external factors such as weather, solar irradiance, temperature, etc. Specifically, the prediction results generated by the SNGAN model can be adjusted according to real-time weather data to improve the prediction accuracy. The formula is as follows:
[0081] P final =P SNGAN +α·W env ;
[0082] Among them, P final is the final photovoltaic power prediction value, P SNGAN is the preliminary power output predicted by the SNGAN model, α·W enb is the weight of the impact of external environmental factors on power output (such as irradiance, temperature, etc.), and α is the correction factor used to balance the impact of the model prediction results and the actual environmental data. Through this correction formula, the impact of external factors can be dynamically adjusted to ensure that the model can better adapt to different weather conditions or photovoltaic power station environments in actual applications.
[0083] 5. Performance Evaluation Metrics
[0084] In order to comprehensively evaluate the performance of the SNGAN model, the following key indicators are used:
[0085] (1) Mean Square Error (MSE): used to measure the difference between the predicted value and the true value. The calculation formula of MSE is as follows:
[0086]
[0087] Among them, P i is the actual photovoltaic power value, is the PV power value predicted by the model, and n is the total number of samples.
[0088] (2) Mean absolute percentage error (MAPE): used to evaluate the percentage of model prediction error relative to the actual value. The formula is as follows:
[0089]
[0090] (3) Coefficient of determination (R 2 ): used to measure the goodness of fit of the model, R 2 The closer it is to 1, the stronger the predictive ability of the model. 2The calculation formula is:
[0091]
[0092] in, is the average value of the PV power data.
[0093] By comparing the above performance indicators, the degree of fit of the model in predicting photovoltaic power is compared, guiding the further training of the model.
[0094] like Figure 2 As shown, an embodiment of the present disclosure provides a photovoltaic power prediction system, comprising:
[0095] The data preprocessing module 11 is used to preprocess the acquired historical photovoltaic power data to obtain preprocessed historical data;
[0096] A model building module 12, used to build a prediction model based on a spectral normalization generative adversarial network;
[0097] A model training module 13 is used to train the prediction model using the preprocessed historical data as input to obtain a trained prediction model;
[0098] The correction and optimization module 14 is used to perform photovoltaic power prediction based on the trained prediction model to obtain a prediction result, and to correct and optimize the prediction result in combination with external environmental factors to obtain a final photovoltaic power prediction value.
[0099] The implementation process of the functions and effects of each module in the above system is specifically described in the implementation process of the corresponding steps in the above method, which will not be repeated here.
[0100] For the system embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The system embodiment described above is only schematic, wherein the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the disclosed solution. A person of ordinary skill in the art can understand and implement it without paying any creative work.
[0101] In the above-mentioned embodiment, any multiple of all modules can be combined in one module for implementation, or any one of the modules can be split into multiple modules. Alternatively, at least some functions of one or more of these modules can be combined with at least some functions of other modules and implemented in one module. At least one of all modules can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation modes of software, hardware and firmware or in a suitable combination of any of them. Alternatively, at least one of all modules can be at least partially implemented as a computer program module, and when the computer program module is run, the corresponding function can be executed.
[0102] See also Figure 3 , an electronic device provided by an embodiment of the present disclosure includes a processor 1110, a communication interface 1120, a memory 1130 and a communication bus 1140, wherein the processor 1110, the communication interface 1120, and the memory 1130 communicate with each other through the communication bus 1140;
[0103] Memory 1130, for storing computer programs;
[0104] The processor 1110 is used to implement the photovoltaic power prediction method shown below when executing the program stored in the memory 1130.
[0105] The communication bus 1140 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus 1140 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0106] The communication interface 1120 is used for communication between the above electronic device and other devices.
[0107] The memory 1130 may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory 1130 may also be at least one storage device located away from the processor 1110.
[0108] The above-mentioned processor 1110 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.
[0109] The embodiment of the present disclosure further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the photovoltaic power prediction method described above is implemented.
[0110] The computer-readable storage medium may be included in the device / apparatus described in the above embodiment; or it may exist independently without being assembled into the device / apparatus. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the photovoltaic power prediction method according to the embodiment of the present disclosure is implemented.
[0111] According to an embodiment of the present disclosure, a computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, may include but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, apparatus, or device.
[0112] The above-mentioned embodiments only express several implementation methods of the present disclosure, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present disclosure. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present disclosure, and these all belong to the protection scope of the present disclosure.
Claims
1. A photovoltaic power prediction method, characterized in that: The following steps are involved: Preprocessing the acquired historical photovoltaic power data to obtain preprocessed historical data; Construct a prediction model based on spectral normalization generative adversarial network; Using the preprocessed historical data as input to train the prediction model to obtain a trained prediction model; The photovoltaic power is predicted based on the trained prediction model to obtain a prediction result, and the prediction result is corrected and optimized in combination with external environmental factors to obtain a final photovoltaic power prediction value.
2. A photovoltaic power prediction method according to claim 1, characterized in that: The acquired historical photovoltaic power data is preprocessed, and the preprocessed historical data includes: De-noising the historical photovoltaic power data using wavelet transform to obtain de-noised data; Normalizing the denoised data to ensure that the data have the same scale range, thereby obtaining normalized data; Feature extraction is performed on the normalized data to obtain preprocessed historical data.
3. A photovoltaic power prediction method according to claim 1, characterized in that: The prediction model based on spectral normalization generative adversarial network is constructed by: A prediction model based on spectral normalization generative adversarial network is constructed through generator and discriminator; The generator is used to generate prediction data similar to the real data distribution by inputting the historical photovoltaic power data; the generator network adopts a convolutional neural network structure, and each layer applies spectral normalization technology; The discriminator is used to distinguish the predicted data and real data generated by the generator, and the discriminator also applies spectral normalization technology.
4. A photovoltaic power prediction method according to claim 3, characterized in that: The prediction model is trained by taking the preprocessed historical data as input, and the trained prediction model is obtained, comprising: Using the preprocessed historical data as input to train the prediction model, the goal of the prediction model training is to minimize the loss function of the generator and the discriminator; The loss function of the generator And the loss function of the discriminator as follows: Wherein, D(x) represents the judgment result of the discriminator on the real photovoltaic power data, and D(G(z)) represents the judgment result of the discriminator on the output data of the generator; G(z) is the photovoltaic power prediction value generated by the generator based on the noise z, and D(G(z)) represents the evaluation output of the discriminator on the generated data; Represents the real data set P data (x) randomly samples x to determine whether x belongs to the real data set P data The average mathematical expectation of (x); Refers to the dataset P generated based on the noise z z In the above example, we can get whether z belongs to the noise data set P. z The average mathematical expectation of .
5. A photovoltaic power prediction method according to claim 1, characterized in that: The external environmental factors include weather conditions, solar irradiance and temperature.
6. A photovoltaic power prediction method according to claim 5, characterized in that: The photovoltaic power prediction is performed based on the trained prediction model to obtain a prediction result, and the prediction result is corrected and optimized in combination with external environmental factors to obtain a final photovoltaic power prediction value including: Perform photovoltaic power prediction based on the trained prediction model to obtain a prediction result; The prediction results are adjusted according to external environmental factors to obtain the final photovoltaic power prediction value, and the formula is as follows: P final =P SNGAN +α·W env ; Among them, P final is the final photovoltaic power prediction value, P SNGAN is the preliminary power output predicted by the trained prediction model, α·W env is the weight of the influence of external environmental factors on power output, and α is the correction coefficient.
7. A photovoltaic power prediction method according to claim 1, characterized in that: It also includes the performance evaluation of the trained prediction model, using key indicators such as mean square error (MSE), mean absolute percentage error (MAPE), and coefficient of determination (R). 2 ; The mean square error (MSE) is used to measure the difference between the predicted value and the true value. The calculation formula is as follows: Among them, P i is the actual photovoltaic power value, is the PV power value predicted by the model, and n is the total number of samples; The mean absolute percentage error (MAPE) is used to evaluate the percentage of the prediction error of the trained prediction model relative to the actual value. The formula is as follows: Coefficient of determination R 2 Used to measure the goodness of fit of the prediction model after training, R 2 The closer it is to 1, the stronger the prediction ability of the prediction model after training. The calculation formula is as follows: in, is the average value of PV power data; By comparing the above indicators, the fitting degree of the trained prediction model in predicting photovoltaic power is compared, and the further training of the trained prediction model is guided.
8. A photovoltaic power prediction system, characterized in that: include: A data preprocessing module is used to preprocess the acquired historical photovoltaic power data to obtain preprocessed historical data; A model building module, used to build a prediction model based on spectral normalization generative adversarial network; A model training module, used to train the prediction model using the preprocessed historical data as input to obtain a trained prediction model; The correction and optimization module is used to perform photovoltaic power prediction based on the trained prediction model to obtain a prediction result, and to correct and optimize the prediction result in combination with external environmental factors to obtain a final photovoltaic power prediction value.
9. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, for storing computer programs; The processor is used to implement the photovoltaic power prediction method described in any one of claims 1 to 7 when executing the program stored in the memory.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the photovoltaic power prediction method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Photovoltaic power generation power prediction method
CN108694484A
Generative adversarial network-based photovoltaic cell defect detection data set augmentation method
CN116385368A
Photovoltaic output prediction method and system based on multi-factor correction
CN117713055A
Cited By
Method, device and equipment for generating abnormal test data of photovoltaic monitoring system and medium
CN120952056A