A train-to-port arrival prediction method based on deep learning

By using an improved AttentionTTE network, combined with trajectory-environment feature encoding and causal constraint reasoning, the problem of poor model generalization ability in train arrival prediction was solved, achieving high-precision multi-task prediction and scheduling optimization, and improving the level of port scheduling intelligence.

CN121352140BActive Publication Date: 2026-03-27TOP XINGDA
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-12-16
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

Existing methods for predicting train arrivals are unable to capture the phased patterns and causal relationships in the trajectory sequence when faced with disturbances such as scheduling and control, line level switching, weather changes, and port congestion. This results in poor model generalization ability, insufficient feature representation ability, and a lack of feedback optimization and closed-loop updates, affecting the reliability and response efficiency of scheduling instructions.

Method used

An improved AttentionTTE network is adopted, which combines trajectory-environment feature encoding, stage attention modeling, causal constraint reasoning and multi-task prediction. Through segmented attention module, inter-segment causal similarity module and environment modulation module, the deep integration of trajectory semantics and environment semantics is achieved. The model parameters are optimized by real-time feedback data, and a closed-loop self-learning scheduling optimization system is constructed.

Benefits of technology

It significantly improves the accuracy of train arrival forecasts and the timeliness of dispatch response, enhances the flexibility and intelligence of port operation scheduling, and strengthens the model's generalization ability and prediction accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121352140B_ABST
    Figure CN121352140B_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on deep learning's train-to-port prediction method, comprising: step one: collecting train operation trajectory data and operating environment data;Step two: feature encoding is carried out, generates track feature sequence and environment feature sequence;Step three: track feature sequence and environment feature sequence are input to improved AttentionTTE network, track feature is extracted and environment semantics is fused, and environment-track feature vector is generated;Step four: based on environment-track feature vector, multi-task prediction is carried out;Step five: based on multi-task prediction result, scheduling control operation is executed;Step six: real-time acquisition feedback data, and through prediction error loss and target perception contrast loss joint optimization improved AttentionTTE network and model parameter;Step seven: the optimized model parameter is versioned and deployed.The application improves the accuracy of train-to-port prediction and the intelligent level of scheduling response.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of intelligent transportation and industrial data intelligent analysis, and particularly relates to a train-to-port prediction method based on deep learning. BACKGROUND

[0002] With the improvement of the digital level of railway transportation, port train scheduling and arrival state prediction have become key technologies that need to be broken through in the intelligent transportation system. In order to improve the efficiency of port connection and the rationality of yard resource allocation, the train-to-port prediction method based on trajectory data and environmental factors has gradually attracted widespread attention. The existing methods mainly rely on historical operation time statistics rules or simple machine learning models for static regression prediction, but there are generally the following problems in actual scenarios:

[0003] The train operation process is disturbed by scheduling control, line grade switching, weather changes, and port congestion, and other factors. The existing methods are difficult to depict the stage rule and cause-effect relationship in the trajectory sequence, resulting in poor model generalization ability; the trajectory data and environmental information are highly heterogeneous, the time steps are not aligned and the dimensions are different, and the traditional splicing fusion strategy cannot realize semantic cascading, resulting in insufficient fusion feature expression ability; the prediction task itself has multiple objectives of state classification and time regression, but most models do not establish a sharing and decoupling mechanism between tasks, making it difficult to simultaneously consider prediction accuracy and stability; the prediction model lacks feedback optimization and closed-loop update, resulting in performance degradation and error accumulation in the long-term operation process, affecting the reliability and response efficiency of the scheduling instruction.

[0004] Therefore, how to provide a train-to-port prediction method based on deep learning is a problem that those skilled in the art need to solve. SUMMARY

[0005] One object of the present application is to provide a train-to-port prediction method based on deep learning. The present application fully integrates trajectory time sequence modeling and running environment semantic analysis, designs an improved AttentionTTE network structure, and details the trajectory-environment joint feature encoding, stage attention modeling, cause-effect constraint reasoning, and multi-task prediction, which has the advantages of high prediction accuracy, strong scheduling adaptability, and strong feedback optimization and closed-loop capability.

[0006] According to the train-to-port prediction method based on deep learning of the present application, the following steps are included:

[0007] Step 1: Collect train operation trajectory data and running environment data;

[0008] Step 2: Feature encoding of train operation trajectory data and running environment data to generate trajectory feature sequence and environment feature sequence, respectively;

[0009] Step 3: Input the trajectory feature sequence and environment feature sequence into the improved AttentionTTE network to extract trajectory features and fuse environment semantics to generate an environment-trajectory feature vector. The improved AttentionTTE network includes a segmented attention module, an inter-segment causal similarity module, and an environment modulation module.

[0010] Step 4: Perform multi-task prediction based on environment-trajectory feature vectors and output the multi-task prediction results;

[0011] Step 5: Based on the multi-task prediction results, execute scheduling control operations;

[0012] Step 6: Collect feedback data in real time, and jointly optimize the improved AttentionTTE network and model parameters by combining prediction error loss and target perception contrast loss;

[0013] Step 7: Update the optimized model parameters and deploy them on the embedded terminal.

[0014] Optionally, the train operation trajectory data includes a sequence of station numbers along the train route, a sequence of train operation order identifiers, arrival and departure times of each station, and distance information between stations; the operating environment data includes weather conditions, holiday identifiers, line level, train type, and port congestion status information.

[0015] Optionally, the step of performing feature encoding on the train's trajectory data and operating environment data to generate trajectory feature sequences and environment feature sequences respectively involves:

[0016] Convert the sequence of station numbers along the train route into a sequence of discrete integer index values;

[0017] Construct a trainable embedding matrix, wherein the number of rows of the trainable embedding matrix is ​​equal to the number of site numbers in the set of site number indices, and the number of columns is equal to the set embedding vector dimension;

[0018] The discrete integer index value of each site is mapped to the corresponding embedding vector by looking up a table, and all embedding vectors are organized into a site embedding vector sequence.

[0019] The train operation sequence identifier is encoded using the sine and cosine position encoding method to form a position encoding vector sequence;

[0020] Perform difference calculation on the arrival and departure times of adjacent stations to generate a station interval feature sequence;

[0021] The station embedding vector sequence, the location encoding vector sequence, and the station interval feature sequence are concatenated to form a standardized trajectory sequence.

[0022] The weather condition, line grade, and train type are converted into discrete category index values, and the discrete category indexes are encoded by one-hot to generate corresponding category feature vectors, the holiday identifier is encoded by a Boolean value to generate a binary feature vector, and the port congestion state is normalized to generate a continuous numerical feature vector;

[0023] The various category features, binary feature vectors, and continuous numerical feature vectors are spliced to form an environment feature sequence.

[0024] Optionally, the segment attention module divides the trajectory feature sequence and performs attention modeling and feature compression to generate a trajectory attention feature matrix, specifically:

[0025] The trajectory feature sequence is divided according to a preset physical running section to obtain a plurality of trajectory subsequences, and the physical running section includes a dispatch control boundary section, a road network grade conversion section, and a station dense section;

[0026] Each trajectory subsequence is calculated by linear mapping to obtain a query matrix, a key matrix, and a value matrix, and self-attention operation is performed based on the query matrix, the key matrix, and the value matrix to generate a trajectory attention feature matrix;

[0027] Each trajectory attention feature matrix is averaged and pooled along the trajectory time step dimension to compress the trajectory point level features to generate a trajectory attention feature vector, and all trajectory attention feature vectors are vertically stacked and spliced according to the physical running order of the trajectory subsequence to form a trajectory attention feature matrix.

[0028] Optionally, the inter-segment causal similarity module performs inter-segment similarity modeling and causal constraints on the trajectory attention feature matrix to generate an inter-segment causal trajectory matrix, specifically:

[0029] The similarity between any two trajectory attention feature vectors is calculated by a cosine similarity function to obtain an inter-segment similarity matrix, and the dimension of the inter-segment similarity matrix is consistent with the number of trajectory subsequences;

[0030] Each row of the inter-segment similarity matrix is normalized by a Softmax function to obtain an inter-segment weight matrix;

[0031] A causal mask matrix is introduced, and the causal mask matrix has the same dimension as the inter-segment weight matrix. When the column index of the causal mask matrix does not exceed the row index, the corresponding element in the causal mask matrix is set to 1, otherwise it is set to 0;

[0032] The inter-segment weight matrix and the causal mask matrix are multiplied element by element to generate a causal weight matrix;

[0033] The causal weight matrix is subjected to a matrix multiplication operation with the track attention feature matrix to generate an inter-segment causal track matrix.

[0034] Optionally, the environment modulation module performs channel-level modulation on the inter-segment causal track matrix based on the environment feature sequence to generate an environment-track feature vector, specifically:

[0035] The environment feature sequence is compressed along the time step dimension by an average pooling method to generate a global environment feature vector.

[0036] The global environment feature vector is input into a fully connected network to perform linear mapping and GELU activation operations to generate an intermediate feature vector.

[0037] The intermediate feature vector is normalized by Sigmoid to generate a channel modulation factor vector and by a tanh activation function to generate a channel adjustment offset vector.

[0038] The channel modulation factor vector is subjected to an element-level multiplication with each track channel vector in the inter-segment causal track matrix, and is added to the channel adjustment offset vector to generate an environment-track feature vector.

[0039] Optionally, the environment-track feature vector is used for multi-task prediction to output multi-task prediction results, including a train-to-port state label, a train-to-port time prediction value, and a train-to-port time confidence interval.

[0040] The environment-track feature vector is subjected to dimension compression and semantic reconstruction by a shared feature encoding layer to generate a shared feature vector, the shared feature encoding layer adopts a linear transformation by a layer of fully connected network and a non-linear mapping by a ReLU activation function.

[0041] The shared feature vector is input into a layer of state prediction fully connected layer and is normalized by a Softmax activation function to output a state label probability distribution vector, and an index corresponding to the maximum probability in the state label probability distribution vector is taken as a train-to-port state label.

[0042] The train-to-port state label includes L0: normal arrival, L1: slight delay, L2: serious delay, and L3: early arrival.

[0043] The shared feature vector is input into a layer of regression prediction fully connected layer to perform linear transformation and output a train-to-port time prediction value.

[0044] The shared feature vector is input into two prediction sub-networks to generate a train-to-port time prediction mean vector and a prediction standard deviation vector, respectively.

[0045] Based on the train-to-port time prediction mean vector and the prediction standard deviation vector, a train-to-port time confidence interval is generated by normal confidence.

[0046] Optionally, the scheduling control operation is specifically:

[0047] The multi-task prediction result is transmitted to a port scheduling management system;

[0048] If the train set arrival state label is L0, the original connection operation plan and the yard scheduling scheme remain unchanged;

[0049] If the train set arrival state label is L1, and the predicted arrival time is within 5 minutes of the planned time threshold, the pre-allocated track occupation period is postponed, the starting time of the loading and unloading equipment is delayed, and a low-level warning is generated;

[0050] If the train set arrival state label is L2, and the predicted arrival time is delayed by 5 to 20 minutes of the planned time threshold, the connection resources are released in advance, the yard scheduling is re-planned, and a medium-level warning is generated;

[0051] If the train set arrival state label is L2, and the predicted arrival time is delayed by more than 20 minutes of the planned time threshold, an emergency scheduling plan is enabled, the connection and loading and unloading processes are rearranged, and a high-level warning is generated;

[0052] If the train set arrival state label is L3, and the predicted arrival time is earlier than the planned time threshold by more than 5 minutes, the track occupation and loading and unloading equipment scheduling plan is adjusted in advance, and an early warning is generated;

[0053] If the arrival time confidence interval range exceeds the set threshold, the connection scheduling scheme is executed by default, and a "predicted fluctuation is large" state is marked;

[0054] The level warning and the marked state are recorded and pushed to the port scheduling terminal system in real time.

[0055] Optionally, the feedback data includes historical train set arrival state labels, historical arrival time prediction values, historical arrival time confidence intervals, actual arrival state labels, actual arrival times, and actual scheduling execution results;

[0056] The prediction error loss is the mean square error between the predicted arrival time and the actual arrival time;

[0057] The target perception contrast loss adopts an InfoNCE loss form, wherein a positive sample pair is an environment-track feature vector with the same label in the historical train set arrival state label, and a negative sample pair is an environment-track feature vector with different labels;

[0058] The model parameters include linear mapping weights and bias terms for generating a query matrix, a key matrix and a value matrix in the segmented attention module, parameters for calculating inter-segment similarity, normalization weights and causal mask adjustment in the inter-segment causal similarity module, full connection network weights and bias terms for generating a channel modulation factor vector and a channel adjustment offset vector in the environment modulation module, and linear mapping weights and bias terms of a shared feature encoding layer, a state prediction fully connected layer, a regression prediction fully connected layer and a prediction subnetwork in the multi-task prediction network.

[0059] The beneficial effects of the present application are:

[0060] Firstly, the present application collects train operation trajectory data and operation environment data, and encodes them into trajectory feature sequences and environment feature sequences respectively, introduces trainable embedding matrices, sine-cosine position encoding methods and normalization strategies, realizes unified modeling of multi-source heterogeneous input data, and effectively improves the expression ability of original information and the understanding depth of the model to the trajectory evolution process.

[0061] Secondly, the improved AttentionTTE network combines the segmented attention module, the inter-segment causal similarity module and the environment modulation module, can construct sub-sequence level attention representation based on the trajectory physical operation segment, introduce causal mask constraint to improve the temporal logic expression between trajectory features, and use the environment feature sequence for channel level modulation, so as to realize the deep fusion of trajectory semantics and environment semantics.

[0062] In addition, the multi-task prediction based on environment-trajectory feature vectors outputs the train arrival state label and the arrival time prediction value, and through the confidence interval, the interpretability and scheduling reference value of the prediction result are enhanced; and in the scheduling control operation, according to the prediction result and the confidence interval state, the scheduling strategy is automatically matched, the hierarchical optimization response of train connection, yard scheduling and loading and unloading equipment deployment plan is realized, and the flexibility and intelligent level of port operation scheduling are effectively improved. Through real-time collection of feedback data, a joint optimization mechanism of prediction error loss and target perception comparison loss is constructed, the generalization ability and model precision of the improved AttentionTTE network are further improved, and through continuous version update and embedded terminal deployment of model parameters, a closed-loop self-learning scheduling optimization system is constructed.

[0063] In summary, the present application can significantly improve the accuracy of train arrival prediction, the timeliness of scheduling response and the intelligent level of model operation, and has good practical value and engineering popularization prospect. BRIEF DESCRIPTION OF DRAWINGS

[0064] The accompanying drawings are included to provide a further understanding of the present application, and constitute a part of the specification, together with the embodiments of the present application, to explain the present application, and do not constitute a limitation on the present application. In the drawings:

[0065] Fig. 1 is a schematic diagram of a train-to-port prediction method based on deep learning proposed by the present application;

[0066] Fig. 2 is a flowchart of a trajectory feature encoding structure in a train-to-port prediction method based on deep learning proposed by the present application;

[0067] Fig. 3 is a flowchart of an improved AttentionTTE network structure in a train-to-port prediction method based on deep learning proposed by the present application. DETAILED DESCRIPTION

[0068] The present application will now be further described in detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams and only illustrate the basic structure of the present application in a schematic manner, and therefore only show the components related to the present application.

[0069] Reference Figs. 1-3 A train-to-port prediction method based on deep learning includes the following steps:

[0070] Step 1: Collect train operation trajectory data and operation environment data;

[0071] Step 2: Feature encode the train operation trajectory data and operation environment data to generate trajectory feature sequences and environment feature sequences, respectively;

[0072] Step 3: Input the trajectory feature sequences and environment feature sequences into an improved AttentionTTE network to extract trajectory features and fuse environmental semantics, generating an environment-trajectory feature vector, the improved AttentionTTE network including a segmented attention module, an inter-segment causal similarity module, and an environment modulation module;

[0073] Step 4: Perform multi-task prediction based on the environment-trajectory feature vector, outputting multi-task prediction results;

[0074] Step 5: Based on the multi-task prediction results, perform scheduling control operations;

[0075] Step 6: Collect feedback data in real time, and jointly optimize the improved AttentionTTE network and model parameters through prediction error loss and target perception comparison loss;

[0076] Step 7: Update the optimized model parameters and deploy them on an embedded terminal.

[0077] In the embodiment, the train operation track data includes a train passing station number sequence, a train operation sequence identification sequence, arrival time and departure time of each station, and distance information between stations; and the operation environment data includes weather conditions, holiday identification, line level, train type, and port congestion state information.

[0078] In the embodiment, the train operation track data and the operation environment data are feature-encoded to generate a track feature sequence and an environment feature sequence, specifically:

[0079] The train passing station number sequence is converted into a discrete integer index value sequence;

[0080] A trainable embedding matrix is constructed, the number of rows of the trainable embedding matrix being equal to the number of station numbers in the set of station number indexes, and the number of columns being equal to the set embedding vector dimension;

[0081] Each station's discrete integer index value is mapped to a corresponding embedding vector through a lookup table method, and all embedding vectors are organized into a station embedding vector sequence;

[0082] For example, a certain train actually passes through the station number index set ["ZK101", "ZK203", "ZK305"], in the preset station number dictionary, "ZK101" is mapped to a discrete index value 12, "ZK203" is mapped to an index value 47, and "ZK305" is mapped to an index value 89. Assuming that the embedding vector dimension is 6, the trainable embedding matrix is a two-dimensional tensor with a size of (total number of stations x 6), wherein each row corresponds to an embedding vector of a station. The corresponding embedding result is obtained through the lookup table method: the embedding vector corresponding to the index value 12 is [0.15, -0.02, 0.33, 0.18, 0.07, -0.10], the embedding vector corresponding to the index value 47 is [-0.04, 0.29, 0.11, -0.17, 0.23, 0.02], and the embedding vector corresponding to the index value 89 is [0.08, 0.12, -0.09, 0.26, -0.03, 0.19]. The above three embedding vectors are organized in order, and a station embedding vector sequence with a length of 3 and a dimension of 6 for each vector is obtained. This process realizes the conversion from the original station number to the low-dimensional dense vector space, which helps the deep network to fully mine the semantic relationship and geographical correlation in the station sequence.

[0083] The train operation sequence identification sequence is encoded by a sine-cosine position encoding method to form a position encoding vector sequence, specifically:

[0084] Assuming that the train operation sequence identification sequence is , and the encoding dimension is , the position encoding vector of each sequence identification is defined as:

[0085] ,

[0086] ;

[0087] wherein, denotes the running order position, denotes the index of the order identifier, is the encoding dimension;

[0088] For example, the sequence of the train running order identifier is , the encoding dimension is set as , and for the order identifier , the encoding result is: ;

[0089] The difference calculation is performed on the arrival time and the departure time of the adjacent stations to generate a sequence of station interval features;

[0090] The sequence of the station embedding vector, the sequence of the position encoding vector, and the sequence of the station interval features are spliced to form a standardized trajectory sequence;

[0091] The weather condition, the line grade, and the train type are respectively converted into discrete category index values, and the discrete category indexes are encoded by one-hot encoding to generate corresponding category feature vectors. The holiday identifier is encoded by a Boolean value to generate a binary feature vector. The port congestion state is normalized to generate a continuous numerical feature vector;

[0092] The category feature vectors, the binary feature vectors, and the continuous numerical feature vectors are spliced to form an environment feature sequence.

[0093] In the embodiment, the segmented attention module divides the trajectory feature sequence and performs attention modeling and feature compression to generate a trajectory attention feature matrix, specifically:

[0094] The trajectory feature sequence is divided according to a preset physical running section to obtain a plurality of trajectory sub-sequences, and the physical running section includes:

[0095] Dispatching control boundary section: indicating the running interval controlled by different dispatching centers during the running of the train;

[0096] Road network grade conversion section: indicating the line transition interval in the running trajectory from a high-grade trunk line to a low-grade branch line or vice versa;

[0097] Station-intensive section: indicating the running section of the train when entering or leaving the port hub area, during which the train frequently stops at multiple stations;

[0098] Each trajectory sub-sequence is calculated through a linear mapping to obtain a query matrix, a key matrix and a value matrix, and self-attention operation is performed based on the query matrix, the key matrix and the value matrix to generate a trajectory attention feature matrix;

[0099] Each trajectory attention feature matrix is subjected to average pooling along the trajectory time step dimension to compress the trajectory point level features, generate a trajectory attention feature vector, and all trajectory attention feature vectors are vertically stacked and spliced according to the physical running order of the trajectory sub-sequences to form a trajectory attention feature matrix.

[0100] In the present application, the segmented attention module can improve the local perception ability of trajectory modeling and the representation stability between running segments. First, the complete trajectory feature sequence is divided into multiple sub-segments according to the physical properties of the trajectory, so that the improved AttentionTTE network can focus on the internal variation law of the features in different segments. The self-attention mechanism is performed in each trajectory sub-segment, the dynamic dependency relationship between the trajectory points in the segment is learned, and a trajectory attention feature vector with position semantics and local context perception ability is generated. Through average pooling compression and splicing, a hierarchical trajectory attention feature matrix is constructed to realize the structured modeling of trajectory information. Through segmented attention, the improved AttentionTTE network significantly improves the accuracy in abnormal trajectory segment identification and key moment state prediction, and enhances the understanding ability and prediction robustness of complex trajectory sequences.

[0101] In the present embodiment, the inter-segment causal similarity module performs inter-segment similarity modeling and causal constraint on the trajectory attention feature matrix to generate an inter-segment causal trajectory matrix, specifically:

[0102] The similarity between any two trajectory attention feature vectors is calculated by a cosine similarity function to obtain an inter-segment similarity matrix, and the dimension of the inter-segment similarity matrix is consistent with the number of trajectory sub-sequences;

[0103] Each row of the inter-segment similarity matrix is subjected to a normalization operation by a Softmax function to obtain an inter-segment weight matrix;

[0104] A causal mask matrix is introduced, and the dimension of the causal mask matrix is consistent with that of the inter-segment weight matrix. When the column index of the causal mask matrix does not exceed the row index, the corresponding element in the causal mask matrix is set to 1, otherwise it is set to 0;

[0105] The inter-segment weight matrix and the causal mask matrix are subjected to element-level multiplication to generate a causal weight matrix;

[0106] The causal weight matrix and the trajectory attention feature matrix are subjected to matrix multiplication to generate an inter-segment causal trajectory matrix.

[0107] In this invention, the inter-segment causal similarity module is used to enhance the temporal dependency modeling capability between trajectory sub-segments and improve the accuracy of capturing the trend of changes in running state. This module uses a cosine similarity function to calculate the similarity between any two trajectory attention feature vectors, constructing an inter-segment similarity matrix to measure the semantic relevance between trajectory sub-segments. The Softmax function is used to normalize each row of the similarity matrix to generate an inter-segment weight matrix, ensuring the probabilistic distribution of the association weights of each segment. A causal mask matrix is ​​introduced to impose causal constraints on the inter-segment weight matrix, retaining only the influence of the previous segment on the current segment, thus generating a causal weight matrix with temporal unidirectionality. This causal weight matrix is ​​then multiplied with the original trajectory attention feature matrix to fuse the inter-segment causal information, obtaining the inter-segment causal trajectory matrix. Through similarity fusion and causal masking, the improved AttentionTTE network's ability to model the evolution of trajectory states is effectively enhanced, exhibiting higher stability and generalization performance in dynamic running prediction scenarios.

[0108] In this embodiment, the environment modulation module performs channel-level modulation on the inter-segment causal trajectory matrix based on the environment feature sequence to generate an environment-trajectory feature vector, specifically:

[0109] The environmental feature sequence is compressed along the time step dimension by average pooling to generate a global environmental feature vector;

[0110] The global environment feature vector is input into a fully connected network, and linear mapping and GELU activation operations are performed to generate intermediate feature vectors.

[0111] The intermediate feature vector is normalized using Sigmoid to generate the channel modulation factor vector, and the channel adjustment offset vector is generated using the tanh activation function.

[0112] Perform element-wise multiplication between the channel modulation factor vector and each trajectory channel vector in the inter-segment causal trajectory matrix, and add this to the channel adjustment offset vector to generate the environment-trajectory feature vector:

[0113] ;

[0114] in, This represents Hadamard multiplication. Represents the first segment in the inter-segment causal trajectory matrix A trajectory channel vector, For channel modulation factor vectors, Adjust the offset vector for the channel. This is the environment-trajectory feature vector.

[0115] In the present application, the environment modulation module is used to improve the adaptability of the improved AttentionTTE network to the difference in operating environment and the prediction accuracy. Specifically, the environment feature sequence is first compressed into a global environment feature vector through average pooling, and then input into a fully connected network to generate a channel modulation factor and a channel offset vector, which are used to adjust the response intensity and bias correction of the trajectory feature in different channel dimensions. Subsequently, the modulation factor and the trajectory feature are multiplied element by element, and added to the offset vector to realize dynamic weighting and semantic reconstruction of the trajectory feature. The modulation mechanism effectively introduces the regulation of environmental factors such as weather, holidays, and line grade on the trajectory modeling results, so that the improved AttentionTTE network can flexibly adapt to different operating environment conditions, thereby improving the accuracy and robustness of state label determination and arrival time estimation.

[0116] In the present embodiment, the multi-task prediction based on the environment-trajectory feature vector is performed, and the multi-task prediction result is output, which includes the train arrival state label, the arrival time prediction value and the arrival time confidence interval. Specifically,

[0117] The environment-trajectory feature vector is dimensionally compressed and semantically reconstructed by a shared feature encoding layer to generate a shared feature vector. The shared feature encoding layer adopts a fully connected network for linear transformation and a ReLU activation function for non-linear mapping;

[0118] The shared feature vector is input into a state prediction fully connected layer, and normalized by a Softmax activation function to output a state label probability distribution vector. The index corresponding to the maximum probability in the state label probability distribution vector is taken as the train arrival state label;

[0119] The train arrival state label includes L0: normal arrival, L1: slight delay, L2: serious delay, and L3: early arrival;

[0120] The shared feature vector is input into a regression prediction fully connected layer to perform linear transformation and output an arrival time prediction value;

[0121] The shared feature vector is input into two prediction sub-networks to generate an arrival time prediction mean vector and a prediction standard deviation vector, respectively;

[0122] Based on the arrival time prediction mean vector and the prediction standard deviation vector, the arrival time confidence interval is generated by normal confidence :

[0123] ;

[0124] wherein, is a confidence coefficient, and when corresponds to a 95% confidence interval.

[0125] In this embodiment, the scheduling control operation specifically includes:

[0126] transmitting the multi-task prediction result to a port scheduling management system;

[0127] if the train-to-port state label is L0, the original connection operation plan and the yard scheduling plan remain unchanged;

[0128] if the train-to-port state label is L1 and the predicted train arrival time is within 5 minutes of the planned time threshold, the pre-allocated track occupation period is postponed, the starting time of the loading and unloading equipment is delayed, and a low-level warning is generated;

[0129] if the train-to-port state label is L2 and the predicted train arrival time is delayed by 5 to 20 minutes of the planned time threshold, the connection resources are released in advance, the yard scheduling is re-planned, and a medium-level warning is generated;

[0130] if the train-to-port state label is L2 and the predicted train arrival time is delayed by more than 20 minutes of the planned time threshold, an emergency scheduling plan is enabled, the connection and loading and unloading processes are rearranged, and a high-level warning is generated;

[0131] if the train-to-port state label is L3 and the predicted train arrival time is earlier than the planned time threshold by more than 5 minutes, the track occupation and loading and unloading equipment scheduling plan is adjusted in advance, and an early warning is generated;

[0132] if the train arrival time confidence interval range exceeds the set threshold, the connection scheduling plan is executed by default, and a "predicted fluctuation is large" state is marked;

[0133] The level warning and the marked state are recorded and pushed to the port scheduling terminal system in real time.

[0134] For example, a train CL20250905 departs from an inland hub on a certain day and is expected to arrive at the port at 13:50, but due to frequent grade switching along the way and thunderstorm weather, the actual arrival time is highly uncertain. The port scheduling terminal system predicts its arrival state as L2, the predicted arrival time as 14:12, the confidence interval as [14:08, 14:18], and the predicted fluctuation as medium, pushes a medium-level warning to the dispatcher, and performs resource rearrangement. Finally, the actual arrival time of CL20250905 is 14:10, with an error of ±2 minutes, and the adjusted loading and unloading operation plan is successfully completed, avoiding the track conflict with CL20250906.

[0135] In this embodiment, the feedback data includes historical train-to-port state labels, historical predicted train arrival times, historical train arrival time confidence intervals, actual train-to-port state labels, actual train arrival times, and actual scheduling execution results.

[0136] The prediction error loss is the mean square error between the predicted time of arrival and the actual time of arrival;

[0137] The target perception contrast loss adopts the InfoNCE loss form, specifically:

[0138] Based on the historical train formation arrival state label, the environment-track feature vectors with the same label are taken as positive sample pairs, and the environment-track feature vectors with different labels are taken as negative sample pairs, then the target perception contrast loss is:

[0139]

[0140] wherein, represents the current environment-track feature vector, represents the positive sample with the same label as represents one of the contrast samples in all samples, represents the cosine similarity function, represents the exponential function with the natural number e as the base, is a temperature scaling coefficient, represents the total number of positive and negative samples. The model parameters include the linear mapping weights and bias terms for generating the query matrix, the key matrix and the value matrix in the segmented attention module, the parameters for calculating the inter-segment similarity, the normalization weight and the causal mask adjustment in the inter-segment causal similarity module, the fully connected network weights and bias terms for generating the channel modulation factor vector and the channel adjustment offset vector in the environment modulation module, and the linear mapping weights and bias terms of the shared feature encoding layer, the state prediction fully connected layer, the regression prediction fully connected layer and the prediction sub-network in the multi-task prediction network.

[0141]

[0142] ​​In the present application, the target perception contrast loss function is constructed by constructing positive and negative sample pairs, narrowing the distance of samples with the same label and pushing away the distance of samples with different labels in the feature space, thereby strengthening the recognition ability of the improved AttentionTTE network for the state semantics of the train to the port. Specifically, the positive sample pair is the environment-track feature vector pair with the same label, and the negative sample pair is the environment-track feature vector pair with different labels. The model is optimized based on the InfoNCE loss function, guiding the shared feature vector to have a clearer boundary in the state label dimension. By introducing the target perception contrast loss, the boundary ambiguity problem between easily confused states (such as mild delay and severe delay) in state label classification can be effectively alleviated, and the accuracy of state determination and the recall rate of high delay prediction can be improved. The loss function realizes the dual goals of feature semantic alignment and state boundary strengthening during model optimization, and is the key mechanism for realizing high-precision state recognition in the multi-task prediction module of the present application.

[0143] Embodiment 1:

[0144] In order to verify the feasibility of the present application in implementation, the present application is applied to the container train scheduling prediction task of a coastal port. The port has more than 60 trains per day, distributed in 6 main connection tracks and 4 container yard areas, involving multiple line levels, multiple types of trains, multiple port area operation switching and port congestion conditions, with typical complex trajectory structure and uncertain running environment characteristics. In this scenario, the port scheduling terminal system urgently needs a high-precision, strong-explanation, and land-based arrival prediction method to improve the efficiency of train connection scheduling, alleviate resource conflicts, and reduce the risk of yard congestion caused by delays.

[0145] In specific applications, the port scheduling terminal system first collects train running trajectory data, including train passing station number sequence, arrival and departure time at each station, distance between stations, and running order identifier, while synchronously collecting running environment data of the port on the day, such as weather conditions, whether it is a holiday, line level, train type, and current congestion status of the port. After feature encoding of the above data, standardized trajectory feature sequences and environment feature sequences are generated and input into the improved AttentionTTE network deployed on the port edge computing platform. The network model is pre-trained and has the ability to extract trajectory dynamic features from multiple data sources, fuse environment adjustment semantics, and predict the arrival state and time.

[0146] In order to comprehensively evaluate the actual effect of the present application, 300 container trains continuously running in the port are selected as test data, and the performance of the present application method and the traditional LSTM model, the standard Transformer model, and the classic TTE model in multiple evaluation indicators are compared. The experimental results are shown in Table 1.

[0147] Table 1 Effect comparison table of different methods in port train arrival prediction task

[0148] ;

[0149] From the data in Table 1, it can be seen that the method of the present application is significantly better than the traditional comparative method in multiple performance indicators. In terms of average error of arrival time, the error of the method of the present application is 3.47 minutes, which is much lower than 6.85 minutes of traditional LSTM, 5.14 minutes of standard Transformer and 4.78 minutes of classic TTE model, indicating that the method of the present application significantly improves the time prediction accuracy. In terms of state label accuracy, the method of the present application reaches 92.6%, which is 14.4 percentage points higher than traditional LSTM, indicating that the method of the present application has stronger discrimination ability in the arrival state classification task. In terms of confidence interval coverage, the method of the present application reaches 96.3%, effectively ensuring the reliability of the prediction interval; in terms of high delay prediction recall rate, the method of the present application is 88.1%, which is significantly better than other methods, indicating that the method of the present application is helpful for the port dispatch terminal system to respond to major delay risks in advance

[0150] In addition, in terms of abnormal scheduling response accuracy, the method of the present application achieves a high accuracy of 90.4%, which is better than 82.6% of the classic TTE model, indicating that the generation of scheduling control instructions based on the multi-task prediction result is more reasonable and reliable. In terms of model optimization efficiency, the model iteration convergence round of the method of the present application is only 6 rounds, which is faster than 12 rounds of traditional LSTM and 8-9 rounds of other methods, reflecting stronger training convergence and parameter update efficiency.

[0151] The method of the present application performs excellently in prediction accuracy, risk identification ability, scheduling response quality and model optimization efficiency, and has good engineering adaptability and promotion value.

[0152] The above describes only the preferred specific embodiments of the present application, but the protection scope of the present application is not limited thereto, any person skilled in the art can make equivalent substitutions or changes to the technical solutions and inventive concepts of the present application within the technical range disclosed by the present application, which should be covered within the protection scope of the present application.

Claims

1. A deep learning-based train-to-port prediction method, characterized in that, The method comprises the following steps: Step 1: collecting train formation running track data and running environment data; Step 2: feature coding the train formation running track data and the running environment data to generate track feature sequences and environment feature sequences respectively; Step 3: inputting the track feature sequences and the environment feature sequences into an improved AttentionTTE network to extract track features and fuse environment semantics, and generating environment-track feature vectors, wherein the improved AttentionTTE network comprises a segmented attention module, an inter-segment causal similarity module and an environment modulation module; The segmented attention module divides the track feature sequences and performs attention modeling and feature compression to generate track attention feature matrices, specifically as follows: Divide the track feature sequences according to preset physical running segments to obtain multiple track subsequences, wherein the physical running segments include scheduling control boundary segments, road network level conversion segments and station dense segments; Calculate a query matrix, a key matrix and a value matrix for each track subsequence through linear mapping, and perform self-attention operation based on the query matrix, the key matrix and the value matrix to generate a track attention feature matrix; Perform average pooling along the track time step dimension for each track attention feature matrix to compress track point level features, generate track attention feature vectors, and stack and splice all track attention feature vectors in a vertical direction according to the physical running order of the track subsequences to form a track attention feature matrix; The inter-segment causal similarity module performs inter-segment similarity modeling and causal constraint on the track attention feature matrix to generate an inter-segment causal track matrix, specifically as follows: Calculate the similarity between any two track attention feature vectors through a cosine similarity function to obtain an inter-segment similarity matrix, wherein the dimension of the inter-segment similarity matrix is consistent with the number of track subsequences; Perform normalization operation on each row of the inter-segment similarity matrix through a Softmax function to obtain an inter-segment weight matrix; Introduce a causal mask matrix, wherein the causal mask matrix has the same dimension as the inter-segment weight matrix, and when the column index of the causal mask matrix does not exceed the row index, the corresponding element in the causal mask matrix is set to 1, otherwise it is set to 0; Perform element-level multiplication between the inter-segment weight matrix and the causal mask matrix to generate a causal weight matrix; Perform matrix multiplication operation between the causal weight matrix and the track attention feature matrix to generate an inter-segment causal track matrix; The environment modulation module modulates the inter-segment causal track matrix based on the environment feature sequence to generate an environment-track feature vector, specifically as follows: Compress the environment feature sequence along the time step dimension through average pooling to generate a global environment feature vector; Input the global environment feature vector into a fully connected network to perform linear mapping and GELU activation operation to generate an intermediate feature vector; Normalize the intermediate feature vector through Sigmoid to generate a channel modulation factor vector, and generate a channel adjustment offset vector through a tanh activation function; performing element-level multiplication on each trajectory channel vector in the inter-segment causal trajectory matrix with the channel modulation factor vector and adding the channel modulation offset vector to generate an environment-trajectory feature vector; Step four: performing multi-task prediction based on the environment-trajectory feature vector to output a multi-task prediction result, specifically: The multi-task prediction result includes a train-to-port state label, a train-to-port time prediction value, and a train-to-port time confidence interval; performing dimension compression and semantic reconstruction on the environment-trajectory feature vector through a shared feature encoding layer to generate a shared feature vector, wherein the shared feature encoding layer adopts a linear transformation through a fully connected network and a non-linear mapping through a ReLU activation function; inputting the shared feature vector into a state prediction fully connected layer and performing normalization through a Softmax activation function to output a state label probability distribution vector, and taking the index corresponding to the maximum probability in the state label probability distribution vector as the train-to-port state label; The train-to-port state label includes L0: normal arrival, L1: slight delay, L2: serious delay, and L3: early arrival. inputting the shared feature vector into a regression prediction fully connected layer to perform linear transformation and output a train-to-port time prediction value; inputting the shared feature vector into two prediction sub-networks to generate a train-to-port time prediction mean vector and a prediction standard deviation vector, respectively; generating a train-to-port time confidence interval based on the train-to-port time prediction mean vector and the prediction standard deviation vector through normal confidence; Step five: performing scheduling control operations based on the multi-task prediction result; Step six: collecting feedback data in real time and jointly optimizing the improved AttentionTTE network and model parameters through a prediction error loss and a target perception comparison loss, specifically: The feedback data includes historical train-to-port state labels, historical train-to-port time prediction values, historical train-to-port time confidence intervals, actual train-to-port state labels, actual train-to-port times, and actual scheduling execution results. The prediction error loss is the mean square error between the train-to-port time prediction value and the actual train-to-port time. The target perception comparison loss adopts an InfoNCE loss form, wherein a positive sample pair is an environment-trajectory feature vector with the same label in the historical train-to-port state label, and a negative sample pair is an environment-trajectory feature vector with different labels. The model parameters include linear mapping weights and bias terms for generating query matrices, key matrices, and value matrices in the segmented attention module, parameters for calculating inter-segment similarity, normalization weights, and causal mask adjustment in the inter-segment causal similarity module, fully connected network weights and bias terms for generating channel modulation factor vectors and channel modulation offset vectors in the environment modulation module, and linear mapping weights and bias terms of the shared feature encoding layer, the state prediction fully connected layer, the regression prediction fully connected layer, and the prediction sub-network in the multi-task prediction network. Step seven: updating the optimized model parameters and deploying them on an embedded terminal.

2. The train arrival prediction method based on deep learning according to claim 1, characterized in that, The train operation track data comprises a train passing station number sequence, a train operation sequence identification sequence, an arrival time and a departure time of each station, and distance information between stations; and the operation environment data comprises weather conditions, holiday identification, line level, train type, and port congestion state information. 3.The train arrival prediction method based on deep learning according to claim 1, characterized in that, The train operation track data and the operation environment data are feature-encoded to generate a track feature sequence and an environment feature sequence, specifically as follows: The train passing station number sequence is converted into a discrete integer index value sequence; A trainable embedding matrix is constructed, wherein the number of rows of the trainable embedding matrix is equal to the number of station numbers in the set of station number indexes, and the number of columns is equal to the set embedding vector dimension; Each station's discrete integer index value is mapped to the corresponding embedding vector by table lookup, and all embedding vectors are organized into a station embedding vector sequence; The train operation sequence identification sequence is encoded by a sine-cosine position encoding method to form a position encoding vector sequence; The arrival time and the departure time of adjacent stations are calculated by difference to generate a station interval feature sequence; The station embedding vector sequence, the position encoding vector sequence, and the station interval feature sequence are spliced to form a standardized track sequence; The weather conditions, the line level, and the train type are converted into discrete category index values, and the discrete category indexes are encoded by one-hot encoding to generate corresponding category feature vectors; the holiday identification is encoded by a Boolean value to generate a binary feature vector; and the port congestion state is normalized to generate a continuous numerical feature vector; The various category features, binary feature vectors, and continuous numerical feature vectors are spliced to form an environment feature sequence. 4.The train arrival prediction method based on deep learning according to claim 1, wherein, The scheduling control operation is specifically as follows: The multi-task prediction result is transmitted to a port scheduling management system; If the train arrival state label is L0, the original connection operation plan and the yard scheduling scheme remain unchanged; If the train arrival state label is L1, and the predicted arrival time is within 5 minutes of the planned time threshold, the pre-allocated track occupation period is postponed, the starting time of the loading and unloading equipment is delayed, and a low-level warning is generated; If the train arrival state label is L2, and the predicted arrival time is delayed by more than 5 to 20 minutes of the planned time threshold, the connection resources are released in advance, the yard scheduling is re-planned, and a medium-level warning is generated; If the train arrival state label is L2, and the predicted arrival time is delayed by more than 20 minutes of the planned time threshold, an emergency scheduling plan is enabled, the connection and loading and unloading processes are rearranged, and a high-level warning is generated; If the train arrival state label is L3, and the predicted arrival time is more than 5 minutes earlier than the planned time threshold, the track occupation and loading and unloading equipment scheduling plan is adjusted in advance, and an early warning is generated; If the arrival time confidence interval range exceeds the set threshold, the connection scheduling scheme is executed by default, and the "predicted fluctuation is large" state is marked; The level warning and the marked state are recorded and pushed to the port scheduling terminal system in real time.

Citation Information

Patent Citations

  • Port ship trajectory prediction method based on TCN model

    CN113240198A

  • Bus arrival time prediction method based on deep neural network calculation

    CN113380043A