计算机工程与应用 ›› 2026, Vol. 62 ›› Issue (8): 380-391.DOI: 10.3778/j.issn.1002-8331.2502-0194

• 工程与应用 • 上一篇    下一篇

关键节点感知与时空自适应的Transformer交通流预测方法

李卫军1,2,熊章友1+,杨国梁1,朱晓娟1,马馨瑜1   

  1. 1.北方民族大学 计算机科学与工程学院,银川 750021
    2.北方民族大学 图形图像智能处理国家民委重点实验室,银川 750021
    + 通信作者 E-mail:1436333610@qq.com
  • 收稿日期:2025-02-26 修回日期:2025-05-20 在线发布日期:2026-04-15 出版日期:2026-04-15
  • 基金资助:
    宁夏高等学校科学研究项目(NYG2024086);北方民族大学研究生创新项目(YCX24363)。

Transformer Traffic Flow Prediction Method Based on Key Node Perception and Spatial-Temporal Adaptation

LI Weijun1,2, XIONG Zhangyou1+, YANG Guoliang1, ZHU Xiaojuan1, MA Xinyu1   

  1. 1.School of Computer Science and Engineering, North Minzu University, Yinchuan 750021, China
    2.Key Laboratory of Images & Graphics Intelligent Processing of State Ethnic Affairs Commission, North Minzu University, Yinchuan 750021, China
    + Corresponding author E-mail:1436333610@qq.com
  • Received:2025-02-26 Revised:2025-05-20 Online:2026-04-15 Published:2026-04-15

摘要: 交通流数据本身具有明显的时空特性,不仅与时间和位置密切相关,还与道路网络的空间结构息息相关。目前的研究方法通常依赖于复杂的神经网络来捕捉交通流的时空相关性,但往往未能深入挖掘交通流数据的内在属性。此外,现有方法对于嵌入层的数据处理和交通流的时空特征也缺乏充分的探讨。为了解决这些问题,提出了一种名为KASTFormer的模型。该模型通过关键节点感知空间自注意力机制,有效地捕捉交通流枢纽道路的特征,并结合时间、语义和地理自注意力机制,进一步加强了短期和长期时空依赖的建模。同时,设计了一种时空自适应嵌入方法,通过统一建模时空关系捕捉交通流数据及其时空特征。通过在三个数据集上的实验验证了模型的有效性,并通过消融实验和模型结构性能分析进一步证明了其实际效果。

关键词: 关键节点感知, 时空自适应, 注意力机制, 交通预测, 时空特征

Abstract: Traffic flow data itself has obvious spatial-temporal characteristics, which are closely related to not only time and location, but also the spatial structure of the road network. Current research methods usually rely on complex neural networks to capture the spatial-temporal correlation of traffic flow, but often fail to deeply mine the intrinsic properties of traffic flow data. In addition, the existing methods lack sufficient discussion on the data processing of the embedding layer and the spatial-temporal characteristics of traffic flow. To address these issues, a model called KASTFormer is proposed. The model effectively captures the characteristics of traffic flow hub roads through the spatial self-attention mechanism sensed by key nodes, and further strengthens the modeling of short-term and long-term spatial-temporal dependencies by combining temporal, semantic and geographic self-attention mechanisms. At the same time, a spatial-temporal adaptive embedding method is designed to capture the traffic flow data and its spatial-temporal characteristics through a unified modeling spatial-temporal relationship. Finally, the effectiveness of the model is verified by experiments on three data sets, and the practical effect is further proved by ablation experiments and model structure performance analysis.

Key words: key-node awareness, spatial-temporal adaptation, attention mechanism, traffic prediction, spatial-temporal features