To address the complexity and dynamic nature of vehicle trajectory anomaly detection in intelligent transportation systems, a novel method named DSTGRU (Dynamic Spatio-Temporal Gated Recurrent Unit) was proposed on the basis of Multi-level Spatio-Temporal Interaction dependency Dynamic Graph (MSTIDG). In DSTGRU, by constructing dynamic graphs for short-term and long-term spatio-temporal interaction dependencies, the complex interactions between vehicles were captured effectively. In this process, the Multi-level Spatio-temporal interaction feature Fusion Bidirectional Gate Recurrent Unit (MSF-BiGRU) module was introduced to fuse multi-level spatio-temporal features, so as to integrate spatio-temporal information at different scales, thereby alleviating conflicts in shared information extraction and enhancing the model’s robustness, which improved the ability to identify anomalous trajectories. Experimental results demonstrate that DSTGRU outperforms the existing methods significantly on the TrackRisk and HighD datasets, achieving Pre@100 of 0.90 and 0.89, respectively, and AUROC of 0.913 and 0.827, respectively. Compared to existing advanced methods, DiffTAD and ImDiffusion, DSTGRU ranks first in multiple evaluation metrics. Additionally, DSTGRU exhibits strong robustness in complex scenarios, and identifies anomalous behaviors accurately, providing a solution for trajectory anomaly detection in intelligent transportation systems.