The realization of abnormal detection and pattern discovery of electromagnetic data is of great value to the judgment and early warning of abnormal behaviors of electromagnetic targets. Different types of electromagnetic data usually exist in the form of time series, with the characteristic of imbalance between normal data and abnormal data. To address these issues,a time series anomaly detection method is proposed based on the spatial-temporal joint attention mechanism. The channel attention mechanism and spatial attention mechanism are combined to enhance the feature representation of the abnormal part of time series data. Experimental results show that the proposed detection algorithm can effectively deal with the difficulty of data imbalance and has strong robustness.