## 2 Related Work  
Previously, statistical models such as autoregressive model (AR) [13], moving average model (MA) [14], and autoregressive moving average [15] and its variant ARIMA [16] have been widely used for time series prediction. However, these models cannot describe the nonlinear changes in time series. In order to solve this problem, researchers have resorted to some nonlinear models such as the kernel method [17], Gaussian process [18] and hidden Markov model [19], support vector machines [20], and least squares support vector machine [21] which have the ability to adapt to complex time series. Experiments show that they achieve good efficiency and prediction accuracy in short-term prediction. With the rapid development of deep learning, CNN [22], RNN [23; 24] and its variants, including long short-term memory (LSTM) [4] and gate recurrent unit (GRU) [25], have attracted significant attention and become popular methods for time series modeling. For example, [PERSON] et al. [26] proposed a dual-stage attention-based recurrent neural network (DA-RNN), which contains an encoder and a decoder. The former with an input attention mechanism adaptively extracts the input features of each time step, and the latter with a temporal attention mechanism selects the relevant hidden states of the encoder among all the time steps in different stages. In recent years, the transformer architecture [27] has achieved great success in time series prediction. It completely relies on the self-attention mechanism for time series modeling, and has been reported to achieve promising results. The self-attention mechanism has been widely used in time series prediction. For example, the continuous failure of high-voltage transmission lines increases the instability of the lines and presents various degrees of hidden security risks, which increase the load of the linesand the cost of repairing the lines. In response to the above problems, [PERSON] et al. [28] proposed a self-attention convolutional neural network model (SAT-CNN) which is based on time series imaging for feature extraction and combined self-attention mechanism with CNN to make the model more accurately identify specific types of failures for precise classification. Finally, the effectiveness of the proposed SAT-CNN model is tested with the number of combined input voltage, current, and voltage-current signals at different sampling frequencies. [PERSON] et al. [29] applied the self-attention mechanism to the agricultural field and proposed a bidirectional self-attention encoder-decoder framework (BEDA). Firstly, the wavelet threshold filter and preprocessing are used to denoise the time series, and then the bidirectional long short-term memory network is used to extract the features of the time series. Then the multi-attentional mechanism is introduced into the encoder-decoder framework. Finally, the indoor environmental factors (temperature, humidity, and CO\({}_{2}\)) are accurately predicted to provide good conditions for crop planting and growth. Experiments show that the framework has good robustness and generalization ability. With the development of modern intelligent transportation systems (ITSs), effectively obtaining the potential spatial pattern and time dynamic traffic flow prediction has become an urgent problem to be solved. [PERSON] et al. [30] proposed a novel spatial-temporal graph self-attentive model (STGSA). The model learns the spatial embedding of the graph through a graph self-attention layer with Gumbel-Softmax technique, and obtains the temporal embedding using an RNN combined with a gated recurrent unit. The effectiveness of the method was demonstrated by experiments on the traffic flow dataset in Langfang, China, in 2014. [PERSON] et al. [31] carried out an in-depth study on the time series prediction of adversarial attack and proposed an adversarial sample generation algorithm based on perturbation. Specifically, the performance of a time series prediction model can be reduced by adding malicious disturbance to time series.