Express terminal two-stage distribution path optimization method and system based on map API real-time data
By adopting a two-stage optimization method based on map API in the optimization of express terminal delivery paths, and using improved genetic algorithms and simulated annealing algorithms, the shortcomings of delivery path optimization in the existing technology are solved, and a more efficient, environmentally friendly and economical delivery solution is achieved.
Patent Information
- Application Number
- CN202411576049.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-06
- Publication Date
- 2025-02-25
AI Technical Summary
It is difficult for the existing technology to effectively optimize the express terminal distribution path, especially when facing complex road conditions and diversified order needs, traditional methods have shortcomings in distance deviations and real-time road conditions data.
A two-stage distribution path optimization method based on real-time data of the map API is adopted. In the first stage, a multi-objective optimization model is established by improving the genetic algorithm to consider the vehicle load and maximum mileage constraints; in the second stage, a multi-objective optimization model is established using the map API to improve the K-means clustering results, and a mathematical model with the highest customer satisfaction is constructed based on the simulated annealing algorithm.
In a changing environment, optimal path optimization is achieved based on real-time road conditions and order differences, improving distribution efficiency and customer satisfaction, while reducing carbon emissions and distribution costs.
Smart Images

Figure CN119515243A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of logistics distribution path optimization, and in particular to a method and system for optimizing a two-stage distribution path at the end of an express delivery service based on map API real-time data. Background Art
[0002] The fierce competition in the current logistics market and the diversification of customer service requirements have made the modern logistics distribution process more complicated, and put forward higher requirements for the logistics distribution system to respond to the changing environment and adjust the operation plan in time. There are large differences in the order completion goals of express delivery companies. When facing different orders, they need to choose between the optimal goals of cost, driving distance, driving time and carbon emissions. Current research mainly focuses on time-varying road networks and carbon emission path optimization, but there is little research on the optimization problem of express delivery terminal delivery path decision-making based on map API real-time data.
[0003] As the last-mile delivery directly connected to customers, it is not only the most costly part of the entire express delivery, but also the most important part affecting customer satisfaction. Due to the large volume of orders for last-mile delivery, the complex delivery situation, and the impact of the time window of the delivery service, the traditional Euclidean distance clustering algorithm deviates from the actual geographical situation. In most path optimization studies, road data are mostly simulated data or fixed data, and real road condition information is rarely used. Therefore, there is an urgent need for a two-stage delivery path optimization method and system for express delivery based on real-time data from map API. Summary of the invention
[0004] In view of the deficiencies of the prior art, the present invention provides a two-stage delivery path optimization method and system for express delivery terminals based on real-time data from a map API. The present invention considers the two-stage path optimization problems of transfer station-express delivery outlets and express delivery outlets-customers. In the first stage, the vehicle load and maximum mileage constraints are considered to establish a mathematical optimization model that considers four objectives, namely, delivery cost, delivery distance, longest driving time and carbon emissions. An improved genetic algorithm solver based on a large-scale neighborhood search algorithm is designed to visualize the driving routes and compare and analyze the optimization schemes for the optimal delivery paths under different objectives, so that enterprises can face a changing environment and make the best path optimization decisions by fully considering the differences in road conditions and orders. In the second stage, the map API is used to improve the K-means clustering results, and a mathematical model with the highest customer satisfaction as the goal is constructed based on the mailing time window function. A solver based on a simulated annealing algorithm is designed to determine the optimal delivery path.
[0005] Terminology explanation:
[0006] 1. Map API: It is a set of application interfaces based on map services provided for developers, including JavaScript API, Web service API, Android SDK, iOS SDK, positioning SDK, Internet of Vehicles API, LBS cloud and other development tools and services. It provides basic map display, search, positioning, reverse / geocoding, route planning, LBS cloud storage and retrieval and other functions. It is suitable for map application development on various devices such as PC, mobile, and server, and under various operating systems.
[0007] 2. Traditional genetic algorithm: It is an optimization algorithm that simulates the principles of natural selection and genetics. It seeks the optimal solution to the problem by maintaining a population of individuals (potential solutions) and gradually evolving through operations such as fitness evaluation, selection, crossover and mutation.
[0008] 3. Selection operation: select individuals for reproduction based on fitness. Common selection strategies include roulette selection, tournament selection, etc. The purpose of selection is to retain excellent individuals and increase their probability of appearing in the next generation.
[0009] 4. Crossover operation: Crossover is a simulation of gene recombination in genetics, usually involving two or more parent individuals, which produces new individuals by exchanging some genes to explore new solution space.
[0010] 5. Mutation operation: Mutation is to randomly change part of an individual's genes to increase the diversity of the population and prevent the algorithm from falling into a local optimum.
[0011] To achieve the above object, the present invention provides the following technical solutions:
[0012] A two-stage delivery route optimization method for express delivery terminals based on real-time data from a map API, comprising:
[0013] Step 1: Use the map API to obtain real-time driving distance and time and collect customer demand information; the demand information includes the location coordinates of the transfer station, express outlets and each customer demand point, the delivery volume, the number of shipments, the specified time window, and the acceptable time window;
[0014] Step 2: Transfer station-express delivery outlet stage: Establish four mathematical optimization models with the goals of lowest delivery cost, shortest delivery distance, shortest longest driving time and lowest carbon emissions, and determine the constraints; solve the optimal path model based on the improved genetic algorithm of the large-scale neighborhood search algorithm, visualize the driving route and compare and analyze the optimization schemes for the optimal delivery path under different goals, so as to make the best path optimization decision for enterprises in the face of changing environments, taking into full consideration the differences in road conditions and orders;
[0015] Step 3: Express outlets-customer stage: Use the map API to improve the K-means clustering results, build a mathematical model with the highest customer satisfaction as the goal based on the delivery time window function, determine the constraints, solve the optimal path model based on the simulated annealing algorithm, and determine the optimal path.
[0016] According to the preferred embodiment of the present invention, the specific implementation process of step 1 includes: using the map API to obtain real-time traffic information to model and solve the transfer station-express delivery outlet path optimization problem; and calling the driving distance, driving time, and visualized driving route between the transfer station and each express delivery outlet in real time. Specifically including:
[0017] There are multiple routes with different road conditions between any two points in the distribution road network. The driving speed of vehicles on the same route varies with the traffic time. The map API obtains road data for a period of time in the future from the departure time based on traffic big data. The batch route calculation function of the map API calculates the route distance and time in batches based on the starting point and the end point. At the same time, the real-time road conditions are taken into account during the calculation process.
[0018] The map API retrieves eligible driving and cycling (bicycle, electric bicycle) route planning solutions based on the starting and ending coordinates. Combined with multi-way point route planning, delivery routes can be visualized.
[0019] According to the preferred embodiment of the present invention, in step 2, four mathematical optimization models with the objectives of minimum delivery cost, shortest delivery distance, shortest longest driving time and minimum carbon emissions are established, and the constraints are determined; including:
[0020] The four mathematical optimization models include the objective function of minimizing delivery cost, minimizing delivery distance, minimizing longest driving time, and minimizing carbon emissions; the delivery cost includes the fixed cost of the delivery vehicle, the fuel consumption cost of the vehicle related to the load, and the salary of the delivery staff;
[0021] The calculation formula for the fixed cost of the delivery vehicle is:
[0022] C1=Nc1;
[0023] Where N represents the number of vehicles, c1 represents the unit fixed cost;
[0024] The calculation formula of the vehicle fuel consumption cost related to the load is:
[0025] Carbon emissions are also related to fuel consumption. Considering that fuel consumption is related to vehicle load and vehicle travel distance, the fuel consumption rate when the vehicle is empty and fully loaded is introduced here. The fuel consumption rate under different load conditions is calculated by the full load rate, that is,
[0026]
[0027] Among them, the node set D = {D i |i=1,2,…,n}, when i is 0, it means a transfer station, 1 to n means there are n express delivery outlets in the area; vehicle set K={K i |i=1,2,…,l}, indicating that the transfer station has a total of l vehicles; l ij represents the distance between point i and j; w ijk represents the load of vehicle k from node i to node j; Q represents the maximum load of the vehicle; c2 represents the oil price; ρ0 represents the fuel consumption rate when the vehicle is unloaded; ρ * Indicates the fuel consumption rate when the vehicle is fully loaded; x ijk It is a 0-1 integer programming, indicating whether vehicle K passes through nodes i and j;
[0028] The calculation formula for the delivery staff salary is:
[0029]
[0030] Among them, t ij represents the time required to travel from node i to node j; t represents the service time required for loading and unloading at a single express delivery outlet; c3 represents the average hourly wage of the delivery driver;
[0031] The objective function for minimizing the delivery cost is:
[0032]
[0033] The objective function for the shortest delivery distance is:
[0034]
[0035] The objective function of minimizing the longest travel time is:
[0036]
[0037] The objective function for minimizing carbon emissions is:
[0038]
[0039] Where γ represents the conversion rate of fuel combustion to carbon dioxide;
[0040] The constraints of the four mathematical optimization models are as follows:
[0041] Vehicle load restrictions;
[0042] Vehicle maximum range constraints;
[0043] N≤l, N≥0, indicating that the number of delivery vehicles dispatched by the transfer station is not greater than its ownership;
[0044] Constraints on the total delivery volume of each express delivery outlet;
[0045] Constraints on the total return volume of each express delivery outlet;
[0046] It means that a courier outlet has only one vehicle serving it and only serves it once;
[0047] It means that each vehicle starts from the transfer station and finally returns to the transfer station;
[0048] Ensure that the vehicle entering and exiting express delivery outlet j is the same vehicle;
[0049] Avoid vehicles from making self-loops during the delivery process.
[0050] Where, L represents the maximum driving distance of the vehicle (km); q i Indicates the amount of express delivery that the transfer station needs to deliver to the express delivery outlets; p i It indicates the amount of express delivery that the transfer station needs to transport back from the express delivery outlets.
[0051] Preferably, according to the present invention, solving the optimal path optimization model based on the improved genetic algorithm to determine the optimal vehicle delivery path includes:
[0052] a. Perform chromosome encoding on the transfer station nodes and each express delivery outlet node, and define the fitness function as the inverse of the objective function; map the chromosome encoding of the population individual to a real value, which is used to represent the fitness of the individual;
[0053] b. Randomly arrange the nodes of each express delivery outlet to generate random individuals to form an initial population; use a traditional genetic algorithm to traverse the entire system, which refers to the distribution network including transfer stations and express delivery outlets; convert the initial solution (i.e., a complete distribution plan) into initial individuals;
[0054] c. Select individuals in the current group according to their fitness values; perform crossover and mutation operations based on the selected individuals to generate individuals in the new generation group;
[0055] d. Introducing the destruction and repair mechanism of the large-scale neighborhood search algorithm into the traditional genetic algorithm, including:
[0056] Destruction: Randomly delete a customer a from the current solution set S after the first generation of selection, crossover and mutation operations, and save it to the removed customer set R. Remove the customer with the greatest correlation with customer a from the remaining customer set S′ and add it to the customer set R. Repeat this operation, randomly select customer a1 from the customer set R, and remove the customer with the greatest correlation with a1, until the customer set R reaches the predetermined number, shortening the route for customers to be deleted.
[0057] To avoid over-reliance on the correlation function, a random factor is introduced into the destruction operation; the specific method is as follows: define the random number D as the weight of selecting the customer to be removed, and its range is between [0,1]; assume index = (Random([0,1])) D ×(S′), then S' is a customer list sorted from large to small according to the correlation with customer a as lst. According to the random number D, lst[index] is selected from the sorted list lst as the customer to be removed; when D is 1, the customer selection is completely random; when D is close to positive infinity, the customer selection tends to the customer with the greatest correlation. Therefore, the larger the value of the random factor D, the more likely it is to select customers with high correlation.
[0058] Fix: Rebuild the solution by inserting the removed customers. Find a location that meets the constraints, scan all free locations, and repeatedly insert the customer with the minimum cost until all customers are inserted;
[0059] e. Take the new generation population as the current population and return to step c for iteration until the number of population iterations reaches the preset number of iterations; output the individual with the largest fitness value in the last generation population, which is the optimal delivery path for the vehicle.
[0060] Further preferably, the correlation calculation formula is:
[0061]
[0062] l ij represents the distance between express delivery outlets i and j; v ij Indicates whether i and j are on the same path, that is, whether they are served by the same vehicle. If they are on the same path, it is 1, otherwise it is 0.
[0063] Preferably, in step 3, using a map API to improve the K-means clustering result includes:
[0064] Order segmentation: Orders are divided according to time windows to ensure the uniformity of the time dimension. Since delivery orders are highly random and their locations and times are relatively scattered, only delivery orders without time window restrictions are clustered.
[0065] Gaussian projection conversion: perform Gaussian projection conversion on the longitude and latitude coordinates obtained from the map API;
[0066] Preliminary clustering: Use K-means algorithm to cluster and get K initial groups;
[0067] Driving time calculation and outlier processing: Calculate the driving time T within the K initial grouping results; for example, if there is a point j in group i whose driving time from any point other than j in the group is greater than t minutes, then point j is determined to be a point that travels farther than other points in group i, and point j is removed from group i and classified as a separate class to ensure the accuracy of the results in practical applications.
[0068] According to the preferred embodiment of the present invention, in step 3, a mathematical model with the highest customer satisfaction as the goal is to be constructed based on the mailing time window function, and the constraint conditions are determined; including:
[0069] According to the demand information, a mathematical model with the highest customer satisfaction as the goal is established, including: the mathematical model with the highest customer satisfaction as the goal is that the sum of the delivery time and the time penalty is minimized, that is, the customer satisfaction is the highest;
[0070] The delivery time is calculated as follows:
[0071]
[0072] Among them, the set D={D i |i=1,2,…,n}, when i is 0, it indicates the location of the delivery vehicle, and 1 to n indicate the set of points that need to be traversed in the area; t ij represents the time required to travel from node i to node j; q i represents the quantity of express delivery required by customer i (the number of customers included); t represents the delivery and mailing service time of a single express item; x ij It means that the vehicle is traveling from node to node, which is 1, otherwise it is 0;
[0073] The penalty time is calculated as:
[0074]
[0075] Among them, E.T. i represents the left time window of customer i, that is, the earliest service time required by the customer within the service point; LT i AT represents the right time window of customer i, that is, the latest service time required by the customer in the service point; i The arrival time of customer i; C represents the penalty coefficient for early or late arrival;
[0076] The sum of delivery time and time penalty is minimized, that is, the objective function with the highest customer satisfaction is:
[0077]
[0078] The constraints for establishing the highest customer satisfaction objective function are as follows:
[0079] Vehicle load restrictions;
[0080] Vehicle maximum range constraints;
[0081] It means that a customer is served by only one courier and only once;
[0082] Avoid vehicles from making self-loops during the delivery process;
[0083] AT j =AT i +max(ET i -AT i ,0)+q i t+t ij , the time when the vehicle arrives at customer point j.
[0084] Preferably, according to the present invention, solving the optimal path model based on a simulated annealing algorithm to determine the optimal path comprises:
[0085] (1) Input the known parameters of the geographical location coordinates, demand, and vehicle capacity of each customer node;
[0086] (2) Setting the initial temperature, end temperature, cooling rate, number of iterations g, and number of new solution searches L;
[0087] (3) Randomly generate the initial delivery path to meet the time window constraint and use the initial solution as the current optimal solution; randomly select the order of customer nodes to ensure that all nodes are visited. When generating the path, it is necessary to ensure that the vehicle reaches each customer within the specified time.
[0088] (4) When the initial temperature T is greater than the final temperature T end , make a small-scale disturbance or change to S0 to generate a new solution S new , and calculate dC = S new -S0, if dC<0, then accept the new solution S new As the new current solution S0, otherwise, with probability Accept S new ;
[0089] (5) Repeat step (4), add 1 to the number of iterations after searching for new solutions L times, and cool down once at the cooling rate;
[0090] (6) When the temperature T drops to the termination temperature Tend , end the iteration and output the optimal solution.
[0091] A computer device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of a method for optimizing a two-stage delivery path at the end of an express delivery service based on real-time data from a map API are implemented.
[0092] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of a two-stage delivery path optimization method for express delivery terminals based on map API real-time data.
[0093] A two-stage delivery route optimization system for express delivery terminals based on real-time data from map API, including:
[0094] The demand information acquisition module is used to: use the map API to obtain real-time driving distance and time and collect customer demand information; the demand information includes the location coordinates of the transfer station, express outlets and each customer demand point, the delivery volume, the mail volume, the specified time window, and the acceptable time window;
[0095] The transfer station-express delivery point route optimization module is used to: establish four mathematical optimization models with the goals of lowest delivery cost, shortest delivery distance, shortest longest driving time and lowest carbon emissions, and determine the constraints; solve the optimal route model based on the improved genetic algorithm of the large-scale neighborhood search algorithm, visualize the route and compare and analyze the optimization schemes for the optimal delivery routes under different goals, so as to make the best route optimization decision for enterprises in the face of changing environments, taking into full consideration the differences in road conditions and orders;
[0096] The express delivery point-customer delivery optimization module is used to: use the map API to improve the K-means clustering results, build a mathematical model with the highest customer satisfaction as the goal based on the delivery time window function, and determine the constraints; solve the optimal path model based on the simulated annealing algorithm to determine the optimal path.
[0097] According to the specific embodiments provided by the present invention, the present invention discloses the following technical effects:
[0098] The present invention provides a two-stage delivery path optimization method and system for express delivery terminals based on real-time data of map API, comprising the following steps: dividing the delivery process into two stages of "transfer station-express delivery outlet" and "express delivery outlet-customer" for path optimization, using map API to obtain real-time driving distance and time and collect customer demand information, considering constraints such as vehicle load and maximum driving mileage in the first stage, establishing a mathematical optimization model of four objectives considering delivery cost, delivery driving distance, maximum driving time and carbon emissions, designing an improved genetic algorithm solution program based on large-scale neighborhood search algorithm, visualizing the driving route and comparing and analyzing the optimization schemes for the optimal delivery path under different objectives, and making the optimal path optimization decision for enterprises in the face of changing environments and fully considering the differences in road conditions and orders. The present invention integrates the destruction and repair mechanism in the large-scale neighborhood search algorithm into the traditional genetic algorithm, significantly improving the quality and speed of model solution. In the second stage, the map API is used to improve the K-means clustering results, a mathematical model with the highest customer satisfaction as the goal is constructed based on the mailing time window function, and a solution program based on the simulated annealing algorithm is designed to determine the optimal delivery path. The present invention utilizes the map API travel time prediction function to improve the clustering results, removes points that do not conform to reality in each clustering result, and classifies them separately to ensure the accuracy of the results in practical applications.
[0099] In addition, the present invention takes into account the vehicle fuel consumption cost related to load in the distribution cost, takes into account the objective function of carbon emissions affected by load, and integrates real-time road condition information into four distribution path optimization models through the map API. Through the dynamic integration of real-time data and path visualization, this study can reflect the changes in road conditions in real time, and improve the adaptability and flexibility of the model in practical applications. It also improves the visualization of the results and user interactivity, and effectively responds to the dynamic changes in the distribution environment. It is of great practical significance to help enterprises adjust distribution plans in time to adapt to the ever-changing market environment when responding to policy changes, market changes and customer demand changes. The present invention also proposes a comprehensive optimization strategy based on the map API to improve the K-means clustering results and simulated annealing algorithm to deal with the problem of express terminal distribution path optimization. By combining the real-time road condition information provided by the map API, the improved K-means clustering results can more accurately reflect the actual distribution scene, thereby providing a more reliable initial solution and optimization path for the simulated annealing algorithm, improving distribution efficiency and customer satisfaction speed. BRIEF DESCRIPTION OF THE DRAWINGS
[0100] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the figures required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0101] FIG1( a ) is a schematic diagram of the effect of the improved genetic algorithm provided in Example 1 of the present invention before improvement;
[0102] FIG1( b ) is a schematic diagram of the optimization effect of the improved genetic algorithm provided in Example 1 of the present invention after improvement;
[0103] Figure 2 A schematic diagram of the process of improving K-means clustering results using a map API provided in Example 1 of the present invention;
[0104] Figure 3 A schematic diagram of the simulated annealing algorithm operation result route provided in Example 1 of the present invention;
[0105] Figure 4 It is a structural block diagram of the present invention for optimizing the two-stage delivery path of express delivery terminals based on map API real-time data; DETAILED DESCRIPTION
[0106] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0107] The purpose of the present invention is to provide a two-stage delivery path optimization method and system for express delivery terminals based on real-time data of map API, including the following steps: dividing the delivery process into two stages of "transfer station-express delivery outlet" and "express delivery outlet-customer" for path optimization, using map API to obtain real-time driving distance, time and collect customer demand information, considering vehicle load and maximum mileage constraints in the first stage, establishing a mathematical optimization model considering four objectives of delivery cost, delivery driving distance, maximum driving time and carbon emissions, designing an improved genetic algorithm solution program based on large-scale neighborhood search algorithm, visualizing the driving route and comparing and analyzing the optimization schemes for the optimal delivery path under different objectives, and making the best path optimization decision for enterprises in the face of changing environments and fully considering the differences in road conditions and orders. The present invention integrates the destruction and repair mechanism in the large-scale neighborhood search algorithm into the traditional genetic algorithm, significantly improving the quality and speed of model solution. In the second stage, the map API is used to improve the K-means clustering results, a mathematical model with the highest customer satisfaction as the goal is constructed based on the mailing time window function, and a solution program based on the simulated annealing algorithm is designed to determine the optimal delivery path. The present invention utilizes the map API travel time prediction function to improve the clustering results, removes points that do not conform to reality in each clustering result, and classifies them separately to ensure the accuracy of the results in practical applications.
[0108] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0109] Example 1
[0110] Refer to Figure 1(a), Figure 1(b), Figure 2 and Figure 3 , a two-stage delivery route optimization method for express delivery terminals based on map API real-time data, including:
[0111] Step 1: Use the map API to obtain real-time driving distance and time and collect customer demand information; the demand information includes the location coordinates of the transfer station, express outlets and each customer demand point, the delivery volume, the number of shipments, the specified time window, and the acceptable time window;
[0112] Step 2: Transfer station-express delivery outlet stage: Establish four mathematical optimization models with the goals of lowest delivery cost, shortest delivery distance, shortest longest driving time and lowest carbon emissions, and determine the constraints; solve the optimal path model based on the improved genetic algorithm of the large-scale neighborhood search algorithm, visualize the driving route and compare and analyze the optimization schemes for the optimal delivery path under different goals, so as to make the best path optimization decision for enterprises in the face of changing environments, taking into full consideration the differences in road conditions and orders;
[0113] Step 3: Express outlets-customer stage: Use the map API to improve the K-means clustering results, build a mathematical model with the highest customer satisfaction as the goal based on the delivery time window function, and determine the constraints; solve the optimal path model based on the simulated annealing algorithm to determine the optimal path.
[0114] The specific implementation process of step one includes: using the map API to obtain real-time traffic information to model and solve the transfer station-express delivery outlet path optimization problem; and making real-time calls to the driving distance, driving time, and visual driving route between the transfer station and each express delivery outlet. Specifically including:
[0115] There are multiple routes with different road conditions between any two points in the delivery road network. The speed of vehicles on the same route varies with the traffic time. The map API obtains road data for a period of time in the future from the departure time based on traffic big data.
[0116] The batch route calculation function of the map API can batch calculate the route distance and time based on the starting point and the end point, and take the real-time traffic conditions into consideration during the calculation process.
[0117] The map API retrieves eligible driving and cycling (bicycle, electric bicycle) route planning solutions based on the starting and ending coordinates. Combined with multi-way point route planning, delivery routes can be visualized.
[0118] In step 2, four mathematical optimization models with the goals of minimum delivery cost, shortest delivery distance, shortest longest driving time and minimum carbon emissions are established, and the constraints are determined; including:
[0119] The four mathematical optimization models include the objective function of minimizing delivery cost, minimizing delivery distance, minimizing longest driving time, and minimizing carbon emissions; the delivery cost includes the fixed cost of the delivery vehicle, the fuel consumption cost of the vehicle related to the load, and the salary of the delivery staff;
[0120] The fixed cost of a delivery vehicle is calculated as:
[0121] C1=Nc1;
[0122] Where N represents the number of vehicles, c1 represents the unit fixed cost;
[0123] The formula for calculating the fuel consumption cost of a vehicle related to load is:
[0124] Carbon emissions are also related to fuel consumption. Considering that fuel consumption is related to vehicle load and vehicle travel distance, the fuel consumption rate when the vehicle is empty and fully loaded is introduced here. The fuel consumption rate under different load conditions is calculated by the full load rate, that is,
[0125]
[0126] Among them, the node set D = {D i |i=1,2,…,n}, when i is 0, it means a transfer station, 1 to n means there are n express delivery outlets in the area; vehicle set K={K i |i=1,2,…,l}, indicating that the transfer station has a total of l vehicles; l ij represents the distance between point i and j; w ijk represents the load of vehicle k from node i to node j; Q represents the maximum load of the vehicle; c2 represents the oil price; ρ0 represents the fuel consumption rate when the vehicle is unloaded; ρ * Indicates the fuel consumption rate when the vehicle is fully loaded; x ijk It is a 0-1 integer programming, indicating whether vehicle K passes through nodes i and j;
[0127] The calculation formula for delivery staff wages is:
[0128]
[0129] Among them, t ij represents the time required to travel from node i to node j; t represents the service time required for loading and unloading at a single express delivery outlet; c3 represents the average hourly wage of the delivery driver;
[0130] The objective function for minimizing the delivery cost is:
[0131]
[0132] The objective function for the shortest delivery distance is:
[0133]
[0134] The objective function of minimizing the longest travel time is:
[0135]
[0136] The objective function for minimizing carbon emissions is:
[0137]
[0138] Among them, γ represents the conversion rate of fuel combustion to carbon dioxide;
[0139] The constraints of the four mathematical optimization models are as follows:
[0140] Vehicle load restrictions;
[0141] Vehicle maximum range constraints;
[0142] N≤l, N≥0, indicating that the number of delivery vehicles dispatched by the transfer station is not greater than its ownership;
[0143] Constraints on the total delivery volume of each express delivery outlet;
[0144] Constraints on the total return volume of each express delivery outlet;
[0145] It means that a courier outlet has only one vehicle serving it and only serves it once;
[0146] It means that each vehicle starts from the transfer station and finally returns to the transfer station;
[0147] Ensure that the vehicle entering and exiting express delivery outlet j is the same vehicle;
[0148] Avoid vehicles from making self-loops during the delivery process.
[0149] Where, L represents the maximum driving distance of the vehicle (km); q i Indicates the amount of express delivery that the transfer station needs to deliver to the express delivery outlets; p i It indicates the amount of express delivery that the transfer station needs to transport back from the express delivery outlets.
[0150] According to the actual distribution situation of the enterprise, the following assumptions are made:
[0151] ① The location and express delivery volume of the transfer station and express delivery outlets are known;
[0152] ②For any express delivery outlet, the express delivery volume received is less than the maximum carrying capacity of the vehicle;
[0153] ③ During the delivery process, each vehicle does not consider changing the delivery demand midway;
[0154] ④The express delivery volume received by each express delivery outlet is greater than the express delivery volume;
[0155] ⑤The model and load capacity of the delivery vehicles at the default transfer station are the same.
[0156] Solve the optimal path optimization model based on the improved genetic algorithm to determine the optimal vehicle distribution path; including:
[0157] a. Perform chromosome encoding on the transfer station nodes and each express delivery outlet node, and define the fitness function as the inverse of the objective function; map the chromosome encoding of the population individual to a real value, which is used to represent the fitness of the individual;
[0158] b. Randomly arrange the nodes of each express delivery outlet to generate random individuals to form an initial population; use a traditional genetic algorithm to traverse the entire system, which refers to the distribution network including transfer stations and express delivery outlets; convert the initial solution (i.e., a complete distribution plan) into initial individuals;
[0159] c. Select individuals in the current group according to their fitness values; perform crossover and mutation operations based on the selected individuals to generate individuals in the new generation group;
[0160] d. Introducing the destruction and repair mechanism of the large-scale neighborhood search algorithm into the traditional genetic algorithm, including:
[0161] Destruction: Randomly delete a customer a from the current solution set S after the first generation of selection, crossover and mutation operations, and save it to the removed customer set R. Remove the customer with the greatest correlation with customer a from the remaining customer set S′ and add it to the customer set R. Repeat this operation, randomly select customer a1 from the customer set R, and remove the customer with the greatest correlation with a1, until the customer set R reaches the predetermined number, shortening the route for customers to be deleted.
[0162] To avoid over-reliance on the correlation function, a random factor is introduced into the destruction operation; the specific method is as follows: define the random number D as the weight of selecting the customer to be removed, and its range is between [0,1]; assume index = (Random([0,1])) D ×(S′), then S' is a customer list sorted from large to small according to the correlation with customer a as lst. According to the random number D, lst[index] is selected from the sorted list lst as the customer to be removed. lst[index] refers to the customer selected to be removed from the customer list lst sorted according to the correlation. When D is 1, the customer selection is completely random. When D is close to positive infinity, the customer selection tends to be the customer with the greatest correlation. Therefore, the larger the value of the random factor D, the more likely it is to select customers with high correlation.
[0163] Fix: Rebuild the solution by inserting the removed customers. Find a location that meets the constraints, scan all free locations, and repeatedly insert the customer with the minimum cost until all customers are inserted;
[0164] e. Take the new generation population as the current population and return to step c for iteration until the number of population iterations reaches the preset number of iterations; output the individual with the largest fitness value in the last generation population, which is the optimal delivery path for the vehicle.
[0165] The correlation calculation formula is:
[0166]
[0167] l ij represents the distance between express delivery outlets i and j; v ij Indicates whether i and j are on the same path, that is, whether they are served by the same vehicle. If they are on the same path, it is 1, otherwise it is 0.
[0168] In a specific embodiment, the transfer station of Y Express Company in Huangdao District, Qingdao City, Shandong Province and the corresponding 34 terminal outlets are selected. The geographical coordinates of each point are obtained by geocoding. Icon 0 is the Huangdao transfer station of Y Express Company, and icons 1 to 34 are 34 distribution outlets in Huangdao District. The transfer station has a total of 7 vehicles, which are general box trucks. The maximum load of the vehicle is 4,000 express items. The service time of a single outlet, that is, the unloading time, is 20 minutes, and the driver is calculated according to the salary of 15 yuan per hour. The express delivery demand is random, and the express delivery volume of each terminal outlet is random. The time periods when the express volume has increased sharply, such as "618" and "Double Eleven", are not considered. The average express business volume of each outlet within 15 days is used as the experimental data (see Table 1).
[0169] Table 1: Distribution and shipment volume table;
[0170]
[0171]
[0172] Combined with the geographic data and express delivery business volume data in Table 1, they are introduced into the improved genetic algorithms with four different objective functions. MATLAB is used to analyze the four optimization objectives of the example and the map API is used to visualize the route.
[0173] Table 2: Table of delivery routes with the lowest delivery cost;
[0174]
[0175] Table 3. The lowest distribution cost result table;
[0176]
[0177] Table 4: The shortest delivery route table;
[0178]
[0179]
[0180] Table 5: Shortest driving distance results table;
[0181]
[0182] Table 6: Table of delivery paths with the longest delivery time and the minimum delivery time;
[0183]
[0184] Table 7: Table of minimum results for the longest delivery time;
[0185]
[0186]
[0187] Table 8: Table of distribution routes with minimum carbon emissions;
[0188]
[0189] Table 9: Minimum carbon emission results;
[0190]
[0191] By solving the distribution path optimization models for four different objectives, namely distribution cost, driving distance, maximum delivery time, and carbon emissions, we obtain the distribution results and distribution route map, and compare and analyze the result data of the four plans. The optimization degree of each plan is compared in six dimensions: cost, driving distance, driving time, carbon emissions, vehicle empty rate, and fuel consumption.
[0192] Table 10 Statistical table of the results of the four schemes;
[0193]
[0194] From the results of the scheme in Table 10, we can find that:
[0195] ① The solution with the lowest delivery cost only uses 6 vehicles, has the lowest empty load rate, and reduces the cost by 4.81%-7.53% compared with the other three solutions. However, since there are more terminal nodes for vehicle delivery on average, the delivery time is longer. Therefore, when enterprises face orders with low delivery time requirements, they can give priority to the solution with the lowest delivery cost, which will help improve the overall competitiveness of enterprises.
[0196] ② The solution that only seeks the shortest driving distance is obviously not a relatively high-quality solution set, and it will result in higher delivery costs and longer delivery time. This is because in the actual delivery process, factors such as road congestion and the number of traffic lights passed have a much greater impact than the length of the driving distance.
[0197] ③ The plan with the shortest longest delivery time can save about 20-30 minutes, about 5.83%-8.52%, compared with other delivery plans. When the company faces a large number of urgent orders, it should give priority to the plan with the shortest longest delivery time to improve overall delivery efficiency and enhance customer satisfaction.
[0198] ④ The carbon emission of the solution with the smallest carbon emission is 4.63%-9.77% lower than that of other solutions, and the fuel consumption is reduced by 4.86%-10.83%. When customers have high requirements for environmental protection or enterprises want to establish a green image, they will give priority to the solution with the smallest carbon emission.
[0199] Using real-time data from the map API, the optimal route plan can be quickly selected based on order differences, helping companies to adjust delivery plans and make flexible decisions in a timely manner to adapt to the ever-changing environment when responding to policy changes, market changes, and changes in customer demand.
[0200] In step 3, the map API is used to improve the K-means clustering results, including:
[0201] Order division: According to the actual survey situation, the delivery can make an appointment for the door-to-door time. Each time period is two hours, divided into 9:00-11:00, 11:00-13:00, 13:00-15:00, 15:00-17:00, so the time period is divided into [0-120], [120-240], [240-360], [360-540]. If it is a courier that needs to be delivered, there is no time window limit by default, so the time window is set to [0-540]. Table 11 is a courier order that a courier needs to serve in a certain day.
[0202] Table 11: Distribution and shipment volume table;
[0203]
[0204]
[0205] Gaussian projection conversion: Use Gaussian fuzzy projection to convert the customer's latitude and longitude information, convert the longitude and latitude coordinates into the Gaussian plane rectangular coordinate system, and use the CoordTools tool to perform Gaussian calculations. In Table 12, x and y are the converted horizontal and vertical coordinates, respectively.
[0206] Table 12 Gaussian plane rectangular coordinate system conversion results table;
[0207]
[0208] Preliminary clustering: The K-means algorithm is used to cluster the points in the Gaussian rectangular coordinate system. Due to the improvement of the clustering method, the final clustering result does not depend solely on the K value. Therefore, the initial K value is selected based on the number of stops in the courier's daily delivery and the degree of influence on the result. Here, the K value is set to 24.
[0209] Driving time calculation and outlier processing: The driving time T is calculated for the K group results. The two destinations with a driving time greater than 2 minutes are considered to have a long driving distance and low correlation. They are often blocked by integral buildings and need to be removed. The data in categories 8, 16, and 22 in Table 3 are newly added, and are removed from categories 9, 17, and 23 respectively. At this time, the number of orders contained in each category is as high as 15 and as low as 1. The point numbered 0 is the express outlet, and the points numbered 1 to 27 are the results of clustering. In order to facilitate the data to be brought into the MATLAB program for calculation, the mailing orders are also converted into the same data format as the delivery orders, and the numbers 28 to 45 are mailing orders.
[0210] Table 13 Express order data table;
[0211]
[0212]
[0213] In step 3, a mathematical model with the highest customer satisfaction as the goal is to build a delivery time window function and determine the constraints, including:
[0214] According to the demand information, a mathematical model with the highest customer satisfaction as the goal is established, including: the mathematical model with the highest customer satisfaction as the goal is that the sum of the delivery time and the time penalty is minimized, that is, the customer satisfaction is the highest;
[0215] The delivery time is calculated as follows:
[0216]
[0217] Among them, the set D={D i |i=1,2,…,n}, when i is 0, it indicates the location of the delivery vehicle, and 1 to n indicate the set of points that need to be traversed in the area; t ij represents the time required to travel from node i to node j; q i represents the quantity of express delivery required by customer i (the number of customers included); t represents the delivery and mailing service time of a single express item; x ij It means that the vehicle is traveling from node to node, which is 1, otherwise it is 0;
[0218] The penalty time is calculated as:
[0219]
[0220] Among them, E.T. i represents the left time window of customer i, that is, the earliest service time required by the customer within the service point; LT i AT represents the right time window of customer i, that is, the latest service time required by the customer in the service point;i The arrival time of customer i; C represents the penalty coefficient for early or late arrival;
[0221] The sum of delivery time and time penalty is minimized, that is, the objective function with the highest customer satisfaction is:
[0222]
[0223] The constraints for establishing the highest customer satisfaction objective function are as follows:
[0224] Vehicle load restrictions;
[0225] Vehicle maximum range constraints;
[0226] It means that a customer is served by only one courier and only once;
[0227] Avoid vehicles from making self-loops during the delivery process;
[0228] AT j =AT i +max(ET i -AT i ,0)+q i t+t ij , the time when the vehicle arrives at customer point j.
[0229] In the specific embodiment, according to the actual distribution situation of the enterprise, the following assumptions are made:
[0230] ① The locations of the outlets where the couriers and their vehicles are located are known, and each courier has a fixed delivery area;
[0231] ②When the information of the express item to be delivered is known, including the geographical location;
[0232] ③During the delivery process, couriers do not generate new delivery needs, but do generate new shipment needs.
[0233] Solve the optimal path model based on the simulated annealing algorithm and determine the optimal path; including:
[0234] (1) Input the known parameters of the geographical location coordinates, demand, and vehicle capacity of each customer node;
[0235] (2) Setting the initial temperature, end temperature, cooling rate, number of iterations g, and number of new solution searches L;
[0236] (3) Randomly generate the initial delivery path to meet the time window constraint and use the initial solution as the current optimal solution; randomly select the order of customer nodes to ensure that all nodes are visited. When generating the path, it is necessary to ensure that the vehicle reaches each customer within the specified time.
[0237] (4) When the initial temperature T is greater than the final temperature T end , make a small-scale disturbance or change to S0 to generate a new solution S new , and calculate dC = S new -S0, if dC<0, then accept the new solution S new As the new current solution S0, otherwise, with probability Accept S new ;
[0238] (5) Repeat step (4), add 1 to the number of iterations after searching for new solutions L times, and cool down once at the cooling rate;
[0239] (6) When the temperature T drops to the termination temperature T end , end the iteration and output the optimal solution.
[0240] In a specific embodiment, this study selected the delivery service scope of a courier outlet in Huangdao District, Qingdao City, Shandong Province. The courier mainly uses electric tricycles in the process of terminal delivery to the delivery area, and the maximum load of the electric tricycle is 200 pieces. According to the field survey of multiple delivery points in the area, the service time of a single courier is random and uncontrollable. In the process of route optimization, it is hoped that more time can be left to ensure the driving safety of the courier, so the service time of a single courier is set to 2.5 minutes. The penalty coefficient C for violating the delivery time window is set to 3.
[0241] refer to Figure 2 , combined with Table 13, it is brought into the mathematical model with the goal of maximizing customer satisfaction and the simulated annealing algorithm designed by MATLAB is used to solve the example.
[0242] Figure 3 This is the roadmap of the algorithm running results. The black numbers are delivery orders, and the purple numbers are mailing orders.
[0243] The total driving time of the global optimal route is 508.5 minutes, or 8.475 hours in total. The courier's daily working hours are reduced from 9 hours to 8.475 hours, saving about 31.5 minutes, which can greatly improve delivery efficiency and customer satisfaction.
[0244] In summary, the present invention proposes a two-stage delivery path optimization method and system for express delivery terminals based on real-time data of map API, which optimizes the two stages of express delivery terminals, namely, transfer station-express delivery outlet and express delivery outlet-customer, and can solve the path problem of express delivery terminals well.
[0245] Example 2
[0246] A two-stage delivery route optimization system for express delivery terminals based on real-time data from map API, such as Figure 4 As shown, including:
[0247] The demand information acquisition module is used to: use the map API to obtain real-time driving distance and time and collect customer demand information; the demand information includes the location coordinates of the transfer station, express outlets and each customer demand point, the delivery volume, the mail volume, the specified time window, and the acceptable time window;
[0248] The transfer station-express delivery point route optimization module is used to: establish four mathematical optimization models with the goals of lowest delivery cost, shortest delivery distance, shortest longest driving time and lowest carbon emissions, and determine the constraints; solve the optimal route model based on the improved genetic algorithm of the large-scale neighborhood search algorithm, visualize the route and compare and analyze the optimization schemes for the optimal delivery routes under different goals, so as to make the best route optimization decision for enterprises in the face of changing environments, taking into full consideration the differences in road conditions and orders;
[0249] The express delivery point-customer delivery optimization module is used to: use the map API to improve the K-means clustering results, build a mathematical model with the highest customer satisfaction as the goal based on the delivery time window function, and determine the constraints; solve the optimal path model based on the simulated annealing algorithm to determine the optimal path.
[0250] Example 3
[0251] A computer device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of a two-stage delivery path optimization method for express delivery terminals based on map API real-time data as described in Example 1 or 2 are implemented.
[0252] Example 4
[0253] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of a two-stage delivery path optimization method for express delivery terminals based on map API real-time data as described in Example 1 or 2.
Claims
1. A two-stage delivery route optimization method for express delivery terminals based on real-time data from map API, characterized in that: include: Step 1: Use the map API to obtain real-time driving distance, time and collect customer demand information; The demand information includes the location coordinates of the transfer station, express delivery outlets and each customer demand point, the delivery volume, the shipment volume, the specified time window, and the acceptable time window; Step 2: Transfer station-express delivery outlet stage: Establish four mathematical optimization models with the goals of lowest delivery cost, shortest delivery distance, shortest longest driving time and lowest carbon emissions, and determine the constraints; solve the optimal path model based on the improved genetic algorithm of the large-scale neighborhood search algorithm, visualize the driving route and compare and analyze the optimization schemes for the optimal delivery path under different goals, so as to make the best path optimization decision for enterprises in the face of changing environments, taking into full consideration the differences in road conditions and orders; Step 3: Express outlets-customer stage: Use the map API to improve the K-means clustering results, build a mathematical model with the highest customer satisfaction as the goal based on the delivery time window function, and determine the constraints; solve the optimal path model based on the simulated annealing algorithm to determine the optimal path.
2. According to claim 1, a two-stage delivery route optimization method for express delivery terminals based on map API real-time data is characterized in that: The specific implementation process of step one includes: using the map API to obtain real-time traffic information to model and solve the transfer station-express delivery outlet path optimization problem; and making real-time calls to the driving distance, driving time, and visualized driving routes between the transfer station and each express delivery outlet.
3. According to claim 1, a two-stage delivery route optimization method for express delivery terminal based on map API real-time data is characterized in that: In step 2, four mathematical optimization models with the goals of minimum delivery cost, shortest delivery distance, shortest longest driving time and minimum carbon emissions are established, and the constraints are determined; including: The four mathematical optimization models include the objective function of minimizing delivery cost, minimizing delivery distance, minimizing longest driving time, and minimizing carbon emissions; the delivery cost includes the fixed cost of the delivery vehicle, the fuel consumption cost of the vehicle related to the load, and the salary of the delivery staff; The calculation formula for the fixed cost of the delivery vehicle is: C1=Nc1; Where N represents the number of vehicles, c1 represents the unit fixed cost; The calculation formula of the vehicle fuel consumption cost related to the load is: The fuel consumption rate under different load conditions is calculated by the full load rate. Among them, the node set D = {D i |i=1,2,…,n}, when i is 0, it means a transfer station, 1 to n means there are n express delivery outlets in the area; vehicle set K={K i |i=1,2,…,l}, indicating that the transfer station has a total of l vehicles; l ij represents the distance between point i and j; w ijk represents the load of vehicle k from node i to node j; Q represents the maximum load of the vehicle; c2 represents the oil price; ρ0 represents the fuel consumption rate when the vehicle is unloaded; ρ * Indicates the fuel consumption rate when the vehicle is fully loaded; x ijk It is a 0-1 integer programming, indicating whether vehicle K passes through nodes i and j; The calculation formula for the delivery staff salary is: Among them, t ij represents the time required to travel from node i to node j; t represents the service time required for loading and unloading at a single express delivery outlet; c3 represents the average hourly wage of the delivery driver; The objective function for minimizing the delivery cost is: The objective function for the shortest delivery distance is: The objective function of minimizing the longest travel time is: The objective function for minimizing carbon emissions is: Among them, γ represents the conversion rate of fuel combustion to carbon dioxide; The constraints of the four mathematical optimization models are as follows: Vehicle load restrictions; Vehicle maximum range constraints; N≤l, N≥0, indicating that the number of delivery vehicles dispatched by the transfer station is not greater than its ownership; Constraints on the total delivery volume of each express delivery outlet; Constraints on the total return volume of each express delivery outlet; It means that a courier outlet has only one vehicle serving it and only serves it once; It means that each vehicle starts from the transfer station and finally returns to the transfer station; Ensure that the vehicle entering and exiting express delivery outlet j is the same vehicle; Avoid vehicles from making self-loops during the delivery process; Where, L represents the maximum driving distance of the vehicle (km); q i Indicates the amount of express delivery that the transfer station needs to deliver to the express delivery outlets; i It indicates the amount of express delivery that the transfer station needs to transport back from the express delivery outlets.
4. According to claim 1, a two-stage delivery route optimization method for express delivery terminals based on map API real-time data is characterized in that: Solve the optimal path optimization model based on the improved genetic algorithm to determine the optimal vehicle distribution path; including: a. Perform chromosome encoding on the transfer station nodes and each express delivery outlet node, and define the fitness function as the inverse of the objective function; map the chromosome encoding of the population individual to a real value, which is used to represent the fitness of the individual; b. Randomly arrange the nodes of each express delivery outlet to generate random individuals to form an initial population; use a traditional genetic algorithm to traverse the entire system, which refers to the distribution network including transfer stations and express delivery outlets; convert the initial solution into an initial individual; c. Select individuals in the current group according to their fitness values; perform crossover and mutation operations based on the selected individuals to generate individuals in the new generation group; d. Introducing the destruction and repair mechanism of the large-scale neighborhood search algorithm into the traditional genetic algorithm, including: Destruction: Randomly delete a customer a from the current solution set S after the first generation of selection, crossover and mutation operations, and save it to the removed customer set R. Remove the customer with the greatest correlation with customer a from the remaining customer set S′ and add it to the customer set R. Repeat this operation, randomly select customer a1 from the customer set R, and remove the customer with the greatest correlation with a1, until the customer set R reaches the predetermined number, shortening the route for customers to be deleted. The correlation calculation formula is as follows; l ij represents the distance between express delivery outlets i and j; v ij Indicates whether i and j are on the same path, that is, whether they are served by the same vehicle; if they are on the same path, it is 1, otherwise it is 0; Introduce a random factor in the destruction operation; the specific method is as follows: define the random number D as the weight of selecting the customer to be removed, and its range is between [0,1]; assume index = (Random([0,1])) D ×(S′), then the customer list S′ is sorted from large to small according to the relevance to customer a as lst. According to the random number D, lst[index] is selected from the sorted list lst as the customer to be removed; Fix: Find a location that meets the constraints, scan all free locations, and repeatedly insert the customer with the minimum cost until all customers are inserted; e. Take the new generation population as the current population and return to step c for iteration until the number of population iterations reaches the preset number of iterations; output the individual with the largest fitness value in the last generation population, which is the optimal delivery path for the vehicle.
5. According to claim 1, a two-stage delivery route optimization method for express delivery terminals based on map API real-time data is characterized in that: In step 3, the map API is used to improve the K-means clustering results, including: Order division: divide the orders according to time windows; Gaussian projection conversion: perform Gaussian projection conversion on the longitude and latitude coordinates obtained from the map API; Preliminary clustering: Use K-means algorithm to cluster and get K initial groups; Travel time calculation and outlier processing: Calculate the travel time T within the K initial grouping results.
6. The express terminal two-stage delivery route optimization method based on map API real-time data according to claim 1 is characterized in that: In step 3, a mathematical model with the highest customer satisfaction as the goal is to build a delivery time window function and determine the constraints, including: According to the demand information, a mathematical model with the highest customer satisfaction as the goal is established, including: the mathematical model with the highest customer satisfaction as the goal is that the sum of the delivery time and the time penalty is minimized, that is, the customer satisfaction is the highest; The delivery time is calculated as follows: Among them, the set D={D i |i=1,2,…,n}, when i is 0, it indicates the location of the delivery vehicle, and 1 to n indicate the set of points that need to be traversed in the area; t ij represents the time required to travel from node i to node j; q i represents the quantity of express delivery required by customer i; t represents the delivery and delivery service time of a single express delivery; x ij It means that the vehicle is traveling from node to node, which is 1, otherwise it is 0; The penalty time is calculated as: Among them, E.T. i represents the left time window of customer i, that is, the earliest service time required by the customer within the service point; LT i AT represents the right time window of customer i, that is, the latest service time required by the customer in the service point; i The arrival time of customer i; C represents the penalty coefficient for early or late arrival; The sum of delivery time and time penalty is minimized, that is, the objective function with the highest customer satisfaction is: The constraints for establishing the highest customer satisfaction objective function are as follows: Vehicle load restrictions; Vehicle maximum range constraints; It means that a customer is served by only one courier and only once; Avoid vehicles from making self-loops during the delivery process; AT j =AT i +max(ET i -AT i ,0)+q i t+t ij , the time when the vehicle arrives at customer point j.
7. The express terminal two-stage delivery route optimization method based on map API real-time data according to claim 1 is characterized in that: Use the map API to improve the K-means clustering results, solve the optimal path model based on the simulated annealing algorithm, and determine the optimal path; including: (1) Input the known parameters of the geographical location coordinates, demand, and vehicle capacity of each customer node; (2) Setting the initial temperature, end temperature, cooling rate, number of iterations g, and number of new solution searches L; (3) Randomly generate an initial delivery path that meets the time window constraint and use the initial solution as the current optimal solution; (4) When the initial temperature T is greater than the final temperature T end , make a small-scale disturbance or change to S0 to generate a new solution S new , and calculate dC = S new -S0, if dC<0, then accept the new solution S new As the new current solution S0, otherwise, with probability Accept S new ; (5) Repeat step (4), add 1 to the number of iterations after searching for new solutions L times, and cool down once at the cooling rate; (6) When the temperature T drops to the termination temperature T end , end the iteration and output the optimal solution.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of a two-stage delivery path optimization method for express delivery terminals based on map API real-time data as described in any one of claims 1-7 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by the processor, the steps of a two-stage delivery path optimization method for express delivery terminals based on map API real-time data as described in any one of claims 1-7 are implemented.
10. A two-stage delivery route optimization system for express delivery terminals based on real-time data from map API, characterized in that: include: The demand information acquisition module is used to: use the map API to obtain real-time driving distance and time and collect customer demand information; The demand information includes the location coordinates of the transfer station, express delivery outlets and each customer demand point, the delivery volume, the shipment volume, the specified time window, and the acceptable time window; The transfer station-express delivery point route optimization module is used to: establish four mathematical optimization models with the goals of lowest delivery cost, shortest delivery distance, shortest longest driving time and lowest carbon emissions, and determine the constraints; solve the optimal route model based on the improved genetic algorithm of the large-scale neighborhood search algorithm, visualize the route and compare and analyze the optimization schemes for the optimal delivery routes under different goals, so as to make the best route optimization decision for enterprises in the face of changing environments, taking into full consideration the differences in road conditions and orders; The express delivery point-customer delivery optimization module is used to: use the map API to improve the K-means clustering results, build a mathematical model with the highest customer satisfaction as the goal based on the delivery time window function, and determine the constraints; solve the optimal path model based on the simulated annealing algorithm to determine the optimal path.