## 3 Materials and Methods
### Conv-LSTM  
In this paper, the Conv-LSTM module [33] serves as the main component of our proposed model, aiming to extract spatiotemporal features from PV power generation data. This module is a fusion of a convolutional neural network (CNN) and an LSTM network, as depicted in Figure 5. The CNN part comprises two convolutional layers, while the LSTM part consists of two LSTM layers.  
Figure 4: The LSTM neuron structure.  
The Conv-LSTM model combines the respective strengths of CNN and LSTM, allowing it to effectively handle spatiotemporal sequence data, extract multi-layer features, model long-term dependencies, and capture spatial relationships. As a result of these advantages, the Conv-LSTM model demonstrates superior performance in various tasks, including image prediction, video analysis, PV power forecasting, and traffic flow prediction.  
The Conv-LSTM module receives as input a spatiotemporal matrix, denoted \(X_{t}^{s}\), as elucidated in Equation (1). This matrix embodies the historical PV power at the forecast target location and its proximate areas. The extraction of spatial features is facilitated through the execution of a one-dimensional convolution operation across the flow data \(X_{t}^{s}\) at each time step t. A one-dimensional convolution kernel filter maneuvers across the data, capturing the local perceptual domain. The operational mechanism of the convolution kernel filter can be expressed mathematically as:  
\[Y_{t}^{s}=\sigma(W_{s}*X_{t}^{s}+b_{s}) \tag{13}\]  
In this expression, \(W_{s}\) represents the filter's weights, \(b_{s}\) signifies the bias, \(X_{t}^{s}\) indicates the PV power input at  
Figure 6 illustrates how the attention mechanism is applied to the Conv-LSTM module. As shown in Figure 6, the output of the Conv-LSTM at each time step t is computed as the weighted sum of the LSTM network output \(\rm H_{t}^{s}\). The specific calculation is as follows:  
\[\rm H_{t}^{a}=\sum_{k=1}^{n+1}\beta_{k}H_{t-(k-1)}^{s} \tag{17}\]  
where \(\rm n+1\) is the sequence length, and \(\beta_{k}\) represents the attention value at time \(\rm t-(k-1)\). The attention \(\beta_{k}\) can be calculated as follows:  
\[\rm\beta_{k}=\frac{exp(s_{k})}{\sum_{k=1}^{n+1}s_{k}} \tag{18}\]  
The vector \(\bf s=(s_{1},s_{2},\cdots,s_{1,})^{T}\) represents the importance of each component in the power time series and can be obtained as follows:  
\[\rm s_{t}=V_{s}^{T}tanh(W_{hs}G_{t}^{s}+W_{ls}H_{t}^{s}) \tag{19}\]  
where \(\rm V_{s}^{T}\), \(\rm W_{ss}\), and \(W_{hs}\) are learnable parameters, and \(\rm H_{t}^{s}\) represents the hidden output from the Conv-LSTM network.  
From Equations (18) and (19), it can be observed that the attention value \(\beta\) at time t depends on the current time step t and its previous n time steps of inputs \(\rm G_{t}^{s}\) and hidden variables \(\rm H_{t}^{s}\). The attention value \(\beta\) can also be seen as the activation of the power selection gate, where a set of gates controls the amount of information flowing into the LSTM network at each time step. A higher activation value indicates that the power's contribution to the final prediction result is more significant.