Short-term photovoltaic power generation power prediction method and system
Patent Information
- Application Number
- CN202411791652.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-06
- Publication Date
- 2025-03-25
AI Technical Summary
The prior art has problems of insufficient prediction accuracy and dispersed data samples in the short-term photovoltaic power generation prediction, which affects the stability of the power grid when connected to the grid.
The hybrid attention mechanism is used to improve the LSTM model, and the data set is constructed by collecting real-time power generation and environmental parameters of solar panels, and adjusting weights using soft attention mechanisms and adaptive attention mechanisms, dynamically determine the contribution of the attention mechanism, thereby more accurately predicting short-term photovoltaic power generation power.
It improves the accuracy of short-term photovoltaic power prediction, reduces the impact of the power grid when connected to the grid, and improves the stability of the power grid operation when connected to the grid.
Smart Images

Figure CN119692551A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of new energy, and in particular to short-term photovoltaic power generation prediction. Background Art
[0002] Solar panels can generate electricity under sunlight, but their power generation performance is affected by many factors, such as the unevenness of sunshine time, ambient temperature and climate, which makes them intermittent energy. Power stations can usually only generate electricity during the day, so their power generation performance is volatile and random. Due to these factors, photovoltaic power generation has strong random fluctuations in a short period of time, and large-scale grid connection may have an impact on the stability of the power system.
[0003] In order to reduce the impact of grid connection and effectively predict the photovoltaic power generation in the short term, accurate prediction becomes crucial. However, although the physical prediction model requires the understanding of specific parameters, such as the solar radiation equation and photovoltaic module parameters, its generalization ability is limited and the prediction accuracy is not as good as the statistical method. In addition, although the neural network in the machine learning algorithm has a strong generalization ability, if the data samples are scattered and complex, it may not be able to effectively learn the data features, resulting in poor prediction results. Wavelet analysis cannot directly predict photovoltaic power and can only be used in combination with other models. Summary of the invention
[0004] In order to solve the deficiencies in the prior art, the present invention provides a short-term photovoltaic power prediction method and system, by which the short-term photovoltaic power can be estimated more accurately.
[0005] The present invention adopts the following technical solution.
[0006] The first aspect of the present invention relates to a short-term photovoltaic power prediction method, which includes the following steps: collecting real-time power generation parameters of solar panels and environmental parameters of solar panels to construct a data set; constructing a soft attention mechanism and an adaptive attention mechanism, adjusting the weight of the soft attention mechanism and the weight of the adaptive attention mechanism; importing the soft attention mechanism, the adaptive attention mechanism and the weight into an improved LSTM model; inputting the data set into the improved LSTM model to predict short-term photovoltaic power.
[0007] Preferably, real-time power generation parameters and environmental parameters of the solar panel are collected to construct a data set; the real-time power generation parameters include the real-time voltage, real-time current and real-time power of the solar panel; the environmental parameters include the ambient temperature, ambient humidity and ambient light intensity of the solar panel.
[0008] Preferably, a soft attention mechanism and an adaptive attention mechanism are constructed, and the weights of the soft attention mechanism and the adaptive attention mechanism are adjusted, including: dynamically determining the weights of the soft attention mechanism and the adaptive attention mechanism according to input data.
[0009] Preferably, the weights of the soft attention mechanism and the adaptive attention mechanism are dynamically determined according to the input data, including: generating a gating signal according to the characteristics of the input data, and outputting the attention weight using the gating signal.
[0010] Preferably, a gating signal is generated according to the characteristics of the input data, and the attention weight is output using the gating signal, including: the gating signal g is:
[0011]
[0012] Where W g is the learnable weight matrix,
[0013] Q, K, V are attention parameters respectively,
[0014] μ, is the input data feature,
[0015] W g and b g are the LSTM model parameters.
[0016] Preferably, generating a gating signal according to the characteristics of the input data, and using the gating signal to output the attention weight includes:
[0017] w t =g⊙α ti +(1-g)⊙β t
[0018] In the formula, α ti and β t They are the output of the soft attention mechanism and the output of the adaptive attention mechanism respectively.
[0019] Preferably, the soft attention mechanism and the adaptive attention mechanism and weights are introduced into the improved LSTM model, including: using a stochastic gradient descent algorithm to implement back propagation to train the improved LSTM model.
[0020] The second aspect of the present invention relates to a short-term photovoltaic power prediction system using the method in the first aspect of the present invention, the system comprising an acquisition module, a construction module, an improvement module and a prediction module; wherein the acquisition module is used to collect real-time power generation parameters of solar panels and environmental parameters of solar panels to construct a data set; the construction module is used to construct a soft attention mechanism and an adaptive attention mechanism, and adjust the weights of the soft attention mechanism and the adaptive attention mechanism; the improvement module is used to import the soft attention mechanism and the adaptive attention mechanism and the weights into an improved LSTM model; the prediction module is used to input the data set into the improved LSTM model to predict short-term photovoltaic power.
[0021] A third aspect of the present invention relates to a terminal, comprising a processor and a storage medium; the storage medium is used to store instructions; the processor is used to operate according to the instructions to execute the steps of the method described in the first aspect of the present invention.
[0022] A fourth aspect of the present invention relates to a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method in the first aspect of the present invention.
[0023] The beneficial effect of the present invention is that, compared with the prior art, the present invention provides a short-term photovoltaic power generation prediction method and system, through which the short-term photovoltaic power generation can be estimated more accurately, thereby reducing the impact of grid connection and improving the stability of grid operation when large-scale photovoltaic power generation is connected to the grid. This not only helps to reduce the probability of potential grid operation problems, but also better manages the operation of the grid, and has high practical value. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 This is a short-term photovoltaic power generation prediction diagram. DETAILED DESCRIPTION
[0025] In order to make the purpose, technical scheme and advantages of the present invention clearer, the technical scheme of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. The embodiments described in this application are only part of the embodiments of the present invention, not all of them. Based on the spirit of the present invention, other embodiments obtained by ordinary technicians in this field without creative work are all within the scope of protection of the present invention.
[0026] Figure 1The present invention provides a short-term photovoltaic power prediction method, comprising: collecting real-time power generation parameters of solar panels and environmental parameters of solar panels to construct a data set; constructing a soft attention mechanism and an adaptive attention mechanism, adjusting the weight of the soft attention mechanism and the weight of the adaptive attention mechanism; importing the soft attention mechanism and the adaptive attention mechanism and the weight into an improved LSTM model; inputting the data set into the improved LSTM model to predict short-term photovoltaic power generation.
[0027] In order to solve the problem of short-term photovoltaic power generation prediction, this paper proposes a hybrid attention mechanism LSTM. With this method, short-term photovoltaic power generation can be estimated more accurately, thereby reducing the impact of grid connection and improving the stability of grid operation when large-scale photovoltaic power generation is connected to the grid. This not only helps to reduce the probability of potential grid operation problems, but also better manages the operation of the grid, which has high practical value.
[0028] Real-time power generation parameters include the real-time voltage, real-time current, and real-time power of the solar panel; environmental parameters include the ambient temperature, ambient humidity, and ambient light intensity of the solar panel. Read historical charge and discharge records. Features include light intensity, temperature, relative humidity, etc. According to the actual situation, select different or other feature types, fill in missing values forward, select n days of samples and divide them into training sets and test sets. Meteorological data needs to be upgraded as input and provided in the form of time series. The dimensions are (batch_size, sequence_length, feature_dim), where feature_dim is the number of features. Secondly, it is necessary to normalize the feature values of different ranges (such as temperature and irradiance) to prevent the large difference in feature values from affecting model training. This paper adopts Z-score normalization for normalization.
[0029] Establish the LSTM model, initialize the parameters required for the LSTM network and attention mechanism, and select the hyperparameter type and initial value. The input sequence is converted into a high-dimensional vector through the embedding layer to prepare for the calculation of attention. The Long Short-Term Memory Network (LSTM) is an improved recurrent neural network (RNN). RNN is a neural network that learns sequential patterns through an internal kernel. In the RNN network, multiple recurrent units are included, and these cycles can continuously transmit information. LSTM inherits many advantages of the RNN model and successfully solves the disadvantage that RNN may limit its prediction accuracy due to the gradient disappearance problem.
[0030] The predecessor of LSTM neural network is recurrent neural network, which learns and adjusts weight values through the back propagation form of chain rule.
[0031] This weight value will activate various functions, the most common ones are Sigmoid and Tanh functions. In this case, the slope of the function will become extremely small or extremely large, resulting in the problem of gradient vanishing or gradient exploding. The purpose of establishing the LSTM model is to solve these problems. Researchers proposed memory cells and memory gates. This structure can store information for a long time while ignoring unnecessary information.
[0032] LSTM networks use memory cells. An LSTM unit consists of a memory cell and an input gate i t 、Forget gate t , output gate o t There are three gates in total. At this time, t,x t represents the input data, h t Indicates the hidden layer state. The symbol x is the vector outer product, and the symbol + is the superposition operation.
[0033] First, the forget gate decides which information to let through, which is achieved through a sigmoid layer called the forget-gate layer. When the output value is between 0 and 1, it means that some information is allowed to pass through, when the output value is 0, it means that no information is allowed to pass through, and when the output value is 1, it means that all information is allowed to pass through.
[0034] f t =σ(W f ·[h t-1 ,x t ]+b f )
[0035] As shown in the formula, where W f is the matrix weight, b f is the offset, σ is the sigmoid function, and the symbol * is the vector outer product.
[0036] Then, the need to determine the amount of new information added to the cell state is realized. This can be achieved in two steps: which information needs to be updated is determined by the sigmoid layer of the input-gate layer; the generation of new information content is realized by the tanh layer. Combining these two parts, the need to update the cell state can be realized.
[0037] i t =σ(W i ·[h t-1 ,x t ]+b i )
[0038] As shown in the formula, where x t is the feature input vector at time t, i tis the output vector at time t, the dot product is the multiplication of matrices, and [] is the horizontal concatenation of matrices.
[0039] Next, the old state C is updated by the update gate. t-1 and f t Multiply to forget some information you don't want to keep, and then add This part of information is the new content to be updated.
[0040]
[0041] As shown in the formula, where f t is the output of the forget gate, C t-1 is the state vector at time t-1, i t and They are the input gate outputs respectively, and × means that the multiplication of the corresponding positions of the matrix does not change the size of the matrix.
[0042] Finally, h t-1 With x t After concatenation, it passes through the sigmoid layer and then passes through the tanh layer and updates the state of W C Multiply, the output result is the final result of the output gate, and the value range is between [-1, 1], as shown in the formula.
[0043] C t =tanh(W C ·[h t-1 ,x t ]+b C )
[0044] The forget gate and input gate control the amount of information retained in the previous memory unit and the amount of new information received by the storage unit respectively. t is the storage weight of the storage unit. The original information and the new information are controlled by the forget gate and the input gate respectively, and the current memory unit C is obtained. t Finally, the storage unit is filtered through the output gate, and the updated storage unit retrieves the current hidden layer state, and finally completes the back propagation to form an LSTM model composed of these storage blocks.
[0045] The attention mechanism is a data processing method in machine learning, which is widely used in various types of machine learning tasks such as natural language processing, image recognition, and speech recognition. The soft attention mechanism refers to calculating the weighted average of multiple input information when selecting information, and then inputting it into the neural network. The calculation of the attention value can be divided into two steps: calculating the attention distribution on all input information; and calculating the weighted average of the input information based on the attention distribution.
[0046] The input information is represented by a key-value pair, where the key is used to calculate the attention distribution and the value is used to calculate the aggregate information. It is determined by calculating the similarity between the Query and the address Key of the element in the memory. It is equivalent to calculating the weight of each Value value by the similarity between the Query and the Key, and then using the Value value for weighted summation. The weighted summation gives the final Value value, which is the attention value.
[0047] The mathematical principle of the soft attention mechanism can be summarized into three steps. The first step is to calculate the similarity between the query and the key. The second step is to convert the attention score into a numerical value using the softmax function. The third step is to perform a weighted summation of the value according to the weight coefficient. Based on the above process, the formula for calculating the attention weight value is:
[0048]
[0049] The core of the Adaptive Attention mechanism is to enable the neural network to adapt to the characteristics of different input data more flexibly by dynamically adjusting the attention weights. Compared with the soft attention mechanism, it does not require pre-learned parameters, but adaptively generates weights based on the statistical characteristics of the input data. Specifically, for the input sequence X, statistical features are extracted by calculating the mean μ and standard deviation σ. Then, by normalizing the input sequence, adaptive weights wi are generated. Finally, the weights are normalized by the softmax function to obtain the final adaptive attention weight ai. This weight is used to perform a weighted summation of the input sequence to form the final output of the model:
[0050]
[0051] The advantage of this mechanism lies in its adaptability, which can automatically adapt to different data distributions and task requirements and improve the generalization ability of the model.
[0052] The design of the hybrid attention mechanism combines the soft attention mechanism and the adaptive attention mechanism to achieve a more flexible and adaptable model. The soft attention mechanism obtains weights through learning, weights different parts of the input sequence, and adapts to the complexity of the task. On the other hand, the adaptive attention mechanism dynamically generates weights based on the statistical information or other features of the input data, does not rely on additional learned parameters, and has stronger adaptability.
[0053] In the hybrid process, the weights of the soft and adaptive attention mechanisms are combined. Through linear combination, the model can simultaneously take into account the learned weights and the weights dynamically generated according to the input data, which can better capture the key information in the input sequence. The final output is the result of the weighted summation of the input sequence, which fully reflects the comprehensive utilization of different attention levels by the hybrid attention mechanism and improves the expressiveness of the model. In addition, the hybrid design performs well in dealing with different data distributions, providing the model with better generalization capabilities.
[0054] The weight calculation method of the soft attention mechanism is based on the similarity between the input features and the input related to the target task (i.e., Query), which is calculated by a scoring function. The scoring function selected in this paper is an additive scoring function. The additive scoring function uses a small feedforward neural network to map the Query and Key to a hidden layer of the same dimension and calculate the similarity between the two. The self-attention mechanism weight generation generates the corresponding Query, Key, and Value vectors for each input position xi for the input sequence X = [x1, x2, …, xn]. Self-attention uses a dot product model to calculate the dot product similarity between each Query and all Keys, and converts the similarity score into a weight.
[0055] This paper adopts a gating mechanism to dynamically adjust the weights of the soft attention mechanism and the self-attention mechanism, integrating multiple attention mechanisms. The model can dynamically determine the contribution of the two attention mechanisms based on the input data.
[0056] Generate a gating signal based on the characteristics of the input data, and use the gating signal to output the attention weight, including:
[0057] The gate signal g is:
[0058]
[0059] Where W g is the learnable weight matrix,
[0060] Q, K, V are attention parameters respectively,
[0061] μ, is the input data feature, and is the mean and standard deviation of the input sequence X.
[0062] W g and b g are the LSTM model parameters.
[0063] Generate a gating signal based on the characteristics of the input data, and use the gating signal to output the attention weight, including:
[0064] w t =g⊙α ti+(1-g)⊙β t
[0065] In the formula, α ti and β t They are the output of the soft attention mechanism and the output of the adaptive attention mechanism respectively.
[0066] In this paper, a total of 4 LSTM layers are designed for the LSTM network, each layer contains 256 memory cells, the batch size is 64, the learning rate is set to 0.001, and the regularization adopts Dropout regularization with a value of 0.2.
[0067] The fused attention-enhanced feature sequence is input into the LSTM layer. The formula is:
[0068] i t =σ(W xi (w t ⊙x t )+W hi h t-1 +b i )
[0069] f t =σ(W xf x t +W hf h t-1 +b f )
[0070] o t =σ(W xo (w t ⊙x t )+W ho h t-1 +b o )
[0071] g t =tanh(W xc x t +W hc h t-1 +b c )
[0072] c t =f t *c t-1 +i t *g t
[0073] h t =o t *tanh(c t )
[0074] Among them, i t , f t , ot , g t , c t ,h t They represent the input gate, forget gate, output gate, current candidate memory, cell state, and hidden state respectively. σ is the sigmoid activation function, and tanh is the hyperbolic tangent activation function.
[0075] In the forward propagation of short-term photovoltaic power prediction, the input layer receives historical photovoltaic power and environmental feature data and inputs it into the LSTM unit as a sequence. The LSTM processes the input data through its internal gating mechanism, retains important time series information, generates hidden states, and finally calculates the final predicted power through a linear activation function. This forms the output of the model and provides a basis for subsequent loss calculation and model optimization.
[0076] For regression tasks, the root mean square error is selected as the loss function, and its calculation formula is:
[0077]
[0078] In the training phase, the loss is calculated and back propagated to update the model parameters. Back propagation uses the traditional stochastic gradient descent algorithm (SGD), and its formula is:
[0079]
[0080] Repeat until the model converges or the set number of iterations is reached.
[0081] In order to verify the accuracy of the photovoltaic power prediction model based on the hybrid attention mechanism proposed in this paper, the hybrid attention mechanism model, the original LSTM, the LSTM hyperparameter adjustment, and the Catboost model are compared and analyzed experimentally:
[0082]
[0083] The evaluation results of the three indicators are shown in the table. From the analysis results shown in the table, it can be seen that the MAPE indicators of the original LSTM, LSTM hyperparameter adjustment, and HAM-LSTM model prediction results are 7.33%, 5.96%, and 4.28% respectively; the RMSE evaluation indicators are 98.34, 74.39, and 55.96 respectively; and the MAE evaluation values are 81.95, 60.11, and 41.32 respectively. From the comprehensive perspective of the three evaluation indicators, the hybrid attention mechanism prediction model has the best performance and the most accurate prediction results.
[0084] The second aspect of the present invention relates to a short-term photovoltaic power prediction system using the method in the first aspect of the present invention, the system comprising a collection module, a construction module, an improvement module and a prediction module; wherein the collection module is used to collect real-time power generation parameters of solar panels and environmental parameters of solar panels to construct a data set; the construction module is used to construct a soft attention mechanism and an adaptive attention mechanism, and adjust the weights of the soft attention mechanism and the weights of the adaptive attention mechanism; the improvement module is used to import the soft attention mechanism and the adaptive attention mechanism and the weights into an improved LSTM model; the prediction module is used to input the data set into the improved LSTM model to predict short-term photovoltaic power.
[0085] A third aspect of the present invention relates to a terminal, comprising a processor and a storage medium; the storage medium is used to store instructions; the processor is used to operate according to the instructions to execute the steps of any one of the methods described in the first aspect.
[0086] A fourth aspect of the present invention relates to a computer-readable storage medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the steps of the method described in the first aspect.
[0087] The present disclosure may be a system, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present disclosure.
[0088] A computer-readable storage medium may be a tangible device that can hold and store instructions used by an instruction execution device. A computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples of computer-readable storage media (a non-exhaustive list) include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination of the foregoing. As used herein, a computer-readable storage medium is not to be interpreted as a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted through a wire.
[0089] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.
[0090] The computer program instructions for performing the operation of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed completely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via 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., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be customized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present disclosure.
[0091] Various aspects of the present disclosure are described herein 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 disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.
[0092] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0093] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0094] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction includes one or more executable instructions for realizing the specified logical function. In some alternative implementations, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in reverse 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 the specified function or action, or can be implemented with a combination of special hardware and computer instructions.
[0095] 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, and any modifications or equivalent replacements that do 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 short-term photovoltaic power generation prediction method, characterized in that: The method comprises the following steps: Collect the real-time power generation parameters and environmental parameters of solar panels to build a data set; Construct soft attention mechanism and adaptive attention mechanism, and adjust the weight of soft attention mechanism and adaptive attention mechanism; Import soft attention mechanism and adaptive attention mechanism and weights into the improved LSTM model; The dataset is input into the improved LSTM model to predict short-term photovoltaic power generation.
2. A short-term photovoltaic power generation prediction method according to claim 1, characterized in that: The real-time power generation parameters of the solar panel and the environmental parameters of the solar panel are collected to construct a data set; The real-time power generation parameters include the real-time voltage, real-time current and real-time power of the solar panel; The environmental parameters include the ambient temperature, ambient humidity, and ambient light intensity of the solar panel.
3. A short-term photovoltaic power generation prediction method according to claim 2, characterized in that: The step of constructing the soft attention mechanism and the adaptive attention mechanism, and adjusting the weight of the soft attention mechanism and the weight of the adaptive attention mechanism, includes: The weights of the soft attention mechanism and the adaptive attention mechanism are dynamically determined according to the input data.
4. A short-term photovoltaic power generation prediction method according to claim 3, characterized in that: The dynamically determining the weight of the soft attention mechanism and the weight of the adaptive attention mechanism according to the input data includes: Generate a gating signal based on the characteristics of the input data, and use the gating signal to output the attention weight.
5. A short-term photovoltaic power generation prediction method according to claim 4, characterized in that: The method of generating a gating signal according to the characteristics of the input data and outputting the attention weight using the gating signal includes: The gate signal g is: Where W g is the learnable weight matrix, Q, K, V are attention parameters respectively, μ, is the input data feature, W g and b g are the LSTM model parameters.
6. A short-term photovoltaic power generation prediction method according to claim 5, characterized in that: The method of generating a gating signal according to the characteristics of the input data and outputting the attention weight using the gating signal includes: w t =g⊙α ti +(1-g)⊙β t In the formula, α ti and β t They are the output of the soft attention mechanism and the output of the adaptive attention mechanism respectively.
7. A short-term photovoltaic power generation prediction method according to claim 6, characterized in that: The method of importing the soft attention mechanism, the adaptive attention mechanism and the weight into the improved LSTM model includes: The stochastic gradient descent algorithm is used to implement back propagation to train the improved LSTM model.
8. A short-term photovoltaic power generation prediction system using the method according to any one of claims 1 to 7, characterized in that: The system includes a collection module, a construction module, an improvement module and a prediction module; wherein, The acquisition module is used to collect real-time power generation parameters of the solar panel and environmental parameters of the solar panel to construct a data set; The building module is used to build a soft attention mechanism and an adaptive attention mechanism, and adjust the weight of the soft attention mechanism and the weight of the adaptive attention mechanism; The improved module is used to import the soft attention mechanism and the adaptive attention mechanism and weights into the improved LSTM model; The prediction module is used to input the data set into the improved LSTM model to predict short-term photovoltaic power generation.
9. A terminal comprising a processor and a storage medium; characterized in that: The storage medium is used to store instructions; The processor is configured to operate according to the instructions to execute the steps of the method according to any one of claims 1-7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Weight allocation method based on multiple attention mechanisms of transformer
CN110688860A
An edge group calculation-based garden perimeter intelligent early warning method
CN113361502A
Short-term photovoltaic output prediction method based on multi-model fusion
CN114781723A
Photovoltaic power prediction method based on LSTM
CN114819382A
Network traffic prediction method based on space-time diagram multi-attention mechanism
CN117880871A