A method, apparatus, equipment, and dielectric for predicting regional photovoltaic power generation.
Patent Information
- Application Number
- CN202311724711.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-14
- Publication Date
- 2026-09-01
- Estimated Expiration
- 2043-12-14
AI Technical Summary
对于分布式光伏电站而言,传统的集中式预测方法无法满足实时性和准确性的要求
[0072] This application provides a method for predicting regional photovoltaic (PV) power generation. First, semantic segmentation is performed based on regional satellite cloud images and a semantic segmentation model to obtain cloud cluster regions. Then, an attenuation correction coefficient is obtained based on these cloud cluster regions. Next, PV power data and meteorological data from PV power plants within the region are collected and input into a prediction model to obtain an initial prediction result. This prediction model is a convolutional-long short-term memory (LSTM) network model trained using a federated learning architecture. Finally, the attenuation correction coefficient is used to correct the initial prediction result, yielding the predicted power data for the PV power plants. In this process, a prediction model based on a federated learning architecture is established to train and update the models for each PV power plant within the region, thereby improving the accuracy of the initial prediction result in a distributed environment. Furthermore, using the attenuation correction coefficient to correct the initial prediction result further improves the prediction accuracy, thus enhancing the accuracy of predicting PV power generation in a distributed environment and achieving ultra-short-term accurate prediction of regional PV power.
Smart Images

Figure CN117709482B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of photovoltaic power generation prediction, and in particular to a method, apparatus, equipment and medium for predicting regional photovoltaic power generation. Background Technology
[0002] To gradually achieve carbon neutrality, zero-carbon and low-carbon technologies have received widespread attention, making renewable energy power generation a new research hotspot. Solar energy, as a clean and large-scale renewable energy source, plays a crucial role in addressing environmental issues and contributing to carbon neutrality. However, due to natural factors such as weather, large-scale photovoltaic (PV) output is limited by external factors like cloud cover, making stable power output difficult. Grid connection can cause fluctuations in voltage, current, and frequency, affecting grid efficiency. Furthermore, with the development of distributed generation systems, the scale of PV power plants is gradually increasing, as is the number of individual plants. Traditional centralized forecasting methods cannot meet the requirements of real-time performance and accuracy for distributed PV power plants. In addition, different PV power plants within the same area may belong to different companies; due to privacy protection, data security, or legal restrictions, this data forms "data silos," making it impossible to merge and centrally train unified data. Therefore, how to accurately and in real-time predict the power output of PV power plants in a distributed environment has become an urgent problem to be solved. Summary of the Invention
[0003] This application provides a method, apparatus, equipment, and medium for predicting regional photovoltaic power generation. It obtains attenuation correction coefficients based on regional satellite cloud images and constructs a prediction model trained based on a federated learning architecture. The attenuation correction coefficients are used to modify the initial prediction results output by the prediction model to obtain more accurate prediction results, thereby improving the accuracy of predicting photovoltaic power plant power in a distributed environment.
[0004] In a first aspect, this application provides a method for predicting regional photovoltaic power generation, the method comprising:
[0005] Semantic segmentation is performed based on regional satellite cloud images and a semantic segmentation model to obtain cloud cluster regions.
[0006] Based on the cloud region, an attenuation correction coefficient is obtained, which is used to indicate the attenuation effect of the cloud region on the irradiance intensity around the regional photovoltaic power station.
[0007] Photovoltaic power data and meteorological data of photovoltaic power plants in the region are collected. The photovoltaic power data and meteorological data are data from the same time interval as the regional satellite cloud image.
[0008] Photovoltaic power data and meteorological data are input into the prediction model to obtain initial prediction results. The initial prediction results are the initial predicted power data of the photovoltaic power station. The prediction model is a convolutional-long short-term memory network model trained based on a federated learning architecture. The training samples of the prediction model include multiple historical photovoltaic power data and corresponding historical meteorological data.
[0009] The initial prediction results are corrected using an attenuation correction coefficient to obtain the prediction results, which are the predicted power data of the photovoltaic power station.
[0010] Optionally, before performing semantic segmentation processing based on regional satellite cloud images and the semantic segmentation model, the following steps are also included:
[0011] Obtain the raw satellite cloud image;
[0012] Virtual positioning is added to the original satellite cloud image based on the latitude and longitude coordinates of the photovoltaic power station, and the original satellite cloud image is cropped based on the virtual positioning to obtain a regional satellite cloud image.
[0013] Optionally, based on the cloud region, an attenuation correction factor is obtained, including:
[0014] Extract the average grayscale value of the cloud region, which is used to indicate the thickness of the cloud;
[0015] Substitute the average gray value of the cloud region into the attenuation correction coefficient formula to obtain the attenuation correction coefficient, which is as follows:
[0016]
[0017] Where η represents the percentage reduction in irradiance around the photovoltaic power station caused by the shading cloud; g i g represents the average grayscale value of the cloud region. max This represents the maximum grayscale value.
[0018] Optionally, the training process of the prediction model includes:
[0019] A federated learning framework is constructed, which includes a central server and multiple photovoltaic power stations within a region;
[0020] The central server constructs an initial model based on the photovoltaic dataset and sends the initial model to multiple photovoltaic power plants. The photovoltaic dataset is obtained by the central server from the Internet.
[0021] Multiple photovoltaic power plants acquire historical photovoltaic power data and historical meteorological data over a period of time, and preprocess the historical photovoltaic power data and historical meteorological data to obtain a sample dataset;
[0022] Multiple photovoltaic power plants standardized the sample dataset to obtain training and test sets;
[0023] Multiple photovoltaic power plants train and test the initial model based on the training set and test set to obtain initial feature parameters, and then send the initial feature parameters to the central server.
[0024] The central server uses a federated averaging algorithm to aggregate the initial feature parameters sent by multiple photovoltaic power plants, obtain aggregated feature parameters, and then transmits the aggregated feature parameters to the multiple photovoltaic power plants respectively.
[0025] Multiple photovoltaic power plants update the initial model based on aggregated feature parameters, and then train and test the updated model again based on the training set and test set to obtain the updated aggregated feature parameters, and determine whether the loss value in the updated model meets the expected value.
[0026] If the loss value does not meet the expected value, multiple photovoltaic power plants will send the updated aggregated feature parameters to the central server to perform aggregated transmission operations until the loss value in the updated model meets the expected value.
[0027] If the loss value matches the expected value, the updated model will be used as the prediction model.
[0028] Optionally, historical photovoltaic power data and historical meteorological data are preprocessed to obtain a sample dataset, including:
[0029] Historical photovoltaic power data and historical meteorological data are combined to obtain a master data table;
[0030] Remove data from the master data table where the historical photovoltaic power data is 0;
[0031] The standard deviation triple method is used to identify outliers in the data summary table, and the mean is used to replace the outliers to obtain a sample dataset.
[0032] Optionally, the method further includes:
[0033] The Paillier homomorphic encryption algorithm is used to encrypt the data transmitted between the central server and multiple photovoltaic power plants.
[0034] Optionally, the method further includes:
[0035] By using socket communication to bind a specified port number, the number and IP address of photovoltaic power plants in the area for photovoltaic power prediction can be determined, so as to realize online real-time communication between the central server and multiple photovoltaic power plants.
[0036] Secondly, this application provides a regional photovoltaic power generation prediction device, the device comprising:
[0037] The semantic segmentation unit is used to perform semantic segmentation processing based on regional satellite cloud images and semantic segmentation models to obtain cloud cluster regions.
[0038] A unit for obtaining attenuation correction coefficient is used to obtain an attenuation correction coefficient based on the cloud region, wherein the attenuation correction coefficient is used to indicate the attenuation effect of the cloud region on the irradiance intensity around the photovoltaic power station.
[0039] The data acquisition unit is used to collect photovoltaic power data and meteorological data of photovoltaic power plants in the area. The photovoltaic power data and meteorological data are data from the same time interval as the regional satellite cloud image.
[0040] The processing unit is used to input photovoltaic power data and meteorological data into the prediction model to obtain initial prediction results. The initial prediction results are the initial predicted power data of the photovoltaic power station. The prediction model is a convolutional-long short-term memory network model trained based on a federated learning architecture. The training samples of the prediction model include multiple historical photovoltaic power data and corresponding historical meteorological data.
[0041] The correction unit is used to correct the initial prediction result using the attenuation correction coefficient to obtain the prediction result, which is the predicted power data of the photovoltaic power station.
[0042] Optionally, the prediction device further includes:
[0043] The acquisition unit is used to acquire the original satellite cloud image; it is used to add virtual positioning to the original satellite cloud image based on the latitude and longitude coordinates of the photovoltaic power station, and to crop the original satellite cloud image based on the virtual positioning to obtain the regional satellite cloud image.
[0044] Optionally, the unit for obtaining the attenuation correction coefficient is specifically used for:
[0045] Extract the average grayscale value of the cloud region, which is used to indicate the thickness of the cloud;
[0046] Substitute the average gray value of the cloud region into the attenuation correction coefficient formula to obtain the attenuation correction coefficient, which is as follows:
[0047]
[0048] Where η represents the percentage reduction in irradiance around the photovoltaic power station caused by the shading cloud; g i g represents the average grayscale value of the cloud region. max This represents the maximum grayscale value.
[0049] Optionally, the prediction device further includes: a training unit for:
[0050] A federated learning framework is constructed, which includes a central server and multiple photovoltaic power stations within a region;
[0051] The central server constructs an initial model based on the photovoltaic dataset and sends the initial model to multiple photovoltaic power plants. The photovoltaic dataset is obtained by the central server from the Internet.
[0052] Multiple photovoltaic power plants acquire historical photovoltaic power data and historical meteorological data over a period of time, and preprocess the historical photovoltaic power data and historical meteorological data to obtain a sample dataset;
[0053] Multiple photovoltaic power plants standardized the sample dataset to obtain training and test sets;
[0054] Multiple photovoltaic power plants train and test the initial model based on the training set and test set to obtain initial feature parameters, and then send the initial feature parameters to the central server.
[0055] The central server uses a federated averaging algorithm to aggregate the initial feature parameters sent by multiple photovoltaic power plants, obtain aggregated feature parameters, and then transmits the aggregated feature parameters to the multiple photovoltaic power plants respectively.
[0056] Multiple photovoltaic power plants update the initial model based on aggregated feature parameters, and then train and test the updated model again based on the training set and test set to obtain the updated aggregated feature parameters, and determine whether the loss value in the updated model meets the expected value.
[0057] If the loss value does not meet the expected value, multiple photovoltaic power plants will send the updated aggregated feature parameters to the central server to perform aggregated transmission operations until the loss value in the updated model meets the expected value.
[0058] If the loss value matches the expected value, the updated model will be used as the prediction model.
[0059] Optionally, the training unit preprocesses historical photovoltaic power data and historical meteorological data to obtain the sample dataset, specifically for:
[0060] Historical photovoltaic power data and historical meteorological data are combined to obtain a master data table;
[0061] Remove data from the master data table where the historical photovoltaic power data is 0;
[0062] The standard deviation triple method is used to identify outliers in the data summary table, and the mean is used to replace the outliers to obtain a sample dataset.
[0063] Optionally, the prediction device further includes:
[0064] The encryption unit is used to encrypt the data transmitted between the central server and multiple photovoltaic power stations using the Paillier homomorphic encryption algorithm;
[0065] Optionally, the prediction device further includes:
[0066] The communication unit is used to determine the number and IP address of photovoltaic power stations in the area that perform photovoltaic power prediction by binding a specified port number through socket communication, so as to realize online real-time communication between the central server and multiple photovoltaic power stations.
[0067] Thirdly, this application provides an electronic device, the device including a memory and a processor:
[0068] Memory is used to store computer programs;
[0069] The processor is used to execute the method provided in the first aspect above according to the computer program.
[0070] Fourthly, this application provides a computer-readable storage medium for storing a computer program for performing the method provided in the first aspect above.
[0071] Therefore, this application has the following beneficial effects:
[0072] This application provides a method for predicting regional photovoltaic (PV) power generation. First, semantic segmentation is performed based on regional satellite cloud images and a semantic segmentation model to obtain cloud cluster regions. Then, an attenuation correction coefficient is obtained based on these cloud cluster regions. Next, PV power data and meteorological data from PV power plants within the region are collected and input into a prediction model to obtain an initial prediction result. This prediction model is a convolutional-long short-term memory (LSTM) network model trained using a federated learning architecture. Finally, the attenuation correction coefficient is used to correct the initial prediction result, yielding the predicted power data for the PV power plants. In this process, a prediction model based on a federated learning architecture is established to train and update the models for each PV power plant within the region, thereby improving the accuracy of the initial prediction result in a distributed environment. Furthermore, using the attenuation correction coefficient to correct the initial prediction result further improves the prediction accuracy, thus enhancing the accuracy of predicting PV power generation in a distributed environment and achieving ultra-short-term accurate prediction of regional PV power. Attached Figure Description
[0073] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments recorded in this application. For those skilled in the art, other drawings can be obtained based on these drawings.
[0074] Figure 1 This is a schematic diagram of the structure of a convolutional-long short-term memory network model in a method for predicting regional photovoltaic power generation in an embodiment of this application.
[0075] Figure 2 This is a flowchart illustrating a method for predicting regional photovoltaic power generation in an embodiment of this application.
[0076] Figure 3 This is a flowchart illustrating one embodiment of a method for predicting regional photovoltaic power generation in this application.
[0077] Figure 4 This is a schematic diagram of the structure of a regional photovoltaic power generation prediction device according to an embodiment of this application;
[0078] Figure 5 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application. Detailed Implementation
[0079] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0080] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data shall comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0081] First, the technical terms used in the embodiments of this application are explained as follows:
[0082] (1) Semantic segmentation model based on DeepLabv3+: DeepLabv3+ is a high-performance image segmentation model that improves the accuracy and efficiency of image segmentation by introducing Feature Pyramid Network (FPN) and dilated convolution.
[0083] (2) MobileNetV2 Convolutional Neural Network: Employs depthwise separable convolution. This convolutional operation splits each convolutional kernel into two parts: spatial convolution and channel-wise pointwise convolution. First, a small filter is used to extract local features for each input channel, and then 1x1 pointwise convolutions are used to combine the features from different channels, significantly reducing computational cost. Furthermore, the MobileNetV2 convolutional neural network adds a linear layer before the nonlinear activation function (e.g., ReLU) and another linear layer after the activation function. This allows the nonlinear transformation to be performed in two smaller steps, making the network easier to optimize.
[0084] (2) Convolutional Long Short-Term Memory Network (CNN-LSTM) model: such as Figure 1 As shown, the entire neural network model mainly consists of CNN units and LSTM units. The CNN unit includes convolutional layers, pooling layers, fully connected layers, and an output layer connected in sequence: convolutional layers extract local features from the data; pooling layers selectively output local features; fully connected layers extract the local features output by the pooling layers and obtain global features; the output layer outputs the global features. The LSTM unit includes an input layer, a forgetting layer, three LSTM layers, and a fully connected layer. The input layer feeds the data from the training set into the neural network; the forgetting layer forgets some training information to avoid overfitting; the LSTM layers train the input data to obtain intermediate results and corresponding parameters; and the fully connected layer connects the intermediate results to obtain the final prediction result, used to calculate the loss.
[0085] (3) Paillier homomorphic encryption algorithm: A special encryption method that allows direct computation, such as addition and multiplication, to be performed on encrypted data without revealing any information about the original text. The result of the computation is still encrypted. A user with the key decrypts the processed ciphertext data to obtain the processed original text. The Paillier algorithm is a semi-homomorphic encryption scheme. The algorithm consists of four parts: key generation, encryption, computation algorithm, and decryption. The computation algorithm includes homomorphic addition and homomorphic scalar multiplication algorithms.
[0086] (4) Socket communication: A socket is an abstraction layer between the application layer and the transport layer. It abstracts the complex operations of the TCP / IP layer into a few simple interfaces, which are called by the application layer to realize communication between processes in the network. Socket communication can realize online real-time communication between the client and the server. By binding a specified port number, the number and IP address of local photovoltaic power stations in the area for photovoltaic forecasting can be determined.
[0087] Because there is a high correlation between changes in cloud cover and solar radiation intensity, photovoltaic (PV) power generation is easily affected by fluctuations in cloud cover, leading to random fluctuations in PV output power in the short term. Satellite cloud images can acquire large-scale cloud cover, water vapor, and visible light data, enabling continuous monitoring of key factors affecting PV power generation and effectively reducing the impact of cloud cover changes on regional PV ultra-short-term power forecasting.
[0088] Therefore, a cloud shading model can be used to analyze satellite cloud images to obtain attenuation correction coefficients representing the effect of cloud clusters on the irradiance intensity around photovoltaic power plants. The cloud shading model includes a cropping step for obtaining regional satellite cloud images and a semantic segmentation algorithm model, which can distinguish regional satellite cloud images into cloud clusters and background to determine the shading effect of cloud clusters on photovoltaic power plants in the region; it also includes a step of calculating attenuation correction coefficients, which can be used to correct the initial prediction results.
[0089] Currently, photovoltaic power generation prediction methods mainly include those based on statistical models and machine learning. Statistical models typically require large amounts of historical data for modeling and parameter estimation, and are often limited by assumptions, failing to accurately describe complex nonlinear relationships. In recent years, the development of machine learning and deep learning technologies has provided new ideas and methods for solving this problem. Neural networks, as a powerful nonlinear model, possess self-learning capabilities and strong adaptability, and have already achieved significant success in fields such as image recognition and speech recognition, and are also attracting considerable attention in the field of photovoltaic prediction.
[0090] With the development of distributed generation systems, the scale of photovoltaic power plants is gradually increasing, and the number of individual power plants is also increasing accordingly. For distributed photovoltaic power plants, traditional centralized forecasting methods cannot meet the requirements of real-time performance and accuracy. Furthermore, different photovoltaic power plants within the same region may belong to different companies, and due to privacy protection, data security, or legal restrictions, these data form isolated "data silos," making it impossible to merge and centrally train them. Therefore, a method is needed that can efficiently, securely, and accurately perform ultra-short-term forecasting of regional photovoltaic power generation in a distributed environment.
[0091] In this embodiment, a cloud occlusion model is used to analyze satellite cloud images to obtain attenuation correction coefficients. An initial prediction result is obtained through a prediction model trained on a federated learning architecture. Finally, the attenuation correction coefficients are used to correct the initial prediction result to obtain the final prediction result. This improves the accuracy of predicting photovoltaic power plant power in a distributed environment. Specifically, the method may include: first, performing semantic segmentation based on regional satellite cloud images and a semantic segmentation model to obtain cloud cluster regions; obtaining attenuation correction coefficients based on the cloud cluster regions, whereby the attenuation coefficients indicate the effect of cloud cluster regions on the attenuation of irradiance around the regional photovoltaic power plant; then collecting photovoltaic power data and meteorological data from the photovoltaic power plant within the region, and inputting these data into the prediction model to obtain an initial prediction result, which is the initial predicted power data for the photovoltaic power plant. The prediction model is a convolutional-long short-term memory network model trained on a federated learning architecture, and the training samples of the prediction model include multiple historical photovoltaic power data and corresponding historical meteorological data; finally, the attenuation correction coefficients are used to correct the initial prediction result to obtain the final prediction result, which is the predicted power data for the photovoltaic power plant.
[0092] As can be seen, the method provided in this application establishes a prediction model based on a federated learning architecture, enabling the training and updating of models for each photovoltaic power station in the region, thereby improving the accuracy of the initial prediction results in a distributed environment. Furthermore, by using an attenuation correction coefficient to correct the initial prediction results and obtain the final prediction results, the accuracy of prediction can be further improved, thereby enhancing the accuracy of predicting the power of photovoltaic power stations in a distributed environment.
[0093] To facilitate understanding of the specific implementation of the method for predicting regional photovoltaic power generation provided in the embodiments of this application, the following description will be provided in conjunction with the accompanying drawings.
[0094] It should be noted that the main body implementing the method for predicting the photovoltaic power generation in this region can be a regional photovoltaic power generation prediction device provided in the embodiments of this application. This regional photovoltaic power generation prediction device can be carried in an electronic device or a functional module of an electronic device. The electronic device in the embodiments of this application can be any device capable of implementing a regional photovoltaic power generation prediction method in the embodiments of this application, such as an Internet of Things (IoT) device.
[0095] Figure 2 This is a flowchart illustrating a method for predicting regional photovoltaic power generation, provided in an embodiment of this application. This method can be applied to a regional photovoltaic power generation prediction device, which may be, for example, a device such as... Figure 4The illustrated device is a regional photovoltaic power generation prediction device 400; alternatively, the regional photovoltaic power generation prediction device may also be integrated into... Figure 5 Functional modules in the electronic device 500 shown.
[0096] like Figure 2 As shown, the method includes the following steps S201 to S204:
[0097] S201: Perform semantic segmentation processing based on regional satellite cloud images and semantic segmentation models to obtain cloud cluster regions.
[0098] To obtain highly accurate prediction results, the regional satellite cloud image first needs to be semantically segmented to obtain the cloud cluster region. Then, based on the cloud cluster region, an attenuation correction coefficient is obtained. This attenuation correction coefficient indicates the attenuation effect of the cloud cluster region on the irradiance around the regional photovoltaic power station. Next, photovoltaic power data and meteorological data from the photovoltaic power station in the region are collected and input into the prediction model to obtain an initial prediction result. Finally, the attenuation correction coefficient is used to correct the initial prediction result to obtain the predicted power data of the photovoltaic power station. Therefore, in this embodiment, semantic segmentation based on the regional satellite cloud image and the semantic segmentation model is performed in step S201 to obtain the cloud cluster region, providing a prerequisite for subsequently obtaining the attenuation correction coefficient.
[0099] As an example, executing S201 may also include: first, acquiring the raw satellite cloud image, the raw satellite cloud... Figure 1 Generally, satellite cloud images containing photovoltaic power station areas are downloaded from the Internet. Since the original satellite cloud images also include land parcels outside the photovoltaic power station areas, in order to improve the accuracy of obtaining the attenuation correction coefficient, it is necessary to obtain regional satellite cloud images of the photovoltaic power station areas. Then, virtual positioning is added to the original satellite cloud images based on the latitude and longitude coordinates of the photovoltaic power station, and the original satellite cloud images are cropped based on the virtual positioning to obtain the regional satellite cloud images.
[0100] As an example, S201 may include: performing semantic segmentation processing based on regional satellite cloud images and a semantic segmentation model to obtain cloud cluster regions. The semantic segmentation model is a DeepLabv3+ deep learning-based semantic segmentation model, and the backbone feature extraction network of the semantic segmentation model uses a MobileNetV2 convolutional neural network. Specifically, the semantic segmentation model is a DeepLabv3+ deep learning-based semantic segmentation model, which is a high-performance image segmentation model that can improve the accuracy and efficiency of image segmentation. Furthermore, the use of a MobileNetV2 convolutional neural network for the backbone feature extraction network of this semantic segmentation model makes the network easier to optimize.
[0101] In this process, semantic segmentation technology is used to classify regional satellite cloud images at the pixel level, thereby distinguishing cloud areas from background areas, so that cloud areas can be used to calculate attenuation correction coefficients later.
[0102] S202: Based on the cloud region, obtain the attenuation correction coefficient, which is used to indicate the attenuation effect of the cloud region on the irradiance around the regional photovoltaic power station.
[0103] As an example, S202 may include: extracting the average grayscale value of the cloud region, the average grayscale value being used to indicate the thickness of the cloud; substituting the average grayscale value of the cloud region into the attenuation correction coefficient formula to obtain the attenuation correction coefficient, wherein the attenuation correction coefficient formula is as shown in formula (1):
[0104]
[0105] Where η represents the percentage reduction in irradiance around the photovoltaic power station caused by the shading cloud; g i g represents the average grayscale value of the cloud region. max This represents the maximum grayscale value, typically 255.
[0106] S203: Collect photovoltaic power data and meteorological data of photovoltaic power plants in the area. The photovoltaic power data and meteorological data are data from the same time interval as the satellite cloud image of the area.
[0107] To improve the accuracy of the final prediction results, the initial prediction results can be corrected using an attenuation correction coefficient. Therefore, the time period for obtaining the regional satellite cloud image corresponding to the attenuation correction coefficient must be consistent with the time interval for collecting photovoltaic power data and meteorological data of photovoltaic power plants in the region. The meteorological data includes temperature, humidity, irradiance and air pressure.
[0108] S204: Input photovoltaic power data and meteorological data into the prediction model to obtain initial prediction results. The initial prediction results are the initial predicted power data of the photovoltaic power station. The prediction model is a convolutional-long short-term memory network model trained based on a federated learning architecture.
[0109] As an example, S204 may include: inputting photovoltaic power data and meteorological data into the prediction model to obtain initial prediction results, namely, the initial predicted power data of the photovoltaic power plant.
[0110] It should be noted that the prediction model is a convolutional-long short-term memory network model trained based on a federated learning architecture. The following details the process of training the prediction model:
[0111] (1) Construct a federated learning framework, which includes a central server and multiple photovoltaic power stations within the region;
[0112] (2) The central server constructs an initial model based on the photovoltaic dataset and sends the initial model to multiple photovoltaic power plants. The photovoltaic dataset is an existing dataset obtained by the central server from the internet, and the initial model is a CNN-LSTM model.
[0113] (3) Historical photovoltaic power data and historical meteorological data for a period of time are acquired from multiple photovoltaic power plants, and the historical photovoltaic power data and historical meteorological data are preprocessed to obtain a sample dataset. The preprocessing process includes: splicing the historical photovoltaic power data and historical meteorological data to obtain a data summary table; removing data with a historical photovoltaic power of 0 from the data summary table, then using the standard deviation three times method to identify outliers, and using the mean to replace the outliers in the data summary table to obtain a sample dataset;
[0114] (4) Multiple photovoltaic power plants standardize the sample dataset to obtain training and test sets;
[0115] (5) Multiple photovoltaic power stations train and test the initial model based on the training set and test set to obtain the initial feature parameters, and send the initial feature parameters to the central server.
[0116] (6) The central server uses the federated averaging algorithm to aggregate the initial feature parameters sent by multiple photovoltaic power stations, obtain aggregated feature parameters, and transmit the aggregated feature parameters to multiple photovoltaic power stations respectively.
[0117] (7) Multiple photovoltaic power stations update the initial model based on aggregated feature parameters, and then train and test the updated model again based on the training set and test set to obtain the updated aggregated feature parameters and determine whether the loss value in the initial model meets the expected value.
[0118] (8) If the loss value does not meet the expected value, multiple photovoltaic power plants will send the updated aggregated feature parameters to the central server to perform aggregated transmission operation until the loss value in the initial model meets the expected value.
[0119] (9) If the loss value meets the expected value, the updated model will be used as the prediction model.
[0120] It should be noted that the Paillier homomorphic encryption algorithm is used to encrypt the data transmitted between the central server and multiple photovoltaic power stations during this process. Furthermore, socket communication is used to bind specified port numbers to determine the number and IP addresses of photovoltaic power stations within the region performing photovoltaic power prediction, thereby enabling online real-time communication between the central server and multiple photovoltaic power stations.
[0121] In this process, a prediction model is established based on a federated learning architecture to train and update the model of each photovoltaic power station in the region, thereby improving the accuracy of the initial prediction results in a distributed environment. Furthermore, the Paillier synchronization encryption algorithm is used during the data transmission process between the central server and multiple photovoltaic power stations to enhance the confidentiality of data privacy.
[0122] S205: The initial prediction result is corrected using the attenuation correction coefficient to obtain the prediction result, which is the predicted power data of the photovoltaic power station.
[0123] As an example, S205 may include: correcting the initial prediction result using the attenuation correction coefficient, and combining it with the photovoltaic power data collected above to obtain the prediction result. Specifically, the process of obtaining the prediction result involves substituting the attenuation correction coefficient, the initial prediction result, and the collected photovoltaic power data into formula (2), as shown in formula (2) below:
[0124] P=α×η×P t +γ×P r Formula (2)
[0125] Where P represents the final prediction result, P t P represents the initial prediction result. r The value represents the power at the previous moment, η represents the attenuation correction factor, and α and γ represent the power prediction correction factors. The power prediction correction factors are empirical parameters obtained by adjusting the above prediction model based on the actual prediction results.
[0126] As can be seen, the embodiments of this application establish a prediction model based on a federated learning architecture, thereby training and updating the models of various photovoltaic power stations in the region, thus improving the accuracy of the initial prediction results in a distributed environment. Furthermore, by using the attenuation correction coefficient to correct the initial prediction results, the prediction accuracy can be further improved, thereby enhancing the accuracy of predicting the power of photovoltaic power stations in a distributed environment and achieving ultra-short-term accurate prediction of regional photovoltaic power.
[0127] To make the methods provided in the embodiments of this application clearer and easier to understand, the following is combined with... Figure 3 A specific example of the process of obtaining the prediction model in this method will be used to illustrate the method.
[0128] S301: Construct a federated learning framework, which includes a central server and multiple photovoltaic power stations within the region.
[0129] To enable ultra-short-term prediction of regional photovoltaic power generation in a distributed environment, a federated learning framework can be constructed. This framework utilizes a central server to aggregate federated averaging algorithms and iteratively update the models of multiple photovoltaic power stations within the region, thereby obtaining a prediction model.
[0130] S302: The central server constructs an initial model based on the photovoltaic dataset, and encrypts the initial model using a homomorphic encryption algorithm before sending it to multiple photovoltaic power stations. The photovoltaic dataset is obtained by the central server from the Internet.
[0131] The central server will first obtain existing publicly available photovoltaic datasets via the Internet, then build an initial model based on the photovoltaic datasets, and send the initial model to multiple photovoltaic power plants so that multiple photovoltaic power plants can train and test the initial model based on their local sample datasets. The initial model can be a CNN-LSTM model.
[0132] As an example, the steps for the central server to encrypt the initial model using a homomorphic encryption algorithm may include: determining the first scaling factor and performing scaling based on the exponent information and positive / negative information of the initial model; determining the second scaling factor and performing scaling and rounding based on the key length information corresponding to the preset homomorphic encryption algorithm and the precision requirement information of the initial model; determining the third scaling factor and performing scaling based on the preset carry position information; and finally, packaging and concatenating the multiple third-scaled data according to the key length information.
[0133] It should be noted that the central server stores information related to the generated key and can obtain key length information. The central server and the multiple photovoltaic power stations participating in the training unify the accuracy requirements, exponent information, positive and negative sign information and key of the data, and store them in their respective databases.
[0134] S303: Multiple photovoltaic power plants acquire historical photovoltaic power data and historical meteorological data over a period of time, and preprocess the historical photovoltaic power data and historical meteorological data to obtain a sample dataset.
[0135] As an example, S303 may include: S3031, multiple photovoltaic power plants acquire historical photovoltaic power data and historical meteorological data over a period of time; S3032, multiple photovoltaic power plants splice the historical photovoltaic power data and historical meteorological data to obtain a data summary table; S3033, multiple photovoltaic power plants remove data with historical photovoltaic power data of 0 from the data summary table, then use the standard deviation three times method to judge abnormal data, and use the mean to replace the abnormal data in the data summary table to obtain a sample dataset, wherein the operation of replacing abnormal data is performed using the following formula (3):
[0136]
[0137] in, Indicates data replacement, x i Representing data, β iThis represents a Boolean type number, where n represents the total number of data points. When x i When representing missing or outlier data, β i =0, β does not indicate missing or outlier data. i =1.
[0138] S304: Multiple photovoltaic power plants standardize the sample dataset to obtain training and test sets.
[0139] As an example, S304 may include: the method for standardizing the sample dataset from multiple photovoltaic power plants may be the maximum-minimum normalization method, as shown in the following formula (4):
[0140]
[0141] in, y represents the data obtained after normalization. i y represents the data before normalization. max and y min This represents the maximum and minimum values among all the data.
[0142] S305: Multiple photovoltaic power plants decrypt the encrypted initial model, train and test the initial model based on the training set and test set, and obtain the initial feature parameters.
[0143] Multiple photovoltaic power plants need to first decrypt the encrypted initial model. The specific steps may include: decrypting the packaged parameter information and the initial model obtained by homomorphic encryption algorithm to obtain carry information; according to the obtained carry information, key length information and accuracy requirements of training set and test set, splitting the packaged information into initial split parameter information; and restoring the initial model obtained from the initial split according to the exponent information and positive and negative sign information to obtain the final unpacked and restored initial model.
[0144] After obtaining training and testing sets, multiple photovoltaic power plants can train and test the CNN-LSTM model to obtain initial feature parameters.
[0145] S306: Multiple photovoltaic power plants use homomorphic encryption algorithms to encrypt the initial feature parameters and send the encrypted initial feature parameters to the central server.
[0146] S307: The central server decrypts the encrypted initial feature parameters and uses a federated averaging algorithm to aggregate the initial feature parameters sent by multiple photovoltaic power stations to obtain aggregated feature parameters.
[0147] The central server first needs to decrypt the encrypted initial feature parameters. After obtaining the initial feature parameters, it aggregates the initial feature parameters online using a federated averaging algorithm based on socket communication to obtain aggregated feature parameters. The federated averaging algorithm integrates the neural network learning models of multiple clients into a global model. The goal of federated learning is to minimize empirical risk, as shown in formula (5) below:
[0148]
[0149] Where F(x) represents the expected global average loss obtained by federated learning, n represents the sample size, and s i Let f(x; s) represent the i-th sample individual. i ) indicates that the model is in s i The loss function on the model. Assume there are K local models, P k Let n represent the set of indexes of the sample individuals owned by the k-th model. k =|P k |, then the target can be rewritten as:
[0150]
[0151]
[0152] Since the model data in each photovoltaic power station cannot represent the global data, The model is not necessarily the same as F(x), meaning that any local model cannot be used as the global model. This represents the average loss allocated to the central server by the expected value of the k-th model obtained through iteration. One parameter update of the local model constitutes one iteration. Therefore, the iteration formula for the k-th local model is shown in formula (8) below:
[0153]
[0154] Where b represents a batch; f(x; s i ) indicates that the model is in s i The loss function is δ, which indicates that the updated model is obtained by subtracting the iteration loss from the model of the previous iteration.
[0155] The federated averaging algorithm divides the training process into multiple epochs, in which CK (0 < K < 1) local models are selected to learn from the data in each epoch. If the number of epochs for the k-th local model in a epoch is E, and the batch size is B, then the number of iterations is E. nk / B. After one round, the parameters of all the local models involved in the learning are weighted and averaged to obtain the global model.
[0156] S308: The central server uses a homomorphic encryption algorithm to encrypt the aggregated feature parameters and then transmits the encrypted aggregated feature parameters to multiple photovoltaic power stations.
[0157] S309: Multiple photovoltaic power plants decrypt the encrypted aggregated feature parameters and update the initial model based on the aggregated feature parameters to obtain the updated model.
[0158] As an example, S309 may include: after multiple photovoltaic power plants obtain aggregated feature parameters, the initial model is updated to optimize and update the global model, which satisfies the optimization and updating of the model in a distributed environment, thereby improving the accuracy of the prediction results.
[0159] S310: Multiple photovoltaic power plants train and test the updated model based on the training set and test set to obtain the updated aggregated feature parameters.
[0160] Since the initial model has been updated, it is necessary to train and test the updated model again using the training and test sets, and obtain the updated aggregated feature parameters.
[0161] S311: Multiple photovoltaic power plants determine whether the loss value in the updated model meets the expected value.
[0162] To determine whether the updated model can be used as a prediction model, it is necessary to check whether the loss value in the updated model meets the expected value. If the loss value does not meet the expected value, it means that the updated model cannot yet be used as a prediction model and needs to be iterated and updated, so S312 is executed; if the loss value meets the expected value, it means that the updated model can be used as a prediction model, so S313 is executed to complete the training operation of the prediction model.
[0163] S312: If the loss value does not meet the expected value, multiple photovoltaic power plants will send the updated aggregated feature parameters to the central server to perform aggregated transmission operations until the loss value in the updated model meets the expected value.
[0164] If the loss value does not meet the expected value, it means that the models in multiple photovoltaic power plants still need to be iterated and updated. Therefore, repeat the operations of S306 to S311 until the models in multiple photovoltaic power plants meet the requirements and can be used for prediction.
[0165] S313: If the loss value matches the expected value, the updated model will be used as the prediction model.
[0166] This embodiment provides a method for training a prediction model. After each photovoltaic power station trains its model locally, it protects the data privacy of its model parameters using the Paillier synchronization encryption algorithm and transmits the model parameters to a central server via socket communication within the region. The central server obtains the model parameters from multiple photovoltaic power stations within the region and performs model aggregation calculations to obtain updated model parameters. The central server then sends these updated model parameters to each photovoltaic power station in the same way, enabling each station to update its model using the new parameters and retrain. After multiple iterations, the final model parameters are obtained and used as the prediction model parameters to process tasks for a specific time period.
[0167] See Figure 4 This application provides a regional photovoltaic power generation prediction device 400, which includes:
[0168] Semantic segmentation unit 401 is used to perform semantic segmentation processing based on regional satellite cloud images and semantic segmentation models to obtain cloud cluster regions;
[0169] The attenuation correction coefficient unit 402 is used to obtain an attenuation correction coefficient based on the cloud region, wherein the attenuation correction coefficient is used to indicate the attenuation effect of the cloud region on the irradiance intensity around the photovoltaic power station.
[0170] The acquisition unit 403 is used to acquire photovoltaic power data and meteorological data of photovoltaic power stations in the area. The photovoltaic power data and meteorological data are data of the same time interval as the regional satellite cloud image.
[0171] The processing unit 404 is used to input photovoltaic power data and meteorological data into the prediction model to obtain initial prediction results. The initial prediction results are the initial predicted power data of the photovoltaic power station. The prediction model is a convolutional-long short-term memory network model trained based on a federated learning architecture. The training samples of the prediction model include multiple historical photovoltaic power data and corresponding historical meteorological data.
[0172] The correction unit 405 is used to correct the initial prediction result using the attenuation correction coefficient to obtain a prediction result, which is the predicted power data of the photovoltaic power station.
[0173] Optionally, the prediction device 400 further includes:
[0174] The acquisition unit is used to acquire the original satellite cloud image; it is used to add virtual positioning to the original satellite cloud image based on the latitude and longitude coordinates of the photovoltaic power station, and to crop the original satellite cloud image based on the virtual positioning to obtain the regional satellite cloud image.
[0175] Optionally, the attenuation correction coefficient unit 402 is specifically used for:
[0176] Extract the average grayscale value of the cloud region, which is used to indicate the thickness of the cloud;
[0177] Substitute the average gray value of the cloud region into the attenuation correction coefficient formula to obtain the attenuation correction coefficient, which is as follows:
[0178]
[0179] Where η represents the percentage reduction in irradiance around the photovoltaic power station caused by the shading cloud; g i g represents the average grayscale value of the cloud region. max This represents the maximum grayscale value.
[0180] Optionally, the prediction device 400 further includes: a training unit for:
[0181] A federated learning framework is constructed, which includes a central server and multiple photovoltaic power stations within a region;
[0182] The central server constructs an initial model based on the photovoltaic dataset and sends the initial model to multiple photovoltaic power plants. The photovoltaic dataset is obtained by the central server from the Internet.
[0183] Multiple photovoltaic power plants acquire historical photovoltaic power data and historical meteorological data over a period of time, and preprocess the historical photovoltaic power data and historical meteorological data to obtain a sample dataset;
[0184] Multiple photovoltaic power plants standardized the sample dataset to obtain training and test sets;
[0185] Multiple photovoltaic power plants train and test the initial model based on the training set and test set to obtain initial feature parameters, and then send the initial feature parameters to the central server.
[0186] The central server uses a federated averaging algorithm to aggregate the initial feature parameters sent by multiple photovoltaic power plants, obtain aggregated feature parameters, and then transmits the aggregated feature parameters to the multiple photovoltaic power plants respectively.
[0187] Multiple photovoltaic power plants update the initial model based on aggregated feature parameters, and then train and test the updated model again based on the training set and test set to obtain the updated aggregated feature parameters, and determine whether the loss value in the updated model meets the expected value.
[0188] If the loss value does not meet the expected value, multiple photovoltaic power plants will send the updated aggregated feature parameters to the central server to perform aggregated transmission operations until the loss value in the updated model meets the expected value.
[0189] If the loss value matches the expected value, the updated model will be used as the prediction model.
[0190] Optionally, the training unit preprocesses historical photovoltaic power data and historical meteorological data to obtain the sample dataset, specifically for:
[0191] Historical photovoltaic power data and historical meteorological data are combined to obtain a master data table;
[0192] Remove data from the master data table where the historical photovoltaic power data is 0;
[0193] The standard deviation triple method is used to identify outliers in the data summary table, and the mean is used to replace the outliers to obtain a sample dataset.
[0194] Optionally, the prediction device 400 further includes:
[0195] The encryption unit is used to encrypt the data transmitted between the central server and multiple photovoltaic power stations using the Paillier homomorphic encryption algorithm;
[0196] Optionally, the prediction device 400 further includes:
[0197] The communication unit is used to determine the number and IP address of photovoltaic power stations in the area that perform photovoltaic power prediction by binding a specified port number through socket communication, so as to realize online real-time communication between the central server and multiple photovoltaic power stations.
[0198] It should be noted that the specific implementation method and achieved effect of the photovoltaic power generation prediction device 400 in this area can be found in the above. Figure 2 or Figure 3 The relevant descriptions in the provided methods will not be repeated here.
[0199] This application also provides an electronic device 500, such as... Figure 5 As shown, the device 500 includes a memory 501 and a processor 502:
[0200] Memory 501 is used to store computer programs;
[0201] Processor 502 is used to execute the above according to the computer program. Figure 2 or Figure 3 The methods provided.
[0202] In addition, this application also provides a computer-readable storage medium for storing a computer program, the computer program being executed. Figure 2 or Figure 3 The methods provided.
[0203] As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that all or part of the steps in the methods of the above embodiments can be implemented by means of software plus a general-purpose hardware platform. Based on this understanding, the technical solution of this application can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as a read-only memory (ROM) / RAM, magnetic disk, optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, a server, or a network communication device such as a router) to execute the methods described in various embodiments or some parts of the embodiments of this application.
[0204] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on its differences from other embodiments. In particular, the device embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments. The device embodiments described above are merely illustrative. Modules described as separate components may or may not be physically separate, and components shown as modules may or may not be physical modules; they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the objectives of this embodiment according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0205] The above description is merely an exemplary implementation of this application and is not intended to limit the scope of protection of this application.
Claims
1. A method for predicting regional photovoltaic power generation, characterized in that, include: Semantic segmentation is performed based on regional satellite cloud images and a semantic segmentation model to obtain cloud cluster regions. Based on the cloud region, an attenuation correction coefficient is obtained, which is used to indicate the attenuation effect of the cloud region on the irradiance around the regional photovoltaic power station. Photovoltaic power data and meteorological data of photovoltaic power plants in the region are collected, and the photovoltaic power data and meteorological data are data of the same time interval as the satellite cloud image of the region; The photovoltaic power data and the meteorological data are input into the prediction model to obtain the initial prediction result. The initial prediction result is the initial predicted power data of the photovoltaic power station. The prediction model is a convolutional-long short-term memory network model trained based on a federated learning architecture. The training samples of the prediction model include multiple historical photovoltaic power data and corresponding historical meteorological data. The initial prediction result is corrected using the attenuation correction coefficient to obtain the prediction result, which is the predicted power data of the photovoltaic power station.
2. The method according to claim 1, characterized in that, Before performing semantic segmentation processing based on regional satellite cloud images and semantic segmentation models, the process also includes: Obtain the raw satellite cloud image; A virtual location is added to the original satellite cloud image based on the latitude and longitude coordinates of the photovoltaic power station, and the original satellite cloud image is cropped based on the virtual location to obtain the regional satellite cloud image.
3. The method according to claim 1, characterized in that, The step of obtaining the attenuation correction coefficient based on the cloud region includes: Extract the average grayscale value of the cloud region; the average grayscale value is used to indicate the thickness of the cloud. Substituting the average gray value of the cloud region into the attenuation correction coefficient formula, the attenuation correction coefficient is obtained. The attenuation correction coefficient formula is as follows: Where η represents the percentage reduction in irradiance around the photovoltaic power station caused by the shading cloud; g i g represents the average gray level of the cloud region. max This represents the maximum grayscale value.
4. The method according to claim 1, characterized in that, The training process of the prediction model includes: A federated learning framework is constructed, which includes a central server and multiple photovoltaic power stations within the region; The central server constructs an initial model based on the photovoltaic dataset and sends the initial model to the multiple photovoltaic power stations. The photovoltaic dataset is obtained by the central server from the Internet. The multiple photovoltaic power stations acquire historical photovoltaic power data and historical meteorological data over a period of time, and preprocess the historical photovoltaic power data and historical meteorological data to obtain a sample dataset; The multiple photovoltaic power plants standardized the sample dataset to obtain a training set and a test set. The multiple photovoltaic power stations train and test the initial model based on the training set and the test set to obtain initial feature parameters, and then send the initial feature parameters to the central server. The central server uses a federated averaging algorithm to aggregate the initial feature parameters sent by multiple photovoltaic power stations to obtain aggregated feature parameters, and then transmits the aggregated feature parameters to the multiple photovoltaic power stations respectively. The multiple photovoltaic power stations update the initial model based on the aggregated feature parameters, and then train and test the updated model again based on the training set and the test set to obtain the updated aggregated feature parameters, and determine whether the loss value in the updated model meets the expected value. If the loss value does not meet the expected value, the multiple photovoltaic power stations will send the updated aggregated feature parameters to the central server to perform aggregated transmission operation until the loss value in the updated model meets the expected value. If the loss value matches the expected value, then the updated model is used as the prediction model.
5. The method according to claim 4, characterized in that, The step of preprocessing the historical photovoltaic power data and the historical meteorological data to obtain a sample dataset includes: The historical photovoltaic power data and the historical meteorological data are combined to obtain a master data table; Remove data from the aforementioned data summary table where the historical photovoltaic power data is 0; The abnormal data in the data summary table are identified using the standard deviation triple method, and the abnormal data are replaced with the mean to obtain the sample dataset.
6. The method according to claim 4, characterized in that, The method further includes: The Paillier homomorphic encryption algorithm is used to encrypt the data transmitted between the central server and the multiple photovoltaic power stations.
7. The method according to claim 4, characterized in that, The method further includes: The number and IP address of photovoltaic power stations within a region for photovoltaic power prediction are determined by binding a specified port number using socket communication, so as to realize online real-time communication between the central server and the multiple photovoltaic power stations.
8. A device for predicting regional photovoltaic power generation, characterized in that, include: The semantic segmentation unit is used to perform semantic segmentation processing based on regional satellite cloud images and semantic segmentation models to obtain cloud cluster regions. A unit for obtaining attenuation correction coefficient is used to obtain an attenuation correction coefficient based on the cloud region, wherein the attenuation correction coefficient is used to indicate the attenuation effect of the cloud region on the irradiance intensity around the photovoltaic power station. The data acquisition unit is used to collect photovoltaic power data and meteorological data of photovoltaic power plants in the area. The photovoltaic power data and meteorological data are data from the same time interval as the satellite cloud image of the area. The processing unit is used to input the photovoltaic power data and the meteorological data into the prediction model to obtain the initial prediction result. The initial prediction result is the initial predicted power data of the photovoltaic power station. The prediction model is a convolutional-long short-term memory network model trained based on a federated learning architecture. The training samples of the prediction model include multiple historical photovoltaic power data and corresponding historical meteorological data. The correction unit is used to correct the initial prediction result using the attenuation correction coefficient to obtain a prediction result, which is the predicted power data of the photovoltaic power station.
9. An electronic device, characterized in that, The device includes a memory and a processor, the processor being configured to execute a program stored in the memory, performing the method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store a computer program for performing the method according to any one of claims 1-7.