Order dispatching method, device and storage medium
Through two-stage fast heuristic order dispatching methods, clustering and cost matrix optimization, the problems of inaccurate order dispatching and long calculation time in the existing technology are solved, and more accurate and efficient rider order allocation is achieved, improving user experience and System efficiency.
Patent Information
- Application Number
- CN202110040388.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-13
- Publication Date
- 2024-12-13
- Estimated Expiration
- 2041-01-13
AI Technical Summary
The existing greedy heuristic algorithm cannot accurately evaluate delivery costs, resulting in inaccurate order delivery results, which increases the problem of rider capacity waste and reduced user experience. The calculation time increases exponentially with the increase of path task points, resulting in a relatively large order delivery time. long.
Using a two-stage fast heuristic order dispatch method, cluster filtering, build a cost matrix, select the minimum cost category order to deliver it to the best rider, and update the cost matrix until Iterate through all categories.
It improves the accuracy and efficiency of order assignments, reduces the system order assignment time, improves the operating efficiency and user experience of the distribution and scheduling system, and reduces the proportion of serious timeouts.
Smart Images

Figure CN112749899B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to dispatching order technology, and in particular to a dispatching order method, device and storage medium. Background Art
[0002] The main features of food delivery are high concurrency and low latency. In the intelligent rider dispatching system, new orders need to be assigned to the most suitable rider in real time. Riders usually carry multiple orders. Before dispatching new orders, it is necessary to calculate the old orders and possible new orders of the current rider, and select the orders with the least timeout and the shortest distance according to the cost matrix results and assign them to the corresponding riders. Therefore, the definition of the cost matrix has an important impact on the accuracy of dispatching orders in the dispatching system.
[0003] The existing order allocation method uses a greedy heuristic method, taking the sum of the total timeout duration of all pick-up and delivery tasks in the rider's execution path and the total distance as the objective function, and calculates the cost matrix between the unassigned orders and the available riders at the current moment to find the minimum value of the objective function and assign the order to the most suitable rider. Then, the assigned orders are deleted and the cost matrix is updated until all unassigned orders are traversed.
[0004] In actual delivery scenarios, because the timeliness requirements of orders vary and there is a correlation between regional transportation capacity and time, the actual delivery situation becomes complicated. The existing greedy-based heuristic algorithm cannot accurately evaluate the cost of delivery, and thus cannot provide an accurate basis for dispatching orders, resulting in inaccurate dispatch results. This will reduce the operating efficiency of the scheduling system, waste rider capacity, and reduce user experience. The existing delivery dispatch method also has the problem of long computing time, that is, the computing time increases exponentially with the increase of task points in the path. If there are too many task points in the path, the computing time will be very long, which will lead to a long dispatch time. Summary of the invention
[0005] The embodiments of the present invention provide a dispatching method, device and storage medium, which can improve the accuracy of dispatching, reduce the dispatching time of the system, improve the delivery efficiency of the delivery dispatching system, and improve the user experience.
[0006] This proposal proposes a drug delivery dispatching method based on a two-stage fast heuristic.
[0007] A first aspect of an embodiment of the present invention provides an order dispatching method, comprising:
[0008] Get the remaining assessment time and available riders for each currently unassigned order;
[0009] The unassigned orders are taken as nodes, each node is clustered according to its own category, and orders with only one node and a remaining assessment time greater than a preset value are filtered out to obtain a final clustering of orders;
[0010] Based on the final clustering and available riders, a cost matrix is obtained. After delivering the order of the category corresponding to the minimum cost to the best rider selected from the cost matrix, the cost matrix is updated until all categories are traversed.
[0011] Optionally, in a possible implementation manner of the first aspect, the obtaining of the remaining assessment time of each current unassigned order includes:
[0012] Obtain the estimated time of arrival ETA of the order and the current time T, and calculate the remaining assessment time auditTime based on the following formula
[0013] auditTime = ETA – T.
[0014] Optionally, in a possible implementation manner of the first aspect, obtaining the remaining assessment time of each current unassigned order and available riders includes:
[0015] Obtain the number of orders carried by each rider at the current moment, and use the riders with the number of orders carried less than the preset amount as available riders.
[0016] Optionally, in a possible implementation manner of the first aspect, taking the unassigned orders as nodes, clustering each node according to its own category, and filtering out the orders with only one node and the remaining assessment time greater than the preset value to obtain the final clustering of the orders includes:
[0017] Take the current unassigned orders as nodes, and set the constraint condition of the node as the weighted sum of the range and the remaining assessment time. The formula is as follows
[0018] D = λ1dist + λ2auditTime
[0019] where dist is the clustering range, and λ1 and λ2 are weight parameters respectively;
[0020] Cluster each node according to its own category through the following steps, including:
[0021] Select any node i. If node i has no category, generate a new category for node i and become the center point of this category;
[0022] If node j is not grouped and dij < D, then assign j to class i;
[0023] If node j is assigned to class k and j is not the clustering center, if dij < dkj, then reassign j to class i.
[0024] Filter out the orders with only one node in the class and auditTime > 60min.
[0025] Optionally, in a possible implementation manner of the first aspect, obtaining a cost matrix based on the final clustering and available riders, and delivering the category order corresponding to the minimum cost to the best rider selected by the cost matrix for delivery includes:
[0026] The set of j categories is {C1, C2,…, C j}, the set of currently available riders is {C1, C2,…, R i}, calculated by the following function,
[0027]
[0028] Among them, ETR is the estimated delivery time given by the path planning module; Δdist is the distance increment, which is the distance of the order farthest from the merchant in the cluster category; the objective function is the sum of the distance increment and the total timeout risk;
[0029] The rider corresponding to the minimum objective function value is selected as the best rider for delivery.
[0030] A second aspect of an embodiment of the present invention provides an order dispatching device, including:
[0031] The acquisition module is used to obtain the remaining assessment time and available riders for each currently unassigned order;
[0032] A clustering module is used to take the unassigned orders as nodes, cluster each node according to its own category, filter out orders with only one node and a remaining assessment time greater than a preset value, and obtain a final clustering of orders;
[0033] The calculation module is used to obtain a cost matrix based on the final clustering and the available riders, deliver the category order corresponding to the minimum cost to the best rider selected by the cost matrix for delivery, and update the cost matrix until all categories are traversed.
[0034] Optionally, in a possible implementation manner of the second aspect, the acquisition module includes:
[0035] The calculation unit is used to obtain the estimated arrival time ETA of the order and the current time T, and calculate the remaining audit time auditTime based on the following formula:
[0036] auditTime=ETA–T.
[0037] Optionally, in a possible implementation manner of the second aspect, the acquisition module includes:
[0038] The screening unit is used to obtain the number of orders each rider has at the current moment, and to identify riders whose number of orders is less than a preset amount as available riders.
[0039] According to a third aspect of an embodiment of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the data migration method described in any one of the first aspects above.
[0040] According to a fourth aspect of an embodiment of the present invention, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor executes the data migration method described in any one of the first aspects above.
[0041] The present invention provides a dispatching method, device and storage medium. The dispatching results are more in line with the rider's behavior habits, improving the rider experience and the efficiency of the rider in performing the delivery task. In addition, the dispatching objective function is more accurately estimated, the dispatching results are more accurate and optimized, the KPI indicators of the scheduling system are improved, and the on-time rate of order delivery is improved, and the proportion of bad cases with serious timeouts is reduced. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 A flowchart of a first implementation method of the dispatching method;
[0043] Figure 2 A flow chart of a second implementation method of the dispatching method;
[0044] Figure 3 This is a structural diagram of the first implementation of the dispatching device. DETAILED DESCRIPTION
[0045] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0046] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present invention and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in sequences other than those illustrated or described herein.
[0047] It should be understood that in various embodiments of the present invention, the size of the sequence number of each process does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0048] It should be understood that in the present invention, "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or apparatus comprising a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to these processes, methods, products or apparatuses.
[0049] It should be understood that in the present invention, "plurality" refers to two or more than two. "And / or" is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "Contains A, B and C", "Contains A, B, C" means that A, B, and C are all included, "Contains A, B or C" means that one of A, B, and C is included, and "Contains A, B and / or C" means that any one, any two, or any three of A, B, and C are included.
[0050] It should be understood that in the present invention, "B corresponding to A", "B corresponding to A", "A corresponds to B" or "B corresponds to A" means that B is associated with A and B can be determined based on A. Determining B based on A does not mean determining B based only on A, but B can also be determined based on A and / or other information. A and B match when the similarity between A and B is greater than or equal to a preset threshold.
[0051] Depending on the context, "if" as used herein may be interpreted as "when" or "when" or "in response to determining" or "in response to detecting."
[0052] The technical solution of the present invention is described in detail with specific embodiments below. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
[0053] The present invention provides a first implementation method of a dispatching method, such as Figure 1As shown in the figure, before the algorithm is executed, initialization operations are required: according to business requirements, riders who do not meet the constraints are filtered out. The first stage is the order package module: input the currently unassigned orders, and use the hierarchical clustering algorithm based on geographic information to obtain the classification information of the orders. The second stage is the dispatch module: calculate the cost matrix formed by the clustering classification results of the orders in the first stage and the riders at the current moment, evaluate the minimum cost, and update the cost matrix until all order categories are traversed.
[0054] Compared with the existing technology, this solution has improvements in the following aspects:
[0055] 1) Rider efficiency dimension: The dispatch results are more in line with the rider’s behavior habits, improving the rider experience and the efficiency of the rider in performing delivery tasks;
[0056] 2) Dispatching system dimension: The dispatching objective function is estimated more accurately, the dispatching results are more accurate and optimized, and the dispatching system KPI indicators are improved;
[0057] 3) User experience dimension: Improve the on-time delivery rate of orders and reduce the proportion of bad cases with serious timeouts.
[0058] The present invention provides a second implementation of a dispatch method, such as Figure 2 As shown, including:
[0059] Step S110: Obtain the remaining assessment time and available riders for each currently unassigned order.
[0060] In step S110, it also includes:
[0061] Step S1101: Obtain the estimated arrival time ETA of the order and the current time T, and calculate the remaining audit time auditTime based on the following formula:
[0062] auditTime=ETA–T;
[0063] Step S1102: Obtain the number of orders that each rider is carrying at the current moment, and consider the riders whose number of orders is less than the preset amount as available riders.
[0064] Step S120: take the unassigned orders as nodes, cluster each node according to its own category, filter out orders with only one node and a remaining assessment time greater than a preset value, and obtain a final clustering of orders.
[0065] In step S120, it also includes:
[0066] Take the currently unassigned orders as nodes, and set the node constraints to be the weighted sum of the range and the remaining assessment time. The formula is as follows:
[0067] D = λ1dist + λ2auditTime
[0068] Wherein, dist is the clustering range, and λ1 and λ2 are weight parameters respectively;
[0069] Cluster each node according to its own category through the following steps, including:
[0070] Select any node i. If node i has no category, generate a new category for node i and become the center point of this category;
[0071] If node j is not grouped and dij < D, then assign j to class i;
[0072] If node j is assigned to class k and j is not the clustering center, if dij < dkj, then reassign j to class i.
[0073] Filter out orders with only one node in the category and auditTime > 60min.
[0074] Step S130: Based on the final clustering and available riders, obtain a cost matrix. After delivering the orders of the category corresponding to the minimum cost to the best rider selected by the cost matrix for distribution, update the cost matrix until all categories are traversed.
[0075] In step S130, it also includes:
[0076] The obtaining the cost matrix based on the final clustering and available riders and delivering the orders of the category corresponding to the minimum cost to the best rider selected by the cost matrix for distribution includes:
[0077] The set of j categories is {C1, C2,..., C j}}, and the set of currently available riders is {R1, R2,..., R i}}, which is calculated through the following function
[0078]
[0079] Wherein, ETR is the estimated delivery time given by the path planning module; Δdist is the distance increment, that is, the distance of the order farthest from the merchant in the clustering category; the objective function is the sum of the distance increment and the total overtime risk;
[0080] Select the rider corresponding to the minimum objective function value as the best rider for distribution.
[0081] Calculate the cost matrix composed of clustering categories and available riders through the above steps, deliver the orders of the category corresponding to the minimum cost to the best rider for distribution, and then update the cost matrix until all categories are traversed. Achieve the update and optimization of the model while calculating the distribution.
[0082] A first implementation of a dispatching device provided by the present invention is as follows: Figure 3 As shown, including:
[0083] The acquisition module is used to obtain the remaining assessment time and available riders for each currently unassigned order;
[0084] A clustering module is used to take the unassigned orders as nodes, cluster each node according to its own category, filter out orders with only one node and a remaining assessment time greater than a preset value, and obtain a final clustering of orders;
[0085] The calculation module is used to obtain a cost matrix based on the final clustering and the available riders, deliver the category order corresponding to the minimum cost to the best rider selected by the cost matrix for delivery, and update the cost matrix until all categories are traversed.
[0086] In one embodiment, the acquisition module includes:
[0087] The calculation unit is used to obtain the estimated arrival time ETA of the order and the current time T, and calculate the remaining audit time auditTime based on the following formula:
[0088] auditTime=ETA–T.
[0089] In one embodiment, the acquisition module includes:
[0090] The screening unit is used to obtain the number of orders each rider has at the current moment, and to identify riders whose number of orders is less than a preset amount as available riders.
[0091] The technical solution provided by the present invention introduces and comprehensively considers multi-dimensional features such as orders, rider status, and merchants, and uses a hierarchical clustering algorithm based on geographic information. This method can make full use of clustering information and identify the differences between different scenarios, thereby improving the accuracy of dispatching orders and the KPI indicators of the dispatching system. This has the following advantages, including:
[0092] 1) Through the hierarchical clustering algorithm based on geographic information, the current orders are clustered into different classes, and the orders are processed according to the clustering results, which can reduce the calculation time and improve the efficiency of dispatching orders;
[0093] 2) Introducing multi-dimensional features to effectively identify complex scenes;
[0094] 3) Dynamically select the task points that meet the constraints before calling the model each time to ensure that the subsequent results fully meet the constraints;
[0095] 4) This proposal makes full use of global features such as the geographic information distribution of orders and the remaining assessment time, which is more in line with actual scenarios, reduces the proportion of bad cases, and is closer to the optimal solution.
[0096] Among them, the readable storage medium can be a computer storage medium or a communication medium. The communication medium includes any medium that facilitates the transmission of a computer program from one place to another. The computer storage medium can be any available medium that can be accessed by a general-purpose or special-purpose computer. For example, a readable storage medium is coupled to a processor so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can be located in an application-specific integrated circuit (Application Specific Integrated Circuits, abbreviated as: ASIC). In addition, the ASIC can be located in a user device. Of course, the processor and the readable storage medium can also exist in a communication device as discrete components. The readable storage medium can be a read-only memory (ROM), a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device, etc.
[0097] The present invention also provides a program product, which includes an execution instruction, which is stored in a readable storage medium. At least one processor of a device can read the execution instruction from the readable storage medium, and at least one processor executes the execution instruction so that the device implements the methods provided in the above various embodiments.
[0098] In the above-mentioned terminal or server embodiments, it should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the present invention may be directly implemented as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.
[0099] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for dispatching orders, characterized in that: Including: Obtain the remaining assessment time and available riders for each current unassigned order; Take the unassigned orders as nodes, cluster each node according to its own category, and filter out orders with only one node and a remaining assessment time greater than a preset value to obtain the final clustering of the orders, specifically including: Take the currently unassigned orders as nodes, and set the constraint condition of the node as the weighted sum of the range and the remaining assessment time. The formula is as follows: D = λ1dist + λ2auditTime Where dist is the clustering range, and λ1 and λ2 are weight parameters respectively; Cluster each node according to its own category through the following steps, including: Select any node i. If node i has no category, generate a new category for node i and become the center point of this category; If node j is not grouped and dij < D, then assign j to category i; If node j is assigned to category k and j is not the clustering center, if dij < dkj, then reassign j to category i; Filter out orders with only one node in the category and auditTime > 60min; Based on the final clustering and available riders, obtain a cost matrix. After delivering the orders of the category corresponding to the minimum cost to the best rider selected by the cost matrix, update the cost matrix until all categories are traversed, specifically including: The set of j categories is {C1,C2,…,C j }, the set of currently available riders is {R1, R2, …, R i }, calculated by the following function, Where ETR is the estimated delivery time given by the path planning module, and Δdist is the distance increment, that is, the distance of the order farthest from the merchant in the clustering category; the objective function is the sum of the distance increment and the total overtime risk; Select the rider corresponding to the minimum value of the objective function value as the best rider for delivery.
2. The order assignment method according to claim 1, wherein: The obtaining the remaining assessment time of each current unassigned order includes: Obtain the estimated arrival time ETA of the order and the current time T, and calculate the remaining assessment time auditTime based on the following formula: auditTime = ETA – T.
3. The order assignment method according to claim 1, wherein: Obtaining the remaining assessment time and available riders of each current unassigned order includes: Obtain the order volume carried by each rider at the current time, and take the riders with an order volume less than the preset volume as available riders.
4. A dispatching device, characterized in that: Including: An obtaining module for obtaining the remaining assessment time and available riders of each current unassigned order; A clustering module for taking the unassigned orders as nodes, clustering each node according to its own category, and filtering out orders with only one node and a remaining assessment time greater than a preset value to obtain the final clustering of the orders, specifically including: Take the currently unassigned orders as nodes, and set the constraint condition of the node as the weighted sum of the range and the remaining assessment time. The formula is as follows: D = λ1dist + λ2auditTime Where dist is the clustering range, and λ1 and λ2 are weight parameters respectively; Cluster each node according to its own category through the following steps, including: Select any node i. If node i has no category, generate a new category for node i and become the center point of this category; If node j is not grouped and dij < D, then assign j to class i; If node j is assigned to class k and j is not a clustering center, and if dij < dkj, then re-assign j to class i; Filter out orders with only one node in the class and auditTime > 60 min; A calculation module, configured to obtain a cost matrix based on the final clustering and available riders, deliver the order of the category corresponding to the minimum cost to the best rider selected by the cost matrix, and then update the cost matrix until all categories are traversed, specifically including: The set of j categories is {C1,C2,…,C j }, the set of currently available riders is {R1, R2, …, R i }, calculated by the following function, Wherein, ETR is the estimated delivery time given by the path planning module, and Δdist is the distance increment, that is, the distance of the order farthest from the merchant in the clustering category; the objective function is the sum of the distance increment and the total overtime risk; Select the rider corresponding to the minimum value of the objective function as the best rider for delivery.
5. The order dispatching device according to claim 4, wherein The obtaining module includes: A calculation unit, configured to obtain the estimated arrival time ETA of the order and the current time T, and calculate the remaining assessment time auditTime based on the following formula auditTime = ETA – T.
6. The order dispatching device according to claim 4, wherein The obtaining module includes: A screening unit, configured to obtain the order volume carried by each rider at the current time, and use the riders with an order volume less than the preset volume as available riders.
7. A readable storage medium, characterized in that: The readable storage medium stores a computer program, and when the computer program is executed by a processor, it is used to implement the method according to any one of claims 1 to 3.
8. An electronic device, characterized in that: Including: At least one processor; And a memory communicatively connected to the at least one processor; wherein, the memory stores a computer program executable by the at least one processor, and when the computer program is executed by the at least one processor, the at least one processor is caused to execute the method according to any one of claims 1 - 3.
