Photovoltaic power prediction method and device, equipment and medium

By using feature extraction, encoder, decoder and output layer modules in the photovoltaic power prediction method, combined with the self-attention mechanism and feedforward neural network, the challenge of photovoltaic power fluctuations on the grid stability is solved, and high-precision photovoltaic power prediction is achieved.

CN120011777APending Publication Date: 2025-05-16HUBEI CENT CHINA TECH DEV OF ELECTRIC POWER
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411856595.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-17
Publication Date
2025-05-16

AI Technical Summary

Technical Problem

Photovoltaic power generation is intermittent and random, and the fluctuations in its power generation power pose a challenge to the stability and power quality of the power grid, resulting in the accurate prediction of photovoltaic power generation power becoming an important and urgent research topic.

Method used

A photovoltaic power prediction method is adopted, including feature extraction module, encoder module, decoder module and final output layer module. Through the self-attention mechanism, mask self-attention mechanism and feedforward neural network, time series feature information of photovoltaic data is extracted and predicted to generate accurate photovoltaic power prediction.

Benefits of technology

Accurate prediction of the power generation power of photovoltaic power stations is achieved, with small errors and simple operation, which significantly improves the accuracy and credibility of the prediction, helping to manage the stability of the power grid and the power quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure HDA0005191984490000011
    Figure HDA0005191984490000011
  • Figure HDA0005191984490000021
    Figure HDA0005191984490000021
Patent Text Reader

Abstract

The invention provides a photovoltaic power prediction method and device, equipment and a medium, and the method comprises the steps: a feature extraction module extracts photovoltaic data of different time sequences, carries out the preprocessing and feature extraction of the photovoltaic data, and obtains the preprocessed time sequence data; the encoder module receives the preprocessed time sequence data and obtains time sequence feature information of the photovoltaic data through extraction and encoding; the decoder maps the time sequence feature information back to an output space, generates a predicted value, and generates feature information through a self-attention mechanism, a mask self-attention mechanism and a feedforward neural network; and the final output layer converts the feature information into a feature value of the target sequence through an activation function, and finally outputs a predicted target feature value. According to the photovoltaic power prediction method, the problems that the utilization rate of renewable energy sources and the abnormal data processing capacity are insufficient, key features are difficult to extract and the like are solved by predicting the power generation power in a period of time in the future.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of photovoltaic power prediction, and in particular to a photovoltaic power prediction method, device, equipment and medium. Background Art

[0002] With the continuous increase in global energy demand and the enhancement of environmental awareness, the utilization value of solar energy as a clean and renewable energy source has become increasingly prominent. Photovoltaic power generation, as one of the main forms of solar energy utilization, has developed rapidly in recent years. However, photovoltaic power generation is intermittent and random, and the fluctuation of its power generation poses a challenge to the stability and power quality of the power grid. Therefore, accurately predicting photovoltaic power generation has become an important and urgent research topic. Summary of the invention

[0003] To solve this problem, the present invention provides a photovoltaic power prediction method, device, equipment and medium, which can realize feature extraction function, prediction model module and result output module, aiming to propose a method with small error and simple operation to achieve accurate prediction of photovoltaic power generation power.

[0004] In order to achieve the above object, the present invention adopts the following technical solutions:

[0005] A photovoltaic power prediction method comprises the following steps:

[0006] Step 1: The feature extraction module extracts photovoltaic data of different time series, and performs preprocessing and feature extraction on the photovoltaic data to obtain preprocessed time series data;

[0007] Step 2: The encoder module receives the pre-processed time series data output from the feature extraction module, and obtains the time series feature information of the photovoltaic data through extraction and encoding;

[0008] Step 3: The decoder maps the time series feature information extracted from the encoder back to the output space and generates a prediction value. The feature information is generated through the self-attention mechanism, the masked self-attention mechanism and the feedforward neural network.

[0009] Step 4: The final output layer converts the feature information output by the decoder into the feature value of the target sequence through an activation function, and finally outputs the predicted target feature value.

[0010] Furthermore, step one specifically includes:

[0011] Data collection: determining the source of the photovoltaic data, including photovoltaic power plant monitoring system or grid data, whose attributes include historical power values, temperature, humidity, wind speed and atmospheric pressure;

[0012] Data preprocessing: Clean the collected photovoltaic data, including removing outliers and missing values, converting the photovoltaic data into a unified time series format, ensuring that each data point contains a timestamp and the corresponding photovoltaic power value, and normalizing or standardizing the photovoltaic data to obtain photovoltaic data with a time series;

[0013] Feature extraction: Extract features useful for PV power prediction from PV data with time series to obtain preprocessed time series data, including historical power values, temperature, humidity, and wind speed information, to enhance the prediction ability of the model;

[0014] Dataset division: The preprocessed time series data is divided into training set, validation set and test set. The training set is used for model training, the validation set is used to adjust model parameters and prevent overfitting, and the test set is used to evaluate the performance of the model.

[0015] Furthermore, step 2 specifically includes:

[0016] The encoder module inputs the preprocessed time series data into a one-dimensional convolutional layer, performs preliminary feature extraction and embedding on the input sequence, converts the feature dimension of the input data from feature_dim to a higher dimension d_model, and the embedded vector is sent to the encoder of the multi-layer stacked converter model for processing; in the encoder of each layer of the converter model, the data first captures the global dependency through the self-attention mechanism, and then performs feature extraction and enhancement through the feedforward neural network. Through the stacking of the self-attention mechanism and the feedforward neural network, the time series feature information of the photovoltaic data is gradually extracted; after being processed by the encoder of the multi-layer converter model, an encoded representation is generated, which contains the time series feature information of the input data and is passed to the decoder for generating the final prediction result.

[0017] Furthermore, step three specifically includes:

[0018] The decoder receives the feature information output by the encoder module, uses the sliding window and convolution kernel operations of the convolution layer to capture local features, and expands the receptive field by stacking multiple layers; then, through the multi-layer stacked self-attention mechanism, the model is allowed to consider the output information of the previous time step when processing the output of each time step, thereby capturing the generation dependency of the sequence; a multi-head self-attention mechanism is used to process sequence information in parallel to improve computational efficiency and model performance; the feedforward neural network in the decoder further processes and transforms the output of the self-attention mechanism to generate feature information to enhance the nonlinear expression ability of the model; to ensure the autoregressive nature of the decoder, the output of the current time step can only rely on the output of the previous time step, and the self-attention mechanism in the decoder adds a mask, which blocks the information of future time steps to prevent the model from leaking future information during the generation process.

[0019] Furthermore, step four specifically includes:

[0020] The final output layer is constructed by a set of fully connected layers. The fully connected layer converts the output data of the decoder into a predicted value with a specific dimension. The predicted value represents the prediction result at a certain point in the future. The fully connected layer performs a linear transformation on the input features and generates the final predicted value through an activation function.

[0021] A photovoltaic power prediction device, comprising:

[0022] A feature extraction module is used to extract photovoltaic data of different time series, and preprocess and extract features of the photovoltaic data to obtain preprocessed time series data;

[0023] An encoder module is used to receive the pre-processed time series data output from the feature extraction module, and obtain the time series feature information of the photovoltaic data through extraction and encoding;

[0024] The decoder module is used to map the time series feature information extracted in the encoder back to the output space and generate prediction values. The feature information is generated through the self-attention mechanism, masked self-attention mechanism and feedforward neural network;

[0025] The final output layer module is used to convert the feature information output by the decoder into the feature value of the target sequence through an activation function, and finally output the predicted target feature value.

[0026] A photovoltaic power-based prediction device comprises: a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the photovoltaic power prediction method is executed.

[0027] A non-volatile computer-readable storage medium stores computer program instructions, which implement the photovoltaic power prediction method when the computer program instructions are executed by a processor.

[0028] The present invention has the following beneficial effects:

[0029] The present invention first carefully selects the feature information that is crucial to prediction from the complex time series data through the feature extraction module, laying a solid foundation for the prediction process. Subsequently, the encoder module, as the core of data processing, deeply mines and refines these key features to provide rich and accurate data support for the prediction model. On this basis, the decoder module further refines and compresses the features, and uses the masked attention mechanism to strictly follow the time order for prediction, ensuring that only historical and current information is relied on, effectively avoiding the leakage of future information, thereby significantly improving the accuracy and credibility of the prediction. Finally, the final output layer module serves as a display window for the prediction results. Through the activation function, the output of the decoder is converted into an intuitive and immediate prediction value, providing users with accurate and reliable prediction information. This series of modules works closely together to solve the problem of how to efficiently extract key features from complex and changeable time series data and accurately predict future photovoltaic power generation trends. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 The present invention provides a flow chart of a photovoltaic power prediction method.

[0031] Figure 2 The present invention is a schematic diagram of the structure of a photovoltaic power prediction device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0032] The embodiments of the present application solve the problem of predicting photovoltaic power under different environments by providing a photovoltaic power prediction method, device, equipment and medium.

[0033] In order to better understand the above-mentioned technical scheme, the above-mentioned technical scheme will be described in detail below in combination with specific implementation methods. It should be understood that the embodiments of the present invention and the specific features in the embodiments are detailed descriptions of the technical scheme of the present application, rather than limitations on the technical scheme of the present application. In the absence of conflict, the embodiments of the present application and the technical features in the embodiments can be combined with each other.

[0034] like Figure 1 As shown, the present invention provides a photovoltaic power prediction method, comprising:

[0035] Step S101, the feature extraction module must first clarify the data source, such as the photovoltaic power station monitoring system or power grid data, and store it securely locally. Subsequently, through careful data inspection, the accuracy of the data scale, type and timestamp is confirmed, the data format is unified, and problems such as noise, missing values ​​and outliers are identified and resolved. In the data cleaning stage, the missing values ​​are flexibly processed by filling or deleting methods according to the data characteristics to ensure the consistency of the time series data in the time dimension. Then, in order to meet the model training requirements, the data needs to be standardized or normalized, and photovoltaic data with time series is obtained, and features useful for photovoltaic power prediction are extracted to obtain pre-processed time series data, such as historical power values, temperature, humidity and wind speed, etc.). Finally, the pre-processed time series data is divided into training set, validation set and test set, and saved in CSV format suitable for model input, laying a solid foundation for subsequent analysis.

[0036] Step S102, the encoder receives the time series data preprocessed by the feature module, which contains multi-dimensional features and is sampled at fixed time intervals, and obtains the time series feature information of the photovoltaic data through extraction and encoding. The specific steps of step S102 are as follows:

[0037] 1. The encoder receives preprocessed time series data. This data contains multiple features (such as temperature, humidity, wind speed, etc.) and has been sampled at certain time intervals (such as every hour, every day, etc.). The dimensions of the input data are usually expressed as (batch_size, seq_length, feature_dim), where batch_size is the batch size, seq_length is the sequence length (i.e. the number of time points), and feature_dim is the number of features at each time point.

[0038] 2. In data embedding, first, a one-dimensional convolutional layer (Conv1d) is used to perform preliminary feature extraction and embedding on the input data. This step is usually used to convert the feature dimension of the input data from feature_dim to a higher dimension d_model. Through the convolution operation, the data is embedded in a higher-dimensional space to capture richer feature information.

[0039] 3. Since the Transformer model itself does not have the ability to process sequence order, positional encoding is needed to add position information. Positional encoding is a matrix with the same length as the input data sequence, which contains the encoding information of each position. Positional encoding is usually generated by sine and cosine functions, and its shape is (max_len, d_model), where max_len is the maximum possible sequence length. In practical applications, only the first seq_length positional encodings are added to the input data.

[0040] 4. The model introduces a self-attention mechanism to improve the ability to process long sequences. This mechanism only calculates the attention score of the most important part of the input sequence and ignores the unimportant parts. In order to reduce the amount of calculation, the model also compresses long sequences into shorter key sequences through distillation operations while retaining important information. After the self-attention layer, a position-by-point feedforward neural network is usually added to further process and transform the feature representation. This network usually contains two linear transformation layers with a nonlinear activation function in the middle;

[0041] 5. In order to stabilize the training process and prevent the gradient from disappearing or exploding, layer normalization operations are added between multiple layers. Secondly, to prevent overfitting, a Dropout layer is added after layer normalization to randomly discard the output of some neurons. In order to extract deeper features, the encoder usually contains multiple stacked self-attention blocks and feedforward neural network blocks. In order to process data at different time scales, stacking structures of different sizes are used. The original data is processed through a larger stack, while the downsampled or dimensionally reduced data is processed through a smaller stack.

[0042] After the above series of processing steps, the encoder outputs an encoded representation, which contains the key feature information of the input time series and is used in the subsequent decoding and prediction process.

[0043] Step S103, the decoder maps the time series feature information extracted in the encoder back to the output space and generates a prediction value, and generates feature information through the self-attention mechanism, the masked self-attention mechanism and the feedforward neural network. The specific steps of step S103 are as follows:

[0044] 1. Receive encoder output: The decoder first receives the processed output of the encoder, which usually contains a series of rich feature representations that capture the key information of the input sequence.

[0045] 2. Position encoding: Similar to the encoder, the decoder also needs to add position encoding to maintain the order information of the sequence. However, during the decoding process, since decoding is performed step by step, the position encoding needs to be dynamically added to each decoding step.

[0046] 3. The self-attention mechanism in the decoder applies a mask to ensure that when the model generates an output at a certain time point, it only relies on all information before that time point, including the encoder output and the generated decoder output. The mask blocks all positions after the current position in the self-attention calculation. This masking mechanism ensures that the model does not access future information when predicting, thereby ensuring the rationality and fairness of the prediction.

[0047] 4. The decoder also contains an encoder-decoder attention layer, which allows the decoder to refer to the encoder's output when generating each output. This attention mechanism allows the decoder to capture the interaction information between the input sequence and the generated output sequence. The decoder's attention layer is usually followed by a position-by-position feedforward neural network, which further processes and transforms the output of the attention layer to generate the final predicted output.

[0048] Through the above steps, the decoder effectively generates predictions of the target sequence by introducing a masked attention mechanism and other processing steps based on the encoder’s feature representation, while avoiding the leakage of future information and enhancing the accuracy and robustness of the prediction.

[0049] Step S104, the final prediction result is obtained by the final output layer of the decoder. This layer consists of a series of fully connected layers, which are responsible for converting the output of the decoder into prediction values ​​of specific dimensions, which may represent specific prediction results at a certain point in the future. The fully connected layer realizes the conversion of input features and the generation of prediction values ​​through the use of linear transformation and activation function. The dimensional configuration of the output layer is a key link in model design, which directly determines the diversity and applicability of the model prediction results.

[0050] The embodiment of the present invention further provides a photovoltaic power prediction device, comprising:

[0051] A feature extraction module is used to extract photovoltaic data of different time series, and preprocess and extract features of the photovoltaic data to obtain preprocessed time series data;

[0052] An encoder module is used to receive the pre-processed time series data output from the feature extraction module, and obtain the time series feature information of the photovoltaic data through extraction and encoding;

[0053] The decoder module is used to map the time series feature information extracted in the encoder back to the output space and generate prediction values. The feature information is generated through the self-attention mechanism, masked self-attention mechanism and feedforward neural network;

[0054] The final output layer module is used to convert the feature information output by the decoder into the feature value of the target sequence through an activation function, and finally output the predicted target feature value.

[0055] like Figure 2 As shown, the embodiment of the present invention further provides a photovoltaic power prediction device. For the convenience of description, only the parts related to the embodiment of the present invention are shown, including:

[0056] The processor 30, the memory 31, and the computer program 32 stored in the memory 31 and executable on the processor 30. When the processor 30 executes the computer program 32, the steps in the above photovoltaic power prediction method embodiment are implemented, for example: Figure 1 Alternatively, when the processor 30 executes the computer program 32, the functions of each unit in the above-mentioned device embodiments are realized.

[0057] The embodiment of the present invention further provides a non-volatile computer-readable storage medium on which computer program instructions are stored. When the computer program instructions are executed by a processor, the photovoltaic power prediction method is implemented.

[0058] The photovoltaic power prediction method, device, equipment and medium provided by the present invention not only improve the accuracy of prediction, but also promote the innovation and development of the photovoltaic power generation industry. Through the analysis of real-time data and prediction results, they can formulate power generation plans and scheduling plans more scientifically. This method overcomes the problems of inaccurate prediction, inability to predict long sequences, insufficient abnormal data processing capabilities, etc. in traditional methods, making it have more efficient prediction performance. This highly flexible and adaptable feature makes this method have great potential and broad prospects in application fields such as the photovoltaic power generation industry.

[0059] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of embodiments of software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0060] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0061] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0062] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0063] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.

Claims

1. A photovoltaic power prediction method, characterized in that: The steps include: Step 1: The feature extraction module extracts photovoltaic data of different time series, and performs preprocessing and feature extraction on the photovoltaic data to obtain preprocessed time series data; Step 2: The encoder module receives the pre-processed time series data output from the feature extraction module, and obtains the time series feature information of the photovoltaic data through extraction and encoding; Step 3: The decoder maps the time series feature information extracted from the encoder back to the output space and generates a prediction value. The feature information is generated through the self-attention mechanism, the masked self-attention mechanism and the feedforward neural network. Step 4: The final output layer converts the feature information output by the decoder into the feature value of the target sequence through an activation function, and finally outputs the predicted target feature value.

2. The photovoltaic power prediction method according to claim 1, characterized in that: Step 1 specifically includes: Data collection: determining the source of the photovoltaic data, including photovoltaic power plant monitoring system or grid data, whose attributes include historical power values, temperature, humidity, wind speed and atmospheric pressure; Data preprocessing: Clean the collected photovoltaic data, including removing outliers and missing values, converting the photovoltaic data into a unified time series format, ensuring that each data point contains a timestamp and the corresponding photovoltaic power value, and normalizing or standardizing the photovoltaic data to obtain photovoltaic data with a time series; Feature extraction: Extract features useful for photovoltaic power prediction from photovoltaic data with time series, and obtain pre-processed time series data, including historical power values, temperature, humidity and wind speed information, to enhance the prediction ability of the model; Dataset division: The preprocessed time series data is divided into training set, validation set and test set. The training set is used for model training, the validation set is used to adjust model parameters and prevent overfitting, and the test set is used to evaluate the performance of the model.

3. The photovoltaic power prediction method according to claim 1, characterized in that: Step 2 specifically includes: The encoder module inputs the preprocessed time series data into a one-dimensional convolutional layer, performs preliminary feature extraction and embedding on the input sequence, converts the feature dimension of the input data from feature_dim to a higher dimension d_model, and the embedded vector is sent to the encoder of the multi-layer stacked converter model for processing; in the encoder of each layer of the converter model, the data first captures the global dependency through the self-attention mechanism, and then performs feature extraction and enhancement through the feedforward neural network. Through the stacking of the self-attention mechanism and the feedforward neural network, the time series feature information of the photovoltaic data is gradually extracted; after being processed by the encoder of the multi-layer converter model, an encoded representation is generated, which contains the time series feature information of the input data and is passed to the decoder for generating the final prediction result.

4. The photovoltaic power prediction method according to claim 1, characterized in that: Step three specifically includes: The decoder receives the feature information output by the encoder module, uses the sliding window and convolution kernel operations of the convolution layer to capture local features, and expands the receptive field by stacking multiple layers; then, through the multi-layer stacked self-attention mechanism, the model is allowed to consider the output information of the previous time step when processing the output of each time step, thereby capturing the generation dependency of the sequence; a multi-head self-attention mechanism is used to process sequence information in parallel to improve computational efficiency and model performance; the feedforward neural network in the decoder further processes and transforms the output of the self-attention mechanism to generate feature information to enhance the nonlinear expression ability of the model; to ensure the autoregressive nature of the decoder, the output of the current time step can only rely on the output of the previous time step, and the self-attention mechanism in the decoder adds a mask, which blocks the information of future time steps to prevent the model from leaking future information during the generation process.

5. The photovoltaic power prediction method according to claim 1, characterized in that: Step four specifically includes: the final output layer is constructed by a set of fully connected layers. The fully connected layer converts the output data of the decoder into a predicted value with a specific dimension. The predicted value represents the prediction result at a certain point in the future. The fully connected layer performs a linear transformation on the input features and generates the final predicted value through an activation function.

6. A photovoltaic power prediction device, characterized in that: include: A feature extraction module is used to extract photovoltaic data of different time series, and preprocess and extract features of the photovoltaic data to obtain preprocessed time series data; An encoder module is used to receive the pre-processed time series data output from the feature extraction module, and obtain the time series feature information of the photovoltaic data through extraction and encoding; The decoder module is used to map the time series feature information extracted in the encoder back to the output space and generate prediction values. The feature information is generated through the self-attention mechanism, masked self-attention mechanism and feedforward neural network; The final output layer module is used to convert the feature information output by the decoder into the feature value of the target sequence through an activation function, and finally output the predicted target feature value.

7. A photovoltaic power prediction device, comprising: A processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the method for predicting photovoltaic power according to any one of claims 1 to 5 is executed when the processor executes the computer program.

8. A non-volatile computer-readable storage medium having computer program instructions stored thereon, wherein when the computer program instructions are executed by a processor, the photovoltaic power prediction method according to any one of claims 1 to 5 is implemented.

Citation Information

Cited By

  • Generation power prediction method and device

    CN120875628A