Path planning method, device, electronic device and computer readable medium
By sorting and path planning for the waybills that have not been processed for target capacity, combining the removal and reinsertion of the initial sequence, and locally adjusting the sequence, the problem of slow path planning process and inability to generate results in the existing technology is solved, and efficient path planning results acquisition is achieved.
Patent Information
- Application Number
- CN202010550940.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-06-16
- Publication Date
- 2025-05-16
- Estimated Expiration
- 2040-06-16
AI Technical Summary
In the prior art, the path planning process is slow and cannot be applied to online scenarios, and it is easy to cause the path planning results to be generated.
By obtaining the completed waybills that have not been processed by the target capacity, sorting and path planning, the sequence of places to be accessed is obtained as the initial sequence, and the location to be accessed is randomly removed and reinserted, the sequence is adjusted locally, and the path planning results are generated.
It improves the solution efficiency of path planning problems, is suitable for online scenarios, effectively obtains path planning results, and avoids the situation of failure in obtaining the optimal solution.
Smart Images

Figure CN113804206B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer technology, and specifically to a path planning method, device, electronic device, and computer-readable medium. Background Art
[0002] With the rapid development of Internet technology, instant delivery services have gradually become an indispensable part of modern life. During the delivery process, the service platform needs to plan the route for the delivery capacity in order to provide a more reasonable pickup, delivery route and sequence for the delivery capacity, thereby reducing the occurrence of delays in the delivery of items.
[0003] In the prior art, feasible solutions to the path planning problem are usually randomly initialized through genetic algorithms or taboo search algorithms, and then the optimal solution is directly searched by inserting and exchanging neighborhoods, so as to obtain the final path planning result. However, this path planning method has a slow solution process and is not suitable for online scenarios. At the same time, this method is not easy to search for the optimal solution, resulting in the frequent failure to generate path planning results. Summary of the invention
[0004] The embodiments of the present application propose a path planning method, device, electronic device and computer-readable medium to solve the technical problems of the prior art that the solution process is slow, resulting in the inapplicability of the technology to online scenarios, and the inability to generate path planning results.
[0005] In a first aspect, an embodiment of the present application provides a path planning method, the method comprising: obtaining waybills for which target capacity has not been processed, wherein the waybills record places to be visited; sorting the waybills, and performing path planning for the places to be visited in the waybills according to the sorting order of the waybills to obtain a sequence of places to be visited; taking the sequence of places to be visited as an initial sequence, and performing the following path adjustment steps: randomly removing some places to be visited from the initial sequence to obtain a remaining sequence; reinserting the removed places to be visited into the remaining sequence to obtain a recombined sequence; locally adjusting the recombined sequence to obtain a target sequence; and generating a path planning result based on the target sequence when a preset termination condition is met.
[0006] In a second aspect, an embodiment of the present application provides a path planning device, which includes: an acquisition unit, configured to acquire waybills whose target capacity has not been processed, wherein the waybills record places to be visited; a path planning unit, configured to sort the waybills, and perform path planning for the places to be visited in the waybills according to the sorting order of the waybills, to obtain a sequence of places to be visited; a path adjustment unit, configured to use the sequence of places to be visited as an initial sequence, and perform the following path adjustment steps: randomly remove some places to be visited from the initial sequence to obtain a remaining sequence; reinsert the removed places to be visited into the remaining sequence to obtain a recombined sequence; locally adjust the recombined sequence to obtain a target sequence; and generate a path planning result based on the target sequence when a preset end condition is met.
[0007] In a third aspect, an embodiment of the present application provides an electronic device, comprising: one or more processors; a storage device on which one or more programs are stored, and when the one or more programs are executed by one or more processors, the one or more processors implement the method described in the first aspect.
[0008] In a fourth aspect, an embodiment of the present application provides a computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements the method described in the first aspect.
[0009] The path planning method, device, electronic device and computer-readable medium provided in the embodiments of the present application, by sorting the unprocessed waybills of the acquired target capacity, and performing path planning for the places to be visited in the waybills in the sorting order, thereby obtaining a sequence of places to be visited; then the sequence of places to be visited is used as the initial sequence, some places to be visited are randomly removed from the initial sequence, and the removed places to be visited are reinserted into the remaining sequence, thereby obtaining a reorganized sequence; then the reorganized sequence is locally adjusted to obtain the target sequence; finally, when the preset end condition is met, a path planning result is generated based on the target sequence. The above process of obtaining the initial sequence can obtain a feasible solution to the initial path planning problem, the process of reorganizing the initial sequence can realize a rough search for the optimal solution, and the process of locally adjusting the reorganized sequence can realize a fine search for the optimal solution. Compared with the method of directly calculating the optimal solution based on a large amount of data as a whole in the prior art, the path planning result obtained through the processes of initialization, rough search and fine search can effectively obtain the path planning result and avoid the failure of obtaining the optimal solution. At the same time, the local optimal solution is used in the process of determining the path planning results, which reduces the amount of data calculation and improves the efficiency of solving the path planning problem, thereby improving the applicability of online scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] Other features, objects and advantages of the present application will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings:
[0011] Figure 1 is a flow chart of an embodiment of a path planning method according to the present application;
[0012] Figure 2 is a decomposed flow chart of the steps for generating a recombinant sequence according to the present application;
[0013] Figure 3 is a flow chart of an implementation method of locally adjusting a recombinant sequence according to the present application;
[0014] Figure 4 is a flow chart of another implementation method of locally adjusting the recombinant sequence according to the present application;
[0015] Figure 5 is a flow chart of another implementation method of locally adjusting the recombinant sequence according to the present application;
[0016] Figure 6 is a flow chart of another implementation method of locally adjusting the recombinant sequence according to the present application;
[0017] Figure 7 is a flow chart of another embodiment of the path planning method according to the present application;
[0018] Figure 8 is a schematic structural diagram of an embodiment of a path planning device according to the present application;
[0019] Fig. 9 It is a structural diagram of a computer system suitable for implementing an electronic device of an embodiment of the present application. DETAILED DESCRIPTION
[0020] The present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the relevant invention, rather than to limit the invention. It should also be noted that, for ease of description, only the parts related to the relevant invention are shown in the accompanying drawings.
[0021] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0022] Please refer to Figure 1, which shows a process 100 according to an embodiment of a path planning method of the present application. The execution subject of the path planning method may be a server. The server may be hardware or software. When the server is hardware, it may be implemented as a distributed device cluster consisting of multiple devices, or as a single device. When the server is software, it may be implemented as multiple software or software modules, or as a single software or software module. No specific limitation is made here.
[0023] In addition, when the terminal device has the ability to implement the information acquisition method of the present application, the execution subject of the path planning method can also be the terminal device. The above-mentioned terminal device can be an electronic device such as a mobile phone, a smart phone, a tablet computer, a laptop computer, a wearable device, etc.
[0024] The path planning method comprises the following steps:
[0025] Step 101, obtaining the waybills that have not been processed by the target capacity.
[0026] In this embodiment, the execution subject of the path planning method can obtain waybills that have not been processed by the target transportation capacity. Among them, the places to be visited can be recorded in each waybill obtained. The above-mentioned places to be visited may include delivery locations. The delivery location may refer to the destination where the target transportation capacity delivers items (such as express delivery, meals), etc., such as the location specified by the user, the delivery cabinet, etc. For waybills of categories such as meals and waybills that have not yet been picked up, the places to be visited include not only the delivery locations, but also the pickup locations, such as meal pickup stores, meal pickup cabinets, etc.
[0027] In practice, the target transport capacity may be various types of delivery transport capacity. For example, it may include but is not limited to: delivery personnel, delivery robots, drones, unmanned vehicles, etc. During the delivery process, the delivery transport capacity may collect the list of wireless network information to be tested in real time or periodically, and send the collected list of wireless network information to be tested to the above-mentioned execution subject.
[0028] Step 102, sorting the waybills, and planning the paths of the places to be visited in the waybills according to the sorting order of the waybills, to obtain a sequence of the places to be visited.
[0029] In this embodiment, the above-mentioned execution entity can sort each waybill according to a variety of sorting methods, so as to obtain the sorting results of each waybill.
[0030] As an example, each waybill may record a target arrival time at the delivery location. The execution entity may sort the waybills in order of the target arrival time at the delivery location from earliest to latest.
[0031] As another example, the execution entity may sort the waybills in descending order of importance of the waybill delivery objects, so that waybills of important users are sorted first and waybills of unimportant users are sorted last.
[0032] As another example, the execution entity may sort the waybills in descending order of their urgency. The urgency here may be determined based on the location of the target capacity, the current time, and the target arrival time at the delivery location. For example, the urgency of the waybill may be determined by referring to the following formula:
[0033]
[0034] Among them, δ i is the value used to characterize the urgency of waybill i, d i is the distance between the delivery location in order i and the location of the target transport capacity, ETA i is the target arrival time of the delivery location of waybill i, and ct is the current time.
[0035] It should be noted that each waybill may also be sorted based on other sorting methods, and this embodiment does not limit the specific sorting method.
[0036] In this embodiment, after obtaining the sorting order of each waybill, the execution subject can perform path planning for the places to be visited in each waybill according to the sorting order of each waybill to obtain a sequence of places to be visited. Specifically, the execution can be performed according to the following steps:
[0037] First, the first waybill can be taken out in the sorting order. Since there is only one place to be visited, there is no path planning problem, so the place to be visited can be directly recorded as the first place to be visited.
[0038] Then, the second waybill can be taken out according to the sorting order, and the place to be visited in the second waybill is used as the second place to be visited. Since the second place to be visited can be located before or after the first place to be visited, it can be determined whether the second place to be visited satisfies the preset constraint conditions in the two cases of being before and after the first place to be visited. If only one case satisfies the constraint conditions, the order of the first place to be visited and the second place to be visited in that case can be recorded. If both cases satisfy the constraint conditions, the objective function values of the two cases can be determined, and based on the objective function value, the order of the first place to be visited and the second place to be visited in one of the cases is selected for recording.
[0039] For subsequent waybills, the processing method of the second waybill can be referred to, and the positions of the places to be visited in the subsequent waybills can be inserted in turn to obtain the final order of the places to be visited, and a sequence of places to be visited can be generated according to this order.
[0040] It should be noted that, for waybills of categories such as meals and waybills that have not yet been picked up, the places to be visited include not only the delivery places but also the pickup places. Therefore, sorting the places to be visited can refer to sorting the various places to be visited (including the pickup places and the delivery places). For example, if the first waybill and the second waybill have not been picked up, the first place to be visited includes the first pickup place (which can be recorded as A1) and the first delivery place (which can be recorded as B1) recorded in the first waybill, and the places to be visited recorded in the second waybill include the second pickup place (which can be recorded as A2) and the delivery place (which can be recorded as B2). After taking out the first waybill, the sequence A1-B1 can be obtained. After taking out the second waybill, since the access time of the pickup location of the same waybill is earlier than the access time of the delivery location, there are 6 sorting methods: A2-B2-A1-B1, A2-A1-B2-B1, A2-A1-B1-B2, A1-A2-B2-B1, A1-A2-B1-B2, A1-B1-A2-B2, a total of 6 sorting methods. If all 6 sorting methods meet the preset constraints, the objective function values under these 6 sorting methods can be determined, and based on the objective function value, one of the optimal sorting methods is selected for recording.
[0041] It should be pointed out that the constraint condition may be a condition for constraining the order of the places to be visited. Optionally, the constraint condition may include but is not limited to: the visit time of the pickup location is later than the shipment time of the items, the visit time of the pickup location of the same waybill is earlier than the visit time of the delivery location, etc. The objective function value is the value of a preset objective function. The objective function can be used to characterize the goal of path planning. Optionally, the objective function can be used to characterize minimizing the delivery timeout, minimizing the delivery distance, or minimizing both the delivery timeout and the delivery distance, etc. As an example, the following function can be used as the objective function:
[0042]
[0043] Among them, t i is the target arrival time of the delivery location in waybill i. i is the estimated arrival time of the delivery location in waybill i, that is, the estimated time when the target transport capacity arrives at the delivery location. i The distance traveled by the target transport capacity to complete order i.
[0044] By planning the paths of the places to be visited in each waybill according to the sorting order of the waybill, a sequence of places to be visited is obtained, so that a dynamic planning result can be initialized, that is, an initial feasible solution to the path planning problem is obtained. Since the feasible solution is obtained by planning the paths one by one according to the sorting order of the waybill, a greedy strategy is adopted. Compared with the method of obtaining a feasible solution by random initialization, the effectiveness and rationality of the initial feasible solution are improved.
[0045] Step 103: taking the sequence of places to be visited as the initial sequence.
[0046] In this embodiment, the execution subject may use the sequence of places to be visited as the initial sequence and execute the path adjustment steps including the following steps 104 to 107 .
[0047] Step 104, randomly remove some of the locations to be visited from the initial sequence to obtain a remaining sequence.
[0048] In this embodiment, the execution subject may randomly remove some of the places to be visited from the initial sequence, and use the initial sequence after removing the places to be visited as the remaining sequence. For example, a fixed number of places to be visited may be removed, or a number of places to be visited may be removed that is related to the total number of places to be visited.
[0049] In some optional implementations of this embodiment, the execution entity may determine a target number based on the total number of places to be visited. The target number is recorded as the number of waybills whose places to be visited are to be removed. For example, if the total number of places to be visited is n, the target number may be n / 2. Then, the target number (i.e., n / 2) of waybills may be randomly selected, and the places to be visited in the randomly selected waybills may be removed from the initial sequence.
[0050] Therefore, the number of removed places to be visited is related to the total number of places to be visited. Since the total number of places to be visited can represent the scale of the path planning problem, the number of removed places to be visited is related to the scale of the path planning problem, which can ensure the rationality of the number of reorganized places to be visited.
[0051] Step 105, reinsert the removed location to be visited into the remaining sequence to obtain a recombinant sequence.
[0052] In this embodiment, the execution subject can reinsert the removed locations to be visited into the remaining sequence to obtain a recombined sequence. In practice, the removed locations to be visited can be reinsert based on the principle that the objective function value of the recombined sequence is better than (e.g., less than) the objective function value of the initial sequence and the recombined sequence satisfies the preset constraints.
[0053] In some optional implementations of this embodiment, see Figure 2 A decomposed flow chart of the steps for generating the recombinant sequence is shown. Figure 2 As shown, the above execution subject can obtain the recombinant sequence according to the following sub-steps S11 to S14:
[0054] Sub-step S11, summarizing the removed places to be visited into a removal sequence (which can be recorded as π R ).
[0055] Sub-step S12, obtaining the objective function and constraint conditions of the path planning. The objective function and constraint conditions can be found in the description of step 102, which will not be repeated here.
[0056] Sub-step S13, taking out the places to be visited in the removal sequence one by one, and executing the following steps:
[0057] First, insert the locations to be visited into the remaining sequence (which can be recorded as π D ) and determine the objective function value when inserted into each feasible position. Among them, the feasible position is the position that satisfies the constraint conditions.
[0058] Then, the feasible position with the minimum objective function value is taken as the target position, and the extracted location to be visited is inserted into the target position in the remaining sequence.
[0059] Therefore, π R Insert each location to be visited in π one by one D Each feasible position in the , and then select the best one to place, until π R There are no places to visit.
[0060] Sub-step S14, determining the remaining sequence with the to-be-visited location inserted in the removed sequence as the recombined sequence.
[0061] By reinserting the randomly selected locations to be visited into the remaining sequence to obtain a reorganized sequence, a rough search for the solution to the path planning is achieved. In this process, since the sequence is reorganized by inserting one by one, a solution based on a greedy strategy is adopted. Compared with the method of directly determining the overall optimal solution in the prior art, the efficiency of solving the path planning problem is improved, and the applicability of online scenarios is improved. At the same time, the path planning results can be effectively obtained, avoiding the failure of obtaining the optimal solution. Compared with directly using the initial sequence, the quality of the solution can be improved.
[0062] Step 106: locally adjust the recombinant sequence to obtain the target sequence.
[0063] In this embodiment, the execution subject can locally adjust the recombinant sequence to obtain the target sequence. In practice, one or more methods can be used to locally adjust the recombinant sequence.
[0064] In some optional implementations of this embodiment, the to-be-visited location in the waybill includes a delivery location, and the target arrival time of the delivery location is recorded in the waybill. Figure 3 As shown, the above execution entity can locally adjust the recombinant sequence according to the following sub-steps S21 to S24:
[0065] Sub-step S21, based on the reorganized sequence, determining the estimated arrival time of the delivery location of the waybill.
[0066] In practice, the order of visiting each location to be visited can be determined based on the reorganized sequence, and the estimated arrival time of the target transportation capacity at the delivery location of each waybill can be estimated based on the order of visiting each location to be visited, the location of the target transportation capacity, the distance between the target transportation capacity and each location to be visited, and the road conditions. The process of estimating the arrival time can be carried out in an existing manner and will not be described in detail here.
[0067] Sub-step S22, determining the early delivery waybill and adding a first mark to each early delivery waybill, the early delivery waybill being a waybill whose estimated arrival time at the delivery location is earlier than the target arrival time.
[0068] Sub-step S23, performing the following first local adjustment step:
[0069] First, from the waybills with the first mark, the waybill with the largest difference between the target arrival time and the estimated arrival time is selected as the first target waybill, and the delivery location in the first target waybill is used as the first target delivery location.
[0070] Then, in response to the first target delivery location not being at the end of the reorganized sequence, the first target delivery location is moved backward in the reorganized sequence, and the first mark of the first target waybill is deleted. By moving the first target delivery location backward in the reorganized sequence, the waybill delivered in advance can be changed to be delivered later, so that more urgent waybill can be processed earlier, thereby further improving the quality and rationality of the solution to the path planning problem.
[0071] Optionally, the position of the first target delivery location in the reorganization sequence can be adjusted according to the following steps: Step 1, the position of the first target delivery location in the reorganization sequence is taken as the first original position, and the first target delivery location is removed from the reorganization sequence. Step 2, the objective function and constraint conditions of the path planning are obtained. Step 3, the first target delivery location is respectively inserted into each feasible position after the first original position in the reorganization sequence, and the objective function value when inserted into each feasible position is determined, and the feasible position is the position that satisfies the constraint conditions. The objective function and constraint conditions used here can be found in the description in step 102, which will not be repeated here. Step 4, the feasible position when the objective function value is the smallest is taken as the first updated position, and the first target delivery location is inserted into the first updated position.
[0072] In this way, not only can the early delivery waybill be changed to a later delivery, so that more urgent waybill can be processed earlier, but the delivery address in the early delivery waybill can also be adjusted to the most reasonable location, further improving the quality and rationality of the solution to the path planning problem.
[0073] It should be noted that, in response to the first target delivery location being located at the end of the recombinant sequence, sub-step S24 may be directly executed.
[0074] Sub-step S24, detecting whether there is a waybill with the first mark, and if so, re-executing the first local adjustment step.
[0075] By partially adjusting the reorganization sequence by shifting the positions of the delivery locations in each delayed delivery order backward, the delivery order of each early delivery order can be shifted backward, so that more urgent orders can be processed first. In this way, the quality and rationality of the solution to the path planning problem can be further improved.
[0076] In some optional implementations of this embodiment, the to-be-visited location in the waybill includes a delivery location, and the target arrival time of the delivery location is recorded in the waybill. Figure 4 As shown, the above execution entity can locally adjust the recombinant sequence according to the following sub-steps S31 to S34:
[0077] Sub-step S31, based on the reorganized sequence, determining the estimated arrival time of the delivery location of the waybill.
[0078] Sub-step S32, determining delayed delivery waybills and adding a second mark to each delayed delivery waybill, wherein a delayed delivery waybill is a waybill whose estimated arrival time at the delivery location is later than the target arrival time.
[0079] Sub-step S33, performing the following second local adjustment step:
[0080] First, from the waybills with the second mark, the waybill with the largest difference between the estimated arrival time and the target arrival time is selected as the second target waybill, and the delivery location in the second target waybill is used as the second target delivery location.
[0081] Afterwards, in response to the second target delivery location not being located at the head of the reorganized sequence, the second target delivery location is moved forward in the reorganized sequence, and the second mark of the second target waybill is deleted. By moving the second target delivery location forward in the reorganized sequence, the delivery order of each delayed delivery waybill can be advanced, thereby avoiding delayed delivery of orders or reducing the timeout time of delayed delivery orders, thereby further improving the quality and rationality of the solution to the path planning problem.
[0082] Optionally, the position of the second target delivery location in the reorganization sequence can be adjusted according to the following steps: Step 1, the position of the second target delivery location in the reorganization sequence is used as the second original position, and the second target delivery location is removed from the reorganization sequence. Step 2, the objective function and constraint conditions of the path planning are obtained. Step 3, the second target delivery location is respectively inserted into each feasible position before the second original position in the reorganization sequence, and the objective function value when inserted into each feasible position is determined, and the feasible position is the position that satisfies the constraint conditions. The objective function and constraint conditions used here can be found in the description in step 102, which will not be repeated here. Step 4, the feasible position when the objective function value is the smallest is used as the second updated position, and the second target delivery location is inserted into the second updated position.
[0083] In this way, not only can the delivery order of delayed delivery waybills be advanced, but the delivery address in the delayed delivery waybills can also be adjusted to the most reasonable location, further improving the quality and rationality of the solution to the path planning problem.
[0084] It should be noted that, in response to the second target delivery location being located at the head end of the recombinant sequence, sub-step S34 may be directly executed.
[0085] Sub-step S34, detecting whether there is a waybill with the second mark, and if so, re-execute the second local adjustment step.
[0086] By moving forward the position of the delivery location in each delayed delivery order to partially adjust the reorganization sequence, the delivery order of each delayed delivery order can be advanced, thereby avoiding delayed delivery of orders or reducing the timeout time of delayed delivery orders. In this way, the quality and rationality of the solution to the path planning problem can be further improved.
[0087] In some optional implementations of this embodiment, the location to be visited in the waybill includes the delivery location. Figure 5 As shown, the above execution entity can locally adjust the recombinant sequence according to the following sub-steps S41 to S43:
[0088] Sub-step S41, adding a third tag to each delivery location in the recombined sequence.
[0089] Sub-step S42, performing the following third local adjustment step:
[0090] First, any delivery location with a third marker in the recombinant sequence is used as a third target delivery location, and the third target delivery location is removed from the recombinant sequence.
[0091] Afterwards, the objective function and preset conditions of path planning are obtained.
[0092] Afterwards, the third target delivery location is respectively inserted into each feasible position in the recombinant sequence, and the objective function value when inserted into each feasible position is determined, and the feasible position is the position that satisfies the constraint condition.
[0093] Finally, the feasible position when the objective function value is the minimum is used as the third updated position, the third target delivery location is inserted into the third updated position, and the third mark of the third target delivery location is deleted.
[0094] Sub-step S43, detecting whether there is a delivery location with a third tag in the recombinant sequence, and if so, re-execute the third local adjustment step.
[0095] Thus, each delivery location in the reorganized sequence can be taken out and reinserted as the third target delivery location one by one. Thus, more feasible solutions are further searched, and the optimal solution (i.e., the sequence with the smallest objective function value) is selected from these feasible solutions, which can further improve the quality of the solution to the path planning problem.
[0096] In some optional implementations of this embodiment, the location to be visited in the waybill includes the delivery location. Figure 6 As shown, the execution subject can locally adjust the recombinant sequence according to the following sub-steps S51 to S53:
[0097] Sub-step S51, adding a fourth tag to the delivery location in the recombined sequence.
[0098] Sub-step S52, performing the following fourth local adjustment step:
[0099] First, obtain the objective function and constraints of path planning.
[0100] Afterwards, any delivery location with a fourth mark in the reorganized sequence is used as the fourth target delivery location, and the fourth target delivery location is exchanged with the remaining to-be-visited locations in the reorganized sequence respectively to obtain the objective function value under each exchange method, and determine whether each exchange method meets the constraint conditions.
[0101] Finally, the exchange method when the objective function value is the smallest and the constraint conditions are met is used as the target exchange method, the fourth target delivery location is exchanged with the target exchange method, and the fourth mark of the fourth target delivery location is deleted.
[0102] Sub-step S53, detecting whether there is a delivery location with a fourth tag in the recombinant sequence, and if so, re-execute the fourth local adjustment step.
[0103] Thus, each delivery location in the reorganized sequence can be used as the fourth target delivery location one by one to detect the quality of the feasible solution when it is exchanged with the remaining locations to be visited. Thus, more feasible solutions are further searched, and the optimal solution (i.e., the sequence with the smallest objective function value) is selected among these feasible solutions, which can further improve the quality of the solution to the path planning problem.
[0104] It should be noted that the above-mentioned execution subject may also adopt the above-mentioned various optional implementation methods in sequence to make local adjustments to the recombinant sequence to obtain the target sequence; it may also make any combination of the above-mentioned optional implementation methods to make local adjustments to the recombinant sequence to obtain the target sequence; it may also adopt other methods to make local adjustments to the recombinant sequence to obtain the target sequence.
[0105] Step 107: When the preset end condition is met, a path planning result is generated based on the target sequence.
[0106] In this embodiment, the execution subject may first detect whether a preset end condition is satisfied. The preset end condition may refer to a condition for the end of path planning solution. The preset end condition here may be preset as needed. For example, it may be set as the iterative execution order of the path adjustment step being greater than or equal to a preset value, the processing time being greater than or equal to a preset threshold, etc.
[0107] In this embodiment, in response to meeting the preset end condition, the execution subject may generate a path planning result based on the target sequence. The path planning result here may include information such as the order of visits and routes of each to-be-visited location in the target sequence, so as to facilitate the target transport capacity to process the waybill based on the path planning result, such as picking up and delivering.
[0108] It should be noted that, in response to detecting that the above-mentioned preset end condition is not met, the above-mentioned execution subject can use the target sequence obtained in step 107 as the initial sequence and continue to execute the above-mentioned path adjustment step until the preset end condition is met. Thus, when the preset end condition is not met, the path adjustment step can be iteratively executed multiple times. Since the more times this step is executed, the better the final path planning result, the quality of the path planning result and the time consumption of path planning can be balanced.
[0109] In some optional implementations of this embodiment, the above-mentioned execution subject can detect whether the processing time meets the preset end condition through the following steps: First, the time difference between the current time and the acquisition time of the waybill of the target capacity is taken as the processing time, and whether the processing time is greater than or equal to the preset threshold is detected. In response to the processing time being greater than or equal to the preset threshold, it can be determined that the preset end condition is met; in response to the time difference being less than the preset threshold, it can be determined that the preset end condition is not met. In this way, the duration of the path planning solution can be limited in time, further improving the applicability to online scenarios.
[0110] Here, the preset threshold may be related to the total number of places to be visited. For example, if the total number of places to be visited is n, the preset threshold may be 2n milliseconds or n 2 Since the total number of places to be visited can represent the scale of the path planning problem, the preset threshold is set to a number related to the scale of the path planning problem to ensure the rationality of the preset threshold.
[0111] In some optional implementations of this embodiment, after generating the path planning result, the execution subject may also return the path planning result to the target transport capacity, so that the target transport capacity can deliver or pick up goods according to the path planning result. In addition, after generating the path planning result, the execution subject may also use the path planning result to allocate orders to the target transport capacity, etc. This embodiment does not limit the application of the path planning result.
[0112] The method provided by the above embodiment of the present application is to sort the unprocessed waybills of the acquired target capacity, and plan the paths for the places to be visited in the waybills according to the sorting order, so as to obtain a sequence of places to be visited; then the sequence of places to be visited is used as the initial sequence, and some places to be visited are randomly removed from the initial sequence, and the removed places to be visited are reinserted into the remaining sequence, so as to obtain a reorganized sequence; then the reorganized sequence is locally adjusted to obtain the target sequence; finally, when the preset end condition is met, the path planning result is generated based on the target sequence. The above process of obtaining the initial sequence can obtain a feasible solution to the initial path planning problem, the process of reorganizing the initial sequence can realize a rough search for the optimal solution, and the process of locally adjusting the reorganized sequence can realize a fine search for the optimal solution. The path planning result obtained through the process of initialization, rough search, and fine search can effectively obtain the path planning result compared with the method of directly calculating the optimal solution based on a large amount of data as a whole in the prior art, and avoid the failure of obtaining the optimal solution. At the same time, the local optimal solution is used in the process of determining the path planning result, which reduces the amount of data calculation, improves the efficiency of solving the path planning problem, and thus improves the applicability of online scenarios.
[0113] Further references Figure 7, which shows a process 700 of another embodiment of a path planning method. The process 700 of the path planning method includes the following steps:
[0114] Step 701, obtaining the waybills that have not been processed by the target capacity.
[0115] Step 701 of this embodiment can be found in Figure 1 The step 101 of the corresponding embodiment will not be described in detail here.
[0116] Step 702, the waybills whose locations to be visited are delivery locations are classified as first-category waybills, and the waybills whose locations to be visited include pickup locations and delivery locations are classified as second-category waybills, and the first-category waybills and the second-category waybills are sorted respectively.
[0117] In this embodiment, the execution subject of the route planning method can classify the waybills whose to-be-visited location is the delivery location as the first category waybills, and classify the waybills whose to-be-visited location includes the pickup location and the delivery location as the second category waybills, and sort the first category waybills and the second category waybills respectively. One or more methods can be used for sorting here.
[0118] For example, the first and second category waybills can be sorted in order of the target delivery time of the delivery location from earliest to latest. For another example, the waybills can be sorted in order of the importance of the waybills' delivery objects from highest to lowest, so that the waybills of important users are sorted first and the waybills of unimportant users are sorted last. For another example, the waybills can be sorted in order of the urgency of the waybills from largest to smallest.
[0119] In some optional implementations of this embodiment, the waybill also records the target arrival time at the delivery location. The above-mentioned execution entity may sort various types of waybills (including first-category waybills and second-category waybills) according to the first sorting method and the second sorting method, respectively. Among them, the above-mentioned first sorting method is a method of sorting in order from first to last according to the target delivery time at the delivery location. The above-mentioned second sorting method is a method of sorting in order from large to small according to the urgency of the waybills. The above-mentioned urgency is determined based on the location of the target transportation capacity, the current time, and the target arrival time at the delivery location. For example, see Figure 1 The determination is performed in the manner described in step 102 of the corresponding embodiment, which will not be described in detail here.
[0120] Step 703, setting the sorted first-category waybills before the sorted second-category waybills to obtain the sorting order of the waybills.
[0121] In this embodiment, the execution entity can place the sorted first-class waybills before the sorted second-class waybills to obtain the sorting order of each waybill. Thus, orders that have been picked up but not yet delivered can be delivered first, which helps to improve the rationality of route planning.
[0122] In some optional implementations of the present embodiment, when various types of waybills are sorted in at least two sorting methods, for each sorting method, the first type of waybills under the sorting method can be set before the second type of waybills sorted in the same sorting method, to obtain the sorting order of each waybill under various sorting methods. As an example, when various types of waybills (including the first type of waybills and the second type of waybills) are sorted according to the first sorting method and the second sorting method, respectively, the first type of waybills sorted according to the above-mentioned first sorting method can be set before the second type of waybills sorted according to the above-mentioned first sorting method, to obtain the first sorting order of each waybill; and the first type of waybills sorted according to the above-mentioned second sorting method can be set before the second type of waybills sorted according to the above-mentioned second sorting method, to obtain the second sorting order of each waybill.
[0123] Step 704 , planning the routes for the places to be visited in each waybill according to the sorting order of the waybill, and obtaining a sequence of the places to be visited.
[0124] In this embodiment, the execution subject can perform path planning for the places to be visited in each waybill according to the sorting order of the waybill to obtain a sequence of places to be visited. The specific execution method can be found in step 102, which will not be described in detail here.
[0125] In some optional implementations of this embodiment, when various waybills are sorted in at least two sorting modes, the sorting order of each waybill in each sorting mode can be obtained. At this time, for each sorting mode, according to the sorting order of the waybills in the sorting mode, the path planning can be performed for the places to be visited in each waybill, and at least two sequences of places to be visited can be obtained. Then, the best sequence of places to be visited can be selected from them.
[0126] As an example, when various types of waybills (including first-class waybills and second-class waybills) are sorted according to the first sorting method and the second sorting method, respectively, the first sorting order and the second sorting order of each waybill can be obtained. At this time, the objective function and constraints of the path planning can be first obtained. Then, based on the above objective function and the above constraints, the paths of the places to be visited in each waybill can be planned according to the first sorting order of each waybill to obtain a first sequence of places to be visited. Optionally, the objective function can be used to minimize the delivery timeout and the delivery distance. The above constraints may include but are not limited to: the access time of the pickup location is later than the shipping time of the item, and the access time of the pickup location of the same waybill is earlier than the access time of the delivery location. Afterwards, based on the above objective function and the above constraints, the paths of the places to be visited in each waybill can be planned according to the second sorting order of the waybill to obtain a second sequence of places to be visited. Finally, one of the sequences of places to be visited can be selected based on the objective function value corresponding to each sequence of places to be visited. For example, if the objective function is used to minimize the delivery timeout duration and the delivery distance, the smaller the objective function value, the better the sequence of places to be visited, and thus the sequence of places to be visited with a smaller objective function value can be selected.
[0127] By performing sorting in a variety of sorting methods and respectively determining the sequence of places to be visited corresponding to the various sorting methods, the quality of path planning can be improved by selecting the optimal sequence of places to be visited.
[0128] Step 705: Use the sequence of locations to be visited as the initial sequence.
[0129] Step 706: Randomly remove some of the locations to be visited from the initial sequence to obtain a remaining sequence.
[0130] Step 707, reinsert the removed location to be visited into the remaining sequence to obtain a recombined sequence.
[0131] Step 708: locally adjust the recombinant sequence to obtain the target sequence.
[0132] Step 709: When the preset end condition is met, a path planning result is generated based on the target sequence.
[0133] Steps 705 to 709 of this embodiment can be found in Figure 1 Steps 103 to 107 of the corresponding embodiment are not described in detail here.
[0134] from Figure 7 It can be seen that Figure 1Compared with the corresponding embodiment, the process 700 of the path planning method in this embodiment involves classifying orders and sorting orders without pickup locations before orders with pickup locations, so that orders that have been picked up but not yet delivered can be delivered first, which helps to improve the rationality of path planning.
[0135] Further references Figure 8 The present application provides an embodiment of a path planning device, which can be specifically applied to various electronic devices.
[0136] like Figure 8 As shown, the path planning device 800 described in this embodiment includes: an acquisition unit 801, configured to acquire waybills whose target capacity has not been processed, wherein the above waybills record places to be visited; a path planning unit 802, configured to sort the above waybills, and plan paths for the places to be visited in the above waybills according to the sorting order of the waybills to obtain a sequence of places to be visited; a path adjustment unit 803, configured to use the above sequence of places to be visited as an initial sequence, and perform the following path adjustment steps: randomly remove some places to be visited from the above initial sequence to obtain a remaining sequence; reinsert the removed places to be visited into the above remaining sequence to obtain a recombined sequence; locally adjust the above recombined sequence to obtain a target sequence; and generate a path planning result based on the above target sequence when a preset end condition is met.
[0137] The process of obtaining the initial sequence can obtain a feasible solution to the initial path planning problem. The process of reorganizing the initial sequence can realize a rough search for the optimal solution. The process of locally adjusting the reorganized sequence can realize a fine search for the optimal solution. The path planning result obtained through the process of initialization, rough search, and fine search can effectively obtain the path planning result and avoid the failure of obtaining the optimal solution compared to the method of directly calculating the optimal solution based on a large amount of data in the prior art. At the same time, the local optimal solution is used in the process of determining the path planning result, which reduces the amount of data calculation and improves the efficiency of solving the path planning problem, thereby improving the applicability of online scenarios.
[0138] In some optional implementations of this embodiment, the apparatus further includes: an execution unit configured to: when the preset end condition is not met, use the target sequence as the initial sequence and continue to execute the path adjustment step.
[0139] Thus, when the preset end condition is not met, the path adjustment step can be iteratively executed multiple times. The more times this step is executed, the better the final path planning result will be, thus balancing the quality of the path planning result and the time consumption of path planning.
[0140] In some optional implementations of the present embodiment, the path planning unit 802 is further configured to: treat the waybills whose locations to be visited are delivery locations as first-class waybills, treat the waybills whose locations to be visited include pickup locations and delivery locations as second-class waybills, and sort the first-class waybills and the second-class waybills respectively; set the sorted first-class waybills before the sorted second-class waybills to obtain the sorting order of the waybills.
[0141] As a result, orders that have been picked up but not yet delivered can be delivered first, which helps to improve the rationality of route planning.
[0142] In some optional implementations of the present embodiment, the target arrival time of the delivery location is also recorded in the waybill; and the path planning unit 802 is further configured to: sort the various types of waybills according to a first sorting method and a second sorting method, respectively, wherein the first sorting method is a method of sorting in order from first to last according to the target delivery time of the delivery location, and the second sorting method is a method of sorting in order from high to low according to the urgency of the waybills, and the urgency is determined based on the location of the target transportation capacity, the current time and the target arrival time of the delivery location.
[0143] By performing sorting in a variety of sorting methods and respectively determining the sequences of places to be visited corresponding to the various sorting methods, the quality of path planning can be improved by selecting the optimal sequence of places to be visited.
[0144] In some optional implementations of the present embodiment, the path planning unit 802 is further configured to: set the first category of waybills sorted according to the first sorting method before the second category of waybills sorted according to the first sorting method, to obtain a first sorting order of the waybills; set the first category of waybills sorted according to the second sorting method before the second category of waybills sorted according to the second sorting method, to obtain a second sorting order of the waybills.
[0145] As a result, orders that have been picked up but not yet delivered can be delivered first, which helps to improve the rationality of route planning.
[0146] In some optional implementations of the present embodiment, the path planning unit 802 is further configured to: obtain an objective function and constraints for path planning; based on the objective function and the constraints, perform path planning for the places to be visited in the waybill according to a first sorting order to obtain a first sequence of places to be visited; based on the objective function and the constraints, perform path planning for the places to be visited in the waybill according to a second sorting order to obtain a second sequence of places to be visited; based on the objective function value corresponding to each sequence of places to be visited, select one of the sequences of places to be visited.
[0147] By performing sorting in a variety of sorting methods and respectively determining the sequences of places to be visited corresponding to the various sorting methods, the quality of path planning can be improved by selecting the optimal sequence of places to be visited.
[0148] In some optional implementations of this embodiment, the above objective function is used to minimize the delivery timeout duration and the delivery distance, and the above constraints include: the access time of the pick-up location is later than the shipment time of the items, and the access time of the pick-up location of the same waybill is earlier than the access time of the delivery location.
[0149] In some optional implementations of this embodiment, the path adjustment unit 803 is further configured to: determine a target number based on the total number of places to be visited; randomly select the target number of waybills, and remove the places to be visited in the randomly selected waybills from the initial sequence.
[0150] Therefore, the number of removed places to be visited is related to the total number of places to be visited. Since the total number of places to be visited can represent the scale of the path planning problem, the number of removed places to be visited is related to the scale of the path planning problem, which can ensure the rationality of the number of reorganized places to be visited.
[0151] In some optional implementations of the present embodiment, the path adjustment unit 803 is further configured to: summarize the removed places to be visited into a removal sequence; obtain the objective function and constraints of the path planning; take out the places to be visited in the removal sequence one by one, and perform the following steps: insert the taken out places to be visited into each feasible position in the remaining sequence, and determine the objective function value when inserted into each feasible position, the feasible position being the position that satisfies the constraints; take the feasible position with the minimum objective function value as the target position, and insert the taken out places to be visited into the target position in the remaining sequence; determine the remaining sequence with the places to be visited in the removal sequence inserted as a reorganized sequence.
[0152] By reinserting the randomly selected locations to be visited into the remaining sequence to obtain a reorganized sequence, a rough search for the solution to the path planning is achieved. In this process, since the sequence is reorganized by inserting one by one, a solution based on a greedy strategy is adopted. Compared with the method of directly determining the overall optimal solution in the prior art, the efficiency of solving the path planning problem is improved, and the applicability of online scenarios is improved. At the same time, the path planning results can be effectively obtained, avoiding the failure of obtaining the optimal solution. Compared with directly using the initial sequence, the quality of the solution can be improved.
[0153] In some optional implementations of this embodiment, the to-be-visited location in the waybill includes a delivery location, and the waybill records the target arrival time of the delivery location; and the path adjustment unit 803 is further configured to: determine the estimated arrival time of the delivery location of the waybill based on the reorganized sequence; determine an early delivery waybill, and add a first mark to the early delivery waybill, the early delivery waybill being a waybill whose estimated arrival time at the delivery location is earlier than the target arrival time; perform the following first partial adjustment step: select the waybill with the largest difference between the target arrival time and the estimated arrival time from the waybill with the first mark as the first target waybill, and use the delivery location in the first target waybill as the first target delivery location; in response to the first target delivery location not being located at the end of the reorganized sequence, move the first target delivery location backward in the reorganized sequence, and delete the first mark of the first target waybill. Detect whether there is a waybill with the first mark, and if so, re-execute the first partial adjustment step.
[0154] In this way, not only can the early delivery waybill be changed to a later delivery, so that more urgent waybill can be processed earlier, but the delivery address in the early delivery waybill can also be adjusted to the most reasonable location, further improving the quality and rationality of the solution to the path planning problem.
[0155] In some optional implementations of the present embodiment, the path adjustment unit 803 is further configured to: take the position of the first target delivery location in the reorganized sequence as the first original position, and remove the first target delivery location from the reorganized sequence; obtain the objective function and constraint conditions of the path planning; insert the first target delivery location into each feasible position after the first original position in the reorganized sequence, and determine the objective function value when inserted into each feasible position, the feasible position being a position that satisfies the constraint conditions; take the feasible position with the minimum objective function value as the first updated position, and insert the first target delivery location into the first updated position.
[0156] In this way, not only can the early delivery waybill be changed to a later delivery, so that more urgent waybill can be processed earlier, but the delivery address in the early delivery waybill can also be adjusted to the most reasonable location, further improving the quality and rationality of the solution to the path planning problem.
[0157] In some optional implementations of this embodiment, the to-be-visited location in the waybill includes a delivery location, and the waybill records the target arrival time of the delivery location; and the path adjustment unit 803 is further configured to: determine the estimated arrival time of the delivery location of the waybill based on the reorganized sequence; determine a delayed delivery waybill, and add a second mark to the delayed delivery waybill, the delayed delivery waybill being a waybill whose estimated arrival time at the delivery location is later than the target arrival time; perform the following second local adjustment step: select the waybill with the largest difference between the estimated arrival time and the target arrival time from the waybill with the second mark as the second target waybill, and use the delivery location in the second target waybill as the second target delivery location; in response to the second target delivery location not being located at the beginning of the reorganized sequence, move the second target delivery location forward in the reorganized sequence, and delete the second mark of the second target waybill. Detect whether there is a waybill with the second mark, and if so, re-execute the second local adjustment step.
[0158] By moving forward the position of the delivery location in each delayed delivery order to partially adjust the reorganization sequence, the delivery order of each delayed delivery order can be advanced, thereby avoiding delayed delivery of orders or reducing the timeout time of delayed delivery orders. In this way, the quality and rationality of the solution to the path planning problem can be further improved.
[0159] In some optional implementations of the present embodiment, the path adjustment unit 803 is further configured to: take the position of the second target delivery location in the reorganized sequence as the second original position, and remove the second target delivery location from the reorganized sequence; obtain the objective function and constraint conditions of the path planning; insert the second target delivery location into each feasible position before the second original position in the reorganized sequence, and determine the objective function value when inserted into each feasible position, the feasible position being the position that satisfies the constraint conditions; take the feasible position with the minimum objective function value as the second updated position, and insert the second target delivery location into the second updated position.
[0160] In this way, not only can the delivery order of delayed delivery waybills be advanced, but the delivery address in the delayed delivery waybills can also be adjusted to the most reasonable location, further improving the quality and rationality of the solution to the path planning problem.
[0161] In some optional implementations of this embodiment, the to-be-visited location in the waybill includes a delivery location; and the path adjustment unit 803 is further configured to: add a third mark to the delivery location in the reorganized sequence; perform the following third local adjustment step: take any delivery location with the third mark in the reorganized sequence as the third target delivery location, and take the third target delivery location from the reorganized sequence; obtain the objective function and preset conditions of the path planning; insert the third target delivery location into each feasible position in the reorganized sequence, and determine the objective function value when inserted into each feasible position, the feasible position is the position that satisfies the constraint conditions; take the feasible position with the minimum objective function value as the third updated position, insert the third target delivery location into the third updated position, and delete the third mark of the third target delivery location. Detect whether there is a delivery location with the third mark in the reorganized sequence, and if so, re-execute the third local adjustment step.
[0162] Thus, each delivery location in the reorganized sequence can be taken out and reinserted as the third target delivery location one by one. Thus, more feasible solutions are further searched, and the optimal solution (i.e., the sequence with the smallest objective function value) is selected from these feasible solutions, which can further improve the quality of the solution to the path planning problem.
[0163] In some optional implementations of this embodiment, the to-be-visited locations in the waybill include delivery locations; and the path adjustment unit 803 is further configured to: add a fourth mark to the delivery locations in the reorganized sequence; perform the following fourth local adjustment step: obtain the objective function and constraint conditions of the path planning; use any delivery location with the fourth mark in the reorganized sequence as the fourth target delivery location, exchange the fourth target delivery location with the remaining to-be-visited locations in the reorganized sequence, obtain the objective function value under each exchange mode, and determine whether each exchange mode satisfies the constraint conditions; use the exchange mode with the minimum objective function value and the constraint conditions as the target exchange mode, exchange the position of the fourth target delivery location with the target exchange mode, and delete the fourth mark of the fourth target delivery location. Detect whether there is a delivery location with the fourth mark in the reorganized sequence, and if so, re-execute the fourth local adjustment step.
[0164] Thus, each delivery location in the reorganized sequence can be used as the fourth target delivery location one by one to detect the quality of the feasible solution when it is exchanged with the remaining locations to be visited. Thus, more feasible solutions are further searched, and the optimal solution (i.e., the sequence with the smallest objective function value) is selected among these feasible solutions, which can further improve the quality of the solution to the path planning problem.
[0165] In some optional implementations of the present embodiment, the path adjustment unit 803 is further configured to: take the time difference between the current time and the time of obtaining the waybill of the target capacity as processing time, and detect whether the processing time is greater than or equal to a preset threshold; in response to the processing time being greater than or equal to the preset threshold, determine that the preset end condition is met, and the preset threshold is related to the total number of places to be visited; in response to the time difference being less than the preset threshold, determine that the preset end condition is not met.
[0166] Therefore, the duration of path planning solution can be limited from the time, further improving the applicability to online scenarios. In addition, since the total number of places to be visited can represent the scale of the path planning problem, the preset threshold is set to a number related to the scale of the path planning problem to ensure the rationality of the preset threshold.
[0167] Reference below Fig. 9 , which shows a schematic diagram of the structure of a computer system 900 suitable for implementing an electronic device of an embodiment of the present application. Fig. 9 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0168] like Fig. 9 As shown, the computer system 900 includes a central processing unit (CPU) 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage part 908 into a random access memory (RAM) 903. In the RAM 903, various programs and data required for the operation of the system 900 are also stored. The CPU 901, the ROM 902, and the RAM 903 are connected to each other via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.
[0169] The following components are connected to the I / O interface 905: an input section 906 including a keyboard, a mouse, etc.; an output section 907 including a liquid crystal display (LCD), etc. and a speaker, etc.; a storage section 908 including a hard disk, etc.; and a communication section 909 including a network interface card such as a LAN card, a modem, etc. The communication section 909 performs communication processing via a network such as the Internet. A drive 910 is also connected to the I / O interface 905 as needed. A removable medium 911, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 910 as needed, so that a computer program read therefrom is installed into the storage section 908 as needed.
[0170] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 909, and / or installed from the removable medium 911. When the computer program is executed by the central processing unit (CPU) 901, the above functions defined in the method of the present application are executed. It should be noted that the computer-readable medium described in the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, - but not limited to - an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to, an electrical connection with one or more conductors, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, an apparatus or a device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in combination with an instruction execution system, an apparatus or a device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0171] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0172] The units involved in the embodiments described in this application may be implemented by software or hardware. The units described may also be arranged in a processor, wherein the names of these units do not constitute limitations on the units themselves in certain circumstances.
[0173] As another aspect, the present application also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently and not be assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by the device, the device: obtains the waybills that have not been processed by the target capacity, and the waybills record the places to be visited; sorts the waybills, and plans the paths for the places to be visited in the waybills according to the sorting order of the waybills to obtain a sequence of places to be visited; uses the sequence of places to be visited as the initial sequence, and randomly removes some places to be visited from the initial sequence to obtain the remaining sequence; reinserts the removed places to be visited into the remaining sequence to obtain a recombined sequence; partially adjusts the recombined sequence to obtain a target sequence; generates a path planning result based on the target sequence when the preset end condition is met.
[0174] The above description is only a preferred embodiment of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the present application is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above invention concept. For example, the above features are replaced with the technical features with similar functions disclosed in this application (but not limited to) by each other to form a technical solution.
Claims
1. A path planning method, characterized in that: The method comprises: Obtaining unprocessed waybills of the target transport capacity, wherein the waybills record locations to be visited; Sorting the waybills, and planning paths for the places to be visited in the waybills according to the sorting order of the waybills to obtain a sequence of places to be visited; Taking the sequence of places to be visited as the initial sequence, the following path adjustment steps are performed: randomly removing some places to be visited from the initial sequence to obtain a remaining sequence; reinserting the removed places to be visited into the remaining sequence to obtain a recombined sequence; locally adjusting the recombined sequence to obtain a target sequence; and generating a path planning result based on the target sequence when a preset end condition is met; Wherein, the sorting of the waybills includes: The waybills whose to-be-visited locations are delivery locations are classified as first-category waybills, and the waybills whose to-be-visited locations include pickup locations and delivery locations are classified as second-category waybills, and the first-category waybills and the second-category waybills are sorted respectively; The sorted first-class waybills are set before the sorted second-class waybills to obtain the sorting order of the waybills; The waybill also records the target arrival time of the delivery location; and the sorting of the first category waybill and the second category waybill respectively includes: Sorting the various types of waybills according to a first sorting method and a second sorting method, respectively, wherein the first sorting method is a method of sorting the waybills in order of target delivery time at the delivery location from earliest to latest, and the second sorting method is a method of sorting the waybills in order of urgency from largest to smallest, wherein the urgency is determined based on the location of the target transport capacity, the current time, and the target arrival time at the delivery location; The step of placing the sorted first-category waybills before the sorted second-category waybills to obtain the sorting order of the waybills includes: The first category of waybills sorted according to the first sorting method are arranged before the second category of waybills sorted according to the first sorting method, to obtain a first sorting order of the waybills; The first category waybills sorted according to the second sorting method are set before the second category waybills sorted according to the second sorting method to obtain a second sorting order of the waybills.
2. The method according to claim 1, characterized in that The method further comprises: When the preset end condition is not met, the target sequence is used as the initial sequence and the path adjustment step is continued.
3. The method according to claim 1, characterized in that The step of performing path planning for the places to be visited in the waybill according to the sorting order of the waybill to obtain a sequence of places to be visited includes: Obtain the objective function and constraints of path planning; Based on the objective function and the constraint condition, path planning is performed for the places to be visited in the waybill according to the first sorting order to obtain a first sequence of places to be visited; Based on the objective function and the constraint condition, path planning is performed for the places to be visited in the waybill according to the second sorting order to obtain a second sequence of places to be visited; Based on the objective function values corresponding to each sequence of locations to be visited, one of the sequences of locations to be visited is selected.
4. The method according to claim 3, characterized in that The objective function is used to minimize the delivery timeout and the delivery distance, and the constraints include: the access time of the pickup location is later than the item shipment time, and the access time of the pickup location of the same waybill is earlier than the access time of the delivery location.
5. The method according to claim 1, characterized in that The randomly removing some of the locations to be visited from the initial sequence to obtain the remaining sequence includes: Determine the target number based on the total number of locations to be visited; The target number of waybills are randomly selected, and the places to be visited in the randomly selected waybills are removed from the initial sequence.
6. The method according to claim 1, characterized in that The step of reinserting the removed to-be-visited location into the remaining sequence to obtain a recombinant sequence comprises: Summarize the removed locations to be visited into a removal sequence; Obtain the objective function and constraints of path planning; Take out the places to be visited in the removed sequence one by one, and perform the following steps: insert the taken out places to be visited into each feasible position in the remaining sequence, and determine the objective function value when inserting into each feasible position, wherein the feasible position is the position that satisfies the constraint condition; take the feasible position with the minimum objective function value as the target position, and insert the taken out places to be visited into the target position in the remaining sequence; The remaining sequence inserted into the location to be visited in the removed sequence is determined as the recombinant sequence.
7. The method according to claim 1, characterized in that The location to be visited in the waybill includes a delivery location, and the waybill records a target arrival time of the delivery location; and the locally adjusting the recombined sequence to obtain a target sequence includes: Determining an estimated arrival time of the delivery location of the waybill based on the reorganized sequence; Determine an early delivery waybill and add a first mark to the early delivery waybill, wherein the early delivery waybill is a waybill whose estimated arrival time at the delivery location is earlier than the target arrival time; The following first local adjustment step is performed: from the waybills with the first mark, the waybills with the largest difference between the target arrival time and the estimated arrival time are selected as the first target waybills, and the delivery location in the first target waybills is used as the first target delivery location; in response to the first target delivery location not being located at the end of the recombined sequence, the position of the first target delivery location in the recombined sequence is moved backward, and the first mark of the first target waybills is deleted; Check whether there is a waybill with the first mark. If so, re-execute the first local adjustment step.
8. The method according to claim 7, characterized in that The adjusting the position of the first target delivery site in the recombinant sequence comprises: taking the position of the first target delivery location in the recombinant sequence as the first original position, and removing the first target delivery location from the recombinant sequence; Obtain the objective function and constraints of path planning; Inserting the first target delivery location into each feasible position after the first original position in the recombined sequence, and determining the objective function value when inserting into each feasible position, wherein the feasible position is a position that satisfies the constraint condition; The feasible position when the objective function value is the smallest is used as the first updated position, and the first target delivery location is inserted into the first updated position.
9. The method according to claim 1, characterized in that: The location to be visited in the waybill includes a delivery location, and the waybill records a target arrival time of the delivery location; and the locally adjusting the recombined sequence to obtain a target sequence includes: Determining an estimated arrival time of the delivery location of the waybill based on the reorganized sequence; Determine a delayed delivery waybill and add a second mark to the delayed delivery waybill, wherein the delayed delivery waybill is a waybill whose estimated arrival time at the delivery location is later than the target arrival time; The following second local adjustment step is performed: from the waybills with the second mark, the waybills with the largest difference between the estimated arrival time and the target arrival time are selected as the second target waybills, and the delivery location in the second target waybills is used as the second target delivery location; in response to the second target delivery location not being located at the head end of the recombined sequence, the position of the second target delivery location in the recombined sequence is moved forward, and the second mark of the second target waybills is deleted; Check whether there is a waybill with the second mark. If so, re-execute the second local adjustment step.
10. The method according to claim 9, characterized in that The adjusting the position of the second target delivery site in the recombinant sequence comprises: taking the position of the second target delivery location in the recombinant sequence as the second original position, and removing the second target delivery location from the recombinant sequence; Obtain the objective function and constraints of path planning; Inserting the second target delivery location into each feasible position before the second original position in the recombined sequence, and determining the objective function value when inserting into each feasible position, wherein the feasible position is a position that satisfies the constraint condition; The feasible position when the objective function value is the smallest is used as the second updated position, and the second target delivery location is inserted into the second updated position.
11. The method according to claim 1, characterized in that: The places to be visited in the waybill include the delivery places; And, the locally adjusting the recombinant sequence to obtain a target sequence comprises: adding a third marker for the delivery site in the recombinant sequence; The following third local adjustment step is performed: any delivery location with the third mark in the reorganized sequence is taken as a third target delivery location, and the third target delivery location is taken out from the reorganized sequence; the objective function and preset conditions of the path planning are obtained; the third target delivery location is respectively inserted into each feasible position in the reorganized sequence, and the objective function value when inserted into each feasible position is determined, and the feasible position is a position that satisfies the constraint condition; Taking the feasible position when the objective function value is the minimum as the third updated position, inserting the third target delivery location into the third updated position, and deleting the third mark of the third target delivery location; Detect whether there is a delivery location with the third tag in the recombinant sequence, and if so, re-execute the third local adjustment step.
12. The method according to claim 1, characterized in that The places to be visited in the waybill include the delivery places; And, the locally adjusting the recombinant sequence to obtain a target sequence comprises: adding a fourth marker for the delivery site in the recombinant sequence; The following fourth local adjustment step is performed: obtaining the objective function and constraint conditions of the path planning; taking any delivery location with the fourth mark in the reorganized sequence as a fourth target delivery location, exchanging the fourth target delivery location with the remaining to-be-visited locations in the reorganized sequence, obtaining the objective function value under each exchange mode, and determining whether each exchange mode satisfies the constraint conditions; taking the exchange mode with the minimum objective function value and satisfying the constraint conditions as the target exchange mode, exchanging the position of the fourth target delivery location with the target exchange mode, and deleting the fourth mark of the fourth target delivery location; Detect whether there is a delivery location with the fourth tag in the recombinant sequence, and if so, re-execute the fourth local adjustment step.
13. The method according to claim 1, characterized in that Check whether the preset end conditions are met through the following steps: Taking the time difference between the current time and the acquisition time of the waybill of the target transport capacity as the processing time, and detecting whether the processing time is greater than or equal to a preset threshold; In response to the processing time being greater than or equal to the preset threshold, determining that a preset end condition is satisfied, wherein the preset threshold is related to the total number of places to be visited; In response to the time difference being less than the preset threshold, it is determined that the preset end condition is not satisfied.
14. A path planning device, characterized in that: The device comprises: An acquisition unit is configured to acquire a waybill that has not been processed by the target transport capacity, wherein the waybill records the location to be visited; a path planning unit configured to sort the waybills, and plan paths for the places to be visited in the waybills according to the sorting order of the waybills, to obtain a sequence of places to be visited; The path adjustment unit is configured to use the sequence of places to be visited as an initial sequence and perform the following path adjustment steps: randomly removing some places to be visited from the initial sequence to obtain a remaining sequence; reinserting the removed places to be visited into the remaining sequence to obtain a recombined sequence; locally adjusting the recombined sequence to obtain a target sequence; and generating a path planning result based on the target sequence when a preset end condition is met; Wherein, the sorting of the waybills includes: The waybills whose to-be-visited locations are delivery locations are classified as first-category waybills, and the waybills whose to-be-visited locations include pickup locations and delivery locations are classified as second-category waybills, and the first-category waybills and the second-category waybills are sorted respectively; The sorted first-class waybills are set before the sorted second-class waybills to obtain the sorting order of the waybills; The waybill also records the target arrival time of the delivery location; and the sorting of the first category waybill and the second category waybill respectively includes: Sorting the various types of waybills according to a first sorting method and a second sorting method, respectively, wherein the first sorting method is a method of sorting the waybills in order of target delivery time at the delivery location from earliest to latest, and the second sorting method is a method of sorting the waybills in order of urgency from largest to smallest, wherein the urgency is determined based on the location of the target transport capacity, the current time, and the target arrival time at the delivery location; The step of placing the sorted first-category waybills before the sorted second-category waybills to obtain the sorting order of the waybills includes: The first category of waybills sorted according to the first sorting method are arranged before the second category of waybills sorted according to the first sorting method, to obtain a first sorting order of the waybills; The first category waybills sorted according to the second sorting method are set before the second category waybills sorted according to the second sorting method to obtain a second sorting order of the waybills.
15. An electronic device, characterized in that: include: one or more processors; A storage device having one or more programs stored thereon, when the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 13.
16. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 13 is implemented.
Citation Information
Patent Citations
Method and device used for path planning
CN108492068A
Path planning method and device
CN110231044A