In the context of rapid advancements in electric vehicle (EV) technology, the safety and reliability of lithium-ion (Li) batteries,as the core power source, have garnered significant attention. The non-stationarity and complex dynamics of battery data posemajor challenges in the field of battery state monitoring, making it difficult for existing monitoring and prediction methods toaccurately address the variability of real-world environments. To address these issues, we propose a Transformer model based ona wavelet transform dynamic attention mechanism (WADT), capable of effectively handling the non-stationarity of battery dataand capturing its complex dynamic changes. The dynamic attention mechanism, grounded in wavelet transform, can adaptivelyfocus on the most informative parts of the battery data, thereby enhancing the accuracy of anomaly detection. Building on thismechanism, we further developed a deep learning model that incorporates an improved Transformer architecture, specificallydesigned to handle the complex dynamics of time series data. This model not only considers the temporal dependencies of batterydata but also adapts to its non-stationary behavior, achieving more accurate and reliable anomaly detection. Experimental resultson public battery datasets have demonstrated the effectiveness of our proposed approach. Compared to existing technologies, ourmodel has achieved significant improvements in several key performance indicators, including but not limited to accuracy, AUCscore. These results not only validate the innovation and effectiveness of our method but also showcase its potential applicationin the field of battery anomaly detection.