Order matching method and device, electronic equipment and computer storage medium
By performing order reallocation processing based on neighborhood search based on the greedy algorithm, the problem of order and delivery resource matching results falling into local optimality is solved, achieving better order-delivery resource matching results, and improving delivery experience and efficiency. .
Patent Information
- Application Number
- CN202411064605.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-05
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2044-08-05
AI Technical Summary
In the existing technology, the matching results between orders and delivery resources are prone to fall into local optimality, and the changes in order backing status of delivery resources cannot be effectively updated, resulting in inaccurate matching evaluation and failure to obtain the globally optimal order-delivery resource allocation result.
A greedy algorithm is used to construct the initial matching degree matrix. After obtaining the order pre-matching results through multiple rounds of matching, orders are reallocated based on neighborhood search, the matching degree matrix is updated, and neighborhood operators are used to perform perturbation transformation to find a better solution. Until the optimal order-delivery resource matching result is determined.
Through the post-adjustment process, it can better jump out of the local optimal solution, improve the quality and solution performance of order-delivery resource matching, and is suitable for large-scale order-resource matching scenarios.
Smart Images

Figure CN118586804A
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to an order matching method, an order matching device, an electronic device and a storage medium. Background Art
[0002] At present, instant delivery services are becoming more and more important in people's daily lives. For the dispatching system of instant delivery services, it is very important to handle the matching relationship between orders and delivery resources. However, in the instant delivery service scenario, new orders are generated every moment, and the location of delivery resources and the status of orders in delivery are constantly changing. With the widespread use of instant delivery services, the matching relationship between the huge number of orders and delivery resources is becoming more and more complex. The dispatching system needs to obtain the status information of the current orders and delivery resources in real time, and continuously match the orders to be allocated with appropriate delivery resources. Therefore, how to match orders with delivery resources is crucial to the final fulfillment quality of the order and the delivery experience of the riders as delivery resources.
[0003] In the prior art, a greedy strategy is usually used to quickly match orders and delivery resources. The greedy strategy includes evaluating the matching degree between orders and delivery resources, and assigning orders to the delivery resource with the highest current matching degree in each round of calculation, so as to quickly generate a better order allocation result. However, in the above greedy strategy, once an order is assigned to a delivery resource, it will no longer be reallocated, and the matching degree of the order to all the delivery resources on the current disk will not be updated. In actual applications, the order status of delivery resources will continue to change, which may lead to inaccurate evaluation of the matching degree of the initially assigned order to the delivery resource. Therefore, the final order-delivery resource allocation result is usually a local optimum.
[0004] Therefore, how to match orders with delivery resources to avoid falling into local optimality is a problem that needs to be solved.
[0005] The above information disclosed in the background technology section is only used to enhance the understanding of the background of this application. It may therefore include information that does not form the prior art already known to a person of ordinary skill in the art. Summary of the invention
[0006] The present application provides an order matching method to avoid the matching result between orders and delivery resources being limited to a local optimum. The present application also provides an order matching device, an electronic device, and a computer storage medium.
[0007] The present application provides an order matching method, comprising: obtaining orders to be allocated and alternative delivery resources, and constructing an initial matching degree matrix; wherein the elements of the matching degree matrix represent the matching degree of order-delivery resource pairs consisting of orders and corresponding delivery resources; performing multiple rounds of order-delivery resource matching based on a greedy algorithm and a matching degree matrix until the delivery resources to be allocated are determined for each order, and an order pre-matching result is obtained; performing at least one round of order reallocation based on a neighborhood search for the order pre-matching result, until an optimal order-delivery resource matching result is determined; wherein each round of order reallocation comprises: determining the delivery resources whose order backing status has changed in the current round, updating the matching degree of each order and the order-delivery resource pairs consisting of the delivery resources whose order backing status has changed, and obtaining the matching degree matrix of the current round; performing a neighborhood search on the order-delivery resource matching result of the previous round based on the matching degree matrix of the current round and a neighborhood operator, and obtaining a better order-delivery resource matching result of the current round.
[0008] Optionally, the matching matrix and neighborhood operator of the current round are used to perform a neighborhood search on the order-delivery resource matching results of the previous round to obtain a better order-delivery resource matching result for order reallocation in the current round, including: based on the matching matrix and neighborhood operator of the current round, a neighborhood transformation is performed on the order-delivery resource matching results of the previous round to obtain a neighborhood solution set for the current round; based on a preset acceptance criterion, a better solution is searched for from the neighborhood solution set; if a better solution for the current round is determined, the better solution is accepted and used as the better order-delivery resource matching result obtained for order reallocation in the current round, and the difference between the better solution of the current round and the better solution of the previous round is used to determine the delivery resources whose backorder status has changed in the next round.
[0009] Optionally, at least one round of neighborhood search-based order reallocation is performed on the order pre-matching results until the optimal order-delivery resource matching result is determined, including: if a preset exit condition is met or no better solution is found in the current round, the better solution of the most recent round is used as the optimal order-delivery resource matching result, and the optimal order-delivery resource matching result is used to allocate each order to the corresponding delivery resource.
[0010] Optionally, the neighborhood operator is an order transfer operator; wherein, the processing logic encapsulated by the order transfer operator includes: judging, for the order, based on the matching degree matrix of the current round of order reallocation, whether there is a better distribution resource with a greater matching degree than the distribution resource initially to be allocated; if so, transferring the order from the distribution resource currently to be allocated to the better distribution resource, thereby performing a perturbation transformation on the initial order-distribution resource matching result of the previous round, and obtaining its neighborhood solution set to find a better solution; wherein, the better distribution resource is used as the initial distribution resource to be allocated for the order in the next round of order reallocation processing.
[0011] Optionally, the order transfer operator executes a batch neighborhood transformation strategy, and the processing logic encapsulated by the order transfer operator specifically includes: simultaneously attempting to transfer the initially allocated distribution resources corresponding to all orders, so as to add disturbance to the initial order-distribution resource allocation result in the current round.
[0012] Optionally, the simultaneous transfer attempt of the initially allocated delivery resources corresponding to all orders includes: judging for each order whether there is a delivery resource with a greater matching degree based on the matching matrix of the current round of order reallocation; if so, transferring the order from the currently allocated delivery resource to the delivery resource with a greater matching degree.
[0013] Optionally, a round of neighborhood search-based order reallocation specifically includes: generating a possible matching set for each order based on the order transfer operator, the elements in the possible matching set representing the distribution resources that may correspond to the corresponding order; performing batch neighborhood transformation, including selecting the distribution resource with the greatest matching degree from the possible matching set of each order as the optimal distribution resource for the order in this round; processing the batch neighborhood transformation results, including for each order, if it is determined that the optimal distribution resource is not changed compared with the distribution resource originally to be allocated, retaining the original matching result; if it is determined that the optimal distribution resource is different from the distribution resource originally to be allocated, placing the matching result containing the optimal distribution resource as a better matching result into the better matching set; if it is determined that the better matching set is empty, ending the neighborhood search.
[0014] Optionally, it also includes: if it is determined that the better matching set is not empty, performing matching conflict resolution and updating the current order-delivery resource matching result; wherein, the matching conflict resolution includes: aggregating the better matching set based on the delivery resource identifier, and retaining the matching result with the highest matching degree for each delivery resource as the better matching set; wherein, updating the current order-delivery resource matching result includes: based on the better matching set after resolving the conflict, transferring the transferred order from the original delivery resource to the delivery resource corresponding to the better matching result, so that the order-delivery resource matching result is updated.
[0015] Optionally, the neighborhood operator is an order exchange operator; wherein the processing logic encapsulated by the order exchange operator includes: selecting two orders in the order and exchanging the delivery resources currently to be allocated to the two orders according to the matching matrix of the current round of order reallocation.
[0016] Optionally, the multiple rounds of order-delivery resource matching based on the greedy algorithm and the matching matrix include: each round of order-delivery resource matching includes selecting the order-delivery resource pair corresponding to the element with the largest matching degree from the matching degree matrix of the current round as the order pre-matching result of the current round; updating the matching degree matrix of the current round, and using the updated matching degree matrix as the matching degree matrix of the next round; wherein, updating the matching degree matrix of the current round includes: deleting the elements corresponding to the orders to which distribution resources are to be allocated in the current round in the matching degree matrix; using the distribution resources to be allocated in the current round as the distribution resources whose back-order status has changed, and updating the matching degrees of other orders to which distribution resources are not to be allocated in the current round corresponding to the distribution resources whose back-order status has changed.
[0017] The present application also provides an order matching device, comprising: an initialization unit, used to obtain orders to be assigned and alternative delivery resources, and construct an initial matching degree matrix; wherein the elements of the matching degree matrix represent the matching degree of an order-delivery resource pair consisting of an order and a corresponding delivery resource; a pre-matching unit, used to perform multiple rounds of order-delivery resource matching based on a greedy algorithm and a matching degree matrix, until the delivery resource to be assigned is determined for each order, and an order pre-matching result is obtained; a reallocation unit, used to perform at least one round of order reallocation based on a neighborhood search for the order pre-matching result, until the best order is determined. The reallocation unit comprises a matching degree updating subunit and a neighborhood searching subunit; the matching degree updating subunit is used to determine the distribution resources whose backorder status has changed in the current round, and to update the matching degree of each order-distribution resource pair consisting of the distribution resources whose backorder status has changed, so as to obtain the matching degree matrix of the current round; the neighborhood searching subunit is used to perform a neighborhood search on the order-distribution resource matching results of the previous round based on the matching degree matrix of the current round and the neighborhood operator, so as to obtain a more optimal order-distribution resource matching result of the current round.
[0018] The present application also provides an electronic device, comprising: a memory and a processor; the memory is used to store a computer program, and after the computer program is run by the processor, the method provided in the present application is executed.
[0019] The present application also provides a computer storage medium storing computer execution instructions, which are used to implement the method provided in the present application when executed by a processor.
[0020] Compared with the prior art, the present application has the following advantages: The present application provides an order matching method, device, electronic device and computer storage medium, which construct an initial matching degree matrix by obtaining orders to be allocated and alternative delivery resources; wherein the elements of the matching degree matrix represent the matching degree of order-delivery resource pairs consisting of orders and corresponding delivery resources; multiple rounds of order-delivery resource matching are performed based on a greedy algorithm and a matching degree matrix until the delivery resources to be allocated are determined for each order, and an order pre-matching result is obtained; at least one round of order reallocation based on neighborhood search is performed for the order pre-matching result until the optimal order-delivery resource matching result is determined; wherein each round of order reallocation includes: determining the delivery resources whose order backing status has changed in the current round, updating the matching degree of each order and the order-delivery resource pair consisting of the delivery resources whose order backing status has changed, and obtaining the matching degree matrix of the current round; based on the matching degree matrix of the current round and a neighborhood operator, a neighborhood search is performed on the order-delivery resource matching result of the previous round to obtain a better order-delivery resource matching result of the current round. After obtaining the order pre-matching results based on the greedy algorithm, an order reallocation processing flow based on neighborhood search is added. The order reallocation processing flow is a post-adjustment process after the greedy algorithm. It can adjust the order-delivery resource matching results representing the pre-allocation (or proposed allocation) obtained by the greedy algorithm, and better escape from the local optimum.
[0021] In a preferred method, a batch neighborhood transformation strategy is executed in the order reallocation process and the batch neighborhood transformation results are processed, including attempts to transfer all orders at the same time. If the better delivery resources for multiple orders are the same delivery resources, conflicts are resolved, which can greatly improve the solution performance of order-delivery resource matching and adapt to large-scale order-resource matching processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 It is a processing flow chart of an order matching method provided in the first embodiment of the present application.
[0023] Figure 2 This is a schematic diagram of an order pre-matching process provided in the first embodiment of the present application.
[0024] Figure 3 This is a schematic diagram of updating the matching degree matrix in the process of allocating the optimal rider in the order pre-matching process provided by the first embodiment of the present application.
[0025] Figure 4 This is a schematic diagram of an order matching process provided in the first embodiment of the present application.
[0026] Figure 5 This is a schematic diagram of an order matching process based on an order transfer operator provided in the first embodiment of the present application.
[0027] Figure 6 This is an order matching example provided in the first embodiment of the present application.
[0028] Figure 7 This is a schematic diagram of an order matching device provided in the second embodiment of the present application.
[0029] Figure 8 It is a schematic diagram of an electronic device provided by this application. DETAILED DESCRIPTION
[0030] Many specific details are described in the following description to facilitate a full understanding of the present application. However, the present application can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of the present application, so the present application is not limited by the specific implementation disclosed below.
[0031] The present application provides an order matching method, device, electronic device and computer storage medium, which are described one by one in the following embodiments.
[0032] For ease of understanding, the application scenario and related concepts of the order matching method are first given. This scenario is only an example scenario and is not intended to limit the method and its application scenario provided in this application.
[0033] The order matching method of the present application can be applied to delivery service scenarios, especially instant delivery service scenarios, to allocate orders to be delivered to alternative delivery resources. Delivery service scenarios include but are not limited to online shopping, take-out catering, errands and other delivery scenarios. The instant delivery service scenario is a delivery service scenario, which refers to a point-to-point / on-demand delivery scenario provided for take-out catering, instant shopping, emergency needs, etc. Delivery service scenarios generally involve delivery resources, users, merchants and platforms. Users use the client to conduct transactions with merchants through the platform, triggering the generation of orders; after the user successfully places an order, the platform matches the delivery resources for the instant order and assigns the order to the matched delivery resources; after the delivery resources undertake the delivery task of the order, they arrive at the pickup address to extract the items contained in the order, and deliver them to the delivery address after the extraction is successful. In this embodiment, the delivery resources refer to resources with delivery capabilities, including but not limited to riders, drones, unmanned vehicles, etc.
[0034] Solution space: the set of all possible solutions or solutions to a problem. In this application, it refers to the solution space of the order-delivery resource matching problem, that is, the set of all possible solutions or solutions to the order-delivery resource matching problem.
[0035] Global optimal solution: the optimal solution in the solution space of a problem, in this application, refers to the globally optimal order-delivery resource matching solution. Correspondingly, local optimal solution: refers to a non-globally optimal solution.
[0036] Greedy algorithm: A step-by-step solution algorithm that always makes the best choice at the moment during the solution process. The solution to the problem obtained based on this algorithm is usually a local optimal solution.
[0037] Neighborhood search: A search algorithm that obtains a set of neighborhood solutions by perturbing the solution to find a better solution.
[0038] It should be noted that the above disclosed information is only used to help understand the present application and does not mean to constitute the prior art known to ordinary technicians in the field. First embodiment
[0039] This embodiment provides an order matching method. After determining the order pre-matching result based on the greedy algorithm, the order pre-matching result is reallocated based on the neighborhood search, so as to adjust the order pre-matching result and better escape the local optimum. Furthermore, in the order reallocation process, a batch neighborhood transformation strategy is executed to try to transfer all orders at the same time, so as to improve the solution performance and adapt to the scenario of a large number of orders. Figures 1 to 6 The order matching method provided in the first embodiment of the present application is described.
[0040] Please refer to Figure 1 , which is an order matching method provided in an embodiment of the present application, comprising: steps S101 to S103.
[0041] Step S101: Obtaining orders to be allocated and alternative delivery resources, and constructing an initial matching matrix; wherein the elements of the matching matrix represent the matching degree of order-delivery resource pairs consisting of orders and corresponding delivery resources.
[0042] The order-delivery resource matching problem requires real-time acquisition of current disk information, and continuous matching of appropriate delivery resources for orders to be assigned based on the current disk information. Among them, the current disk information is the sum of information on which the order-delivery resource matching decision depends, including: status information of orders to be assigned, status information of alternative delivery resources, current overall environmental characteristics, etc. Taking takeaway orders as an example, the status information of the order includes whether the order has been served, the preparation time of the order, etc.; the status information of the delivery resource includes the current location of the rider, the status of the rider's order, the number of orders to be picked up by the rider, the number of orders to be delivered by the rider, the rider's order-carrying capacity, etc.; environmental characteristics include overall delivery pressure, weather conditions, overall traffic pressure, overall driving speed, etc. The rider is an embodiment of a delivery resource. The so-called order-carrying state refers to the situation of orders accepted by the delivery resource at the same time, such as the number of orders to be carried, the order-carrying time, etc. The so-called order-carrying capacity refers to the limit of the number of orders that the delivery resource accepts at the same time.
[0043] In this embodiment, the order pre-matching result is determined based on a greedy algorithm, and the order pre-matching result represents the distribution resource to be allocated to each order, which is a local optimal solution. After determining the order pre-matching result, the order pre-matching result is subjected to order reallocation based on a neighborhood search, and the order pre-matching result is adjusted to obtain a final order-distribution resource matching result, and the order is allocated to the distribution resource according to the final order-distribution resource matching result, thereby avoiding falling into a local optimal solution.
[0044] This step is to construct an initial matching matrix based on the current disk information to solve the above-mentioned order-delivery resource matching problem. The matching degree is an evaluation value of the degree of matching between an order and the corresponding delivery resource, that is, an evaluation value of an order-delivery resource pair consisting of an order and the corresponding delivery resource. The evaluation value is determined by comprehensively considering factors such as overtime risk, running distance, and delivery resource back-up capacity. The value of each element in the matching matrix represents the matching degree between the order and the delivery resource. For example, if there are n orders to be assigned to riders and m riders who can accept orders in the current time slice, an n*m-dimensional or m*n-dimensional matrix can be constructed as the initial matching matrix.
[0045] Step S102: performing multiple rounds of order-delivery resource matching based on the greedy algorithm and the matching degree matrix until the delivery resource to be allocated is determined for each order, and an order pre-matching result is obtained.
[0046] Among them, each round of order-delivery resource matching includes selecting the order-delivery resource pair corresponding to the element with the largest matching degree from the matching degree matrix of the current round as the order pre-matching result of the current round. The matching degree matrix of the current round is a matrix obtained by updating the matching degree matrix of the previous round.
[0047] This step is to use a greedy algorithm to iteratively perform the matching of orders and delivery resources for the matching matrix. In each round of iteration, the order with the highest matching degree in the matrix will be paired with the delivery resource, so as to realize the proposed allocation of all orders step by step, and quickly generate a better order pre-matching result. Specifically, the order-delivery resource matching based on the greedy algorithm and the matching degree matrix for multiple rounds includes: after selecting the order-delivery resource pair corresponding to the element with the largest matching degree from the matching degree matrix of the current round as the order pre-matching result of the current round, updating the matching degree matrix of the current round, and using the updated matching degree matrix as the matching degree matrix of the next round; wherein, updating the matching degree matrix of the current round includes: deleting the elements corresponding to the orders to be allocated with delivery resources in the matching degree matrix in the current round; using the delivery resources to be allocated in the current round as the delivery resources with changed order status, and updating the matching degree of other orders to which delivery resources are not to be allocated in the current round corresponding to the delivery resources with changed order status. In fact, when an order is assigned to a rider, the matching degree of other orders to the rider will change. For example, after an empty-loaded rider is assigned an order, other orders may become reverse orders for this rider, and the matching degree between the reverse order and the rider will be much lower than the matching degree when the rider is empty. Therefore, it is necessary to update the matching degree of other orders that are not to be assigned to this rider after the current round of orders are to be assigned. Among them, the deletion is to delete the relevant elements of the orders that have been planned to be assigned delivery resources from the matching degree matrix during the initial calculation of this round. For example, for an n*m dimensional matrix with n orders and m riders, delete the row corresponding to an order that has been planned to be assigned delivery resources, and update it to obtain a (n-1)*m dimensional matrix, and update the matching degree of the delivery resources to be assigned to the deleted order relative to other unassigned orders in the matrix, so as to obtain a matrix with updated values of one dimension and some elements, which serves as the initial matching degree matrix after entering the next round of iteration.
[0048] Please refer to Figure 2 , the figure shows a process of order pre-matching, including the following steps: S201: Initialize the matching matrix; S202: Determine whether the order has been allocated. If so, jump to S205; otherwise, execute S203; S203: Selecting the order-delivery resource pair with the greatest matching degree as the pre-matching result of this round; that is, the order in the order-delivery resource pair is to be allocated to the corresponding delivery resource therein; S204: updating the matching degree matrix; that is, deleting a row (or a column) of values corresponding to the order to be assigned in S203 from the matching degree matrix, and updating the matching degree values of other orders corresponding to the distribution resources to be assigned, specifically updating each value according to the current disk information; S205: Generate order pre-matching results, that is, all orders have been planned to be allocated delivery resources.
[0049] Please continue to refer to Figure 3 , the figure shows the matching degree matrix update process in the process of allocating the best rider in the order pre-matching process. The figure assumes that there are 3 orders to be allocated and 3 riders on the current board. In each round of pre-matching, the order-rider pair corresponding to the element with the largest matching degree (val) in the matrix is selected as the pre-matching result of the current round, and the assigned row of elements (that is, the related elements of the assigned order) is deleted, and the elements in the column of the rider to be currently assigned are updated. Finally, after several rounds of selection and update, each order is allocated to a suitable rider. In the figure, the initial val (2,3) is the largest, so order o2 is assigned to rider c3, and the row corresponding to order o2 is deleted, and so on.
[0050] Step S103: Perform at least one round of neighborhood search-based order reallocation for the order pre-matching results until the optimal order-delivery resource matching result is determined; wherein, each round of order reallocation includes: determining the delivery resources whose order status has changed in the current round, updating the matching degree of each order-delivery resource pair consisting of the delivery resources whose order status has changed, and obtaining the matching degree matrix of the current round; based on the matching degree matrix of the current round and the neighborhood operator, perform a neighborhood search on the order-delivery resource matching results of the previous round to obtain a better order-delivery resource matching result of the current round.
[0051] This step is an order reallocation process that adjusts the order pre-matching results obtained in step S102, in order to jump out of the local optimal solution, further improve the quality of order-delivery resource matching, and make the overall matching results more reasonable. Specifically, the order reallocation process includes a matching degree update process and a neighborhood search process. The matching degree update process is to re-evaluate the matching degree between the delivery resources and each order under the current delivery resource's back-order status. The neighborhood search process is to use the neighborhood search strategy to solve the order-delivery resource matching problem and adjust and optimize the order pre-matching results.
[0052] Among them, the matching degree update process in the order reallocation process includes the following processing: determine the distribution resources whose backorder status has changed in the current round, update the matching degree of each order-distribution resource pair consisting of the distribution resources whose backorder status has changed, and obtain the matching degree matrix of the current round. In other words, the matching degree of all orders to the distribution resources whose backorder status has changed will be updated, even if the order has been assigned to the distribution resource during the solution process. Therefore, in the calculation process of this update, the order will be removed from the distribution resource, and then the updated matching degree will be calculated based on the remaining backorders of the distribution resource.
[0053] Among them, the neighborhood search process in the order reallocation process includes the following processing: Based on the matching degree matrix and neighborhood operator of the current round, the neighborhood search is performed on the order-delivery resource matching results of the previous round to obtain a better order-delivery resource matching result of the current round. Specifically, based on the latest matching degree matrix, it is determined from the order perspective whether there is a delivery resource with a higher matching degree. If so, the order is transferred from the current delivery resource to be allocated to the better delivery resource.
[0054] Specifically, the matching degree matrix and the neighborhood operator of the current round are used to perform a neighborhood search on the order-delivery resource matching result of the previous round to obtain a better order-delivery resource matching result for order redistribution in the current round, including: Based on the matching degree matrix and neighborhood operator of the current round, the neighborhood transformation is performed on the order-delivery resource matching results of the previous round to obtain the neighborhood solution set of the current round; Based on the preset acceptance criteria, a better solution is sought from the neighborhood solution set. If a better solution for the current round is determined, the better solution is accepted and used as the better order-delivery resource matching result obtained by order reallocation in the current round. The difference between the better solution of the current round and the better solution of the previous round is used to determine the delivery resources whose order status has changed in the next round.
[0055] In this embodiment, the order reallocation process also includes an exit condition. Specifically, the order reallocation based on neighborhood search is performed for at least one round for the order pre-matching result until the optimal order-delivery resource matching result is determined, including: if the preset exit condition is met or a better solution is not found in the current round, the better solution in the most recent round is used as the optimal order-delivery resource matching result, and the optimal order-delivery resource matching result is used to allocate each order to the corresponding delivery resource. For example, the preset exit condition may be that a better solution cannot be found for a long time or timeout.
[0056] Please refer to Figure 4 , the figure shows an order matching process, including: S401: Obtaining order pre-matching results, which include each order to be allocated and the corresponding delivery resources to be allocated; S402: updating the matching degree of the rider whose order-taking status has changed to the order to be assigned; S403: Perform neighborhood search and adjust the order; for example, transfer or exchange the order; S404: Determine whether the order-delivery resource matching result has changed. If so, jump to S402; otherwise, execute S405; S405: Return the final order-delivery resource matching result, which is used to assign the order to the delivery resource.
[0057] The neighborhood operator is a way of perturbing the solution (specifically the order pre-matching result in this embodiment) in the neighborhood search to obtain a neighborhood solution set and find a better solution from it. The design of the neighborhood operator can be combined with specific application scenarios. For example, in the order-delivery resource matching scenario, neighborhood operators such as order transfer operators and / or order exchange operators can be used to perturb the solution.
[0058] In one embodiment, the neighborhood operator is an order transfer operator; wherein the processing logic encapsulated by the order transfer operator includes: according to the matching degree matrix of the current round of order reallocation, judging whether there is a better distribution resource with a greater matching degree than the distribution resource initially to be allocated for the order, and if so, transferring the order from the distribution resource currently to be allocated to the better distribution resource, thereby perturbing the initial order-distribution resource matching result of the previous round, and obtaining its neighborhood solution set to find a better solution; wherein the better distribution resource is used as the initial distribution resource to be allocated for the order in the next round of order reallocation processing. In one embodiment, the neighborhood operator is an order exchange operator; wherein the processing logic encapsulated by the order exchange operator includes: according to the matching degree matrix of the current round of order reallocation, selecting two orders in the order and exchanging the distribution resources currently to be allocated to the two orders. Different implementation methods can be combined with each other if there is no conflict.
[0059] In a preferred embodiment, the order transfer operator executes a batch neighborhood transformation strategy. The processing logic encapsulated by the order transfer operator specifically includes: simultaneously attempting to transfer the initially allocated distribution resources corresponding to all orders, so as to add disturbances to the initial order-distribution resource allocation results in the current round. During implementation, all orders will be attempted to be transferred at the same time. If the better riders for multiple orders are the same rider, matching conflicts need to be resolved. This batch neighborhood transformation strategy can greatly improve the performance of neighborhood search without affecting the solution effect, so that the order matching method can be more widely applied to the solution and optimization of order-distribution resource matching problems of different scales.
[0060] Among them, the simultaneous transfer attempt of the initially allocated distribution resources corresponding to all orders includes: judging whether there is a distribution resource with a greater matching degree for each order according to the matching degree matrix of the current round of order reallocation; if so, transferring the order from the currently allocated distribution resource to the distribution resource with a greater matching degree. Further, a round of neighborhood search-based order reallocation specifically includes: generating a possible matching set for each order based on the order transfer operator, and the elements in the possible matching set represent the distribution resources that may correspond to the corresponding order; performing batch neighborhood transformation, including selecting the distribution resource with the greatest matching degree from the possible matching set of each order as the optimal distribution resource for the order in this round; processing the batch neighborhood transformation results, including for each order, if it is determined that the optimal distribution resource has not changed compared with the distribution resource originally allocated, then retaining the original matching result; if it is determined that the optimal distribution resource is different from the distribution resource originally allocated, then putting the matching result containing the optimal distribution resource into the better matching set as a better matching result; if it is determined that the better matching set is empty, then ending the neighborhood search. If it is determined that the better matching set is not empty, matching conflict resolution is performed and the current order-delivery resource matching result is updated; wherein, the matching conflict resolution includes: aggregating the better matching set based on the delivery resource identifier, retaining the matching result with the highest matching degree for each delivery resource as the better matching set; wherein, updating the current order-delivery resource matching result includes: based on the better matching set after conflict resolution, transferring the transferred order from the original delivery resource to the delivery resource corresponding to the better matching result, so that the order-delivery resource matching result is updated.
[0061] Please refer to Figure 5 ,The figure shows an order matching process based on the order transfer operator, including: S501: Obtaining order pre-matching results, which include each order to be allocated and the corresponding delivery resources to be allocated; S502: Update the matching degree matrix, specifically, update the matching degree of the rider whose order-carrying status has changed to the assigned order; S503: Execute batch neighborhood transformation, including selecting the best rider for each order; S504: Processing the neighborhood transformation result, including: if the best rider of the order is different from the original rider, putting the matching result into a better matching result set; S505: Determine whether the combination of better matching results is empty, if so, jump to S508; otherwise, execute S506; S506: matching conflict resolution, including retaining the order with the highest matching degree from the rider's perspective as the current matching result; S507: Current solution update: replace the current solution (i.e., the order-delivery resource matching result of the current round) with a better solution; S508: Return the final order-delivery resource matching result, which is used to assign the order to the delivery resource.
[0062] In this embodiment, after obtaining the initial solution (i.e., order pre-matching result) based on the greedy algorithm, an order reallocation process based on neighborhood search is added, which can adjust and optimize the existing order pre-matching results and better escape the local optimum. Furthermore, the batch neighborhood transformation strategy is adopted in the order reallocation process, which can greatly improve the solution performance, adapt to the solution of large-scale order-delivery resource matching problems, and can be flexibly expanded. Please refer to Figure 6 , the order matching example shown in the figure includes two orders to be assigned, o1 and o2, and two candidate riders c1 and c2, of which c1 is a non-empty rider with two orders on his back (as shown by the blue arrow), and c2 is an empty rider. Based on the greedy algorithm, since the timeout risk of o1 assigned to c1 is higher, and c2 is empty and has a closer distance to pick up the food, o1 will be allocated to c2 in the order pre-allocation result; after updating the matching degree based on the pre-allocation result of o1, it will be found that o2 will time out regardless of whether it is assigned to c1 or c2, but it is obvious that c1 has a higher timeout risk, so the pre-allocation result of o2 is intended to be assigned to c2, and the final order pre-matching result is that both o1 and o2 are intended to be assigned to c2. After the order reallocation process is introduced, the matching degree of o1 to c1 and c2 can be updated based on the above pre-matching results. When the risk of timeout is equal, the order-delivery resource matching result after o1 is transferred from c2 to c1 will be more convenient. Therefore, after reallocation, o1 is assigned to c1 and o2 is assigned to c2, which will significantly optimize the rider experience and delivery time. According to the experimental results, the delivery efficiency index increased by 5% after adding the order reallocation process, and the overall order reassignment rate decreased by 3%.
[0063] It should be noted that, in the absence of conflict, the features given in this embodiment and other embodiments of the present application can be combined with each other, and steps S101 and S102 or similar terms do not limit the steps to be executed sequentially.
[0064] So far, the method provided in this embodiment has been explained. After obtaining the order pre-matching result based on the greedy algorithm, the method adds a post-adjustment process. The post-adjustment process is a processing process for order reallocation based on neighborhood search, which can adjust and optimize the order-delivery resource matching result representing the pre-allocation (or proposed allocation) obtained by the greedy algorithm, and better escape from the local optimum. Second embodiment
[0065] Corresponding to the first embodiment, the second embodiment of the present application provides an order matching device. For the relevant parts, please refer to the description of the corresponding method embodiment. Figure 7 , the order matching device shown in the figure comprises: Initialization unit 701 is used to obtain the order to be assigned and the alternative delivery resources, and construct an initial matching degree matrix; wherein the elements of the matching degree matrix represent the matching degree of the order-delivery resource pair consisting of the order and the corresponding delivery resource; A pre-matching unit 701 is used to perform multiple rounds of order-delivery resource matching based on a greedy algorithm and a matching degree matrix until a delivery resource to be allocated is determined for each order, thereby obtaining an order pre-matching result; A reallocation unit 703, configured to perform at least one round of neighborhood search-based order reallocation for the order pre-matching result until an optimal order-delivery resource matching result is determined; wherein the reallocation unit includes a matching degree updating subunit 703-1 and a neighborhood search subunit 703-2; The matching degree updating subunit 703-1 is used to determine the delivery resources whose order status has changed in the current round, update the matching degree of each order-delivery resource pair consisting of the delivery resources whose order status has changed, and obtain the matching degree matrix of the current round; The neighborhood search subunit 703-2 is used to perform a neighborhood search on the order-delivery resource matching result of the previous round based on the matching degree matrix and the neighborhood operator of the current round to obtain a better order-delivery resource matching result of the current round.
[0066] Optionally, the neighborhood search subunit 703-2 is specifically used to: based on the matching degree matrix and neighborhood operator of the current round, perform neighborhood transformation on the order-delivery resource matching results of the previous round to obtain a neighborhood solution set of the current round; based on a preset acceptance criterion, find a better solution from the neighborhood solution set; if a better solution for the current round is determined, accept the better solution and use the better solution as the better order-delivery resource matching result obtained by order reallocation in the current round; and use the difference between the better solution of the current round and the better solution of the previous round to determine the delivery resources whose order status has changed in the next round.
[0067] Optionally, the reallocation unit 703 is specifically used to: if a preset exit condition is met or a better solution is not found in the current round, the better solution of the most recent round is used as the optimal order-delivery resource matching result, and the optimal order-delivery resource matching result is used to allocate each order to the corresponding delivery resource.
[0068] Optionally, the neighborhood operator is an order transfer operator; wherein, the neighborhood search subunit 703-2 executes the processing logic encapsulated by the order transfer operator, including: judging whether there is a better distribution resource with a greater matching degree than the distribution resource initially to be allocated for the order according to the matching degree matrix of the current round of order reallocation, and if so, transferring the order from the distribution resource currently to be allocated to the better distribution resource, thereby performing a perturbation transformation on the initial order-distribution resource matching result of the previous round, and obtaining its neighborhood solution set to find a better solution; wherein, the better distribution resource is used as the initial distribution resource to be allocated for the order in the next round of order reallocation processing.
[0069] Optionally, the order transfer operator executes a batch neighborhood transformation strategy, wherein the neighborhood search subunit 703-2 is specifically used to: simultaneously attempt to transfer the initially allocated distribution resources corresponding to all orders, so as to add disturbance to the initial order-distribution resource allocation result in the current round.
[0070] Optionally, the neighborhood search subunit 703-2 is specifically used to: determine whether there is a delivery resource with a greater matching degree for each order based on the matching degree matrix of the current round of order reallocation; if so, transfer the order from the currently allocated delivery resource to the delivery resource with a greater matching degree.
[0071] Optionally, the reallocation unit 703 is specifically used to: generate a possible matching set for each order based on the order transfer operator, the elements in the possible matching set represent the delivery resources that may correspond to the corresponding order; perform batch neighborhood transformation, including selecting the delivery resource with the greatest matching degree from the possible matching set of each order as the optimal delivery resource for the order in this round; process the batch neighborhood transformation results, including for each order, if it is determined that the optimal delivery resource is not changed compared with the originally planned distribution resource, then retain the original matching result; if it is determined that the optimal distribution resource is different from the originally planned distribution resource, then put the matching result containing the optimal distribution resource as a better matching result into the better matching set; if it is determined that the better matching set is empty, then end the neighborhood search.
[0072] Optionally, the reallocation unit 703 is specifically used to: if it is determined that the better matching set is not empty, perform matching conflict resolution and update the current order-delivery resource matching result; wherein, the matching conflict resolution includes: aggregating the better matching set based on the delivery resource identifier, and retaining the matching result with the highest matching degree for each delivery resource as the better matching set; wherein, updating the current order-delivery resource matching result includes: based on the better matching set after resolving the conflict, transferring the transferred order from the original delivery resource to the delivery resource corresponding to the better matching result, so that the order-delivery resource matching result is updated.
[0073] Optionally, the neighborhood operator is an order exchange operator; wherein the neighborhood search subunit 703-2 executes the processing logic encapsulated by the order exchange operator, including: according to the matching matrix of the current round of order reallocation, selecting two orders in the order and exchanging the delivery resources currently to be allocated to the two orders.
[0074] Optionally, the pre-matching unit 701 is specifically used for: each round of order-delivery resource matching includes selecting the order-delivery resource pair corresponding to the element with the largest matching degree from the matching degree matrix of the current round as the order pre-matching result of the current round; updating the matching degree matrix of the current round, and using the updated matching degree matrix as the matching degree matrix of the next round; wherein, updating the matching degree matrix of the current round includes: deleting the elements corresponding to the orders to which delivery resources are to be allocated in the current round in the matching degree matrix; using the delivery resources to be allocated in the current round as the delivery resources whose back-order status has changed, and updating the matching degrees of other orders to which delivery resources are not to be allocated in the current round corresponding to the delivery resources whose back-order status has changed.
[0075] Based on the above embodiment, one embodiment of the present application provides an electronic device. For the relevant parts, please refer to the corresponding description of the above embodiment. Figure 8 Schematic diagram of an electronic device, the electronic device shown in the figure includes: a memory, and a processor; the memory is used to store a computer program, and after the computer program is run by the processor, the method provided in the embodiment of the present application is executed.
[0076] Based on the above embodiments, one embodiment of the present application provides a computer storage medium. For the relevant parts, please refer to the corresponding description of the above embodiments. The schematic diagram of the computer storage medium is similar to the schematic diagram of an electronic device, and the memory in the figure can be understood as the storage medium. The computer storage medium stores computer execution instructions, which are used to implement the method provided in the embodiment of the present application when executed by the processor.
[0077] It should be noted that the embodiments of the present application may involve platform operations, order transactions, etc. In actual applications, the solutions described in this article should be applied within the scope permitted by applicable laws and regulations in accordance with the applicable laws and regulations of the country where they are located.
[0078] It should be noted that the embodiments of the present application may involve the use of user data. In actual applications, the user's specific personal data should be used in the scheme described in this document within the scope permitted by applicable laws and regulations, in compliance with the applicable laws and regulations of the country where the user is located (for example, the user's explicit consent, effective notification to the user, etc.).
[0079] In a typical configuration, an electronic device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory. The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
[0080] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0081] Although the present application is disclosed as above in the form of a preferred embodiment, it is not intended to limit the present application. Any technical personnel in this field may make possible changes and modifications without departing from the spirit and scope of the present application. Therefore, the scope of protection of the present application shall be based on the scope defined by the claims of the present application.
Claims
1. An order matching method, characterized in that: include: Obtaining the orders to be assigned and the alternative delivery resources, and constructing an initial matching degree matrix; wherein the elements of the matching degree matrix represent the matching degree of the order-delivery resource pair consisting of the order and the corresponding delivery resource; Perform multiple rounds of order-delivery resource matching based on the greedy algorithm and matching matrix until the delivery resource to be allocated is determined for each order, and the order pre-matching result is obtained; Perform at least one round of neighborhood search-based order reallocation for the order pre-matching result until the optimal order-delivery resource matching result is determined; wherein each round of order reallocation includes: Determine the delivery resources whose order status has changed in the current round, update the matching degree of each order-delivery resource pair consisting of the delivery resources whose order status has changed, and obtain the matching degree matrix of the current round; Based on the matching degree matrix and neighborhood operator of the current round, a neighborhood search is performed on the order-delivery resource matching results of the previous round to obtain a better order-delivery resource matching result of the current round.
2. The method according to claim 1, characterized in that The matching degree matrix and neighborhood operator of the current round are used to perform a neighborhood search on the order-delivery resource matching results of the previous round to obtain a better order-delivery resource matching result for order redistribution in the current round, including: Based on the matching degree matrix and neighborhood operator of the current round, the neighborhood transformation is performed on the order-delivery resource matching results of the previous round to obtain the neighborhood solution set of the current round; Based on the preset acceptance criteria, a better solution is sought from the neighborhood solution set. If a better solution for the current round is determined, the better solution is accepted and used as the better order-delivery resource matching result obtained by order reallocation in the current round. The difference between the better solution of the current round and the better solution of the previous round is used to determine the delivery resources whose order status has changed in the next round.
3. The method according to claim 1, characterized in that The performing at least one round of neighborhood search-based order reallocation on the order pre-matching result until the optimal order-delivery resource matching result is determined includes: If the preset exit condition is met or a better solution is not found in the current round, the better solution of the most recent round will be used as the optimal order-delivery resource matching result, and the optimal order-delivery resource matching result is used to allocate each order to the corresponding delivery resource.
4. The method according to claim 1, characterized in that: The neighborhood operator is an order transfer operator; wherein the processing logic encapsulated by the order transfer operator includes: According to the matching degree matrix of the current round of order reallocation, determine whether there is a better distribution resource with a greater matching degree than the distribution resource initially to be allocated for the order. If so, transfer the order from the current distribution resource to be allocated to the better distribution resource, thereby performing a perturbation transformation on the initial order-distribution resource matching result of the previous round, and obtaining its neighborhood solution set to find a better solution; The more optimal distribution resources are used as the initial distribution resources to be allocated for the order in the next round of order reallocation processing.
5. The method according to claim 4, characterized in that The order transfer operator executes the batch neighborhood transformation strategy. The processing logic encapsulated by the order transfer operator specifically includes: At the same time, attempts are made to transfer the distribution resources initially allocated to all orders, so as to add disturbances to the initial order-distribution resource allocation results in the current round.
6. The method according to claim 5, characterized in that The simultaneously attempting to transfer the initially allocated delivery resources corresponding to all orders includes: According to the matching degree matrix of the current round of order reallocation, for each order, determine whether there is a delivery resource with a greater matching degree; if so, transfer the order from the currently allocated delivery resource to the delivery resource with a greater matching degree.
7. The method according to claim 6, characterized in that A round of neighborhood search-based order redistribution includes: Generate a possible matching set for each order based on the order transfer operator, where the elements in the possible matching set represent possible distribution resources corresponding to the corresponding order; Perform batch neighborhood transformation, including selecting the delivery resource with the highest matching degree from the possible matching set for each order as the optimal delivery resource for this order in this round; Processing the results of the batch neighborhood transformation, including for each order, if the optimal delivery resource is determined to be unchanged compared with the originally planned delivery resource, then retaining the original matching result; if the optimal delivery resource is determined to be different from the originally planned delivery resource, then placing the matching result containing the optimal delivery resource as a better matching result into the better matching set; If it is determined that the better matching set is empty, the neighborhood search ends.
8. The method according to claim 7, characterized in that Also includes: If it is determined that the better matching set is not empty, then the matching conflict resolution is performed and the current order-delivery resource matching result is updated; The matching conflict resolution includes: aggregating the better matching set based on the distribution resource identifier, and retaining the matching result with the greatest matching degree for each distribution resource as the better matching set; Wherein, updating the current order-delivery resource matching result includes: based on the better matching set after resolving the conflict, transferring the transferred order from the original delivery resource to the delivery resource corresponding to the better matching result, so that the order-delivery resource matching result is updated.
9. The method according to claim 1, characterized in that: The neighborhood operator is an order exchange operator; wherein the processing logic encapsulated by the order exchange operator includes: According to the matching degree matrix of the current round of order reallocation, two orders in the order are selected and the delivery resources currently to be allocated to the two orders are exchanged.
10. The method according to claim 1, characterized in that The method of performing multiple rounds of order-delivery resource matching based on the greedy algorithm and the matching degree matrix includes: Each round of order-delivery resource matching includes selecting the order-delivery resource pair corresponding to the element with the largest matching degree from the matching degree matrix of the current round as the order pre-matching result of the current round; Update the matching matrix of the current round, and use the updated matching matrix as the matching matrix of the next round; Among them, updating the matching degree matrix of the current round includes: Delete the elements corresponding to the orders to which distribution resources are to be allocated in the current round in the matching matrix; The distribution resources to be allocated in the current round are used as the distribution resources with changed backorder status, and the matching degree of other orders to which distribution resources are not to be allocated in the current round corresponding to the distribution resources with changed backorder status is updated.
Citation Information
Patent Citations
Distribution task distribution method and device, server and storage medium
CN111310119A
Order matching method and device
CN114581173A
Automatic distribution center order sorting method based on hybrid meta-heuristic algorithm
CN115293670A
Cloud platform order allocation optimization method based on improved particle swarm optimization
CN115330123A
Waybill and capacity matching relation post-processing method and device and electronic equipment
CN116341800A
