Port task load long-short time fusion prediction method and terminal equipment

By employing a dual-model architecture of iTransformer-FECAM and LSTM-FECAM, combined with long-time and short-time datasets and a channel attention mechanism, the problem of insufficient data modeling and the separation between long-time and short-time data in port workload prediction is solved, achieving accurate workload prediction and improving prediction accuracy and production adaptability.

CN121436261APending Publication Date: 2026-01-30TIANJIN UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511526240.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-24
Publication Date
2026-01-30

Smart Images

  • Figure CN121436261A_ABST
    Figure CN121436261A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of port task load prediction, and particularly discloses a port task load long-short time fusion prediction method and terminal equipment, and the method comprises the steps: obtaining historical operation data of a port, the historical operation data comprising influence factor data and task load; performing sparse sampling and dense sampling on the historical operation data to correspondingly obtain a long-term data set and a short-term data set, training a long-term prediction model by using the long-term data set, and training a short-term prediction model based on the long-term prediction model and the short-term data set; respectively inputting the real-time influence factor data of the port into the trained long-term prediction model and short-term prediction model to obtain a long-term prediction task load and a short-term prediction task load; and determining the fusion prediction task load of the port according to the long-term prediction task load and the short-term prediction task load. According to the method, short-term prediction drifting can be avoided in combination with long-term trend constraint, the matching degree of the prediction result and the actual production requirement is improved by 15%-20%, and the error is reduced by 5%-8%.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of port task quantity prediction, and specifically discloses a port task quantity long-short time fusion prediction method and a terminal device. BACKGROUND

[0002] With the expansion of port logistics scale, the volatility of container and material task quantity (such as affected by seasonal changes, international trade policies, extreme weather, etc.) brings severe challenges to production arrangement. Precise task quantity prediction is the core of realizing efficient scheduling of the port. If the prediction deviation is too large, it may lead to idle equipment (task quantity lower than expected) or congestion (task quantity higher than expected), significantly increasing operating costs.

[0003] The existing port task quantity prediction method has the following limitations:

[0004] 1) Insufficient data modeling: traditional methods (such as ARIMA, single LSTM) are difficult to handle multivariate coupling relationships (such as nonlinear correlation between ship arrival quantity and container throughput), and have weak ability to capture long-term trends (such as annual seasonality) and short-term fluctuations (such as weekday / weekend differences) in coordination;

[0005] 2) Long-short time prediction fragmentation: existing technologies mostly separately perform long-term (annual / quarterly) or short-term (monthly / weekly) prediction, long-term prediction ignores short-term sudden factors (such as temporary ship docking), and short-term prediction lacks long-term trend constraints (such as annual capacity planning), resulting in low matching degree of prediction results and actual production demand;

[0006] 3) Low sensitivity to key features: port task quantity is affected by multiple factors (such as holidays, adverse weather may cause task quantity to decrease sharply), traditional models are difficult to dynamically focus on key features, and prediction robustness is insufficient. SUMMARY

[0007] The purpose of the present application is to provide a port task quantity long-short time fusion prediction method and a terminal device to solve the technical problems of insufficient data modeling, long-short time prediction fragmentation and low sensitivity to key features in existing prediction methods.

[0008] The first aspect of the present application provides a port task quantity long-short time fusion prediction method, comprising:

[0009] obtaining historical operation data of the port, the historical operation data including influence factor data and task quantity;

[0010] respectively performing sparse sampling and dense sampling on the historical operation data, corresponding to obtain a long-term data set and a short-term data set, training a long-term prediction model using the long-term data set, and training a short-term prediction model based on the long-term prediction model and the short-term data set;

[0011] inputting real-time influencing factor data of the port into the trained long-term prediction model and the trained short-term prediction model respectively to obtain a long-term predicted task quantity and a short-term predicted task quantity;

[0012] determining a fusion predicted task quantity of the port according to the long-term predicted task quantity and the short-term predicted task quantity.

[0013] Preferably, the long-term prediction model is trained by using a long-term data set, and the short-term prediction model is trained based on the long-term prediction model and a short-term data set, specifically:

[0014] After training the long-term prediction model by using the long-term data set, a long-term predicted task quantity of a preset time period is obtained;

[0015] determining a short-term basic task quantity according to the long-term predicted task quantity of the preset time period and a length of the preset time period;

[0016] obtaining a short-term predicted task quantity in the preset time period during training of the short-term prediction model by using the short-term data set, and training the short-term prediction model according to the short-term predicted task quantity in the preset time period and the short-term basic task quantity.

[0017] Preferably, after determining the short-term basic task quantity according to the long-term predicted task quantity of the preset time period and the length of the preset time period, the method further comprises:

[0018] obtaining a historical actual short-term task quantity and a mean value of the same period as the preset time period;

[0019] determining a fluctuation coefficient according to the historical actual short-term task quantity and the mean value;

[0020] correcting the short-term basic task quantity by using the fluctuation coefficient.

[0021] Preferably, the short-term prediction model is trained according to the short-term predicted task quantity in the preset time period and the short-term basic task quantity, specifically:

[0022] determining a relative deviation rate of the short-term predicted task quantity to the short-term basic task quantity;

[0023] determining a total loss function according to the relative deviation rate and a preset deviation threshold, and training the short-term prediction model with an optimization goal of minimizing the total loss function.

[0024] Preferably, the total loss function is determined according to the relative deviation rate and the preset deviation threshold, specifically:

[0025] the relative deviation rate the date of the preset deviation threshold, a regular prediction loss function is determined according to the short-term predicted task quantity and a real task quantity of the day;

[0026] Relative deviation rate For dates that deviate from the threshold, a trend constraint loss function is determined based on the penalty weight, short-term predicted task volume, and the actual task volume on that day.

[0027] The total loss function is determined based on the conventional prediction loss function and the trend constraint loss function.

[0028] Preferably, the preset deviation threshold is 15%.

[0029] Preferably, the real-time influencing factor data of the port is input into the trained long-term prediction model to obtain the long-term prediction task quantity, specifically as follows:

[0030] The real-time influencing factors data of the port are input into the trained iTransformer model to obtain the first feature tensor. ;

[0031] The first feature tensor The input is fed into the trained channel attention module to obtain the long-term prediction task volume; the channel attention module is a FECAM module, an SE module, or a CBAM module.

[0032] Preferably, the real-time influencing factor data of the port is input into the trained short-term prediction model to obtain the short-term prediction task, specifically as follows:

[0033] The real-time influencing factors data of the port are input into the trained LSTM model to obtain the second feature tensor. ;

[0034] The second feature tensor The input is fed into the trained channel attention module to obtain the short-term prediction task volume; the channel attention module is a FECAM module, an SE module, or a CBAM module.

[0035] Preferably, the port's integrated forecast task volume is determined based on the long-term forecast task volume and the short-term forecast task volume, specifically as follows:

[0036] Based on the long-term forecast task volume and the duration of the preset period, a short-term forecast benchmark value is determined.

[0037] The port's integration forecast task volume is determined based on the short-term forecast task volume and the short-term forecast baseline value.

[0038] A second aspect of the present invention provides a terminal device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the above-described port task volume long-term and short-term fusion prediction method.

[0039] The port task volume long-term and short-term fusion prediction method and terminal equipment of the present invention have the following advantages compared with the prior art:

[0040] 1. Improved Prediction Accuracy: Utilizing a dual-model architecture of iTransformer-FECAM and LSTM-FECAM (with a channel attention mechanism supporting flexible selection of FECAM, SE, and CBAM modules), it accurately captures multivariate coupling relationships (such as the nonlinear correlation between ship arrivals and container throughput). FECAM's multi-scale feature enhancement capability dynamically focuses on key features (such as short-term ship arrival plans and long-term policy adjustments), resulting in an average reduction of over 3.2% in MAE and MSE compared to traditional models (such as single LSTM or ARIMA). In extreme scenarios (such as sudden policy changes leading to a surge in workload), the prediction error can be reduced by 5%-8%.

[0041] 2. Long-term and short-term synergistic optimization: Long-term trend constraints avoid short-term forecast "drift" (such as ignoring the annual peak season trend), while short-term fluctuations capture and adapt to unexpected factors (such as temporary ship docking), improving the matching degree between forecast results and actual production demand by 15%-20%;

[0042] 3. Strong production adaptability: The forecast results are directly mapped to the scheduling of warehousing, personnel, and equipment, which can reduce equipment idle rate by more than 10% and reduce delay costs caused by congestion by 8%-12%;

[0043] 4. Excellent generalization ability: It adapts to complex port scenarios (such as weather changes and policy adjustments) through multivariate modeling and performs stably in ports of different sizes (coastal hub ports and inland river ports). Attached Figure Description

[0044] Figure 1 This is a flowchart of the port task volume long-term and short-term fusion prediction method according to an embodiment of the present invention. Detailed Implementation

[0045] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of the invention. However, those skilled in the art will understand that the invention can be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods are omitted so as not to obscure the description of the invention with unnecessary detail.

[0046] The first aspect of this invention provides a long-term and short-term time series fusion prediction method for port workload, specifically a time series fusion prediction method for port workload based on a dual-model architecture of LSTM and iTransformer. By combining long-term trend prediction and short-term fluctuation prediction, it achieves accurate prediction of port container / material workload, providing support for the rational scheduling of production tasks. The process of this invention embodiment is as follows: Figure 1 As shown, it includes:

[0047] Step 1: Obtain historical operational data of the port, including influencing factors and workload.

[0048] The influencing factors in the embodiments of the present invention include the number of ships arriving at the port (daily), weather data (rainfall, wind), holiday markings, international trade policy adjustment records, port equipment failure rate, and surrounding transportation capacity.

[0049] The task volume in this embodiment of the invention is the container throughput (TEU / day) or the material loading and unloading volume (tons / day).

[0050] After obtaining the aforementioned historical operational data, this embodiment of the invention performs data cleaning and standardization, as follows:

[0051] Outlier handling: The “3σ criterion + business verification” is adopted. Potential outliers exceeding “mean ± 3 times standard deviation” are confirmed by combining business data such as equipment failure records and weather warnings. Outliers caused by data collection errors are replaced with the average of the next 3 days.

[0052] Missing value imputation: For short-term missing values ​​(1-2 days), linear interpolation is used; for long-term missing values ​​(more than 3 days), similar periodic mapping is used (matching historical data on similar ship arrivals and weather patterns).

[0053] Standardization: Z-score standardization is used to map the input features to a zero-mean, unit-variance distribution, as shown in formula (1):

[0054] (1)

[0055] In the formula, These are the original eigenvalues. The characteristic mean, The characteristic standard deviation is denoted as .

[0056] All historical operational data used subsequently were cleaned and standardized.

[0057] Step 2: Perform sparse and dense sampling on the historical data to obtain long-term and short-term datasets, respectively. Train a long-term prediction model using the long-term dataset, and train a short-term prediction model based on the long-term and short-term datasets. Specifically:

[0058] Step 2.1: Perform sparse sampling and dense sampling on the historical running data to obtain the long-term dataset and the short-term dataset respectively.

[0059] Long-term dataset: Monthly sparse sampling (average of the last 5 working days of each month) is used to cover 5-10 years of historical data to capture long-term trends such as annual seasonality and policy cycles.

[0060] Short-term dataset: Daily intensive sampling, covering data from the most recent 3-6 months, is used to capture short-term fluctuations such as weekly peaks and troughs and temporary ship berthing.

[0061] Step 2.2: Train a long-term prediction model using the long-term dataset, and train a short-term prediction model based on the long-term prediction model and the short-term dataset.

[0062] In this embodiment of the invention, both the long-term dataset and the short-term dataset are divided into training set, validation set, and test set in a ratio of 8:1:1.

[0063] The overall architecture of the model in this embodiment includes a long-term trend prediction module (corresponding to a long-term prediction model), a short-term fluctuation prediction module (corresponding to a short-term prediction model), and a trend fusion module, forming a heterogeneous dual-track prediction system.

[0064] In this embodiment of the invention, a phased training strategy is adopted when training the long-term and short-term prediction models. Phased training enables synergistic prediction by "constraining short-term fluctuations with long-term trends." First, the long-term prediction model learns the macro-level patterns of port workload (such as annual seasonality and policy cycles). Then, using the long-term prediction results as a benchmark, the short-term prediction model is guided to avoid deviating from the macro-level trend when capturing intraday / weekly fluctuations. This avoids "trend drift" in short-term predictions due to local noise (such as temporary equipment failures or abnormal weather on a single day), ultimately improving the overall accuracy and production adaptability of the fusion prediction of long-term and short-term predictions. Phased training allows the long-term module to first determine the "general direction," and then allows the short-term module to accurately capture small fluctuations while ensuring that the "general direction" remains unchanged. Ultimately, the prediction results conform to both long-term trends and short-term realities.

[0065] Under the above-mentioned phased training concept, step 2.2 specifically includes:

[0066] Step 2.2.1: After training the long-term prediction model using the long-term dataset, obtain the long-term prediction task volume for the preset time period.

[0067] The long-term prediction model used in this embodiment of the invention is an iTransformer model based on a channel attention mechanism. MSE is used as the loss function to learn macro trends and save optimal parameters. The channel attention mechanism used corresponds to modules such as FECAM, SE, or CBAM. Because the FECAM module can refine and enhance the original features through feature enhancement branches, it can more accurately capture the dynamic changes of "strong transientity" (such as temporary ship berthing) and "strong correlation" (such as the lagged correlation between policy adjustments and monthly task volume) features in port scenarios. Compared to the single-dimensional compression of the SE module or the simple spatial-channel stitching of CBAM, it better fits the nonlinear characteristics of multivariate time-series data in ports, significantly improving the model's sensitivity to key influencing factors. Therefore, this embodiment of the invention preferably uses the FECAM module.

[0068] Training process: Using a long-term dataset, training was conducted independently until convergence, and the optimal parameters were saved. The training consisted of 20 epochs, with the Adam optimizer (learning rate 0.0001). Appropriate momentum and weight decay terms were configured according to the specific task requirements. The batch size was set to 64, and an early stopping mechanism (patience=4) was used to avoid overfitting.

[0069] Step 2.2.2: Determine the short-term basic task volume based on the long-term predicted task volume and the duration of the preset period, and then obtain the historical actual short-term task volume and average value for the same period as the preset period; determine the fluctuation coefficient based on the historical actual short-term task volume and average value; and use the fluctuation coefficient to correct the short-term basic task volume.

[0070] For example: First, the trained long-term forecasting model (using the iTransformer-FECAM model as an example) is invoked, outputting the long-term forecasted task volume (monthly / quarterly average task volume) for a preset period (e.g., May-July 2024). This serves as the "general basis" for generating the short-term basic task volume, ensuring it aligns with long-term patterns (e.g., peak / off-peak seasons, policy influences). Then, the long-term forecasted task volume (monthly average task volume) output by the long-term forecasting model is averaged over the preset period's duration (actual number of days in the month) to obtain the "short-term basic task volume under no-fluctuation conditions," which serves as an initial reference. That is: Short-term basic task volume = Long-term forecasted task volume output by the long-term forecasting model (monthly average task volume) ÷ Preset period's duration (actual number of days in the month). Since the port's short-term task volume is affected by "date type"... Significant impacts (e.g., busy weekdays, less busy weekends, and even less busy holidays) necessitate analyzing historical data from the same period to calculate "fluctuation coefficients for different date types." This data is used to adjust the baseline task volume to better reflect reality. For example, selecting daily actual task volume data from the past three years and the same period as the preset timeframe (e.g., May 2021-2023), the ratio of "actual short-term task volume to the average daily task volume of the month (historical average short-term task volume)" for different date types (weekdays / weekends / holidays) is calculated, and the average value is used as the fluctuation coefficient. Finally, the short-term baseline task volume is multiplied by the corresponding date's fluctuation coefficient to obtain the adjusted short-term baseline task volume: Short-term baseline task volume = Fluctuation coefficient of the corresponding date × Short-term baseline task volume. This adjusted short-term baseline task volume serves as the "reasonable range line" for the short-term forecasting model. When the short-term forecast task volume deviates from this value by more than a preset deviation threshold, a penalty mechanism for trend constraint loss is triggered.

[0071] The short-term basic task volume is a "reasonable fluctuation reference line" set by the long-term trend module for each day in the short term. The core is to break down the long-term predicted monthly / quarterly macro task volume into specific reference values ​​for each day in the short term, so as to ensure that the short-term prediction does not deviate from the long-term trend.

[0072] Step 2.2.3: Obtain the short-term prediction task volume within a preset time period during the training of the short-term prediction model using the short-term dataset, and train the short-term prediction model based on the short-term prediction task volume and the short-term basic task volume within the preset time period.

[0073] The short-term prediction model in this embodiment of the invention is an LSTM model based on a channel attention mechanism, wherein the module corresponding to the channel attention mechanism used is the FECAM module, the SE module, or the CBAM module. The FECAM module is preferred.

[0074] In this embodiment of the invention, the parameters of the long-term prediction model are fixed to train the short-term prediction model, and a trend constraint loss is introduced to ensure that short-term fluctuations do not deviate from the long-term benchmark. When the short-term prediction task amount predicted by the short-term prediction model (LSTM-FECAM) deviates from the corresponding short-term basic task amount by more than a preset deviation threshold, the prediction error cost of the model needs to be increased through the "trend constraint loss" to force the short-term prediction to revert to the long-term trend.

[0075] Specifically, the short-term prediction model is trained based on the short-term prediction task volume and the short-term basic task volume within a preset time period, as follows:

[0076] S1. Determine the relative deviation rate of the short-term forecast task quantity from the short-term basic task quantity: Relative deviation rate = .

[0077] S2. Determine the total loss function based on the relative deviation rate and the preset deviation threshold, and train a short-term prediction model with the goal of minimizing the total loss function. In this embodiment of the invention, the preset deviation threshold is 15%.

[0078] The total loss function is determined based on the relative deviation rate and a preset deviation threshold, specifically as follows:

[0079] S21. Regarding relative deviation rate For dates with a preset deviation threshold, a conventional prediction loss function is determined based on the short-term predicted task volume and the actual task volume for that day. This embodiment of the invention uses Mean Absolute Error (MAE) to calculate the error between the short-term predicted task volume and the actual task volume for that day, adapting to the high noise characteristics of short-term data (avoiding excessive interference from extreme values).

[0080] Conventional prediction loss =

[0081] In this embodiment of the invention, the short-term forecast task volume is the daily forecast task volume, and T1 is the relative deviation rate. The total number of days that deviate from the preset threshold, i.e., the relative deviation rate. The total number of valid workdays that deviate from the preset threshold, where t is the t-th valid workday in T1.

[0082] S22, Regarding relative deviation rate The date of deviation from the threshold is preset, and the trend constraint loss function is determined based on the penalty weight, the short-term predicted task volume, and the actual task volume on that day.

[0083] This invention introduces penalty weights. (An empirical value of 1.8 is used, which can be adjusted according to the port's sensitivity to trends.) The cost of amplifying deviation errors:

[0084] Trend constraint loss = .

[0085] In the formula, For indicator functions (satisfying) If the percentage is greater than 15%, take 1; otherwise, take 0. The penalty weight is T2, and the relative deviation rate is T2. The total number of days that deviate from the preset threshold, i.e., the relative deviation rate. The total number of valid workdays that deviate from the preset threshold, where t is the t-th valid workday in T2.

[0086] S23. Finally, determine the total loss function based on the conventional prediction loss function and the trend constraint loss function.

[0087] In this embodiment of the invention, the total loss is determined by a weighted sum of the conventional prediction loss and the trend constraint loss, wherein the weight of the trend constraint loss is... A value of 0.7 is used to ensure the dominance of trend constraints and avoid short-term forecasts ignoring long-term benchmarks. Specifically: Total Loss = Conventional Forecasting Loss + × Trend constraint loss.

[0088] This invention updates the parameters of the short-term prediction model by minimizing the total loss. When the trend constraint loss is triggered, the short-term prediction model will adjust its prediction logic, correcting the predicted value to within ±15% of the short-term baseline task volume. Training and validation requirements: the prediction deviation rate for more than 90% of effective workdays must be less than or equal to 15%; otherwise, the penalty weight should be increased. Retrain.

[0089] Step 3: Input the real-time influencing factors data of the port into the trained long-term prediction model and short-term prediction model respectively to obtain the long-term prediction task and short-term prediction task.

[0090] Step 3.1: Input the real-time influencing factors data of the port into the trained long-term prediction model to obtain the long-term prediction task quantity, specifically:

[0091] Step 3.1.1: Input the real-time influencing factors of the port into the trained iTransformer model to obtain the first feature tensor. .

[0092] This invention employs the iTransformer architecture (adapted for long-term time-series modeling) and introduces the FECAM module (Frequency Enhancement Channel Attention Mechanism module) to enhance key feature capture. The input is a multivariate sequence corresponding to real-time influencing factors data of the port. (where L is the sequence length and C is the number of channels at each time step), it is first mapped to a high-dimensional feature space through an embedding layer.

[0093] (2)

[0094] In the formula, Representing feature dimension, This represents the embedding layer. This embedding layer aims to integrate original variable features, temporal location information, and timestamp information to provide a unified and rich identifier for subsequent deep modeling. Subsequently, the embedded features... The data is fed into multiple iTransformer encoder layers for deep feature modeling. Each encoder layer mainly consists of a Factorized Channel Attention module and a Feedforward Neural Network (FFN). Unlike standard self-attention mechanisms that compute the entire feature dimension, iTransformer computes the feature dimension... The code is divided into G subspaces, and attention computation is performed independently within each subspace. Let the input of a certain encoder layer be... The attention mechanism first calculates the query, key, and value. . , and These are the weight matrices for the query, key, and value, respectively.

[0095] Within the channel factorization framework, assuming the channel is divided into G subspaces, attention computation is performed independently within each subspace:

[0096] (3)

[0097] In the formula, Let be the channel dimension of the g-th subspace.

[0098] The attention outputs of all subspaces are concatenated and residually connected to the original input to form the encoder output of that layer.

[0099] (4)

[0100] In the formula, For weights.

[0101] Subsequently, the encoder output is fed into a feedforward neural network (FFN) layer for nonlinear transformation to obtain the first feature tensor. .

[0102] (5)

[0103] Step 3.1.2: Convert the first feature tensor The input is fed into the trained channel attention module to obtain the long-term prediction task volume; this embodiment of the invention uses the FECAM module as an example to illustrate this step.

[0104] This invention introduces the FECAM module into the iTransformer architecture. The attention mechanism of iTransformer mainly focuses on the relevance in the time dimension and does not distinguish the "criticality" of the variables themselves, resulting in all variable channels having approximately equal initial attention. The FECAM module can solve this channel attention problem.

[0105] The FECAM module constructs a mechanism that can adaptively weight and enhance feature channels (i.e., variable dimensions). This module first processes the input feature tensor... A global analysis is performed, where B, L, and d represent the batch size, time step length, and feature dimension, respectively. First, the input is transposed along the channel dimension, and channel-level statistical features are extracted using global average pooling.

[0106] (6)

[0107] (7)

[0108] Subsequently, through two layers of one-dimensional convolution ( Channel attention weights are generated using a non-linear activation function.

[0109] (8)

[0110] in, For pointwise convolution kernels, This is a compression ratio hyperparameter. for Activation function.

[0111] Then, the generated channel attention weights are broadcast to the input feature tensor to perform channel weighting:

[0112] (9)

[0113] After all encoder layers are stacked, the final output features are linearly mapped to generate the target prediction value.

[0114] (10)

[0115] In the formula, To predict the step size, , This is a bias term.

[0116] The FECAM module dynamically focuses on long-term key features. For example, for features that influence long-term trends, such as adjustments in international trade policies, the module automatically increases the weight of these features. For historical annual fluctuations, the FECAM module introduces multi-scale convolution to extract local dependencies. This multi-scale design effectively adapts to the characteristic that local fluctuations in long-term port workload data contain key information. For instance, a sudden increase in workload due to policy changes in a specific quarter can be accurately captured through multi-scale receptive fields. The FECAM module concatenates global and local features and generates refined attention weights through a fully connected network. This achieves enhanced representation of key variables (weight > 1) and suppression of redundant variables (weight < 1), thereby enabling refined control over the significance of variables.

[0117] This invention addresses the low noise and strong trend characteristics of long-term data by simplifying local feature extraction, strengthening the synergistic effect of channel factorization attention mechanism and FECAM, and improving the ability to capture cross-year trends. The output of the long-term prediction module is a prediction of the quarterly / monthly task volume trend for the next 1-3 years.

[0118] Step 3.2: Input the real-time influencing factor data of the port into the trained short-term prediction model to obtain the short-term prediction task volume, specifically:

[0119] Step 3.2.1: Input the real-time influencing factors of the port into the trained LSTM model to obtain the second feature tensor. .

[0120] This invention employs an LSTM architecture (adapted for short-term fluctuation modeling) and introduces FECAM to enhance key feature capture. The input is a multivariate sequence corresponding to the real-time influencing factors of the port. First, time-series features are extracted using the LSTM model.

[0121] LSTM handles temporal dependencies through a gating mechanism. The core state update formula is as follows:

[0122] Forget gate: Used to filter information that needs to be retained in historical unit states; the calculation formula is as follows. ,in The sigmoid activation function is used. Here is the forget gate weight matrix. This represents the concatenated vector of the hidden state from the previous time step and the input from the current time step. This is the forget gate bias term.

[0123] Input gate: Used to control the update ratio of the current information to the cell state; the calculation formula is as follows. ,in The input gate weight matrix, For input gate bias terms;

[0124] Candidate cell state values: Generate new information for the current time step, calculated using the following formula: ,in The hyperbolic tangent activation function is used. The unit state weight matrix, This refers to the unit state bias term.

[0125] Cell status update: Combining historically retained information with current new information, the calculation formula is as follows: ,in This indicates element-wise multiplication.

[0126] Output gates: determine the information that needs to be output to the hidden state in a cell state; the calculation formula is as follows. ,in This is the output gate weight matrix. This is the output gate bias term.

[0127] Hidden state: This is the output feature at the current time step, calculated using the following formula: .

[0128] The feature tensor is obtained after LSTM processing. (B is the batch size, N is the sequence length, and E is the number of channels at each time step), where H is the hidden state at each time step. It was pieced together in chronological order.

[0129] Step 3.2.2: Convert the second feature tensor The input is fed into the trained channel attention module to obtain the short-term prediction task volume; for example, the channel attention module is the FECAM module.

[0130] The embodiments of the present invention use feature tensors The input features are then fed into the FECAM module for channel feature enhancement. The FECAM module aims to dynamically distinguish the criticality of variables. It first performs a global analysis of the input feature tensor, extracting statistical features through channel transpose and global average pooling.

[0131] (11)

[0132] (12)

[0133] Subsequently, channel attention weights are generated using two layers of one-dimensional convolution and a non-linear activation function:

[0134] (13)

[0135] in, For pointwise convolution kernels, This is a compression ratio hyperparameter. for Activation function.

[0136] Then, the generated channel attention weights are broadcast to the input feature tensor. Above, implement channel weighting operations:

[0137] (14)

[0138] (15)

[0139] The features enhanced by the FECAM module are fed into a fully connected layer for nonlinear transformation, and finally the target prediction value is generated through linear mapping.

[0140] (16)

[0141] In the formula, To predict the step size, This is a bias term.

[0142] This invention addresses the high noise and strong fluctuations inherent in short-term data by enhancing the multi-scale feature capture capabilities of the FECAM module, thereby improving the response accuracy to intra-weekly differences and sudden factors. The short-term prediction model outputs a prediction of daily task volume for the next 1-3 months.

[0143] Step 4: Determine the port's integrated forecast task volume based on the long-term and short-term forecast task volumes, specifically as follows:

[0144] Step 4.1: Determine the short-term forecast baseline value based on the long-term forecast task volume and the duration of the preset period.

[0145] In this embodiment of the invention, the long-term predicted task volume (average monthly task volume) corresponding to a preset time period (e.g., May-July 2024) is obtained. Then, the long-term predicted task volume (average monthly task volume) is averaged over the duration of the preset time period (actual number of days in the month) to obtain a "short-term prediction benchmark value under no fluctuation condition," which serves as an initial reference. That is: Short-term prediction benchmark value = Long-term predicted task volume (average monthly task volume) ÷ Duration of the preset time period (actual number of days in the month). Since the port's short-term task volume is significantly affected by "date type" (e.g., busy on weekdays, less busy on weekends, and even less busy on holidays), it is necessary to statistically analyze the "fluctuation coefficient for different date types" from historical data of the same period to correct the short-term prediction benchmark value, making it more consistent with reality. For example, the actual daily task volume data of the same period over the past 3 years (e.g., May 2021-2023) is selected, and the "ratio of actual short-term task volume to the average daily task volume of the month (historical average short-term task volume)" for different date types (weekdays / weekends / holidays) is calculated, and the average value is taken as the fluctuation coefficient. Finally, the short-term forecast benchmark value is multiplied by the volatility coefficient of the corresponding date to obtain the corrected short-term forecast benchmark value, that is: short-term forecast benchmark value = volatility coefficient of the corresponding date × short-term forecast benchmark value.

[0146] Step 4.2: Determine the port's integrated forecast task volume based on the short-term forecast task volume and the short-term forecast baseline value.

[0147] This invention employs a "dynamic weighted overlay" strategy to fuse long-term and short-term forecast results. This strategy, based on the forecast time span and the characteristics of port business scenarios, achieves adaptive coordination between long-term trends and short-term fluctuations. The specific mechanism is as follows:

[0148] Long-term trend weight The weighting of the short-term forecast baseline is adjusted over a longer time span. The core logic is to strengthen the constraint of long-term trends on the overall forecast results as the forecast period lengthens. When forecasting the workload within one month, When the value is 0.3, short-term fluctuations have a more significant impact on the near-term task volume; when predicting the task volume for 3 months, Increase it to 0.5 to strengthen the guiding role of long-term trends (such as quarterly production planning).

[0149] Short-term volatility weight ( Focusing on recent dynamic responses, the model dynamically increases the weighting of short-term factors in port operations, specifically addressing the significant impact of unforeseen factors (such as approaching holidays or temporary concentrated vessel arrivals) on short-term workload. For example, during special periods such as before and after holidays, the short-term weighting can be increased to 0.8, ensuring the model accurately captures short-term sudden business fluctuations.

[0150] The final port's convergence prediction task volume is achieved through " × Short-term forecast baseline + ( The weighted calculation is derived from "() × short-term forecast task volume". This dynamic weighting mechanism not only ensures that the long-term trend provides a basic constraint on the forecast results and avoids trend deviations in short-term forecasts due to local fluctuations, but also allows for precise adaptation to short-term emergencies in port operations through flexible adjustment of short-term weights, achieving an organic integration of the advantages of long-term and short-term forecasts and improving the matching degree between the overall forecast results and actual production needs.

[0151] This invention uses mean absolute error (MAE), mean square error (MSE), and root mean square error (RMSE) to evaluate prediction accuracy.

[0152] (17)

[0153] (18)

[0154] (19)

[0155] In the formula, For the first The true value in the next period For the model number Predicted values ​​for the next cycle assessment This represents the total number of cycles.

[0156] MAE: Reflects the overall error level; the smaller the value, the better.

[0157] MSE: Amplifies extreme errors (such as sudden changes in workload). The smaller the value, the stronger the stability.

[0158] A second aspect of the present invention provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the above-described port task volume long-term and short-term fusion prediction method.

[0159] Based on the above-mentioned port integrated forecast workload, the port production task scheduling application process is as follows:

[0160] 1. Input real-time data on factors affecting the port (such as the number of ships arriving on the day and the status of equipment).

[0161] 2. Call the trained model to output the daily fusion prediction task volume for the next 1-3 months.

[0162] 3. Generate production scheduling suggestions based on the forecast results:

[0163] Production scheduling quantitative mapping rules: A quantitative decision-making model is built based on historical operational data (task volume, equipment efficiency, and personnel productivity over the past 12 months). The core thresholds and mapping relationships are as follows:

[0164] (1) Threshold determination method

[0165] Basic parameter calculation:

[0166] Daily processing capacity of a single shift (S): Take the 90th percentile of the actual efficiency of the shift over the past 3 months (filtering out extremely inefficient data), such as S=600 TEU / shift (that is, 90% of the shifts can achieve this efficiency).

[0167] Daily processing capacity (E) of a single loading and unloading equipment: statistics by equipment type (e.g., automated quay crane E=1200 TEU / unit, manual gantry crane E=800 TEU / unit).

[0168] Storage safety capacity (C): Total storage capacity × 0.85 (15% buffer reserved to cope with sudden stockpiling). For example, when the total capacity is 50,000 TEU, C = 42,500 TEU.

[0169] Equipment idle rate benchmark (R): the average idle rate over the past 6 months, such as R=18% (target to reduce to 8%-12%).

[0170] Dynamic threshold setting:

[0171] Peak day determination threshold: The total number of tasks predicted by the fusion is greater than the average daily task volume of the same period in history by 1.3 (i.e., exceeding the same period by 30%).

[0172] Team adjustment threshold: Fusion prediction task volume > current number of teams × S × 1.1 (1.1 is the redundancy coefficient to cover prediction error).

[0173] Equipment activation threshold: Fusion prediction task volume > total capacity of currently activated equipment × 1.05.

[0174] Warehouse early warning threshold: Integrated predicted storage demand > C × 0.9 (i.e., reaching 90% of safe capacity).

[0175] The projected storage demand comprises current inventory not yet shipped + inventory in transit awaiting warehousing + future new pre-warehousing volume + temporary adjustments. The future new pre-warehousing volume is determined by the projected container throughput and material handling volume. Higher throughput and handling volume result in a larger future new pre-warehousing volume and increased storage demand.

[0176] (2) Dimensional Production Arrangement

[0177] Long-term perspective (1-3 months):

[0178] Warehouse planning: When the cumulative forecasted storage demand for the quarter is greater than C×0.8, reserve 5% of the temporary storage area one month in advance (such as leasing surrounding storage yards) and initiate a plan to remove overdue goods (prioritizing the transfer of goods that have been overdue for more than 14 days).

[0179] Equipment allocation: If the predicted workload for three consecutive months is greater than the average monthly total equipment capacity × 0.9, the long-term equipment leasing process will be triggered (e.g., leasing two more automated quay cranes for a period of three months).

[0180] Short-term perspective (1-7 days):

[0181] Staffing schedule:

[0182] If the predicted daily task volume is 9000 TEU, and the current number of work groups is 12 (12×600=7200 TEU), since 9000>12×600×1.1=7920, the number of work groups needs to be increased by ceil [(9000-7920) / 600]=2 (finally 14 work groups).

[0183] If the predicted daily workload is 5000 TEU (lower than 12×600×0.7=5040), reduce the number of work groups by 2 (adjust to 10), and arrange for them to take turns resting and training.

[0184] Equipment scheduling:

[0185] When the peak day is predicted (e.g., 9000 TEU), the total capacity of the equipment to be activated is 9000 × 1.05 = 9450 TEU. The equipment should be activated according to the principle of "prioritizing high-efficiency equipment" (e.g., if the current capacity is 8000 TEU, one additional unit needs to be activated).

[0186] When a low-load day is predicted (e.g., 5000 TEU), 30% of the ordinary loading and unloading equipment will be shut down, while high-efficiency equipment will be kept on standby, keeping the idle rate ≤10%.

[0187] Emergency plan: When the upper limit of the predicted confidence interval is greater than 1.2 times the total equipment capacity, contact a temporary labor team to stand by 24 hours in advance.

[0188] 4. Closed-loop optimization: Collect actual task volume, equipment utilization rate, and personnel efficiency data daily and compare them with the fusion predicted task volume. If the deviation is >8% for 3 consecutive days, automatically update the threshold parameters (such as adjusting the calculation cycle of S and E to the past month to enhance the adaptability to recent efficiency changes).

[0189] This invention proposes a port workload prediction method that integrates LSTM and iTransformer dual models. Its core breakthroughs include:

[0190] The dual-track forecasting architecture, which combines long-term and short-term forecasting, uses sparse sampling to capture annual / quarterly trends and dense sampling to capture monthly / weekly fluctuations. The trend fusion module achieves "long-term constraints on short-term trends".

[0191] Multivariate Feature Enhancement Modeling: This invention introduces a channel attention mechanism to dynamically focus on key features (such as short-term ship arrival plans and long-term policy adjustments), enhancing sensitivity to sudden factors and core variables. Considering the complexity of multivariate coupling in port workload forecasting (such as the dynamic weight differences of features like weather, ship arrival volume, and holidays), this invention is compatible with various mainstream channel attention modules (such as the SE module, CBAM module, and FECAM module). Among them, FECAM is preferred because it refines and strengthens the original features through feature enhancement branches, enabling it to more accurately capture the dynamic changes of "strong instantaneity" (such as temporary ship berthing) and "strong correlation" (such as the lagged correlation between policy adjustments and monthly workload) features in port scenarios. Compared to the single-dimensional compression of the SE module or the simple space-channel splicing of CBAM, it better fits the nonlinear characteristics of port multivariate time-series data, significantly improving the model's sensitivity to key influencing factors.

[0192] Production adaptation output: The prediction results are directly mapped to production task arrangements (such as equipment scheduling and warehouse reservation), realizing a "prediction-scheduling" closed loop.

[0193] The above descriptions are merely a few embodiments of the present invention and are not intended to limit the present invention in any way. Although the present invention has been disclosed above with reference to preferred embodiments, it is not intended to limit the present invention. Any modifications or alterations made by those skilled in the art without departing from the scope of the technical solution of the present invention using the disclosed technical content are equivalent to equivalent implementation cases and fall within the scope of the technical solution.

Claims

1. A port task volume long and short time fusion prediction method, characterized in that, The method comprises the following steps: acquiring historical operation data of a port, the historical operation data comprising influence factor data and task volume; respectively performing sparse sampling and dense sampling on the historical operation data to obtain a long-term data set and a short-term data set, training a long-term prediction model using the long-term data set, and training a short-term prediction model based on the long-term prediction model and the short-term data set; inputting real-time influence factor data of the port into the trained long-term prediction model and short-term prediction model to obtain a long-term predicted task volume and a short-term predicted task volume; determining a fused predicted task volume of the port according to the long-term predicted task volume and the short-term predicted task volume.

2. The port task length short-time fusion prediction method according to claim 1, characterized in that, The long-term prediction model is trained using the long-term data set, and the short-term prediction model is trained based on the long-term prediction model and the short-term data set, specifically as follows: after training the long-term prediction model using the long-term data set, a long-term predicted task volume of a preset time period is acquired; a short-term basic task volume is determined according to the long-term predicted task volume of the preset time period and the length of the preset time period; a short-term predicted task volume in the preset time period is acquired during training of the short-term prediction model using the short-term data set, and the short-term prediction model is trained according to the short-term predicted task volume in the preset time period and the short-term basic task volume.

3. The port task length short-time fusion prediction method according to claim 2, characterized in that, After determining the short-term basic task volume according to the long-term predicted task volume of the preset time period and the length of the preset time period, the following steps are further included: acquiring a historical actual short-term task volume and a mean value of the same period as the preset time period; determining a fluctuation coefficient according to the historical actual short-term task volume and the mean value; correcting the short-term basic task volume using the fluctuation coefficient.

4. The port task length short-time fusion prediction method according to claim 2, characterized in that, The short-term prediction model is trained according to the short-term predicted task volume in the preset time period and the short-term basic task volume, specifically as follows: determining a relative deviation rate of the short-term predicted task volume from the short-term basic task volume; determining a total loss function according to the relative deviation rate and a preset deviation threshold, and training the short-term prediction model with an optimization goal of minimizing the total loss function.

5. The port task length short-time fusion prediction method according to claim 4, characterized in that, The total loss function is determined according to the relative deviation rate and the preset deviation threshold, specifically as follows: Relative deviation rate The date of the preset deviation threshold is determined according to the short-term prediction task quantity and the real task quantity of the day. Relative deviation rate The date of the preset deviation threshold value is determined according to a trend constraint loss function of a penalty weight, a short-term prediction task quantity and a real task quantity of the day. determining the total loss function according to the conventional prediction loss function and the trend constraint loss function.

6. The port task length short-time fusion prediction method according to claim 5, characterized in that, The preset deviation threshold is 15%.

7. The port task length short-time fusion prediction method according to claim 1, characterized in that, The real-time influence factor data of the port is input into the trained long-term prediction model to obtain a long-term predicted task volume, specifically as follows: inputting real-time influencing factor data of the port into the iTransformer model trained to obtain a first feature tensor ; The first feature tensor is input to a trained channel attention module to obtain a long-term prediction task quantity; the channel attention module is an FECAM module, an SE module, or a CBAM module.

8. The port task length short-time fusion prediction method according to claim 1, characterized in that, The real-time influence factor data of the port is input into the trained short-term prediction model to obtain a short-term predicted task volume, specifically as follows: Input real-time influencing factor data of the port into the trained LSTM model to obtain a second feature tensor ; the second feature tensor input into a trained channel attention module to obtain a short-term prediction task quantity; the channel attention module is an FECAM module, an SE module, or a CBAM module.

9. The port task length short-time fusion prediction method according to claim 1, characterized in that, The fused predicted task volume of the port is determined according to the long-term predicted task volume and the short-term predicted task volume, specifically as follows: a short-term prediction reference value is determined according to the long-term predicted task volume and the length of the preset time period; the fused predicted task volume of the port is determined according to the short-term predicted task volume and the short-term prediction reference value.

10. A terminal device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, The processor implements the steps of the port task volume long-short time fused prediction method according to any one of claims 1 to 9 when executing the computer program.