CN112529305A - Express item acquisition sequence prediction method based on deep learning - Google Patents

Express item acquisition sequence prediction method based on deep learning Download PDF

Info

Publication number
CN112529305A
CN112529305A CN202011485308.1A CN202011485308A CN112529305A CN 112529305 A CN112529305 A CN 112529305A CN 202011485308 A CN202011485308 A CN 202011485308A CN 112529305 A CN112529305 A CN 112529305A
Authority
CN
China
Prior art keywords
package
courier
collected
packages
preference
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
CN202011485308.1A
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.)
Beijing Jiaotong University
Original Assignee
Beijing Jiaotong 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 Beijing Jiaotong University filed Critical Beijing Jiaotong University
Priority to CN202011485308.1A priority Critical patent/CN112529305A/en
Publication of CN112529305A publication Critical patent/CN112529305A/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
    • 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/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • 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/049Temporal neural networks, e.g. delay elements, oscillating neurons or pulsed inputs
    • 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/083Shipping

Abstract

The invention provides a courier pickup sequence prediction method based on deep learning, and belongs to the field of logistics optimization. The item pull sequence prediction method comprises the following steps: collecting historical package collecting data, extracting the characteristics of packages to be collected and the characteristics of couriers' individual packages as an original data set, and dividing the original data set into a training set, a verification set and a test set; constructing a courier pickup sequence prediction model based on a deep learning algorithm, training the courier pickup sequence prediction model by using the training set and the verification set, and testing the trained model by using the testing set; and when the test reaches the standard, inputting the current courier information through a courier package order prediction model, predicting the package order of the courier to be packaged, and outputting the predicted package order of the courier to be predicted in a preset time period. The invention optimizes logistics scheduling, improves the accuracy of predicting the arrival time of the collecting piece, improves collecting efficiency and reduces overdue rate.

Description

Express item acquisition sequence prediction method based on deep learning
Technical Field
The invention belongs to the field of logistics optimization, and particularly relates to a courier pickup order prediction method based on deep learning.
Background
In recent years, with the development of electronic commerce, the logistics industry is rapidly developing. The couriers are the basis of the logistics industry and the most professions engaged in personnel in the logistics industry. Couriers with increasing series need to efficiently complete distribution tasks, and a scheduling system needs to reasonably arrange the order of collecting couriers. Predicting the express item acquisition sequence of the couriers is the key of optimizing the scheduling system. Accurate piece picking sequence prediction can help a delivery system to distribute packages to couriers more reasonably and effectively, delivery efficiency is further improved, and overdue rate is reduced.
The method is used for predicting the express item acquisition sequence of the courier, is a sequencing problem with strict space-time constraints, and needs to consider a plurality of space-time constraints when modeling the decision-making behavior of the courier. Meanwhile, the order of picking up the express is also influenced by different decision preferences of the express. Thus, the prediction of the sequence of pull events is more difficult than the prediction of other events.
In the prior art, a piece collecting sequence prediction method based on combination optimization, a piece collecting sequence prediction method based on position prediction and a prediction method based on sequencing are generally adopted.
Based on a combined optimization method, the component acquisition sequence prediction is regarded as a combined optimization problem under space-time constraint, and a combined optimization algorithm is used for calculating a prediction sequence through a minimum assembly cost; however, in a real scene, the optimization algorithm is difficult to consider various space-time constraints and the influence of decision preference of a courier, and the prediction accuracy is not high.
Based on a position prediction method, item collection sequence prediction is used as a position prediction problem, the aim is to predict the position to which a courier will go at the next time step, the output next position comes from the whole position library, and only fixed multi-step prediction can be carried out; however, in the package sequence prediction problem, the predicted position should be selected from a set of given positions (i.e. package positions which are not packaged), and a multi-step prediction is performed, and the predicted length changes with the change of the input length, so that the position prediction-based method cannot be directly used for solving the package sequence prediction problem.
Based on a sorting method, item-capturing sequence prediction is used as a sorting problem, and the method is similar to a sorting method of a recommendation system or information retrieval; although an ordered list can be output according to the characteristics of the ordered objects, the ordering method in the recommendation system aims to learn a scoring function for the ordered objects, and the score is used for measuring the relevance of the user and the commodity; in the package order prediction task, the object of package ordering is to learn the routing strategy of couriers, and the accurate prediction cannot be realized unlike the recommendation system.
Disclosure of Invention
In view of the above problems, embodiments of the present invention provide a courier pickup sequence prediction method based on deep learning, which learns the decision experience and preference of a courier from historical data based on a deep learning model, and predicts a package pickup route of the courier, thereby accurately predicting a pickup sequence of the courier, optimizing logistics scheduling, improving pickup efficiency, and reducing overdue rate.
In order to achieve the above purpose, the embodiment of the present invention adopts the following technical solutions:
in a first aspect, an embodiment of the present invention provides a courier pickup order prediction method based on deep learning, where the pickup order prediction method includes:
step S1, collecting historical package collecting data, extracting the characteristics of packages to be collected and the characteristics of couriers' individual packages as an original data set;
step S2, dividing the data set into a training set, a verification set and a test set;
s3, constructing a courier pickup sequence prediction model based on a deep learning algorithm;
step S4, the courier pickup order prediction model is trained by using the training set and the verification set, and the trained model is tested by using the test set; when the test reaches the standard, the step S5 is entered; otherwise, return to step S4;
and step S5, inputting the current courier information through the trained courier package order prediction model, predicting the package order of the to-be-packaged couriers, and outputting the predicted package order of the to-be-predicted couriers in a preset time period.
As a preferred embodiment of the present invention, in step S3, when building a courier package sequence prediction model based on a deep learning algorithm, the model is built according to the spatio-temporal constraints of package non-package and the decision preference of couriers.
As a preferred embodiment of the invention, the constructed courier package order prediction model comprises the following steps: a preference perception representation layer, a Transformer coding layer and an attention cycle decoding layer; wherein the content of the first and second substances,
the preference perception representation layer extracts the characteristics of the package to be collected and combines the characteristics with the decision preference of the courier to form package embedding to be collected; the method comprises the following steps that a Transformer coding layer captures the time-space correlation among packages to be collected to obtain new package embedding to be collected; the attention circulating decoding layer is embedded in a new package to be collected obtained on the basis of a Transformer coding layer, circularly selects from the package to be collected and outputs the package to be collected, and obtains a collection sequence prediction sequence
As a preferred embodiment of the present invention, the preference perception representation layer is composed of a package embedding module and a preference perception module; the package embedding module converts original features of packages to be collected into a feature matrix by a feed-forward neural network, and connects the regional features with the package feature matrix to form a middle embedding matrix; the preference perception module captures the space-time relation between adjacent recently collected packages, deduces the decision preference vector of the courier when selecting the next package by using the hidden state vector of the last package, and obtains a preference perception expression matrix for all packages to be collected according to the intermediate embedding matrix and the decision preference vector.
As a preferred embodiment of the present invention, when constructing the preference perception representation layer of the courier package order prediction model, the method specifically includes:
step S311, a feedforward neural network converts the original feature of the package to be collected into a feature matrix X, and connects the regional feature with the package feature matrix X to form a middle embedded matrix E';
step S312, constructing a preference vector P of the courier as follows:
p=σ(Wp[xu,hut]+bp) (1),
in the formula (1), xuPersonal characteristics representing courier u; sigma represents Sigmoid activation function sigma (x) is 1/(1+ e)-x),bpRepresents a learnable offset vector; h isut=[hbt,hft]The packaging sequence representing the encoded recent acquisition, hftAnd hbtThe hidden state vector is based on forward and backward directions of BilSTM when a courier u takes a recent package collecting sequence as input at any time t;
and step S313, performing Hadamard multiplication on the intermediate embedded matrix E' and the preference vector p to obtain a preference perception representation matrix E for all packages to be collected.
As a preferred embodiment of the present invention, the Transformer coding layer is formed by stacking n layers of Transformer encoders, and each layer of encoder completes information transfer of any two packages to be collected by using a multi-head self-attention mechanism; the output after the multi-head self-attention mechanism is subjected to a feedforward neural network to enhance the nonlinear conversion capability of the model, and residual connection and batch normalization are added for each self-attention mechanism operation and each feedforward neural network operation; after the state of the n layers is updated, embedding of the package to be collected is obtained, and an average value is calculated; the average embedding of the packages to be picked up is used as the initial input of an attention cycle decoding layer.
As a preferred embodiment of the present invention, the calculation formula of the self-attention mechanism is as follows:
Figure BDA0002838924960000031
in the formula (2), Q represents a query (query) matrix, K represents a key value (key) matrix, and V represents a value (value) matrix, and the three matrices are obtained by linearly varying the preference perception representation matrix E.
As a preferred embodiment of the present invention, when constructing the attention cycle decoding layer of the courier package order prediction model, the method specifically includes:
step S331, the attention cycle decoding layer calculates the attention distribution of each round by using LSTM in cooperation with an attention mechanism, and the specific calculation formula is as follows:
Figure BDA0002838924960000041
in the formula (6), v, W1,W2For learning parameters, e represents the output of the transform coding layer, h represents the hidden state of the decoding layer, u represents the non-normalized attention distribution, i represents the sequence number of the coding layer output, j represents the time step of the decoding layer, and pijRepresenting the serial number of the package output at the time step j';
step S332, sequentially calculating the hidden state of the attention loop decoding layer corresponding to the time step j and all the outputs of the transform coding layer according to the formula (6), and assigning the attention value of the package which is output before the time step j to be infinity;
step S333, performing Softmax operation on the obtained probability distribution, and selecting the package-in package with the maximum probability for each round to output;
in step S334, the difference between the label and the model output is calculated using a cross entropy loss function.
As a preferred embodiment of the present invention, in step S334, for the method for calculating loss after arrival of a new package task, only the loss L between the result of the model output that is not affected before the arrival time of the package task and the tag is calculated, and the specific calculation formula is as follows:
Figure BDA0002838924960000042
in the formula (7), T represents the set of all sampling time points, QtRepresenting a package set to be pulled which is not influenced by a new pulling task at the time t, yoRepresenting the number of packages o in the courier's exact route, p (y)o| θ) represents the output probability of the package o for the model decision, and θ represents the model parameters.
As a preferred embodiment of the present invention, the historical pickup data at least includes data of the area where the courier is located and the time period of employment to be predicted, so that the collected historical data is valid data for the current courier; the characteristics of the package to be collected comprise the area characteristics such as the remaining collecting time of the package, the distance between the package and the current courier departure point, the average collecting time of the area where the package is located, the area attribute and the like.
The invention has the following beneficial effects:
according to the express delivery member pickup sequence prediction method based on deep learning, the decision experience and preference of an express delivery member are learned from historical data based on a deep learning model, and the package pickup route of the express delivery member is predicted, so that the pickup sequence of the express delivery member is accurately predicted, logistics scheduling is optimized, pickup efficiency is improved, overdue rate is reduced, pickup sequence of the express delivery member is accurately predicted, and accuracy of pickup arrival time prediction is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a flowchart of a courier pickup order prediction method based on deep learning according to an embodiment of the present invention;
FIG. 2 is a schematic structural diagram of a courier pickup order prediction model based on deep learning in the embodiment of the invention;
FIG. 3 is a model structure diagram of a courier decision preference layer in an embodiment of the invention;
FIG. 4 is a schematic diagram of a model structure of an encoder in a transform coding layer according to an embodiment of the present invention;
fig. 5 is a model structure diagram of an attention cycle decoding layer in the embodiment of the present invention.
Detailed Description
The technical problems, aspects and advantages of the invention will be apparent from the following detailed description, which proceeds with reference to the accompanying drawings, when taken in conjunction with the accompanying exemplary embodiments. The following exemplary embodiments are merely illustrative of the present invention and are not to be construed as limiting the invention. It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the prior art and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein.
The embodiment of the invention provides a courier package order prediction method based on deep learning, which comprises the steps of extracting package characteristic data collected by couriers and courier personal characteristic data, fully considering the time-space constraint of non-package packages required to be considered when the couriers package parcels and the decision preference of the couriers when the couriers package parcels, constructing a package order prediction model based on a deep learning algorithm, training the package order prediction model by using the extracted data, finally predicting the package order of the couriers to be predicted by using the trained prediction model, applying a prediction result to a scheduling system to distribute packages, improving package efficiency, improving the accuracy of predicted package arrival time and reducing overdue rate.
Fig. 1 shows a flowchart of a method for predicting a courier package order based on deep learning according to an embodiment of the present invention. As shown in fig. 1, the package order prediction method includes:
and step S1, collecting historical package acquisition data, and extracting the characteristics of packages to be collected and the individual package acquisition characteristics of couriers as an original data set.
In this step, the historical data includes at least data of the area where the courier is located and the time period of job entry to be predicted, so that the collected historical data is effective data for the current courier.
The characteristics of the package to be collected comprise the remaining collecting time of the package, the distance between the package and the current courier departure point, the average collecting time of the area where the package is located and the area attribute.
The individual package collecting characteristics of the couriers comprise total working days, average daily package collecting quantity, package collecting time distribution and package collecting geographical distribution.
Step S2, the data set is divided into a training set, a validation set and a test set.
In this step, when the data set is divided, the data set may be distributed according to the total working days of the couriers in the extracted data. For example, the first 36 days of 60-day acquisition data are taken as a training set, the last 10 days are taken as a test set, and the remaining 14 days are taken as a verification set.
And step S3, constructing a courier pickup sequence prediction model based on a deep learning algorithm.
In the step, when the model is constructed based on the deep learning algorithm, the model is constructed according to the space-time constraint of packages which are not collected and the decision preference of couriers.
As shown in fig. 2, the constructed courier package order prediction model includes: a preference perception representation layer, a transform encoding layer and an attention cycle decoding layer. The preference perception representation layer extracts the characteristics of the package to be collected and combines the characteristics with the decision preference of the courier to form package embedding to be collected; the Transformer coding layer is used for capturing the time-space correlation among the packages to be collected to obtain new package embedding to be collected; and the attention circulating decoding layer is embedded in a new package to be collected obtained on the basis of the Transformer coding layer, and circularly selects and outputs the package to be collected to obtain a collection sequence prediction sequence.
Wherein, the preference perception representation layer is composed of a package embedding module and a preference perception module. The package embedding module firstly converts original features of packages to be collected into a feature matrix X by a feed-forward neural network, and connects the regional features with the package feature matrix X to form a middle embedding matrix E'. The preference perception module captures the time-space relation between adjacent package acquisition packages, deduces a decision preference vector of the courier when selecting the next package by using the hidden state vector of the last package, and obtains a preference perception expression matrix E for all packages to be acquired according to the intermediate embedded matrix E' and the decision preference vector. Preferably, in the present embodiment, a Bi-directional Long Short-Term Memory network (BiLSTM) is used to capture the spatiotemporal relationship.
For example, for a certain courier u, at any time t, with the latest package acquisition sequence as input, forward and backward hidden state vectors h of BilSTM are usedftAnd hbtThe join yields a representation h of the nearest package sequenceut=[hbt,hft]. Then the courier personal characteristic x in the step S1uPackaging sequence representation h with the nearest packageutAnd connecting to obtain a preference vector p after passing through a full connection layer. This process can be expressed as:
p=σ(Wp[xu,hut]+bp) (1)
in the formula (1), xuRepresenting the personal characteristics of courier u. σ denotes Sigmoid activation function (σ (x) ═ 1/(1+ e)-x)),bpRepresenting a learnable offset vector. And performing Hadamard multiplication on the intermediate embedded matrix E' and the preference vector p to obtain a preference perception representation matrix E for all packages to be picked.
The Transformer coding layer is formed by stacking n layers of Transformer encoders, and each encoder completes information transmission of any two packages to be collected by using a multi-head self-attention mechanism. The formula for the calculation of the self-attention mechanism is as follows:
Figure BDA0002838924960000071
in the formula (2), Q represents a query (query) matrix, K represents a key value (key) matrix, and V represents a value (value) matrix. The three matrixes are all derived from the preference perception expression matrix E of the packages to be picked up through linear change.
As shown in formula (2), in training, the Transformer coding layer firstly calculates the dot product of the query matrix Q and the key matrix K to obtain the attention distribution, and then divides the attention distribution by the dot product
Figure BDA0002838924960000072
(d is the dimension of embedding the package to be collected), then obtaining the normalized attention distribution by using Softmax, and finally obtaining corresponding output by calculating with the corresponding V.
And enhancing the nonlinear conversion capability of the model by the output after the multi-head self-attention mechanism through a feedforward neural network, and adding residual connection and batch normalization to each self-attention mechanism operation and feedforward neural network operation to improve the effect of the transform encoder. The specific calculation formula is as follows:
Figure BDA0002838924960000073
Figure BDA0002838924960000074
in equations (3) and (4), MHA represents multi-head self-attention operation, the attention calculation of each head is as in equation (2), FFN represents feed-forward neural network operation, BN represents batch normalization operation, where e'iRepresenting the embedding of the ith parcel after a multi-headed self-attentive mechanism operation,
Figure BDA0002838924960000075
representing the embedding of the ith parcel through the ith encoder. After the state of the n layers is updated, the final embedding of the package to be collected is obtained, and the average value is calculated, wherein the specific calculation formula is as follows:
Figure BDA0002838924960000081
in the formula (5), the reaction mixture is,
Figure BDA0002838924960000082
represents the average embedding of the package status to be picked up. The resulting average embedding of packages to be picked up is used as the initial input to the attention cycle decoding layer.
The attention cycle decoding layer calculates the attention distribution of each round by using the LSTM and an attention mechanism, and the specific calculation formula is as follows:
Figure BDA0002838924960000083
in the formula (6), v, W1,W2For learning parameters, e represents the output of the transform coding layer, h represents the hidden state of the decoding layer, u represents the non-normalized attention distribution, i represents the sequence number of the coding layer output, j represents the time step of the decoding layer, and pijAnd represents the package serial number output at time step j'. And (3) sequentially carrying out the operation of a formula (6) on the hidden state of the attention loop decoding layer corresponding to the time step j and all the outputs of the transform coding layer, and assigning the attention value of the package which is output before the time step j to infinity.
And performing Softmax operation on the obtained probability distribution, and selecting the collecting package with the maximum probability for each round to output, so that repeated output can be avoided, and the collection sequence prediction is completed.
The difference between the label and the model output is calculated using a cross entropy loss function. The labels here are the actual package order of the couriers.
For the calculation method of loss after the arrival of the new component collecting task, only calculating the loss L between the result of the model output which is not influenced before the arrival time of the new component collecting task and the label, wherein the specific calculation formula is as follows:
Figure BDA0002838924960000084
in the formula (7), T represents the set of all sampling time points, QtRepresenting a package set to be pulled which is not influenced by a new pulling task at the time t, yoRepresenting the number of packages o in the courier's exact route, p (y)o| θ) represents the output probability of the package o for the model decision, and θ represents the model parameters.
Step S4, the courier pickup order prediction model is trained by using the training set and the verification set, and the trained model is tested by using the test set; when the test reaches the standard, the step S5 is entered; otherwise, return to step S4.
And step S5, inputting the current courier information through the trained courier package order prediction model, predicting the package order of the to-be-packaged couriers, and outputting the predicted package order of the to-be-predicted couriers in a preset time period.
The present invention will be described in further detail with reference to specific examples, which are provided only for the purpose of supplementary explanation and are not to be construed as limiting the present invention.
The express mail picking sequence prediction method based on deep learning provided by the embodiment takes express mail package picking in certain areas of Shanghai in China as an example for explanation. The method comprises the following steps:
step S1, collecting pickup data of 432 couriers from 11/2019 to 11/1/2020 in a certain area of Shanghai in China, and extracting pickup package characteristics and 432 courier individual pickup characteristics as an original data set. The extracted package acquisition characteristics are shown in table 1, and the extracted 432 courier individual package characteristics are shown in table 2.
TABLE 1
Package Type of region Longitude of region Latitude of region Remaining time of taking out the article Distance from cable member
1 Residential area 121.4018 31.2873 70(min) 257(m)
2 Residential area 121.4033 31.2892 64(min) 381(m)
…… …… …… …… …… ……
n Commercial district 121.3978 31.2961 104(min) 1058(m)
TABLE 2
Courier numbering Total days of work Average daily number of packets
1 55 40
…… …… ……
n 60 52
And step S2, taking the first 36 days of the collected piece data of 60 days as a training set, taking the last 10 days as a testing set, and taking the other days as a verification set.
And step S3, constructing a courier package order prediction model based on a deep learning algorithm, wherein the model comprises a preference perception representation layer, a Transformer coding layer and an attention circulation decoding layer which are sequentially connected.
The preference perception representation layer represents the characteristics of the package to be collected and integrates the characteristics with the decision preference of the courier to form package embedding to be collected; learning the time-space correlation among the packages to be collected through a Transformer coding layer to obtain new package embedding to be collected; based on the embedding obtained by the transform coding layer, the attention circulating decoding layer circularly selects and outputs the packages to be collected to obtain a collection prediction sequence.
Fig. 3 shows a model structure diagram of the courier decision preference module in the embodiment. The courier decision preference module uses BiLSTM to capture the spatiotemporal relationship between adjacent package acquisition and uses the hidden state vector of the last cell to infer the courier's decision preference in selecting the next package. For a certain courier u, at any time t, taking the latest package acquisition sequence as input, and taking forward and backward hidden state vectors h of BilSTMftAnd hbtThe join yields a representation h of the nearest package sequenceut=[hbt,hft]. Then the personal characteristics x of the courier in the step 1 are compareduPackaging sequence representation h with the nearest packageutAnd connecting to obtain a preference vector p after passing through a full connection layer. The calculation process of the preference vector p is shown as formula (1). For example, as shown in fig. 3, in a training sample, a recent package acquisition sequence (package acquisition 8:00, package acquisition 8:30, package acquisition 10: 30) is input into the BiLSTM, the air-space relationship is captured by the BiLSTM, and finally, a recent package acquisition characteristic is obtained, which is used for estimating the decision preference of the courier in the current state. In addition, personal characteristics of the courier (such as working days of the courier, daily average quantity of the courier and the like) can reflect long-term decision preference (such as watching distance or time). The long-term and short-term decision preference can be captured simultaneously by splicing the recent package acquisition characteristics and the individual characteristics of couriers.
The transform coding layer is stacked by multiple layers of transform encoders, wherein FIG. 4 showsAnd (3) a model structure schematic diagram of a Transformer coding layer. As shown in fig. 4, each layer uses a multi-head self-attention mechanism to complete information transfer of any two packages to be picked up. Suppose the transform encoder layer consists of 2 layers of transform encoders, the number of heads of the multi-head attention mechanism is 8, and the hidden layer represents dimension 32. Calculating the dot product of query (Q) and key (K) by the calculation formula (2) of the self-attention mechanism to obtain the attention distribution, and dividing the attention distribution by the point product
Figure BDA0002838924960000101
(d is a characteristic dimension of packages to be collected), then using Softmax to obtain the attention distribution after normalization, and finally calculating with value (V) to obtain corresponding output.
And (3) the output after the multi-head self-attention mechanism is subjected to a feedforward neural network to enhance the nonlinear conversion capability of the model, residual connection and batch normalization are added for each self-attention mechanism operation and feedforward neural network operation to improve the effect of a transform encoder, and the embedding of the ith parcel after the ith parcel passes through the first encoder is calculated through formulas (3) and (4). After the state of the n layers is updated, embedding of the package to be collected is obtained, the average embedding of the package state to be collected is calculated by adopting a formula (5), and the average embedding is used as the input of the attention cycle decoding layer.
Fig. 5 shows a model structure diagram of an attention cycle decoding layer, and the obtained average embedding of packages to be collected is used as an initial input of the attention cycle decoding layer. The attention cycle decoding layer calculates the attention distribution for each round by equation (6) using LSTM in conjunction with the attention mechanism. And (3) sequentially carrying out the operation of the formula (6) on the hidden state of the attention loop decoding layer at the time step j and all the outputs of the transform coding layer, and assigning the attention value of the package which is output before the time step j to be infinity. And performing Softmax operation on the obtained probability distribution, and selecting the collecting package with the maximum probability for each round to output, so that repeated output can be avoided, and the collection sequence prediction is completed.
Step S4, the courier pickup order prediction model is trained by using the training set and the verification set, and the trained model is tested by using the test set; when the test reaches the standard, the step S5 is entered; otherwise, return to step S4. The model parameters can be solved by a random gradient descent method or an optimization algorithm such as Adam, and the learning rate is assumed to be 0.001.
The reliability of the model is checked by using acquisition data of 432 couriers in a certain area of Shanghai from 1 month and 2 days in 2020 to 1 month and 11 days in 2020 as test data.
And step S5, inputting the current courier information through the trained courier package order prediction model, predicting the package order of the to-be-packaged couriers, and outputting the predicted package order of the to-be-predicted couriers in a preset time period.
While the foregoing is directed to the preferred embodiment of the present invention, it is understood that the invention is not limited to the exemplary embodiments disclosed, but is made merely for the purpose of providing those skilled in the relevant art with a comprehensive understanding of the specific details of the invention. It will be apparent to those skilled in the art that various modifications and adaptations of the present invention can be made without departing from the principles of the invention and the scope of the invention is to be determined by the claims.

Claims (10)

1. A courier pickup sequence prediction method based on deep learning is characterized by comprising the following steps:
step S1, collecting historical package collecting data, extracting the characteristics of packages to be collected and the characteristics of couriers' individual packages as an original data set;
step S2, dividing the data set into a training set, a verification set and a test set;
s3, constructing a courier pickup sequence prediction model based on a deep learning algorithm;
step S4, the courier pickup order prediction model is trained by using the training set and the verification set, and the trained model is tested by using the test set; when the test reaches the standard, the step S5 is entered; otherwise, return to step S4;
and step S5, inputting the current courier information through the trained courier package order prediction model, predicting the package order of the to-be-packaged couriers, and outputting the predicted package order of the to-be-predicted couriers in a preset time period.
2. The courier package pulling sequence prediction method according to claim 1, wherein in the step S3, when a courier package pulling sequence prediction model is constructed based on a deep learning algorithm, the construction is performed according to space-time constraints of packages which are not packaged and decision preference of couriers.
3. The courier pickup sequence prediction method according to claim 2, wherein the constructed courier pickup sequence prediction model comprises: a preference perception representation layer, a Transformer coding layer and an attention cycle decoding layer; wherein the content of the first and second substances,
the preference perception representation layer extracts the characteristics of the package to be collected and combines the characteristics with the decision preference of the courier to form package embedding to be collected; the method comprises the following steps that a Transformer coding layer captures the time-space correlation among packages to be collected to obtain new package embedding to be collected; and the attention circulating decoding layer is embedded in a new package to be collected obtained on the basis of the Transformer coding layer, and circularly selects and outputs the package to be collected to obtain a collection sequence prediction sequence.
4. The courier package pulling sequence prediction method according to claim 3, wherein the preference perception representation layer is composed of a package embedding module and a preference perception module; the package embedding module converts original features of packages to be collected into a feature matrix by a feed-forward neural network, and connects the regional features with the package feature matrix to form a middle embedding matrix; the preference perception module captures the space-time relation between adjacent recently collected packages, deduces the decision preference vector of the courier when selecting the next package by using the hidden state vector of the last package, and obtains a preference perception expression matrix for all packages to be collected according to the intermediate embedding matrix and the decision preference vector.
5. The courier package order prediction method according to claim 3, wherein when constructing the preference perception representation layer of the courier package order prediction model, the method specifically comprises:
step S311, a feedforward neural network converts the original feature of the package to be collected into a feature matrix X, and connects the regional feature with the package feature matrix X to form a middle embedded matrix E';
step S312, constructing a preference vector P of the courier as follows:
p=σ(Wp[xu,hut]+bp) (1),
in the formula (1), xuPersonal characteristics representing courier u; sigma represents Sigmoid activation function sigma (x) is 1/(1+ e)-x),bpRepresents a learnable offset vector; h isut=[hbt,hft]Information of the latest package sequence representing the code, hftAnd hbtThe hidden state vector is based on forward and backward directions of BilSTM when a courier u takes a recent package collecting sequence as input at any time t;
and step S313, performing Hadamard multiplication on the intermediate embedded matrix E' and the preference vector p to obtain a preference perception representation matrix E for all packages to be collected.
6. The courier package pulling sequence prediction method according to claim 4 or 5, wherein the transform coding layer is formed by stacking n layers of transform encoders, and each layer of encoder completes information transmission of any two packages to be packaged by using a multi-head self-attention mechanism; the output after the multi-head self-attention mechanism is subjected to a feedforward neural network to enhance the nonlinear conversion capability of the model, and residual connection and batch normalization are added for each self-attention mechanism operation and each feedforward neural network operation; after the state of the n layers is updated, embedding of the package to be collected is obtained, and an average value is calculated; the average embedding of the packages to be picked up is used as the initial input of an attention cycle decoding layer.
7. The courier package order prediction method according to claim 6, wherein the calculation formula of the self-attention mechanism is as follows:
Figure FDA0002838924950000021
in the formula (2), Q represents a query matrix, K represents a key value matrix, and V represents a value matrix, and the three matrices are obtained by linear variation from the preference perception representation matrix E.
8. The courier package order prediction method according to claim 6, wherein when constructing an attention cycle decoding layer of the courier package order prediction model, the method specifically comprises:
step S331, the attention cycle decoding layer calculates the attention distribution of each round by using LSTM in cooperation with an attention mechanism, and the specific calculation formula is as follows:
Figure FDA0002838924950000031
in the formula (6), v, W1,W2For learning parameters, e represents the output of the transform coding layer, h represents the hidden state of the decoding layer, u represents the non-normalized attention distribution, i represents the sequence number of the coding layer output, j represents the time step of the decoding layer, and pijRepresenting the serial number of the package output at the time step j';
step S332, sequentially calculating the hidden state of the attention loop decoding layer corresponding to the time step j and all the outputs of the transform coding layer according to the formula (6), and assigning the attention value of the package which is output before the time step j to be infinity;
step S333, performing Softmax operation on the obtained probability distribution, and selecting the package-in package with the maximum probability for each round to output;
in step S334, the difference between the label and the model output is calculated using a cross entropy loss function.
9. The method for predicting the package pull sequence of couriers according to claim 8, wherein in step S334, for the calculation method of loss after the package pull task arrives, only the loss L between the tag and the result of the model output that is not affected before the package pull task arrives is calculated, and the specific calculation formula is as follows:
Figure FDA0002838924950000032
in the formula (7), T represents the set of all sampling time points, QtRepresenting a package set to be pulled which is not influenced by a new pulling task at the time t, yoRepresenting the number of packages o in the courier's exact route, p (y)o| θ) represents the output probability of the package o for the model decision, and θ represents the model parameters.
10. The courier package pulling sequence prediction method according to claim 8, wherein the historical package pulling data at least comprises data of an area where the courier is located and data of an entry time period to be predicted, so that the collected historical data is valid data for the current courier; the characteristics of the package to be collected comprise the remaining collecting time of the package, the distance between the package and the current courier departure point, the average collecting time of the area where the package is located and the area attribute.
CN202011485308.1A 2020-12-16 2020-12-16 Express item acquisition sequence prediction method based on deep learning Pending CN112529305A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011485308.1A CN112529305A (en) 2020-12-16 2020-12-16 Express item acquisition sequence prediction method based on deep learning

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011485308.1A CN112529305A (en) 2020-12-16 2020-12-16 Express item acquisition sequence prediction method based on deep learning

Publications (1)

Publication Number Publication Date
CN112529305A true CN112529305A (en) 2021-03-19

Family

ID=75000603

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011485308.1A Pending CN112529305A (en) 2020-12-16 2020-12-16 Express item acquisition sequence prediction method based on deep learning

Country Status (1)

Country Link
CN (1) CN112529305A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113256157A (en) * 2021-06-17 2021-08-13 平安科技(深圳)有限公司 Conference flow generation method and device, computer equipment and storage medium
CN113687651A (en) * 2021-07-06 2021-11-23 清华大学 Path planning method and device for delivering vehicles according to needs

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105046338A (en) * 2015-08-24 2015-11-11 扬州大学 Intelligent express distribution method on mobile platform
US20180209808A1 (en) * 2017-01-10 2018-07-26 Beijing Didi Infinity Technology And Development Co., Ltd. Method and system for estimating time of arrival
CN109415122A (en) * 2016-06-06 2019-03-01 福特全球技术公司 System, the method and apparatus delivered for automated vehicle and unmanned plane
CN109993382A (en) * 2017-12-29 2019-07-09 顺丰科技有限公司 Courier sends sequence recommended method and system with charge free
CN111047102A (en) * 2019-12-18 2020-04-21 江南大学 Express delivery distribution route optimization method based on elite-driven particle swarm algorithm
CN111950803A (en) * 2020-08-24 2020-11-17 上海寻梦信息技术有限公司 Logistics object delivery time prediction method and device, electronic equipment and storage medium
CN111967678A (en) * 2020-08-20 2020-11-20 辽宁工业大学 Express delivery terminal distribution path optimization method

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105046338A (en) * 2015-08-24 2015-11-11 扬州大学 Intelligent express distribution method on mobile platform
CN109415122A (en) * 2016-06-06 2019-03-01 福特全球技术公司 System, the method and apparatus delivered for automated vehicle and unmanned plane
US20180209808A1 (en) * 2017-01-10 2018-07-26 Beijing Didi Infinity Technology And Development Co., Ltd. Method and system for estimating time of arrival
CN109993382A (en) * 2017-12-29 2019-07-09 顺丰科技有限公司 Courier sends sequence recommended method and system with charge free
CN111047102A (en) * 2019-12-18 2020-04-21 江南大学 Express delivery distribution route optimization method based on elite-driven particle swarm algorithm
CN111967678A (en) * 2020-08-20 2020-11-20 辽宁工业大学 Express delivery terminal distribution path optimization method
CN111950803A (en) * 2020-08-24 2020-11-17 上海寻梦信息技术有限公司 Logistics object delivery time prediction method and device, electronic equipment and storage medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113256157A (en) * 2021-06-17 2021-08-13 平安科技(深圳)有限公司 Conference flow generation method and device, computer equipment and storage medium
CN113687651A (en) * 2021-07-06 2021-11-23 清华大学 Path planning method and device for delivering vehicles according to needs
CN113687651B (en) * 2021-07-06 2023-10-03 清华大学 Path planning method and device for dispatching vehicles on demand

Similar Documents

Publication Publication Date Title
CN107844915B (en) Automatic scheduling method of call center based on traffic prediction
CN115640914B (en) Intelligent gas storage optimization method, internet of things system, device and medium
CN112529305A (en) Express item acquisition sequence prediction method based on deep learning
Wu et al. Deepeta: A spatial-temporal sequential neural network model for estimating time of arrival in package delivery system
US11495055B1 (en) Pedestrian trajectory prediction method and system based on multi-interaction spatiotemporal graph network
CN111091196A (en) Passenger flow data determination method and device, computer equipment and storage medium
CN108694470A (en) A kind of data predication method and device based on artificial intelligence
CN111582356B (en) Target information unified representation and association method
CN116090602A (en) Power load prediction method and system
CN115269958A (en) Internet reliability data information acquisition and analysis system
CN114662389A (en) Air pollutant-oriented self-correlation error Informer model long time sequence prediction method and system
CN112990584B (en) Automatic production decision system and method based on deep reinforcement learning
CN107506937B (en) Hydropower station power generation capacity evaluation method based on association rule
CN116865261B (en) Power load prediction method and system based on twin network
Biyun et al. A Reliability Forecasting Method for Distribution Network Based on Data Mining
CN116404637A (en) Short-term load prediction method and device for electric power system
CN116703644A (en) Attention-RNN-based short-term power load prediction method
CN113673846B (en) Demand situation awareness method under electric power Internet of things architecture
CN111209802B (en) Robot visual image scene analysis method for graph focus transfer
CN115241872A (en) Multi-mode photovoltaic power generation output power prediction method based on pure attention mechanism
Khan et al. Short-term load and price forecasting based on improved convolutional neural network
CN109034453A (en) A kind of Short-Term Load Forecasting Method based on multiple labeling neural network
CN112579721A (en) Method and system for constructing crowd distribution map, terminal device and storage medium
Heydari et al. An evolutionary hybrid method to predict pistachio price
CN113034195A (en) Network taxi booking demand prediction method based on convolutional network and non-local network

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