Path planning method of distribution vehicle
Through the niche genetic algorithm and the K-means algorithm, and combined with the hybrid fleet of electric vehicles and fuel vehicles, the problem of insufficient battery life and charging facilities of electric vehicles is solved, and the logistics distribution of low energy consumption and low carbon emissions is achieved.
Patent Information
- Application Number
- CN202510410109.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-02
- Publication Date
- 2025-07-04
AI Technical Summary
In the prior art, the electric vehicles have poor endurance, long charging time and incomplete charging and swapping facilities, resulting in the delivery of large goods relying on traditional fuel vehicles, and the existing path planning ignores the requirements of high-quality services and low pollution emissions.
A path planning constraint model is constructed using a niche genetic algorithm, combining distribution location, charging station, distribution volume, distribution transfer station, distribution time and vehicle information, path planning is optimized to reduce energy consumption and carbon emissions, distribution transfer stations are determined through the K-means algorithm, and path planning is used using a hybrid fleet.
It effectively reduces vehicle energy consumption and carbon emissions, realizes the economic, efficient and green urban logistics distribution, and optimizes the path planning of hybrid fleets.
Smart Images

Figure CN120258678A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of distribution route planning, and particularly to a route planning method for distribution vehicles. Background Art
[0002] As a basic service industry, in the current situation where it is impossible to quickly replace the entire process of electric vehicle distribution, on the basis of meeting customer needs, reasonably planning the distribution route and distribution time is a key step for logistics enterprises to enhance their core competitiveness. However, the current electric vehicles mainly consist of electric tricycles, which are mainly responsible for the last-mile distribution work within the city. There are problems such as poor endurance, long charging time, and imperfect charging and swapping facilities. Therefore, the distribution of large goods still relies on traditional fuel vehicles. It can be predicted that in the current stage and for some time in the future, many logistics enterprises will use a mixed fleet composed of fuel vehicles and electric vehicles for transportation and distribution production activities. However, most companies only plan the distribution route from the perspective of economic benefits, while ignoring the actual requirements of high-quality service and low pollution emissions. Summary of the Invention
[0003] Based on this, the purpose of this application is to provide a route planning method for distribution vehicles, which can overcome the deficiencies of the prior art.
[0004] In order to achieve the above purpose, the technical solution adopted in this application is as follows:
[0005] A route planning method for distribution vehicles, comprising:
[0006] Obtain the distribution information of customers to be served; the distribution information includes distribution time, distribution location, and distribution volume.
[0007] Obtain a distribution transfer station according to the distribution location and charging stations.
[0008] Construct a route planning constraint model according to the distribution location, the charging station location, the distribution volume, the distribution transfer station, the distribution time, the vehicle information of the distribution fleet, and the energy consumption and carbon emissions of the vehicle.
[0009] Obtain a target route planning scheme according to the niche genetic algorithm and the route planning constraint model.
[0010] As an implementation manner, the step of obtaining a distribution transfer station according to the distribution location and charging stations includes:
[0011] Take the distribution location and the charging stations as point data to form a service data set including multiple point data;
[0012] Randomly select several initial distribution transfer stations;
[0013] Based on the distances from each point of data to each of the distribution transfer stations, data clusters including a number of points of data corresponding to each of the distribution transfer stations are obtained;
[0014] Based on the central positions of the points of data in the data clusters, the distribution transfer stations are updated.
[0015] As an implementation manner, the step of obtaining, based on the distances from each point of data to each of the distribution transfer stations, data clusters including a number of points of data corresponding to each of the distribution transfer stations includes:
[0016] Traverse all the points of data in the service data set through the K-means algorithm to obtain the Euclidean distances between each of the points of data and each of the distribution transfer stations;
[0017] Based on the minimum Euclidean distances of each of the points of data, the distribution transfer stations corresponding to each of the points of data are obtained;
[0018] Construct the data clusters based on a number of points of data corresponding to the same distribution transfer station to obtain data clusters corresponding to each of the distribution transfer stations.
[0019] As an implementation manner, the step of updating the distribution transfer stations based on the central positions of the points of data in the data clusters includes:
[0020] Based on the coordinate values of all the points of data in the data clusters, the corresponding central positions are obtained;
[0021] Move the distribution transfer stations to the central positions to update the distribution transfer stations.
[0022] As an implementation manner, after the step of moving the distribution transfer stations to the central positions to update the distribution transfer stations, it includes:
[0023] Based on the distances from each point of data to the current positions of each of the updated distribution transfer stations, update the data clusters corresponding to each of the distribution transfer stations;
[0024] Obtain the new central positions of the points of data in the updated data clusters. If the new central positions are the same as the current positions of the updated distribution transfer stations, stop updating the distribution transfer stations; if the new central positions are different from the current positions of the updated distribution transfer stations, move the distribution transfer stations to the central positions to update the distribution transfer stations.
[0025] As an implementation manner, the step of constructing a path planning constraint model based on the distribution location, the charging station sites, the distribution volume, the distribution transfer stations, the distribution time, the vehicle information of the distribution fleet, and the energy consumption and carbon emissions of the vehicles includes:
[0026] The path planning constraint model is obtained through the following formula:
[0027]
[0028] where Z1 is the driving cost of the truck for primary distribution; d 0i is the distance from location 0 to location i; is; C l is the set of trucks;
[0029]
[0030] where Z2 is; p k is the carbon emission per unit distance of vehicle k; di j is the distance from location i to location j; indicates whether vehicle k needs to go from location i to location j; λ k represents the fuel cost or electricity cost per unit distance of vehicle k; C is the set of all vehicles;
[0031]
[0032] where Z3 is the average customer satisfaction, n is the number of customers, is the satisfaction of the i-th customer.
[0033] As an implementation method, the satisfaction of the i-th customer is obtained through the following formula:
[0034]
[0035] where, represents the time when vehicle k arrives at location i, a i and b i respectively represent the earliest delivery time and the latest delivery time that customer i can accept.
[0036] As an implementation method, the path planning constraint model further includes:
[0037]
[0038] Formula (5) represents that each customer will be served once, where V c is the set of customer locations;
[0039]
[0040] Formula (6) represents that the tram may go to the charging station for charging;
[0041]
[0042] Formula (7) is the limit of out-degree and in-degree;
[0043]
[0044] Formula (8) means that the load capacity of the delivery vehicle will decrease by the corresponding share after serving the customers. represents the load capacity of vehicle k when it arrives at location i. represents the maximum capacity limit of vehicle k;
[0045]
[0046] Formula (9) means that the load capacity of the vehicle cannot be negative and cannot exceed the limit.
[0047]
[0048] Formula (10) means that the electric vehicle k should consume the corresponding amount of electricity after driving. represents the remaining electricity of electric vehicle k when it arrives at location i, r b represents the electricity consumption per unit distance of the electric vehicle, Q b represents the maximum battery capacity of the electric vehicle;
[0049]
[0050] Formula (11) means that when the electric vehicle comes out of the warehouse, the electricity should be full, that is, the warehouse also has the function of charging; represents;
[0051]
[0052] Formula (12) means that the electricity of the electric vehicle should not be negative and should not exceed the upper limit of the battery power;
[0053]
[0054] Formula (13) represents the definition of the variable ;
[0055]
[0056] Formula (14) represents the time consumption of the vehicle during driving on the journey. represents the time point when vehicle k arrives at location i, v k represents the speed of vehicle k, and M is a preset coefficient;
[0057]
[0058] Formula (15) represents the time consumption when the vehicle goes to the charging station for charging, and g represents the charging rate of the electric vehicle at the charging station.
[0059] As an implementation manner, the step of obtaining the target path planning scheme according to the niche genetic algorithm and the path planning constraint model includes:
[0060] Initialize the parameters of the algorithm, including the niche population size T, the crossover probability P c , the mutation probability P m , the number of loops I t , the number of elite retention layers f e , and the tournament algorithm selects the size f t ;
[0061] Taking each secondary distribution system with each distribution transfer station as the core as the basis, encode multiple chromosomes and initialize the population of the genetic algorithm;
[0062] Decode the chromosomes and calculate their fitness;
[0063] Use the preset niche genetic algorithm to find an excellent distribution plan.
[0064] As an implementation manner, the step of using the preset niche genetic algorithm to find an excellent distribution plan includes:
[0065] Use the fast non-dominated sorting algorithm to evaluate the Pareto layer where the chromosomes in the population are located, select the chromosomes on the most excellent Pareto front layer, then calculate the crowding degree of the chromosomes on the Pareto layer, and select the chromosome with the lowest crowding degree, that is, the most representative chromosome, as the excellent parent;
[0066] Adopt an adaptive elite strategy and roulette wheel strategy to select parents to evolve and generate the next generation of population; among them, the adaptive tournament strategy selects different f t values, selects a larger selection range in the early stage of iteration, and gradually narrows it in the later stage of iteration, promoting the rapid convergence of the algorithm;
[0067] Repeat the crossover and mutation operations to continuously update the population until the number of iterations reaches the upper limit and stop, take out the Pareto front solutions of the entire population and decode them, so as to generate an optimal path set for selection.
[0068] Compared with the traditional technology, the beneficial effects of the path planning method for distribution vehicles described in this application are:
[0069] Based on the delivery location, the charging station site, the delivery volume, the delivery transfer station, the delivery time, the vehicle information of the delivery fleet, as well as the energy consumption and carbon emissions of the vehicles, this application constructs a path planning constraint model. Then, according to the niche genetic algorithm and the path planning constraint model, the obtained target path planning scheme combines an excellent delivery scheme that is constrained by the path planning constraint model, which can effectively reduce the energy consumption and carbon emissions of each vehicle for realizing the target path planning scheme, and maximize the economicization, efficiency, and greening of urban logistics distribution.
[0070] For better understanding and implementation, the present application will be described in detail below with reference to the accompanying drawings. Description of the Drawings
[0071] Figure 1 It is a flowchart of the path planning method for the delivery vehicle in an embodiment of the present application.
[0072] Figure 2 It is a system schematic diagram of the path planning system for a certain type of delivery vehicle in an embodiment of the present application. Detailed Embodiments
[0073] To make the objectives, technical solutions, and advantages of the present application clearer, the embodiments of the present application will be further described in detail below with reference to the accompanying drawings.
[0074] It should be clear that the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the embodiments of the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope protected by the embodiments of the present application.
[0075] When the following description involves the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. In the description of the present application, it should be understood that the terms "first", "second", "third", etc. are only used to distinguish similar objects, and do not have to be used to describe a specific order or sequence, nor can they be understood as indicating or implying relative importance. For those of ordinary skill in the art, the specific meanings of the above terms in the present application can be understood according to specific circumstances. The singular forms of "a", "the", and "said" used in the present application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. The words "if" / "when" used herein can be interpreted as "when...", "while...", or "in response to determining".
[0076] In addition, in the description of this application, unless otherwise specified, "a plurality of" means two or more. "And / or" describes the association relationship of associated objects and indicates that there can be three relationships. For example, A and / or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone. The character " / " generally represents an "or" relationship between the associated objects before and after.
[0077] Please refer to Figure 1 , which is a flowchart of a path planning method for a delivery vehicle according to an embodiment of this application, including:
[0078] S1: Obtain the delivery information of the customers to be served; the delivery information includes the delivery time, delivery location, and delivery quantity.
[0079] Among them, the delivery location is the delivery destination required by the customer.
[0080] S2: Obtain the delivery transfer station according to the delivery location and the charging station.
[0081] As an implementation manner, the step of obtaining the delivery transfer station according to the delivery location and the charging station includes:
[0082] S21: Use the delivery location and the charging station as point data to form a service data set including a plurality of point data.
[0083] S22: Randomly select several initial delivery transfer stations.
[0084] Among them, in step S22, several initial delivery transfer stations are randomly selected from the map, and the number of the selected initial delivery transfer stations can be set by the user or can be the number calculated by the K-means algorithm.
[0085] S23: According to the distance from each point data to each of the delivery transfer stations, obtain data clusters including several point data corresponding to each of the delivery transfer stations.
[0086] S24: Update the delivery transfer station according to the central position of the point data in the data cluster.
[0087] Considering that in the case of low battery life of the electric vehicle, it is necessary to effectively complete the delivery task through immediate charging, the delivery location and the charging station are used as point data to determine a suitable delivery transfer station.
[0088] As an implementation manner, the step of S23: According to the distance from each point data to each of the delivery transfer stations, obtain data clusters including several point data corresponding to each of the delivery transfer stations includes:
[0089] S231: Traverse all the point data in the service dataset through the K-means algorithm to obtain the Euclidean distances between each of the point data and each of the distribution transfer stations.
[0090] For the traditional K-means algorithm, the selection of the K value is often the key to the problem, and the choice of the K value will directly affect the classification effect of the dataset. However, for this model, the K value corresponds to the number of distribution transfer stations, that is, the number of trucks responsible for primary distribution. These trucks must be able to carry the goods of all customers, which limits the minimum value of the K value. At the same time, for a long-term operating distribution system, the number of trucks responsible for primary distribution is constant, and additional truck distribution often brings huge expenses, which limits the upper limit of the K value. Therefore, the number of delivery trucks in this distribution system is selected as the K value, so as to allocate the customers they deliver to all trucks.
[0091] S232: Obtain the distribution transfer station corresponding to each of the point data according to the minimum Euclidean distance of each of the point data.
[0092] The distance calculation method mentioned here is the traditional Euclidean distance, which can well represent the delivery distance in the actual environment as the real distance between two points. The K-means algorithm will traverse each point in the dataset, calculate the distance from it to each distribution transfer station in turn, and assign it to the nearest station.
[0093] S233: Construct the data cluster according to several point data corresponding to the same distribution transfer station to obtain the data clusters corresponding to each distribution transfer station.
[0094] As an implementation, the step of S24: updating the distribution transfer station according to the central position of the point data of the data cluster includes:
[0095] S241: Obtain the corresponding central position according to the coordinate values of all the point data of the data cluster;
[0096] S242: Move the distribution transfer station to the central position to update the distribution transfer station.
[0097] Calculating the central position of the customers and charging stations belonging to each distribution transfer station mentioned in this embodiment means regarding the positions of all the customers and charging stations belonging to the distribution transfer station as a set, adding up their horizontal and vertical coordinate values respectively, and dividing by the number of points to obtain the central position of these points. And this central position is the position of the new distribution transfer station.
[0098] As an implementation, after the step of S242: moving the distribution transfer station to the central position to update the distribution transfer station, it includes:
[0099] S243: Update the data clusters corresponding to each of the distribution transfer stations according to the distances from each point data to the current positions of the updated distribution transfer stations.
[0100] S244: Obtain the new central positions of the point data of the updated data clusters. If the new central positions are the same as the current positions of the updated distribution transfer stations, stop updating the distribution transfer stations; if the new central positions are different from the current positions of the updated distribution transfer stations, execute step S242: Move the distribution transfer stations to the central positions to update the distribution transfer stations.
[0101] By repeating steps S242, S243, and S244 until the positions of the distribution transfer stations no longer change, the positions of the distribution transfer stations can be continuously modified, and the corresponding distribution transfer stations of customers and charging stations will also be continuously adjusted. When all customers and charging stations have found the optimal positions of the distribution transfer stations, the algorithm will enter the state of local optimal solution at this time, that is, the positions of the distribution transfer stations will no longer change. In addition, an expected iteration upper limit can also be set to end the iteration process earlier.
[0102] S3: Construct a path planning constraint model according to the distribution locations, the charging station sites, the distribution volumes, the distribution transfer stations, the distribution times, the vehicle information of the distribution fleet, and the energy consumption and carbon emissions of the vehicles.
[0103] Among them, the vehicle information of the distribution fleet includes the information of the trucks responsible for starting from the warehouse and serving as distribution transfer stations, and the information of the hybrid fuel and electric vehicle fleet starting from the distribution transfer stations and completing the last-mile distribution.
[0104] As an implementation, the path planning constraint model is defined on a fully connected weighted undirected graph G=(V,E), where V = V C ∪V f ∪V0 represents the set of all points in the graph, where V0 represents the warehouse, and all vehicles need to start from the warehouse V0 and finally return to the warehouse; V C is the set of customers; V f is the set of charging stations. We set that the charging behavior of the charging stations is based on a fixed efficiency for charging on the basis of the remaining power. E ={(i,j)|i,j∈V,i≠j} is the set of arcs between vertices, and each arc (i,j) has a weight d ij , which is used to represent the distance between point i and j. Let the mobile transfer station be V z , then the graph G=(G1∪G2) with the mobile transfer station added can be divided into two levels: the first-level distribution system is G1=(V1,E1), where V1 = V z∪V0, E1 = {(i, j)|i, j ∈ V1, i ≠ j}, which represents being composed of a warehouse and mobile transfer stations and is transported by first-level distribution trucks; and the second-level distribution system is G2 = (V2, E2), where V2 = V z ∪V c ∪V f , E2 = {(i, j)|i, j ∈ V2, i ≠ j}, which represents being composed of mobile transfer stations, customers and charging stations and is transported by a mixed distribution fleet composed of fuel vehicles and electric vehicles;
[0105] In addition, define C = C z ∪C0∪C e as the set of distribution vehicles, where C z represents first-level distribution trucks, C0 represents traditional fuel vehicles in the second-level mixed distribution fleet, and C e represents electric vehicles in the second-level distribution fleet. Each vehicle has a maximum cargo demand capacity Q c , and electric vehicles also have a maximum battery capacity Q b . The per-kilometer consumption rate of the battery is denoted as r b , and for any arc (i, j), an electric vehicle will consume r b ×d ij of battery power when passing through this arc. The variables m ik and n ik are respectively used to represent the remaining cargo capacity and remaining battery power of an electric vehicle when it arrives at node i ∈ V. Each location i has a fixed order volume o i , and its expected earliest and latest delivery times are respectively denoted as a i and b i . Set the decision variable to represent whether vehicle k will travel from location i to location j. If so, it is 1, otherwise it is 0. Among them, the first-level distribution refers to the distribution from the warehouse to the mobile transfer station, and the truck responsible for this distribution process will also be used as a mobile transfer station after arriving at the predetermined location. The second-level distribution refers to the distribution from the mobile transfer station to the customer and is delivered by a mixed fleet of electric vehicles and fuel vehicles.
[0106] Therefore, the steps of constructing the path planning constraint model according to the distribution location, the charging station site, the distribution volume, the distribution transfer station, the distribution time, the vehicle information of the distribution fleet, and the energy consumption and carbon emissions of the vehicle include:
[0107] Obtain the path planning constraint model through the following formula:
[0108]
[0109] Among them, Z1 is the driving cost of the first-level distribution trucks; d0i is the distance from position 0 to position i; is the fuel cost per kilometer of truck l; C l is the set of trucks;
[0110]
[0111] where Z2 is the total distribution cost of secondary distribution, including pollution cost and fuel cost; p k is the carbon emission per unit distance of vehicle k; d ij is the distance from position i to position j; indicates whether vehicle k needs to go from position i to position j, if so it is 1, otherwise it is 0; λ k represents the fuel cost or electricity cost per unit distance of vehicle k; C is the set of all vehicles;
[0112]
[0113] where minZ3 represents maximizing customer satisfaction, Z3 is the negation of the average customer satisfaction, and n is the number of customers, is the satisfaction of the i-th customer.
[0114] As an implementation manner, the satisfaction of the i-th customer is obtained through the following formula:
[0115]
[0116] where, represents that vehicle k delivers to customer i c at time, a i and b i respectively represent the earliest delivery time and the latest delivery time that customer i c can accept. Among them, in formula (4), the first item represents arriving more than 2 hours earlier than the expected time, arriving too early, so the customer satisfaction is 0; the second item represents arriving within 2 hours earlier than the expected time, and the satisfaction is deducted according to the early arrival time; the third item represents arriving within the expected time, so the customer satisfaction is 1; the fourth item represents arriving within 2 hours later than the expected time, and the satisfaction is deducted according to the late arrival time; the fifth item represents arriving more than 2 hours later than the expected time, arriving too late, so the customer satisfaction is 0.
[0117] As an implementation manner, the path planning constraint model further includes:
[0118]
[0119] Formula (5) represents that vehicle k needs to go from position i to position j, that is, each corresponding customer will be served once, where V cis a set of customer locations;
[0120]
[0121] Equation (6) represents that the tram may go to the charging station for charging, C e represents the electric vehicles in the secondary distribution fleet, represents a set of virtual charging stations; Equation (6) indicates that each virtual charging station can be accessed by electric vehicles at most once, which also means that each charging station can be accessed multiple times. In the formula represents a set of virtual charging stations, which contains b f virtual charging stations (b f is a positive scalar). Combining the current driving range of electric vehicles after a single charge, we can conclude that when the electric vehicle completes a day's delivery task, it needs to charge at most once more. Assuming that in the extreme case, the electric vehicle needs to charge on the way back and forth when delivering goods to a single customer, then during the entire delivery process, the electric vehicle will perform a total of 2|V c | charging behaviors. In other words, the electric vehicle will visit 2|V c | charging stations. Mathematically, this behavior is considered that the electric vehicle charges at b f = 2|V c | virtual charging stations. Therefore, Equation (6) represents that some vehicles will charge at virtual charging stations, that is, during the delivery process, some electric vehicles will perform charging behaviors according to the actual situation.
[0122]
[0123] Equation (7) is the limit of in-degree and out-degree, representing that the number of vehicles entering each point is the same as the number of vehicles leaving, that is, each vehicle departs from the warehouse, delivers to customers in turn, and then returns to the warehouse. V represents the set of all points in the graph;
[0124]
[0125] Equation (8) represents that the cargo capacity of the express vehicle will decrease by the corresponding share after serving the customer, represents the cargo capacity of vehicle k when it arrives at location i, represents the maximum capacity limit of vehicle k, o i represents the cargo capacity of customer i; Equation 8 only restricts the cargo capacity of the express vehicle after delivery, that is, after the express vehicle delivers goods to the customer, the amount of goods on the vehicle should decrease. And the time limit is in Equations 14 and 15. The meaning of less than or equal to in Equation 8 is that the express vehicle is allowed to deliver more goods than the order quantity to the customer. As for whether this behavior is reasonable, it is judged by two target values, represents the cargo capacity of vehicle k when it arrives at location i, represents the maximum capacity limit of vehicle k, o i represents the load of customer i; for a certain vehicle k, when the vehicle is about to leave after serving customer i, that is, when the vehicle is about to drive from customer i to another point j, here Equation (8) is transformed into represents that the vehicle will at least deliver the goods ordered by the customer to complete the order, and the load of the vehicle decreases; if the vehicle does not serve customer i, there is no departure from the customer, here Equation (8) is The right side of the equation is always greater than or equal to the left side. Mathematically, this represents the situation is not affected. In other words, the vehicle does not deliver goods to the customer, and the amount of goods on the vehicle will naturally not change;
[0126]
[0127] Equation (9) represents that the load of the vehicle cannot be negative and cannot be overloaded;
[0128]
[0129] Equation (10) represents that the electric vehicle k should consume the corresponding amount of electricity after driving, represents the remaining electricity of electric vehicle k when it arrives at position i, r b represents the electricity consumed by the electric vehicle per unit distance traveled, Q b represents the maximum battery capacity of the electric vehicle; for a certain electric vehicle k, when the vehicle is about to drive from point i to another point j, Equation (10) is transformed into represents that the electric vehicle will at least consume the electricity for the distance between point i and point j; if the vehicle does not drive out from point i, naturally Equation (10) is The right side of the equation is always greater than or equal to the left side. Mathematically, this represents the situation is not affected. In other words, the electric vehicle does not travel between two points, and the electricity of the electric vehicle is not affected.
[0130]
[0131] Equation (11) represents that when the electric vehicle comes out of the warehouse, the electricity should be full, that is, the warehouse also has the function of charging; represents that;
[0132]
[0133] Equation (12) represents that the electricity of the electric vehicle should not be negative and should not exceed the upper limit of the battery power;
[0134]
[0135] Formula (13) represents the definition of the variable ;
[0136]
[0137] Formula (14) represents the time consumption when the vehicle is driving on the route, represents the time point when vehicle k arrives at position i, v k represents the speed of vehicle k, and M is a preset maximum value; for a certain vehicle k, when the vehicle is about to drive from point i to another point j, Formula (14) is transformed into It means that the vehicle driving from point i to point j will consume the above time; if the vehicle does not drive out from point i, naturally Formula (14) is very large, that is, when vehicle k arrives at position j, an infinite amount of time has passed. Mathematically, this means it will not affect ;
[0138]
[0139] Formula (15) represents the time consumption when the vehicle goes to the charging station for charging, and g represents the charging rate of the electric vehicle at the charging station. For a certain vehicle k, when the vehicle is about to drive from point i to charging station j, Formula (15) is transformed into It means that the vehicle arrives at the charging station and is ready to continue delivering goods, and it needs to consume at least the driving time plus the charging time; if the vehicle does not go to the charging station, naturally Formula (14) is The same as formula (14), this means that for situations where the vehicle does not actually drive, there is no constraint.
[0140] S4: According to the niche genetic algorithm and the path planning constraint model, obtain the target path planning scheme.
[0141] As an implementation, the step of S4: According to the niche genetic algorithm and the path planning constraint model, obtain the target path planning scheme includes:
[0142] S41: Initialize the parameters of the algorithm, including the niche population size T, the crossover probability P c , the mutation probability P m , the number of loops It 、 Elite retention level f e , the tournament algorithm selects a scale of f t .
[0143] S42: Based on each secondary distribution system centered on each distribution transfer station, encode multiple distribution plans (chromosomes are used to represent distribution plans in the genetic algorithm), and initialize the population of the genetic algorithm.
[0144] The energy types and load capacities of the delivery vehicles in the secondary distribution system centered on the mobile transfer station are different. Therefore, different from the traditional fixed-length coding form, the chromosome coding form with partially variable length will be able to adapt to different types of delivery vehicles. The chromosome will consist of two parts, namely the variable-length fleet coding part and the fixed-length customer coding part. The variable-length fleet coding part consists of electric vehicles E and fuel vehicles O. For the fleet coding part, only the quantity of each type of vehicle is meaningful, and the vehicle sorting is not meaningful. The fixed-length customer coding part is directly composed of customer numbers, and the order of customers will affect the task allocation of delivery vehicles and the customer order.
[0145] Since the two parts of the chromosome are separated during reproduction, the traditional method of overall random generation cannot be used, but different initialization methods are used for the two parts. The fixed-length customer coding part will use the traditional random generation method to randomly arrange customers to generate a coding sequence. For the variable-length part, the idea of traversal is used to include as many fleet arrangements as possible. First, calculate the minimum number of vehicles N required to transport the total order volume when only using fuel vehicles. Next, during the construction of the fleet coding, let the number of fuel vehicles generate N + 1 different initial formations from 0 to N, and then allocate the unfulfilled order volume in each formation to the necessary electric vehicles to form N + 1 different fleet codings.
[0146] S43: Decode the chromosome and calculate its fitness.
[0147] Fitness, that is, the two optimization target values of this chromosome. In the genetic algorithm, the fitness of the chromosome is the three optimization target values of this distribution plan. The better these three values are, the better the fitness of this distribution plan (chromosome) in the population.
[0148] After the initial population is generated, the two objective function values corresponding to each chromosome will be calculated according to the path planning constraint model to judge its quality. Before calculation, the encoded chromosome needs to be decoded to restore it to a readable distribution plan.
[0149] During decoding, the vehicles in the fleet code need to be inserted into the customer code in sequence, and a reasonable charging station needs to be selected for the electric vehicles to ensure normal delivery. First, insert the first vehicle in the fleet code in front of the first customer in the customer code. If the vehicle can serve this customer, assign this customer to the vehicle and move the vehicle behind this customer. Repeat this step until the vehicle cannot serve the next customer, that is, the load capacity of the express vehicle is insufficient. Then insert the next vehicle in front of the unserved customers, that is, behind the previous express vehicle, and repeat the above steps until all customers are assigned. After the vehicles are inserted, the vehicle that will serve the customer is the nearest vehicle behind this customer, and the order of the customers is the delivery order of the vehicles. After all customers are assigned, fill in warehouse 0 on both sides of the customer delivery queue of each vehicle. That is to say, the vehicle will start from the warehouse, serve the customers in the order of the customer delivery queue, and finally return to the warehouse.
[0150] In addition, due to the limited battery capacity of electric vehicles, after the customers are assigned and the warehouses are added, it is also necessary to check whether they can complete the delivery service normally. For the customer queue of electric vehicles, starting from the first delivery node of the customer delivery queue, that is, the warehouse, calculate the number of customers it can serve. If it can serve all customers, no charging station is inserted. Otherwise, insert the nearest charging station behind the maximum number of customers it can serve. If the situation occurs that the electric vehicle cannot reach the charging station before the battery runs out, select the previous customer and calculate whether it can reach the nearest charging station. If it can, insert the charging station; otherwise, continue to repeat.
[0151] After the decoding of the chromosome is completed, the chromosome will be evaluated according to the three objective functions of the path planning constraint model, and the corresponding objective function values will be calculated. Among them, the objective function value of the delivery plan, that is, the fitness of the chromosome. The genetic algorithm will use biological terms to metaphorize these delivery plans as chromosomes and metaphorize the optimized objective function values of these delivery plans as fitness.
[0152] S44: Use the preset niche genetic algorithm to find excellent delivery plans. Specifically, use the preset niche genetic algorithm to solve the problem and finally provide a series of alternative delivery plans. Here, the delivery plans include the number of vehicles deployed, the delivery routes of each vehicle, the cargo load of each vehicle, etc.
[0153] As an implementation method, the step of S44: using the preset niche genetic algorithm to find excellent delivery plans includes:
[0154] S441: Use the fast non-dominated sorting algorithm to evaluate the Pareto levels of the chromosomes in the population, select the chromosomes on the most excellent Pareto front layer, then calculate the crowding degree of the chromosomes on the Pareto layer, and select the chromosome with the lowest crowding degree, that is, the most representative chromosome, as the excellent parent generation.
[0155] S442: Adopt an adaptive elitist strategy and roulette wheel strategy to select parent generations to evolve and generate the next generation of populations; among them, the adaptive tournament strategy is to select different f t values, select a larger selection range in the early stage of iteration, and gradually narrow it in the later stage of iteration, which promotes the rapid convergence of the algorithm.
[0156] S443: Repeat the crossover and mutation operations to continuously update the population until the iteration times reach the upper limit and stop. Take out the Pareto front solutions of the entire population and decode them to generate an optional set of optimal paths.
[0157] In view of the phenomenon that in the secondary distribution system with a distribution transfer station as the core, the end distribution is served by a mixed fleet composed of fuel vehicles and electric vehicles, the present invention considers the distribution services of fleets with different energy sources and different capacities, and at the same time considers the distribution time windows and satisfaction degrees of customers. It designs a variable-length chromosome encoding and decoding method to be applicable to the niche genetic algorithm, realizes the optimization of the algorithm for the allocation of distribution transfer stations and the solution of end distribution fleets, so as to be able to find excellent optional distribution plans, thereby maximizing the economicization, efficiency and greening of urban double-layer logistics distribution.
[0158] Compared with the traditional technology, the beneficial effects of the path planning method for distribution vehicles described in the present application are:
[0159] The present application constructs a path planning constraint model according to the distribution location, the charging station site, the distribution volume, the distribution transfer station, the distribution time, the vehicle information of the distribution fleet, and the energy consumption and carbon emissions of the vehicles. Then, according to the niche genetic algorithm and the path planning constraint model, the obtained target path planning scheme combines an excellent distribution scheme that is constrained by the path planning constraint model, which can effectively reduce the energy consumption and carbon emissions of each vehicle for realizing the target path planning scheme, and maximize the economicization, efficiency and greening of urban logistics distribution.
[0160] Please refer to Figure 2 , the present application also discloses a path planning system for distribution vehicles, including a user registration module, an order submission module, an express tracking module, an information query module, a data communication module, a path planning module, a vehicle scheduling module and a personnel management module;
[0161] The user registration module is used for customers to register accounts and fill in personal information.
[0162] The order submission module is used for customers to submit their personal goods requirements and expected delivery times. In addition, the location information of the expected delivery will also be submitted.
[0163] The express delivery tracking module is used to display the location information and delivery status of the delivery vehicle in real time. Customers can query the delivery progress of their personal orders through this module.
[0164] The information query module is used for customers to query their personal information and historical orders.
[0165] The data communication module is used to receive the delivery information submitted by customers and feedback the delivery status of the vehicle to customers.
[0166] The path planning module is used to construct a two-layer delivery model, complete the allocation of mobile transfer stations, and formulate the delivery paths for secondary end delivery tasks.
[0167] The vehicle scheduling module is used to configure vehicles according to the determined delivery plan.
[0168] The personnel management module is used for the express delivery center to verify the information of couriers and allocate tasks according to the determined delivery plan.
[0169] It should be noted that the path planning system of the delivery vehicle provided in the second embodiment of the present application and the path planning method of the delivery vehicle in the first embodiment of the present application belong to the same concept. The implementation process is shown in the method embodiment and will not be elaborated here.
[0170] The device embodiments described above are merely illustrative. The components described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of the present application. Those of ordinary skill in the art can understand and implement it without creative efforts.
[0171] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0172] This application is described with reference to the flowcharts and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the present application. It should be understood that each flow and / or block in the flowchart and / or block diagram, and the combination of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing device to produce a machine, such that the instructions executed by the processor of the computer or other programmable data processing device generate means for implementing the selected functions in the process Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks. These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, such that the instructions stored in the computer-readable memory produce a manufactured article including instruction means that implement the selected functions in the process Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.
[0173] These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide steps for implementing the selected functions in the process Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.
[0174] In a typical configuration, a computing device includes one or more processors (CPUs), an input / output interface, a network interface, and memory.
[0175] The memory may include non-permanent memory in the form of computer-readable media, random access memory (RAM), and / or non-volatile memory, such as read-only memory (ROM) or flash memory (flash RAM). The memory is an example of computer-readable media.
[0176] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0177] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0178] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims
1. A path planning method for a distribution vehicle, characterized in that: Including: Obtain the delivery information of the customer to be served; The delivery information includes delivery time, delivery location, and delivery volume; Obtain the delivery transfer station according to the delivery location and the charging station; Construct a path planning constraint model according to the delivery location, the charging station, the delivery volume, the delivery transfer station, the delivery time, the vehicle information of the delivery fleet, and the energy consumption and carbon emissions of the vehicle; Obtain the target path planning scheme according to the niche genetic algorithm and the path planning constraint model.
2. The path planning method for a distribution vehicle according to claim 1, characterized in that: The step of obtaining the delivery transfer station according to the delivery location and the charging station includes: Take the delivery location and the charging station as point data to form a service data set including multiple point data; Randomly select several initial delivery transfer stations; According to the distance from each point data to each delivery transfer station, obtain data clusters including several point data corresponding to each delivery transfer station; Update the delivery transfer station according to the central position of the point data in the data cluster.
3. The path planning method for a distribution vehicle according to claim 2, wherein: The step of obtaining data clusters including several point data corresponding to each delivery transfer station according to the distance from each point data to each delivery transfer station includes: Traverse all point data in the service data set through the K-means algorithm to obtain the Euclidean distance between each point data and each delivery transfer station; According to the minimum Euclidean distance of each point data, obtain the delivery transfer station corresponding to each point data; Construct the data cluster according to several point data corresponding to the same delivery transfer station to obtain the data cluster corresponding to each delivery transfer station.
4. The path planning method for a delivery vehicle according to claim 2, wherein: The step of updating the delivery transfer station according to the central position of the point data in the data cluster includes: Obtain the corresponding central position according to the coordinate values of all point data in the data cluster; Move the delivery transfer station to the central position to update the delivery transfer station.
5. The path planning method for a distribution vehicle according to claim 4, wherein: After the step of moving the delivery transfer station to the central position to update the delivery transfer station, it includes: Update the data cluster corresponding to each delivery transfer station according to the distance from each point data to the current position of each updated delivery transfer station; Obtain the new central position of the point data in the updated data cluster. If the new central position is the same as the current position of the updated delivery transfer station, stop updating the delivery transfer station; if the new central position is different from the current position of the updated delivery transfer station, move the delivery transfer station to the central position to update the delivery transfer station.
6. The path planning method for a distribution vehicle according to claim 4, wherein: The step of constructing a path planning constraint model according to the delivery location, the charging station, the delivery volume, the delivery transfer station, the delivery time, the vehicle information of the delivery fleet, and the energy consumption and carbon emissions of the vehicle includes: Obtain the path planning constraint model through the following formula: Among them, Z1 is the driving cost of the trucks for primary distribution; d 0i is the distance from location 0 to location i; is the fuel cost per kilometer of truck l; C l is the set of trucks; Among them, Z2 is the total distribution cost of secondary distribution, including pollution cost and fuel cost; p k is the carbon emission per unit distance of vehicle k; d ij is the distance from location i to location j; indicates whether vehicle k needs to travel from location i to location j; λ k represents the fuel cost or electricity cost per unit distance of vehicle k; C is the set of all vehicles; Among them, minZ3 represents the pursuit of maximizing customer satisfaction, Z3 is the negation of the average customer satisfaction, n is the number of customers, is the satisfaction of the c ith customer.
7. The path planning method for a distribution vehicle according to claim 6, wherein: Obtain the satisfaction degree of the i-th customer through the following formula: Among them, represents the time when vehicle k delivers to customer i c , and respectively represent the earliest delivery time and the latest delivery time that customer i c can accept.
8. The path planning method for a distribution vehicle according to claim 6, wherein: The path planning constraint model further includes: Equation (5) represents that each customer will be served once, where V c is the set of customer locations; Formula (6) represents that the tram may go to the charging station for charging, C e represents the electric vehicles in the secondary distribution fleet, represents the set of virtual charging stations; Formula (7) is the limit of in-degree and out-degree, and V represents the set of all points in the graph; Formula (8) represents that the load capacity of the express vehicle will decrease by the corresponding share after serving the customers. represents the load capacity of vehicle k when it arrives at location i. represents the maximum capacity limit of vehicle k, o i represents the load capacity of customer i. Formula (9) means that the load capacity of the vehicle cannot be negative and cannot be overloaded; Formula (10) represents that after the tram k travels, it should consume the corresponding amount of electricity. represents the remaining electricity of tram k when it reaches position i, r b represents the electricity consumed when the tram travels a unit distance, Q b represents the maximum battery capacity of the tram; Formula (11) represents that when the tram comes out of the warehouse, its battery should be fully charged, that is, the warehouse also has the function of charging. Formula (12) represents that the battery level of the tram should not be negative and should not exceed the upper limit of the battery capacity. Formula (13) represents the definition of the variable ; Equation (14) represents the time consumption when the vehicle is traveling on the journey, represents the time point when vehicle k arrives at position i, v k represents the speed of vehicle k, and M represents a preset maximum value; Formula (15) represents the time consumption when the vehicle goes to the charging station for charging, and g represents the charging rate of the tram at the charging station.
9. The path planning method for a distribution vehicle according to claim 1, wherein: The steps of obtaining the target path planning scheme according to the niche genetic algorithm and the path planning constraint model include: Initialize the parameters of the algorithm, including the niche population size T, the crossover probability P c , the mutation probability P m , the number of iterations I t , the number of elite retention layers f e , and the tournament algorithm selects a size f t ; Based on the two-level distribution system with each distribution transfer station as the core, encode multiple distribution plans and initialize the population of the genetic algorithm. Decode the chromosome and calculate its fitness. Use the preset niche genetic algorithm to find excellent distribution plans.
10. The path planning method for a distribution vehicle according to claim 9, characterized in that: The steps of using the preset niche genetic algorithm to find excellent distribution plans include: Use the fast non-dominated sorting algorithm to evaluate the Pareto levels of the chromosomes in the population, select the chromosomes on the most excellent Pareto front layer, then calculate the crowding degree of the chromosomes on the Pareto layer, and select the chromosome with the lowest crowding degree, that is, the most representative chromosome, as the excellent parent. An adaptive elitist strategy and roulette wheel strategy are adopted to select parents for evolving to generate the next generation population; among them, the adaptive tournament strategy selects different f t values. A larger selection range is selected in the early stage of iteration, and gradually narrowed in the later stage of iteration, which promotes the rapid convergence of the algorithm. Repeat the crossover and mutation operations to continuously update the population until the iteration times reach the upper limit and stop. Take out the Pareto front solutions of the whole population and decode them to generate an optimal path set for selection.