Logistics Routing Sequence Generation Method, Device, Computer Equipment and Storage Medium
By vectorizing the historical logistics routing sequence and using the sequence-to-sequence translation model to generate similar logistics routing sequences, the problems of high time complexity and dependence on experience in the prior art logistics routing planning method are solved, and flexible and efficient logistics routing sequence generation is achieved.
Patent Information
- Application Number
- CN202011343553.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-26
- Publication Date
- 2025-06-13
- Estimated Expiration
- 2040-11-26
AI Technical Summary
In the existing logistics routing planning methods, the time complexity of breadth and depth search algorithms is too high, making it difficult to apply to the large-scale express delivery industry. The experience rules and regulations rely on business management experience, which is too rigid and lacks flexibility.
By obtaining the historical logistics routing sequence, the outlet codes of each logistics outlet are vectorized, and a similar logistics routing sequence corresponding to the vectorized logistics routing sequence is generated using the sequence-to-sequence translation model.
It reduces the computational complexity, reduces the scale of logistics routing sequence generation, improves the flexibility of the method, and does not rely on personal experience, and can efficiently generate similar logistics routing sequences.
Smart Images

Figure CN114548468B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of logistics technologies, and in particular, to a method and apparatus for generating a logistics routing sequence, a computer device, and a storage medium. Background Art
[0002] Logistics routing planning is an effective way to guide the efficient transportation of express deliveries. Generating an ordered sequence from the order origin to the destination and the passing-through locations is the basis of logistics routing planning. This sequence forms a logistics routing through the connection of corresponding transportation capacity resources and becomes a member of the logistics routing pool for planning use. Currently, there are mainly two methods for dealing with this problem, namely the search algorithm (depth-first search, breadth-first search) and the empirical rule restriction method.
[0003] However, the common breadth-first and depth-first search algorithms have too high time complexity and are difficult to apply in the express delivery industry where the scale of logistics outlets and transportation capacity is increasing day by day; while the empirical rule restriction method, although reducing the search scale, relies on management experience, making the search lose flexibility and becoming too rigid. Summary of the Invention
[0004] Based on this, in view of the above technical problems, it is necessary to provide a method and apparatus for generating a logistics routing sequence, a computer device, and a storage medium with a small scale and high flexibility.
[0005] A method for generating a logistics routing sequence, the method comprising:
[0006] Obtaining a historical logistics routing sequence;
[0007] Reading the outlet codes of each logistics outlet included in the historical logistics routing sequence;
[0008] Respectively vectorizing each of the outlet codes in the historical logistics routing sequence to generate a vectorized logistics routing sequence;
[0009] Based on the vectorized logistics routing sequence, generating a similar logistics routing sequence corresponding to the vectorized logistics routing sequence.
[0010] In one of the embodiments, the generating a similar logistics routing sequence corresponding to the vectorized logistics routing sequence based on the vectorized logistics routing sequence includes:
[0011] Inputting the vectorized logistics routing sequence into a sequence-to-sequence translation model determined by training;
[0012] Obtaining a vectorized similar logistics routing sequence output by the sequence-to-sequence translation model;
[0013] Based on the vectorized similar logistics routing sequence, obtaining the similar logistics routing sequence.
[0014] In one embodiment, the vectorization of each of the network point codes in the historical logistics routing sequence to generate a vectorized logistics routing sequence includes:
[0015] Inputting each of the network point codes into a word vector model respectively; wherein, the word vector model is constructed based on all network point codes;
[0016] Obtaining the word vectors corresponding to each of the network point codes output by the word vector model;
[0017] Replacing the corresponding network point codes in the historical logistics routing sequence with the word vectors respectively to obtain the vectorized logistics routing sequence corresponding to the historical logistics routing sequence.
[0018] In one embodiment, the sequence-to-sequence translation model includes an encoder and a decoder;
[0019] Inputting the vectorized logistics routing sequence into a sequence-to-sequence translation model determined by training to obtain a vectorized similar logistics routing sequence output by the sequence-to-sequence translation model includes:
[0020] Inputting the vectorized logistics routing sequence into the encoder to obtain a fixed-length intermediate vector;
[0021] Inputting the intermediate vector into the decoder to obtain the vectorized similar logistics routing sequence output by the decoder.
[0022] In one embodiment, the training of the translation model includes the steps of:
[0023] Obtaining a sample logistics routing sequence, where the sample logistics routing sequence is the logistics routing sequence that occurred within a preset historical time period;
[0024] Constructing a sequence-to-sequence translation model architecture, training the translation model architecture based on the sample logistics routing sequence, and stopping training when the termination condition is met to obtain the sequence-to-sequence translation model.
[0025] In one embodiment, the constructing of the sequence-to-sequence translation model architecture includes:
[0026] Constructing an initial encoder based on a long short-term memory network;
[0027] Constructing an initial decoder based on a long short-term memory network;
[0028] Splicing the output of the initial encoder as the input of the initial decoder, and adding a correction logic outside the spliced model to obtain the sequence translation model architecture.
[0029] A logistics routing sequence generation device, the device comprising:
[0030] An acquisition module, configured to acquire a historical logistics routing sequence;
[0031] A network point code reading module, configured to read the network point codes of each logistics network point included in the historical logistics routing sequence;
[0032] A vectorization module, configured to vectorize each of the network point codes in the historical logistics routing sequence respectively to generate a vectorized logistics routing sequence;
[0033] A similar logistics routing sequence generation module, configured to generate a similar logistics routing sequence corresponding to the vectorized logistics routing sequence.
[0034] In one of the embodiments, the similar logistics routing sequence generation module comprises:
[0035] An input unit, configured to input the vectorized logistics routing sequence into a sequence-to-sequence translation model determined through training;
[0036] A translation result acquisition unit, configured to acquire the vectorized similar logistics routing sequence output by the sequence-to-sequence translation model;
[0037] The similar logistics routing sequence generation module is specifically configured to: obtain the similar logistics routing sequence based on the vectorized similar logistics routing sequence.
[0038] A computer device, comprising a memory and a processor, where the memory stores a computer program, and when the processor executes the computer program, the steps of the above-mentioned logistics routing sequence generation method are implemented.
[0039] A computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above-mentioned logistics routing sequence generation method are implemented.
[0040] For the above-mentioned logistics routing sequence generation method, device, computer device and storage medium, after vectorizing the already occurred logistics routing sequence, a vectorized logistics routing sequence is obtained, then the vectorized logistics routing sequence is input into an encoder to obtain a fixed-length vector, and the fixed-length vector is input into a decoder to obtain a logistics routing sequence similar to the input vectorized logistics routing sequence. By first vectorizing the acquired logistics routing sequence and then using the vectorized logistics sequence to generate a similar logistics routing sequence similar thereto, the above method can reduce the computational complexity, thereby reducing the scale, and at the same time does not need to rely on personal experience and has high flexibility. Description of the Drawings
[0041] Figure 1Schematic flowchart of a method for generating a logistics routing sequence in an embodiment;
[0042] Figure 2 Schematic flowchart of a method for vectorizing each network point code in a historical logistics routing sequence to generate a vectorized logistics routing sequence in an embodiment;
[0043] Figure 3 Schematic flowchart of a method for generating a similar logistics routing sequence corresponding to a vectorized logistics routing sequence based on the vectorized logistics routing sequence in an embodiment;
[0044] Figure 4 Schematic flowchart of a method for generating a logistics routing sequence in another embodiment;
[0045] Figure 5 Schematic flowchart of a training process of a translation model in an embodiment;
[0046] Figure 6 Schematic diagram of the structure of a sequence-to-sequence translation model in a specific embodiment;
[0047] Figure 7 Block diagram of the structure of a logistics routing sequence generation device in an embodiment;
[0048] Figure 8 Internal structure diagram of a computer device in an embodiment. Detailed implementation manners
[0049] In order to make the objectives, technical solutions, and advantages of the present application clearer and more understandable, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0050] In one embodiment, as Figure 1 shown, a method for generating a logistics routing sequence is provided. In this embodiment, it is exemplified that the method is applied to a terminal. It can be understood that the method can also be applied to a server and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes steps S110 to S140.
[0051] Step S110, obtain a historical logistics routing sequence.
[0052] In the logistics and express delivery industry, a logistics route is the path or route from the origin to the destination, that is, the path for transferring parcels from the sender's address to the delivery address. A sequence is a list of objects (or events) arranged in a row; each element in the sequence is either before or after other elements. A logistics network point is a node of the logistics network, mainly referring to storage warehouses, distribution warehouses, transfer warehouses, etc. In this embodiment, a logistics route sequence refers to the various logistics network points that make up the path from the origin to the destination in the logistics industry; further, a historical logistics route sequence refers to the logistics path from the origin to the destination that has occurred within a historical time.
[0053] Step S120, read the network point codes of each logistics network point included in the historical logistics route sequence.
[0054] Among them, a logistics network point is a node of the logistics network. It mainly refers to storage warehouses, distribution warehouses, transfer warehouses, etc. And in a logistics system, each logistics network point has a unique corresponding identifier. In this embodiment, the network point code is used as the unique identifier for each logistics network point.
[0055] In this embodiment, after obtaining the historical logistics route sequence, read the network point codes of each logistics network point included in each historical logistics route sequence respectively, and the network point codes of the various logistics network points that make up the historical logistics route sequence can be obtained.
[0056] Step S130, vectorize each network point code in the historical logistics route sequence respectively to generate a vectorized logistics route sequence.
[0057] In this embodiment, vectorizing the network point code means converting the network point code into a corresponding vector; among them, different vectorization methods can be used to implement the vectorization of the network point code, which is not limited here; for example, it can be achieved by one-hot (one-hot encoding), SVD (Singular Value Decomposition), NNLM (NerualNetwork Language Model), Word2Vec (a model for obtaining word vectors), GloVe (Global Vectors), etc. to vectorize the network point code.
[0058] In one embodiment, as Figure 2 shown, vectorize each network point code in the historical logistics route sequence respectively to generate a vectorized logistics route sequence, including steps S131 to S133.
[0059] Step S131, input each network point code into the word vector model respectively; among them, the word vector model is constructed based on all network point codes.
[0060] A word vector, also known as a word embedding, represents mapping words in a vocabulary into real - valued vectors. A word vector model can be used to convert words in a corpus into vectors for subsequent various calculations based on these word vectors, that is, it can output a corresponding representation in a vector space according to the input word. There are two common algorithms for word vector models: CBOW (Continuous Bag - Of - Words Model) and skip gram (Continuous Skip - gram Model). CBOW predicts the current word given the context of the current word, while Skip - gram, on the contrary, predicts the context given the current word.
[0061] Among them, all network point codes include the network point codes of all logistics network points within the coverage range of the word vector model to be constructed; this coverage range is usually based on the logistics scope. For example, if the logistics scope of a certain logistics company is across the country, then all network point codes include the network point codes of all logistics network points across the country.
[0062] In one embodiment, the construction of the word vector model can be implemented in any way; when constructing the word vector model, all network point codes are used for construction. The constructed word vector model can generate a word space that can reflect the similarity between network point codes. This word space contains the entire network point code dictionary, which is manifested as the network point codes being represented in a vectorized form, that is, the word space contains all network point codes and the corresponding word vectors. The constructed word vector model can output the corresponding word vector for the input network point code, or can output the corresponding network point code for the input word vector.
[0063] Step S132: Obtain the word vectors corresponding to each network point code output by the word vector model.
[0064] Step S133: Replace the corresponding network point codes in the historical logistics routing sequence with word vectors respectively to obtain the vectorized logistics routing sequence corresponding to the historical logistics routing sequence.
[0065] In this step, by replacing each network point code in the historical logistics routing sequence with the corresponding word vector, a vectorized historical logistics routing sequence can be obtained, which is denoted as the vectorized logistics routing sequence in this embodiment.
[0066] In this embodiment, the word vector model that has been constructed is used to determine the corresponding word vectors for each network point code in the historical logistics routing sequence. Then, each network point code in the historical logistics routing sequence is replaced with the word vector, and a vectorized historical logistics routing sequence can be obtained, which can be used later to generate a new logistics routing sequence. The word vector model runs relatively fast, and the obtained word vectors can better represent the similarity between network point codes.
[0067] Step S140: Based on the vectorized logistics routing sequence, generate a similar logistics routing sequence corresponding to the vectorized logistics routing sequence.
[0068] After obtaining the vectorized logistics routing sequence corresponding to the historical logistics routing sequence, a logistics routing sequence similar to the historical logistics routing sequence can be generated based on this vectorized logistics routing sequence, which is denoted as the similar logistics routing sequence in this embodiment. It should be noted that the similar logistics routing path output in this embodiment is similar to the input historical logistics routing sequence, but belongs to a different routing sequence.
[0069] In one embodiment, as Figure 3 shown, generating a similar logistics routing sequence corresponding to the vectorized logistics routing sequence includes steps S141 to S143.
[0070] Step S141: Input the vectorized logistics routing sequence into the sequence-to-sequence translation model determined through training.
[0071] The sequence-to-sequence translation model (Sequence to Sequence, usually abbreviated as seq2seq) is a special type of recursive neural network architecture. The most common architecture used to build the Seq2Seq model is the Encoder-Decoder architecture. In this embodiment, the sequence-to-sequence translation model includes an encoder and a decoder. The input and output of the sequence-to-sequence translation model are both sequences. In this embodiment, the sequence input into the sequence-to-sequence translation model is the vectorized logistics routing sequence, and the output is also the vectorized logistics routing sequence.
[0072] In one embodiment, the training process of the sequence-to-sequence translation model includes building the framework of the sequence-to-sequence translation model and using the sample vectorized logistics routing sequence. Among them, the sample vectorized logistics routing sequence includes multiple groups of samples, and each group includes two similar vectorized logistics routing sequences. The sequence-to-sequence translation model architecture is trained with each group of vectorized logistics routing sequences until the termination condition is reached and the training stops, obtaining the sequence-to-sequence translation model. Among them, the similarity between two vectorized logistics routing sequences can be calculated, and a set similarity threshold can be used to determine whether two vectorized logistics routing sequences are similar.
[0073] Step S142: Obtain the vectorized similar logistics routing sequence output by the sequence-to-sequence translation model.
[0074] Further, in one embodiment, inputting the vectorized logistics routing sequence into the sequence-to-sequence translation model determined through training to obtain the vectorized similar logistics routing sequence output by the sequence-to-sequence translation model includes: inputting the vectorized logistics routing sequence into the encoder to obtain an intermediate vector of a fixed length; inputting the intermediate vector into the decoder to obtain the vectorized similar logistics routing sequence output by the decoder.
[0075] Among them, the encoder mainly refers to encoding a sentence into a fixed-length vector that can map out the general content of the sentence. The decoder is to restore the fixed-length vector obtained by the encoder back into the corresponding sequence data, usually using the same structure as the encoder. In the actual operation process, the fixed-length vector obtained by the encoder will be passed to the decoder, and the decoder node will use this vector as the input of the hidden layer and a start flag as the input of the current position.
[0076] Step S143: Obtain the similar logistics routing sequence based on the vectorized similar logistics routing sequence.
[0077] In one embodiment, obtaining the similar logistics routing sequence based on the vectorized similar logistics routing sequence includes: reading each word vector in the vectorized similar routing sequence, respectively inputting each word vector into the word vector model to obtain the network point code corresponding to the word vector output by the word vector model, and replacing the corresponding word vector with the network point code in the vectorized logistics routing sequence to obtain the similar logistics routing sequence converted into network point codes. The word vector used is the word vector model constructed based on all network point codes in the above embodiment.
[0078] In this embodiment, the trained sequence-to-sequence model is used to translate the vectorized logistics routing sequence to obtain a similar logistics routing sequence, which can be used for path planning in the future. The sequence-to-sequence model does not need to consider the sequence length and order, and each input corresponds to an output.
[0079] For the above logistics routing sequence generation method, after vectorizing the already occurred logistics routing sequence, a vectorized logistics routing sequence is obtained. Then, the vectorized logistics routing sequence is input into the encoder to obtain a fixed-length vector, and the fixed-length vector is input into the decoder to obtain a logistics routing sequence similar to the input vectorized logistics routing sequence. By first vectorizing the obtained logistics routing sequence and then using the vectorized logistics sequence to generate a similar logistics routing sequence, the calculation complexity can be reduced, the scale can be reduced, and at the same time, it does not need to rely on personal experience and has high flexibility.
[0080] Further, in one embodiment, as Figure 4 shown, the training of the translation model includes step S410: obtaining a sample logistics routing sequence, where the sample logistics routing sequence is the logistics routing sequence that occurred within a preset historical time period; step S420: constructing a sequence-to-sequence translation model architecture, training the translation model architecture based on the sample logistics routing sequence, and stopping the training when the termination condition is met to obtain a sequence-to-sequence translation model.
[0081] Among them, the preset historical time period can be set according to the actual situation. For example, it can be set to the past 6 months, 12 months, or 24 months, etc.; the preset historical time period can be set in advance; it can also be set during the training of the model. For example, when obtaining samples, the user inputs the time range of the data to be obtained, and the historical logistics routing sequence within this time range is obtained as the sample logistics routing sequence at the corresponding path. In one embodiment, the sample logistics routing sequence can be obtained from a preset database. It can be understood that in other embodiments, the sample logistics routing sequence can also be obtained through other means.
[0082] In one embodiment, the sequence-to-sequence translation model architecture includes an encoder and a decoder. The training of the model mainly needs to consider three parts: the input of the encoder, the input of the decoder, and the output of the decoder. Among them, the input of the encoder: the dataset of the sequence task is mainly divided into the original sequence and the transformed sequence. For example, in this embodiment, the input of the LSTM (Long Short-Term Memory) of the encoder is the vector corresponding to the historical logistics routing sequence. In this embodiment, the input of the decoder is the output of the encoder; the output of the decoder is a vectorized routing sequence similar to the vector corresponding to the historical logistics reason sequence.
[0083] The termination condition is the termination condition for the model training. In a specific embodiment, the training termination condition of the sequence-to-sequence translation model is set to until the loss function index used to judge that the model output is close to the sample data reaches an empirical value (for example: the loss function index reaches 0.01); in other embodiments, the termination condition can also be set to other conditions.
[0084] Among them, in one embodiment, as Figure 5 shown, constructing the sequence-to-sequence translation model architecture includes steps S421 to S423.
[0085] Step S421, constructing an initial encoder based on the long short-term memory network.
[0086] Among them, the long short-term memory network (LSTM) is a type of recurrent neural network for time series, which is specifically designed to solve the long-term dependence problem existing in general RNNs. All RNNs have a chain form of repeating neural network modules.
[0087] Step S422: Construct an initial decoder based on the long short-term memory network.
[0088] Step S423: Concatenate the output of the initial encoder as the input of the initial decoder, and add correction logic outside the concatenated model to obtain a sequence translation model architecture.
[0089] Concatenating the output of the initial encoder as the input of the initial decoder includes: Assembling the above-implemented model components into a sequence-to-sequence (Seq2Seq) translation model in the following order: the routed sequence of input vectorization, the encoder, a fixed-length vector, the decoder, and the output vectorized sequence. Further, after obtaining the sequence-to-sequence translation model architecture by concatenation, add a section of correction logic outside to correct the parameters of the encoder and decoder according to the training data.
[0090] In this embodiment, by constructing an initial encoder and an initial decoder, and concatenating the initial encoder and the initial decoder in a certain order, training the obtained sequence-to-sequence model architecture based on the sample logistics routing sequence, and stopping training when the termination condition is reached, a sequence-to-sequence translation model can be obtained, which can be used to translate the input logistics routing sequence to obtain a new sequence similar to the original sequence.
[0091] In a specific embodiment, the above method for generating a logistics routing sequence includes the following steps:
[0092] Obtain historical logistics routes to form a historical logistics route sequence; read each network point code in each historical logistics route sequence respectively.
[0093] Vectorize each network point code using the constructed word vector model to obtain the word vector corresponding to each network point code, and replace the network point codes in each historical logistics route sequence with the corresponding word vectors respectively to obtain the corresponding vectorized historical logistics route sequence. Among them, constructing the word vector model includes: making a network point code dictionary; the network point code dictionary collects all network point codes in the country; constructing a Word2Vec word vector model based on the network point code dictionary; this model will generate a word space that can reflect the similarity between network point codes according to all existing routing sequences, and this space contains the entire network point code dictionary, and its manifestation form is the vectorized representation of the network point code, that is, the word vector of the network point code.
[0094] Use the vectorized historical logistics routing sequence as the input to the trained sequence-to-sequence translation model to obtain the new sequence output by the sequence-to-sequence translation model, that is, the vectorized similar logistics routing sequence; convert the vectorized similar logistics routing sequence to obtain a logistics routing sequence similar to the historical logistics routing sequence.
[0095] Among them, the construction of the sequence-to-sequence translation model includes the steps of: ① constructing an encoder based on the LSTM network; the input of this encoder is the vectorized routing sequence, and its output is a vector of a fixed length; ② constructing a decoder based on the LSTM network; the input of this decoder is the fixed-length vector output by the encoder, and its output is a vectorized sequence similar to the encoder input; ③ using an assembly logic to connect the encoder and the decoder and assemble them into a sequence-to-sequence translation model architecture; (where the assembly logic mainly assembles the above-implemented model components into a sequence-to-sequence translation model in the following order: input vectorized routing sequence, encoder, fixed-length vector, decoder, output vectorized sequence); ④ after assembling the sequence-to-sequence translation model architecture, add a correction logic outside to correct the parameters of the encoder and the decoder according to the training data; ⑤ train the sequence-to-sequence translation model architecture based on the sample logistics routing sequence until the loss function index used to judge that the model is close to the training data reaches an empirical value (for example: the loss function index reaches 0.01). As Figure 6 shown in the structural schematic diagram of the sequence-to-sequence translation model.
[0096] In this embodiment, by generating the routing sequence first and then concatenating it, the scale of routing concatenation is reduced, and at the same time, time and computing power resources are saved; using the encoder-decoder intermediate vector as the abstract representation of the routing sequence information ensures the similarity between the new sequence and the original sequence, thus ensuring the executability of the new sequence; the translation model generates a new sequence similar to the original sequence, and the new route concatenated therefrom is similar to the original route; and the new route similar to the existing route is an important basis for route optimization. The routing sequence produced by the above routing sequence generation method can be used as the input of the routing optimization model to provide support for downstream projects.
[0097] It should be understood that although the steps in the respective flowcharts involved in the above embodiments are shown in sequence according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless there is a clear indication in this article, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, at least a part of the steps in the respective flowcharts involved in the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily executed at the same moment, but can be executed at different moments. The execution order of these steps or stages is not necessarily sequential, but can be executed alternately or in turns with at least a part of other steps or steps or stages in other steps.
[0098] In one embodiment, as Figure 7 shown, a logistics routing sequence generation device is provided, including: an acquisition module 710, a network point code reading module 720, a vectorization module 730, and a similar logistics routing sequence generation module 740, where:
[0099] The acquisition module 710 is configured to acquire historical logistics routing sequences.
[0100] The network point code reading module 720 is configured to read the network point codes of each logistics network point included in the historical logistics routing sequence.
[0101] The vectorization module 730 is configured to vectorize each network point code in the historical logistics routing sequence respectively to generate a vectorized logistics routing sequence.
[0102] The similar logistics routing sequence generation module 740 generates a similar logistics routing sequence corresponding to the vectorized logistics routing sequence.
[0103] The above logistics routing sequence generation device, after vectorizing the already occurred logistics routing sequence, obtains a vectorized logistics routing sequence, then inputs the vectorized logistics routing sequence into an encoder to obtain a fixed-length vector, and inputs the fixed-length vector into a decoder to obtain a logistics routing sequence similar to the input vectorized logistics routing sequence. By first vectorizing the acquired logistics routing sequence and then using the vectorized logistics sequence to generate a similar logistics routing sequence similar to it, the above device can reduce the computational complexity, thereby reducing the scale, and at the same time does not need to rely on personal experience and has high flexibility.
[0104] In one embodiment, the similar logistics routing sequence generation module 740 includes: an input unit for inputting the vectorized logistics routing sequence into the sequence-to-sequence translation model determined through training; a translation result acquisition unit for acquiring the vectorized similar logistics routing sequence output by the sequence-to-sequence translation model; in this embodiment, the similar logistics routing sequence generation module is specifically configured to: obtain the similar logistics routing sequence based on the vectorized similar logistics routing sequence.
[0105] In one embodiment, the vectorization module 730 includes: an input unit for respectively inputting each network point code into the word vector model; wherein, the word vector model is constructed based on all network point codes; a word vector acquisition unit for acquiring the word vectors corresponding to each network point code output by the word vector model; a replacement unit for respectively replacing the corresponding network point codes in the historical logistics routing sequence with word vectors to obtain the vectorized logistics routing sequence corresponding to the historical logistics routing sequence.
[0106] In one embodiment, the sequence-to-sequence translation model includes an encoder and a decoder; in this embodiment, the above-mentioned similar logistics routing sequence generation module 740 is specifically configured to: input the vectorized logistics routing sequence into the encoder to obtain a fixed-length intermediate vector; input the intermediate vector into the decoder to obtain the vectorized similar logistics routing sequence output by the decoder.
[0107] In one embodiment, the above-mentioned device further includes a training model, including a sample acquisition unit for: acquiring sample logistics routing sequences, where the sample logistics routing sequences are the logistics routing sequences that occurred within a preset historical time period; a training unit for constructing a sequence-to-sequence translation model architecture, training the translation model architecture based on the sample logistics routing sequences, and stopping training when the termination condition is met to obtain the sequence-to-sequence translation model.
[0108] In one embodiment, the training unit of the above-mentioned device includes an encoder construction subunit for constructing an initial encoder based on a long short-term memory network; a decoder construction subunit for constructing an initial decoder based on a long short-term memory network; a splicing subunit for splicing the output of the initial encoder as the input of the initial decoder, and adding correction logic outside the spliced model to obtain the sequence translation model architecture.
[0109] For the specific limitations of the logistics routing sequence generation device, reference can be made to the limitations of the logistics routing sequence generation method in the above text, which will not be elaborated here. Each module in the above-mentioned logistics routing sequence generation device can be implemented in whole or in part through software, hardware, and their combination. The above-mentioned modules can be embedded in the processor of the computer device in hardware form or be independent of it, or can be stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to the above-mentioned modules.
[0110] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in Figure 8 . The computer device includes a processor, a memory, a communication interface, a display screen, and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner. The wireless manner can be implemented through WIFI, a carrier network, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a method for generating a logistics routing sequence. The display screen of the computer device may be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device may be a touch layer covering the display screen, or a button, a trackball, or a touchpad provided on the housing of the computer device, or an external keyboard, a touchpad, or a mouse, etc.
[0111] Those skilled in the art can understand that Figure 8 the structure shown in
[0112] is only a block diagram of some structures related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.
[0113] Obtain a historical logistics routing sequence; read the network point codes of each logistics network point included in the historical logistics routing sequence; respectively vectorize the network point codes in the historical logistics routing sequence to generate a vectorized logistics routing sequence; based on the vectorized logistics routing sequence, generate a similar logistics routing sequence corresponding to the vectorized logistics routing sequence.
[0114] In one embodiment, when the processor executes the computer program, the following steps are further implemented: input the vectorized logistics routing sequence into a sequence-to-sequence translation model determined through training; obtain the vectorized similar logistics routing sequence output by the sequence-to-sequence translation model; obtain a similar logistics routing sequence based on the vectorized similar logistics routing sequence.
[0115] In one embodiment, when the processor executes the computer program, the following steps are further implemented: input each network point code into the word vector model respectively; wherein, the word vector model is constructed based on all network point codes; obtain the word vectors corresponding to each network point code output by the word vector model; replace the corresponding network point codes in the historical logistics routing sequence with the word vectors respectively to obtain the vectorized logistics routing sequence corresponding to the historical logistics routing sequence.
[0116] In one embodiment, when the processor executes the computer program, the following steps are further implemented: input the vectorized logistics routing sequence into the encoder to obtain an intermediate vector with a fixed length; input the intermediate vector into the decoder to obtain the vectorized similar logistics routing sequence output by the decoder.
[0117] In one embodiment, when the processor executes the computer program, the following steps are further implemented: obtain the sample logistics routing sequence, where the sample logistics routing sequence is the logistics routing sequence that occurred within a preset historical time period; construct the sequence-to-sequence translation model architecture, train the translation model architecture based on the sample logistics routing sequence, and stop training when the termination condition is met to obtain the sequence-to-sequence translation model.
[0118] In one embodiment, when the processor executes the computer program, the following steps are further implemented: construct an initial encoder based on the long short-term memory network; construct an initial decoder based on the long short-term memory network; splice the output of the initial encoder as the input of the initial decoder, and add correction logic outside the spliced model to obtain the sequence translation model architecture.
[0119] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by the processor, the following steps are implemented:
[0120] Obtain the historical logistics routing sequence; read the network point codes of each logistics network point included in the historical logistics routing sequence; vectorize each network point code in the historical logistics routing sequence respectively to generate a vectorized logistics routing sequence; generate a similar logistics routing sequence corresponding to the vectorized logistics routing sequence based on the vectorized logistics routing sequence.
[0121] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: input the vectorized logistics routing sequence into the sequence-to-sequence translation model determined through training; obtain the vectorized similar logistics routing sequence output by the sequence-to-sequence translation model; obtain the similar logistics routing sequence based on the vectorized similar logistics routing sequence.
[0122] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: inputting each network point code into a word vector model respectively; wherein, the word vector model is constructed based on all network point codes; obtaining the word vectors corresponding to each network point code output by the word vector model; respectively replacing the corresponding network point codes in the historical logistics routing sequence with the word vectors to obtain a vectorized logistics routing sequence corresponding to the historical logistics routing sequence.
[0123] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: inputting the vectorized logistics routing sequence into an encoder to obtain an intermediate vector with a fixed length; inputting the intermediate vector into a decoder to obtain a vectorized similar logistics routing sequence output by the decoder.
[0124] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: obtaining a sample logistics routing sequence, where the sample logistics routing sequence is a logistics routing sequence that occurred within a preset historical time period; constructing a sequence-to-sequence translation model architecture, training the translation model architecture based on the sample logistics routing sequence, and stopping the training when a termination condition is met to obtain a sequence-to-sequence translation model.
[0125] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: constructing an initial encoder based on a long short-term memory network; constructing an initial decoder based on a long short-term memory network; splicing the output of the initial encoder as the input of the initial decoder, and adding a correction logic outside the spliced model to obtain a sequence translation model architecture.
[0126] Those of ordinary skill in the art can understand that all or part of the processes of implementing the methods in the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, storage, database, or other medium used in the various embodiments provided in the present application can include at least one of non-volatile and volatile memories. Non-volatile memories can include read-only memory (ROM), magnetic tapes, floppy disks, flash memories, or optical memories, etc. Volatile memories can include random access memory (RAM) or external cache memories. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.
[0127] The technical features of the above embodiments can be combined arbitrarily. For the sake of concise description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope described in this specification.
[0128] The above embodiments only express several implementation manners of the present application, and the description is relatively specific and detailed. However, it should not be understood as a limitation to the scope of the invention patent. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the appended claims.
Claims
1. A method for generating a logistics routing sequence, characterized in that, the method includes: Obtain the historical logistics routing sequence; Read the network codes of each logistics network point included in the historical logistics routing sequence; Vectorize each of the network codes in the historical logistics routing sequence respectively to generate a vectorized logistics routing sequence; Based on the vectorized logistics routing sequence, generate a similar logistics routing sequence corresponding to the vectorized logistics routing sequence, wherein, based on the vectorized logistics routing sequence, generating a similar logistics routing sequence corresponding to the vectorized logistics routing sequence includes: Input the vectorized logistics routing sequence into a sequence-to-sequence translation model determined by training; Obtain the vectorized similar logistics routing sequence output by the sequence-to-sequence translation model; Obtain the similar logistics routing sequence based on the vectorized similar logistics routing sequence.
2. The method according to claim 1, characterized in that, the step of respectively vectorizing each of the network codes in the historical logistics routing sequence to generate a vectorized logistics routing sequence includes: Input each of the network codes into a word vector model respectively; wherein, the word vector model is constructed based on all network codes; Obtain the word vectors corresponding to each of the network codes output by the word vector model; Replace the corresponding network codes in the historical logistics routing sequence with the word vectors respectively to obtain the vectorized logistics routing sequence corresponding to the historical logistics routing sequence.
3. The method according to claim 1, characterized in that, the sequence-to-sequence translation model includes an encoder and a decoder; Input the vectorized logistics routing sequence into a sequence-to-sequence translation model determined by training, and obtain the vectorized similar logistics routing sequence output by the sequence-to-sequence translation model, including: Input the vectorized logistics routing sequence into the encoder to obtain an intermediate vector of a fixed length; Input the intermediate vector into the decoder to obtain the vectorized similar logistics routing sequence output by the decoder.
4. The method according to claim 1, characterized in that, the training of the translation model includes the steps: Obtain a sample logistics routing sequence, where the sample logistics routing sequence is the logistics routing sequence that occurred within a preset historical time period; Construct a sequence-to-sequence translation model architecture, train the translation model architecture based on the sample logistics routing sequence, and stop training when the termination condition is met to obtain the sequence-to-sequence translation model.
5. The method according to claim 4, characterized in that, the constructing of the sequence-to-sequence translation model architecture includes: Construct an initial encoder based on a long short-term memory network; Construct an initial decoder based on a long short-term memory network; Splice the output of the initial encoder as the input of the initial decoder, and add a correction logic outside the spliced model to obtain the sequence translation model architecture.
6. A device for generating a logistics routing sequence, characterized in that, the device includes: An obtaining module for obtaining the historical logistics routing sequence; A network code reading module for reading the network codes of each logistics network point included in the historical logistics routing sequence; A vectorization module, configured to vectorize each of the network point codes in the historical logistics routing sequence respectively to generate a vectorized logistics routing sequence; A similar logistics routing sequence generation module, configured to generate a similar logistics routing sequence corresponding to the vectorized logistics routing sequence, wherein the similar logistics routing sequence generation module includes: An input unit, configured to input the vectorized logistics routing sequence into a sequence-to-sequence translation model determined through training; A translation result acquisition unit, configured to acquire the vectorized similar logistics routing sequence output by the sequence-to-sequence translation model; The similar logistics routing sequence generation module is specifically configured to: obtain the similar logistics routing sequence based on the vectorized similar logistics routing sequence.
7. The apparatus according to claim 6, wherein, the vectorization module includes: An input unit, configured to input each of the network point codes into a word vector model respectively; wherein the word vector model is constructed based on all network point codes; A word vector acquisition unit, configured to acquire the word vectors corresponding to each of the network point codes output by the word vector model; A replacement unit, configured to replace the corresponding network point codes in the historical logistics routing sequence with the word vectors respectively to obtain the vectorized logistics routing sequence corresponding to the historical logistics routing sequence.
8. The apparatus according to claim 6, wherein, the sequence-to-sequence translation model includes an encoder and a decoder; the similar logistics routing sequence generation module is further configured to: Input the vectorized logistics routing sequence into the encoder to obtain an intermediate vector with a fixed length; input the intermediate vector into the decoder to acquire the vectorized similar logistics routing sequence output by the decoder.
9. A computer device, including a memory and a processor, the memory stores a computer program, wherein, when the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.
10. A computer-readable storage medium, on which a computer program is stored, wherein, when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Path planning prediction method, device and equipment and computer readable storage medium
CN110348636A
Method for processing logistics package delivery route, and related device
US20190370747A1