Published 2025-09-30
How to Cite

This work is licensed under a Creative Commons Attribution 4.0 International License.
Abstract
This paper proposes an anomaly detection algorithm based on an improved Transformer architecture to address the limitations in modeling complex behavioral dependencies and capturing asynchronous service anomalies in microservice systems. The method integrates graph structure awareness and multi-scale behavior modeling. A structure-guided attention module is introduced to enhance the accuracy of modeling topological dependencies in service invocation graphs. In addition,multi-scale convolution and residual paths are used to build a hybrid representation space for short-term and long-term service behaviors, improving the model's sensitivity to sparse and burst anomalies. The overall architecture consists of a graph representation learning layer, a multi-head global attention layer, and a structure-level fine-tuning module, enabling layered feature abstraction and anomaly distribution representation. Experiments are conducted on real-world microservice datasets. Results show that the proposed method outperforms mainstream baseline models in F1-score, AUROC, and AUPR, confirming its applicability, stability, and detection accuracy in complex microservice environments. The proposed framework demonstrates strong robustness, scalability, and structural generalization, offering an effective modeling paradigm for anomaly perception tasks in high-dimensional and heterogeneous microservice systems.