Method and system for predicting container truck flow outside wharf crossing based on hybrid deep learning architecture

By combining LSTM, Transformer and CNN with a hybrid deep learning architecture to process the temporal and spatial characteristics of truck traffic, the problem of insufficient prediction accuracy in existing technologies is solved, and real-time dynamic and accurate prediction of truck traffic outside the terminal crossing is achieved, thereby improving the efficiency of terminal operations.

CN121766535APending Publication Date: 2026-03-31TONGJI UNIV
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-26
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

Existing technologies for predicting container truck traffic outside wharf crossings suffer from several problems: insufficient mining of temporal features, simplistic modeling of spatial features, and difficulty for a single network to simultaneously consider multi-scale temporal features and spatial evolution trends. These issues result in insufficient prediction accuracy and an inability to achieve accurate real-time dynamic predictions.

Method used

A hybrid deep learning architecture is adopted, combining Long Short-Term Memory (LSTM), Transformer and Convolutional Neural Network (CNN) to process the temporal and spatial features of truck traffic. Feature fusion is performed through a fully connected neural network to build a truck traffic prediction model outside the dock level. Real-time data from the reservation system and GPS are captured and the input is dynamically adjusted.

Benefits of technology

It enables accurate hourly truck traffic forecasting for the next few hours, supports real-time scheduling, improves terminal operation efficiency, provides an efficient container transshipment scheduling solution, and solves the problems of static and insufficient accuracy in existing technologies.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121766535A_ABST
    Figure CN121766535A_ABST
Patent Text Reader

Abstract

The invention relates to a wharf crossing external container truck flow prediction method and system based on a hybrid deep learning architecture, and the method comprises the steps: collecting data of a wharf crossing external container truck, carrying out the preprocessing, data matching calculation and feature engineering processing, and constructing a wharf crossing external container truck flow prediction data set; the wharf crossing outer container truck flow prediction data set comprises wharf crossing outer container truck flow time sequence characteristics, wharf crossing outer container truck flow space characteristics and wharf crossing outer container truck reservation quantity characteristics; and inputting the wharf crossing external container truck flow prediction data set into a pre-trained prediction model, and outputting a wharf crossing external container truck flow prediction value of each hour in a plurality of hours in the future. Compared with the prior art, the global feature and the short-time feature of the container truck flow time sequence outside the wharf crossing are fully considered, and the spatial feature and the container truck reservation quantity feature are introduced to realize the spatio-temporal information fusion of the container truck flow outside the wharf crossing, so that the dynamic real-time accurate prediction of the container truck flow outside the wharf crossing is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of automated container terminals, and in particular to a method and system for predicting the flow of container trucks outside the terminal gates based on a hybrid deep learning architecture. Background Technology

[0002] In container terminal operations, external trucks, as container handling tools on the landside of intelligent container terminals, are responsible for transporting containers at entrances and exits, serving as a hub connecting the terminal to the inland areas. However, the arrival time of external trucks is affected by multiple factors such as traffic conditions and driver decisions, easily leading to fragmented terminal operation scheduling and increased idle rates of yard crane resources, thus hindering the improvement of terminal operation efficiency and service quality. Therefore, accurate prediction of external truck traffic is crucial for improving the efficiency of container terminal operation systems and has significant research value. In recent years, scholars both domestically and internationally have conducted extensive research on truck traffic prediction at entrances, and several technical solutions have been developed to achieve this accurate prediction.

[0003] For example, reference 1, "The Daily Container Volumes Prediction of Storage Yard inPort with Long Short-Term Memory Recurrent Neural Network" (Yinping Gao, Daofang Chang, Ting Fang, Yiqun Fan. Journal of Advanced Transportation, 2019, 2019:1-11.), proposes a prediction model based on Long Short-Term Memory (LSTM) networks, focusing on daily container truck traffic prediction in the storage yard. By setting a 7-day time step, the model uses the traffic data from the previous 7 days to predict the traffic on the 8th day, validating the model's high accuracy in single-step prediction. However, this model only supports single-time-step prediction and cannot achieve multi-step traffic estimation; furthermore, it does not incorporate external influencing factors such as weather and traffic, nor does it consider the spatial characteristics of container truck activity, thus limiting the model's generalization ability.

[0004] For example, reference 2, “Modeling Categorized Truck Arrivals at Ports: Big Data for Traffic Prediction” (N. Li, H. Sheng, P. Wang, Y. Jia, Z. Yang and Z. Jin. IEEE Transactions on Intelligent Transportation Systems, vol. 24, no. 3, pp.2772-2788, March 2023), designed a deep learning model that integrates gated recurrent units (GRUs) and fully connected neural networks (FCNNs). This model comprehensively considers multiple variables such as weather, ship type, and port service information to predict the number of truck arrivals, improving the robustness of predictions in multi-factor scenarios. However, this model suffers from significant “error accumulation” during multi-step predictions, and the predictions do not achieve hourly accuracy. Furthermore, this study did not incorporate truck reservation system data and spatial distribution characteristics, limiting the model's accuracy in real-time scheduling.

[0005] For example, reference 3, "Prediction of delivery truck arrivals at container terminals: an ensemble deep learning model" (Li N, Wang Z, Lin X, et al. Maritime Economics & Logistics, 2024, 26(4):658-684.), proposes a new deep learning architecture (SCGD-DA) based on reference 2. It combines historical truck traffic, border crossing dates, and weather data to achieve multi-time step prediction of truck arrivals on specific routes for the next 1 to 24 hours, thus expanding the prediction time dimension. However, this research model relies on the "truck-route" binding relationship and requires additional refined data related to the route, resulting in low data availability in practical applications. At the same time, it does not consider the truck reservation mechanism and spatial distribution characteristics, thus failing to achieve fusion prediction based on spatiotemporal information.

[0006] For example, reference 4, "Actual Truck Arrival Prediction at a Container Terminal with the Truck Appointment System Based on the Long Short-Term Memory and Transformer Model" (Ma M, Li X, Fan H, et al. JOURNAL OF MARINE SCIENCE AND ENGINEERING, 2025, 13(3):405.), introduces a truck reservation system, constructs multi-timescale traffic flow time-series features, and extracts global time-series features and short-term dynamic features through a model combining LSTM and Transformer to achieve traffic flow prediction for the next few hours, thus improving the prediction capability driven by reservation data. However, this model is only based on historical traffic flow time series and reservation information, and spatial information is only indirectly represented by traffic congestion coefficients, without directly capturing the real-time spatial distribution of trucks, resulting in insufficient utilization of spatial features and limited improvement in prediction accuracy.

[0007] For example, reference 5, "A Prediction Model for Truck Arrival Volume Based on Multi-Source Heterogeneous Fusion and Spatiotemporal Graph Convolutional Networks" (Xue Guixiang, Chen Yuang, Liu Yu, et al. Computer Engineering and Science, 2025, 47(03): 561.), uses graph convolutional networks (GCNs) to extract spatial features from real-time GPS location records of trucks, transforming dynamic spatial information into a continuous temporal graph to achieve traffic prediction for the next 15 to 60 minutes, meeting the time accuracy requirements of real-time scheduling. The limitation of this research is that truck reservation information is simply fused with the spatial features extracted by GCNs at a fully connected layer, without in-depth mining of time-series features. This fails to achieve organic fusion and joint modeling of spatiotemporal features, limiting the collaborative utilization of cross-dimensional information.

[0008] Chinese patent CN120297514A discloses a method, system, medium, and management method for predicting truck traffic at a crossing, applied to the field of automated container terminal technology. It dynamically adapts to the terminal operation scenario through a data modality classification model, combines a Long Short-Term Memory (LSTM) regression model and an Extreme Gradient Boosting (XGBoost) regression model for parallel prediction, and integrates the prediction results through weighted summation, thereby accurately predicting the truck traffic at the terminal crossing for each time period within a preset time period. However, this invention focuses on the classification of data modalities and the optimization of model combinations, but does not model the spatial distribution characteristics of trucks, and does not make full use of spatial and temporal characteristics.

[0009] In summary, while existing technologies can make some predictions about truck traffic outside wharf crossings, there are still many areas for improvement. For example, the precision of the prediction time step is insufficient; the depth of temporal feature mining is inadequate; real-time dynamic prediction of truck traffic outside wharf crossings has not been achieved; the value of the truck reservation system has not been fully utilized; and the modeling of truck spatial distribution characteristics has not been adequately integrated with temporal features. These problems make it difficult for existing technologies to make real-time, dynamic, and accurate predictions of truck traffic based on a comprehensive consideration of truck reservation information and real-time GPS latitude and longitude location information, thus causing inconvenience for wharf operators in carrying out real-time production scheduling. Summary of the Invention

[0010] The purpose of this invention is to overcome the problems of insufficient mining of temporal features, simple modeling of spatial features, and difficulty in taking into account both temporal multi-scale features and spatial evolution trends of a single network in the existing technology, and to provide a method and system for predicting the flow of container trucks outside the dock crossing based on a hybrid deep learning architecture.

[0011] The objective of this invention can be achieved through the following technical solutions: A method for predicting truck traffic flow at a terminal crossing based on a hybrid deep learning architecture, the method comprising: Collect container truck data outside the dock level crossing, perform preprocessing, data matching calculation and feature engineering processing to construct a container truck traffic prediction dataset outside the dock level crossing; the container truck traffic prediction dataset outside the dock level crossing includes the time series characteristics of container truck traffic outside the dock level crossing, the spatial characteristics of container truck traffic outside the dock level crossing, and the reservation volume characteristics of container trucks outside the dock level crossing. Input the predicted truck traffic outside the dock level into the pre-trained prediction model, and output the predicted truck traffic outside the dock level for each hour in the next few hours. The prediction model is a hybrid deep learning architecture model, trained on a historical dataset of truck traffic outside the dock level. The historical dataset is divided into a feature dataset and a label dataset. The hybrid deep learning architecture model uses different networks to process and splice temporal features, spatial features and reservation volume features respectively, to achieve spatiotemporal information fusion of truck traffic outside the dock level.

[0012] Furthermore, the container truck data outside the dock crossing includes: container truck information, historical records of container truck arrivals at the crossing, reservation records from the container truck reservation system, and real-time GPS location records of the container trucks.

[0013] Furthermore, the preprocessing includes: Remove invalid data: Delete records with missing license plate numbers, abnormal timestamps, and latitude and longitude coordinates that are outside the reasonable range around the dock; Deduplication: The system uses a combination of license plate number and timestamp for dual-dimensional deduplication to remove completely duplicate records.

[0014] Furthermore, the process of performing the aforementioned data matching calculation on the container truck data outside the dock crossing includes: Hourly arrival flow matching: Using the license plate number and the time when the truck arrives at the crossing as a unique index, calculate the number of trucks arriving at the crossing each hour based on historical data; Reservation data matching: Remove reservation data where the reservation time is greater than or equal to the reservation operation time, and calculate the number of container truck reservations outside the dock gate in the reservation system for each hour using the license plate number and the reservation arrival time as unique indexes. GPS and reservation data matching: Using the license plate number and reserved operation time as unique indexes, the real-time GPS latitude and longitude location records of the container trucks are matched with the reservation records in the container truck reservation system. Data that fails to match in the container truck GPS latitude and longitude location records is removed, thus completing the matching of container truck GPS latitude and longitude location information with container truck reservation information in the reservation system. For the successfully matched container truck GPS latitude and longitude location records, data whose timestamps are greater than the container truck reservation operation time are removed.

[0015] Furthermore, the feature engineering process includes: Constructing time-series features: Extract the hourly index of the arrival time of container trucks at the level crossing and the actual arrival flow per hour; calculate the moving average of different preset time steps based on the hourly flow; integrate the hourly index, the actual arrival flow per hour, and the moving average to form a time-series feature set of container truck flow outside the wharf level crossing; Constructing spatial features: Define an initial GPS latitude and longitude range, divide the spatial domain into grids of fixed size, treat the grids in the spatial domain as matrix elements, and initialize the GPS scatter matrix; at preset intervals, count the GPS location of the trucks using license plate number and scheduled operation time as unique indices; based on the counted GPS latitude and longitude locations of the trucks, assign values ​​to each element in the GPS scatter matrix to construct the spatial features of truck traffic outside the dock level, where the value of each element is the number of trucks outside the dock level within that grid; Constructing reservation volume characteristics: Based on the reservation volume of container trucks outside the dock level in the reservation system every hour, construct a feature set of container truck traffic reservation volume outside the dock level.

[0016] Furthermore, the tag dataset includes hourly truck traffic outside the crossing within the next few hours under different feature combinations, and the tag dataset is obtained based on historical statistics of truck arrivals at the dock crossing.

[0017] Furthermore, the pre-trained prediction model is a hybrid deep learning architecture model, which includes a Long Short-Term Memory (LSTM) network, a Transformer, a Convolutional Neural Network (CNN), and a fully connected neural network. The LSTM network and the Transformer process temporal features simultaneously, while the cascaded network of the CNN and the LSTM network processes spatial features. The processing results of the temporal and spatial features are concatenated with the reservation volume features and input into the fully connected neural network. The fully connected neural network then outputs the predicted truck traffic flow outside the level crossing for the next few hours.

[0018] Furthermore, the Long Short-Term Memory (LSTM) network structure includes an input layer, a hidden layer, and an output layer, with each hidden layer containing multiple LSTM storage units; the Transformer structure includes a position encoding module, a multi-head self-attention mechanism, and an encoder-decoder structure; the LSTM network is used to capture short-term fluctuation features of time-series data, and the Transformer is used to capture global features of time-series data; the Transformer performs position encoding on the time-series features of truck traffic outside the dock crossing based on the position encoding module, supplementing the time-series sequence information.

[0019] Furthermore, the convolutional neural network includes an input layer, a double convolutional layer, an average pooling layer, and an output layer; the convolutional neural network extracts local features from the GPS scatter matrix through local connections and weight sharing, and the long short-term memory network captures the spatiotemporal evolution trend of the truck moving from the outer grid to the crossing in chronological order based on the local features in the GPS scatter matrix.

[0020] A system for predicting truck traffic outside a dock crossing based on a hybrid deep learning architecture, the system comprising: Spatiotemporal data preprocessing and feature engineering module: Based on the historical records of truck arrivals at the level crossing, the reservation records of the truck reservation system, and the latitude and longitude location records of the trucks in real time GPS, the module completes the data preprocessing, matching, and feature engineering to construct a truck traffic prediction dataset outside the level crossing. The truck traffic prediction dataset outside the level crossing includes the temporal characteristics of truck traffic outside the level crossing, the spatial characteristics of truck traffic outside the level crossing, and the reservation volume characteristics of trucks outside the level crossing. The spatiotemporal information fusion prediction module for truck traffic outside the crossing: inputs the predicted dataset of truck traffic outside the crossing obtained by the spatiotemporal data preprocessing and feature engineering module into the pre-trained prediction model, and outputs the predicted value of truck traffic outside the crossing for each hour in the next few hours. Prediction model building and training module: Builds and trains a prediction model, which is a hybrid deep learning architecture model.

[0021] Compared with the prior art, the beneficial effects of the present invention include: 1. This invention can predict the hourly truck traffic flow at terminal level crossings within a certain number of integer hours in the future, achieving accurate prediction of truck traffic flow outside terminal level crossings and thus helping to solve the problem of low efficiency in container transshipment at terminals. The invention employs temporal characteristics, spatial characteristics, and reservation characteristics of truck traffic flow outside terminal level crossings when predicting traffic flow. It fully considers multi-source information in time and space during the prediction process, accurately focusing the prediction target on the hourly truck traffic flow outside terminal level crossings within a certain number of integer hours in the future, thereby achieving dynamic, real-time, and accurate prediction. The prediction results can directly provide decision support for terminal operators, helping them to formulate efficient container transshipment scheduling plans and improving the overall operational efficiency of the terminal from a data-driven perspective.

[0022] 2. This invention collects three types of core data: historical records of truck arrivals at level crossings, records from the truck reservation system, and real-time GPS latitude and longitude data of trucks, solving the problem of single data sources in existing technologies. This invention eliminates duplicate records through a dual dimension of license plate number + timestamp, filters valid data according to the condition that reservation time < reservation operation time ≤ GPS timestamp ≤ reservation operation time, and achieves accurate data matching by using license plate number + key time as a unique index, avoiding prediction deviations caused by data redundancy and chaotic matching in existing technologies.

[0023] 3. This invention captures real-time updated data from the reservation system and real-time GPS location data, supports dynamic adjustment of the input to the prediction model, and solves the limitations of existing technologies that rely on static data modeling and cannot adapt to real-time scenarios.

[0024] 4. This invention constructs a 6-dimensional time-series feature consisting of an hourly index, hourly actual traffic flow, and four types of multi-time-step moving averages, comprehensively covering short-term fluctuations and long-term trends; it innovatively constructs a GPS scatter matrix: defining a grid space with a fixed latitude and longitude range, and counting the number of trucks within the grid every 30 minutes, transforming spatial distribution into structured features, solving the defects of existing technologies in indirect representation or lack of modeling of spatial information; it segments according to the scheduled operation time and the time difference between the scheduled operation time, and counts the accurate number of scheduled operations per hour in the next few hours, forming an independent feature dimension.

[0025] 5. This invention uses LSTM and Transformer networks to capture the short-term and global features of truck traffic flow outside terminal level crossings; it uses a cascaded network of CNN and LSTM to capture the spatial and temporally variable features of truck traffic flow outside terminal level crossings; and finally, it uses a fully connected neural network to fuse the output of the last time step of the above networks with the truck reservation volume features outside terminal level crossings to achieve dynamic, real-time, and accurate prediction of hourly truck traffic flow outside terminal level crossings for the next several hours. The prediction results will play an important guiding role in the formulation of various plans by terminal operators and have great market value. Attached Figure Description

[0026] Figure 1 This is a flowchart of the method of the present invention; Figure 2 This is a schematic diagram of the wharf crossing of the present invention; Figure 3 This is a schematic diagram comparing the predicted and actual flow rates of trucks outside the crossing in one embodiment of the present invention. Figure 4 This is a schematic diagram of the percentile error of the traffic flow prediction for trucks outside the crossing in one embodiment of the present invention. Detailed Implementation

[0027] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0028] Example 1 This embodiment discloses a method for predicting truck traffic flow outside dock crossings based on a hybrid deep learning architecture. The method is as follows: Figure 1 As shown, the details are as follows: Step S1: Collect data on container trucks outside the dock crossing; This method is based on, for example Figure 1 The scene structure shown includes truck data outside the dock crossing, including truck information, historical records of truck arrivals at the crossing, reservation records from the truck reservation system, and real-time GPS location records of the trucks.

[0029] In this embodiment, information on truck arrival records at a certain level, truck reservation system records, and real-time GPS latitude and longitude location information of a container terminal in China are collected over a period of three years.

[0030] Step S2 involves preprocessing the collected data, performing data matching calculations and feature engineering to construct a truck traffic prediction dataset outside the dock level crossing. The truck traffic prediction dataset outside the dock level crossing includes the temporal characteristics of truck traffic outside the dock level crossing, the spatial characteristics of truck traffic outside the dock level crossing, and the reservation volume characteristics of truck traffic outside the dock level crossing.

[0031] Preprocessing includes: Remove invalid data: Delete records with missing license plate numbers, abnormal timestamps, and latitude and longitude coordinates that are outside the reasonable range around the dock; Deduplication: The system uses a combination of license plate number and timestamp for dual-dimensional deduplication to remove completely duplicate records.

[0032] The process of performing data matching and calculation on the data of container trucks outside the dock crossing includes: Hourly arrival flow matching: Using the license plate number and the time when the truck arrives at the crossing as a unique index, calculate the number of trucks arriving at the crossing each hour based on historical data; Reservation data matching: Remove reservation data where the reservation time is greater than or equal to the reservation operation time, and calculate the number of container truck reservations outside the dock gate in the reservation system for each hour using the license plate number and the reservation arrival time as unique indexes. GPS and reservation data matching: Using the license plate number and reserved operation time as unique indexes, the real-time GPS latitude and longitude location records of the container trucks are matched with the reservation records in the container truck reservation system. Data that fails to match in the container truck GPS latitude and longitude location records is removed, thus completing the matching of container truck GPS latitude and longitude location information with container truck reservation information in the reservation system. For the successfully matched container truck GPS latitude and longitude location records, data whose timestamps are greater than the container truck reservation operation time are removed.

[0033] The feature engineering process includes: Constructing time-series features: Extract the hourly index of the arrival time of container trucks at the crossing and the actual arrival flow per hour; calculate the moving average of different preset time steps based on the hourly flow; integrate the hourly index, the actual arrival flow per hour, and the moving average to form a time-series feature set of container truck flow outside the crossing.

[0034] Constructing Spatial Features: Define an initial GPS latitude and longitude range, divide the spatial domain into a fixed-size grid, and treat the grids in the spatial domain as matrix elements to initialize a GPS scatter matrix; at preset time intervals, use license plate number and scheduled operation time as unique indices to count the GPS locations of container trucks; based on the counted GPS latitude and longitude locations of container trucks, assign values ​​to each element in the GPS scatter matrix to construct the spatial features of container truck traffic outside the dock crossing, where the value of each element is the number of container trucks outside the dock crossing within that grid. Constructing reservation volume characteristics: Based on the reservation volume of container trucks outside the dock level in the reservation system every hour, construct a feature set of container truck traffic reservation volume outside the dock level.

[0035] Step S3: Input the predicted truck traffic flow data outside the dock level into the pre-trained prediction model, and output the predicted truck traffic flow value outside the dock level for each hour in the next few hours.

[0036] The prediction model is a hybrid deep learning architecture model, trained on a historical dataset of truck traffic outside the dock level. The historical dataset is divided into a feature dataset and a label dataset. The hybrid deep learning architecture model uses different networks to process and splice temporal features, spatial features and reservation volume features respectively, to achieve spatiotemporal information fusion of truck traffic outside the dock level.

[0037] The tag dataset includes hourly truck traffic outside the crossing for several hours in the future under different feature combinations. The tag dataset is obtained based on historical statistics of truck arrivals at the dock crossing.

[0038] The pre-trained prediction model is a hybrid deep learning architecture model, which includes a Long Short-Term Memory (LSTM) network, a Transformer, a Convolutional Neural Network (CNN), and a fully connected neural network. The LSTM network and the Transformer process temporal features simultaneously, while the cascaded network of the CNN and the LSTM network processes spatial features. The processing results of temporal and spatial features are concatenated with the reservation volume features and input into the fully connected neural network, which outputs the predicted value of truck traffic outside the level crossing for the next few hours.

[0039] The model architecture is shown in the following equation: In the formula, This indicates the time-series characteristics of truck traffic outside the dock crossing; This indicates the spatial characteristics of container truck traffic outside the dock level; Indicates the characteristics of container truck reservations outside the dock level; symbol Indicates function composition; symbol Indicates feature splicing; represents learnable parameters; FC represents a fully connected neural network.

[0040] The Long Short-Term Memory (LSTM) network structure includes an input layer, hidden layers, and an output layer, with each hidden layer containing multiple LSTM storage units. The Transformer structure includes a position encoding module, a multi-head self-attention mechanism, and an encoder-decoder structure. The LSTM network is used to capture the short-term fluctuation features of time-series data, while the Transformer is used to capture the global features of time-series data. The Transformer uses the position encoding module to perform position encoding on the time-series features of truck traffic outside the dock crossing, supplementing the time-series sequence information.

[0041] Convolutional neural networks consist of an input layer, a double convolutional layer, an average pooling layer, and an output layer. Through local connections and weight sharing, convolutional neural networks extract local features from the GPS scatter matrix. Long short-term memory networks, based on the local features in the GPS scatter matrix, capture the spatiotemporal evolution trend of trucks moving from the outer grid to the crossing in chronological order.

[0042] LSTM networks are a special type of recurrent neural network architecture, consisting of an input layer, one or more hidden layers, and an output layer. Each hidden layer contains multiple LSTM storage units, and the flow of information is controlled by forget gates, input gates, and output gates, which have good processing performance for time series data. In an LSTM network, the forget gate is the first step in discarding and retaining information. The forget gate's information processing flow can be represented by the following formula: In the formula, It is the sigmoid activation function. The weight matrix between the forget gate and the input vector. The weight matrix between the forget gate and the output vector. This is the bias term in the forget gate; this process is completed independently by the forget gate and is used to determine... and Which information was completely retained, and which information was completely forgotten?

[0043] In an LSTM network, after discarding and retaining information, it is necessary to determine what new information is stored in the memory cell. This process can be represented by the following formula: This process is similar to the forgetting gate process described above, where, The weight matrix between the input gate and the input vector. The weight matrix between the input gate and the output vector. This is the bias term in the forget gate; next, the tanh layer creates a new candidate vector and adds it to the state, a process that can be represented by the following equation: In the formula, tanh is the hyperbolic tangent activation function. The weight matrix between the tanh layer and the input vector is... The weight matrix between the tanh layer and the output vector is... This is the bias term in the tanh layer; subsequently, a state update is required, by... Updated to The process is represented by the following formula: Finally, the output is obtained. The process first determines which part of the cell state will be the output based on the sigmoid layer; then, it processes the cell state based on the tanh layer to obtain the output of the LSTM memory cell; this process is represented by the following formula: In the formula, The weight matrix between the output gate and the input vector. The weight matrix between the output gate and the output vector. This refers to the bias term in the output gate; In an LSTM network, information transmission is accomplished through the cooperation of the forget gate, input gate, and output gate. Time-series data from historical time points are input into the network, and the information contained in the cells is continuously updated and forgotten, ultimately completing the learning of time-series features. For the LSTM network used to process the time-series characteristics of truck traffic outside the dock crossing, the time-series information is modeled as follows: Finally, the features of the last time step of the LSTM network output are obtained. ; Batch size; This represents the number of neurons in the hidden layer of the LSTM network. Transformer is a deep learning architecture based on a multi-head attention mechanism. Its core structure includes a position encoding module, a multi-head self-attention mechanism, and an encoder-decoder structure. The Transformer structure for processing the time-series characteristics of truck traffic outside dock crossings in this invention includes a position encoding module (PE) and an encoder (TransformerEncoder) structure incorporating a multi-head self-attention mechanism. For Transformer applications processing the time-series characteristics of truck traffic outside dock crossings, since the sequence information is lost when calculating multi-head self-attention, it is necessary to perform position encoding on the time-series characteristics of truck traffic outside dock crossings based on the position encoding module, as shown in the following formula: In the formula, This indicates the time-series characteristics of truck traffic outside the dock crossing; For location index; For dimension indexing; The dimension of the model; For the TransformerEncoder structure used to process the time-series characteristics of truck traffic outside dock crossings, its core is a multi-head attention mechanism. The basic idea is to linearly map the input sequence to multiple different representation subspaces, compute attention weights in parallel within these subspaces, and finally concatenate the results and restore the dimensionality through a linear transformation. Single-head attention... The calculation formula is: In the formula, X Represents the input vector; , , This represents the learnable parameter matrix; Q, K, and V represent the query, key, and value matrices, respectively. n Indicates the number of input features; It is a scaling factor used to prevent the gradient from vanishing due to an excessively large dot product result. It is a vector mapping activation function; given a matrix The soft vector mapping is performed on the matrix row by row, and its calculation formula is as follows: Multi-head attention Then by repeating the above operations This is achieved through vector concatenation operations. Output implementation: The calculation for each head is as follows: in, and It is a learnable parameter matrix. Through the multi-head self-attention mechanism, the prediction model can capture the relationships between different positions in the input sequence, effectively capturing the global features of long sequences. The output of the multi-head self-attention is passed through residual connections and layer normalization (LayerNorm), then through a feedforward neural network, and finally through residual connections and layer normalization again to obtain the output of a Transformer encoder, as shown in the following equation: In the formula, and As an intermediate variable; , Based on a single sample Mean and variance of all features; , , , , , All are learnable parameters; The multi-head self-attention mechanism described above can be described in functional form as follows: In the formula, Representing the The output of the TransformerEncoder layer. The final Transformer output, processing the time-series characteristics of truck traffic outside the dock crossing, features the characteristics of the last time step. ; Batch size; This represents the number of hidden layer neurons in a Transformer feedforward neural network. CNN networks, designed for processing the spatial characteristics of truck traffic outside dock crossings, are deep learning frameworks specifically designed for grid-like data. Compared to other neural network structures, their core design philosophy lies in employing local connectivity and weight sharing mechanisms, enabling efficient extraction of multi-scale features inherent in grid-like data. A typical CNN usually includes components such as convolutional layers, pooling layers, and fully connected layers. The CNN network architecture of this invention consists of two convolutional layers and one average pooling layer, as detailed below: In the formula, ; Batch size; represents the number of hidden layer neurons in a CNN network; Conv2D is a two-dimensional convolutional layer, whose core is the convolution kernel, used to extract local features from grid-like data. Specifically, for an input matrix... convolution kernel The output is For a single-channel input, the output is as follows: In the formula H Represents the height of the input. W Represents the width of the input; k h Represents the height of the convolution kernel. k w Represents the width of the convolution kernel. Y i,j To output the feature map at position ( i,j The value of ); b This is a bias term used to adjust the output baseline; m,n () is the index of the element inside the convolution kernel.

[0044] In the CNN network architecture of this invention, an activation function is applied after the output of the first convolutional layer. Here, the Rectified Linear Unit (ReLU) is used as the activation function of the CNN network, and its expression is as follows: Pooling layers are used to reduce the dimensionality of the output and enhance translation invariance. This invention employs average pooling (AvgPool) as shown in the following equation: In the formula, S The pooling step size; m , n This is the index of the element within the pooled window; X This is the input matrix for the pooling layer; Y This is the output matrix of the pooling layer.

[0045] Since each hour may contain multiple GPS scatter matrix points, the output of the CNN network needs to be averaged, as shown in the following formula: In the formula This represents the number of GPS scatter points in the matrix for each hour; thus, the output of the CNN network for each hour is obtained. The output of the CNN network that processes the spatial characteristics of truck traffic outside the dock crossing is fed into an LSTM network to model the spatial time-varying features of the GPS scatter matrix, as shown in the following equation: Finally, the features of the last time step of the LSTM network output are obtained. ; Batch size; This represents the number of neurons in the hidden layer of the LSTM network. Finally, based on the outputs of the two LSTM networks, the output of the Transformer, and the reservation features of trucks outside the dock level, the features are concatenated. The concatenated features are then input into a fully connected neural network to output the predicted truck traffic flow outside the level for the next few hours, as shown in the following formula: In the formula, , , , Dropout is a regularization technique that uses learnable parameters to randomly set the activation values ​​of some neurons to 0 during model training, thereby preventing overfitting. For batch size, t This indicates the prediction time step; the prediction target here is the future. t Hourly truck traffic outside the level crossing; Compared with existing technologies, this invention fully considers multi-source spatiotemporal information in the process of predicting container truck traffic outside the terminal level. It captures the number of container truck reservations in the reservation system in real time and dynamically integrates the GPS latitude and longitude location information of the container trucks. This allows the prediction target to be accurately focused on the hourly container truck traffic outside the terminal level within a certain number of integer hours in the future, thereby achieving dynamic, real-time, and accurate prediction. The prediction results can directly provide decision support for terminal operators, helping them to formulate efficient container transshipment scheduling plans and improve the overall operational efficiency of the terminal from a data-driven perspective.

[0046] Example 2 Based on Embodiment 1 above, this embodiment discloses a container truck traffic prediction system based on a hybrid deep learning architecture. The system includes: a spatiotemporal data preprocessing and feature engineering module, a spatiotemporal information fusion prediction module for container truck traffic outside the crossing, and a prediction model construction and training module.

[0047] Spatiotemporal data preprocessing and feature engineering module: Based on the historical records of truck arrivals at the level crossing, the reservation records of the truck reservation system, and the latitude and longitude location records of the trucks in real time using the GPS, the module completes the preprocessing, matching, and feature engineering of the data to construct a truck traffic prediction dataset outside the level crossing. The feature dataset includes the temporal characteristics of truck traffic outside the level crossing, the spatial characteristics of truck traffic outside the level crossing, and the reservation volume characteristics of trucks outside the level crossing. The spatiotemporal information fusion prediction module for truck traffic outside the crossing: inputs the predicted truck traffic data set for outside the crossing obtained from the spatiotemporal data preprocessing and feature engineering module into the pre-trained prediction model, and outputs the predicted truck traffic value for each hour of the next several hours. Prediction Model Building and Training Module: Builds and trains the prediction model, which is a hybrid deep learning architecture model.

[0048] Example 3 This embodiment, based on Embodiment 1 above, discloses an evaluation of the prediction results of a method for predicting truck traffic outside a wharf crossing based on a hybrid deep learning architecture.

[0049] The collected historical data underwent spatiotemporal data preprocessing and feature engineering. Using hours as the time step, the hourly truck traffic flow at the wharf crossing was statistically analyzed, and the moving average of the truck traffic flow under different time steps was calculated to construct the temporal series features for predicting truck traffic flow outside the wharf crossing. Using license plate number and reserved operation time as unique indexes, the real-time GPS latitude and longitude location information of the trucks was matched with the information recorded in the truck reservation system. Based on the matched real-time GPS latitude and longitude location information of the trucks, a truck GPS scatter matrix was constructed as the spatial feature of truck traffic flow outside the wharf crossing. The number of truck reservations in the reservation system for each hour within the next 4 hours corresponding to each hour was statistically analyzed as the truck reservation feature outside the wharf crossing.

[0050] When calculating the moving average of truck flow rate at different time steps, the selected time steps are as follows: That is, calculate the average truck traffic flow over the past 3 hours, 6 hours, 12 hours, and 24 hours respectively; use these four moving average truck traffic flow values ​​as part of the input features of the time series dataset.

[0051] Six features were selected as time-series features of truck traffic outside the dock level: hourly labels, hourly truck traffic at the crossing within a past time period, and the hourly moving average of truck traffic within a past time period.

[0052] When constructing the spatial characteristics of container trucks outside the wharf crossing, a GPS scatter matrix of container trucks is constructed every 30 minutes, meaning that two GPS scatter matrices are included every hour; the spatial domain of the matrix is ​​set to latitude. ,longitude: The size of the matrix is ​​set to .

[0053] When calculating the number of truck reservations per hour in the past time period, the relationship between the reservation time and the reservation operation time recorded in the truck reservation system needs to be considered. The prediction target of this invention is the truck traffic per hour in the next 4 hours. Therefore, it is necessary to count the number of truck reservations when the reservation operation time differs from the reservation time by 0-1 hour, 1-2 hours, 2-3 hours, and more than 3 hours, respectively. In this way, the truck reservation volume per hour in the next 4 hours under each timestamp is calculated as the feature of the truck reservation volume outside the wharf crossing.

[0054] The dataset is divided into training samples and test samples according to a certain ratio. In this embodiment, the training sample data volume is 476, and the test sample data volume is 112.

[0055] In the spatiotemporal information fusion prediction module for truck traffic outside the level crossing, the prediction model is trained based on training samples.

[0056] In the LSTM network used to process the time-series features of external card traffic prediction, the network consists of an input layer and a hidden layer. The number of neurons in the input layer is consistent with the types of time-series features of external card traffic prediction, and is set to 6; the number of neurons in the hidden layer is 128.

[0057] In the Transformer used to process the time-series features of external truck traffic prediction, the number of attention heads is set to 4; the number of TransformerEncoder layers is set to 2; and the number of hidden layers in the feedforward neural network is set to 64.

[0058] The CNN network used to process the GPS scatter matrix of container trucks consists of two convolutional layers, one activation function layer, and one average pooling layer. The number of hidden layer neurons is 64, and the kernel sizes of the two convolutional layers are as follows: and The ReLU activation function is selected.

[0059] In the LSTM network used to process the output of the CNN network, the network consists of an input layer and a hidden layer. The number of neurons in the input layer is the same as the number of neurons in the hidden layer of the CNN network, which is 64; the number of neurons in the hidden layer is 128.

[0060] In the fully connected neural network used for feature fusion, the network consists of an input layer, hidden layers, and an output layer. The number of neurons in the input layer is the sum of the number of hidden layer neurons in the LSTM network used to process the time-series features of foreign truck traffic prediction, the number of hidden layer neurons in the feedforward neural network of the Transformer used to process the time-series features of foreign truck traffic prediction, the number of hidden layer neurons in the LSTM network used to process the output of the CNN network, and the number of foreign truck reservation features at the dock crossing, which is 324 in this case; the number of hidden layer neurons is 256; the number of output layer neurons is consistent with the time step of the prediction target. Here, it is necessary to predict the truck traffic prediction value for each hour in the next 4 hours, so the number of output layer neurons is 4.

[0061] For the input of the prediction model , , The temporal and spatial features of the past 24 hours are input into the prediction model, and the batch size is set to 4. , ; Dimensions of input time-series features ; Dimensions of container truck reservation features outside the wharf crossing Number of GPS scatter matrices included per hour GPS scatter matrix size .

[0062] The output of the prediction model is the predicted truck traffic flow outside the dock level for each hour over the next 4 hours.

[0063] During network training, the predicted hourly truck traffic flow outside the dock level for the next 4 hours under the corresponding input features is obtained through forward propagation of the prediction model; the network calculates the loss through the loss function and updates the model parameters based on error backpropagation, thereby completing the training of the prediction model.

[0064] The test samples are input into the trained prediction model. For the trained prediction model, the predicted value of the hourly container truck flow outside the dock in the next 4 hours under the corresponding input features of the test samples is obtained through forward propagation of the prediction model.

[0065] The mean absolute percentage error is used as the evaluation index for this invention. The formula for calculating the mean absolute percentage error is: In the formula, n To test the sample data volume, y i For the first i Actual flow rate at the dock crossing at each time point; For the first i Forecast values ​​of wharf crossing traffic flow at each time point.

[0066] The prediction model proposed in this method has an average relative percentage error of 11.45% for predicting hourly truck traffic flow outside the level crossing over the next 4 hours. Specifically, the average relative percentage errors for predicting truck traffic flow outside the level crossing in the 1st, 2nd, 3rd, and 4th hours are 9.88%, 10.38%, 12.08%, and 13.45%, respectively. The prediction results are as follows: Figure 3 As shown.

[0067] The prediction results of this method are compared with those of LSTM networks and Transformers with the same parameters and processing of the same temporal features. The error percentile plot is shown below. Figure 4 As shown, the average relative percentage error of the LSTM network in predicting hourly truck traffic outside the level crossing for the next 4 hours is 15.87%. Specifically, the average relative percentage errors for predicting truck traffic outside the level crossing for the 1st, 2nd, 3rd, and 4th hours are 14.26%, 14.74%, 16.25%, and 18.23%, respectively. The average relative percentage error of the Transformer network in predicting hourly truck traffic outside the level crossing for the next 4 hours is 16.24%. Specifically, the average relative percentage errors for predicting truck traffic outside the level crossing for the 1st, 2nd, 3rd, and 4th hours are 13.79%, 15.09%, 17.9%, and 18.17%, respectively. This invention reduces the average relative percentage error by 27.85% compared to the LSTM network and by 29.5% compared to the Transformer network. Therefore, the spatiotemporal information fusion prediction model based on a hybrid deep learning architecture proposed in this invention can significantly improve prediction accuracy by fusing spatiotemporal features.

[0068] As can be seen from the results of the embodiments, the spatiotemporal information fusion prediction system for container truck traffic outside the terminal gates proposed in this invention, based on a hybrid deep learning architecture, can complete spatiotemporal information fusion and output the hourly predicted value of container truck traffic outside the terminal gates for the next 4 hours, based on real-time data including the container truck reservation volume and GPS latitude and longitude location data from the reservation system. It combines dynamic real-time performance with significant accuracy advantages, showing a marked performance improvement over the benchmark model. This technological achievement not only provides terminal personnel with a highly reliable decision-making basis for formulating container transshipment plans, but also effectively assists terminals in responding to emergencies in container flow, demonstrating outstanding application value and broad market prospects in the field of port intelligence.

[0069] Example 4 Based on Embodiment 1, this embodiment provides an electronic device, including: one or more processors and a memory, wherein the memory stores one or more programs, the one or more programs including instructions for executing the aforementioned method for predicting truck traffic outside the dock crossing based on a hybrid deep learning architecture.

[0070] At the hardware level, the electronic device includes a processor, internal bus, network interface, memory, and non-volatile memory, and may also include other hardware required for the business. The processor reads the corresponding computer program from the non-volatile memory into memory and then runs it to implement the above-mentioned method for predicting truck traffic outside the dock gate based on a hybrid deep learning architecture. Of course, in addition to the software implementation, this invention does not exclude other implementation methods, such as logic devices or a combination of hardware and software, etc. That is to say, the execution subject of the following processing flow is not limited to individual logic units, but can also be hardware or logic devices.

[0071] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0072] Computer-readable media include both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0073] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and these modifications or substitutions should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A method for predicting the flow of trucks outside a port gate based on a hybrid deep learning architecture, characterized in that, The method comprises: Collecting the data of the truck outside the port gate, preprocessing, data matching calculation and feature engineering processing to construct a truck flow prediction data set outside the port gate; the truck flow prediction data set outside the port gate comprises time series features of the truck flow outside the port gate, spatial features of the truck flow outside the port gate and reservation quantity features of the truck outside the port gate; The truck flow prediction data set outside the port gate is input into a pre-trained prediction model to output the truck flow prediction value of each hour in the future several hours; The prediction model is a hybrid deep learning architecture model trained based on a historical data set of the truck outside the port gate, and the historical data set is divided into a feature data set and a label data set; the hybrid deep learning architecture model uses different networks to process and splice the time series features, spatial features and reservation quantity features, respectively, to realize the spatio-temporal information fusion of the truck flow outside the port gate.

2. The port gate external truck flow prediction method based on a hybrid deep learning architecture according to claim 1, characterized in that, The data of the truck outside the port gate comprises truck information, historical records of the truck arriving at the gate, reservation records of the truck reservation system and real-time global positioning system latitude and longitude position records of the truck.

3. The method according to claim 1, wherein, The preprocessing comprises: Eliminating invalid data: deleting records with missing license plate number, abnormal timestamp and latitude and longitude coordinates beyond the reasonable range around the port; De-duplication processing: double-dimension de-duplication is performed in the way of binding license plate number and timestamp to eliminate completely repeated records.

4. The port gate external truck flow prediction method based on a hybrid deep learning architecture according to claim 1, characterized in that, The process of data matching calculation on the truck data outside the port gate comprises: Hourly arrival flow matching: using the license plate number and the time of the truck arriving at the gate as the unique index, the number of trucks arriving at the gate per hour is calculated based on the historical data; Reservation quantity data matching: eliminating reservation data with reservation time greater than or equal to the reservation operation time, using the license plate number and the reservation arrival time as the unique index, the reservation quantity of the truck outside the port gate per hour is calculated based on the reservation system; GPS and reservation data matching: using the license plate number and the reservation operation time as the unique index, matching the real-time GPS latitude and longitude position records of the truck with the reservation records in the truck reservation system, eliminating the data in the GPS latitude and longitude position records of the truck that fails to match, completing the matching of the GPS latitude and longitude position information of the truck with the reservation information of the truck in the reservation system; for the GPS latitude and longitude position records of the truck that successfully match, eliminating the data in the GPS latitude and longitude position records of the truck with the timestamp greater than the reservation operation time of the truck.

5. The port gate external truck flow prediction method based on a hybrid deep learning architecture according to claim 1, characterized in that, The process of feature engineering processing comprises: Constructing time series features: extracting the hour index of the truck arriving at the gate and the actual arrival flow per hour; based on the hourly flow, calculating the sliding average value of different preset time steps; integrating the hour index, the actual arrival flow per hour and the sliding average value to form the time series feature set of the truck flow outside the port gate; Constructing spatial features: defining an initial GPS latitude and longitude range, dividing the spatial domain into fixed-size grids, regarding the grids in the spatial domain as matrix elements, initializing a GPS scatter matrix; every interval of a preset time, indexing by license plate number and scheduled operation time, counting the GPS position of the truck once; according to the counted GPS latitude and longitude position of the truck, assigning a value to each element in the GPS scatter matrix, constructing the spatial feature of the truck outside the port gate, wherein the value of each element is the number of trucks outside the port gate in the grid; Constructing a reservation quantity feature: based on the reservation quantity of the truck outside the port gate of the reservation system every hour, constructing a truck flow reservation quantity feature set outside the port gate.

6. The port gate external truck flow prediction method based on a hybrid deep learning architecture according to claim 1, characterized in that, The label data set includes the corresponding truck flow outside the gate in the future several hours under different feature combinations, and the label data set is obtained based on the historical record statistics of the truck arriving at the port gate.

7. The port gate external truck flow prediction method based on a hybrid deep learning architecture according to claim 1, characterized in that, The pre-trained prediction model is a hybrid deep learning architecture model, which includes a long short-term memory network, a Transformer, a convolutional neural network and a fully connected neural network, the long short-term memory network and the Transformer process the time sequence features at the same time, and the convolutional neural network and the long short-term memory network process the spatial features; the processing results of the time sequence features and the spatial features are spliced with the reservation quantity features, and input into the fully connected neural network, and the fully connected neural network outputs the predicted value of the truck flow outside the gate in the future several hours.

8. The method according to claim 7, wherein, The long short-term memory network structure includes an input layer, a hidden layer and an output layer, each of the hidden layers contains a plurality of LSTM storage units; the Transformer structure includes a position encoding module, a multi-head self-attention mechanism and an encoder-decoder structure; the long short-term memory network is used to capture the short-term fluctuation features of the time sequence data, and the Transformer is used to capture the global features of the time sequence data; The Transformer encodes the truck flow time sequence feature outside the port gate based on the position encoding module, and supplements the time sequence order information.

9. The method according to claim 7, wherein, The convolutional neural network includes an input layer, a double convolutional layer, an average pooling layer and an output layer; the convolutional neural network extracts local features in the GPS scatter matrix through local connection and weight sharing, and the long short-term memory network captures the spatio-temporal evolution trend of the truck moving from the peripheral grid to the gate based on the local features in the GPS scatter matrix. 10.A terminal truck flow prediction system based on a hybrid deep learning architecture, characterized in that, The system comprises: A spatio-temporal data preprocessing and feature engineering module: based on the historical record of the truck arriving at the gate, the reservation record of the truck reservation system and the real-time global positioning system latitude and longitude position record of the truck, the data preprocessing, matching and feature engineering are completed, so as to construct a port gate truck flow prediction data set; the port gate truck flow prediction data set includes truck flow time sequence features outside the port gate, truck flow spatial features outside the port gate and truck reservation quantity features outside the port gate; The time-space information fusion prediction module of the truck flow outside the wharf crossing outputs the predicted value of the truck flow outside the wharf crossing in each hour in the future several hours. The prediction model construction and training module constructs and trains the prediction model, and the prediction model is a hybrid deep learning architecture model.

Citation Information

Patent Citations

  • Crossing container truck flow prediction method and system, medium and crossing container truck management method

    CN120297514A