Photovoltaic power prediction method and device based on QTCN and random LSTM
By combining quantum sequential convolution and stochastic LSTM models, the problem of low accuracy and efficiency of the photovoltaic power prediction model is solved, higher prediction accuracy and computational efficiency are achieved, the expression and generalization capabilities of the model are enhanced, and the model can adapt to complex Meteorological changes and demand for large-scale photovoltaic stations.
Patent Information
- Application Number
- CN202411038138.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-31
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2044-07-31
AI Technical Summary
Existing photovoltaic power prediction models have low prediction accuracy and low computational efficiency. Complex models lead to overfitting and insufficient generalization capabilities, making it difficult to cope with complex meteorological changes and the computing needs of large-scale photovoltaic stations.
A photovoltaic power prediction method based on QTCN and stochastic LSTM is used to extract features through quantum temporal convolution and combine with the stochastic LSTM model to enhance the local context modeling capability and computational efficiency of the model. Quantum superposition states and random quantization functions are introduced to improve model expression and Generalization ability.
It improves the accuracy and computing efficiency of photovoltaic power prediction, enhances the expression ability and generalization ability of the model, can better handle complex computing tasks, and improves the robustness of the model.
Smart Images

Figure CN118568571B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of photovoltaic power generation, and in particular to a method and device for photovoltaic power prediction based on QTCN and random LSTM. Background Art
[0002] As the penetration rate of photovoltaic power generation continues to increase, the periodicity and random fluctuations in its output are also increasing, and the resulting problems such as real-time coordination and balance of power and power quality of the power system are becoming more serious. Therefore, in order to meet the needs of high-proportion photovoltaic access and the requirements for safe and stable operation of the distribution network, it is necessary to carry out accurate and reliable photovoltaic power forecasting for photovoltaic power stations, and then flexibly adjust their output to achieve a balance between supply and demand in the power grid.
[0003] Photovoltaic power generation prediction models based on machine learning have shown great application potential in photovoltaic power generation prediction. Common photovoltaic power generation prediction models include multi-layer perceptrons, long short-term memory networks, and attention mechanism neural networks. There is a complex interactive relationship between photovoltaic power generation and meteorology. The complex and changeable meteorological conditions in recent years have brought challenges to the power generation prediction of photovoltaic power stations. At the same time, with the establishment of large-scale photovoltaic stations, the cost of calculation and prediction is getting higher and higher. The current methods have the problem of low efficiency. It is necessary to combine the most cutting-edge computing technology to study photovoltaic power generation prediction methods with better performance. However, the increasingly complex model design has led to a rapid increase in the number of redundant parameters in the model, and the increase in benefits has encountered a bottleneck. At the same time, the demand for data volume is also increasing. Models with higher complexity are more likely to lead to overfitting, which is not conducive to improving generalization ability. Summary of the invention
[0004] In order to solve the problems of low prediction accuracy and low prediction efficiency in the prior art, the primary purpose of the present invention is to provide a method for photovoltaic power prediction based on QTCN and random LSTM, which can enhance the local context modeling capability of the model and improve the accuracy of photovoltaic power prediction; it can handle more complex computing tasks and obtain higher computing efficiency.
[0005] To achieve the above object, the present invention adopts the following technical solution: a photovoltaic power prediction method based on QTCN and random LSTM, the method comprising the following steps in order:
[0006] Collect historical performance data of photovoltaic power generation systems and pre-process the collected data;
[0007] Construct a random LSTM photovoltaic power generation prediction model;
[0008] The preprocessed data is input into quantum time series convolution for feature extraction, and the extracted features are input into the random LSTM photovoltaic power generation prediction model for training to obtain the trained random LSTM photovoltaic power generation prediction model;
[0009] The meteorological data and historical power generation data at the previous time D are input into the trained random LSTM photovoltaic power generation prediction model to obtain the photovoltaic power generation power at the subsequent time T.
[0010] The historical performance data includes weather conditions, photovoltaic module status and power generation records. The preprocessing includes data cleaning, removal of outliers and data normalization. The data normalization adopts the minimum-maximum normalization technology to convert the original value Convert to normalized value ,
[0011] ,
[0012] in, and Represents the minimum and maximum values respectively.
[0013] The random LSTM photovoltaic power generation prediction model includes a forgetting block, an input update block and an output block;
[0014] The forgetting block uses the first random perturbation module , The input is , Output vector , the specific operation of the forget block is:
[0015] ,
[0016] In the formula, The hidden state of the previous time step and the current input vector By concatenating the dimensions, Represents the sigmoid function;
[0017] The input update block includes a second random perturbation module and the third random perturbation module ,first, deal with , and then the output goes through a sigmoid function to determine which values to add to the cell state; at the same time, Processing the same cascade input And generate new unit state candidates through the tanh function ;at last, The output of is element-wise multiplied by , and then use the resulting vector to update the cell state; the specific operation of the input update block is:
[0018] ,
[0019] ,
[0020] ,
[0021] The output block includes a fourth random perturbation module 、The fifth random perturbation module and the sixth random perturbation module ,first, deal with And the unit state is determined by the sigmoid function Which values in are relevant to the output? The cell state itself is passed through a tanh function and then element-wise multiplied by The output of Further processing to obtain hidden state , or use Further processing to obtain output , the specific operations of the output block are:
[0022] ,
[0023] ,
[0024] ,
[0025] The first random perturbation module , the second random perturbation module , the third random perturbation module , the fourth random perturbation module 、The fifth random perturbation module and the sixth random perturbation module The structure is the same.
[0026] The loss function of the random LSTM photovoltaic power generation prediction model is:
[0027] ,
[0028] Where n represents the number of statistical data, represents the actual photovoltaic power generation, Indicates the predicted power generation.
[0029] The quantum time series convolution includes a plurality of variational quantum circuits, and the variational quantum circuits are composed of three layers: a data encoding layer, a variational layer, and a quantum measurement layer;
[0030] The data encoding layer uses H gate, RY gate, and RZ gate:
[0031] ,
[0032] ,
[0033] ,
[0034] In the formula, represents classical information input;
[0035] CNOT gate, RZ gate, and CNOT gate are used as the variation layer acting on two adjacent bits:
[0036] ,
[0037] The quantum measurement layer adopts PauliZ measurement module.
[0038] The first random perturbation module The mathematical expression is as follows:
[0039] ,
[0040] Where RQF(·) represents the random quantization function, w is the weight parameter to be quantized, and p is the generated random number. Represents the minimum value of the quantization weight parameter.
[0041] Another object of the present invention is to provide a photovoltaic power prediction device based on QTCN and random LSTM, the device comprising:
[0042] A data collection and processing module is used to collect historical performance data of the photovoltaic power generation system and pre-process the collected data;
[0043] Model building module, used to build a random LSTM photovoltaic power generation prediction model;
[0044] The training module is used to input the preprocessed data into the quantum time series convolution for feature extraction, and input the extracted features into the random LSTM photovoltaic power generation prediction model for training to obtain the trained random LSTM photovoltaic power generation prediction model;
[0045] The prediction module is used to input the meteorological data and historical power generation data at the previous time D into the trained random LSTM photovoltaic power generation prediction model to obtain the photovoltaic power generation at the subsequent time T.
[0046] The present invention also discloses a computer-readable storage medium based on the QTCN and random LSTM photovoltaic power prediction method.
[0047] The present invention also discloses a computer program product, which includes the computer program in the photovoltaic power prediction method based on QTCN and random LSTM.
[0048] It can be seen from the above technical scheme that the beneficial effects of the present invention are: first, the present invention adopts quantum convolution to model the local time features of feature data, and introduces the concept of quantum superposition state, which means that the model can consider multiple possibilities at the same time, thereby enhancing the expression ability and generalization ability of the model, strengthening the establishment of correlation relationships between different moments, and enhancing the local context modeling ability of the model, thereby improving the accuracy of photovoltaic power prediction; second, the present invention adopts the advantages of parallelism and super position computing of quantum computing to handle more complex computing tasks, and in some specific cases, higher computing efficiency can be obtained. Third, the present invention adopts a random quantization function to add a random process to the weight representation of the model, which increases the randomness of the model, helps to improve the robustness and generalization ability of the model, and designs quantum time series convolution, combining the time series modeling ability of the LSTM neural network and the random elements of quantum machine learning, which makes the model more flexible and has performance advantages. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 It is a prediction framework diagram of the present invention;
[0050] Figure 2 This is a schematic diagram of the architecture of the random LSTM photovoltaic power generation prediction model;
[0051] Figure 3 This is the computational flow chart of quantum time convolution. DETAILED DESCRIPTION
[0052] like Figure 1 As shown, a photovoltaic power prediction method based on QTCN and random LSTM includes the following steps in sequence:
[0053] Collect historical performance data of photovoltaic power generation systems and pre-process the collected data;
[0054] Construct a random LSTM photovoltaic power generation prediction model;
[0055] The preprocessed data is input into the quantum time series convolution QTCN for feature extraction, and the extracted features are input into the random LSTM photovoltaic power generation prediction model for training to obtain the trained random LSTM photovoltaic power generation prediction model;
[0056] The meteorological data and historical power generation data at the previous time D are input into the trained random LSTM photovoltaic power generation prediction model to obtain the photovoltaic power generation power at the subsequent time T.
[0057] The historical performance data includes weather conditions, photovoltaic module status and power generation records. The preprocessing includes data cleaning, removal of outliers and data normalization. The data normalization adopts the minimum-maximum normalization technology to convert the original value Convert to normalized value :
[0058] ,
[0059] in, and Represents the minimum and maximum values respectively.
[0060] like Figure 2 As shown, the random LSTM photovoltaic power generation prediction model is Figure 1 The IVQC-SLSTM in the algorithm includes a forget block, an input update block, and an output block;
[0061] The forgetting block uses the first random perturbation module , The input is , Output vector , the specific operation of the forget block is:
[0062] ,
[0063] In the formula, The hidden state of the previous time step and the current input vector By concatenating the dimensions, Represents the sigmoid function;
[0064] The input update block includes a second random perturbation module and the third random perturbation module ,first, deal with , and then the output goes through a sigmoid function to determine which values to add to the cell state; at the same time, Processing the same cascade input And generate new unit state candidates through the tanh function ;at last, The output of is element-wise multiplied by , and then use the resulting vector to update the cell state; the specific operation of the input update block is:
[0065] ,
[0066] ,
[0067] ,
[0068] The output block includes a fourth random perturbation module 、The fifth random perturbation module and the sixth random perturbation module ,first, deal with And the unit state is determined by the sigmoid function Which values in are relevant to the output? The cell state itself is passed through a tanh function and then element-wise multiplied by The output of Further processing to obtain hidden state , or use Further processing to obtain output , the specific operations of the output block are:
[0069] ,
[0070] ,
[0071] ,
[0072] The first random perturbation module , the second random perturbation module , the third random perturbation module , the fourth random perturbation module 、The fifth random perturbation module and the sixth random perturbation module The structure is the same.
[0073] The loss function of the random LSTM photovoltaic power generation prediction model is:
[0074] ,
[0075] Where n represents the number of statistical data, represents the actual photovoltaic power generation, Indicates the predicted power generation.
[0076] The quantum time series convolution QTCN includes a plurality of variational quantum circuits, and the variational quantum circuits are composed of three layers: a data encoding layer, a variational layer, and a quantum measurement layer;
[0077] The data encoding layer uses H gate, RY gate, and RZ gate:
[0078] ,
[0079] ,
[0080] ,
[0081] In the formula, represents classical information input;
[0082] CNOT gate, RZ gate, and CNOT gate are used as the variation layer acting on two adjacent bits:
[0083] ,
[0084] The quantum measurement layer adopts PauliZ measurement module.
[0085] The first random perturbation module The mathematical expression is as follows:
[0086] ,
[0087] Where RQF(·) represents the random quantization function, w is the weight parameter to be quantized, and p is the generated random number. Represents the minimum value of the quantized weight parameter. This ensures that the quantized weight is within a certain range and maintains a certain degree of randomness.
[0088] like Figure 3 As shown, the feature dimension of the input at each moment is 6, and the dimension is reduced through the fully connected layer. The number of channels for dimension reduction is 4. Assuming that the input sequence length is L=5, the input vector dimension is: [input sequence length, number of channels];
[0089] When L=5, the classical data loop input to the variational quantum circuit is [ , ],[ , ],[ , ],[ , ],[ , ], each time the classical data input to the variational quantum circuit is a 3*4=12-dimensional vector, so the number of quantum bits of the variational quantum circuit is 12, and the encoding layer acting on each quantum bit is set to be H gate, RY gate, and RZ gate, where the input of the RY gate is the inverse tangent function of the classical information, that is, arctan(x), and the input of the RZ gate is the inverse tangent function of the square of the classical information, that is, arctan( ), the input is encoded into the quantum state, and then entanglement encoding is performed through the variational layer to improve the expressive power of the quantum circuit; finally, the expected value of Z0 is measured and a one-dimensional vector is output. Assuming that the number of channels is 4, there are a total of 4 quantum time-series convolution kernels with different parameters for calculation, so the output vector dimension is [input sequence length, number of channels].
[0090] The features of the quantum time series convolution output are input into the random LSTM photovoltaic power prediction model to continue learning.
[0091] The device includes:
[0092] A data collection and processing module is used to collect historical performance data of the photovoltaic power generation system and pre-process the collected data;
[0093] Model building module, used to build a random LSTM photovoltaic power generation prediction model;
[0094] The training module is used to input the preprocessed data into the quantum time series convolution for feature extraction, and input the extracted features into the random LSTM photovoltaic power generation prediction model for training to obtain the trained random LSTM photovoltaic power generation prediction model;
[0095] The prediction module is used to input the meteorological data and historical power generation data at the previous time D into the trained random LSTM photovoltaic power generation prediction model to obtain the photovoltaic power generation at the subsequent time T.
[0096] The present invention also discloses a computer-readable storage medium based on the QTCN and random LSTM photovoltaic power prediction method.
[0097] The present invention also discloses a computer program product, which includes the computer program in the photovoltaic power prediction method based on QTCN and random LSTM.
[0098] In summary, the present invention uses quantum convolution to model the local time features of feature data and introduces the concept of quantum superposition, which means that the model can consider multiple possibilities at the same time, thereby enhancing the expressiveness and generalization capabilities of the model, strengthening the establishment of correlation relationships between different moments, and enhancing the local context modeling capabilities of the model, thereby improving the accuracy of photovoltaic power prediction; using the advantages of quantum computing parallelism and super position computing to handle more complex computing tasks, and in certain specific cases, higher computing efficiency can be obtained, using random quantization functions to add random processes to the weight representation of the model, increasing the randomness of the model, and helping to improve the robustness and generalization ability of the model, designing quantum time series convolution, combining the time series modeling capabilities of LSTM neural networks and the random elements of quantum machine learning, which makes the model more flexible and has performance advantages.
Claims
1. A photovoltaic power prediction method based on QTCN and random LSTM, characterized by: The method comprises the following steps in the following order: Collect historical performance data of photovoltaic power generation systems and pre-process the collected data; Construct a random LSTM photovoltaic power generation prediction model; The preprocessed data is input into quantum time series convolution for feature extraction, and the extracted features are input into the random LSTM photovoltaic power generation prediction model for training to obtain the trained random LSTM photovoltaic power generation prediction model; The meteorological data and historical power generation data at the previous time D are input into the trained random LSTM photovoltaic power generation prediction model to obtain the photovoltaic power generation at the subsequent time T; The random LSTM photovoltaic power generation prediction model includes a forgetting block, an input update block and an output block; The forgetting block uses the first random perturbation module , The input is , Output vector , the specific operation of the forget block is: , In the formula, The hidden state of the previous time step and the current input vector By concatenating the dimensions, Represents the sigmoid function; The input update block includes a second random perturbation module and the third random perturbation module ,first, deal with , and then the output goes through a sigmoid function to determine which values to add to the cell state; at the same time, Processing the same cascade input And generate new unit state candidates through the tanh function ;at last, The output of is element-wise multiplied by , and then use the resulting vector to update the cell state; the specific operation of the input update block is: , , , The output block includes a fourth random perturbation module 、The fifth random perturbation module and the sixth random perturbation module ,first, deal with And the unit state is determined by the sigmoid function Which values in are relevant to the output? The cell state itself is passed through a tanh function and then element-wise multiplied by The output of Further processing to obtain hidden state , or use Further processing to obtain output , the specific operations of the output block are: , , , The first random perturbation module , the second random perturbation module , the third random perturbation module , the fourth random perturbation module 、The fifth random perturbation module and the sixth random perturbation module The structure is the same; The quantum time series convolution includes a plurality of variational quantum circuits, and the variational quantum circuits are composed of three layers: a data encoding layer, a variational layer, and a quantum measurement layer; The data encoding layer uses H gate, RY gate, and RZ gate: , , , In the formula, represents classical information input; CNOT gate, RZ gate, and CNOT gate are used as the variation layer acting on two adjacent bits: , The quantum measurement layer adopts PauliZ measurement module.
2. The photovoltaic power prediction method based on QTCN and random LSTM according to claim 1 is characterized in that: The historical performance data includes weather conditions, photovoltaic module status and power generation records. The preprocessing includes data cleaning, removal of outliers and data normalization. The data normalization adopts the minimum-maximum normalization technology to convert the original value Convert to normalized value : , in, and Represents the minimum and maximum values respectively.
3. The photovoltaic power prediction method based on QTCN and random LSTM according to claim 1 is characterized in that: The loss function of the random LSTM photovoltaic power generation prediction model is: , Where n represents the number of statistical data, represents the actual photovoltaic power generation, Indicates the predicted power generation.
4. The photovoltaic power prediction method based on QTCN and random LSTM according to claim 1 is characterized in that: The first random perturbation module The mathematical expression is as follows: , Where RQF(·) represents the random quantization function, w is the weight parameter to be quantized, and p is the generated random number. Represents the minimum value of the quantization weight parameter.
5. A device for implementing the photovoltaic power prediction method based on QTCN and random LSTM according to any one of claims 1 to 4, characterized in that: The device includes: A data collection and processing module is used to collect historical performance data of the photovoltaic power generation system and pre-process the collected data; Model building module, used to build a random LSTM photovoltaic power generation prediction model; The training module is used to input the preprocessed data into quantum time series convolution for feature extraction, and input the extracted features into the random LSTM photovoltaic power generation prediction model for training to obtain the trained random LSTM photovoltaic power generation prediction model; The prediction module is used to input the meteorological data and historical power generation data at the previous time D into the trained random LSTM photovoltaic power generation prediction model to obtain the photovoltaic power generation at the subsequent time T.
6. A computer-readable storage medium according to any one of claims 1 to 4 for the photovoltaic power prediction method based on QTCN and random LSTM.
7. A computer program product, characterized in that: The computer program product comprises a computer program in the photovoltaic power prediction method based on QTCN and random LSTM as described in any one of claims 1 to 4.
