Photovoltaic power generation prediction method and system based on CNN, BiLSTM and Attention

By using CNN, BiLSTM and Attention methods in photovoltaic power generation prediction, the time characteristics and key characteristics of photovoltaic power generation data are extracted, and the problem of low prediction accuracy in the existing technology is solved, achieving more efficient and accurate prediction effects.

CN119538989APending Publication Date: 2025-02-28HUAQIAO UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411114910.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-14
Publication Date
2025-02-28

AI Technical Summary

Technical Problem

The existing photovoltaic power prediction methods are difficult to effectively capture the long-term dependence of data sequences and the connection between the output at this moment and the input at the next moment under cloudy weather conditions, resulting in low prediction accuracy.

Method used

The photovoltaic power generation prediction method based on CNN, BiLSTM and Attention is adopted to extract the time characteristics of photovoltaic power generation data through one-dimensional convolutional neural network CNN, and the bidirectional long and short-term memory network BiLSTM further extracts the time characteristics, and uses the attention mechanism Attention combined with feature sequence vector to extract key features, and finally build a photovoltaic power generation prediction model for prediction.

Benefits of technology

The learning ability and prediction quality of the photovoltaic power generation prediction model can more effectively obtain long-term dependencies and pay attention to the connection between the output at this moment and the input at the next moment, thereby improving prediction efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119538989A_ABST
    Figure CN119538989A_ABST
Patent Text Reader

Abstract

The invention provides a CNN, BiLSTM and Attention-based photovoltaic power generation prediction method and system. The method comprises the following steps: carrying out normalization processing on a photovoltaic power generation data sequence; preliminarily extracting time features of the photovoltaic power generation data sequence through a one-dimensional convolutional neural network (CNN) and performing dimension reduction; time features are further extracted through a bidirectional long and short time memory network BiLSTM, a forward layer carries out forward calculation to obtain the output of each step length to a front hidden layer, a backward layer carries out backward calculation to obtain the output of each step length to a rear hidden layer, and finally output feature sequence vectors are obtained through combination; key features are extracted through an attention mechanism Attention in combination with the feature sequence vectors and are combined according to the importance degree, attention weights are distributed to the feature sequence vectors, weighted summation is carried out, and complete features of the photovoltaic power generation sequence are obtained; and constructing a photovoltaic power generation prediction model and predicting the photovoltaic power generation power in combination with the complete features. According to the method, the photovoltaic power generation data sequence can be fully learned, and the prediction efficiency and accuracy are greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the fields of computer technology and data processing technology, and in particular to a photovoltaic power generation prediction method and system based on CNN, BiLSTM and Attention. Background Art

[0004] Early photovoltaic power generation prediction was mainly based on building a physical prediction model for photovoltaic power stations, but due to the limitations of the model mechanism, the prediction accuracy of this method was not very ideal. Later, the prediction model establishment method represented by data-driven was widely studied. The prediction model establishment method is mainly divided into two forms: linear mapping and nonlinear mapping. The linear mapping form is mainly time series analysis; the nonlinear mapping form is mainly based on the statistical prediction model of photovoltaic power stations based on machine learning algorithms, including the most commonly used artificial neural networks, support vector machines and Markov chains.

[0005] With the continuous advancement of deep learning algorithms, methods such as recurrent neural network (RNN), long short term memory network (LSTM), and convolutional neural network (CNN) have also been introduced into photovoltaic power generation prediction, greatly improving the accuracy of prediction. In order to solve the problem that the irradiance received by the surface will fluctuate rapidly in a short period of time under cloudy weather, a prediction method that introduces cloud map information has been proposed in the prior art, but its observation means and methods are not yet very mature.

[0006] Traditional photovoltaic power generation prediction based on recurrent neural networks generally uses recursive neural networks, long short-term memory networks and other models for prediction. Although these methods have achieved a high level of prediction accuracy in photovoltaic power generation, their learning of input sequences is still insufficient and they cannot effectively obtain long-term dependencies. In addition, neural networks generally used for time series prediction cannot pay attention to the connection between the output at this moment and the input at later moments. Summary of the invention

[0007] The present invention proposes the following technical solutions to address one or more technical deficiencies in the above-mentioned prior art.

[0008] Based on the first aspect of the present invention, a photovoltaic power generation prediction method based on CNN, BiLSTM and Attention is proposed, comprising:

[0009] S1: Divide the acquired photovoltaic power generation data sequence into a training set and a test set and perform normalization processing;

[0010] S2: Preliminarily extracting the time features of the photovoltaic power generation data sequence through a one-dimensional convolutional neural network (CNN) and performing dimensionality reduction;

[0011] S3: further extracting the time characteristics of the photovoltaic power generation data sequence through a bidirectional long short-term memory network BiLSTM, the forward layer of the bidirectional long short-term memory network BiLSTM performs forward calculation to obtain the output of each step forward hidden layer, the backward layer of the bidirectional long short-term memory network BiLSTM performs reverse calculation to obtain the output of each step backward hidden layer, and the output of each step forward hidden layer and the output of the backward hidden layer are combined to obtain the feature sequence vector finally output by the bidirectional long short-term memory network BiLSTM;

[0012] S4: extracting key features of the photovoltaic power generation data sequence by using the attention mechanism and combining the feature sequence vector, merging the photovoltaic power generation data sequence according to the importance, assigning attention weights to the feature sequence vectors and performing weighted summation to obtain the complete features of the photovoltaic power generation sequence;

[0013] S5: Construct a photovoltaic power generation prediction model and predict the photovoltaic power generation power in combination with the complete features.

[0014] Furthermore, the formula for normalization is as follows:

[0015]

[0016] Among them, x' represents the normalized data, x represents the original data of the time series, min(x) represents the minimum value of the time series, and max(x) represents the maximum value of the time series.

[0017] Furthermore, S2 specifically includes the convolution layer of the one-dimensional convolutional neural network CNN sensing the local information of the photovoltaic power generation data input sequence and extracting the time features through the convolution operation, the pooling layer of the one-dimensional convolutional neural network CNN retains the optimal features of the local information and reduces the parameters to reduce the dimension of the time features, and the fully connected layer of the one-dimensional convolutional neural network CNN connects the pooled photovoltaic power generation data vectors into a serialized structure.

[0018] Furthermore, the calculation formula of the key feature is:

[0019]

[0020] Where m represents the total time step of the input bidirectional long short-term memory network Bi LSTM, v i represents the feature sequence vector finally output by the bidirectional long short-term memory network Bi LSTM, βi represents the weight of the vector, and c represents the key feature.

[0021] Furthermore, the calculation formula of the time feature is:

[0022]

[0023] Among them, y(k) represents the time feature, h(k) represents the hidden layer feature sequence, u(k) represents the inverse shift sequence of the hidden layer feature sequence, k represents the number of convolutions, and N represents the length of u.

[0024] Furthermore, the weight β of the vector is obtained through a small neural network in the attention mechanism model. i , the calculation formula is as follows:

[0025]

[0026] e i =a(v i )=σ(Wv i + b);

[0027] Among them, e i represents the similarity, σ represents the sigmoid function, W represents the weight matrix from the input layer to the hidden layer, vi represents the feature vector output by the bidirectional long short-term memory network BiLSTM, and b represents the bias value matrix.

[0028] Based on the second aspect of the present invention, a photovoltaic power generation prediction system based on CNN, BiLSTM and Attention is also proposed, including:

[0029] Preprocessing module: divide the acquired photovoltaic power generation data sequence into training set and test set and perform normalization processing;

[0030] CNN module: preliminarily extract the time characteristics of the photovoltaic power generation data sequence and perform dimensionality reduction through a one-dimensional convolutional neural network CNN;

[0031] BiLSTM module: The time characteristics of the photovoltaic power generation data sequence are further extracted through a bidirectional long short-term memory network BiLSTM, the forward layer of the bidirectional long short-term memory network BiLSTM performs forward calculation to obtain the output of each step forward hidden layer, the backward layer of the bidirectional long short-term memory network BiLSTM performs reverse calculation to obtain the output of each step backward hidden layer, and the output of each step forward hidden layer and the output of the backward hidden layer are combined to obtain the feature sequence vector finally output by the bidirectional long short-term memory network BiLSTM;

[0032] Attention module: extract the key features of the photovoltaic power generation data sequence through the attention mechanism Attention and in combination with the feature sequence vector, merge the photovoltaic power generation data sequence according to the importance, obtain the weight of attention allocation and perform weighted summation to obtain the complete features of the photovoltaic power generation sequence;

[0033] Prediction module: construct a photovoltaic power generation prediction model and predict the photovoltaic power generation power based on the complete features.

[0034] Based on the third aspect of the present invention, a computer program product is also proposed, comprising a computer program, wherein when the computer program is executed by a computer processor, the steps of any one of the methods described above are implemented.

[0035] The technical effect of the present invention is that: the present invention proposes a photovoltaic power generation prediction method and system based on CNN, BiLSTM and Attention. By constructing a photovoltaic power generation prediction model, the input photovoltaic power generation data sequence can be fully learned, so that the photovoltaic power generation prediction model has higher learning ability and higher quality, and obtains effective long-term dependence, and pays attention to the connection between the input at this moment and the output at the next moment, further improving the efficiency and accuracy of predicting photovoltaic power generation. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Other features, objects and advantages of the present application will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings.

[0037] Figure 1 It is an overall flow chart of a photovoltaic power generation prediction method based on CNN, BiLSTM and Attention provided according to an embodiment of the present invention.

[0038] Figure 2 It is a structural diagram of a one-dimensional convolutional neural network (CNN) provided according to an embodiment of the present invention.

[0039] Figure 3 It is a structural diagram of a bidirectional recurrent neural network BiLSTM provided according to an embodiment of the present invention.

[0040] Figure 4 It is a structural diagram of the attention mechanism Attention model provided according to an embodiment of the present invention.

[0041] Figure 5 It is a schematic diagram of a photovoltaic power generation prediction model based on CNN, BiLSTM and Attention according to an embodiment of the present invention.

[0042] Figure 6It is a framework diagram of a photovoltaic power generation prediction system based on CNN, BiLSTM and Attention according to an embodiment of the present invention.

[0043] Figure 7 It is a prediction result comparison chart provided according to an embodiment of the present invention.

[0044] Figure 8 It is a graph showing changes in an MSE loss function curve provided according to an embodiment of the present invention.

[0045] Fig. 9 It is a MAE curve change diagram provided according to an embodiment of the present invention.

[0046] Fig.10 It is a schematic diagram of the structure of a computer system of an electronic device suitable for implementing an embodiment of the present application. DETAILED DESCRIPTION

[0047] The present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the relevant invention, rather than to limit the invention. It should also be noted that, for ease of description, only the parts related to the relevant invention are shown in the accompanying drawings.

[0048] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0049] Figure 1 The overall flow chart of the photovoltaic power generation prediction method based on CNN, BiLSTM and Attention of the present invention is shown, which includes the following steps:

[0050] S1: Divide the acquired photovoltaic power generation data sequence into a training set and a test set and perform normalization processing;

[0051] S2: Preliminarily extracting the time features of the photovoltaic power generation data sequence through a one-dimensional convolutional neural network (CNN) and performing dimensionality reduction;

[0052] S3: further extracting the time characteristics of the photovoltaic power generation data sequence through a bidirectional long short-term memory network BiLSTM, the forward layer of the bidirectional long short-term memory network BiLSTM performs forward calculation to obtain the output of each step forward hidden layer, the backward layer of the bidirectional long short-term memory network BiLSTM performs reverse calculation to obtain the output of each step backward hidden layer, and the output of each step forward hidden layer and the output of the backward hidden layer are combined to obtain the feature sequence vector finally output by the bidirectional long short-term memory network BiLSTM;

[0053] S4: extracting key features of the photovoltaic power generation data sequence by using the attention mechanism and combining the feature sequence vector, merging the photovoltaic power generation data sequence according to the importance, assigning attention weights to the feature sequence vectors and performing weighted summation to obtain the complete features of the photovoltaic power generation sequence;

[0054] S5: Construct a photovoltaic power generation prediction model and predict the photovoltaic power generation power in combination with the complete features.

[0055] It should be noted that the formula for normalization is as follows:

[0056]

[0057] Among them, x' represents the normalized data, x represents the original data of the time series, min(x) represents the minimum value of the time series, and max(x) represents the maximum value of the time series.

[0058] It should be noted that S2 specifically includes the convolution layer of the one-dimensional convolutional neural network CNN, which perceives the local information of the photovoltaic power generation data input sequence and extracts the time features through the convolution operation, the pooling layer of the one-dimensional convolutional neural network CNN retains the optimal features of the local information and reduces the parameters to reduce the dimension of the time features, and the fully connected layer of the one-dimensional convolutional neural network CNN connects the pooled photovoltaic power generation data vectors into a serialized structure.

[0059] It should be noted that the calculation formula of the time characteristic is:

[0060]

[0061] Among them, y(k) represents the time feature, h(k) represents the hidden layer feature sequence, u(k) represents the inverse shift sequence of the hidden layer feature sequence, k represents the number of convolutions, and N represents the length of u.

[0062] It should be noted that CNN is a feedforward neural network with a convolutional structure. It is often used to process network topological data and is widely used in time series analysis, natural language processing and computer vision. According to the different data processed, CNN can be divided into one-dimensional convolutional structure, two-dimensional convolutional structure and three-dimensional convolutional structure. Among them, the one-dimensional convolutional structure is more widely used in the fields of time series analysis and natural language processing. The structure of the one-dimensional convolutional neural network CNN is as follows: Figure 2 As shown, it includes convolutional layers, pooling layers and fully connected layers;

[0063] Among them, the photovoltaic power generation prediction data sequence is input into the input layer, and the convolution layer performs cyclic multiplication and addition through convolution operation and perceives the local information of the input layer sequence; the pooling layer is used to retain the local optimal features and reduce the dimension, and the fully connected layer is used to connect the pooled data into a serialized structure and then output it.

[0064] It should be noted that the bidirectional long short-term memory network BiLSTM realizes bidirectional reading through a reverse layer, and can capture the bidirectional dependency in the photovoltaic power generation data sequence through the output of the forward and backward long short-term memory networks. Its structure is as follows Figure 3 As shown in the figure, the bidirectional long short-term memory network BiLSTM is unfolded along time, and the six weights are repeatedly used in each time step, where (w1, w3) are from the input layer to the forward hidden layer and from the input layer to the backward hidden layer, (w2, w5) are from the hidden layer to the hidden layer itself, (w4, w6) are from the forward hidden layer to the output layer and from the backward hidden layer to the output layer, respectively. There is no information flow between the forward hidden layer and the backward hidden layer, and it is non-cyclic.

[0065] It should be noted that the calculation formula of the key feature is:

[0066]

[0067] Where m represents the total time step of the input bidirectional long short-term memory network Bi LSTM, v i represents the feature sequence vector finally output by the bidirectional long short-term memory network Bi LSTM, β i represents the weight of the vector, and c represents the key feature.

[0068] It should be noted that the weight β of the vector is obtained through the small neural network in the attention mechanism model. i , the calculation formula is as follows:

[0069]

[0070] e i =a(v i )=σ(Wv i + b);

[0071] Among them, e i represents similarity, σ represents the sigmoid function, W represents the weight matrix from the input layer to the hidden layer, v i represents the feature vector output by the bidirectional long short-term memory network BiLSTM, and b represents the bias value matrix.

[0072] It should be noted that the attention mechanism Attention is to output the feature sequence v from the bidirectional long short-term memory network BiLSTM iLearn the importance of each input α(v i ), merge them according to their importance to obtain the weight parameter β of the attention allocation coefficient, and output the key feature c, such as Figure 4 shown.

[0073] It should be noted that the traditional photovoltaic power generation prediction based on recurrent neural network generally uses recursive neural network and long short-term memory network model for prediction. These methods still have insufficient learning of input sequence and cannot effectively obtain long-term dependency. Generally, the neural network used to predict time series cannot pay attention to the connection between the output at this moment and the input at later moments. This application proposes a bidirectional LSTM time series prediction model that combines attention mechanism and convolutional neural network. It solves the dependency and influence problems of long time series to a certain extent by introducing attention mechanism, and solves the connection problem between the output at this moment and the input at later moments through bidirectional long short-term memory network. Its structural diagram is shown as follows Figure 5 As shown in the figure, the model uses a convolutional neural network (CNN) to extract spatial features from the multidimensional time series of the input photovoltaic power generation data, and then uses a bidirectional long short-term memory network (BiLSTM) to extract spatiotemporal features based on the spatial features. Finally, the attention mechanism is used to extract the key features of the photovoltaic power generation data and weight the key features at each moment to obtain the complete features of the sequence, and calculate the predicted value of photovoltaic power generation, so that the predicted value of photovoltaic power generation is closer to the true value, and the prediction result is more stable.

[0074] Reference below Figure 6 , Figure 6 It is a framework diagram of a photovoltaic power generation prediction system based on CNN, BiLSTM and Attention provided according to an embodiment of the present invention, including a preprocessing module a, a CNN module b, a BiLSTM module c, an Attention module d and a prediction module e.

[0075] In a specific embodiment, the preprocessing module a is configured to: divide the acquired photovoltaic power generation data sequence into a training set and a test set and perform normalization processing.

[0076] In a specific embodiment, the CNN module b is configured to: preliminarily extract the time features of the photovoltaic power generation data sequence through a one-dimensional convolutional neural network CNN and perform dimensionality reduction.

[0077] In a specific embodiment, the BiLSTM module c is configured as follows: the time characteristics of the photovoltaic power generation data sequence are further extracted through a bidirectional long short-term memory network BiLSTM, the forward layer of the bidirectional long short-term memory network BiLSTM performs forward calculation to obtain the output of each step forward hidden layer, the backward layer of the bidirectional long short-term memory network BiLSTM performs reverse calculation to obtain the output of each step backward hidden layer, and the output of each step forward hidden layer and the output of the backward hidden layer are combined to obtain the feature sequence vector finally output by the bidirectional long short-term memory network BiLSTM.

[0078] In a specific embodiment, the Attention module d is configured as follows: extracting the key features of the photovoltaic power generation data sequence through the attention mechanism Attention and combining it with the feature sequence vector, merging the photovoltaic power generation data sequence according to the importance, obtaining the attention allocation weight and performing weighted summation to obtain the complete features of the photovoltaic power generation sequence.

[0079] In a specific embodiment, the prediction module e is configured to: construct a photovoltaic power generation prediction model and predict the photovoltaic power generation power in combination with the complete features.

[0080] In a specific embodiment, NWP data and photovoltaic power generation data from January 2020 to September 2020 are collected, as shown in Table 1;

[0081] Table 1 shows some data sets

[0082]

[0083]

[0084] The collected photovoltaic power generation data is processed by the photovoltaic power generation prediction model of this paper, and the prediction result curve is as follows: Figure 7 As shown in the figure, the blue curve represents the predicted value and the orange curve represents the true value. The curves related to the photovoltaic power generation prediction model training using the loss function are shown in Figure 8 As shown in the figure, blue represents the training set and orange represents the test set. The loss value gradually decreases during the training process, and the dispersion of the predicted values ​​gradually decreases, and finally drops to a very low level. The mean absolute error change curve of the MAE model training is shown in the figure. Fig. 9 As shown, blue represents the training set and orange represents the test set. The absolute mean error gradually decreases during training, and the average deviation between the predicted results and the actual values ​​gradually decreases.

[0085] Reference below Fig.10 , which shows a schematic diagram of the structure of a computer system 1000 suitable for implementing an electronic device of an embodiment of the present application. Fig.10The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0086] like Fig.10 As shown, the computer system 1000 includes a central processing unit (CPU) 1001, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage part 1008 into a random access memory (RAM) 1003. In the RAM 1003, various programs and data required for the operation of the system 1000 are also stored. The CPU 1001, the ROM 1002, and the RAM 1003 are connected to each other via a bus 1004. An input / output (I / O) interface 1005 is also connected to the bus 1004.

[0087] The following components are connected to the I / O interface 1005: an input section 1006 including a keyboard, a mouse, etc.; an output section 1007 including a liquid crystal display (LCD), etc. and a speaker, etc.; a storage section 1008 including a hard disk, etc.; and a communication section 1009 including a network interface card such as a LAN card, a modem, etc. The communication section 1009 performs communication processing via a network such as the Internet. A drive 1010 is also connected to the I / O interface 1005 as needed. A removable medium 1011, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1010 as needed, so that a computer program read therefrom is installed into the storage section 1008 as needed.

[0088] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 1009, and / or installed from the removable medium 711. When the computer program is executed by the central processing unit (CPU) 1001, the above functions defined in the method of the present application are executed. It should be noted that the computer-readable storage medium of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, - but not limited to - a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to, an electrical connection with one or more conductors, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device, or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable storage medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, device, or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wireless, wireline, optical cable, RF, etc., or any suitable combination of the foregoing.

[0089] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0090] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0091] The modules involved in the embodiments of the present application may be implemented by software or by hardware.

[0092] As another aspect, the present application also provides a computer-readable storage medium, which may be included in the electronic device described in the above embodiment; or it may exist independently and not be assembled into the electronic device. The above computer-readable storage medium carries one or more programs. When the above one or more programs are executed by the electronic device, the electronic device: divides the acquired photovoltaic power generation data sequence into a training set and a test set and performs normalization processing; preliminarily extracts the time characteristics of the photovoltaic power generation data sequence through a one-dimensional convolutional neural network CNN and performs dimensionality reduction; further extracts the time characteristics of the photovoltaic power generation data sequence through a bidirectional long short-term memory network BiLSTM, the forward layer of the bidirectional long short-term memory network BiLSTM performs forward calculation to obtain the output of each step forward hidden layer, the backward layer of the bidirectional long short-term memory network BiLSTM performs reverse calculation to obtain the output of each step backward hidden layer, and the output of each step forward hidden layer and the output of the backward hidden layer are combined to obtain the feature sequence vector finally output by the bidirectional long short-term memory network BiLSTM; through the attention mechanism Attent ion and extract the key features of the photovoltaic power generation data sequence in combination with the feature sequence vector, merge the photovoltaic power generation data sequence according to the importance, assign attention weights to the feature sequence vectors and perform weighted summation to obtain the complete features of the photovoltaic power generation sequence; construct a photovoltaic power generation prediction model and predict the photovoltaic power generation power in combination with the complete features.

[0093] The above description is only a preferred embodiment of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the present application is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above invention concept. For example, the above features are replaced with the technical features with similar functions disclosed in this application (but not limited to) by each other to form a technical solution.

[0094] Finally, it should be noted that the above embodiments are only intended to illustrate rather than limit the technical solutions of the present invention. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that the present invention can still be modified or replaced by equivalents. Any modification or partial replacement that does not depart from the spirit and scope of the present invention should be included in the scope of the claims of the present invention.

Claims

1. A photovoltaic power generation prediction method based on CNN, BiLSTM and Attention, characterized in that: include: S1: Divide the acquired photovoltaic power generation data sequence into a training set and a test set and perform normalization processing; S2: Preliminarily extracting the time features of the photovoltaic power generation data sequence through a one-dimensional convolutional neural network (CNN) and performing dimensionality reduction; S3: further extracting the time characteristics of the photovoltaic power generation data sequence through a bidirectional long short-term memory network BiLSTM, the forward layer of the bidirectional long short-term memory network BiLSTM performs forward calculation to obtain the output of each step forward hidden layer, the backward layer of the bidirectional long short-term memory network BiLSTM performs reverse calculation to obtain the output of each step backward hidden layer, and the output of each step forward hidden layer and the output of the backward hidden layer are combined to obtain the feature sequence vector finally output by the bidirectional long short-term memory network BiLSTM; S4: extracting key features of the photovoltaic power generation data sequence through the attention mechanism and combining the feature sequence vector, merging the photovoltaic power generation data sequence according to the importance, assigning attention weights to the feature sequence vectors and performing weighted summation to obtain the complete features of the photovoltaic power generation sequence; S5: Construct a photovoltaic power generation prediction model and predict the photovoltaic power generation power in combination with the complete features.

2. The method according to claim 1, characterized in that The formula for normalization is as follows: Among them, x' represents the normalized data, x represents the original data of the time series, min(x) represents the minimum value of the time series, and max(x) represents the maximum value of the time series.

3. The method according to claim 1, characterized in that: S2 specifically includes the convolution layer of the one-dimensional convolutional neural network CNN sensing the local information of the photovoltaic power generation data input sequence and extracting the time features through the convolution operation, the pooling layer of the one-dimensional convolutional neural network CNN retaining the optimal features of the local information and reducing the parameters to reduce the dimension of the time features, and the fully connected layer of the one-dimensional convolutional neural network CNN connecting the pooled photovoltaic power generation data vectors into a serialized structure.

4. The method according to claim 1, characterized in that: The calculation formula of the key feature is: Where m represents the total time step of the input bidirectional long short-term memory network BiLSTM, v i represents the feature sequence vector finally output by the bidirectional long short-term memory network BiLSTM, β i represents the weight of the vector, and c represents the key feature.

5. The method according to claim 3, characterized in that: The calculation formula of the time characteristic is: Among them, y(k) represents the time feature, h(k) represents the hidden layer feature sequence, u(k) represents the inverse shift sequence of the hidden layer feature sequence, k represents the number of convolutions, and N represents the length of u.

6. The method according to claim 4, characterized in that The weight β of the vector is obtained through a small neural network in the attention mechanism model i , the calculation formula is as follows: yes i =a(v i )=σ(Wv i +b); Among them, e i represents similarity, σ represents the sigmoid function, W represents the weight matrix from the input layer to the hidden layer, v i represents the feature vector output by the bidirectional long short-term memory network BiLSTM, and b represents the bias value matrix.

7. A photovoltaic power generation prediction system based on CNN, BiLSTM and Attention, characterized in that: include: Preprocessing module: divide the acquired photovoltaic power generation data sequence into training set and test set and perform normalization processing; CNN module: preliminarily extract the time characteristics of the photovoltaic power generation data sequence and perform dimensionality reduction through a one-dimensional convolutional neural network CNN; BiLSTM module: The time characteristics of the photovoltaic power generation data sequence are further extracted through a bidirectional long short-term memory network BiLSTM, the forward layer of the bidirectional long short-term memory network BiLSTM performs forward calculation to obtain the output of each step forward hidden layer, the backward layer of the bidirectional long short-term memory network BiLSTM performs reverse calculation to obtain the output of each step backward hidden layer, and the output of each step forward hidden layer and the output of the backward hidden layer are combined to obtain the feature sequence vector finally output by the bidirectional long short-term memory network BiLSTM; Attention module: extract the key features of the photovoltaic power generation data sequence through the attention mechanism Attention and combined with the feature sequence vector, merge the photovoltaic power generation data sequence according to the importance, obtain the weight of attention allocation and perform weighted summation to obtain the complete features of the photovoltaic power generation sequence; Prediction module: construct a photovoltaic power generation prediction model and predict the photovoltaic power generation power based on the complete features.

8. A computer program product, comprising a computer program, characterized in that The computer program implements the steps of the method according to any one of claims 1 to 6 when executed by a computer processor.