CN114037139A - Freight vehicle warehouse stay time length prediction method based on attention mechanism - Google Patents

Freight vehicle warehouse stay time length prediction method based on attention mechanism Download PDF

Info

Publication number
CN114037139A
CN114037139A CN202111300016.0A CN202111300016A CN114037139A CN 114037139 A CN114037139 A CN 114037139A CN 202111300016 A CN202111300016 A CN 202111300016A CN 114037139 A CN114037139 A CN 114037139A
Authority
CN
China
Prior art keywords
vehicle
warehouse
vector
time
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111300016.0A
Other languages
Chinese (zh)
Inventor
毛嘉莉
吕星仪
赵威
郭烨
周傲英
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jingchuang Zhihui Shanghai Logistics Technology Co ltd
East China Normal University
Original Assignee
Jingchuang Zhihui Shanghai Logistics Technology Co ltd
East China Normal University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jingchuang Zhihui Shanghai Logistics Technology Co ltd, East China Normal University filed Critical Jingchuang Zhihui Shanghai Logistics Technology Co ltd
Priority to CN202111300016.0A priority Critical patent/CN114037139A/en
Publication of CN114037139A publication Critical patent/CN114037139A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/04Forecasting or optimisation specially adapted for administrative or management purposes, e.g. linear programming or "cutting stock problem"
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/044Recurrent networks, e.g. Hopfield networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/08Logistics, e.g. warehousing, loading or distribution; Inventory or stock management
    • G06Q10/087Inventory or stock management, e.g. order filling, procurement or balancing against orders

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Economics (AREA)
  • Data Mining & Analysis (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Human Resources & Organizations (AREA)
  • General Engineering & Computer Science (AREA)
  • Evolutionary Computation (AREA)
  • Strategic Management (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Tourism & Hospitality (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Molecular Biology (AREA)
  • General Business, Economics & Management (AREA)
  • Computing Systems (AREA)
  • Marketing (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Quality & Reliability (AREA)
  • Operations Research (AREA)
  • Development Economics (AREA)
  • Computational Linguistics (AREA)
  • Biophysics (AREA)
  • Biomedical Technology (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Finance (AREA)
  • Accounting & Taxation (AREA)
  • Evolutionary Biology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Game Theory and Decision Science (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses a freight vehicle warehouse stay duration prediction method based on an attention mechanism, which designs deep learning modules respectively corresponding to a large number of freight vehicles according to different queuing states of the large number of freight vehicles during loading in a factory by using a deep learning technology. According to the operation capability of a finished vehicle information sensing warehouse of the loading and transporting operation, extracting information related to task completion progress in a queue based on vehicles and queued vehicles in operation, extracting important information related to the prediction of the stay time of a preorder vehicle in the queue and a current vehicle warehouse by using an Attention mechanism, performing residual error connection on preorder vehicle information weighting results and current vehicle information, and finally obtaining a final time prediction value by using a single-layer neural network as a regression layer. The method is more suitable for the condition that the operation capability of the warehouse is uncertain in the stay duration prediction research of vehicle queuing in the logistics warehouse, the structural design of the integral model is more suitable for scenes with various queuing states, and the prediction accuracy of the stay duration of the truck in the warehouse can be effectively improved.

Description

Freight vehicle warehouse stay time length prediction method based on attention mechanism
Technical Field
The invention belongs to the technical field of data mining, and relates to a freight vehicle warehouse stay duration prediction method based on an attention mechanism.
Background
Under the promotion of the continuous development of informatization, the steel logistics industry is carrying out rapid transformation. The freight transport driver can receive and submit the transport tasks through the online platform, and the psychological expectation of the driver on the long stay time of the transport vehicle in the warehouse becomes an important factor for improving the experience feeling of the driver. Meanwhile, managers need to know the length of stay of the warehouse of the vehicle entering the factory to assist the optimization of decisions such as vehicle scheduling in the factory. The traditional time series data prediction method focuses on the change trend of data, and ignores the research on the multi-state queuing structure in the steel logistics scene. In order to improve the accuracy of vehicle stay time prediction in a bulk freight scene, a time prediction method suitable for warehouse logistics is urgently needed to deal with various potential characteristics in a warehouse queuing scene.
The existing methods for predicting the vehicle stay time can be divided into three types, one type is that the stay time is extracted by carrying out mathematical analysis based on a queuing theory, and the method requires that the service time of a client and a service desk follows a specific distribution probability and is not suitable for actual logistics scenes that trucks arrive irregularly and the warehouse operation capacity is unknown. The second method is based on a deep learning method to extract features for predicting stay duration, but due to the special structure of a bulk freight queuing scene and the complex relationship among vehicles in a queuing vehicle set, the prediction effect of the method in the scene is poor. In the third method, a model based on an attention mechanism is adopted to capture the correlation among individuals, different weights are set according to the correlations of different degrees, and therefore the stay duration of the vehicle is predicted.
In summary, a warehouse stay duration prediction technology suitable for a bulk freight warehouse logistics queuing scene does not appear yet.
Disclosure of Invention
In order to solve the defects in the prior art, the invention aims to provide a method for predicting the stay duration of a freight vehicle warehouse based on an attention mechanism. In the first stage of the method, the historical data set is analyzed off line, and important factors related to the stay time of the vehicle warehouse are extracted. The second stage of the method is warehouse stay time prediction, the deep learning technology is adopted to express the warehouse operation capacity based on the operation completion vehicle information, then the sequence prediction technology is combined to mine the vehicle task progress condition, the attention mechanism is combined to capture the information that the preorder vehicles in the queue have great influence on the current vehicle warehouse stay time prediction, a single-layer neural network is used as a regression layer to construct a regression model, and the stay time prediction of the vehicle warehouse is realized.
The specific technical scheme for realizing the purpose of the invention is as follows:
s1: historical data processing and analysis, wherein the historical data is preprocessed and analyzed to obtain a plurality of important factors influencing the stay time of the freight vehicle in the warehouse, and a data set is divided into a training set, a verification set and a test set;
s2: the method comprises the following steps of pre-order vehicle set division, namely dividing pre-order vehicles related to a current prediction target in a queuing queue into three sets according to the queuing state of the vehicles, wherein the three sets are a queuing vehicle set, a working vehicle set and a working completion vehicle set;
s3: extracting warehouse operation capacity characteristics, namely extracting the characteristics of each vehicle and performing vector representation on the warehouse operation capacity characteristics by combining a sequence prediction model based on the operation completion vehicle set obtained in the step S2;
s4: extracting vehicle characteristic vectors, namely combining a sequence prediction deep learning model to obtain vector representation of task progress information of the queuing and working vehicles based on the working vehicle set and the queuing vehicle set obtained in the step S2 and the warehouse working capacity representation vector obtained in the step S3;
s5: extracting the importance of the preorder vehicle, namely acquiring the importance of preorder vehicle task progress situation to current vehicle stay duration prediction by combining an attention mechanism based on the vector representation of the queue and the task progress information of the operating vehicle obtained in the step S4, calculating according to an importance weight matrix to obtain preorder vehicle weighting information, and connecting the weighting information and the current vehicle task progress information by using a residual error connecting layer to obtain the final vector representation of the target vehicle;
s6: training and storing the model, inputting the final vector representation obtained in the step S5 into a single-layer fully-connected neural network for regression calculation, outputting the predicted stay duration of the vehicle warehouse, measuring the difference between the predicted duration and the real duration by using a mean square error loss function on a training set, updating parameters in the multi-module deep learning model through back propagation of an Adam optimizer, calculating a loss function value on a verification set after updating the parameters each time, and storing the model when the loss function does not continuously descend, namely the loss function value reaches the minimum;
s7: and (4) predicting the stay time of the warehouse, and inputting the information of the target vehicle and the related preorder vehicles into the trained model to obtain a predicted value of the stay time.
With respect to step S1, the historical data is from real data sets of the enterprise, and data sets in different queuing states in a plurality of warehouses are analyzed, wherein the data sets comprise vehicle data in queuing, vehicle data in work and vehicle data after work is completed. The preprocessing of the data comprises abnormal value processing, data deduplication, data normalization and text data coding, and preprocessing operation can improve the quality of data in a data set and enable the data to be more suitable for model training; the analysis operation on the data comprises characteristic importance analysis, data distribution condition analysis and data change trend analysis.
The influence of various factors on the stay time of the warehouse of the vehicle is found through analysis, wherein the factors comprise preorder vehicle task progress information, warehouse operation capacity, time information, cargo variety and weight information, and therefore the relevant factors are extracted from data by a model to serve as the characteristic of stay time prediction. The data set is partitioned, with seventy percent being the training set, ten percent being the validation set, and twenty percent being the test set.
For step S2, the definition given is as follows:
the vehicle set is divided according to the sequence relation between the key time points of all the states of the vehicles in the queuing data and the key time points of the target vehicle; the set of all vehicles is denoted C, each vehicle is denoted C ∈ C, where the target vehicle is denoted C —; the set of all warehouses is represented as S, and each warehouse is represented as S belonging to S; the queued vehicle set, the working vehicle set and the working completion vehicle set which are in the queue of the warehouse s at the current time t are respectively represented as
Figure BDA0003338021970000031
Figure BDA0003338021970000032
Wherein
Figure BDA0003338021970000033
Respectively indicates the time at which the specific vehicle c starts queuing, starts working and completes working in the queue of the warehouse s, tpIndicating the moment when the prediction request occurs, and alpha indicating the threshold value of the time length for which the vehicle has completed the operation; target vehicle
Figure BDA0003338021970000034
The preceding queued vehicle set, the working vehicle set and the working completed vehicle set of (1) are respectively represented as
Figure BDA0003338021970000035
Figure BDA0003338021970000036
Extracting the front associated with the target vehicle according to the definition given aboveThree vehicle sets are sequenced.
Aiming at the step S3, the latest n finished work vehicles related to the target vehicle are selected, related vehicle task completion information including the total task completion duration and the task detailed information is extracted as input features, the features are connected after being subjected to Embedding dimension reduction respectively, and the one-dimensional feature vector v of each vehicle is obtained after passing through a full connection layerleaveFeature vectors v of the vehicle in sequence orderleaveIn the input sequence prediction model LSTM, the output of the last node is converted into a vector a representing the working capacity of the warehouse through the full link layer.
For step S4, the set of vehicles from which the feature vectors are extracted includes a set of queued vehicles and a set of working vehicles;
a working vehicle: combining the warehouse operation capacity vector a obtained in the step S3, using the current time characteristic, the goods information characteristic and the operated time characteristic as input characteristics, connecting the warehouse operation capacity vector a, the time characteristic, the goods information characteristic, the operated time characteristic and other characteristics after Embedding dimension reduction, and obtaining a one-dimensional characteristic vector v of each vehicle after passing through a full connecting layerworkThe feature vector v of the vehicles in the queue is arranged according to the sequence of the vehicles in the queueworkInputting the sequence prediction model LSTM to obtain a task progress condition vector r of each vehicle nodeworkAnd the hidden state vector s of the last node;
queuing a vehicle set: taking the operating duration, the current time and the cargo information characteristics as input characteristics, connecting the operating duration, the current time and the cargo information characteristics after Embedding dimensionality reduction, and obtaining a one-dimensional characteristic vector v of each vehicle after passing through a full connecting layerwaitCombining hidden state vectors s obtained in the working vehicle set to construct a sequence prediction model LSTM, and obtaining the task progress of each vehicle node as an output vector rwait
In step S5, a task progress indication vector r preceding each of the nodes of the working vehicleworkRepresentation vector r of task progress with a queuing vehicle nodewaitAs Masked Multi-HeadAttenthe input of the motion module acquires the importance weight of the preorder vehicle on the prediction of the stay time of the current vehicle, factors influencing the importance degree include the cargo type and weight of a preorder vehicle task, the working time of the preorder vehicle, the predicted residual stay time and the like, and the preorder vehicle weighting information and the current vehicle information are connected through a residual connecting layer to obtain the final output vector of the current vehicle, wherein the specific construction process is as follows:
target vehicle
Figure BDA0003338021970000041
The final output vector corresponding to time t is represented as
Figure BDA0003338021970000042
It is composed of the current vehicle task progress information vector input at time t
Figure BDA0003338021970000043
Output weighted information vector with attention module
Figure BDA0003338021970000044
The residual error is calculated by the following formula:
Figure BDA0003338021970000045
taking the task progress information vector of the vehicles in queue and working in the preamble, mapping the task progress information vector into n subspaces, and outputting the task progress information vector r by the vehicle c node at the time tc,tIs denoted as hc,t,iRespectively calculating importance weights a between different vehicle vectors in the same subspacec,,c,iWeights to be associated with the current vehicle
Figure BDA0003338021970000046
Subspace vector h of preceding vehiclec,t,iWeighting to obtain the output vector under the subspace
Figure BDA0003338021970000047
Connecting the output vectors of all the subspaces to obtain the attention module weighting information vector of the current vehicle
Figure BDA0003338021970000048
The Masked Multi-HeadAttention module is constructed as follows:
Figure BDA0003338021970000049
Figure BDA00033380219700000410
Figure BDA00033380219700000411
by
Figure BDA00033380219700000412
Indicating that vehicle c corresponds to the target vehicle
Figure BDA00033380219700000413
The predicted importance weight of the stay duration is calculated from a vehicle task progress vector, specifically, the predicted importance of the vehicle to the warehouse stay duration if the vehicle is
Figure BDA00033380219700000422
Then
Figure BDA00033380219700000414
If the vehicle c belongs to PC, the sum of the weights is equal to 1, and the formula is as follows:
Figure BDA00033380219700000415
Figure BDA00033380219700000416
the weight matrix composed is represented as Ai,tIt follows self-attention mechanism, and the formula is as follows:
Figure BDA00033380219700000417
wherein Q isi,tAnd Ki,tIs also a subspace hc,t,iThe weight matrixes of the two matrixes are obtained by training a finally constructed warehouse stay duration prediction model and are respectively expressed as Wi qAnd Wi k,dkIs composed of hc,t,iDimension (d) of
Figure BDA00033380219700000418
The resulting scale factor.
In step S6, the regression calculation is performed using the formula
Figure BDA00033380219700000419
Output vector to Attention module
Figure BDA00033380219700000420
Performing linear transformation, activating via ReLU to obtain nonlinear output result
Figure BDA00033380219700000421
The predicted value of the stay time of the current vehicle is obtained; wherein W is the weight of the full connection layer, b is an offset term, the specific value is obtained by the model training adjustment parameter,
Figure BDA0003338021970000051
and predicting the lingering time of the final target vehicle.
For step S6, the mean square error loss function calculation formula is as follows:
Figure BDA0003338021970000052
where m is the total number of samples tested,
Figure BDA0003338021970000053
for the true linger length of the ith test sample,
Figure BDA0003338021970000054
predicted values for the length of stay for the ith test sample.
In step S6, the multi-module deep learning model refers to a warehouse operation capability extraction module, and a task progress mining module for operating and queuing vehicles; the model structure comprises LSTM and Self-attention; the updated parameters comprise parameters in an Embedding layer, parameters of a full connection layer, internal parameters of each module LSTM and internal parameters of Self-association.
The beneficial effects of the invention include: in the stay duration prediction task in the warehouse queuing scene, compared with the existing prediction model, the sequence prediction model LSTM captures the sequence relation among the vehicles in the queue and the task progress condition of each vehicle, the Attention mechanism captures important information which has great influence on the warehouse stay duration prediction among the vehicles in the queue, the warehouse operation capability can be accurately sensed and represented by combining the deep learning technology, and the prediction precision of the warehouse stay duration is effectively improved. Meanwhile, the design of the model multi-module structure in the invention considers the general structures of the queuing system, namely the queuing queue, the ongoing operation queue and the completed operation queue, and the method can be suitable for the sojourn time length prediction of other queuing systems except the warehouse queuing system.
Drawings
Fig. 1 is a schematic structural diagram of the deep learning method constructed by the present invention, that is, a schematic diagram of a multi-module deep learning model.
FIG. 2 is a diagram of a warehouse job capability mining module according to the present invention.
FIG. 3 is a diagram of a temporal feature processing module according to the present invention.
FIG. 4 is a schematic diagram of the present invention for extracting importance between vehicles based on the Attention mechanism.
FIG. 5 is a flow chart of a time prediction method according to the present invention.
Detailed Description
The present invention will be described in further detail with reference to the following specific examples and the accompanying drawings. The procedures, conditions, experimental methods and the like for carrying out the present invention are general knowledge and common general knowledge in the art except for the contents specifically mentioned below, and the present invention is not particularly limited.
The invention determines the loading and transporting operation state of the vehicle according to each stage time point of the vehicle in the off-line data, divides the vehicle into a vehicle set of three queuing states relative to a target vehicle, extracts the basic characteristics and time information of the vehicle, puts the characteristics of the vehicle after the operation into a warehouse operation capability extraction module, puts the characteristics and the warehouse operation capability characteristics of the vehicle in operation into an LSTM-based operation module, obtains the task progress corresponding to each operation vehicle node as an output vector, simultaneously obtains a hidden state vector corresponding to the last node, puts the characteristics and the hidden state vector of the vehicle in queuing into an LSTM-based queuing module, obtains the task progress corresponding to each queuing vehicle node as an output vector, takes the output vector corresponding to the operation and queuing vehicle nodes as the input of an Attention module, extracts important information which has great influence on the warehouse residence time prediction among the vehicles, and connecting the information weighting of the preorder vehicle and the task progress condition of the current vehicle by using the residual connecting layer, and finally outputting the predicted value of the warehouse stay time of the target vehicle by using the single-layer full connecting layer as a regression layer.
The present invention is further illustrated by the following specific examples.
The method comprises the following steps of carrying out the prediction model training of the stay duration of the vehicle warehouse based on the Attention mechanism, wherein the overall model framework refers to the figure 1:
s1: preprocessing and analyzing historical data to obtain a plurality of important factors influencing the stay duration of the warehouse, dividing a data set into a training set, a verification set and a test set, for example, extracting original basic features { start queuing time: '2021/1/78: 12: 34', cargo weight: 23.415, cargo type: 'cold-formed coil', warehouse code: 'P6 _21_ 6';
s2: dividing the front vehicles in the queue into three sets according to the queuing state of the vehicles, wherein the three sets are respectively a queuing vehicle set, a working vehicle set and a working completion vehicle set, and the vehicle set is divided according to the precedence relationship between the key time point of each queuing state of the vehicles in the queuing data and the key time point of a target vehicle;
s3: obtaining a work completion vehicle set based on S2, extracting the task completion condition characteristics of each vehicle and performing vector representation on the warehouse work capacity characteristics by combining a sequence prediction model; the warehouse operation capacity representation module is shown in fig. 2, wherein the used sequence prediction model is LSTM, the vehicle characteristics are input into the LSTM model after being subjected to Embedding dimension reduction according to the sequence of vehicle operation completion, and finally, the output vector represents the operation capacity of the current warehouse;
s4: obtaining a working vehicle set, a queuing vehicle set and a warehouse working capacity representation vector obtained in the step S3 based on the step S2, and obtaining a vector representation of the queuing and working vehicle task progress information by combining a sequence prediction framework; the processing of the time characteristics of the queuing vehicle set and the working vehicle set refers to fig. 3, the characteristics can be used for reflecting the influence of time points on the stay duration of the warehouse, week and minute are extracted from the time characteristics, and are respectively converted into One-Hot codes with 7 and 288 dimensions, and then, Embedding dimension reduction is carried out, and vector splicing is carried out to obtain the final time characteristics; the sequence prediction model used here is LSTM; connecting the warehouse operation capacity expression vector with the characteristics of the operating vehicles, and inputting the warehouse operation capacity expression vector into the LSTM according to the sequence of the vehicles in the queue to obtain an output vector corresponding to each vehicle and the last hidden state vector of the LSTM in the module; inputting the characteristics of the queued vehicles into an LSTM according to the sequence of the vehicles in the queue, and taking the hidden state vector of the operating module as the input of the first node of the queuing module to obtain the output vector corresponding to each vehicle;
s5: obtaining a vector representation of queuing and work vehicle task progress information based on step S4 as an input to an attention module, in conjunction with the attention mechanism, to obtain the importance of a preceding vehicle to a prediction of the length of a current vehicle stay, e.g.FIG. 4 shows a target vehicle
Figure BDA0003338021970000061
And a preceding vehicle ciComputing a task progress vector to obtain attention weights
Figure BDA0003338021970000062
Calculating according to the importance weight matrix to obtain the weighted vector representation of the preorder vehicle information
Figure BDA0003338021970000071
And connecting preorder vehicle weighting information through residual connecting layer
Figure BDA0003338021970000072
Information related to current vehicle task progress
Figure BDA0003338021970000073
Obtaining a final vector representation of the target vehicle
Figure BDA0003338021970000074
The specific construction process is as follows:
target vehicle
Figure BDA0003338021970000075
The corresponding final output vector is represented as
Figure BDA0003338021970000076
Which is composed of input target vehicle task progress information vector
Figure BDA0003338021970000077
Output vector of attention module
Figure BDA0003338021970000078
The residual error is calculated by the following formula:
Figure BDA0003338021970000079
the ith subspace of the vehicle c-node output vector at time t is denoted as hc,t,iThe construction process of the Masked Multi-HeadAttention module is as follows:
Figure BDA00033380219700000710
Figure BDA00033380219700000711
Figure BDA00033380219700000712
by
Figure BDA00033380219700000713
Indicating that vehicle c corresponds to the target vehicle
Figure BDA00033380219700000714
If the vehicle is of importance for the prediction of the length of stay in the warehouse
Figure BDA00033380219700000722
Then
Figure BDA00033380219700000715
If the vehicle c belongs to PC, the sum of the weights is equal to 1, and the formula is as follows:
Figure BDA00033380219700000716
Figure BDA00033380219700000717
the weight matrix composed is represented as Ai,tIt follows self-attention mechanism, and the formula is as follows:
Figure BDA00033380219700000718
wherein Q isi,tAnd Ki,tIs also a subspace hc,t,iThe weight matrix of the formed matrix is obtained by training a finally constructed warehouse stay duration prediction model and is respectively represented as Wi qAnd Wi k,dkIs composed of hc,t,iDimension (d) of
Figure BDA00033380219700000719
The resulting scale factor;
s6: and (5) training and storing the model. Inputting the obtained target vehicle output vector into a full-connection layer as a regression layer, measuring the error between the predicted duration and the real stay duration by using a mean square error loss function, updating parameters in the multi-module deep learning model through back propagation of an Adam optimizer, calculating a loss function value on a verification set after updating the parameters each time, and storing the model with the minimum loss function value, wherein a calculation formula in the regression layer is as follows:
Figure BDA00033380219700000720
wherein W is the weight of the full connection layer, b is an offset term, the specific value is obtained by the model training adjustment parameter,
Figure BDA00033380219700000721
for the final predicted lingering time value of the target vehicle, the mean square error loss function calculation formula is as follows:
Figure BDA0003338021970000081
where m is the total number of samples tested,
Figure BDA0003338021970000082
for the true stay of the ith test sampleThe length of the utility model is long,
Figure BDA0003338021970000083
predicted values for the length of stay for the ith test sample.
S7: the target vehicle and associated preceding vehicle information in the example are entered into the stored model to obtain a predicted warehouse stay length 19.4121, which is 21.3833 true.
Selecting warehouse vehicle data in the same time period, and predicting the warehouse stay duration of each vehicle according to the stay duration prediction flow chart shown in fig. 5; firstly, extracting a preorder of a target vehicle to finish operation, operate and queue a vehicle set, extracting vehicle characteristics in each vehicle set, inputting the characteristics into a stay duration prediction model of the invention to obtain a stay duration prediction value of the target vehicle, and comparing the prediction result with the prediction effect of other existing methods; the selected existing prediction methods comprise LASSO, random forest regression, DNN, Wide & Deep, Deep FM and transform; the selected evaluation indexes are MAE, RMSE and MAPE; the predicted effect versus results are shown in table 1 below.
TABLE 1 comparison table of prediction effects of different prediction methods
Figure BDA0003338021970000084
In summary, the invention designs a plurality of sequence prediction modules according to the queuing state of the vehicle, obtains the task progress information vector and the warehouse operation capacity vector of each vehicle according to the information extracted by different modules, and extracts the key information through Self-attention to obtain the final predicted value of the stay time of the warehouse. In the stay duration prediction task in the queuing scene of the warehouse, compared with the existing prediction model, the sequence prediction model LSTM captures the sequence relation of the vehicles in the queue and the task progress condition information thereof, the Attention mechanism captures the influence degree of the preamble vehicle information in the queue on the stay duration of the warehouse, the deep learning technology is combined to accurately sense and express the operation capability of the warehouse, the prediction precision of the stay duration of the vehicle warehouse is effectively improved, compared with the existing prediction model, the method is more suitable for the condition that the operation capability of the warehouse is unknown, and the overall model structure is more suitable for the scenes with various queuing states.
The protection of the present invention is not limited to the above embodiments. Variations and advantages that may occur to those skilled in the art may be incorporated into the invention without departing from the spirit and scope of the inventive concept, which is set forth in the following claims.

Claims (10)

1. A method for predicting the stay time of a freight vehicle warehouse based on an attention mechanism is characterized by comprising the following specific steps:
step 1: historical data processing and analysis: preprocessing and analyzing historical data, extracting factors influencing the stay time of the freight vehicle in the warehouse, and dividing a data set into a training set, a verification set and a test set;
step 2: dividing a queuing preorder vehicle set: dividing the preceding vehicles related to the current prediction target in the queue into three sets according to the queuing state of the vehicles: a set of queued vehicles, a set of vehicles in operation, and a set of vehicles at work completion;
and step 3: extracting warehouse operation capacity characteristics: based on the vehicle set which is obtained in the step 2 and is subjected to operation, extracting the characteristics of each vehicle and performing vector representation on the operation capacity characteristics of the warehouse by combining a sequence prediction model;
and 4, step 4: extracting a vehicle feature vector: based on the vehicle set and the queuing vehicle set which are in operation and the warehouse operation capability expression vector obtained in the step 3, combining a sequence prediction deep learning model to obtain vector expression of task progress information of the queuing vehicle and the vehicle which is in operation;
and 5: preamble vehicle importance extraction: based on the queue obtained in the step 4 and the vector representation of the task progress information of the vehicle in operation, the importance degree of the preorder vehicle task progress information on the prediction of the current vehicle stay time is obtained by combining an attention mechanism, preorder vehicle weighting information is obtained by calculation according to an importance weight matrix, and the final vector representation of the target vehicle is obtained by connecting the weighting information with the current vehicle task progress information by using a residual error connecting layer;
step 6: training and saving the model: inputting the final vector representation obtained in the step 5 into a single-layer fully-connected neural network for regression calculation, outputting the predicted vehicle warehouse stay time, measuring the difference between the predicted time and the real time on a training set by using a mean square error loss function, updating parameters in the multi-module deep learning model through back propagation of an Adam optimizer, calculating a loss function value on a verification set after each parameter updating, and storing the model with the minimum loss function value;
and 7: vehicle warehouse stay duration prediction: and inputting the target vehicle and the related pre-order vehicle information into the trained model to obtain the predicted value of the stay duration.
2. The sojourn time prediction method according to claim 1, wherein in step 1, the historical data is from a real data set of a business, and the data sets of a plurality of warehouses in different queuing states are analyzed, wherein the data sets comprise queuing vehicle data, operating vehicle data and operating vehicle data; the preprocessing of the data comprises abnormal value processing, data de-duplication, data normalization and text data coding; the analysis operation on the data comprises characteristic importance analysis, data distribution condition analysis and data change trend analysis.
3. The sojourn time duration prediction method according to claim 1, wherein in step 1, the influence factors include preorder vehicle task progress information, warehouse operation capability, time information, cargo variety and weight information; the data set is partitioned, with seventy percent being the training set, ten percent being the validation set, and twenty percent being the test set.
4. The stay duration prediction method according to claim 1, wherein in step 2, the basis for vehicle set division is the precedence relationship between the key time points of each stage of the vehicle in the queuing data and the key time points of the target vehicle; set of all vehiclesAnd the sum is represented as C, each vehicle is represented as C ∈ C, wherein the target vehicle is represented as C ∈
Figure FDA0003338021960000021
The set of all warehouses is represented as S, and each warehouse is represented as S belonging to S; the queued vehicle set, the working vehicle set and the working completion vehicle set in the queue of the warehouse s at the current time t are respectively represented as
Figure FDA0003338021960000022
Figure FDA0003338021960000023
Wherein
Figure FDA0003338021960000024
Respectively indicates the time at which the vehicle c starts to queue, starts to work, and ends in the queue of the warehouse s, tpIndicating the occurrence time of the prediction request, and alpha indicating the threshold value of the time length of the finished vehicle; target vehicle
Figure FDA0003338021960000026
The preceding in-line vehicle set, the working vehicle set, and the completed working vehicle set of (1) are respectively denoted as
Figure FDA0003338021960000025
A preamble of three vehicle sets related to the target vehicle is extracted according to a given definition.
5. The stay duration prediction method according to claim 1, wherein in step 3, the nearest n completed work vehicles related to the target vehicle are selected, task completion information including cargo information and total work duration of the related vehicles is extracted as input features, the features are connected after being subjected to Embedding dimension reduction respectively, and one-dimensional feature vectors v of the vehicles are obtained after passing through a full connection layerleaveThe vehicle feature vectors v are arranged in the order of the vehicles in the sequenceleaveInput sequence predictionIn the measurement model LSTM, the output of the last node is converted into a vector a for representing the operation capacity of the warehouse through a full connection layer.
6. The sojourn duration prediction method of claim 1, wherein in step 4, the set of vehicles from which the feature vector is extracted comprises a set of queued vehicles and a set of working vehicles;
combining the warehouse operation capacity vector a obtained in the step 3 with the current time characteristic, the goods information characteristic and the operated time characteristic to be used as input characteristics, connecting the warehouse operation capacity vector a, the time characteristic, the goods information characteristic and the operated time characteristic after Embedding dimension reduction, and obtaining a one-dimensional characteristic vector v of each vehicle after passing through a full connecting layerworkThe characteristic vector v of each vehicle is determined according to the sequence of the vehicles in the queueworkObtaining an output vector r of each vehicle node for representing the progress of the vehicle task in an input sequence prediction model LSTMworkAnd the hidden state vector s of the last node;
the queuing vehicle set takes the operation duration, the current time and the cargo information characteristics as input characteristics, the operation duration, the current time and the cargo information characteristics are connected after being subjected to Embedding dimension reduction respectively, and a one-dimensional characteristic vector v of each vehicle is obtained after passing through a full connection layerwaitCombining hidden state vectors s obtained in the working vehicle set to construct a sequence prediction model LSTM, and obtaining output vectors r of each vehicle node for representing vehicle task progresswait
7. The sojourn time prediction method of claim 1, wherein in step 5, the output vector r of each working vehicle node is preceded byworkOutput vector r from the queuing vehicle nodewaitAs the input of mask Multi-Head Attention module, calculating the importance degree of the preceding vehicle task progress information to the prediction of the current vehicle stay time, wherein the factors influencing the importance degree include the cargo type and weight of the preceding vehicle task, and the worked condition of the preceding vehicleThe duration and the predicted remaining stay duration are connected through a residual connecting layer, the preorder vehicle weighting information and the current vehicle information are connected, and the final vector representation of the target vehicle information is obtained, and the specific construction process is as follows:
target vehicle
Figure FDA0003338021960000031
The corresponding output vector at time t is represented as
Figure FDA0003338021960000032
Its current vehicle task progress information vector from input at time t
Figure FDA0003338021960000033
Information weighting vector output by attention module
Figure FDA0003338021960000034
The residual error is calculated by the following formula:
Figure FDA0003338021960000035
taking the task progress information vector of the vehicles in queue and working in the preamble, mapping the task progress information vector into n subspaces, and outputting the task progress information vector r by the vehicle c node at the time tc,tIs denoted as hc,t,iRespectively calculating importance weights a between different vehicle vectors in the same subspacec,,c,iWeights to be associated with the current vehicle
Figure FDA0003338021960000036
Subspace vector h of preceding vehiclec,t,iWeighting to obtain the output vector under the subspace
Figure FDA0003338021960000037
Connecting the output vectors of all subspaces to obtain the currentAttention module weighted information vector for a vehicle
Figure FDA0003338021960000038
The Masked Multi-HeadAttention module is constructed as follows:
Figure FDA00033380219600000321
Figure FDA0003338021960000039
Figure FDA00033380219600000310
by
Figure FDA00033380219600000311
Indicating that vehicle c corresponds to the target vehicle
Figure FDA00033380219600000312
Is calculated from the degree of importance of the vehicle to the prediction of the length of time the warehouse is in, if the vehicle is in
Figure FDA00033380219600000313
Then
Figure FDA00033380219600000314
If the vehicle c belongs to PC, the sum of the weights is equal to 1, and the formula is as follows:
Figure FDA00033380219600000315
Figure FDA00033380219600000316
the weight matrix composed is represented as Ai,tIt follows self-attention mechanism, and the formula is as follows:
Figure FDA00033380219600000317
wherein Q isi,tAnd Ki,tIs also a subspace hc,t,iComposed matrix, Qi,tAnd Ki,tThe weight matrix is obtained by training a finally constructed warehouse stay duration prediction model and is respectively expressed as
Figure FDA00033380219600000318
And
Figure FDA00033380219600000319
dkis composed of hc,t,iDimension (d) of
Figure FDA00033380219600000320
The resulting scale factor.
8. The method of claim 1, wherein in step 6, the regression calculation is based on the formula
Figure FDA0003338021960000041
Output vector to Attention module
Figure FDA0003338021960000042
Performing linear transformation, activating via ReLU to obtain nonlinear output result
Figure FDA0003338021960000043
The predicted value of the stay time of the current vehicle is obtained; wherein W is the weight of the full connection layer, b is an offset term, the specific value is obtained by the model training adjustment parameter,
Figure FDA0003338021960000044
and predicting the lingering time of the final target vehicle.
9. The sojourn duration prediction method according to claim 1, wherein in step 6, the mean square error loss function is calculated as follows:
Figure FDA0003338021960000045
where m is the total number of samples tested,
Figure FDA0003338021960000046
for the true linger length of the ith test sample,
Figure FDA0003338021960000047
predicted values for the length of stay for the ith test sample.
10. The sojourn time duration prediction method according to claim 1, wherein in step 6, the multi-module deep learning model refers to a warehouse job capability extraction module, a task progress mining module of the vehicles in operation and in queue; the model structure comprises LSTM and Self-attention; the updated parameters comprise parameters in an Embedding layer, parameters of a full connection layer, internal parameters of each module LSTM and internal parameters of Self-orientation.
CN202111300016.0A 2021-11-04 2021-11-04 Freight vehicle warehouse stay time length prediction method based on attention mechanism Pending CN114037139A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111300016.0A CN114037139A (en) 2021-11-04 2021-11-04 Freight vehicle warehouse stay time length prediction method based on attention mechanism

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111300016.0A CN114037139A (en) 2021-11-04 2021-11-04 Freight vehicle warehouse stay time length prediction method based on attention mechanism

Publications (1)

Publication Number Publication Date
CN114037139A true CN114037139A (en) 2022-02-11

Family

ID=80142803

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111300016.0A Pending CN114037139A (en) 2021-11-04 2021-11-04 Freight vehicle warehouse stay time length prediction method based on attention mechanism

Country Status (1)

Country Link
CN (1) CN114037139A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116306254A (en) * 2023-02-18 2023-06-23 交通运输部规划研究院 Truck load estimation method and model training method and device thereof
CN117035623A (en) * 2023-10-09 2023-11-10 北京北汽鹏龙汽车服务贸易股份有限公司 Vehicle inventory control early warning method based on circulation quantity prediction and computer equipment

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116306254A (en) * 2023-02-18 2023-06-23 交通运输部规划研究院 Truck load estimation method and model training method and device thereof
CN116306254B (en) * 2023-02-18 2023-11-10 交通运输部规划研究院 Truck load estimation method and model training method and device thereof
CN117035623A (en) * 2023-10-09 2023-11-10 北京北汽鹏龙汽车服务贸易股份有限公司 Vehicle inventory control early warning method based on circulation quantity prediction and computer equipment
CN117035623B (en) * 2023-10-09 2023-12-22 北京北汽鹏龙汽车服务贸易股份有限公司 Vehicle inventory control early warning method based on circulation quantity prediction and computer equipment

Similar Documents

Publication Publication Date Title
US10607331B1 (en) Image segmentation into overlapping tiles
CN114037139A (en) Freight vehicle warehouse stay time length prediction method based on attention mechanism
CN111369016A (en) Image recognition-based on-site operation and maintenance method and system
KR102453582B1 (en) Method and system for ai demand forcasting
CN113240155A (en) Method and device for predicting carbon emission and terminal
CN110956303A (en) Information prediction method, device, terminal and readable storage medium
CN112508265A (en) Time and activity multi-task prediction method and system for business process management
CN113822499B (en) Train spare part loss prediction method based on model fusion
CN115587666A (en) Load prediction method and system based on seasonal trend decomposition and hybrid neural network
CN114757432A (en) Future execution activity and time prediction method and system based on flow log and multi-task learning
CN114490065A (en) Load prediction method, device and equipment
CN113837308A (en) Knowledge distillation-based model training method and device and electronic equipment
CN115660859A (en) Full-link automatic testing method and system based on Internet finance
CN116595066A (en) Data mining method, device, terminal equipment and medium
CN113962160A (en) Internet card user loss prediction method and system based on user portrait
CN114066510A (en) Method and device for predicting commodity sales, computer equipment and storage medium
JPH06337852A (en) Time series prediction method by neural network
CN114861739B (en) Characteristic channel selectable multi-component system degradation prediction method and system
CN115238789A (en) Financial industry special data prediction method and system based on improved GRU
CN111160419B (en) Deep learning-based electronic transformer data classification prediction method and device
CN113869596A (en) Task prediction processing method, device, product and medium
Kotenko et al. Supervised Machine Learning Models for Forecasting Fuel Consumption by Vehicles During the Grain Crops Delivery
CN116610783B (en) Service optimization method based on artificial intelligent decision and digital online page system
CN117694861A (en) Training method and device for heart rate prediction model, electronic equipment and storage medium
Cudney et al. Predicting vehicle cost using the T-method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination