Route planning method and device of logistics network, computer equipment and storage medium
By coding the logistics network for two-dimensional codes of the arrival time of outlets and vehicles, combining fitness calculation and genetic processing, optimizing the logistics network route planning, the problem of inaccurate route planning in traditional methods is solved, and more efficient and accurate route planning is achieved.
Patent Information
- Application Number
- CN202410083192.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-19
- Publication Date
- 2025-07-22
AI Technical Summary
The traditional logistics network route planning method has low accuracy and cannot look at the overall situation, resulting in inaccurate planning routes.
The population is initialized using two-dimensional encoding based on the outlet dimension and vehicle arrival time, and iteratively optimized route planning through fitness calculation and genetic processing until the preset conditions are met, and the target planned route and vehicle arrival time are determined.
It improves the accuracy and efficiency of logistics network route planning, can quickly search high-quality solutions among a large number of feasible solutions, and reduces the computational complexity.
Smart Images

Figure CN120355327A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and particularly to a method, device, computer equipment, and storage medium for route planning of a logistics network. Background Art
[0002] To ensure that vehicles in the logistics network execute logistics distribution tasks in an orderly manner and save logistics costs, it is necessary to perform route planning based on the logistics network.
[0003] In traditional technologies, the route planning of the logistics network usually adopts the method of manual planning. However, the scope considered by manual planning is limited and it is impossible to take an overall view of the situation, resulting in the problem that the planned routes often have low accuracy. Summary of the Invention
[0004] Based on this, in view of the above technical problems, it is necessary to provide a method, device, computer equipment, computer-readable storage medium, and computer program product for route planning of a logistics network, which can improve the accuracy of route planning of the logistics network.
[0005] In a first aspect, this application provides a method for route planning of a logistics network, including: performing node dimension encoding based on the nodes included in the logistics network, performing time dimension encoding based on the vehicle arrival time of the nodes, initializing a population based on the encoding results to obtain an initial population; each individual in the initial population is respectively used to represent the planned route of the logistics network under a certain route planning method;; calculating the fitness of each individual in the initial population to obtain the fitness of each individual in the initial population; based on the fitness of each individual in the initial population, performing genetic processing on the initial population to obtain a next-generation population; using the next-generation population as the initial population, and repeating the step of calculating the fitness of each individual in the initial population until the initial population meets a preset condition; according to the initial population that meets the preset condition, determining the target planned route and the vehicle arrival time of each node in the target planned route.
[0006] Second aspect, the present application further provides a route planning device for a logistics network, including: an encoding module, configured to perform node dimension encoding based on the nodes included in the logistics network, perform time dimension encoding based on the vehicle arrival time of the nodes, and perform population initialization based on the encoding result to obtain an initial population, where each individual in the initial population is respectively used to represent the planned route of the logistics network under a route planning method;; a fitness calculation module, configured to calculate the fitness of each individual in the initial population to obtain the fitness of each individual in the initial population; a genetic processing module, based on the fitness of each individual in the initial population, perform genetic processing on the initial population to obtain a next-generation population; an iteration module, configured to use the next-generation population as the initial population and repeat the step of calculating the fitness of each individual in the initial population until the initial population meets a preset condition; a target route determination module, configured to determine a target planned route and the vehicle arrival time of each node in the target planned route according to the initial population that meets the preset condition.
[0007] Third aspect, the present application further provides a computer device, including a memory and a processor, where the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented: perform node dimension encoding based on the nodes included in the logistics network, perform time dimension encoding based on the vehicle arrival time of the nodes, perform population initialization based on the encoding result to obtain an initial population; each individual in the initial population is respectively used to represent the planned route of the logistics network under a route planning method; calculate the fitness of each individual in the initial population to obtain the fitness of each individual in the initial population; based on the fitness of each individual in the initial population, perform genetic processing on the initial population to obtain a next-generation population; use the next-generation population as the initial population and repeat the step of calculating the fitness of each individual in the initial population until the initial population meets a preset condition; determine a target planned route and the vehicle arrival time of each node in the target planned route according to the initial population that meets the preset condition.
[0008] Fourthly, the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented: performing node dimension encoding based on the nodes included in the logistics network, performing time dimension encoding based on the vehicle arrival time of the nodes, performing population initialization based on the encoding results to obtain an initial population; each individual in the initial population is respectively used to represent the planned route of the logistics network under a route planning mode; calculating the fitness of each individual in the initial population to obtain the fitness of each individual in the initial population; performing genetic processing on the initial population based on the fitness of each individual in the initial population to obtain the next generation population; taking the next generation population as the initial population, and repeating the step of calculating the fitness of each individual in the initial population until the initial population meets a preset condition; determining the target planned route and the vehicle arrival time of each node in the target planned route according to the initial population that meets the preset condition.
[0009] Fifthly, the present application further provides a computer program product, including a computer program. When the computer program is executed by a processor, the following steps are implemented: performing node dimension encoding based on the nodes included in the logistics network, performing time dimension encoding based on the vehicle arrival time of the nodes, performing population initialization based on the encoding results to obtain an initial population; each individual in the initial population is respectively used to represent the planned route of the logistics network under a route planning mode; calculating the fitness of each individual in the initial population to obtain the fitness of each individual in the initial population; performing genetic processing on the initial population based on the fitness of each individual in the initial population to obtain the next generation population; taking the next generation population as the initial population, and repeating the step of calculating the fitness of each individual in the initial population until the initial population meets a preset condition; determining the target planned route and the vehicle arrival time of each node in the target planned route according to the initial population that meets the preset condition.
[0010] The above-mentioned route planning method, device, computer equipment, storage medium and computer program product for a logistics network perform node dimension coding based on the nodes included in the logistics network, perform time dimension coding based on the vehicle arrival time of the nodes, and perform population initialization based on the coding results to obtain an initial population; each individual in the initial population is respectively used to represent the planned route of the logistics network under a certain route planning method, calculate the fitness of each individual in the initial population to obtain the fitness of each individual in the initial population, perform genetic processing on the initial population based on the fitness of each individual in the initial population to obtain the next-generation population, use the next-generation population as the initial population, and repeat the step of calculating the fitness of each individual in the initial population until the initial population meets the preset conditions; according to the initial population that meets the preset conditions, determine the target planned route and the vehicle arrival time of each node in the target planned route. Since two-dimensional coding is used during coding to add the vehicle arrival time other than the nodes as a decision variable, high-quality solutions including the planned route and arrival time can be quickly searched from a large number of feasible solutions during the genetic processing process, so that a relatively accurate planned route can be obtained, improving the accuracy of route planning. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following will briefly introduce the drawings required for use in the description of the embodiments or related technologies. Obviously, the following drawings are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0012] Figure 1 It is an application environment diagram of the route planning method for a logistics network in an embodiment;
[0013] Figure 2 It is a schematic flowchart of the route planning method for a logistics network in an embodiment;
[0014] Figure 3 It is a schematic flowchart of the steps for determining fitness in an embodiment;
[0015] Figure 4 It is a schematic diagram of a logistics network in an embodiment;
[0016] Figure 5 It is a schematic flowchart of the steps for determining fitness in an embodiment;
[0017] Figure 6 It is a schematic flowchart of the steps for genetic processing in an embodiment;
[0018] Figure 7 It is a structural block diagram of the route planning device for a logistics network in an embodiment;
[0019] Figure 8 is the internal structure diagram of a computer device in an embodiment;
[0020] Figure 9 is the internal structure diagram of a computer device in another embodiment. Detailed implementation manners
[0021] In order to make the objectives, technical solutions and advantages of the present application clearer and more understandable, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0022] The route planning method of the logistics network provided by the embodiments of the present application can be applied to an application environment as Figure 1 shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or placed in the cloud or other network servers.
[0023] The route planning method of the logistics network provided by the embodiments of the present application can be executed by a computer device. The computing device can be a terminal or a server, or a system composed of a terminal and a server, and is realized through the interaction between the terminal and the server. For example, the terminal 102 can send a route planning request for the logistics network to the server 104. After receiving the route planning request, the server 104 performs grid dimension coding based on the grids included in the logistics network, and performs time dimension coding based on the vehicle arrival time of the grids. Based on the coding results, population initialization is performed to obtain an initial population. The fitness of each individual in the initial population is calculated to obtain the fitness of each individual in the initial population. Based on the fitness of each individual in the initial population, genetic processing is performed on the initial population to obtain the next generation population. The next generation population is used as the initial population, and the step of calculating the fitness of each individual in the initial population is repeatedly executed until the initial population meets the preset conditions; according to the initial population that meets the preset conditions, the target planning route and the vehicle arrival time of each grid in the target planning route are determined. The server 104 can send the obtained target planning route and the vehicle arrival time of each grid in the target planning route to the terminal.
[0024] Among them, the terminal 102 can be but is not limited to various personal computers, laptop computers, smart phones, tablet computers, Internet of Things devices, and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart in-vehicle devices, etc. The portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server 104 can be implemented by an independent server or a server cluster composed of multiple servers.
[0025] In an exemplary embodiment, as Figure 2 shown, a route planning method for a logistics network is provided. Taking the method applied to the Figure 1 server in it as an example for illustration, it includes the following steps 202 to step 206. Among them:
[0026] Step 202, perform node dimension coding based on the nodes included in the logistics network, perform time dimension coding based on the vehicle arrival time of the nodes, and perform population initialization based on the coding results to obtain an initial population; each individual in the initial population is respectively used to represent the planned route of the logistics network under a route planning method.
[0027] Among them, the logistics network refers to a network composed of nodes and the routes between the nodes. A logistics network includes multiple nodes and multiple routes. The vehicle arrival time of a certain node refers to the expected arrival time of the vehicle planned for this node.
[0028] Specifically, after the server determines the logistics network that needs to perform route planning, it first determines the nodes included in the logistics network, and performs two-dimensional coding based on the nodes and the vehicle arrival time of the nodes, that is, performs node dimension coding on the nodes included in the logistics network, and performs time dimension coding on the vehicle arrival time of the nodes. After coding, the coding result corresponding to each node can be represented by a two-dimensional array. One dimension in this two-dimensional array represents the node, and the other dimension represents the vehicle arrival time. The coding methods include but are not limited to Holland binary code, Gray code, real number coding, and character coding, etc.
[0029] Taking character coding as an example, assume that the logistics network includes three nodes, namely node A, node B, and node C. Then, for node A, it can be coded as [A, A.time], for node B, it can be coded as [B, B.time], and for node C, it can be coded as [C, C.time].
[0030] After two-dimensional encoding is completed to obtain an encoding result, the server can further perform random initialization based on the encoding result, that is, randomly perform route planning according to the network points included in the logistics network to obtain M kinds of planned routes. M can be set as needed. Then, according to the planned routes, determine the vehicle arrival time of each network point in the route, and further an initial population can be obtained. The initial population includes multiple individuals, and each individual represents the planned route of the logistics network under a certain route planning method. It can be understood that under each route planning method, the number of planned routes can be one or more.
[0031] Exemplarily, when determining the vehicle arrival time of each network point in the route according to the planned route, the server can determine the vehicle arrival time of each network point based on the latest arrival time of the destination network point of the planned route, the distance between adjacent network points, and the vehicle speed.
[0032] Step 204, calculate the fitness of each individual in the initial population to obtain the fitness of each individual in the initial population.
[0033] Among them, the fitness is the value calculated by the fitness function, which is used to represent the adaptability of an individual to the environment and also represents the ability of the individual to reproduce offspring. The fitness function is a function used to measure the adaptability of an individual. Usually, the larger the fitness value of an individual, the greater the probability that it will be inherited into the next generation population.
[0034] Specifically, for each individual in the initial population, the server can use a preset fitness function to calculate the fitness to obtain the fitness of each individual in the initial population. Here, the setting of the fitness function is related to the optimization goal. In the embodiments of the present application, the optimization goal is to minimize the number of planned routes. Therefore, the fitness calculated for each individual through the fitness function can be related to the number of planned routes corresponding to each individual.
[0035] Step 206, determine whether the initial population meets the preset conditions. If not, enter step 208; if so, enter step 212.
[0036] Among them, the preset conditions can be set as needed. For example, it can be any one of the current iteration times corresponding to the initial population reaching the preset number of times, the current iteration duration corresponding to the initial population reaching the preset duration, or the fitness value corresponding to the initial population reaching the maximum value.
[0037] Specifically, the server can determine whether the initial population meets the preset conditions. If it meets, the target planned route and the vehicle arrival time of each network point in the target planned route can be determined according to the initial population. If it does not meet, genetic processing can be performed on the initial population to obtain the next generation population.
[0038] Step 208: Based on the fitness of each individual in the initial population, perform genetic processing on the initial population to obtain the next-generation population.
[0039] Among them, genetic processing refers to the processing using genetic operators, and the genetic operators include the following three: selection, crossover, and mutation.
[0040] Specifically, based on the fitness of each individual in the initial population, the server can perform selection processing on the individual using the selection operator, crossover processing using the crossover operator, and mutation processing using the mutation operator respectively to obtain the next-generation population.
[0041] Step 210: Use the next-generation population as the initial population and enter Step 204.
[0042] Specifically, the server can use the obtained next-generation population as the initial population, and then enter Step 206, so that Steps 206 to 210 can be iteratively executed.
[0043] Step 212: Determine the target planned route and the vehicle arrival times at each network point in the target planned route according to the initial population.
[0044] Specifically, the server can determine the target planned route for the individual with the maximum fitness in the initial population, and then determine the vehicle arrival times at each network point according to the target planned route.
[0045] Exemplarily, the server can determine the vehicle arrival times at each network point according to the latest arrival time of the destination network point in the target planned route, the distance between adjacent network points, and the vehicle speed. For example, assume that in the determined target planned route, a certain route is A→B→C, and the latest arrival time of network point C is T1. Then, the time t1 required for the vehicle to travel from network point B to network point C can be determined according to the distance between network points B and C and the normal vehicle speed. Then, the vehicle arrival time at network point B can be T1 - t1 - the stop time at network point B. According to the distance between network points B and A and the normal vehicle speed, the time t2 required for the vehicle to travel from network point A to network point B can be determined. Then, the vehicle arrival time at network point A is (T1 - t1 - the stop time at network point B) - t2 - the stop time at network point A.
[0046] In the above route planning method for the logistics network, two-dimensional coding is performed based on the network points included in the logistics network and the vehicle arrival times of the network points. Based on the coding results, population initialization is carried out to obtain an initial population. The fitness of each individual in the initial population is calculated to obtain the fitness of each individual in the initial population. Based on the fitness of each individual in the initial population, genetic processing is performed on the initial population to obtain the next-generation population. The next-generation population is used as the initial population, and the step of calculating the fitness of each individual in the initial population is repeatedly executed until the initial population meets the preset conditions; according to the initial population that meets the preset conditions, the target planning route and the vehicle arrival times of each network point in the target planning route are determined. Since two-dimensional coding is used during coding to add the vehicle arrival time in addition to the network points as a decision variable, during the genetic processing process, high-quality solutions including the planning route and the arrival time can be quickly searched from a large number of feasible solutions, so that a relatively accurate planning route can be obtained, improving the accuracy of route planning.
[0047] In an exemplary embodiment, calculating the fitness of each individual in the initial population to obtain the fitness of each individual in the initial population includes: determining the number of planning routes corresponding to each individual in the initial population; based on the number of planning routes corresponding to each individual in the initial population, respectively determining the fitness corresponding to each individual in the initial population, and the fitness corresponding to each individual is inversely correlated with the respective corresponding number of planning routes.
[0048] Specifically, the server can determine the number of planning routes corresponding to each individual in the initial population, and based on the number of planning routes corresponding to each individual in the initial population, use a preset fitness function to calculate the fitness corresponding to each individual in the initial population. Among them, the fitness of each individual is inversely correlated with the respective corresponding number of planning routes, that is, the fewer the number of planning routes, the greater the fitness, and vice versa, the more the number of planning routes, the smaller the fitness.
[0049] Exemplarily, the fitness function can be, for example: f(x) = maximum number of planning routes - number of planning routes corresponding to the individual.
[0050] In this embodiment, by determining the number of planning routes corresponding to each individual in the initial population and respectively determining the fitness corresponding to each individual in the initial population based on the number of planning routes corresponding to each individual in the initial population, the fitness can be quickly determined, improving the route planning efficiency.
[0051] In an exemplary embodiment, the logistics network includes multiple destination network points, such as Figure 3 shown, calculating the fitness of each individual in the initial population to obtain the fitness of each individual in the initial population includes:
[0052] Step 302: Decouple the logistics network into multiple logistics sub-networks according to multiple destination outlets, where the outlets included in each logistics sub-network correspond to the same destination outlet.
[0053] In this embodiment, the logistics network includes multiple destination outlets. To reduce the computational complexity and improve the accuracy of route planning, the logistics network can be decoupled into multiple logistics sub-networks according to the multiple destination outlets. Among the obtained logistics sub-networks, the outlets corresponding to the same destination are in the same logistics sub-network, while the outlets corresponding to different destinations are in different logistics sub-networks.
[0054] For example, referring to Figure 4 , assume that there are a total of 7 outlets ABCDEFG and two transfer stations 028R and 028W in the logistics network. Decoupling according to the destination of the transfer stations, the range of outlets corresponding to 028R is ABDCF, and the outlets corresponding to 028W are GECF. After decoupling, {028R, A, B, D, C, F} forms a logistics sub-network, and {028W, G, E, C, F} forms a logistics sub-network.
[0055] Step 304: For each individual in the initial population, determine the number of planned routes under each logistics sub-network respectively.
[0056] Step 306: Count the number of planned routes under each logistics sub-network to obtain the number of planned routes corresponding to the targeted individual.
[0057] Specifically, for each individual in the initial population, the server respectively determines the routes that belong to each logistics sub-network in the routes indicated by the individual, and then counts the routes that belong to the same logistics sub-network to obtain the number of planned routes of the individual under each logistics sub-network.
[0058] For example, assume that an individual indicates 5 routes, among which 3 routes are composed of the outlets in the logistics sub-network corresponding to 028R, and these 3 routes belong to the logistics sub-network corresponding to 028R, and the other 2 routes are composed of the outlets in the logistics sub-network corresponding to 028W, and these 2 routes belong to the logistics sub-network corresponding to 028W.
[0059] Step 308: Based on the number of planned routes corresponding to each individual in the initial population, determine the fitness corresponding to each individual in the initial population respectively.
[0060] Among them, the fitness corresponding to each individual is inversely correlated with the respective corresponding number of planned routes.
[0061] In the above embodiments, when there are multiple destination nodes in the logistics network, the server can decouple the logistics network into multiple logistics sub-networks. Then, for each individual in the initial population, the number of planned routes under each logistics sub-network can be determined respectively, and the number of planned routes under each logistics sub-network can be counted to obtain the number of planned routes corresponding to the targeted individual. Since the network is decoupled, the computational complexity can be reduced and the computational accuracy can be improved.
[0062] In an exemplary embodiment, as Figure 5 shown, the fitness of each individual in the initial population is calculated to obtain the fitness of each individual in the initial population, including:
[0063] Step 502, decouple the logistics network into multiple logistics sub-networks according to multiple destination nodes.
[0064] Among them, the nodes included in each logistics sub-network correspond to the same destination node, and the nodes included in different logistics sub-networks correspond to different destination nodes.
[0065] Step 504, for each individual in the initial population, determine the number of planned routes under each logistics sub-network respectively.
[0066] Step 506, count the number of planned routes under each logistics sub-network to obtain the number of planned routes corresponding to the targeted individual.
[0067] For the explanations of steps 502 to 506, reference can be made to the above embodiments and will not be elaborated here.
[0068] Step 508, for each individual in the initial population, determine the common nodes of each logistics sub-network corresponding to the individual.
[0069] Among them, the common network refers to the nodes shared between logistics sub-networks. For example, the common nodes of the logistics sub-network {028R, A, B, D, C, F} and the logistics sub-network {028W, G, E, C, F} are node C and node F.
[0070] Specifically, the server can compare the nodes between each pair of logistics sub-networks, so as to determine the common network between each pair of logistics sub-networks respectively.
[0071] Step 510, based on the difference between the time difference between the vehicle arrival times corresponding to the common nodes and the preset time difference threshold, determine the time cost value, and the time cost value is positively correlated with the difference.
[0072] Among them, the preset time threshold can be understood as the expected time difference of vehicle arrival when planning two routes for a single node.
[0073] Specifically, for each individual, the server can determine the arrival time of each network point based on the routes in each logistics sub-network respectively included in the individual. For public network points, there are different arrival times in different logistics sub-networks. The server can calculate the time difference between the times of the public network point in different logistics sub-networks, and then calculate the difference between this time difference and a preset time difference threshold, so as to determine the time cost value based on this time difference value. The time cost value is positively correlated with this difference, that is, the larger this difference, the larger the time cost value, and the smaller this difference, the smaller the time cost value.
[0074] Exemplarily, taking the logistics network exemplified above as an example, network points C and F are public network points, and T0 is the preset vehicle arrival time interval. T0 can be set as needed. For example, it can be set to 10 min. Then the calculation of the time cost value can refer to the following cost function:
[0075]
[0076] Step 512: Determine the fitness corresponding to the individual based on the time cost value and the number of planned routes corresponding to the individual.
[0077] Specifically, in the optimization process of the genetic algorithm, the optimization goals are the minimum route and the minimum time cost value. Then the server can determine the fitness corresponding to the individual based on the time cost value and the number of planned routes corresponding to the individual. Among them, the fitness is inversely correlated with the time cost value and the number of planned routes corresponding to the individual respectively.
[0078] Exemplarily, the time cost value can be calculated in the following way. Among them, X can be set according to the maximum value of the number of planned routes and the maximum value of the time cost value, or set according to experience, as long as it is ensured that the calculated fitness is a positive number:
[0079] Fitness = X - number of planned routes - time cost value
[0080] In the above embodiments, when calculating the fitness value, the time cost value is also determined according to the difference between the time difference between the vehicle arrival times corresponding to the public network point and the preset time difference threshold. The time cost value is positively correlated with the difference. Based on the time cost value and the number of planned routes corresponding to the individual, the fitness corresponding to the individual is determined, which can avoid the situation of conflicts among the vehicles stopping at the public network point when multiple routes pass through, and further improve the accuracy of route planning.
[0081] In some embodiments, based on the fitness of each individual in the initial population, genetic processing is performed on the initial population to obtain the next-generation population, including: obtaining preset time-window constraint conditions; the time constraint conditions include at least one of the latest arrival time constraint at the destination, the end time constraint of the shift, the stop time constraint at the network point, or the end time constraint of the originating shift; based on the time-window constraint conditions and the fitness of each individual in the initial population, genetic processing is performed on the initial population using genetic operators to obtain the next-generation population.
[0082] Among them, the time-window constraint conditions refer to the conditions preset for constraining the time of the planned route. The time constraint conditions include at least one of the latest arrival time constraint at the destination, the end time constraint of the shift, the stop time constraint at the network point, or the end time constraint of the originating shift.
[0083] For example, taking the logistics network exemplified above as an example, with the two transfer yards 028R and 028W as the destinations, the time constraint conditions can specifically be the following conditions:
[0084] 1. Latest arrival time constraint at the destination: The time when the line arrives at the transfer yard should be less than or equal to the latest arrival time of the transfer yard shift.
[0085] 2. End time constraint of the shift:
[0086] (1) The end time of the network point shift needs to be within plus or minus 1h of the original shift end time;
[0087] (2) If only one route is planned for a certain network point, the departure time is the end time of the shift at this network point, and the arrival time of the vehicle at this network point needs to be less than or equal to the end time of the shift at this network point - the stop time at the network point;
[0088] (3) If there are two routes for a certain network point, the arrival time of the vehicle corresponding to one of the routes needs to be less than or equal to the end time of the shift at this network point - the stop time at the network point, and the arrival time of the vehicle at the network point corresponding to the other route needs to be less than or equal to (the end time of the shift at this network point + the vehicle arrival time interval) - the stop time at the network point, where the vehicle arrival time interval can be set as needed, for example, it can be set to 10min.
[0089] 3. Stop time constraint at the network point: The stop time at the network point is within the range of 10 - 15min.
[0090] 4. End time constraint of the originating shift: The originating shift is the shift of the initial network point of the route, and the end time of the originating shift is the departure time of this initial network point. If two lines are planned for the originating shift, the departure times corresponding to the two lines need to be separated by 10min.
[0091] Specifically, the server can obtain the preset time window constraint conditions, and perform genetic processing on the initial population using genetic operators based on the time window constraint conditions and the fitness of each individual in the initial population to obtain the next generation population.
[0092] It can be understood that in some other embodiments, during the genetic processing, other constraint conditions can also be set. For example, the upper limit value of the number of network points on each line can be set. For instance, in the above example, the following constraint conditions can also be set: for the line to 028R, the network points can string at most 3 points (excluding the starting point), and for the line to 028W, the network points can string at most 1 point (excluding the starting point).
[0093] In the above embodiments, since during the genetic processing, the time window constraint conditions are also considered, and genetic processing is performed on the initial population using genetic operators based on the time window constraint conditions and the fitness of each individual in the initial population to obtain the next generation population, the obtained population is more in line with the requirements, further improving the accuracy of route planning.
[0094] In some embodiments, referring to Figure 6 , performing genetic processing on the initial population using genetic operators based on the time window constraint conditions and the fitness of each individual in the initial population to obtain the next generation population includes:
[0095] Step 602, perform selection processing on the initial population based on the fitness of each individual in the initial population and the time window constraint conditions to obtain an initial candidate population.
[0096] Among them, selection processing means selecting excellent individuals from the old population with a certain probability to form a new population for breeding the next generation of individuals. The probability of an individual being selected is related to the fitness value. The higher the individual fitness value, the greater the probability of being selected. When the selection probability of an individual is given, a uniform random number between [0, 1] is generated to determine which individual participates in mating. If the selection probability of an individual is large, it has the opportunity to be selected multiple times, and then its genetic genes will expand in the population; if the selection probability of an individual is small, the possibility of being eliminated will be large. The selection processing can be any one of proportional selection, ranking selection, tournament selection, roulette wheel selection.
[0097] Specifically, the server can perform selection processing using a selection operator based on the fitness of each individual in the initial population and the time window constraint conditions to obtain an initial candidate population.
[0098] Step 604, determine multiple logistics sub - networks obtained by decoupling the logistics network.
[0099] Step 606: Under each logistics sub-network, perform crossover processing and mutation processing on the node dimension coding in the individuals of the initial candidate population based on the time window constraint conditions to obtain a new population.
[0100] Among them, crossover processing means randomly selecting two individuals from the population, and through the exchange and combination of two chromosomes, inheriting the excellent characteristics of the parent string to the child string, so as to generate new excellent individuals. Crossover processing can be any one of double-point crossover, multi-point crossover, uniform crossover or arithmetic crossover. Taking single-point crossover as an example, a random crossover position is selected in the paired chromosomes, and then gene position transformation is performed on the paired chromosomes at this crossover position.
[0101] In order to prevent the genetic algorithm from falling into a local optimal solution during the optimization process, during the search process, it is necessary to perform mutation processing on the individuals. In practical applications, single-point mutation, also called bit mutation, is mainly used, that is, only one bit in the gene sequence needs to be mutated. Taking binary coding as an example, 0 becomes 1, and 1 becomes 0.
[0102] Specifically, the server determines multiple logistics sub-networks obtained by decoupling the logistics network. Each individual includes gene values corresponding to each logistics sub-network. During the crossover processing, the gene values corresponding to the same logistics sub-network are crossed with each other in the node coding dimension. After the crossover processing is completed, mutation processing can continue to be performed in the node coding dimension to obtain a new population.
[0103] For example, assume that the initial population contains three individuals X1, X2, and X3, and there are two logistics sub-networks, namely logistics sub-network A and logistics sub-network B. Then, during the crossover of X1 and X2, the gene part of X1 corresponding to logistics sub-network A and the gene part of X2 corresponding to logistics sub-network A are crossed, and the gene part of X1 corresponding to logistics sub-network B and the gene part of X2 corresponding to logistics sub-network B are crossed.
[0104] Step 608: Update the time dimension coding of each individual in the new population to obtain the next generation population.
[0105] Specifically, since crossover and mutation are performed in the node coding dimension, after obtaining the new population, the server can also update the time dimension coding of each individual in the new population. After the update is completed, the next generation population is obtained.
[0106] Exemplarily, the vehicle arrival time of each node in the route can be determined according to the latest arrival time of the destination node, the distance between adjacent nodes, the stop time of the node, and the vehicle speed in the route indicated by each individual in the new population.
[0107] In the above embodiments, by determining a plurality of logistics sub-networks obtained by decoupling the logistics network, under each logistics sub-network, based on the time window constraint conditions, the cross processing and mutation processing are respectively performed on the node dimension coding in the individuals in the initial candidate population to obtain a new population. Since the logistics network is decoupled, the complexity in the calculation process of the genetic algorithm can be reduced, thereby improving the calculation efficiency of the genetic algorithm.
[0108] In some specific embodiments, a route planning method for a logistics network is provided, including the following steps:
[0109] 1. Perform node dimension coding based on the nodes included in the logistics network, perform time dimension coding based on the vehicle arrival time of the nodes, and perform population initialization based on the coding results to obtain an initial population.
[0110] Among them, each individual in the initial population is respectively used to represent the planned route of the logistics network under a route planning method.
[0111] 2. Decouple the logistics network into a plurality of logistics sub-networks, where the nodes included in each logistics sub-network correspond to the same destination node, and the nodes included in different logistics sub-networks correspond to different destination nodes.
[0112] 3. For each individual in the initial population, respectively determine the number of planned routes under each logistics sub-network.
[0113] 4. Count the number of planned routes under each logistics sub-network to obtain the number of planned routes corresponding to the targeted individual.
[0114] 5. For each individual in the initial population, determine the common nodes of the respective logistics sub-networks corresponding to the individual.
[0115] 6. Based on the difference between the time difference between the vehicle arrival times corresponding to the common nodes and a preset time difference threshold, determine the time cost value, and the time cost value is positively correlated with the difference.
[0116] 7. Based on the time cost value and the number of planned routes corresponding to the individual, determine the fitness corresponding to the individual.
[0117] 8. Obtain the preset time window constraint conditions; the time constraint conditions include at least one of the latest arrival time constraint at the destination, the end time constraint of the shift, the stop time constraint at the node, or the end time constraint of the starting shift.
[0118] 9. Based on the fitness of each individual in the initial population and the time window constraint conditions, perform selection processing using a selection operator to obtain an initial candidate population.
[0119] 10. Determine a plurality of logistics sub-networks obtained by decoupling the logistics network.
[0120] 11. Under each sub-network, based on the time window constraint conditions, perform crossover processing on the node dimension encoding in the individuals in the initial candidate population using a crossover operator, and perform mutation processing using a mutation operator to obtain a new population.
[0121] 12. Update the time dimension encoding of each individual in the new population to obtain the next generation population.
[0122] 13. Use the next generation population as the initial population, and repeat steps 3 to 12 until the initial population meets the preset conditions.
[0123] 14. According to the initial population that meets the preset conditions, determine the target planning route and the vehicle arrival time of each node in the target planning route.
[0124] It should be understood that although the steps in the flowcharts involved in the above embodiments are shown in sequence according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless there is a clear description in this article, the execution of these steps does not have a strict order limit, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily executed at the same moment, but can be executed at different moments. The execution order of these steps or stages is not necessarily sequential, but can be executed alternately or alternately with at least a part of other steps or steps or stages in other steps.
[0125] Based on the same inventive concept, the embodiments of the present application also provide a route planning device for a logistics network for implementing the route planning method of the logistics network involved above. The implementation solutions provided by this device to solve problems are similar to the implementation solutions recorded in the above method. Therefore, the specific limitations in one or more embodiments of the following route planning device for a logistics network can refer to the limitations on the route planning method of the logistics network above, and will not be repeated here.
[0126] In an exemplary embodiment, as Figure 7 shown, a route planning device 700 for a logistics network is provided, including:
[0127] An encoding module, configured to perform node dimension encoding based on the nodes included in the logistics network, perform time dimension encoding based on the vehicle arrival time of the nodes, and perform population initialization based on the encoding results to obtain an initial population; each individual in the initial population is respectively used to represent the planning route of the logistics network in a route planning manner.
[0128] A fitness calculation module for calculating the fitness of each individual in the initial population to obtain the fitness of each individual in the initial population;
[0129] A genetic processing module for genetically processing the initial population based on the fitness of each individual in the initial population to obtain the next-generation population;
[0130] An iteration module for using the next-generation population as the initial population and repeating the step of calculating the fitness of each individual in the initial population until the initial population meets a preset condition;
[0131] A target route determination module for determining the target planned route and the vehicle arrival time of each network point in the target planned route according to the initial population that meets the preset condition.
[0132] The above-mentioned route planning device for a logistics network encodes the network points in terms of the network point dimension based on the network points included in the logistics network, encodes in terms of the time dimension based on the vehicle arrival time of the network points, initializes the population based on the encoding results to obtain the initial population, calculates the fitness of each individual in the initial population to obtain the fitness of each individual in the initial population, genetically processes the initial population based on the fitness of each individual in the initial population to obtain the next-generation population, uses the next-generation population as the initial population, and repeats the step of calculating the fitness of each individual in the initial population until the initial population meets the preset condition; determines the target planned route and the vehicle arrival time of each network point in the target planned route according to the initial population that meets the preset condition. Since two-dimensional encoding is used during encoding to add the vehicle arrival time other than the network points as a decision variable, a high-quality solution including the planned route and the arrival time can be quickly searched from a large number of feasible solutions during the genetic processing process, so that a relatively accurate planned route can be obtained, improving the accuracy of route planning.
[0133] In an exemplary embodiment, the fitness calculation module is further configured to determine the number of planned routes corresponding to each individual in the initial population; based on the number of planned routes corresponding to each individual in the initial population, respectively determine the fitness corresponding to each individual in the initial population, and the fitness corresponding to each individual is inversely correlated with the respective corresponding number of planned routes.
[0134] In an exemplary embodiment, the fitness calculation module is further configured to decouple the logistics network into multiple logistics sub-networks according to multiple destination network points, where the network points included in each logistics sub-network correspond to the same destination network point, and the network points included in different logistics sub-networks correspond to different destination network points; for each individual in the initial population, respectively determine the number of planned routes under each logistics sub-network; count the number of planned routes under each logistics sub-network to obtain the number of planned routes corresponding to the targeted individual.
[0135] In an exemplary embodiment, the fitness calculation module is further configured to, for each individual in the initial population, determine the common network points of each corresponding logistics sub-network; determine a time cost value based on the difference between the time differences of the vehicle arrival times corresponding to the common network points and a preset time difference threshold, where the time cost value is positively correlated with the difference; and determine the fitness corresponding to the individual based on the time cost value and the number of planned routes corresponding to the individual.
[0136] In an exemplary embodiment, the genetic processing module is further configured to obtain preset time window constraint conditions; the time constraint conditions include at least one of a latest arrival time constraint at the destination, a shift end time constraint, a network point stop time constraint, or an end time constraint of the originating shift; and perform genetic processing on the initial population using genetic operators based on the time window constraint conditions and the fitness of each individual in the initial population to obtain the next generation population.
[0137] In an exemplary embodiment, the genetic processing module is further configured to perform selection processing using a selection operator based on the fitness of each individual in the initial population and the time window constraint conditions to obtain an initial candidate population; determine a plurality of logistics sub-networks obtained by decoupling the logistics network; in each sub-network, perform crossover processing on the network dimension encoding of the individuals in the initial candidate population using a crossover operator and perform mutation processing using a mutation operator based on the time window constraint conditions, and obtain a new population; and update the time dimension encoding of each individual in the new population to obtain the next generation population.
[0138] Each module in the above route planning device for the logistics network can be implemented in whole or in part by software, hardware, and their combination. The above modules can be embedded in the processor of the computer device in hardware form or be independent of it, or can be stored in the memory of the computer device in software form, so as to facilitate the processor to call and execute the operations corresponding to the above respective modules.
[0139] In an exemplary embodiment, a computer device is provided. The computer device can be a server, and its internal structure diagram can be as Figure 8As shown in the figure. The computer device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O), and a communication interface. Among them, the processor, the memory, and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store XX data. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals through a network connection. When the computer program is executed by the processor, it implements a route planning method for a logistics network.
[0140] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as Figure 9 shown in the figure. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit, and an input device. Among them, the processor, the memory, and the input / output interface are connected through a system bus, and the communication interface, the display unit, and the input device are connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals in a wired or wireless manner. The wireless manner can be achieved through WIFI, a mobile cellular network, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a route planning method for a logistics network. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer covering the display screen, or a button, a trackball, or a touchpad provided on the computer device housing, or an external keyboard, touchpad, or mouse, etc.
[0141] Those skilled in the art can understand that Figure 8 、 Figure 9The structure shown is only a block diagram of some structures related to the solution of this application, and does not constitute a limitation on the computer device to which the solution of this application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.
[0142] In an exemplary embodiment, a computer device is provided, including a memory and a processor. A computer program is stored in the memory, and when the processor executes the computer program, the steps of the route planning method for the logistics network in any of the above embodiments are implemented.
[0143] In an embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the route planning method for the logistics network in any of the above embodiments are implemented.
[0144] In an embodiment, a computer program product is provided, including a computer program. When the computer program is executed by a processor, the steps of the route planning method for the logistics network in any of the above embodiments are implemented.
[0145] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use, and processing of relevant data need to comply with relevant regulations.
[0146] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, database, or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memories. Non-volatile memories can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memories can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the embodiments provided in the present application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., without limitation. The processors involved in the embodiments provided in the present application can be general-purpose processors, central processors, graphics processors, digital signal processors, programmable logic devices, data processing logics based on quantum computing, etc., without limitation.
[0147] The technical features of the above embodiments can be combined arbitrarily. For the sake of concise description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope recorded in this specification.
[0148] The above-described embodiments merely represent several implementation manners of the present application. The description thereof is relatively specific and detailed, but it should not be construed as a limitation on the patent scope of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.
Claims
1. A route planning method for a logistics network, characterized in that, The method includes: Performing node dimension coding based on the nodes included in the logistics network, performing time dimension coding based on the vehicle arrival time of the nodes, and initializing a population based on the coding results to obtain an initial population; each individual in the initial population is respectively used to represent the planned route of the logistics network under a certain route planning method; Calculating the fitness of each individual in the initial population to obtain the fitness of each individual in the initial population; Performing genetic processing on the initial population based on the fitness of each individual in the initial population to obtain the next generation population; Taking the next generation population as the initial population, and repeating the step of calculating the fitness of each individual in the initial population until the initial population meets the preset conditions; Determining the target planned route and the vehicle arrival time of each node in the target planned route according to the initial population that meets the preset conditions.
2. The method according to claim 1, wherein The calculating the fitness of each individual in the initial population to obtain the fitness of each individual in the initial population includes: Determining the number of planned routes corresponding to each individual in the initial population; Based on the number of planned routes corresponding to each individual in the initial population, respectively determining the fitness corresponding to each individual in the initial population, and the fitness corresponding to each individual is inversely correlated with the respective corresponding number of planned routes.
3. The method according to claim 2, characterized in that, The logistics network includes multiple destination nodes, and the determining the number of planned routes corresponding to each individual in the initial population includes: Decoupling the logistics network into multiple logistics sub-networks according to the multiple destination nodes, where the nodes included in each logistics sub-network correspond to the same destination node; For each individual in the initial population, respectively determining the number of planned routes under each logistics sub-network; Counting the number of planned routes under each logistics sub-network to obtain the number of planned routes corresponding to the targeted individual.
4. The method according to claim 3, characterized in that, The respectively determining the fitness corresponding to each individual in the initial population based on the number of planned routes corresponding to each individual in the initial population includes: For each individual in the initial population, determining the common nodes of each logistics sub-network corresponding to the individual; Based on the difference between the time difference between the vehicle arrival times corresponding to the common nodes and a preset time difference threshold, determining a time cost value, and the time cost value is positively correlated with the difference; Based on the time cost value and the number of planned routes corresponding to the individual, determining the fitness corresponding to the individual.
5. The method according to claim 1, wherein The performing genetic processing on the initial population based on the fitness of each individual in the initial population to obtain the next generation population includes: Obtaining a preset time window constraint condition; the time constraint condition includes at least one of a latest arrival time constraint at the destination, a shift end time constraint, a node stop time constraint, or an end time constraint of the originating shift; Performing genetic processing on the initial population using a genetic operator based on the time window constraint condition and the fitness of each individual in the initial population to obtain the next generation population.
6. The method according to claim 5, wherein Performing genetic processing on the initial population using genetic operators based on the time window constraint condition and the fitness of each individual in the initial population to obtain the next-generation population, including: Performing selection processing on the initial population based on the fitness of each individual in the initial population and the time window constraint condition to obtain an initial candidate population; Determining a plurality of logistics sub-networks obtained by decoupling the logistics network; Under each of the logistics sub-networks, performing crossover processing and mutation processing on the node dimension encoding in the individuals in the initial candidate population respectively based on the time window constraint condition to obtain a new population; Updating the time dimension encoding of each individual in the new population to obtain the next-generation population.
7. A route planning device for a logistics network, characterized in that, The apparatus includes: An encoding module, configured to perform node dimension encoding based on the nodes included in the logistics network, perform time dimension encoding based on the vehicle arrival time of the nodes, and perform population initialization based on the encoding result to obtain an initial population; each individual in the initial population is respectively used to represent the planned route of the logistics network under a route planning method; A fitness calculation module, configured to calculate the fitness of each individual in the initial population to obtain the fitness of each individual in the initial population; A genetic processing module, configured to perform genetic processing on the initial population based on the fitness of each individual in the initial population to obtain the next-generation population; An iteration module, configured to use the next-generation population as the initial population, and repeatedly execute the step of calculating the fitness of each individual in the initial population until the initial population meets a preset condition; A target route determination module, configured to determine a target planned route and the vehicle arrival time of each node in the target planned route according to the initial population that meets the preset condition.
8. A computer device, comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, the steps of the method according to any one of claims 1 to 6 are implemented.