A multi-distribution center electric vehicle path planning method

Through the path planning method combined with machine learning and genetic algorithm, the electricity bill and time window constraints in electric vehicle path planning in multi-distribution centers are solved, the path and charging station selection of electric vehicles are optimized, and the effect of reducing electricity bills and carbon emissions is achieved. .

CN116644874BActive Publication Date: 2024-11-01SUZHOU UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310442560.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-23
Publication Date
2024-11-01
Estimated Expiration
2043-04-23

AI Technical Summary

Technical Problem

Existing technologies are difficult to effectively solve the problem of electric vehicles in multiple distribution centers, especially when electric vehicles have short range and difficult to master charging time, resulting in increased distribution costs and carbon emissions.

Method used

Using machine learning combined with genetic algorithms, the objective function is constructed to optimize the electric vehicle path planning, consider the customer service time window and power use, and generate the optimal electric vehicle path and charging station solution through coding, crossover, mutation and replication steps. , reduce electricity consumption and penalty costs.

Benefits of technology

On the basis of meeting the time window constraints and power usage, it has significantly reduced the electricity consumption and carbon emissions of electric vehicles, optimized the distribution path, reduced the distribution time by 45%, and improved the distribution efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116644874B_ABST
    Figure CN116644874B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of logistics and distribution technology, and specifically to a multi-distribution center electric vehicle path planning method. The present invention models the problem of distribution with multiple distribution centers, multiple customer points and multiple electric vehicles, and solves the above problem using a genetic algorithm with a machine learning model as an evaluation module. At the same time, the key genes of the chromosomes in the genetic algorithm are judged according to the evaluation of the machine learning model in the genetic algorithm, and the iteration of the genetic algorithm is guided to a certain extent by the key genes, thereby improving the efficiency of the genetic algorithm in solving this problem. It effectively solves the path problem of electric vehicles with multiple distribution centers in the city and considering the endurance, reduces the electricity cost of electric vehicles during distribution and reduces the distribution time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of logistics distribution, and in particular to a method for planning electric vehicle paths for multiple distribution centers. Background Art

[0002] With the development of my country's economy, the logistics industry has ushered in a huge take-off. Promoting logistics cost reduction and efficiency improvement and doing a good job in last-mile route planning are challenges facing my country's logistics industry. Under the background of my country's dual-carbon strategy, traditional fossil energy vehicles are increasingly restricted. Studies have shown that urban logistics choose to complete logistics distribution under effective intervention measures such as electrification, which can reduce last-mile emissions and traffic congestion by 30%, effectively helping to achieve "carbon neutrality". However, the short range of electric vehicles and the difficulty for drivers to grasp the reasonable charging time are the main factors affecting logistics distribution. Electricity costs, as the main consumption of electric vehicles, are the key optimization point for distribution centers to reduce the transportation costs of electric vehicles. Reasonable planning of distribution routes can greatly reduce the power consumption of electric vehicles and achieve the purpose of saving electricity costs.

[0003] Traditional methods for solving vehicle routing problems include neighborhood search, taboo search, particle swarm algorithm, ant colony algorithm, etc. Although these methods can solve traditional vehicle routing problems, they cannot solve the routing problem of electric vehicles in multiple distribution centers. Because in the routing problem of electric vehicles based on multiple distribution centers, there are constraints on the maximum cargo capacity and maximum travel time for distribution electric vehicles, and customers have a delivery time window. When they arrive early or late, a penalty function will be generated. At the same time, when the electric vehicle is low on power, it should go to the charging station in time for charging. Summary of the invention

[0004] Therefore, the technical problem to be solved by the present invention is that the current solutions do not provide an efficient solution to the problem of electric vehicle path planning for multiple distribution centers.

[0005] In order to solve the above technical problems, the present invention provides a multi-distribution center electric vehicle path planning method, comprising:

[0006] Obtain a collection of distribution centers, a collection of customer points, a collection of charging stations, and a collection of distribution electric vehicles;

[0007] According to the distribution center set, the customer point set and the charging station set, an objective function is constructed under the premise of considering the customer service time window and the electric vehicle power usage;

[0008] The constructed objective function is solved by a genetic algorithm with machine learning as the evaluation model, including:

[0009] S1: Encode the obtained distribution center set, customer point set, charging station set and distribution electric vehicle. Each distribution center, customer point and charging station corresponds to an independent code. At the same time, a corresponding decoding table is established according to the corresponding relationship of the coding. With the constraint that each customer point has a corresponding distribution center and distribution electric vehicle, the generated codes are randomly sorted to obtain a sequence. The obtained sequence is an individual genotype, and each code in the sequence is a gene;

[0010] S2: Configure the parameters in the genetic algorithm according to the obtained distribution center set and customer point set data, including:

[0011] Population size NP, maximum number of iterations, crossover rate Pc, chromosome length L, mutation rate Pm, penalty coefficient afa;

[0012] S3: Repeat step S1 with the constraint that each customer point has a corresponding distribution center and distribution vehicle, randomly sort the generated codes to obtain a sequence, generate a new individual genotype each time, and stop randomly sorting the generated codes until the number of generated individual genotypes is consistent with the configured population size NP, and form the generated individual genotypes into a set to obtain the initial population in the genetic algorithm, calculate each individual genotype of the initial population using the established objective function, and compare to obtain the individual genotype with the best objective function value in the initial population. This individual genotype is the optimal solution of the current population, which is called the current optimal solution, and the optimal solution of the initial population is also the global optimal solution at this time;

[0013] S4: Use the random forest algorithm in machine learning to build an evaluation model, use the constructed evaluation model to evaluate the fitness of each individual genotype in the initial population, and calculate the probability of each individual genotype being selected when generating a new population based on the fitness of each individual genotype obtained;

[0014] S5: According to the crossover rate Pc and mutation rate Pm configured by the genetic algorithm, an operation of adding a new individual genotype to a new population is selected once, including crossover, mutation and replication. If crossover is not selected and mutation is not selected in this selection, replication is performed. After the operation to be performed is selected, the individual genotypes in the initial population are selected according to the probability of each individual genotype obtained in S4 being selected when generating a new population, and the selected operation is performed, and the new individual genotype generated by the operation is added to the new population. At the same time, the fitness of the generated new individual genotype is evaluated using the evaluation model constructed in step S4 to obtain the fitness of the new individual genotype. At the same time, the machine learning model is used to learn the weight of each gene in the individual genotype in the fitness evaluation, and the key gene of the individual genotype is determined according to the weight of each gene in the individual genotype, and the position of the determined key gene does not change in the iterative process after the individual genotype;

[0015] S6: Repeat step S5 until the number of individual genotypes in the new population is the same as the configured population size NP. At this time, one iteration is completed, and the fitness of each individual genotype in the new population is obtained. By comparing the fitness value of each individual in the new population, the individual genotype with the best objective function value in the new population is obtained as the current optimal solution of the new population. The current optimal solution of the new population is compared with the global optimal solution to determine the new global optimal solution.

[0016] S7: Repeat step S6, each time the number of iterations is +1, and stop repeating step S6 when the number of iterations is the same as the configured maximum number of iterations, output the individual genotype corresponding to the global optimal solution, decode the obtained genotype according to the established decoding table, and obtain the charging path and charging station of the electric vehicle by calculation, and obtain the optimal path-charging solution;

[0017] Furthermore, the constructed objective function includes:

[0018] Objective function model: objective function = penalty cost + total electricity cost;

[0019] The penalty cost is the penalty fee incurred when the delivery arrival time does not meet the customer's scheduled time window;

[0020] The total electricity cost is obtained by multiplying the total route of the electric vehicle by the unit distance electricity cost;

[0021] The function is as follows:

[0022] minCost = cost η +cost s

[0023] Where minCost is the objective function value, costη is the penalty cost, cost s The total electricity cost.

[0024] Furthermore, the penalty cost specifically includes:

[0025] Time window late penalty function:

[0026] Early arrival penalty coefficient × early arrival duration (vehicle arrival time - time window upper limit);

[0027] Late penalty coefficient × late duration (vehicle late time - time window lower limit);

[0028]

[0029] The above formula is the penalty cost of all vehicles, where θ is the penalty coefficient for early arrival, η is the penalty coefficient for delayed arrival, and λ u is the beginning of the customer time window, μ i is the end time of the customer's time window, and t is the time when the vehicle arrives at the customer.

[0030] Furthermore, the probability of each individual genotype being selected when generating a new population is calculated as follows:

[0031] The size of the population is N, F(xi) represents the fitness value of the genotype of the i-th individual, then the probability of the i-th individual genotype being selected is given by the following formula

[0032]

[0033] Furthermore, the crossover rate Pc configured according to the genetic algorithm selects the operations of adding a new individual genotype to a new population once, including crossover, mutation and replication, and the crossover is specifically:

[0034] Determine the genotype of the selected individuals;

[0035] A random floating point number r;

[0036] Compare the floating point number r with the configured crossover rate Pc;

[0037] If r is less than the hybridization probability p c , then the genes of the two selected individual genotypes are hybridized to obtain a new individual.

[0038] Furthermore, the operations of adding a new individual genotype to a new population by selecting a crossover rate Pc configured according to the genetic algorithm include crossover, mutation and replication, and the mutation is specifically:

[0039] Determine the genotype of the selected individuals;

[0040] A random floating point number r;

[0041] Compare the floating point number r and the mutation rate Pm;

[0042] If r is less than the mutation rate Pm, perform Gaussian mutation on the current gene.

[0043] Further, the Gaussian mutation is specifically as follows: when performing a mutation operation, a random number that conforms to a normal distribution with a mean of and a variance of is used to replace the original gene value to obtain a new individual.

[0044] Furthermore, the copy operation is specifically as follows:

[0045] Determine the genotype of the selected individuals;

[0046] Replicate their individual genotypes;

[0047] Add the copied individuals to the new population.

[0048] Furthermore, the calculation of the charging path and charging station for the electric vehicle specifically includes:

[0049] Calculate the nearest charging station and storage center for each customer point;

[0050] Calculate the current power of the electric vehicle when it arrives at each point and compare it with the power required to reach the next customer and return to the warehouse center;

[0051] If the current power is less than the power required to reach the next customer and return to the storage center, the vehicle will go to the charging station closest to the current station for charging.

[0052] Furthermore, the current optimal solution of the new population is compared with the global optimal solution to determine the new global optimal solution:

[0053] Evaluate the fitness of each individual genotype in the new population and record the current optimal solution of the new population;

[0054] Compare the current optimal solution of the new population with the global optimal solution;

[0055] If the fitness of the current optimal solution of the new population is less than the fitness value of the global optimal solution, the current optimal solution is maintained; if the fitness value of the current optimal solution is greater than the fitness value of the global optimal solution, the current optimal solution of the new population is updated to the global optimal solution. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] In order to make the content of the present invention more clearly understood, the present invention is further described in detail below according to specific embodiments of the present invention in conjunction with the accompanying drawings, wherein

[0057] Figure 1This is a structural diagram of the first embodiment of the present invention.

[0058] Figure 2 This is the multi-distribution center electric vehicle path planning problem of the present invention

[0059] Figure 3 This is a detailed diagram of chromosome iteration of the machine learning-genetic algorithm of the present invention

[0060] Figure 4 This is the machine learning-genetic algorithm flow chart of the present invention

[0061] Figure 5 This is the result of the present invention not performing multi-distribution center electric vehicle path planning

[0062] Figure 6 This is the result of the present invention's path planning for electric vehicles in the distribution center. DETAILED DESCRIPTION

[0063] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments so that those skilled in the art can better understand the present invention and implement it, but the embodiments are not intended to limit the present invention.

[0064] Embodiment 1:

[0065] The overall structure of the genetic algorithm in this embodiment refers to Figure 1 As shown, including:

[0066] Obtain a distribution center point set, a customer point set, a charging station set, and a distribution electric vehicle;

[0067] The objective function is obtained by presetting the constraints:

[0068] In a region, multiple delivery vehicles serve multiple distribution centers. Each customer point has different delivery requirements and different time windows. The goal is to minimize the total delivery cost of all vehicles, that is, to minimize the total path while satisfying all constraints. The overall objective function is:

[0069] minCost = cost η +cost s

[0070] like Figure 2 As shown, the problem assumptions are as follows:

[0071] (1) The locations of all storage centers, customer points, and charging stations are unchanged, and the cargo demand of customer points and the transfer demand of storage centers are known.

[0072] (2) A customer point can only be served by one vehicle, but a vehicle can serve multiple customer points.

[0073] (3) The waiting time at the charging station is not taken into account, and all electric vehicles are fully charged when they depart from the storage center.

[0074] (4) The truck does not consume electricity while staying at the node.

[0075] (5) The vehicle travels at a constant speed and the power consumption per kilometer is a constant.

[0076] (6) Eliminate the impact of all natural and unnatural emergencies on the entire system.

[0077] (7) The electric vehicles used by each storage center to serve customers are of the same type and have the same vehicle parameters.

[0078] (8) The service time of customer service vehicles at customer nodes and storage centers, and the service time of transfer vehicles at storage centers are fixed.

[0079] (9) The charging costs of different charging stations at the same time are the same.

[0080] (10) There is no limit on the service hours of the storage center, and there is no limit on the service hours of the charging piles.

[0081] This embodiment is mainly composed of an initialization module, an encoding and decoding module, a selection, crossover, mutation module and a key gene selection module. The specific main modules include:

[0082] Initialize the module:

[0083] The initialization module obtains the initial customer point sequence, and all customer points in the sequence have corresponding distribution centers and distribution vehicles.

[0084] Encoding and decoding module:

[0085] In order to fit the concept of biological evolution, the input should be encoded, and the output of the result needs to be decoded. The encoding method in this paper adopts binary encoding. The individual genotype is composed of a binary symbol set {0,1}. The entire genotype is a binary encoding symbol string. The length of the binary encoding symbol string is related to the solution accuracy. The encoding and decoding process should satisfy the process of phenotype-encoding-genotype-decoding-phenotype. The encoding process satisfies:

[0086] All solutions to the problem can be expressed as designed genotypes;

[0087] Any genotype corresponds to a possible solution;

[0088] There is a one-to-one correspondence between phenotype and genotype.

[0089] exist Figure 3In the encoding process of the model, customer points, distribution centers, delivery vehicles, and charging stations are encoded separately, that is, a chromosome should contain all customer points, distribution centers, and delivery vehicles. The solution is obtained in the order of their encoding. As shown in the figure, there are 15 customer points, 3 distribution centers, and 5 vehicles. Customers have pickup and delivery requirements. The output result genotype is [1,14,18,17,4,19,2,16,20,12,22,6,19,7,4,5,21,3,8,9,10,11,23,] and the phenotype should be [11,15,14,1,] delivered by distribution center A and delivery vehicle V1,

[13] delivered by distribution center A and delivery vehicle V2, [9] delivered by distribution center B and delivery vehicle V4, [3,10,4,1,2] delivered by distribution center B and delivery vehicle V3, [5,6,7,8] delivered by distribution center C and delivery vehicle V5.

[0090] Probabilistic selection module:

[0091] In nature, the more adaptable an individual is, the more likely it is to reproduce. However, it cannot be said that the higher the fitness, the more offspring it will definitely have. It can only be said in terms of probability. Genetic algorithms are not like conventional algorithms that eliminate those with values ​​worse than other values. Instead, they give a probability (the disadvantaged may not necessarily perish, but the probability of survival is very low). This probability depends on the fitness of the individual (that is, the size of the objective function obtained in the optimization algorithm). Roulette is used here for selection.

[0092] Assume that the size of the population is N, and F(xi) represents the fitness value of the ith individual. Then the probability of the ith individual being selected is given by the following formula:

[0093]

[0094] Crossover modules:

[0095] By randomly picking a floating point number r, if r is less than the hybridization probability p c , then the genes of the two selected chromosomes are hybridized to obtain a new individual.

[0096] Mutation module:

[0097] Perform the following operations on each gene in the chromosome:

[0098] A random floating point number r;

[0099] Compare r with the mutation rate Pm. If r is smaller, mutate the current gene to a random number within the value range. Otherwise, operate on the next gene.

[0100] Key gene selection module:

[0101] The random forest algorithm in machine learning is used to construct a model for chromosome iteration based on the value of the constructed objective function. At the same time, the random forest algorithm is used to learn the mapping relationship between each gene in the individual genotype and fitness, and the influence weight of each gene in the chromosome iteration process is calculated. The gene iteration pros and cons model is obtained to determine the key genes in the chromosome iteration process, such as Figure 3 In the gene iteration process shown in the figure, gene [2,7] is determined to be the key gene during the iteration. In the subsequent iteration process, the position of gene [2,7] will not change, thereby guiding the optimized gene to iterate in the direction of a better solution, improving the efficiency and accuracy of the algorithm in seeking the optimal solution, and thus providing optimization suggestions for the chromosome iteration process.

[0102] Integrate the above modules to get the final flowchart as follows Figure 4 ,include:

[0103] Define the objective function of the problem: Minimize the minimum cost in the multi-distribution center electric vehicle routing problem. The lowest cost mainly comes from two aspects:

[0104] The total path shortened by path optimization reduces power usage;

[0105] It satisfies the time window constraint and reduces the penalty cost.

[0106] Time window late penalty function:

[0107] Early arrival penalty coefficient × early arrival duration (vehicle arrival time - time window upper limit)

[0108] Late penalty coefficient × late duration (vehicle late time - time window lower limit)

[0109]

[0110] The above formula is the penalty cost of all vehicles, where θ is the penalty coefficient for early arrival, η is the penalty coefficient for delayed arrival, and λ u is the beginning of the customer time window, μ i is the end time of the customer's time window, and t is the time when the vehicle arrives at the customer.

[0111] Design an encoding method for the genetic algorithm: Use binary encoding to convert the solution to the problem into an encoding method that the genetic algorithm can handle.

[0112] Initialize the population: Initialize the initial population by random generation to obtain an initial population that is consistent with the input population size. The order of each customer point gene on the chromosome represents the actual order in path planning. The optimal solution of the initial population is calculated as the initial solution X. Record the corresponding delivery vehicle path set, the distribution center set corresponding to the customer point, and the delivery vehicle charging start position set.

[0113] Input basic parameters such as population size NP, maximum number of iterations, Pc crossover rate, L chromosome length, Pm mutation rate, afa penalty coefficient, etc.

[0114] Evaluate fitness: Evaluate the fitness of each individual through the objective function to evaluate the pros and cons of the individual, and record the current optimal solution p best , the global optimal solution g best .

[0115] Selection operation: Selecting excellent individuals from the population as parents of the next generation, using methods such as roulette or tournament selection.

[0116] Crossover operation: Combine certain genes of parent individuals to generate new individuals using single-point crossover.

[0117] Mutation operation: mutate the newly generated individuals using the Gaussian mutation method.

[0118] Machine learning model training: The encoding representation of the generated new individuals is taken as input and the target function value is taken as output. The machine learning model is trained to learn the mapping relationship between the encoding and the target function.

[0119] Evaluate individual fitness: Use the trained machine learning model to predict the objective function value for each individual to evaluate its fitness, and calculate the probability of this individual genotype being selected in the iteration based on the fitness.

[0120] Compare the current optimal solution p best and the new fitness function value, if the current optimal solution p best is less than the new fitness function value, keep the current multi-distribution center electric vehicle path planning scheme and related data. best If the value is greater than the new fitness function value, the current multi-distribution center electric vehicle path planning scheme and related data will be updated.

[0121] Selection, crossover, and mutation operations: Repeat selection, crossover, and mutation to generate the next generation of individuals, and use machine learning models to evaluate fitness.

[0122] Termination condition: If t≥iteration, exit the algorithm process and output X, as well as the corresponding delivery vehicle path set, the distribution center set corresponding to the customer point, and the delivery vehicle charging starting position set. Otherwise, continue to evaluate, select, cross, and mutate.

[0123] The gene order of the chromosome is updated according to the population size NP, the maximum number of iterations, the Pc crossover rate, the L chromosome length, the Pm mutation rate, the afa penalty coefficient, etc., and a new customer point sequence X is obtained, t=t+1, and then transferred to the evaluation and selection module.

[0124] Output results: Output the optimal solution code and objective function value, that is, the optimal solution to the optimization problem.

[0125] For Figure 3 Solve the problem model shown:

[0126] Figure 5 This is the result of the present invention not performing multi-distribution center electric vehicle path planning. Figure 6 This is the result of the electric vehicle route planning for the distribution center. It can be seen that before the multi-distribution center electric vehicle route planning, a large number of delivery vehicles were wasted between customer points. After optimization, delivery was carried out according to the distance between different distribution centers and customer points, reducing the delivery time by 45%.

[0127] Embodiment 2:

[0128] As shown in Table 1, this embodiment consists of 20 customers, coded as C0-C19, 3 distribution centers, coded as D1, D2, D3, 3 charging stations, coded as E1, E2, E3, and 5 distribution electric vehicles, coded as V1-V5. They are numbered respectively.

[0129] Table 1

[0130]

[0131] Preparations:

[0132] Calculate the OD distance matrix between all numbers and find the nearest distribution center and charging station corresponding to each customer point. Set the iteration (maximum number of iterations) to 100, and the other parameter values ​​in the method are shown in Table 2:

[0133] Table 2

[0134] name Numeric Interpretation NP 50 Population size L 31 Chromosome length Pc 0.8 Crossover rate Pm 0.05 Mutation rate afa 1000 Penalty coefficient

[0135] Solution process:

[0136] Initial solution generation:

[0137] The original population is initialized with random numbers, and the optimal solution of all chromosomes in the original population is obtained as the initial solution. The initial solution is:

[0138] X=[0,26,3,6,12,28,15,21,17,18,22,1,29,4,7,5,8,30,13,14,20,9,2,27,10,11,19,16]

[0139] The initial solution is divided. The distribution center D1 is delivered by two vehicles, V1 and V3, and the delivery paths are V1[3,6,12] and V3[15,21,17,18,22] respectively; the distribution center D2 is delivered by two vehicles, V4 and V5, and the delivery paths are V4[4,7,5,8] and V5[13,14,20,9] respectively; the distribution center D3 is delivered by V2, and the delivery path is V2[10,11,19,16]. The total path length of the initial solution is 1147.6 (keep one decimal place).

[0140] Charging status: When V3 is transported to customer point C14, the power exceeds its own power, and it goes to the nearest charging station E2 corresponding to customer point C14 for charging; when V2 is transported to customer point C2, the power exceeds its own power, and it goes to the nearest charging station E2 corresponding to customer point C2 for charging.

[0141] Iteration 1:

[0142] According to the speed and position update module, the current solution is updated to obtain:

[0143] X=[0,26,3,6,15,28,12,21,17,18,22,1,29,4,9,5,8,30,13,14,20,7,2,27,10,11,19,16]

[0144] The solution of the first iteration is split. The distribution center D1 is delivered by two vehicles, V1 and V3, and the delivery paths are V1[3,6,15] and V3[12,21,17,18,22] respectively; the distribution center D2 is delivered by two vehicles, V4 and V5, and the delivery paths are V4[4,9,5,8] and V5[13,14,20,7] respectively; the distribution center D3 is delivered by V2, and the delivery path is V2[10,11,19,16]. The total path length of the solution is 1058.1 (keep one decimal place).

[0145] Charging status: When V4 is transported to customer point C17, the power exceeds its own power, and it goes to the nearest charging station E2 corresponding to customer point C14 for charging; when V2 is transported to customer point C2, the power exceeds its own power, and it goes to the nearest charging station E2 corresponding to customer point C2 for charging.

[0146] Iteration 10:

[0147] According to the speed and position update module, the current solution is:

[0148] X=[0,26,3,6,15,28,12,21,17,18,22,1,29,4,9,5,8,30,13,14,20,7,2,27,10,11,19,16]

[0149] Update to get:

[0150] X=[0,26,3,10,11,28,12,21,17,18,22,1,29,4,9,5,8,30,13,14,20,7,2,27,6,15,19,16]

[0151] The solution of the tenth iteration is split. The distribution center D1 is delivered by two vehicles, V1 and V3, and the delivery paths are V1[3,10,11] and V3[12,21,17,18,22] respectively; the distribution center D2 is delivered by two vehicles, V4 and V5, and the delivery paths are V4[4,9,5,8] and V5[13,14,20,7] respectively; the distribution center D3 is delivered by V2, and the delivery path is V2[6,15,19,16]. The total path length of the solution is 984.3 (keep one decimal place).

[0152] Charging status: When V4 is transported to customer point C2, the power exceeds its own power, so it goes to the nearest charging station E2 corresponding to customer point C25 for charging; when V5 is transported to customer point C17, the power exceeds its own power, so it goes to the nearest charging station E3 corresponding to customer point C17 for charging.

[0153] Iteration 20:

[0154] According to the speed and position update module, the current solution is:

[0155] X=[0,26,3,10,11,28,12,21,7,18,22,2,29,4,9,5,8,30,13,14,20,7,2,27,6,15,19,16]

[0156] Update to get:

[0157] X=[0,26,3,10,11,28,12,21,4,22,5,1,29,17,18,9,7,8,30,13,14,20,2,27,6,15,19,16]

[0158] The solution of the 20th iteration is split. The distribution center D1 is delivered by two vehicles, V1 and V3, and the delivery paths are V1[3,10,11] and V3[12,21,4,22,5] respectively; the distribution center D2 is delivered by two vehicles, V4 and V5, and the delivery paths are V4[17,18,9,7,8] and V5[13,14,20] respectively; the distribution center D3 is delivered by V2, and the delivery path is V2[6,15,19,16]. The total path length of the solution is 885.8 (keep one decimal place).

[0159] Charging status: When V3 is delivered to customer point C1, the power exceeds its own power, and it goes to the nearest charging station E2 corresponding to customer point C1 for charging.

[0160] Iteration 50:

[0161] According to the speed and position update module, the current solution is:

[0162] X=[0,26,3,10,11,28,12,21,17,18,22,2,29,4,9,5,8,30,13,14,20,7,2,27,6,15,19,16]

[0163] Update to get:

[0164] X=[0,26,3,10,11,28,12,21,5,1,29,17,18,9,15,4,8,30,13,16,20,14,22,27,19,6,7]

[0165] The solution of the 50th iteration is split. The distribution center D1 is delivered by two vehicles, V1 and V3, and the delivery paths are V1[3,10,11] and V3[12,21,5] respectively; the distribution center D2 is delivered by two vehicles, V4 and V5, and the delivery paths are V4[17,18,9,15,4,8] and V5[13,16,20,14,22] respectively; the distribution center D3 is delivered by V2, and the delivery path is V2[19,6,7]. The total path length of the solution is 637.8 (keep one decimal place).

[0166] Charging status: When V5 is delivered to customer point C11, the power exceeds its own power, and it goes to the nearest charging station E2 corresponding to customer point C11 for charging.

[0167] 100th iteration:

[0168] According to the velocity and position update module, the current solution is:

[0169] X=[0,26,3,10,11,28,12,21,17,18,22,2,29,4,9,5,8,30,13,14,20,7,2,27,6,15,19,16]

[0170] Update to get:

[0171] X=[0,26,3,10,11,28,12,21,5,1,29,17,18,9,15,4,8,30,13,16,20,14,22,27,19,6,7]

[0172] The 100th solution is split. We get that the distribution center D1 is delivered by two vehicles, V1 and V3, and the delivery paths are V1[3,10,11] and V3[12,21,5] respectively; the distribution center D2 is delivered by two vehicles, V4 and V5, and the delivery paths are V4[17,18,9,15,4,8] and V5[13,16,20,14,22] respectively; the distribution center D3 is delivered by V2, and the delivery path is V2[19,6,7]. The total path length of the solution is 637.8 (keep one decimal place).

[0173] Charging status: When V5 is delivered to customer point C11, the power exceeds its own power, and it goes to the nearest charging station E2 corresponding to customer point C11 for charging.

[0174] By calculating the total path length of the solution in the iteration, we can clearly see that in the continuous iteration, the total length of the path keeps shortening, and the optimal solution has been obtained at the 50th iteration, which takes into account the accuracy of the model solution. At the same time, the machine learning model is used to guide the genetic algorithm to a certain extent, thereby improving the efficiency of the calculation.

[0175] The present application is described with reference to the flowcharts and computer program products according to the embodiments of the present application. It should be understood that each process in the flowchart can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the process in the flowchart. Figure 1 A device that specifies functions in a process or multiple processes.

[0176] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A function specified in a process or multiple processes.

[0177] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 The steps of a specified function in a process or multiple processes.

Claims

1. A multi-distribution center electric vehicle path planning method, characterized by: include: Get the distribution center set, customer point set and charging station set; According to the distribution center set, the customer point set and the charging station set, an objective function is constructed under the premise of considering the customer service time window and the electric vehicle power usage; The constructed objective function is solved by a genetic algorithm with machine learning as the evaluation model, including: S1: Encode the obtained distribution center set, customer point set, charging station set and distribution electric vehicle. Each distribution center, customer point, charging station and distribution electric vehicle corresponds to an independent code. At the same time, a corresponding decoding table is established according to the corresponding relationship of the coding. With the constraint that each customer point has a corresponding distribution center and distribution vehicle, the generated codes are randomly sorted to obtain a sequence. The obtained sequence is an individual genotype, and each code in the sequence is a gene; S2: Configure the parameters in the genetic algorithm according to the obtained distribution center set and customer point set data, including: Population size NP, maximum number of iterations, crossover rate Pc, chromosome length L, mutation rate Pm, penalty coefficient afa; S3: Repeat step S1 with the constraint that each customer point has a corresponding distribution center and distribution vehicle, randomly sort the generated codes to obtain a sequence, generate a new individual genotype each time, and stop randomly sorting the generated codes until the number of generated individual genotypes is consistent with the configured population size NP, and form the generated individual genotypes into a set to obtain the initial population in the genetic algorithm, calculate each individual genotype of the initial population using the established objective function, and compare to obtain the individual genotype with the best objective function value in the initial population. This individual genotype is the optimal solution of the current population, which is called the current optimal solution, and the optimal solution of the initial population is also the global optimal solution at this time; S4: Use the random forest algorithm in machine learning to build an evaluation model, use the constructed evaluation model to evaluate the fitness of each individual genotype in the initial population, and calculate the probability of each individual genotype being selected when generating a new population based on the fitness of each individual genotype obtained; S5: According to the crossover rate Pc and mutation rate Pm configured by the genetic algorithm, an operation of adding a new individual genotype to a new population is selected once, including crossover, mutation and replication. If crossover is not selected and mutation is not selected in this selection, replication is performed. After the operation to be performed is selected, the individual genotypes in the initial population are selected according to the probability of each individual genotype obtained in S4 being selected when generating a new population, and the selected operation is performed, and the new individual genotype generated by the operation is added to the new population. At the same time, the fitness of the generated new individual genotype is evaluated using the evaluation model constructed in step S4 to obtain the fitness of the new individual genotype. At the same time, the machine learning model is used to learn the weight of each gene in the individual genotype in the fitness evaluation, and the key gene of the individual genotype is determined according to the weight of each gene in the individual genotype, and the position of the determined key gene does not change in the iterative process after the individual genotype; S6: Repeat step S5 until the number of individual genotypes in the new population is the same as the configured population size NP. At this time, one iteration is completed, and the fitness of each individual genotype in the new population is obtained. By comparing the fitness value of each individual in the new population, the individual genotype with the best objective function value in the new population is obtained as the current optimal solution of the new population. The current optimal solution of the new population is compared with the global optimal solution to determine the new global optimal solution. S7: Repeat step S6, each time the number of iterations is increased by 1. When the number of iterations is the same as the configured maximum number of iterations, stop repeating step S6, output the individual genotype corresponding to the global optimal solution, decode the obtained genotype according to the established decoding table, and obtain the charging path and charging station of the electric vehicle by calculation to obtain the optimal path-charging solution.

2. A multi-distribution center electric vehicle path planning method according to claim 1, characterized in that: The objective function constructed includes: Objective function model: objective function = penalty cost + total electricity cost; The penalty cost is the penalty fee incurred when the delivery arrival time does not meet the customer's scheduled time window; The total electricity cost is obtained by multiplying the total route of the electric vehicle by the unit distance electricity cost; The function is as follows: minCost=cost η +cost s Where minCost is the objective function value, cost η is the penalty cost, cost s The total electricity cost.

3. A multi-distribution center electric vehicle path planning method according to claim 2, characterized in that: The penalty costs specifically include: The above formula is the penalty cost of all vehicles, where θ is the penalty coefficient for early arrival, η is the penalty coefficient for delayed arrival, and λ u is the beginning of the customer time window, μ i is the end time of the customer's time window, and t is the time when the vehicle arrives at the customer.

4. A multi-distribution center electric vehicle path planning method according to claim 1, characterized in that: The specific calculation of the probability of each individual genotype being selected when generating a new population is: The size of the population is N, F(xi) represents the fitness value of the genotype of the i-th individual, then the probability of the i-th individual genotype being selected is given by the following formula 5. The multi-distribution center electric vehicle path planning method according to claim 1, characterized in that: The operation of adding a new individual genotype to a new population according to the crossover rate Pc and mutation rate Pm configured by the genetic algorithm includes crossover, mutation and replication, and the crossover is specifically: Determine the genotype of the selected individuals; A random floating point number r; Compare the floating point number r with the configured crossover rate Pc; If r is less than the hybridization probability pc, the genes of the two selected individual genotypes will be hybridized to obtain a new individual.

6. A multi-distribution center electric vehicle path planning method according to claim 1, characterized in that: According to the crossover rate Pc and mutation rate Pm configured by the genetic algorithm, the operation of adding a new individual genotype to a new population includes crossover, mutation, and mutation in replication. Specifically, the mutation is: Determine the genotype of the selected individuals; A random floating point number r; Compare the floating point number r and the mutation rate Pm; If r is less than the mutation rate Pm, Gaussian mutation is performed on the current gene.

7. A multi-distribution center electric vehicle path planning method according to claim 6, characterized in that: The Gaussian mutation is specifically as follows: when performing a mutation operation, a random number that conforms to a normal distribution with a mean of and a variance of is used to replace the original gene value to obtain a new individual.

8. The multi-distribution center electric vehicle path planning method according to claim 1, characterized in that: The copy operation is specifically as follows: Determine the genotype of the selected individuals; Replicate their individual genotypes; Add the copied individuals to the new population.

9. The multi-distribution center electric vehicle path planning method according to claim 1, characterized in that: The calculation of the charging path and charging station for the electric vehicle specifically includes: Calculate the nearest charging station and storage center for each customer point; Calculate the current power of the electric vehicle when it arrives at each point and compare it with the power required to reach the next customer and return to the warehouse center; If the current power is less than the power required to reach the next customer and return to the storage center, the vehicle will go to the charging station closest to the current station for charging.

10. The multi-distribution center electric vehicle path planning method according to claim 1, characterized in that: The current optimal solution of the new population is compared with the global optimal solution to determine the new global optimal solution: Evaluate the fitness of each individual genotype in the new population and record the current optimal solution of the new population; Compare the current optimal solution of the new population with the global optimal solution; If the fitness of the current optimal solution of the new population is less than the fitness value of the global optimal solution, the current optimal solution is maintained; if the fitness value of the current optimal solution is greater than the fitness value of the global optimal solution, the current optimal solution of the new population is updated to the global optimal solution.