Passenger train delay propagation prediction method based on HGT-GRU model
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- XIAN RAILWAY VOCATIONAL & TECH COLLEGE
- Filing Date
- 2026-02-02
- Publication Date
- 2026-05-12
Smart Images

Figure CN121616443B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of train delay prediction under extreme weather, and particularly relates to a passenger train delay propagation prediction method based on an HGT-GRU model. BACKGROUND
[0002] Railway passenger transport is the core pillar of the transportation system, and its safe and on-time operation is directly related to passenger travel experience and social transportation efficiency. With the continuous expansion of the railway network scale and the increasing complexity of line interweaving, initial train delays caused by extreme weather such as rainstorms and typhoons and equipment failures are easy to spread and propagate along the line through the interaction between trains and stations and between trains, forming a chain reaction and bringing serious challenges to train scheduling and emergency disposal. Precise prediction of delay propagation trends, quantification of propagation range and intensity, and dynamic scheduling optimization have become the core demand of smart railway construction.
[0003] At present, the academic community has carried out a lot of research on train delay prediction and propagation mechanism, and although related technologies have made some progress, they still cannot meet the actual operation needs in key dimensions such as complex line network adaptation, real-time and prediction accuracy.
[0004] In the field of delay prediction, the technical route has gradually evolved from traditional statistical models to hybrid data-driven models. In the field of delay propagation analysis, researchers often use graph models or network models (such as Bayesian networks and event graphs) to depict the interaction between train operation events. However, the existing technology still has the following significant shortcomings:
[0005] 1. Lack of complex line network and heterogeneous relationship modeling: Existing propagation analysis models are mostly limited to single-line or double-line scenarios, lacking systematic modeling of large-scale, multi-line interwoven complex line network structures. At the same time, traditional graph models do not fully consider the heterogeneity of train, station and other heterogeneous nodes in the propagation graph, as well as the homogeneity modeling defects brought by multiple edge types such as departure, arrival and following, and most models ignore edge weight differences, making it difficult to reflect the differentiated influence of dynamic changes such as running time and stop time on delay transmission, and making it difficult to accurately capture the complex propagation logic across lines and multiple sites.
[0006] 2. Lack of spatiotemporal feature fusion and dynamic capture: Although deep learning models such as bidirectional LSTM attempt to capture spatiotemporal features, they either focus on a single dimension or use simple concatenation to fuse information;
[0007] 3. Lack of real-time and stability of scheduling optimization: Although new scheduling algorithms such as deep reinforcement learning have self-learning and dynamic adjustment capabilities, they face the core challenge of high computational complexity, and are not real-time enough when dealing with large-scale operation data, making it difficult to meet the real-time requirements of "millisecond-level response" of railway scheduling, and its stability in complex operation scenarios still needs to be further verified.
[0008] In summary, although existing train delay prediction and propagation analysis have made some progress, there are still significant shortcomings in key aspects such as complex network heterogeneous modeling, deep integration of spatiotemporal features, and real-time dynamic prediction. These shortcomings result in insufficient accuracy of delay propagation prediction and delayed dispatch response under extreme weather conditions, making it difficult to meet the actual development needs of railway transportation's transformation towards digitalization and intelligence. Summary of the Invention
[0009] The purpose of this invention is to provide a method for predicting the propagation of passenger train delays based on the HGT-GRU model, thereby solving the aforementioned technical problems.
[0010] To achieve the above objectives, this invention provides a method for predicting passenger train delay propagation based on the HGT-GRU model, comprising the following steps:
[0011] S1. Based on the railway dispatching system database, construct a railway network structure operation map, obtain the train operation data in the railway network under extreme weather conditions, extract train operation characteristics, construct a train delay feature dataset, obtain a standard dataset after preprocessing, and finally divide the standard dataset into training set and test set according to the proportion.
[0012] S2. Based on the standard dataset extracted in step S1, construct a heterogeneous graph containing train event nodes and station nodes, and combine it with the full feature allocation scheme to complete the feature mapping and structured modeling of the heterogeneous graph.
[0013] S3. Construct an HGT-GRU model, capture the key elements affecting train delays in heterogeneous graphs through the multi-head attention mechanism in the HGT model, score each node and edge in the heterogeneous graph, and input the node and edge weights output by the HGT model into the GRU model for temporal evolution learning to complete the joint modeling and training of delay propagation features.
[0014] S4. Input the test set from step S1 into the HGT-GRU model trained in step S3, output the train delay time prediction results, and use the mean absolute error and root mean square error to comprehensively evaluate the train delay time prediction results.
[0015] S5. Using a four-dimensional delay propagation evaluation algorithm, the impact range of train delay propagation is quantified, and the prediction accuracy and propagation characteristic characterization ability of the HGT-GRU model are verified.
[0016] S6. Based on the train delay duration prediction results output in step S4 and the four-dimensional propagation features described in step S5, generate a visual decision reference report for train scheduling, collect train operation feedback data after actual scheduling, and dynamically update the train delay feature dataset in step S1 and the heterogeneous graph feature attributes in step S2.
[0017] Therefore, the passenger train delay propagation prediction method based on the HGT-GRU model described above has the following beneficial effects:
[0018] 1. Accurately depict complex dependencies: By constructing a heterogeneous graph containing train event nodes and station nodes, defining three types of relationships—departure edge, arrival edge, and following edge—and assigning all features, it can effectively capture the interaction logic of heterogeneous entities in the railway network, solving the problem that traditional models have difficulty in depicting the spatial dependencies of delay propagation.
[0019] 2. Improve prediction accuracy and generalization ability: Spatial feature aggregation is achieved by leveraging the multi-head self-attention mechanism of the HGT model, and the GRU model captures the temporal evolution law. The fusion of the two breaks through the limitations of spatiotemporal feature separation learning. At the same time, a random partitioning strategy is adopted for the "vertical tail distribution" of delay data, which enhances the prediction robustness of low-frequency long delay samples under extreme weather conditions.
[0020] 3. Quantify the dimensions of propagation impact: Innovative design of four dimensions of propagation characteristics, such as delay propagation rate (DPR) and affected train spatial rate (STDS), to comprehensively quantify the temporal intensity, spatial range and scale of impact of delay propagation, providing intuitive data support for scheduling decisions.
[0021] 4. Support dynamic intelligent scheduling: By continuously updating the dataset and heterogeneous graph features through IoT feedback data, the model parameters are iteratively optimized to achieve dynamic improvement in prediction capabilities, transforming the scheduling response from passive response to proactive prediction, and reducing the risk of large-scale delays under extreme weather conditions;
[0022] 5. High engineering practicality: Generates standardized and visualized decision reports that directly adapt to train scheduling scenarios. The model hyperparameters are optimized to balance prediction accuracy and computational efficiency, and can be quickly deployed for actual railway network operation.
[0023] 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
[0024] Figure 1 This is a flowchart of the passenger train delay propagation prediction method based on the HGT-GRU model of the present invention;
[0025] Figure 2 This is a schematic diagram of the passenger train delay propagation prediction method based on the HGT-GRU model of the present invention.
[0026] Figure 3 This is a schematic diagram of the railway network used in the simulation experiment.
[0027] Figure 4 This is a diagram showing the proportion of different train types described in the simulation experiment.
[0028] Figure 5 This is an example diagram of partial attention scores on the delay propagation graph described in the simulation experiment;
[0029] Figure 6 The graph shows the performance comparison results of the benchmark model described in the simulation experiment. Detailed Implementation
[0030] To make the objectives, technical solutions, and advantages of 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.
[0031] 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.
[0032] The embodiments of the present invention will now be described in detail with reference to the accompanying drawings.
[0033] like Figure 1 and Figure 2 As shown, the passenger train delay propagation prediction method based on the HGT-GRU model includes the following steps:
[0034] S1. Based on the railway dispatching system database, construct a railway network structure operation map, obtain the train operation data in the railway network under extreme weather conditions, extract train operation characteristics, construct a train delay feature dataset, obtain a standard dataset after preprocessing, and finally divide the standard dataset into training set and test set according to the proportion.
[0035] Step S1 specifically includes the following steps:
[0036] S11. Railway Network Sampling and Operation Map Construction: Perform structured sampling on the target railway network to construct a railway network structure operation map that includes train operation paths, station distribution, and section relationships;
[0037] S12. Data Acquisition: Based on the constructed railway network operation map, collect historical train operation data of the railway network under extreme weather conditions to obtain a dataset of train delay characteristics. ,in, , and These represent extreme weather and static attributes, planned timetable characteristics, and actual timetable characteristics as delay propagation features, respectively. , Indicates extreme weather type, , This represents the total number of extreme weather types. Indicates the intensity of extreme weather. , Indicates the train class. , Indicates the station class, , Indicates train number The origin-destination interval; , Indicates train On the site The planned arrival time, Indicates train On the site The scheduled departure time, , Indicates train On the site The planned stop duration, Indicates site The planned departure interval , Indicates train On the site The scheduled departure time; , Indicates train On the site The actual arrival time Indicates train On the site The actual departure time Indicates train On the site Arrival delay, , Indicates train On the site Departure delay, , Indicates train From the site to station The actual driving time , Indicates train From the site to station Actual mileage Indicates train On the site Total delay time ;
[0038] S13. Data Filtering: Filter extreme weather types that cause train delays, including rainstorms, thunderstorms, strong winds, severe convective weather and typhoon warnings, and remove data corresponding to weather warnings that have no impact, including cold wave warnings.
[0039] S14. Data cleaning: Remove outliers and missing values, retain valid delayed data, and obtain a standard dataset;
[0040] S15. Data Distribution Optimization and Partitioning: To address the imbalanced nature of train delay data, the standard dataset is randomly divided into an 80% training set and a 20% test set; the training set is then further split into a parameter training subset and a model validation subset in a 7:3 ratio.
[0041] S2. Based on the standard dataset extracted in step S1, construct a heterogeneous graph containing train event nodes and station nodes, and combine it with the full feature allocation scheme to complete the feature mapping and structured modeling of the heterogeneous graph.
[0042] Step S2 specifically includes the following steps:
[0043] S21. Define heterogeneous graphs ,in, Represents a set of nodes; Represents the set of edges; Represents a node type mapping function; Represents a set of edge types;
[0044] S22. Define heterogeneous graph nodes: a set of nodes , Indicates the first A subset of nodes of type node, and ,in For train event nodes, For station nodes;
[0045] S23. Define the edge type of a heterogeneous graph: edge set , Representing edge type The edge subset; These represent the departure edge, arrival edge, and following edge, respectively.
[0046] S24. Assign attributes using the full feature allocation scheme:
[0047] when At that time, define the attributes of each node. ;when hour, , Indicates the departure station; Indicates the arrival station;
[0048] For each edge Define its attribute vector Among them, the departure side Reaching the edge , and the side ,in, and These represent the scheduled delay time and the actual delay time, respectively. and These represent the planned delay time and the actual delay time, respectively. This indicates the difference in planned departure times between the two vehicles.
[0049] S25. Feature Mapping: Define type mapping functions By using type mapping functions, nodes and edges are mapped to their respective types, thus completing structured modeling.
[0050] In the heterogeneous graph described in step S2, feature spaces and message passing methods are designed for different types of entities and relationships. The formal message passing framework expression is as follows:
[0051] ;
[0052] In the formula, Indicates the first Layer nodes Hidden representations; Indicates the first Layer nodes Hidden representations; Indicates the first Layer nodes Hidden representations; Represents nodes By edge type The set of all connected neighboring nodes; For activation functions; edge type The message passing function.
[0053] S3. Construct an HGT-GRU model, capture the key elements affecting train delays in heterogeneous graphs through the multi-head attention mechanism in the HGT model, score each node and edge in the heterogeneous graph, and input the node and edge weights output by the HGT model into the GRU model for temporal evolution learning to complete the joint modeling and training of delay propagation features.
[0054] Step S3 specifically includes the following steps:
[0055] S31. Set the optimal hyperparameter combination for the HGT-GRU fusion model: HGT layer count = 2, attention head count = 32, hidden dimension = 32, GRU layer count = 1, dropout ratio = 0.3, learning rate = 10. -5 ;
[0056] S32 and HGT model feature extraction and scoring:
[0057] S321, Type-Specific Linear Transformation: Perform key-query-value mapping for each node type:
[0058] ;
[0059] In the formula, , and They represent the first Layers based on node type The key, query, and value mapping matrix, and , Indicates the matrix dimension; , and They represent the first Layer nodes The key vector, query vector, and value vector;
[0060] S322, Relationship-Specific Transformation: Apply relation-specific keys and query transformations to each edge type:
[0061] ;
[0062] In the formula, and Representing edge types respectively The key and query transformation matrix, and ; and They represent the first Within the layer, for edge type From node To the node The key vector and query vector; Indicates the first Within the layer, depending on the node type nodes The key vector; Indicates the first Within the layer, depending on the node type nodes The query vector;
[0063] S323. Calculate the attention weights between nodes:
[0064] ;
[0065] In the formula, Indicates the first In the layer, the first Individual attention head, targeting edge type from node To the node Attention weights; and They represent the first Within the layer, for edge type From node To the node The query vector and key vector; Indicates the inner product; This represents the vector dimension of each attention head; and , Indicates the number of attention heads;
[0066] S324. Aggregate neighbor node information based on attention weights and update node representations:
[0067] ;
[0068] In the formula, Indicates the first In the layer, nodes Updated node representation vector; Representing edge type The output mapping, and ; Indicates the first Within the layer, for edge type nodes The value vector; Indicates the number of heads of attention;
[0069] S33, GRU Model Temporal Evolution: The node and edge weights output by the HGT model are fed into a single-layer GRU to learn the temporal dependency of delay propagation and complete dynamic prediction modeling.
[0070] S34. Model Training: Train the HGT-GRU fusion model using a training subset, monitor loss changes using a validation subset, iteratively optimize the HGT-GRU fusion model parameters until convergence, and output the trained HGT-GRU fusion model.
[0071] S4. Input the test set from step S1 into the HGT-GRU model trained in step S3, output the train delay time prediction results, and use the mean absolute error and root mean square error to comprehensively evaluate the train delay time prediction results.
[0072] Its core can be divided into two steps:
[0073] Spatial Heterogeneous Aggregation: Using HGT, multi-head self-attention aggregation is performed on heterogeneous graphs to aggregate extreme weather and static properties (WSF), planned timetable features (FPT), and actual timetable features (FAT), and delay propagation characteristics are calculated. , , );
[0074] Temporal evolution prediction: The hidden layer representation of the train nodes obtained each day is sequence encoded using GRU, and the delay prediction for the next time step is output.
[0075] S5. Using a four-dimensional delay propagation evaluation algorithm, the impact range of train delay propagation is quantified, and the prediction accuracy and propagation characteristic characterization ability of the HGT-GRU model are verified.
[0076] S51. Seed Train Selection: From the set of trains at the target originating station, select the first train with a predicted delay greater than 0 and an actual delay greater than 0 as the seed train, and record its actual departure time.
[0077] S52. Construct a propagation chain: Sort all delayed trains departing from the target originating station in ascending order of their actual departure times to form a delay propagation chain. The actual departure time is The train's travel distance is ;
[0078] S53. Calculation of four-dimensional propagation characteristics: Call the four-dimensional delay propagation evaluation algorithm to calculate the delay propagation rate, the spatial velocity of affected trains, the number of affected trains, and the number of affected stations;
[0079] Among them, the rate of delayed transmission (The delay propagation rate is defined as the number of trains affected by a primary delay per unit time. Empirical studies show that the typical propagation rates differ significantly for different anomaly types; a higher propagation rate indicates faster propagation of delays between trains.) The expression is as follows:
[0080] ;
[0081] in,
[0082] ;
[0083] In the formula, Indicates the initial delay; This indicates that all subsequently affected trains will be assembled, and ; Indicates the actual departure time; This indicates the actual departure time of the seed train; This indicates the subsequent assembly of affected trains. The first in A number of trains were affected.
[0084] Affected train space rate The expression is as follows:
[0085] ;
[0086] In the formula, Indicates the first The actual mileage traveled by the affected trains; This indicates the number of affected trains at a given timestamp; Indicates the total number of trains affected;
[0087] Number of trains affected The expression is as follows:
[0088] ;
[0089] In the formula, Indicates the first Affected trains The duration of the delay;
[0090] Number of stations affected The expression is as follows:
[0091] ;
[0092] In the formula, Indicates the first Affected trains Associated station nodes;
[0093] S54. Calculate the attention coefficient of the HGT model. :
[0094] ;
[0095] In the formula, and Representing nodes respectively ,node In edge type Attention The query vector and key vector below; Represents a node In edge type Attention The key vector below;
[0096] S55. Model Accuracy Validation: Using MAE and RMSE metrics, compare the predicted values of the HGT-GRU fusion model with the actual values to verify the model's prediction accuracy and delay propagation network modeling capability.
[0097] The specific algorithm flow in this embodiment is as follows:
[0098] Input: The set of train nodes for a given day Each train All have the following attributes: actual departure time (minutes), actual arrival time (minutes), actual mileage Actual delay time Predicted delay duration (minutes), and Select departure station From the station Departing trains subset .
[0099] Output: Delay propagation rate Affected train space rate Number of trains affected Number of stations affected .
[0100] Step 1: Selecting a Seed Train;
[0101] Identify from station The first delayed train to depart:
[0102] right Perform the traversal:
[0103] like and :
[0104] This train has been identified as a seed train. And record its actual arrival time. .
[0105] Step 2: Construct the propagation chain;
[0106] Building a transmission chain It must satisfy the following condition: for each member in the propagation chain : .
[0107] train subset Sort by actual departure time in ascending order;
[0108] End the traversal.
[0109] Step 3: Calculate the delay propagation rate;
[0110] For the transmission chain Each pair of consecutive trains Perform the calculation:
[0111] Calculate the time difference and coverage distance ;
[0112] Calculate the delay propagation rate: .
[0113] End the loop.
[0114] Step 4: Calculate the spatiotemporal delay propagation;
[0115] If we take As for the propagation distance, perform the following operations:
[0116] Calculate propagation time Subsequently, the formula for calculating the speed of spatial propagation is: .
[0117] otherwise:
[0118] return .
[0119] End the conditional judgment.
[0120] End the loop.
[0121] Step 5: Count the number of affected trains and stations;
[0122] Calculate the number of affected trains and the number of stations affected .
[0123] HGT assigns independent parameter sets to different relation types. Differentiated modeling of three relationships—departure-station, arrival-station, and following-train—captures the different mechanisms by which these relationships affect delay propagation. For example, the following edge emphasizes encoding the impact of planned departure interval (PDH) on delay propagation, while the train-station edge emphasizes the weighting of weather intensity and station level when nodes are mixed. The multi-head mechanism allows the model to learn multiple attention patterns in parallel across different subspaces. Size Focusing on certain semantic subsets, while the first The weight distribution of each attention point may emphasize other aspects. Finally, the node update is completed by averaging the weights of each attention point.
[0124] To further explain the propagation mechanism of train delays, the following explanation is provided in this embodiment: Figure 5As shown in the diagram, the numbers represent the self-attention scores of the nodes; the numbers above or to the left of the edges correspond to the attention scores of the three types of edges (departure edge, arrival edge, and following edge) from the node with the smaller number to the node with the larger number (e.g., nodes 0→6, 3→4); the numbers below or to the right of the edges correspond to the attention scores of the three types of edges from the node with the larger number to the node with the smaller number (e.g., nodes 6→0, 4→3). It should be noted that the complete delay propagation graph contains 38 nodes; due to space limitations, only the first 11 nodes are shown as examples.
[0125] As observed in the graph, the attention score for the following side from node 3 to node 9 is 0.45, indicating that the delay status of node 3 and the planned departure interval between the two nodes have a dominant influence on the delay of node 9. In the event of sudden extreme weather, train dispatchers can reduce the delay of node 9 by optimizing the train operation plan for node 3 or shortening the planned departure interval between node 3 and node 9. Similarly, the departure side attention score for the following side from node 5 to node 4 is 0.48, indicating that the planned departure time, actual departure time, and departure delay of node 5 are the core factors affecting the delay of node 4. Dispatchers can use this attention score to re-plan the departure times of trains at node 5 or optimize the train operation plan, thereby alleviating the delay problem of node 4 to some extent by improving the departure delay situation at node 5.
[0126] In summary, the attention score output by the HGT+GRU model can help train dispatchers accurately locate key delay nodes and core influencing factors in the network, providing a practical reference for dispatching decisions and train operation optimization in the event of sudden network delays under extreme weather conditions.
[0127] This invention combines HGT and GRU models in a time series manner. By sequentially applying the HGT model to a static time map to obtain daily node embeddings, and embedding the sequence into GRU, dynamic evolution learning of the dynamic graph is achieved. Compared with simple spatiotemporal convolutional networks (STGCN) or temporal Transformers, the HGT+GRU gating mechanism can better preserve key historical delay information, suppress noise, and capture long-term dependencies.
[0128] Simulation Experiment
[0129] like Figure 3 and Figure 4As shown, the simulation data is based on train delays caused by extreme weather on a railway network from 2022 to 2025, covering 13 stations of various levels in five cities. Six types of trains operate within the network (high-speed trains, electric multiple units, direct trains, express trains, fast trains, and commuter trains), with a maximum speed limit of 400 km / h, adjusted according to train class. Extreme weather warnings issued by meteorological bureaus were searched, and train data for the days of extreme weather events in the five cities within the network area were matched. The train data includes actual / planned departure and arrival times, extreme weather type and level, train number, type and level, departure station level, and delay duration. Finally, the 18,832 collected train delay data points were cleaned, and all data were randomly divided into two parts: 80% for the training set and 20% for the test set. Simultaneously, during model training, the data was randomly divided into two parts: 70% for training parameters and 30% for validation.
[0130] Validation Example 1: To verify the superiority of the HGT+GRU model, the following five representative benchmark models were selected for comparative experiments:
[0131] Batch Normalization (BN): Represents a basic feature normalization technique used to test the performance ceiling for heterogeneous and temporal modeling. Parameter settings: BN is integrated after each forward propagation of fully connected layers and graph convolutional layers. Hyperparameters include: mini-batch size (batch_size=32), momentum factor (momentum=0.9), and... The smoothing term (epsilon=1e-5) is calculated using stable values.
[0132] GCN (Graph Convolutional Network): Represents a static homogeneous graph neural network, used to compare the modeling ability of traditional graph models on structured data; Parameter settings: The GCN model adopts a two-layer GCN structure, with hidden dimensions set to 64 and 32, activation function is ReLU, L2 regularization coefficient (weight_decay) is 5e-4, learning rate is set to 1e-3, and training batch size is 64.
[0133] SVR (Support Vector Regression) and DELM (Deep Extreme Learning Machine) represent traditional machine learning and "extremely randomized" deep networks, respectively, and are used to verify the delay prediction performance of non-deep graph / non-temporal models. Parameter settings: The SVR model uses a linear kernel, a penalty coefficient C=2.0, and an insensitive loss threshold ε=0.1 to balance model complexity and generalization ability. The DELM model adopts a 3-layer DELM architecture, with randomized mapping dimensions of 256, 128, and 64 for each layer; the activation function is sigmoid; the output layer is set with an L2 regularization coefficient λ=1e-3, and batch closed least squares solution is used instead of iterative optimization, which can complete the training of thousands of samples in seconds, effectively comparing the timeliness and accuracy differences of deep GNNs.
[0134] FCL-IT (Fully-Connected Layers with Input-Time Encoding): Represents a pure temporal modeling scheme used to quantify the gain of spatial structure on delay prediction. Parameter settings: Input layer dimension 20; 3 hidden layers with 128, 64, and 32 units respectively; ReLU activation function; dropout ratio 0.3; optimizer Adam, initial learning rate 1e-4, weight decay = 1e-5; batch size 32.
[0135] The HGT+GRU model integrates the spatial heterogeneous modeling capability of the heterogeneous graph Transformer with the temporal dynamic capture advantage of GRU, highlighting its composite performance in joint learning of multiple relational dependencies and long and short-term temporal evolution.
[0136] To investigate the impact of edge features on the predictive performance of train delay models, the input features were classified into those containing only node features and those considering both node and edge features. The models were tested on six different models, with MAE and RMSE used as evaluation metrics. The results are shown in Table 1.
[0137] Table 1. Comparison of the impact of different input features on the performance of the baseline model
[0138]
[0139] like Figure 6As shown, the HGT+GRU model proposed in this invention significantly outperforms other comparative models when using joint input of node features and edge features. It achieves the best performance in both key evaluation metrics—mean absolute error (MAE) and root mean square error (RMSE)—with times of 0.258 minutes and 1.213 minutes, respectively, far lower than the corresponding values of other models. Notably, the HGT+GRU model already performs well using only node features, but its performance improvement is particularly significant after adding edge features, indicating its stronger modeling ability for structured spatiotemporal correlation information. In contrast, traditional machine learning models such as SVR, DELM, and the shallow neural network FCL-IT, while showing some improvement after introducing edge features, still lag behind HGT-GRU in overall performance.
[0140] In summary, the advantages of HGT+GRU are as follows: First, its heterogeneous graph structure can distinguish the interaction relationships between different types of nodes and edges, and capture key factors in the propagation path through a multi-head attention mechanism; second, by combining GRU gated cyclic units to dynamically model train timing dependencies, it effectively handles the nonlinear and complex laws of delay propagation in the spatiotemporal network.
[0141] Validation Example 2: Validate the model performance on the characteristics of delayed propagation.
[0142] In this simulation experiment, taking the red alert for extreme weather and rainstorm issued by a city on June 23, 2022, which caused a sudden large-scale train delay on the railway network as an example, we analyze the delay propagation graph on that day (actual delay > 0) and demonstrate the model performance in terms of delay propagation characteristics.
[0143] Because sudden extreme weather events are often localized, causing damage only in specific areas, the fixed limitations of railway network capacity mean that if one node (station) is affected, the delay will spread "from point to area" in a network-like manner. Therefore, the algorithm selected trains whose departure or arrival stations were a certain city's railway station and its south station, with actual delay times greater than 0, resulting in four propagation chains: propagation chain 1, propagation chain 2, propagation chain 3, and propagation chain 4.
[0144] Table 2 Propagation Chain 1
[0145]
[0146] Table 3 Propagation Chain 2
[0147]
[0148] Table 4 Propagation Chain 3
[0149]
[0150] Table 5. Transmission Chain 4
[0151]
[0152] As shown in Tables 2-5, propagation chain 3... The maximum is 0.10753 columns / minute, in propagation chain 1. The minimum delay was 0.00664 trains per minute, indicating that delays propagate faster in propagation chain 3, with approximately 6 trains affected per hour. Furthermore, comparing predicted and actual delays reveals that the discrepancies mostly occur with trains experiencing longer delays. This may be because train delay data follows a "vertical tail distribution," with fewer instances of long delays, suggesting the model was not sufficiently trained.
[0153] 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 method for predicting passenger train delay propagation based on the HGT-GRU model, characterized in that: Includes the following steps: S1. Based on the railway dispatching system database, construct a railway network structure operation map, obtain the train operation data in the railway network under extreme weather conditions, extract train operation characteristics, construct a train delay feature dataset, obtain a standard dataset after preprocessing, and finally divide the standard dataset into training set and test set according to the proportion. S2. Based on the standard dataset extracted in step S1, construct a heterogeneous graph containing train event nodes and station nodes, define three types of relationships: departure edge, arrival edge, and following edge, and assign all features to complete the feature mapping and structured modeling of the heterogeneous graph. S3. Construct an HGT-GRU model, capture the key elements affecting train delays in heterogeneous graphs through the multi-head attention mechanism in the HGT model, score each node and edge in the heterogeneous graph, and input the node and edge weights output by the HGT model into the GRU model for temporal evolution learning to complete the joint modeling and training of delay propagation features. S4. Input the test set from step S1 into the HGT-GRU model trained in step S3, output the train delay time prediction results, and use the mean absolute error and root mean square error to comprehensively evaluate the train delay time prediction results. S5. Calculate the delay propagation rate, the spatial velocity of affected trains, the number of affected trains, and the number of affected stations to obtain the four-dimensional propagation characteristics; The attention coefficient of the HGT model is calculated to quantify the propagation impact range of train delays. The MAE and RMSE indices are used to compare the predicted and actual values of the HGT-GRU model to verify its prediction accuracy. The delay propagation rate is defined as the number of trains affected by the primary delay per unit time, and the spatial rate of the affected trains. The expression is as follows: ; In the formula, Indicates the first The actual mileage traveled by the affected trains; This indicates the number of affected trains at a given timestamp; Indicates the total number of trains affected; Indicates the actual departure time; This indicates the actual departure time of the seed train; S6. Based on the train delay time prediction results output in step S4 and the four-dimensional propagation features in step S5, generate a visual decision reference report for train scheduling, collect train operation feedback data after actual scheduling, and dynamically update the train delay feature dataset in step S1 and the heterogeneous graph feature attributes in step S2.
2. The passenger train delay propagation prediction method based on the HGT-GRU model according to claim 1, characterized in that: Step S1 specifically includes the following steps: S11. Railway Network Sampling and Operation Map Construction: Perform structured sampling on the target railway network to construct a railway network structure operation map that includes train operation paths, station distribution, and section relationships; S12. Data Acquisition: Based on the constructed railway network operation map, collect historical train operation data of the railway network under extreme weather conditions to obtain a dataset of train delay characteristics. ,in, , and These represent extreme weather and static attributes, planned timetable characteristics, and actual timetable characteristics as delay propagation features, respectively. , Indicates extreme weather type, , This represents the total number of extreme weather types. Indicates the intensity of extreme weather. , Indicates the train class. , Indicates the station class, , Indicates train number The origin-destination interval; , Indicates train On the site The planned arrival time Indicates train On the site The scheduled departure time, , Indicates train On the site The planned stop duration, Indicates site The planned departure interval , Indicates train On the site The scheduled departure time; , Indicates train On the site The actual arrival time Indicates train On the site The actual departure time Indicates train On the site Arrival delay, , Indicates train On the site Departure delay, , Indicates train From the site to station The actual driving time , Indicates train From the site to station Actual mileage Indicates train On the site Total delay time ; S13. Data Filtering: Filter extreme weather types that cause train delays, including rainstorms, thunderstorms, strong winds, severe convective weather and typhoon warnings, and remove data corresponding to weather warnings that have no impact, including cold wave warnings. S14. Data cleaning: Remove outliers and missing values, retain valid delayed data, and obtain a standard dataset; S15. Data Distribution Optimization and Partitioning: To address the imbalanced nature of train delay data, the standard dataset is randomly divided into an 80% training set and a 20% test set; the training set is then further split into a parameter training subset and a model validation subset in a 7:3 ratio.
3. The passenger train delay propagation prediction method based on the HGT-GRU model according to claim 2, characterized in that: Step S2 specifically includes the following steps: S21. Define heterogeneous graphs ,in, Represents a set of nodes; Represents the set of edges; Represents a node type mapping function; Represents a set of edge types; S22. Define heterogeneous graph nodes: a set of nodes , Indicates the first A subset of nodes of type node, and ,in For train event nodes, For station nodes; S23. Define the edge type of a heterogeneous graph: edge set , Representing edge type The edge subset; These represent the departure edge, arrival edge, and following edge, respectively. S24. Assign attributes using the full feature allocation scheme: when At that time, define the attributes of each node. ;when hour, , Indicates the departure station; Indicates the arrival station; For each edge Define its attribute vector Among them, the departure side Reaching the edge , and the side ,in, and These represent the scheduled delay time and the actual delay time, respectively. and These represent the planned delay time and the actual delay time, respectively. This indicates the difference in planned departure times between the two vehicles. S25. Feature Mapping: Define type mapping functions By using type mapping functions, nodes and edges are mapped to their respective types, thus completing structured modeling.
4. The passenger train delay propagation prediction method based on the HGT-GRU model according to claim 3, characterized in that: In the heterogeneous graph described in step S2, feature spaces and message passing methods are designed for different types of entities and relationships. The formal message passing framework expression is as follows: ; In the formula, Indicates the first Layer nodes Hidden representations; Indicates the first Layer nodes Hidden representations; Indicates the first Layer nodes Hidden representations; Represents nodes By edge type The set of all connected neighboring nodes; For activation functions; edge type The message passing function.
5. The passenger train delay propagation prediction method based on the HGT-GRU model according to claim 4, characterized in that: Step S3 specifically includes the following steps: S31. Set the optimal hyperparameter combination for the HGT-GRU fusion model: HGT layer count = 2, attention head count = 32, hidden dimension = 32, GRU layer count = 1, dropout ratio = 0.3, learning rate = 10. -5 ; S32 and HGT model feature extraction and scoring: S321, Type-Specific Linear Transformation: Perform key-query-value mapping for each node type: ; In the formula, , and They represent the first Layers based on node type The key, query, and value mapping matrix, and , Indicates the matrix dimension; , and They represent the first Layer nodes The key vector, query vector, and value vector; S322, Relationship-Specific Transformation: Apply relation-specific keys and query transformations to each edge type: ; In the formula, and Representing edge types respectively The key and query transformation matrix, and ; and They represent the first Within the layer, for edge types From node To the node The key vector and query vector; Indicates the first Within the layer, depending on the node type nodes The key vector; Indicates the first Within the layer, depending on the node type nodes The query vector; S323. Calculate the attention weights between nodes: ; In the formula, Indicates the first In the layer, the first Attention head, targeting edge type from node To the node Attention weights; and They represent the first Within the layer, for edge types From node To the node The query vector and key vector; Indicates the inner product; This represents the vector dimension of each attention head; and , Indicates the number of attention heads; S324. Aggregate neighbor node information based on attention weights and update node representations: ; In the formula, Indicates the first In the layer, nodes Updated node representation vector; Representing edge type The output mapping, and ; Indicates the first Within the layer, for edge types nodes The value vector; Indicates the number of heads of attention; S33, GRU Model Temporal Evolution: The node and edge weights output by the HGT model are fed into a single-layer GRU to learn the temporal dependency of delay propagation and complete dynamic prediction modeling. S34. Model Training: Train the HGT-GRU fusion model using a training subset, monitor loss changes through a validation subset, iteratively optimize the parameters of the HGT-GRU fusion model until convergence, and output the trained HGT-GRU fusion model.
6. The passenger train delay propagation prediction method based on the HGT-GRU model according to claim 5, characterized in that: Step S5 specifically includes the following steps: S51. Seed Train Selection: From the set of trains at the target originating station, select the first train with a predicted delay greater than 0 and an actual delay greater than 0 as the seed train, and record its actual departure time. S52. Construct a propagation chain: Sort all delayed trains departing from the target originating station in ascending order of their actual departure times to form a delay propagation chain. The actual departure time is The train's travel distance is ; S53. Calculation of four-dimensional propagation characteristics: Call the four-dimensional delay propagation evaluation algorithm to calculate the delay propagation rate, the spatial velocity of affected trains, the number of affected trains, and the number of affected stations; Among them, the rate of delayed transmission The expression is as follows: ; in, ; In the formula, Indicates the initial delay; This indicates that all subsequently affected trains will be assembled, and ; This indicates the subsequent assembly of affected trains. The first in A number of trains were affected. Affected train space rate The expression is as follows: ; In the formula, Indicates the first The actual mileage traveled by the affected trains; This indicates the number of affected trains at a given timestamp; Indicates the total number of trains affected; Number of trains affected The expression is as follows: ; In the formula, Indicates the first Affected trains The duration of the delay; Number of stations affected The expression is as follows: ; In the formula, Indicates the first Affected trains Associated station nodes; S54. Calculate the attention coefficient of the HGT model. : ; In the formula, and Representing nodes respectively ,node In edge type Attention The query vector and key vector below; Represents a node In edge type Attention The key vector below; S55. Model Accuracy Validation: Using MAE and RMSE metrics, compare the predicted values of the HGT-GRU fusion model with the actual values to verify the model's prediction accuracy and delay propagation network modeling capability.