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 PDFInfo
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 40
- 230000007246 mechanism Effects 0.000 title claims abstract description 19
- 239000010410 layer Substances 0.000 claims abstract description 28
- 239000002356 single layer Substances 0.000 claims abstract description 5
- 238000013528 artificial neural network Methods 0.000 claims abstract description 4
- 239000013598 vector Substances 0.000 claims description 95
- 238000012549 training Methods 0.000 claims description 18
- 230000006870 function Effects 0.000 claims description 13
- 238000004458 analytical method Methods 0.000 claims description 12
- 238000012360 testing method Methods 0.000 claims description 11
- 239000011159 matrix material Substances 0.000 claims description 10
- 238000004364 calculation method Methods 0.000 claims description 8
- 238000013136 deep learning model Methods 0.000 claims description 8
- 230000009467 reduction Effects 0.000 claims description 8
- 229940036051 sojourn Drugs 0.000 claims description 7
- 238000012545 processing Methods 0.000 claims description 6
- 238000012795 verification Methods 0.000 claims description 6
- 238000007781 pre-processing Methods 0.000 claims description 5
- 238000010276 construction Methods 0.000 claims description 4
- 238000000605 extraction Methods 0.000 claims description 4
- 230000008569 process Effects 0.000 claims description 4
- ORILYTVJVMAKLC-UHFFFAOYSA-N Adamantane Natural products C1C(C2)CC3CC1CC2C3 ORILYTVJVMAKLC-UHFFFAOYSA-N 0.000 claims description 3
- 230000008859 change Effects 0.000 claims description 3
- 239000013604 expression vector Substances 0.000 claims description 3
- 238000005065 mining Methods 0.000 claims description 3
- 230000009466 transformation Effects 0.000 claims description 3
- 230000002159 abnormal effect Effects 0.000 claims description 2
- 230000003213 activating effect Effects 0.000 claims description 2
- 238000013507 mapping Methods 0.000 claims description 2
- 238000010606 normalization Methods 0.000 claims description 2
- 238000010200 validation analysis Methods 0.000 claims description 2
- 238000005259 measurement Methods 0.000 claims 1
- 238000013135 deep learning Methods 0.000 abstract description 7
- 238000005516 engineering process Methods 0.000 abstract description 6
- 238000013461 design Methods 0.000 abstract description 4
- 238000011160 research Methods 0.000 abstract description 2
- 238000010586 diagram Methods 0.000 description 5
- 230000000694 effects Effects 0.000 description 4
- 239000000284 extract Substances 0.000 description 3
- 229910000831 Steel Inorganic materials 0.000 description 2
- 239000010959 steel Substances 0.000 description 2
- 101001095088 Homo sapiens Melanoma antigen preferentially expressed in tumors Proteins 0.000 description 1
- 102100037020 Melanoma antigen preferentially expressed in tumors Human genes 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000007418 data mining Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000011156 evaluation Methods 0.000 description 1
- 238000002474 experimental method Methods 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
- 238000007637 random forest analysis Methods 0.000 description 1
- 230000002123 temporal effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION 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/00—Administration; Management
- G06Q10/04—Forecasting or optimisation specially adapted for administrative or management purposes, e.g. linear programming or "cutting stock problem"
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/21—Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
- G06F18/214—Generating training patterns; Bootstrap methods, e.g. bagging or boosting
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/044—Recurrent networks, e.g. Hopfield networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION 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/00—Administration; Management
- G06Q10/08—Logistics, e.g. warehousing, loading or distribution; Inventory or stock management
- G06Q10/087—Inventory 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
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 WhereinRespectively 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 vehicleThe preceding queued vehicle set, the working vehicle set and the working completed vehicle set of (1) are respectively represented as 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 vehicleThe final output vector corresponding to time t is represented asIt is composed of the current vehicle task progress information vector input at time tOutput weighted information vector with attention moduleThe residual error is calculated by the following formula:
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 vehicleSubspace vector h of preceding vehiclec,t,iWeighting to obtain the output vector under the subspaceConnecting the output vectors of all the subspaces to obtain the attention module weighting information vector of the current vehicleThe Masked Multi-HeadAttention module is constructed as follows:
byIndicating that vehicle c corresponds to the target vehicleThe 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 isThenIf the vehicle c belongs to PC, the sum of the weights is equal to 1, and the formula is as follows:
the weight matrix composed is represented as Ai,tIt follows self-attention mechanism, and the formula is as follows:
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) ofThe resulting scale factor.
In step S6, the regression calculation is performed using the formulaOutput vector to Attention modulePerforming linear transformation, activating via ReLU to obtain nonlinear output resultThe 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,and predicting the lingering time of the final target vehicle.
For step S6, the mean square error loss function calculation formula is as follows:
where m is the total number of samples tested,for the true linger length of the ith test sample,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 vehicleAnd a preceding vehicle ciComputing a task progress vector to obtain attention weightsCalculating according to the importance weight matrix to obtain the weighted vector representation of the preorder vehicle informationAnd connecting preorder vehicle weighting information through residual connecting layerInformation related to current vehicle task progressObtaining a final vector representation of the target vehicleThe specific construction process is as follows:
target vehicleThe corresponding final output vector is represented asWhich is composed of input target vehicle task progress information vectorOutput vector of attention moduleThe residual error is calculated by the following formula:
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:
byIndicating that vehicle c corresponds to the target vehicleIf the vehicle is of importance for the prediction of the length of stay in the warehouseThenIf the vehicle c belongs to PC, the sum of the weights is equal to 1, and the formula is as follows:
the weight matrix composed is represented as Ai,tIt follows self-attention mechanism, and the formula is as follows:
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) ofThe 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:
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,for the final predicted lingering time value of the target vehicle, the mean square error loss function calculation formula is as follows:
where m is the total number of samples tested,for the true stay of the ith test sampleThe length of the utility model is long,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
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 ∈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 WhereinRespectively 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 vehicleThe preceding in-line vehicle set, the working vehicle set, and the completed working vehicle set of (1) are respectively denoted asA 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 vehicleThe corresponding output vector at time t is represented asIts current vehicle task progress information vector from input at time tInformation weighting vector output by attention moduleThe residual error is calculated by the following formula:
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 vehicleSubspace vector h of preceding vehiclec,t,iWeighting to obtain the output vector under the subspaceConnecting the output vectors of all subspaces to obtain the currentAttention module weighted information vector for a vehicleThe Masked Multi-HeadAttention module is constructed as follows:
byIndicating that vehicle c corresponds to the target vehicleIs 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 inThenIf the vehicle c belongs to PC, the sum of the weights is equal to 1, and the formula is as follows:
the weight matrix composed is represented as Ai,tIt follows self-attention mechanism, and the formula is as follows:
8. The method of claim 1, wherein in step 6, the regression calculation is based on the formulaOutput vector to Attention modulePerforming linear transformation, activating via ReLU to obtain nonlinear output resultThe 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,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:
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.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111300016.0A CN114037139B (en) | 2021-11-04 | 2021-11-04 | Method for predicting stay time of freight vehicle warehouse based on attention mechanism |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111300016.0A CN114037139B (en) | 2021-11-04 | 2021-11-04 | Method for predicting stay time of freight vehicle warehouse based on attention mechanism |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114037139A true CN114037139A (en) | 2022-02-11 |
CN114037139B CN114037139B (en) | 2024-09-17 |
Family
ID=80142803
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111300016.0A Active CN114037139B (en) | 2021-11-04 | 2021-11-04 | Method for predicting stay time of freight vehicle warehouse based on attention mechanism |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114037139B (en) |
Cited By (2)
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 |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103718546A (en) * | 2011-07-29 | 2014-04-09 | 松下电器产业株式会社 | System and method for improving site operations by detecting abnormalities |
CN107609491A (en) * | 2017-08-23 | 2018-01-19 | 中国科学院声学研究所 | A kind of vehicle peccancy parking detection method based on convolutional neural networks |
US20200041612A1 (en) * | 2018-08-02 | 2020-02-06 | Metawave Corporation | Recurrent super-resolution radar for autonomous vehicles |
CN111126153A (en) * | 2019-11-25 | 2020-05-08 | 北京锐安科技有限公司 | Safety monitoring method, system, server and storage medium based on deep learning |
CN111931905A (en) * | 2020-07-13 | 2020-11-13 | 江苏大学 | Graph convolution neural network model and vehicle track prediction method using same |
-
2021
- 2021-11-04 CN CN202111300016.0A patent/CN114037139B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103718546A (en) * | 2011-07-29 | 2014-04-09 | 松下电器产业株式会社 | System and method for improving site operations by detecting abnormalities |
CN107609491A (en) * | 2017-08-23 | 2018-01-19 | 中国科学院声学研究所 | A kind of vehicle peccancy parking detection method based on convolutional neural networks |
US20200041612A1 (en) * | 2018-08-02 | 2020-02-06 | Metawave Corporation | Recurrent super-resolution radar for autonomous vehicles |
CN111126153A (en) * | 2019-11-25 | 2020-05-08 | 北京锐安科技有限公司 | Safety monitoring method, system, server and storage medium based on deep learning |
CN111931905A (en) * | 2020-07-13 | 2020-11-13 | 江苏大学 | Graph convolution neural network model and vehicle track prediction method using same |
Non-Patent Citations (2)
Title |
---|
XINGYI LV 等: "AMBD: Attention Based Multi-Block Deep Learning Model for Warehouse Dwell Time Prediction", 《WEB INFORMATION SYSTEMS ENGINEERING》, 1 January 2022 (2022-01-01), pages 1 - 17 * |
吕星仪: "基于深度学习的钢厂货车滞留时长预测", 《中国优秀硕士学位论文全文数据库 工程科技Ⅰ辑》, 15 October 2023 (2023-10-15), pages 023 - 58 * |
Cited By (4)
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 |
Also Published As
Publication number | Publication date |
---|---|
CN114037139B (en) | 2024-09-17 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10607331B1 (en) | Image segmentation into overlapping tiles | |
CN111369016B (en) | Image recognition-based on-site operation and maintenance method and system | |
CN114037139B (en) | Method for predicting stay time of freight vehicle warehouse based on attention mechanism | |
CN113822499B (en) | Train spare part loss prediction method based on model fusion | |
CN112508265A (en) | Time and activity multi-task prediction method and system for business process management | |
CN115587666A (en) | Load prediction method and system based on seasonal trend decomposition and hybrid neural network | |
CN110956303A (en) | Information prediction method, device, terminal and readable storage medium | |
CN114187120A (en) | Vehicle insurance claim settlement fraud risk identification method and device | |
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 | |
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 | |
CN115660859A (en) | Full-link automatic testing method and system based on Internet finance | |
CN116595066A (en) | Data mining method, device, terminal equipment and medium | |
CN113869596A (en) | Task prediction processing method, device, product and medium | |
JPH06337852A (en) | Time series prediction method by neural network | |
CN112232576B (en) | Decision prediction method, device, electronic equipment and readable storage medium | |
CN116957161A (en) | Work order early warning method, equipment and computer readable storage medium | |
CN117078007A (en) | Multi-scale wind control system integrating scale labels and method thereof | |
CN117114705A (en) | Continuous learning-based e-commerce fraud identification method and system | |
CN114861739B (en) | Characteristic channel selectable multi-component system degradation prediction method and system | |
CN116432835A (en) | Customer loss early warning and attributing method, device, computer equipment and storage medium | |
CN115687330A (en) | Automobile fault code analysis method, storage medium and electronic equipment | |
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 |
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 | ||
GR01 | Patent grant |