Photovoltaic prediction method and system based on historical data
The photovoltaic prediction method enhances accuracy and adaptability by integrating multimodal features and data fusion, addressing the limitations of existing methods in photovoltaic power generation prediction.
Patent Information
- Application Number
- CN202411033869.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-30
- Publication Date
- 2024-12-31
AI Technical Summary
Existing photovoltaic prediction methods suffer from low accuracy, high model complexity, and strong dependence on data quality and distribution, failing to adapt to the complexity of photovoltaic power generation data and varying application scenarios.
A photovoltaic prediction method that integrates multi-source grid and site data using multimodal feature fusion, incorporating a weather discriminator, pyramid wavelet feature prediction network, and grid-site data fusion to enhance prediction accuracy and adaptability.
The method effectively captures spatial and temporal characteristics of photovoltaic power generation, improving prediction accuracy and robustness by integrating weather features and multi-source data fusion, overcoming limitations of traditional methods.
Smart Images

Figure CN119228155A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of photovoltaic power generation, and in particular to a photovoltaic prediction method and system based on historical data. Background Art
[0002] Photovoltaic power generation, as a clean energy, has developed rapidly in recent years. However, its power generation is significantly affected by weather conditions and has obvious intermittency and volatility. Accurately predicting photovoltaic power generation is crucial to grid dispatching and energy management, and is the key to achieving large-scale grid connection of photovoltaic power generation. Existing photovoltaic prediction methods mainly include statistical methods, machine learning methods, and physical model methods. Statistical methods are limited by data distribution assumptions and are difficult to adapt to the complexity of photovoltaic power generation data; machine learning methods require a large amount of training data and are easily affected by data quality; physical model methods rely on complex physical parameters and have high computational complexity. Therefore, existing photovoltaic prediction methods are difficult to meet the needs of actual applications, and there is an urgent need to develop more efficient and accurate prediction methods. Back-calculation simulation is based on real data and estimation models: historical data and estimation models are used for simulation to calculate photovoltaic power generation. However, the existing back-calculation simulation methods rely on the accuracy of the estimation model. If the estimation model is biased, the back-calculation results will also be biased. Lack of processing of abnormal data in historical data leads to inaccurate back-calculation results. Lack of adaptability to different types of photovoltaic power stations, difficulty in meeting the needs of different application scenarios, and other shortcomings. Therefore, a more accurate, reliable and scalable photovoltaic prediction method is needed to meet the actual needs of photovoltaic power generation prediction. Summary of the invention
[0003] In view of the problems of low prediction accuracy, high model complexity and strong dependence on data in existing photovoltaic prediction methods, the present invention is proposed.
[0004] Therefore, the technical problem solved by the present invention is: taking the time series data of photovoltaic power generation and meteorological data as input, using multimodal feature fusion technology to effectively extract and fuse the time series features and meteorological features, and improving the prediction accuracy and generalization ability.
[0005] To solve the above technical problems, the present invention provides the following technical solutions: a photovoltaic prediction method based on historical data, comprising: acquiring photovoltaic data, grid meteorological data and site meteorological data; inputting the grid meteorological data into a weather discriminator to obtain a weather feature sequence; inputting the photovoltaic data and the weather feature sequence into a pyramid wavelet feature prediction network to obtain a grid photovoltaic prediction feature matrix; fusing the grid meteorological data with the site meteorological data to obtain a grid station data fusion feature matrix; combining the grid photovoltaic prediction feature matrix with the grid station data fusion feature matrix to obtain a three-dimensional grid prediction result.
[0006] As a preferred solution of the photovoltaic prediction method based on historical data of the present invention, the grid meteorological data includes surface solar radiation, predicted albedo, two-meter temperature, relative humidity, atmospheric pressure and temperature.
[0007] As a preferred solution of the photovoltaic prediction method based on historical data of the present invention, the grid photovoltaic prediction feature matrix includes: extracting photovoltaic sequence data of a single grid point from photovoltaic data; using a three-level DB4 wavelet decomposition on the photovoltaic sequence data of the single grid point to obtain a three-level wavelet decomposition approximate coefficient and detail coefficient, a second-level wavelet decomposition detail coefficient and a first-level wavelet decomposition detail coefficient; using LSTM to predict the three-level wavelet decomposition approximate coefficient, and outputting the predicted three-level wavelet decomposition approximate coefficient; performing a convolution operation on a single batch of photovoltaic sequences, during the convolution operation, aligning the bottom downsampling layer with the weather feature sequence output by the weather discriminator, and then fusing and splicing them, inputting LSTM for prediction, and obtaining three detail coefficients and an approximate coefficient; reconstructing using a wavelet reconstruction function to obtain a single grid photovoltaic prediction sequence; repeating the above operation for each grid point to obtain a grid photovoltaic prediction feature matrix.
[0008] As a preferred solution of the photovoltaic prediction method based on historical data of the present invention, the use process of the weather discriminator includes: obtaining multi-source meteorological grid data and preprocessing the multi-source meteorological grid data; using a convolutional neural network to extract features and obtain a meteorological feature sequence; processing the preprocessed meteorological feature sequence using a softmax function, and obtaining a weather feature sequence after a weather discrimination method; inputting the weather feature sequence into the bottom hidden layer of the pyramid wavelet feature prediction network.
[0009] As a preferred solution of the photovoltaic prediction method based on historical data of the present invention, the formula of the convolution operation is optimized by introducing depthwise separable convolution and dilated convolution. The depthwise separable convolution includes depthwise convolution and pointwise convolution. The formula of depthwise convolution is as follows:
[0010]
[0011] Among them, y depthwise represents the output result of the deep convolution operation, σ represents the activation function, K represents the number of convolution kernels used in the deep convolution operation, k represents the index, and W k represents the kth depth convolution kernel, X k Represents the feature matrix of the kth input channel; the formula for point-by-point convolution is as follows:
[0012]
[0013] Among them, y pointwiserepresents the output result of the point-by-point convolution operation, σ represents the activation function, d represents the number of output channels, and W 1×1 Represents a 1×1 convolution kernel for point-by-point convolution, which is used to perform linear combinations of channels on the output results of the depthwise convolution. depthwise Represents the output result of the deep convolution operation; the calculation formula of the dilated convolution is as follows:
[0014]
[0015] Among them, y dilated represents the output of the dilated convolution, σ represents the activation function, d represents the number of output channels, and W i represents the i-th convolution kernel in the dilated convolution operation, Represents the input feature with a dilation factor r; combining the depthwise separable convolution and the dilation convolution, the formula for the optimized final convolution output is as follows:
[0016]
[0017] Among them, y represents the final convolution output after optimization, σ represents the activation function, and W 1×1 represents a 1×1 convolution kernel for point-by-point convolution, K represents the number of convolution kernels used in the depthwise convolution operation, k represents the index, and W k represents the kth depth convolution kernel, represents the input features with a dilation factor r, and d represents the number of output channels.
[0018] As a preferred solution of the photovoltaic prediction method based on historical data of the present invention, the grid meteorological data is fused with the site meteorological data to obtain a grid site data fusion feature matrix, including: extracting features after processing the grid meteorological data to obtain a grid feature map; extracting features using a graph neural convolutional network after processing the site meteorological data to obtain a site feature map; combining the grid feature map with the site feature map to obtain a grid site data fusion feature matrix.
[0019] As a preferred solution of the photovoltaic prediction method based on historical data of the present invention, the formula of the graph neural convolution network adjacency matrix is as follows:
[0020] A=D -1 / 2 *(A+I)*D -1 / 2
[0021] Among them, A represents the normalized adjacency matrix, H represents the input feature matrix, W represents the convolution kernel weight matrix, and H′ represents the output feature matrix; the formula of the improved GCN convolution operation is as follows:
[0022] H′=softmax(A·H·W+Q·K T )·V
[0023] Q=H·W Q
[0024] K=H·W K
[0025] V=H·W V
[0026] Among them, A represents the normalized adjacency matrix, H represents the input feature matrix, W represents the convolution kernel weight matrix, H′ represents the output feature matrix, Q represents the query matrix, which is obtained by linear transformation; K represents the key matrix, which is obtained by linear transformation; V represents the value matrix, which is obtained by linear transformation, and softmax represents the normalization function.
[0027] Another object of the present invention is to provide a photovoltaic prediction system based on historical data, including: a data acquisition module for acquiring photovoltaic data, grid meteorological data and site meteorological data; a discrimination module for inputting the grid meteorological data into a weather discriminator to obtain a weather feature sequence; a first matrix calculation module for inputting the photovoltaic data and the weather feature sequence into a pyramid wavelet feature prediction network to obtain a grid photovoltaic prediction feature matrix; a second matrix calculation module for fusing the grid meteorological data with the site meteorological data to obtain a grid station data fusion feature matrix; a prediction module for combining the grid photovoltaic prediction feature matrix with the grid station data fusion feature matrix to obtain a three-dimensional grid prediction result.
[0028] A computer device includes a memory and a processor, wherein the memory stores a computer program, and is characterized in that when the processor executes the computer program, the steps of the photovoltaic prediction method based on historical data are implemented.
[0029] A computer-readable storage medium having a computer program stored thereon, characterized in that when the computer program is executed by a processor, the steps of the photovoltaic prediction method based on historical data as described above are implemented.
[0030] Beneficial effects of the present invention: A photovoltaic prediction method and system based on historical data is designed, the core of which is to integrate multi-source grid data and site data in historical data, so as to achieve a more comprehensive and accurate prediction and analysis of photovoltaic power generation output. By treating photovoltaic grid data as a multi-dimensional time series for fine decomposition and prediction, the complex characteristics of changes in photovoltaic resources in different spatial locations are effectively captured. In addition, the present invention has a deep understanding of the significant impact of weather factors on photovoltaic power generation, and innovatively introduces a weather feature sequence extraction mechanism, which can accurately quantify the dynamic changes of weather conditions and integrate it into the prediction model as key auxiliary information, significantly improving the adaptability and prediction accuracy of the photovoltaic prediction model. The present invention comprehensively considers various factors that have a great impact on photovoltaic data, and improves the accuracy of photovoltaic power generation. Secondly, a photovoltaic prediction method and system based on historical data was designed. For the prediction of photovoltaic data series, a pyramid wavelet feature prediction network was designed. This network combines the fine analysis ability of wavelet decomposition with the excellent feature extraction ability of deep learning models to build a multi-level prediction framework. Through wavelet decomposition, this method can effectively decompose photovoltaic data series into subsequences of different frequencies, accurately capturing the periodicity and non-stationary characteristics of photovoltaic output. The introduction of deep learning models further enhances the network's modeling ability for complex nonlinear relationships and realizes the mining and utilization of deep-level features of photovoltaic data. This network not only overcomes the one-sidedness and inaccuracy that may exist in traditional single prediction methods in photovoltaic data prediction, but also significantly improves the accuracy and stability of prediction results. Thirdly, a photovoltaic prediction method and system based on historical data is designed. In the discrimination of the weather background of the day, a weather discriminator module is used. This module combines the feature extraction advantages of convolutional neural networks with the normalization characteristics of softmax functions, realizes the accurate discrimination and quantification of complex weather backgrounds, and converts the abstract weather information that is difficult to be directly used for photovoltaic prediction into high-dimensional feature sequences. These feature sequences not only capture the core characteristics of the weather, but also retain the subtle differences in its dynamic changes. The present invention combines this weather feature sequence into the pyramid wavelet feature prediction network as the key input of the bottom hidden layer, which not only expands the data dimension of the prediction model, but also enhances the sensitivity and adaptability of the model to the influence of weather factors, thereby achieving higher accuracy and stronger robustness in the prediction of photovoltaic data sequences. Finally, the present invention designs a photovoltaic prediction method and system based on historical data. In the processing of grid and site data, a grid-site data fusion module is used, which realizes the accurate feature extraction and fusion of multi-source grid data and discrete site data. Specifically, for complex and changeable multi-source grid data, this module adopts the ConvLSTM model, which effectively analyzes the spatial correlation and temporal dependence in the grid data with its powerful ability to capture spatiotemporal features.At the same time, for discrete and unevenly distributed site data, the present invention uses a graph convolutional neural network, and uses its excellent performance on graph structure data to accurately extract the inter-site correlation features. Subsequently, these two features from different data sources and extracted by different deep learning models are efficiently fused to form a fusion feature rich in multi-dimensional information. This process not only makes full use of the complementarity of multi-source data, but also overcomes the limitations of a single data source or a single model in feature extraction, thereby achieving a more comprehensive and accurate capture of the information required for photovoltaic prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0032] Figure 1 It is a flow chart of the present invention.
[0033] Figure 2 This is a comparison chart of model performance from 2014.04.18 to 2014.04.21;
[0034] Figure 3 This is a comparison chart of model performance from 2014.07.20 to 2014.07.23;
[0035] Figure 4 This is the network structure diagram of the photovoltaic back-calculation model;
[0036] Figure 5 This is a pyramidal wavelet feature prediction network structure diagram;
[0037] Figure 6 This is the structure diagram of the pyramid feature back-calculation network. DETAILED DESCRIPTION
[0038] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary persons in the art without creative work should fall within the scope of protection of the present invention.
[0039] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.
[0040] Example 1
[0041] Reference Figures 1 to 6 , as an embodiment of the present invention, provides a photovoltaic prediction method based on historical data.
[0042] First, the photovoltaic prediction method based on historical data provided in the present application can be applied to a terminal. The terminal may include one or two processors and a memory for storing data, wherein the processor may include but is not limited to a processing system such as a microprocessor MCU or a programmable logic device FPGA. The above-mentioned terminal may also include a transmission device and an input and output device for communication functions. It can be understood by those skilled in the art that the structure is only for illustration and does not limit the structure of the above-mentioned terminal. For example, the terminal may also include more or fewer components, or have different configurations.
[0043] The memory can be used to store computer programs, such as the computer program corresponding to the photovoltaic prediction method based on historical data in this embodiment. The processor executes various functional applications and data processing by running the computer program stored in the memory, that is, implementing the above method. The memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage systems, flash memory, or other non-volatile solid-state memory. In some examples, the memory may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0044] The transmission device is used to receive or send data via a network. The above network includes a wireless network provided by a communication provider of the terminal. In one example, the transmission device includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device can be a radio frequency (Radio Frequency, referred to as RF) module, which is used to communicate with the Internet wirelessly.
[0045] like Figures 1 to 6 As shown, an embodiment of the present invention provides a photovoltaic prediction method based on historical data, which is described by taking the application of the method to a terminal as an example, and includes the following steps:
[0046] S1: Obtain photovoltaic data, grid meteorological data, and site meteorological data.
[0047] Specifically, the gridded meteorological data include surface solar radiation, predicted albedo, two-meter temperature, relative humidity, atmospheric pressure and temperature.
[0048] S2: Input the grid meteorological data into the weather discriminator to obtain the weather feature sequence.
[0049] Specifically, the weather discriminator (WD) is used to determine the weather conditions at the time of the photovoltaic data. The operation process of the weather discriminator includes: obtaining multi-source meteorological grid data of the day, which includes six elements: surface solar radiation, predicted albedo, two-meter temperature, relative humidity, atmospheric pressure, and temperature, a total of two years of data, with a time resolution of one hour; pre-processing the multi-source grid data, and using a convolutional neural network (CNN) for feature extraction. The processed meteorological feature sequence is processed using a softmax function, and after the weather discrimination method, a weather feature sequence (length 115×1) is obtained.
[0050] Furthermore, the weather discrimination method is used for threshold discrimination. Specifically, the first 50 feature sequence data and the last 50 data are regarded as different weather features, and 15 buffer data are reserved in the middle. If the sum of the first 50 data is greater than the last 50 data, it is identified as the first weather category. At this time, the last 50 data are set to 0, and the first 50 data and the 15 buffer data in the middle are normalized to obtain the weather feature sequence (so that the feature sequence can be subsequently input into the bottom hidden layer of the pyramid wavelet feature prediction network). Similarly, if the sum of the last 50 data is greater than the first 50 data, it will be regarded as the second weather category and the same processing will be performed.
[0051] Furthermore, the feature extraction formula of the standard convolutional neural network is as follows:
[0052]
[0053] Among them, y represents the convolution output, σ represents the activation function, and K i represents the i-th convolution kernel, X i Represents the i-th channel of the input.
[0054] Furthermore, the formula for feature extraction of the standard convolutional neural network is optimized, and depthwise separable convolution and dilated convolution are introduced to optimize the existing standard convolutional neural network feature extraction formula. Depthwise separable convolution includes depthwise convolution and pointwise convolution. Depthwise convolution is to perform convolution operation on each input channel separately. The formula of depthwise convolution is as follows:
[0055]
[0056] Among them, y depthwise represents the output result of the deep convolution operation, σ represents the activation function, K represents the number of convolution kernels used in the deep convolution operation, k represents the index, and W k represents the kth depth convolution kernel, X k Represents the feature matrix of the k-th input channel.
[0057] Furthermore, point-by-point convolution is a 1×1 convolution operation on all input channels for linear combinations between channels. The formula for point-by-point convolution is as follows:
[0058]
[0059] Among them, y pointwise represents the output result of the point-by-point convolution operation, σ represents the activation function, d represents the number of output channels, and W 1×1 Represents a 1×1 convolution kernel for point-by-point convolution, which is used to perform linear combinations of channels on the output results of the depthwise convolution. depthwise Represents the output result of a depthwise convolution operation.
[0060] Furthermore, the dilated convolution is used to insert the dilated factor r into the standard convolution kernel to expand the receptive field. The calculation formula of the dilated convolution is as follows:
[0061]
[0062] Among them, y dilated represents the output of the dilated convolution, σ represents the activation function, d represents the number of output channels, and W i represents the i-th convolution kernel in the dilated convolution operation, represents the input features with a dilation factor r.
[0063] Furthermore, by combining the depthwise separable convolution and the dilated convolution, the formula for the optimized final convolution output is as follows:
[0064]
[0065] Among them, y represents the final convolution output after optimization, σ represents the activation function, and W 1×1represents a 1×1 convolution kernel for point-by-point convolution, K represents the number of convolution kernels used in the depthwise convolution operation, k represents the index, and W k represents the kth depth convolution kernel, represents the input features with a dilation factor r, and d represents the number of output channels.
[0066] Furthermore, reducing the amount of calculation through depthwise separable convolution can improve computing efficiency, expanding the receptive field through atrous convolution can improve the model's ability to extract multi-scale features, and combining the two optimization methods can improve the overall performance and prediction accuracy of the model.
[0067] S3: Input the photovoltaic data and weather feature sequence into the pyramid wavelet feature prediction network to obtain the grid photovoltaic prediction feature matrix.
[0068] Specifically, a photovoltaic data grid matrix is obtained, photovoltaic sequence data of a single grid point is extracted, and the photovoltaic sequence data is divided into twenty batches for processing.
[0069] Furthermore, each batch is a sequence of length 876×1.
[0070] Furthermore, the single-grid photovoltaic sequence is decomposed using a three-level DB4 wavelet to obtain the third-level wavelet decomposition approximate coefficients (length 115×1) and detail coefficients (length 115×1), as well as the second-level wavelet decomposition detail coefficients (length 224×1) and the first-level wavelet decomposition detail coefficients (length 441×1).
[0071] Furthermore, LSTM is used to directly predict the approximate coefficients of the three-level wavelet decomposition, and the predicted three-level wavelet decomposition approximate coefficients (length is 12×1) are output.
[0072] Furthermore, a single batch of photovoltaic sequences (length 876×1) is convolved with a convolution kernel size of 3 and a convolution step size of 2 to obtain a first-level downsampling feature (length 438×1). The first-level downsampling feature and the first-level wavelet decomposition detail coefficient are aligned, channel-wise spliced, and then channel-merged with a 1×1 convolution kernel to obtain a first-level downsampling layer, which is then convolved and down-sampled to obtain a second-level downsampling feature (length 220×1). Similarly, the second-level wavelet decomposition detail coefficient (length 224×1) and the second-level downsampling feature are operated in the same way to obtain a second-level downsampling layer (length 224×1). Similarly, a third-level downsampling layer (length 115×1) is obtained.
[0073] Furthermore, in the upsampling process, the three-level downsampling layer (length is 115×1) is first aligned with the weather feature sequence output by the weather discriminator (WD) and then fused and spliced, and then input into the LSTM for prediction to obtain the three-level wavelet decomposition detail coefficients (length is 12×1).
[0074] Furthermore, the three-level downsampling layer is further upsampled to obtain a two-level upsampling layer (length 224×1). At the same time, the two-level downsampling layer (length 224×1) and the two-level upsampling layer are channel-joined to obtain the two-level coefficients, which are input into the LSTM for prediction to obtain the predicted two-level wavelet decomposition detail coefficients (length 17×1). Similarly, the predicted first-level wavelet decomposition coefficients (length 27×1) are obtained.
[0075] Furthermore, the detailed coefficients of the three predicted levels and the approximate coefficients of the third level are reconstructed using the wavelet reconstruction function to obtain the final single-grid photovoltaic prediction sequence. The same operation is performed on each grid point to obtain the grid photovoltaic prediction feature matrix.
[0076] Furthermore, the operation steps of the pyramid feature back-calculation network include: performing a convolution operation on each batch of photovoltaic sequences to obtain a first-level downsampling feature; processing the photovoltaic sequences after wavelet decomposition, first inputting the third-level wavelet decomposition approximate coefficients separately into the LSTM for prediction, and then aligning the first-level downsampling features and the first-level wavelet decomposition detail coefficients, and obtaining a first-level downsampling layer through channel splicing operation, and further downsampling the first-level downsampling layer, and similarly, obtaining a second-level downsampling layer and a third-level downsampling layer.
[0077] Furthermore, the three-level downsampling layer is fused and spliced with the output of WD, and then input into the LSTM network to obtain the predicted three-level wavelet decomposition detail coefficients. The three-level downsampling layer is upsampled to obtain the second-level upsampling layer, and the second-level downsampling layer is channel-spliced with the 1×1 convolution kernel to obtain the second-level coefficients, which are input into the LSTM network to obtain the predicted second-level wavelet decomposition detail coefficients; the same steps are used for the first-level wavelet decomposition detail coefficients to obtain the predicted first-level wavelet decomposition detail coefficients.
[0078] Furthermore, the structure of the pyramidal wavelet feature prediction network includes:
[0079] In the input layer, the single-grid photovoltaic sequence is processed in batches, and each batch of sequences is used as the input of TSWFP-Net.
[0080] The wavelet decomposition layer performs three-level wavelet decomposition on the input sequence to obtain three-level wavelet decomposition approximate coefficients and detail coefficients, as well as second-level wavelet decomposition detail coefficients and first-level wavelet decomposition detail coefficients.
[0081] Pyramid feature back-calculation network: predicts the photovoltaic sequence after wavelet decomposition and outputs the predicted wavelet decomposition sequence.
[0082] In the wavelet reconstruction layer, the predicted detail coefficients of the three levels and the approximate coefficients of the third level are reconstructed using the wavelet reconstruction function to obtain the final single-grid photovoltaic prediction sequence.
[0083] At the output layer, the above operation is repeated for each grid point to obtain the grid point photovoltaic prediction feature matrix.
[0084] Furthermore, the input gate is used to control the extent to which new information is input into the cell state. The calculation formula of the input gate is as follows:
[0085] i t =σ(W xi *x t +W hi *h t-1 +b i )
[0086] Among them, i t Represents the output result of the input gate, W xi and W hi is a learnable weight matrix, which is used to control the input data x t and the previous state information h t-1 Contribution to the input gate, b i is a learnable bias term, and σ is a sigmoid function, which compresses the input to between 0 and 1 and is used to control the “openness” of the input gate.
[0087] Furthermore, the forget gate is used to control the extent to which old information is removed from the cell state. The calculation formula of the forget gate is as follows:
[0088] f t =σ(W xf *x t +W hf *h t-1 +b f )
[0089] Among them, f t represents the output of the forget gate, σ represents the sigmoid function, which is used to control the “openness” of the forget gate, W xf and W hf is a learnable weight matrix, which is used to control the input data xt and the state information h at the previous moment. t-1 Contribution to the forget gate, b f represents a learnable bias term.
[0090] Furthermore, the output gate is used to control the degree to which the information of the cell state is output to the network. The calculation formula of the output gate is as follows:
[0091] o t =σ(W xo *x t +W ho *h t-1 +b o )
[0092] Among them, t represents the output result of the output gate, σ represents the sigmoid function, which is used to control the "openness" of the output gate, and b o represents the learnable bias term, W xo and W ho is a learnable weight matrix, which is used to control the input data x t and the previous state information h t-1 Contribution to the output gate.
[0093] Furthermore, the cell state stores the information of the time series and is continuously updated and transmitted through the control of the gating unit. The calculation formula of the cell state is as follows:
[0094] C t =f t *C t-1 +i t *tanh(W xc *x t +W hc *h t-1 +b c )
[0095] Among them, C t represents the cell state at the current time step, f t Represents the output of the forget gate, C t-1 Indicates the cell state at the previous moment, i t Represents the output result of the input gate, W xc and W hc is a learnable weight matrix, which is used to control the input data x t and the previous state information h t-1 Contribution to cell state update, tanh is the hyperbolic tangent function, which is used to control the "strength" of cell state information, b c is a learnable bias term.
[0096] S4: Fuse the grid meteorological data with the station meteorological data to obtain the grid station data fusion feature matrix;
[0097] Specifically, the grid-site meteorological data fusion module (G-SMDFM) is used to fuse the grid meteorological data with the site meteorological data, including the following steps:
[0098] For the grid-dense meteorological data, the Convolutional Long Short-Term Memory (ConvLSTM) network is used to extract features and obtain a 48×61×49 grid feature map.
[0099] The sparse meteorological data of the site is processed using the graph convolutional network (GCN) to extract features, and a 48×61×49 site feature map is also obtained;
[0100] The grid feature map and the station feature map are combined to obtain the grid station data fusion feature matrix
[0101] The site data and grid data feature maps are spliced to form a 2×48×61×49 fusion feature matrix, and a 1×1 convolution kernel is used to merge channels to obtain a 48×61×49 grid site data fusion feature matrix.
[0102] Furthermore, the formula of the GCN adjacency matrix is as follows:
[0103] A=D -1 / 2 *(A+I)*D -1 / 2
[0104] Among them, A represents the normalized adjacency matrix, H represents the input feature matrix, W represents the convolution kernel weight matrix, and H′ represents the output feature matrix.
[0105] Furthermore, the formula for the GCN convolution operation is as follows:
[0106] H'=A*H*W
[0107] Among them, A represents the normalized adjacency matrix, H represents the input feature matrix, W represents the convolution kernel weight matrix, and H′ represents the output feature matrix.
[0108] Furthermore, this formula is improved by introducing the self-attention mechanism and the multi-head mechanism. The formula of the improved GCN convolution operation is as follows:
[0109] H′=softmax(A·H·W+Q·K T )·V
[0110] Q=H·W Q
[0111] K=H·W K
[0112] V=H·W V
[0113] Among them, A represents the normalized adjacency matrix, H represents the input feature matrix, W represents the convolution kernel weight matrix, H′ represents the output feature matrix, Q represents the query matrix, which is obtained by linear transformation; K represents the key matrix, which is obtained by linear transformation; V represents the value matrix, which is obtained by linear transformation, and softmax represents the normalization function.
[0114] Preferably, the self-attention mechanism can capture more complex feature relationships and improve the ability of feature extraction. The multi-head attention mechanism can focus on and fuse features from multiple angles and improve the effect of data fusion. By introducing self-attention and multi-head mechanisms, the overall prediction accuracy of the model can be improved.
[0115] S5: Combine the grid photovoltaic prediction feature matrix with the grid station data fusion feature matrix to obtain the three-dimensional grid prediction results.
[0116] The channel splicing method is used to integrate photovoltaic data and grid station meteorological data. The grid photovoltaic prediction feature matrix and the grid station meteorological data fusion feature matrix are combined into a dual channel, which is then merged into a single channel through 1×1 convolution to obtain the final three-dimensional grid prediction.
[0117] Example 2
[0118] Reference Figures 1 to 6 , which is a second embodiment of the present invention, provides a photovoltaic prediction system based on historical data, including:
[0119] For the specific definition of the photovoltaic prediction system based on historical data, please refer to the definition of the photovoltaic prediction method based on historical data above, which will not be repeated here. Each module in the above photovoltaic prediction system based on historical data can be implemented in whole or in part by software, hardware and a combination thereof. The above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0120] Example 3
[0121] Reference Figures 1 to 6, which is the third embodiment of the present invention, based on the first two embodiments, the embodiment of the present invention provides a computer device, which may be a server. The computer device includes a processor, a memory, and a network interface connected via a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium.
[0122] The database of the computer device is used to store action detection data. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, the steps in any of the above-mentioned sparse tensor operation acceleration method embodiments are implemented.
[0123] Those skilled in the art will understand that the structure is merely a block diagram of a portion of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied, or a combination of certain components, or a different arrangement of components.
[0124] In one embodiment, an embodiment of the present invention provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps in any of the above-mentioned sparse tensor operation acceleration method embodiments are implemented.
[0125] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0126] Example 4
[0127] As an embodiment of the present invention, a photovoltaic prediction method based on historical data is provided. In order to verify the beneficial effects of the present invention, a scientific demonstration is carried out through simulation experiments.
[0128] Specifically, two time periods (one time period is two days) were randomly selected for back-calculation and prediction. Due to the particularity of photovoltaic data, there is no data in the evening time period, so only the time points with data are intercepted as a new data set.
[0129] Figure 2 The photovoltaic curves for all the time points with data from 2014.04.18 to 2014.04.21 are shown in the figure. The photovoltaics in this period show periodic fluctuations, and there are also particularly high data. From the curve, we can see that the fitting performance of this model in the whole period is smoother than that of LSTM, without excessive errors. The LSTM model has larger fluctuations. Overall, the performance of this model is better.
[0130] Figure 3 The photovoltaic curves for all the time points with data from 2014.07.20 to 2014.07.23 are shown in the figure. As can be seen from the figure, the photovoltaic curves in this period also show periodic fluctuations, with high peaks and low points. In terms of performance in this period, this model is also smoother than the LSTM model, without large errors, and performs better overall.
[0131] In summary, it can be seen that the performance of this model on the data set is more stable and smoother than that of the LSTM model, and the LSTM model will show greater fluctuations.
[0132] 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 preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.
Claims
1. A photovoltaic prediction method based on historical data, characterized in that: include: Obtain photovoltaic data, grid meteorological data and site meteorological data; Inputting the grid meteorological data into a weather discriminator to obtain a weather feature sequence; Inputting the photovoltaic data and the weather characteristic sequence into a pyramid wavelet characteristic prediction network to obtain a grid photovoltaic prediction characteristic matrix; The grid point meteorological data is fused with the station meteorological data to obtain a grid station data fusion feature matrix; The grid photovoltaic prediction feature matrix is combined with the grid station data fusion feature matrix to obtain a three-dimensional grid prediction result.
2. The photovoltaic prediction method based on historical data according to claim 1, characterized in that: The gridded meteorological data include surface solar radiation, predicted albedo, two-meter temperature, relative humidity, atmospheric pressure and temperature.
3. The photovoltaic prediction method based on historical data according to claim 1, characterized in that: The grid point photovoltaic prediction characteristic matrix obtained includes: Extract single-grid photovoltaic series data from photovoltaic data; The single-grid photovoltaic sequence data is decomposed using three-level DB4 wavelet to obtain the three-level wavelet decomposition approximate coefficients and detail coefficients, the second-level wavelet decomposition detail coefficients and the first-level wavelet decomposition detail coefficients; Use LSTM to predict the approximate coefficients of the three-level wavelet decomposition, and output the predicted approximate coefficients of the three-level wavelet decomposition; A convolution operation is performed on a single batch of photovoltaic sequences. During the convolution operation, the bottom downsampling layer is aligned with the weather feature sequence output by the weather discriminator, and then fused and spliced. The LSTM is input for prediction to obtain three detail coefficients and one approximate coefficient. Use wavelet reconstruction function to reconstruct and obtain single grid photovoltaic prediction sequence; Repeat the above operation for each grid point to obtain the grid point photovoltaic prediction feature matrix.
4. The photovoltaic prediction method based on historical data according to claim 3, characterized in that: The use process of the weather discriminator includes: Acquire multi-source meteorological grid point data and pre-process the multi-source meteorological grid point data; Use convolutional neural network to extract features and obtain meteorological feature sequences; The preprocessed meteorological feature sequence is processed using the softmax function, and after the weather discrimination method, the weather feature sequence is obtained; The weather feature sequence is input into the bottom hidden layer of the pyramidal wavelet feature prediction network.
5. The photovoltaic prediction method based on historical data according to claim 4, characterized in that: The formula of the convolution operation is optimized by introducing depthwise separable convolution and dilated convolution. Depthwise separable convolution includes depthwise convolution and pointwise convolution. The formula for depthwise convolution is as follows: Among them, y depthwise represents the output result of the deep convolution operation, σ represents the activation function, K represents the number of convolution kernels used in the deep convolution operation, k represents the index, and W k represents the kth depth convolution kernel, X k Represents the feature matrix of the kth input channel; The formula for point-by-point convolution is as follows: Among them, y pointwise represents the output result of the point-by-point convolution operation, σ represents the activation function, d represents the number of output channels, and W 1×1 Represents a 1×1 convolution kernel for point-by-point convolution, which is used to perform linear combinations of channels on the output results of the depthwise convolution. depthwise Represents the output result of the depth convolution operation; The calculation formula of the dilated convolution is as follows: Among them, y dilated represents the output of the dilated convolution, σ represents the activation function, d represents the number of output channels, and W i represents the i-th convolution kernel in the dilated convolution operation, represents the input features with a hole factor r; Combining the depthwise separable convolution and the dilated convolution, the formula for the optimized final convolution output is as follows: Among them, y represents the final convolution output after optimization, σ represents the activation function, and W 1×1 represents a 1×1 convolution kernel for point-by-point convolution, K represents the number of convolution kernels used in the depthwise convolution operation, k represents the index, and W k represents the kth depth convolution kernel, represents the input features with a dilation factor r, and d represents the number of output channels.
6. The photovoltaic prediction method based on historical data according to claim 5, characterized in that: The grid meteorological data is fused with the station meteorological data to obtain a grid station data fusion feature matrix including: After processing the grid meteorological data, feature extraction is performed to obtain a grid feature map; After processing the meteorological data of the station, the graph neural convolution network is used to extract features to obtain the station feature map; The grid feature map is combined with the site feature map to obtain the grid site data fusion feature matrix.
7. The photovoltaic prediction method based on historical data according to claim 6, characterized in that: The formula of the graph neural convolutional network adjacency matrix is as follows: A=D -1 / 2 *(A+I)*D -1 / 2 Among them, A represents the normalized adjacency matrix, H represents the input feature matrix, W represents the convolution kernel weight matrix, and H′ represents the output feature matrix; The formula for the improved GCN convolution operation is as follows: H′=softmax(A·H·W+Q·K T )·V Q=H·W Q K=H·W K V=H·W V Among them, A represents the normalized adjacency matrix, H represents the input feature matrix, W represents the convolution kernel weight matrix, H′ represents the output feature matrix, Q represents the query matrix, which is obtained by linear transformation; K represents the key matrix, which is obtained by linear transformation; V represents the value matrix, which is obtained by linear transformation, and softmax represents the normalization function.
8. A system using the photovoltaic prediction method based on historical data as claimed in any one of claims 1 to 7, characterized in that: include: Data acquisition module, used to obtain photovoltaic data, grid meteorological data and site meteorological data; A discriminant module, used for inputting the grid meteorological data into a weather discriminator to obtain a weather feature sequence; A first matrix calculation module is used to input the photovoltaic data and the weather characteristic sequence into a pyramid wavelet characteristic prediction network to obtain a grid photovoltaic prediction characteristic matrix; A second matrix calculation module is used to fuse the grid point meteorological data with the station meteorological data to obtain a grid station data fusion feature matrix; The prediction module is used to combine the grid photovoltaic prediction feature matrix with the grid station data fusion feature matrix to obtain a three-dimensional grid prediction result.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the photovoltaic prediction method based on historical data according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the photovoltaic prediction method based on historical data described in any one of claims 1 to 7 are implemented.
