A spatiotemporal passenger flow prediction framework under the influence of an emergency
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-14
- Publication Date
- 2026-08-11
AI Technical Summary
[0003]结合图1所示的地铁站点实测客流曲线可见,突发事件发生时段内,直接受影响的TL站与间接受影响的邻接CG站出站客流量均显著超出正常客流波动范围,且不同位置站点受事件冲击的幅度与时空传导规律存在明显异质性;针对该类真实突发场景,MTDGAT存在两处核心技术缺陷:其一,该技术依赖SEs编码显式注入预先标注的已知特殊事件信息,面对无标记的未知突发场景时,无法精准识别并学习客流重分布的异常演化机制,难以充分捕捉突发场景下路网时空关联关系的突变特性,导致模型在真实突发场景中的泛化性与鲁棒性受到明显限制;其二,该技术未考量突发事件下非常态客流样本极度稀缺的客观问题,数据驱动的模型更倾向于拟合出现频率更高的常态客流样本,易将突发场景下的非常态样本视作噪声或直接平滑处理,造成预测结果偏离真实客流分布,严重制约模型从有限样本中学习有效异常表征的能力
1、通过将动量对比约束耦合至生成式架构,在保证生成样本符合地铁路网时空拓扑逻辑的前提下,强制拉大其与常态客流在特征空间的分布距离,避免生成样本退化回占比更高的常态模式,能够批量产出具备真实异常属性的增强客流样本。扩充后的均衡样本池可有效避免模型将突发客流异常当作噪声平滑处理,强化模型对非常态客流特征的感知与学习能力,从数据基础层面提升预测模型在突发场景下的鲁棒性。
Smart Images

Figure CN122549679A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of traffic forecasting technology, and in particular to a spatiotemporal passenger flow forecasting framework for the impact of emergencies. Background Technology
[0002] In existing technologies, traffic flow prediction mainly adopts deep learning-based analysis methods. Among them, the representative MTDGAT technology is a short-term traffic prediction scheme based on multi-timescale dynamic graph attention. It models the normal dependence of traffic flow and the sudden change pattern induced by special events in the spatial and temporal dimensions, respectively. It enhances the representation ability of abnormal fluctuations under sudden events by using SEs event encoding. At the same time, it uses multi-scale spatiotemporal graphs to capture the heterogeneous features of different road segments and different time periods affected by events. Finally, it realizes traffic flow prediction under known special event scenarios by converting historical multi-scale spatiotemporal graphs to future multi-scale spatiotemporal graphs.
[0003] Combination Figure 1 As shown in the measured passenger flow curves of the subway stations, during the period of the emergency, the passenger flow at both the directly affected TL station and the indirectly affected adjacent CG station significantly exceeded the normal passenger flow fluctuation range. Furthermore, the magnitude of the impact and the spatiotemporal transmission patterns at different stations exhibited significant heterogeneity. For this type of real-world emergency scenario, MTDGAT has two core technical shortcomings: First, this technology relies on SEs encoding to explicitly inject pre-labeled known special event information. When faced with unlabeled, unknown emergency scenarios, it cannot accurately identify and learn the abnormal evolution mechanism of passenger flow redistribution, and it is difficult to fully capture the abrupt changes in the spatiotemporal correlation of the road network under emergency scenarios, resulting in a significant limitation on the model's generalization and robustness in real-world emergency scenarios. Second, this technology does not consider the objective problem of the extreme scarcity of abnormal passenger flow samples under emergency events. Data-driven models tend to fit more frequently occurring normal passenger flow samples, easily treating abnormal samples under emergency scenarios as noise or directly smoothing them, causing the prediction results to deviate from the actual passenger flow distribution, severely restricting the model's ability to learn effective abnormal representations from limited samples. Summary of the Invention
[0004] The purpose of this invention is to provide a framework for predicting spatiotemporal passenger flow under the influence of emergencies, thereby solving the aforementioned technical problems.
[0005] To achieve the above objectives, the present invention provides a spatiotemporal passenger flow prediction framework for the impact of emergencies, comprising: a data augmentation module, a DTW selector module, and a feature extraction module; The input of the data augmentation module is connected to a normal passenger flow sample, and the output is connected to the input of the DTW selector module. It is used to generate candidate passenger flow samples with abnormal distribution attributes based on generative reconstruction and momentum comparison constraints. The input of the DTW selector module is also connected to normal passenger flow samples and real abnormal passenger flow samples, and the output is connected to the input of the feature extraction module. It is used to filter out high-quality enhanced passenger flow samples and splice them to generate the current input signal sequence. The input of the feature extraction module is also connected to the historical average signal sequence and the subway network adjacency matrix, which are used to output the spatiotemporal passenger flow prediction results under sudden events through prototype feature matching and differential adaptive fusion mechanism.
[0006] Preferably, the data augmentation module has a built-in encoder. The input of the encoder is connected to a normal passenger flow sample, and the output is connected to the input of the diffusion layer. The encoder is composed of alternating stacks of temporally gated convolutional networks and graph convolutional networks, used to decouple and extract the temporal dynamic dependence and spatial topological dependence features of the passenger flow data, and output the aggregated spatiotemporal features. The formula for calculating the spatiotemporal feature aggregation is as follows: ; in, For the first The layer's passenger flow is embedded in the representation. , , , For learnable parameters, The number of stacked layers in the network. The spatiotemporal features of the aggregated output.
[0007] Preferably, the data augmentation module further includes a diffusion layer. The input of the diffusion layer is connected to the output of the encoder, and the output is connected to the input of the decoder. The diffusion layer consists of two fully connected layers with independent parameters. The diffusion layer is used to map spatiotemporal features to a probabilistic latent space and inject random perturbations to simulate the sudden changes in passenger flow caused by sudden events, and outputs a perturbed latent variable. The formula for reparameterization calculation is: ; in, The mean of the latent distribution, For the potential distribution variance, For sampling noise that follows a standard normal distribution, This is an element-wise multiplication operation. These are the potential variables for the output.
[0008] Preferably, the data augmentation module further includes a decoder; the input of the decoder is connected to the output of the diffusion layer, and the output is connected to the input of the DTW selector module and the input of the momentum contrast learning unit, respectively. The decoder adopts a multi-head self-attention architecture; it is used to reconstruct the perturbed latent variables into candidate passenger flow samples that conform to the spatiotemporal propagation logic of passenger flow.
[0009] Preferably, the data augmentation module further includes a momentum contrastive learning unit. The input of this unit is connected to both normal passenger flow samples and candidate passenger flow samples output by the decoder. The output is fed back to the parameter update terminals of the encoder, diffusion layer, and decoder. The momentum contrastive learning unit comprises two parallel branches: a main encoder and a momentum encoder. This is used to constrain the feature distribution of the generated samples, preventing them from degenerating back to the normal mode where data volume dominates. The contrastive loss calculation formula is: ; in, For query representation, Characterized by positive sample bonds. The set of negative sample key representations. For temperature coefficient, This represents the total number of negative samples.
[0010] Preferably, the DTW selector module has a built-in average spatiotemporal regularization distance calculation unit and a hybrid scoring and sorting unit; The average spatiotemporal regularization distance calculation unit is connected to candidate passenger flow samples, normal passenger flow samples, and real abnormal passenger flow samples at its input end, and to the input end of the hybrid scoring and ranking unit at its output end; it is used to calculate the dynamic time regularization distance between samples and quantify the morphological differences of passenger flow sequences. The hybrid scoring and sorting unit is used to construct a hybrid scoring function to screen high-quality samples, output enhanced passenger flow samples, and splice them together to generate the current input signal sequence; The mixed scoring function is: ; in, The average spatiotemporal regularization distance, As a balance factor, As a sample of normal passenger flow, This is a sample of real, abnormal passenger flow. This is a sample of candidate passenger flow.
[0011] Preferably, the feature extraction module includes an embedding layer unit. The input of the embedding layer unit is connected to the current input signal sequence and the historical average signal sequence, and the output is connected to the input of the prototype attention unit. The embedding layer unit is composed of four concatenations: feature embedding, node embedding, intraday time embedding, and intraweek time embedding. It is used to map the original passenger flow data to a high-dimensional feature space and fuse multi-dimensional prior information to output the corresponding embedding representation. The embedding calculation formula is: ; ; in, The feature vectors are concatenated for the embedding layer; It is a fully connected layer. Embedded for nodes, Embedded for intraday time, Embedded for weekday times, For splicing operations, , For learnable parameters, This is the embedded representation of the output.
[0012] Preferably, the feature extraction module is further provided with a prototype attention unit. The input end of the prototype attention unit is connected to the output end of the embedding layer unit, and the output end is connected to the input end of the differential gating unit. The prototype attention unit has a built-in learnable prototype matrix, which is used to retrieve typical spatiotemporal patterns from the input representation, extract the corresponding passenger flow distribution features, and output the current distribution features and historical baseline distribution features respectively. The formula for calculating prototype attention is: ; ; in, These correspond to current and historical inputs, respectively. For query vector, For learnable prototype matrices, For feature dimension, This is the similarity weight matrix. This represents the distribution characteristics of the output.
[0013] Preferably, the feature extraction module further includes a differential gating unit. The input of the differential gating unit is connected to the output of the prototype attention unit, and the output outputs the final spatiotemporal passenger flow prediction result. The differential gating unit includes a dual attention subunit, a differential calculation subunit, and a gating fusion subunit; it is used to adaptively fuse current real-time features and historical baseline features according to the degree of passenger flow deviation from the norm; the dynamic weight coefficient calculation formula is: ; in, It is the Sigmoid activation function. , For learnable parameters, For difference signals, These are dynamic weighting coefficients.
[0014] Preferably, a method for predicting spatiotemporal passenger flow under the influence of emergencies includes the following steps: S1. Based on normal passenger flow samples, multi-layer spatiotemporal feature extraction and residual aggregation are performed by an encoder consisting of alternating stacks of temporally gated convolutional networks and graph convolutional networks to obtain aggregated spatiotemporal features; Based on the spatiotemporal characteristics of aggregation, the mean and variance of the latent probability distribution are inferred through a diffusion layer composed of two fully connected layers. Gaussian noise is injected using the reparameterization technique to obtain the perturbed latent variables. Based on latent variables, spatiotemporal consistency reconstruction is performed using a multi-head self-attention decoder to obtain initial candidate passenger flow samples; Based on the initial candidate passenger flow samples and normal passenger flow samples, the contrastive loss is calculated through the momentum contrastive learning mechanism that includes the master encoder and the momentum encoder. The feature distribution of the generated samples is constrained to avoid degenerate back to the normal mode, and finally candidate passenger flow samples with abnormal distribution attributes are obtained. S2. Based on candidate passenger flow samples, normal passenger flow samples and real abnormal passenger flow samples, the dynamic time regularization distance is calculated station by station and feature by the average spatiotemporal regularization distance calculation unit to obtain the morphological difference measurement results of passenger flow sequences between samples. Based on the morphological difference measurement results, a hybrid scoring function is constructed through a hybrid scoring and ranking unit, and the top-k high-scoring passenger flow samples are selected as high-quality enhanced passenger flow samples. S3. Based on the normal passenger flow samples, the real abnormal passenger flow samples and the enhanced passenger flow samples, the current input signal sequence is obtained by splicing them together through feature dimensions; S4. Based on the current input signal sequence and the historical average signal sequence, feature embedding, node embedding, intraday time embedding and intraweek time embedding are fused through the embedding layer unit, and after linear transformation, the current input representation and the historical benchmark representation are obtained respectively. S5. Based on the current input representation and the historical baseline representation, dot product attention matching and prototype weighted aggregation are performed through the prototype attention unit with built-in learnable prototype matrix to extract the current distribution features and the historical baseline distribution features respectively. S6. Based on the current distribution characteristics and historical baseline distribution characteristics, deep representations are extracted and difference signals are calculated through the dual attention structure of the differential gating unit. After generating dynamic weight coefficients, the two types of features are adaptively weighted and fused. After being output through the fully connected layer, the spatiotemporal passenger flow prediction results under sudden events are obtained.
[0015] Therefore, the present invention adopts the above-mentioned spatiotemporal passenger flow prediction framework under the influence of emergencies, which has the following beneficial effects: 1. By coupling momentum contrast constraints to the generative architecture, while ensuring that the generated samples conform to the spatiotemporal topology of the subway network, the distribution distance between the generated samples and normal passenger flow in the feature space is forcibly increased. This prevents the generated samples from degenerating back into the more prevalent normal pattern, enabling the batch production of enhanced passenger flow samples with genuine anomaly attributes. The expanded balanced sample pool effectively prevents the model from treating sudden passenger flow anomalies as noise smoothing, strengthening the model's ability to perceive and learn abnormal passenger flow characteristics, and improving the robustness of the prediction model in sudden scenarios from the data foundation level.
[0016] 2. Leveraging the flexible alignment capability of dynamic time warping with spatiotemporal sequence patterns, a hybrid evaluation standard is constructed from two dimensions: "abnormality deviating from the normal distribution" and "evolutionary consistency closely resembling real anomalies." This standard can accurately filter out physically meaningless random noise samples and weakly biased samples with insufficient anomalous features. The selected high-quality enhanced passenger flow samples not only retain the evolutionary pattern of passenger flow mutations under sudden events but also conform to the spatiotemporal propagation law of real passenger flow. This avoids invalid samples interfering with the model training direction and improves the convergence efficiency and feature representation accuracy of downstream prediction models.
[0017] 3. By anchoring typical passenger flow spatiotemporal patterns through a learnable global prototype matrix, the system can automatically retrieve and extract corresponding distribution features from real-time passenger flow and historical benchmarks without relying on pre-labeled event information. Furthermore, differential signals are used to quantify the degree of deviation of current passenger flow from normal patterns, driving a gating mechanism to adaptively adjust the fusion weights of historical priors and real-time states. This mechanism can automatically identify the occurrence of sudden events and capture the dynamic evolution characteristics of passenger flow redistribution, accurately adapting to sudden spatiotemporal relationship changes in unknown sudden scenarios, significantly improving the model's prediction accuracy and generalization ability in unlabeled sudden scenarios.
[0018] 4. By deeply coupling generative data augmentation, DTW quality screening, and prototype differential gating feature extraction into an end-to-end prediction architecture, we have achieved collaborative learning of normal cyclical patterns and sudden, abrupt changes. This systematically solves the core problem of existing models' inability to adapt to scenarios involving data distribution shifts and sudden changes in road network operation. The integrated architecture can simultaneously address the common challenges of both sample scarcity and sudden pattern changes in emergency scenarios, demonstrating stronger environmental adaptability and predictive stability in real-world subway emergency scenarios, and providing more reliable decision-making support for operation scheduling and passenger flow management.
[0019] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description
[0020] Figure 1 The accompanying diagram, provided by this invention, shows the locations of stations TL and CG, and the passenger flow during emergencies. Figure 1 (a) in the figure is a site location map. Figure 1 (b) in the figure shows the passenger flow out of TL station during abnormal times. Figure 1 (c) in the figure shows the passenger flow at the CG station during abnormal times; Figure 2 This invention provides an overall framework diagram of a spatiotemporal passenger flow prediction framework for the impact of sudden events; Figure 3 This invention provides a structural diagram of a data augmentation module in a spatiotemporal passenger flow prediction framework for the impact of emergencies. Figure 4 The diagram shows the structure of the feature extraction module in a spatiotemporal passenger flow prediction framework for the impact of sudden events provided by this invention. Detailed Implementation
[0021] To make the objectives, technical solutions, and advantages disclosed in the embodiments of the present invention clearer, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely illustrative of the embodiments of the present invention and are not intended to limit the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of this application. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout.
[0022] It should be noted that the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion, such as a process, method, system, product, or server that includes a series of steps or units, not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such process, method, product, or device.
[0023] The embodiments of the present invention will now be described in detail with reference to the accompanying drawings.
[0024] Existing deep learning-based passenger flow prediction solutions, such as MTDGAT, rely on explicitly injecting pre-labeled known special event codes to represent anomalies. When faced with unknown, unlabeled real-world emergencies, they cannot accurately identify the abnormal evolution mechanism of passenger flow redistribution and cannot fully capture the abrupt changes in the spatiotemporal relationships of the road network under emergencies, resulting in significant limitations in model generalization and robustness. Furthermore, they fail to design adaptation mechanisms for the objective reality of the extreme scarcity of abnormal passenger flow samples under emergencies. Data-driven models tend to fit the more prevalent normal passenger flow samples, treating abnormal passenger flow fluctuations as noise for smoothing, leading to prediction results that significantly deviate from the true distribution and restricting the model's ability to learn effective anomaly representations from limited samples.
[0025] Based on the above analysis, this invention is designed, see appendix. Figures 1-4 This embodiment provides a spatiotemporal passenger flow prediction framework (GAPDG) for the impact of emergencies. It consists of a three-tiered system: a data augmentation module (MCGAM), a DTW selector module, and a feature extraction module (PDGM). Addressing the technical challenges of scarce abnormal samples and low prediction accuracy in unknown emergency scenarios during subway emergencies, it achieves accurate end-to-end spatiotemporal passenger flow prediction. The overall prediction mapping relationship is as follows: ; in, For time arrive Predicted passenger flow status, To predict the number of time steps; Given the current input signal sequence, The signal sequence is the historical average value. It is an adjacency matrix. These are learnable parameters.
[0026] The specific structure includes: a data augmentation module, a DTW selector module, and a feature extraction module; The data augmentation module's input is connected to normal passenger flow samples, and its output is connected to the input of the DTW selector module. This allows it to generate candidate passenger flow samples with anomalous distribution attributes based on generative reconstruction and momentum comparison constraints. Simultaneously, it preserves the topological logic and temporal evolution patterns of the subway network, avoiding the generation of physically meaningless random noise. During implementation, normal passenger flow from TL and CG stations is used as input to generate candidate passenger flow samples that conform to the characteristics of sudden changes in neighboring stations in batches, targeting unknown sudden events caused by unmarked signal faults.
[0027] The data augmentation module has a built-in encoder. The encoder's input is connected to a normal passenger flow sample, and its output is connected to the input of the diffusion layer. The encoder is composed of alternating stacks of temporally gated convolutional networks and graph convolutional networks, based on the GWNet network architecture. It simultaneously decouples two types of spatiotemporal dependencies: passenger flow temporal evolution and subway topology. This is used to decouple and extract the temporal dynamic dependency and spatial topological dependency features of passenger flow data, outputting aggregated spatiotemporal features. Specifically, the normal passenger flow sample is first mapped to an initial embedding representation through a fully connected layer, and then temporally gated convolution and graph convolution operations are alternately executed. Multi-layer feature transfer and aggregation are achieved through residual connections. The spatiotemporal feature aggregation calculation formula is as follows: ; in, For the first The layer's passenger flow is embedded in the representation. , , , For learnable parameters, The number of stacked layers in the network. The spatiotemporal features of the aggregated output have the following dimensions: , To embed feature dimensions, This refers to the number of subway stations.
[0028] The encoder layering calculation formula is: ; ; ; ; ; in It is a fully connected layer. Representing the Embedded representation of passenger flow data for each layer; These represent two TCNs whose parameters are not shared. The feature representation after GatedTCN convolution; This is the prior adjacency matrix. This is the result after GCN convolution; For the first The output of each processing layer.
[0029] The data augmentation module also includes a diffusion layer. The input of the diffusion layer is connected to the output of the encoder, and the output is connected to the input of the decoder. The diffusion layer consists of two parameter-independent fully connected layers, following the probabilistic modeling concept of VAE variational autoencoders to achieve probabilistic simulation of random changes in passenger flow. The diffusion layer is used to map spatiotemporal features to the probabilistic latent space and inject random perturbations to simulate the characteristics of sudden changes in passenger flow caused by sudden events, and outputs perturbed latent variables. The two fully connected layers respectively infer the mean vector and the logarithm vector of variance of the latent distribution, and the gradient propagation of the sampling process is realized through reparameterization techniques.
[0030] This invention samples noise from a standard normal distribution. And construct latent variables by combining the inferred parameters. The reparameterization calculation formula is: ; in, Let be the mean of the potential distribution, and ; Let V be the variance of the latent distribution, and ; For sampling noise that follows a standard normal distribution, This is an element-wise multiplication operation. The latent variables for the output have the following dimensions. , For latent space feature dimensions.
[0031] The diffusion layer is paired with KL regularization loss (used to constrain the latent space distribution to fit a standard normal distribution): ; in, The loss is the KL divergence regularization loss; This refers to the training batch size; Let be the total number of characteristic elements in the latent space, and ; For the first The sample, the first The standard deviation of the latent probability distribution corresponding to the dimensional feature; For the first The sample, the first The mean of the latent probability distribution corresponding to the dimensional feature.
[0032] The data augmentation module also includes a decoder; the input of the decoder is connected to the output of the diffusion layer, and the output is connected to the input of the DTW selector module and the input of the momentum contrast learning unit, respectively. The decoder adopts a multi-head self-attention architecture to reconstruct the disturbed latent variables into candidate passenger flow samples that conform to the spatiotemporal propagation logic of passenger flow. The latent variables are used as query, key, and value inputs in the multi-head self-attention mechanism to model the spatial diffusion correlation and temporal evolution consistency of passenger flow anomalies between stations.
[0033] The decoder reconstruction formula is: ; in, The candidate passenger flow samples output by the decoder represent the initial spatiotemporal data of the generated abnormal passenger flow, with dimensions of [dimension not specified]. ;in The passenger flow characteristics include inbound passenger flow and outbound passenger flow. The total number of subway stations. The time step length; For multi-head self-attention computation function; , , The vectors are, in order, the query vector, the key vector, and the value vector in the attention mechanism, and each is composed of latent variables. Mapped to obtain, The perturbated latent variables output by the diffusion layer have a dimension of ;in For latent space feature dimensions, The total number of subway stations is represented by the latent space features after sampling with probability distribution and injection of Gaussian noise.
[0034] The data augmentation module also includes a momentum contrastive learning unit. The inputs to this unit are normal passenger flow samples and candidate passenger flow samples output from the decoder. The outputs are fed back to the parameter update terminals of the encoder, diffusion layer, and decoder. The momentum contrastive learning unit comprises two parallel branches: a main encoder and a momentum encoder. The main encoder updates in real-time using the standard backpropagation algorithm, while the momentum encoder slowly synchronizes parameters using an exponential moving average method, constructing a large-scale and consistent latent representation dictionary. This dictionary is used to constrain the feature distribution of generated samples, preventing them from degenerating back to the normal mode where data volume dominates. It also incorporates physical boundary constraint loss. Constrain the numerical range of the generated samples to ensure that the generated results conform to the normalized physical boundaries of passenger flow data; Physical boundary constraint loss : ; in, For a three-dimensional index set The total number of elements is equal to the product of the total number of elements in the feature dimension, site dimension, and time dimension. Indexed by the dimension of subway station points (nodes); Indexed by time step dimension; To generate passenger flow samples in the first The first feature, the first The site, the The specific values corresponding to each time step; It is a linear rectified activation function that only generates positive loss values for values that exceed the boundary, while the loss for values within the boundary is 0, thus achieving the effect of penalizing values outside the boundary and having no constraints inside the boundary. The maximum value boundary after normalization of the original passenger flow data is the upper limit of the generated passenger flow sample. The minimum boundary value after normalization of the original passenger flow data is the lower limit of the generated passenger flow sample.
[0035] Will Input to the main encoder to obtain the query sample Then and Positive sample bonds are obtained by feeding them into the momentum encoder. and negative sample bond The momentum contrast learning feature extraction process is as follows: ; ; ; in, The query sample representation (query vector) is obtained by performing average pooling aggregation on the site dimension after the candidate passenger flow samples are encoded by the main encoder; The positive sample key is represented by the candidate passenger flow sample after being encoded by the momentum encoder and then aggregated by average pooling at the station dimension. It serves as the positive sample anchor point for contrastive learning, which is used to narrow the feature distance with the query vector. The negative sample key is represented by the average pooling aggregation of normal passenger flow samples after being encoded by the momentum encoder. It serves as the negative sample anchor for contrastive learning, which is used to widen the feature distance with the query vector and force the feature distribution of the generated samples to deviate from the normal passenger flow pattern. This is an average pooling operation along the site (N) dimension, which aggregates the multi-dimensional features of the site dimension into a global representation and outputs a comparison vector of fixed dimensions. For feature encoder; This is a sample of normal passenger flow, that is, historical passenger flow data during normal subway operating hours.
[0036] To improve the physical plausibility of the generated samples and enhance their discriminative power, at the physical level, since the original passenger flow data has undergone normalization, the generated sample data should also adhere to this physical boundary. Therefore, For exceeding expectations The generated numerical values are penalized, thus effectively constraining the model's output space. At the feature representation level, contrastive loss is used. It aims to narrow down the query vector. With positive sample bond The distance, and simultaneously suppress its bond with normal negative samples. The similarity. The formula for calculating the contrast loss is: ; in, The query representation is obtained by passing candidate passenger flow samples through the main encoder and then average pooling. The positive sample key characterization is obtained by passing candidate passenger flow samples through a momentum encoder and average pooling; The negative sample key representation set is obtained by passing a momentum encoder and average pooling from normal passenger flow samples; For temperature coefficient, This represents the total number of negative samples.
[0037] The DTW selector module's input also receives normal passenger flow samples and real abnormal passenger flow samples, and its output is connected to the input of the feature extraction module. This is used to filter out high-quality enhanced passenger flow samples and splice them to generate the current input signal sequence. Normal passenger flow samples, real abnormal passenger flow samples, and enhanced passenger flow samples are spliced along the feature dimension to construct a balanced training input data, in order to solve the long-tail distribution defects of the scarcity of real abnormal passenger flow samples and the model's tendency to fit normal passenger flow under sudden events.
[0038] The DTW selector module has a built-in average spatiotemporal regularization distance calculation unit and a hybrid scoring and ranking unit. The input of the average spatiotemporal regularization distance calculation unit is connected to candidate passenger flow samples, normal passenger flow samples, and real abnormal passenger flow samples, and the output is connected to the input of the hybrid scoring and ranking unit. It is used to calculate the dynamic time regularization distance between samples and quantify the morphological differences of passenger flow sequences. The dynamic time regularization distance establishes a nonlinear alignment relationship between sequences by introducing regularization paths, realizes flexible matching of passenger flow temporal patterns, and then calculates the average spatiotemporal regularization distance station by station and feature by feature.
[0039] In this embodiment, DTW is used as the basic metric function. DTW introduces a regularized path. , This is used to establish a non-linear alignment relationship between two sequences. Representative sequence The first in Elements and sequences The first in Each element establishes a correlation. Under this mechanism, an observation at one time step can be matched with multiple neighboring times in another sequence, thus achieving flexible alignment. The DTW distance is defined as the path with the minimum cumulative alignment cost among all alignment paths satisfying the constraints. Therefore, the formula for the DTW distance of a single sequence is: ; in, Two univariate time series and The dynamic time-normalized distance between them; These are two univariate time series data points for calculating the distance between two stations, corresponding to time series data of a single station and a single type of passenger flow characteristic. To standardize the path; Time series In the The value at each moment; Time series In the The value at each moment.
[0040] For those with Features and The spacetime tensor of each site This invention extends this metric to mean spatiotemporal regularization distance. Mean spacetime regularization distance: ; in, The average spatiotemporal regularization distance between two passenger flow spatiotemporal tensors is used to comprehensively measure the spatiotemporal morphological differences between the two sets of passenger flow data. Let these be the two sets of passenger flow spatiotemporal tensors to be calculated; For the first spacetime tensor In the middle, the first The site, the Univariate time series corresponding to class features; For the second spacetime tensor In the middle, the first The site, the Univariate time series corresponding to class features.
[0041] The hybrid scoring and ranking unit is used to construct a hybrid scoring function to screen high-quality samples, output enhanced passenger flow samples and splice them to generate the current input signal sequence; at the same time, it measures the abnormality of the candidate passenger flow samples deviating from the normal and the evolutionary consistency with the real abnormality, and selects the top-k high-scoring passenger flow samples as the final enhanced passenger flow samples.
[0042] By calculating candidate passenger flow samples Its corresponding normal passenger flow sample The DTW distance between samples is used to quantify the degree to which the sample deviates from the periodic pattern, aiming to ensure that the generated samples have sufficient anomaly discrimination power; secondly, to avoid generating physically meaningless random noise, this invention uses scarce real anomalous passenger flow samples. A number of randomly sampled samples are used as anchor points. The consistency of the evolution pattern is measured by calculating the DTW distance from the nearest anchor point to the candidate passenger flow sample. Finally, a hybrid scoring function is constructed by introducing a balance factor. All candidate passenger flow samples are sorted in descending order, and the top-k high-scoring passenger flow samples are selected as the final enhanced passenger flow samples and injected into the downstream prediction model. The hybrid scoring function is as follows: ; in, The average spatiotemporal regularization distance, As a balance factor, As a sample of normal passenger flow, This is a sample of real, abnormal passenger flow. This is a sample of candidate passenger flow.
[0043] The formula for filtering output is: ; in, To select the top-k passenger flow samples.
[0044] The feature extraction module also receives historical average signal sequences and the subway network adjacency matrix as inputs. These are used to output spatiotemporal passenger flow prediction results under sudden events through prototype feature matching and differential adaptive fusion mechanisms. It can automatically detect passenger flow anomalies and adapt to the evolution patterns of sudden scenarios without the need for pre-labeling event information.
[0045] See Figure 4 As shown, the feature extraction module includes an embedding layer unit. The input of the embedding layer unit is connected to the current input signal sequence and the historical average signal sequence, and the output is connected to the input of the prototype attention unit. The embedding layer unit consists of four concatenated embeddings: feature embedding, node embedding, intraday time embedding, and intraweek time embedding. The spatiotemporal embedding layer first fuses the original sequence with various prior knowledge to construct a representation of the current input in a high-dimensional feature space. Representation of historical benchmarks Subsequently, as the first core innovation of this module, the model introduces a prototype attention mechanism, utilizing a learnable global pattern dictionary to... and The corresponding typical spatiotemporal distribution features were retrieved and extracted from the data. and Next, the extracted two types of distribution features are differentially analyzed to obtain the differential signal. Finally, relying on another innovative structure of this module, namely the differential gating mechanism, the model uses differential signals... Dynamic adjustment and The fusion ratio is used to output the final prediction result.
[0046] The original input data is mapped to a high-dimensional space, and spatial identifiers and time period information are fused. The input embedding layer consists of four parts: feature embedding, node embedding, intraday time embedding, and intraweek time embedding. The embedding calculation formula is as follows: ; ; in, The feature vectors are concatenated for the embedding layer; It is a fully connected layer. Embedded for nodes, Embedded for intraday time, Embedded for weekday times, For splicing operations, , For learnable parameters, This is the embedded representation of the output.
[0047] The feature extraction module also includes a prototype attention unit. The input of the prototype attention unit is connected to the output of the embedding layer unit, and its output is connected to the input of the differential gating unit. The prototype attention unit has a built-in learnable prototype matrix, which contains... A set of randomly initialized prototype vectors, each corresponding to a typical passenger flow spatiotemporal pattern, such as morning / evening peak hours and off-peak hours, are used to retrieve typical spatiotemporal patterns from the input representation, extract the corresponding passenger flow distribution features, and output the current distribution features and historical baseline distribution features respectively. A similarity weight matrix quantifies the degree of matching between the status of each station and the typical spatiotemporal pattern, achieving adaptive retrieval and weighted aggregation of global typical patterns. Simultaneously, a comparative loss is used... Improve the differentiation between prototypes through deviation loss Constrain the consistency between current and historical representations in the prototype space.
[0048] Representing current and historical inputs The query vectors are obtained by projecting them onto the query space respectively. At the same time, the prototype matrix As keys and values in the attention mechanism, a dot product attention mechanism is used to calculate the similarity score between the current query vector and each prototype, generating a weight matrix. This reflects the response strength of each node's state to a specific spatiotemporal pattern. Subsequently, through weighted aggregation of the prototype library, the model can retrieve and reconstruct the corresponding feature representations from the global dictionary. This mechanism enables the model to obtain representations of the current input features. and characterizing historical benchmark features The formula for calculating prototype attention is: ; ; in, These correspond to current and historical inputs, respectively. For query vector, For learnable prototype matrices, For feature dimension, This is the similarity weight matrix. This represents the distribution characteristics of the output.
[0049] Based on the calculated similarity matrix Select the most relevant prototype for each node and related prototypes For nodes Its most relevant prototype index Related Prototype Index The selection process is as follows: ; ; in, For the first The optimal prototype index corresponding to each subway station is the number of the prototype that best matches the current passenger flow characteristics of that station. This is the index of the second-best prototype corresponding to the nth subway station, that is, the number of the prototype with the second-highest matching degree with the current passenger flow characteristics of the station after excluding the best prototype. In the current input scenario, the first The site and the first The similarity weight values of each prototype are derived from the similarity weight matrix output by the prototype attention. .
[0050] Based on the obtained index, the prototype representation that ultimately participates in the loss function calculation can be expressed as: ; in, Representation of prototype matrix The row vectors The most relevant prototype representation, This is a secondary related prototype representation.
[0051] Comparative loss Make projection features The goal is to bring prototypes closer to the most relevant ones and further away from the less relevant ones. This aims to increase the distinguishability between prototypes, allowing the prototype group to represent more spatiotemporal patterns. (Bias loss) The introduction of this feature aims to ensure the consistency of projected features through consistency constraints. and Similarity in the feature space can be effectively transferred to the prototype space; that is, when two features are close, their corresponding prototype representations are similar. and They should also remain adjacent. Two of the losses can be expressed as follows: ; ; in The maximum of the two. It is a positive boundary value.
[0052] The feature extraction module also includes a differential gating unit. The input of the differential gating unit is connected to the output of the prototype attention unit, which outputs the final spatiotemporal passenger flow prediction result. The differential gating unit contains a dual attention subunit, a differential calculation subunit, and a gating fusion subunit. The dual attention subunit includes a self-attention module and a cross-attention module: self-attention models the dynamic dependencies within the current feature to capture sudden and drastic trends, while cross-attention uses the current feature as a query to retrieve historical baseline features to extract cyclical evolution patterns. It is used to adaptively fuse the current real-time features and historical baseline features according to the degree of passenger flow deviation from the norm. The dynamic weight coefficient can be adaptively adjusted according to the strength of the difference signal: the greater the difference signal, the more the weight is tilted towards the current real-time feature; the smaller the difference signal, the more the weight is tilted towards the historical normal pattern. The differential gating mechanism first utilizes a dual attention structure for spatiotemporal representation. and The current mode representation is calculated. Historical reference representation . Model the current state using a self-attention mechanism. Internal dynamic dependencies are used to capture short-term, drastic trends triggered by unexpected events. The current state is adjusted using the cross-attention mechanism. Historical reference The query aims to retrieve relevant evolutionary features from stable periodic patterns. Subsequently, the current spatiotemporal representation is calculated. Historical reference representation The deviation between them yields the difference signal. The signal is mapped to dynamic weight coefficients using a gated network with a Sigmoid activation function. Finally, the fused prediction output is obtained through a weighted combination method. The process can be represented as follows: ; ; in, This is the current pattern representation calculated by the attention mechanism. This is a historical reference representation calculated for the attention mechanism.
[0053] The formula for calculating the dynamic weighting coefficient is: ; in, It is the Sigmoid activation function. and For learnable parameters, For the difference signal, the weighting coefficient This reflects the degree to which the current passenger flow at each node deviates from the norm: when When it is large, When the element values approach 1, it indicates that the model should focus more on capturing the current input features; conversely, when... When smaller, The element values tend to be close to 0, indicating that the model tends to rely on stable historical patterns.
[0054] The final predicted output satisfies: ; This is element-wise multiplication. It is a fully connected layer.
[0055] To implement a spatiotemporal passenger flow forecasting method for the impact of emergencies, the following steps are included: S1. Based on normal passenger flow samples, multi-layer spatiotemporal feature extraction and residual aggregation are performed by an encoder consisting of alternating stacks of temporally gated convolutional networks and graph convolutional networks to obtain aggregated spatiotemporal features; Based on the spatiotemporal characteristics of aggregation, the mean and variance of the latent probability distribution are inferred through a diffusion layer composed of two fully connected layers. Gaussian noise is injected using a reparameterization technique to obtain perturbed latent variables. At the same time, KL divergence loss is introduced. As a regularization constraint, it minimizes the difference between the approximate posterior distribution and the standard normal prior distribution, thus ensuring the regularity of the latent space. Based on latent variables, spatiotemporal consistency reconstruction is performed using a multi-head self-attention decoder to obtain initial candidate passenger flow samples; Based on the initial candidate passenger flow samples and normal passenger flow samples, the contrastive loss is calculated through the momentum contrastive learning mechanism that includes the master encoder and the momentum encoder. The feature distribution of the generated samples is constrained to avoid degenerate back to the normal mode, and finally candidate passenger flow samples with abnormal distribution attributes are obtained. S2. Based on candidate passenger flow samples, normal passenger flow samples and real abnormal passenger flow samples, the dynamic time regularization distance is calculated station by station and feature by the average spatiotemporal regularization distance calculation unit to obtain the morphological difference measurement results of passenger flow sequences between samples; the time nonlinear elastic alignment is achieved through regularization path to adapt to the time offset characteristics of passenger flow mutation. Based on the morphological difference measurement results, a hybrid scoring function is constructed through a hybrid scoring and ranking unit, and the top-k high-scoring passenger flow samples are selected as high-quality enhanced passenger flow samples. S3. Based on normal passenger flow samples, real abnormal passenger flow samples, and enhanced passenger flow samples, the current input signal sequence is obtained by splicing the feature dimensions. S4. Based on the current input signal sequence and the historical average signal sequence, feature embedding, node embedding, intraday time embedding and intraweek time embedding are fused through the embedding layer unit. After linear transformation, the current input representation and historical benchmark representation are obtained respectively. This is to enrich the spatiotemporal semantic information of high-dimensional features by fusing the spatial attributes of the site and the prior knowledge of the time cycle. S5. Based on the current input representation and the historical baseline representation, dot product attention matching and prototype weighted aggregation are performed through the prototype attention unit with built-in learnable prototype matrix to extract the current distribution features and the historical baseline distribution features respectively. S6. Based on the current distribution characteristics and historical baseline distribution characteristics, deep representations are extracted and difference signals are calculated through the dual attention structure of the differential gating unit. After generating dynamic weight coefficients, the two types of features are adaptively weighted and fused. After being output through the fully connected layer, the spatiotemporal passenger flow prediction results under sudden events are obtained.
[0056] In summary, the GAPTG framework for predicting spatiotemporal passenger flow in emergency situations proposed in this invention generates high-quality abnormal passenger flow samples that conform to the physical logic of the road network in batches through momentum comparison generative data augmentation and DTW hybrid scoring and filtering mechanism. It achieves automatic perception and adaptive feature fusion of abnormal passenger flow in unlabeled scenarios by relying on prototype attention and differential gating feature extraction mechanism. This improves the accuracy, robustness and generalization ability of passenger flow prediction in unknown emergency scenarios, and can provide reliable decision support for subway passenger flow management, vehicle scheduling and operation safety early warning. It solves the problems of existing deep learning prediction schemes represented by MTDGAT relying on pre-labeled known event information, failing to accurately capture the evolution law of passenger flow redistribution and spatiotemporal relationship changes in emergency scenarios, and the extreme scarcity of abnormal passenger flow samples, the model's tendency to overfit normal data and smooth abnormal features, which ultimately leads to the prediction results deviating seriously from the actual passenger flow distribution.
[0057] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the technical solutions of the present invention, and these modifications or equivalent substitutions cannot cause the modified technical solutions to deviate from the spirit and scope of the technical solutions of the present invention.
Claims
1. A framework for spatiotemporal passenger flow prediction under emergency influence, characterized in that, include: Data augmentation module, DTW selector module, and feature extraction module; The input end of the data augmentation module is connected to a normal passenger flow sample, and the output end is connected to the input end of the DTW selector module. It is used to generate candidate passenger flow samples with abnormal distribution attributes based on generative reconstruction and momentum comparison constraints. The candidate passenger flow samples with abnormal distribution attributes are passenger flow samples that conform to the spatiotemporal propagation logic of passenger flow after extracting time dynamic dependence and spatial topological dependence features from normal passenger flow, simulating the sudden change characteristics of passenger flow during sudden events through probabilistic latent spatial random perturbation, and avoiding degradation back to the normal mode through momentum comparison constraints. The input of the DTW selector module is also connected to normal passenger flow samples and real abnormal passenger flow samples, and the output is connected to the input of the feature extraction module. It is used to filter out high-quality enhanced passenger flow samples and splice them to generate the current input signal sequence. High-quality enhanced passenger flow samples refer to passenger flow samples obtained by constructing a hybrid scoring standard based on the morphological differences of passenger flow sequences quantified by dynamic time warping distance, combined with the abnormality degree of deviation from the normal distribution and the evolution consistency close to the real abnormality. The input of the feature extraction module is also connected to the historical average signal sequence and the subway network adjacency matrix, which are used to output the spatiotemporal passenger flow prediction results under sudden events through prototype feature matching and differential adaptive fusion mechanism.
2. The spatiotemporal passenger flow prediction framework for the impact of emergencies according to claim 1, characterized in that: The data augmentation module has a built-in encoder. The input of the encoder is connected to a normal passenger flow sample, and the output is connected to the input of the diffusion layer. The encoder is composed of alternating stacks of temporally gated convolutional networks and graph convolutional networks, used to decouple and extract the temporal dynamic dependence and spatial topological dependence features of passenger flow data, and output the aggregated spatiotemporal features. The formula for calculating the spatiotemporal feature aggregation is as follows: ; in, For the first The layer's passenger flow is embedded in the representation. , , , For learnable parameters, The number of stacked layers in the network. The spatiotemporal features of the aggregated output.
3. The spatiotemporal passenger flow prediction framework for the impact of emergencies according to claim 2, characterized in that: The data augmentation module also includes a diffusion layer. The input of the diffusion layer is connected to the output of the encoder, and the output is connected to the input of the decoder. The diffusion layer consists of two fully connected layers with independent parameters. The diffusion layer is used to map spatiotemporal features to a probabilistic latent space and inject random perturbations to simulate the sudden changes in passenger flow caused by sudden events, and outputs a perturbed latent variable. The formula for reparameterization calculation is: ; in, The mean of the latent distribution, For the potential distribution variance, For sampling noise that follows a standard normal distribution, This is an element-wise multiplication operation. These are the potential variables for the output.
4. The spatiotemporal passenger flow prediction framework for the impact of emergencies according to claim 3, characterized in that: The data augmentation module also includes a decoder; the input of the decoder is connected to the output of the diffusion layer, and the output is connected to the input of the DTW selector module and the input of the momentum contrast learning unit, respectively. The decoder adopts a multi-head self-attention architecture. Used to reconstruct the disturbed latent variables into candidate passenger flow samples that conform to the spatiotemporal propagation logic of passenger flow.
5. The spatiotemporal passenger flow prediction framework for the impact of emergencies according to claim 4, characterized in that: The data augmentation module also includes a momentum contrastive learning unit. The inputs of this unit are connected to both normal passenger flow samples and candidate passenger flow samples output by the decoder. The output is fed back to the parameter update terminals of the encoder, diffusion layer, and decoder. The momentum contrastive learning unit comprises two parallel branches: a main encoder and a momentum encoder. It is used to constrain the feature distribution of the generated samples, preventing them from degenerating back to the normal mode where data volume dominates. The contrastive loss is calculated using the following formula: ; in, For query representation, Characterized by positive sample bonds. The set of negative sample key representations. For temperature coefficient, This represents the total number of negative samples.
6. The spatiotemporal passenger flow prediction framework for the impact of emergencies according to claim 5, characterized in that: The DTW selector module has a built-in average spatiotemporal regularization distance calculation unit and a hybrid scoring and sorting unit. The average spatiotemporal regularization distance calculation unit is connected to candidate passenger flow samples, normal passenger flow samples, and real abnormal passenger flow samples at its input end, and to the input end of the hybrid scoring and ranking unit at its output end; it is used to calculate the dynamic time regularization distance between samples and quantify the morphological differences of passenger flow sequences. The hybrid scoring and sorting unit is used to construct a hybrid scoring function to screen high-quality samples, output enhanced passenger flow samples, and splice them together to generate the current input signal sequence; The mixed scoring function is: ; in, The average spatiotemporal regularization distance, As a balance factor, As a sample of normal passenger flow, This is a sample of real, abnormal passenger flow. This is a sample of candidate passenger flow.
7. The spatiotemporal passenger flow prediction framework for the impact of emergencies according to claim 6, characterized in that: The feature extraction module includes an embedding layer unit. The input of the embedding layer unit is connected to the current input signal sequence and the historical average signal sequence, and the output is connected to the input of the prototype attention unit. The embedding layer unit is composed of four concatenations: feature embedding, node embedding, intraday time embedding, and intraweek time embedding. It is used to map the original passenger flow data to a high-dimensional feature space and fuse multi-dimensional prior information to output the corresponding embedding representation. The embedding calculation formula is: ; ; in, The feature vectors are concatenated for the embedding layer; It is a fully connected layer. Embedded for nodes, Embedded for intraday time, Embedded for weekday times, For splicing operations, , For learnable parameters, This is the embedded representation of the output.
8. The spatiotemporal passenger flow prediction framework for the impact of emergencies according to claim 7, characterized in that: The feature extraction module is also equipped with a prototype attention unit. The input end of the prototype attention unit is connected to the output end of the embedding layer unit, and the output end is connected to the input end of the differential gating unit. The prototype attention unit has a built-in learnable prototype matrix, which is used to retrieve typical spatiotemporal patterns from the input representation, extract the corresponding passenger flow distribution features, and output the current distribution features and historical baseline distribution features respectively. The formula for calculating prototype attention is: ; ; in, These correspond to current and historical inputs, respectively. For query vector, For learnable prototype matrices, For feature dimension, This is the similarity weight matrix. This represents the distribution characteristics of the output.
9. A spatiotemporal passenger flow prediction framework for the impact of emergencies according to claim 8, characterized in that: The feature extraction module is also equipped with a differential gating unit. The input end of the differential gating unit is connected to the output end of the prototype attention unit. The output end outputs the final spatiotemporal passenger flow prediction result. The differential gating unit includes a dual attention subunit, a differential calculation subunit, and a gating fusion subunit. It is used to adaptively fuse current real-time features with historical baseline features based on the degree to which passenger flow deviates from the norm; The formula for calculating the dynamic weighting coefficient is: ; in, It is the Sigmoid activation function. , For learnable parameters, For difference signals, These are dynamic weighting coefficients.
10. A spatiotemporal passenger flow prediction framework for the impact of emergencies according to claim 9, characterized in that, A spatiotemporal passenger flow forecasting method based on the above framework, oriented towards the impact of emergencies, includes the following steps: S1. Based on normal passenger flow samples, multi-layer spatiotemporal feature extraction and residual aggregation are performed by an encoder consisting of alternating stacks of temporally gated convolutional networks and graph convolutional networks to obtain aggregated spatiotemporal features; Based on the spatiotemporal characteristics of aggregation, the mean and variance of the latent probability distribution are inferred through a diffusion layer composed of two fully connected layers. Gaussian noise is injected using the reparameterization technique to obtain the perturbed latent variables. Based on latent variables, spatiotemporal consistency reconstruction is performed using a multi-head self-attention decoder to obtain initial candidate passenger flow samples; Based on the initial candidate passenger flow samples and normal passenger flow samples, the contrastive loss is calculated through the momentum contrastive learning mechanism that includes the master encoder and the momentum encoder. The feature distribution of the generated samples is constrained to avoid degenerate back to the normal mode, and finally candidate passenger flow samples with abnormal distribution attributes are obtained. S2. Based on candidate passenger flow samples, normal passenger flow samples and real abnormal passenger flow samples, the dynamic time regularization distance is calculated station by station and feature by the average spatiotemporal regularization distance calculation unit to obtain the morphological difference measurement results of passenger flow sequences between samples. Based on the morphological difference measurement results, a hybrid scoring function is constructed through a hybrid scoring and ranking unit, and the top-k high-scoring passenger flow samples are selected as high-quality enhanced passenger flow samples. S3. Based on the normal passenger flow samples, the real abnormal passenger flow samples and the enhanced passenger flow samples, the current input signal sequence is obtained by splicing them together through feature dimensions; S4. Based on the current input signal sequence and the historical average signal sequence, feature embedding, node embedding, intraday time embedding and intraweek time embedding are fused through the embedding layer unit, and after linear transformation, the current input representation and the historical benchmark representation are obtained respectively. S5. Based on the current input representation and the historical baseline representation, dot product attention matching and prototype weighted aggregation are performed through the prototype attention unit with built-in learnable prototype matrix to extract the current distribution features and the historical baseline distribution features respectively. S6. Based on the current distribution characteristics and historical baseline distribution characteristics, deep representations are extracted and difference signals are calculated through the dual attention structure of the differential gating unit. After generating dynamic weight coefficients, the two types of features are adaptively weighted and fused. After being output through the fully connected layer, the spatiotemporal passenger flow prediction results under sudden events are obtained.