## 1 Introduction
Additionally, the model encourages orthogonality between the hyper-sphere centers and optimizes representation learning through the introduction of a self-supervised task in the temporal domain. [PERSON] et al. [18] developed an unsupervised multivariate anomaly detection method based on Generative Adversarial Networks (GANs), using Long Short-Term Memory Networks (LSTM-RNNs) as both the generator and discriminator to capture temporal correlations in time-series data. This method considers the entire set of variables to capture latent interactions between variables, detecting anomalies using a newly defined DR score that combines reconstruction errors and discrimination results. [PERSON] et al. [19] proposed a network attack detection framework specifically designed for photovoltaic power stations. By thoroughly analyzing the frequency and temporal features in historical data, the framework significantly improved detection accuracy and model robustness. [PERSON] et al. [20] introduced an integrated method combining the strengths of LSTM and Convolutional Neural Networks (CNNs), effectively capturing temporal dependencies and performing well in time-series analysis. Additionally, transfer learning, as an effective means of reducing the demand for labeled data, has been applied in attack detection for PV systems. [PERSON] et al. [21] proposed a transfer learning method that transfers knowledge learned in one domain to another domain with scarce data, greatly enhancing training efficiency and practical applicability. [PERSON] et al. [22] introduced a Dynamic Spatio-Temporal Graph Neural Network (DST-GNN), which combines Graph Neural Networks (GNNs) with a dynamically weighted adjacency matrix to capture spatial correlations in signal data, while using a one-dimensional Convolutional Neural Network (1D-CNN) to extract temporal patterns. This method dynamically determines the number of graph convolution layers based on system dynamics and adjusts the hyperparameters of the 1D-CNN according to the periodicity of the input signals. In the smart grid domain, [PERSON] et al. [23] developed a denial-of-service (DoS) attack detection model based on Support Vector Machines (SVMs). The model first collects network data and performs feature selection, followed by Principal Component Analysis (PCA) for dimensionality reduction, and finally detects anomalies using the SVM algorithm, validating the effectiveness of the dimensionality reduction process. [PERSON] et al. [24] explored the potential of multi-layer autoencoders (AEs) in anomaly detection, where an AE effectively identifies network attack behaviors by comparing differences between the input and decoded output. These research findings provide critical support for the security of photovoltaic microgrids, advancing data-driven network attack detection technologies, making them more precise, efficient, and adaptive. This study explores the application of Transformer models in unsupervised time-series anomaly detection. Transformer models have garnered widespread attention due to their significant advancements in fields such as natural language processing, computer vision,and time-series analysis. Their core advantage lies in their ability to efficiently integrate global information and long-range dependencies. By utilizing the self-attention mechanism of Transformers, we reveal the intricate correlation structures between different time points in time-series data. These correlation structures are reflected in the weight distribution of the self-attention graph, which deeply characterizes the dynamic patterns of time series, including periodicity and trends. It is worth noting that existing Transformer-based models primarily focus on modeling temporal dependencies, often overlooking dependencies between different variables. However, such dependencies are crucial for multivariate time-series anomaly detection. To address this gap, we re-examine the self-attention mechanism from a novel perspective and propose variable attention to capture dependencies between different variables.