Truck unmanned aerial vehicle path problem planning method and system considering weather conditions, truck unmanned aerial vehicle path planning equipment and storage medium
By constructing a joint distribution path planning model for trucks and drones that consider weather conditions, using a random forest model and genetic algorithm to optimize path planning, the problem of weather impact in drone distribution path planning is solved, and efficient and low-cost logistics distribution is achieved.
Patent Information
- Application Number
- CN202510358513.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-25
- Publication Date
- 2025-07-11
AI Technical Summary
In the prior art, the planning of drone distribution paths does not fully consider the impact of weather conditions, resulting in low distribution efficiency, high energy consumption, and insufficient research on joint distribution of drones and trucks.
A joint distribution path planning model for trucks and drones considering weather conditions is constructed, and a random forest model and genetic algorithm are combined to optimize the distribution path. Through data collection, model construction, fitness function calculation and path planning solution are realized to achieve coordinated operation between trucks and drones.
Selecting the optimal distribution route under different weather conditions will reduce energy consumption and delays, improve distribution efficiency, reduce operating costs, and realize the dual advantages of cost-effectiveness and environmental benefits.
Smart Images

Figure CN120297848A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of urban logistics distribution, and particularly to a method and system for planning the path of a truck and a drone considering weather conditions, a device for planning the path of a truck and a drone, and a storage medium. Background Art
[0002] With the rapid development of globalization and the Internet economy, the e-commerce and express logistics industries have shown explosive growth. This trend has put forward higher requirements for logistics distribution efficiency and cost control. Traditional logistics distribution mainly relies on ground transportation vehicles, such as trucks. These methods gradually show limitations in the face of urban traffic congestion, terrain restrictions, and the increasing requirements for distribution efficiency. To solve these problems, drone technology has been introduced into the field of logistics distribution, and its flexibility and speed provide new solutions for logistics distribution. However, the effectiveness of drone delivery is significantly affected by weather conditions, such as wind speed, wind direction, humidity, etc. These factors will directly affect the flight performance and energy consumption of the drone, and thus affect the planning and selection of the delivery path.
[0003] In existing research, the Vehicle Routing Problem (VRP) has been widely studied, including various variants considering time windows, capacity constraints, dynamic demands, etc. However, most research focuses on the path planning of ground vehicles, and there is relatively little research on the joint delivery of drones and trucks, especially the research considering the impact of weather conditions. The Vehicle Routing Problem with Drones (VRPD) is a new research field that not only needs to consider the special constraints of drones but also the collaborative operation with trucks. In addition, as an important factor affecting drone delivery, the role of weather conditions in path planning has not been fully studied and applied. Summary of the Invention
[0004] In view of the deficiencies in the prior art, the present invention provides a method and system for planning the path of a truck and a drone considering weather conditions, a device for planning the path of a truck and a drone, and a storage medium. By constructing a comprehensive model and algorithm, the delivery path is optimized, the delivery efficiency is improved, the cost is reduced, and the energy consumption is reduced.
[0005] The present invention achieves the above technical objectives through the following technical means.
[0006] The method for planning the path of a truck and a drone considering weather conditions according to the present invention includes the following steps:
[0007] Comprehensive data collection and processing, collecting and processing the weather data and delivery point information of the delivery area;
[0008] Based on the collected data, construct a joint distribution path planning model for trucks and drones considering weather conditions;
[0009] Adopt a random forest model to establish a fitness function calculation model; use a genetic algorithm combined with the random forest fitness calculation model to solve the joint distribution path planning model for trucks and drones considering weather conditions to obtain the optimal distribution plan;
[0010] According to the obtained optimal distribution plan, dispatch vehicles and drones to cooperate and serve customer points.
[0011] Furthermore, the weather data of the distribution area includes weather type, wind speed and wind direction; the distribution point information includes customer location, customer demand, and information on vehicles and drones within the customer service time window.
[0012] Furthermore, constructing a joint distribution path planning model for trucks and drones considering weather conditions is specifically as follows:
[0013] The objective function includes vehicle dispatching cost, truck transportation cost, drone transportation cost, and time window penalty cost, specifically as shown in the following formula:
[0014]
[0015] Constraint conditions:
[0016]
[0017]
[0018] In the formula:
[0019] i, j, o represent customer node indices, i, j, o ∈ N; k represents vehicle index, k ∈ K; h represents drone index, h ∈ H; K represents the set of vehicles; H represents the set of drones; W represents the set of time windows, w ∈ W; w i represents the time window interval of customer point i; C1 represents the unit vehicle dispatching cost; C K represents the unit time vehicle transportation cost; C D represents the unit time drone transportation cost; represents whether vehicle k performs a task from customer point i to customer point j, then otherwise it is 0; represents whether vehicle k performs a task from customer point j to customer point i, then otherwise it is 0; represents whether vehicle k departs from the warehouse and arrives at customer point j, then otherwise it is 0; represents whether vehicle k departs from customer point i and arrives at the warehouse, then Otherwise it is 0; Indicates that if the drone h executes a mission from customer point i to customer point j, then Otherwise it is 0; Indicates that if the drone h executes a mission from customer point j to customer point i, then Otherwise it is 0; Represents the time it takes for vehicle k to travel from customer point i to customer point j; Represents the time it takes for the drone h to travel from customer point i to customer point j; Represents the time when vehicle k arrives at customer point i; Represents the time when the drone h arrives at customer point i; d i Represents the demand of customer point i; E i Represents the earliest service time in the time window of customer point i; L i Represents the latest service time in the time window of customer point i; f represents the penalty coefficient for early arrival; e represents the penalty coefficient for delay; Q k Represents the maximum load capacity of vehicle k; Q h Represents the maximum load capacity of the drone h; V k Represents the driving speed of vehicle k; V h Represents the flying speed of the drone h; s ij Represents the distance between customer point i and customer point j; S max Represents the maximum flying distance of the drone; q h Represents the load of the drone h; E max Represents the maximum energy of the drone; V w Represents the wind speed; V a Represents the rated airspeed of the drone; E(V h ,q h ) Represents the energy consumed by the drone h at a speed of V h and a load of q h ;
[0020] A w Represents the abnormal weather indication variable
[0021] B iw Represents the customer time window matching variable
[0022] C v Represents the speed energy consumption coefficient; C w Represents the load energy consumption coefficient; l ix ,l iy Represents the abscissa and ordinate values of customer point i in the rectangular coordinate system; l jx ,l jy Represents the abscissa and ordinate values of customer point j in the rectangular coordinate system;
[0023] β h represents the wind direction angle; when l jx -l ix ≥0, directly calculate the direction angle;
[0024] T h retrun represents the time for the drone h to return to the truck; T ih represents the time when the drone leaves the truck; represents the time taken by the drone from customer point i to customer point o; represents the time taken by the drone from customer point o to customer point j; T ik represents the time when the truck k arrives at customer point j.
[0025] Furthermore, a fitness function calculation model is established using a random forest model; a genetic algorithm is combined with the random forest fitness calculation model to solve the truck and drone joint distribution path planning model considering weather conditions, and an optimal distribution plan is obtained. Specifically:
[0026] Construct a random forest model and train the random forest model to obtain the trained random forest model as the model for fitness calculation, where is the predicted value of the time window penalty, is the predicted value of the cost;
[0027] Initialization of the genetic algorithm: First, perform individual coding. Each individual represents a plan for the joint distribution of the truck and the drone, denoted as C = {P k , P h , R k , R h}, which includes the truck k path P k , the time when the truck arrives at the customer point R k , the drone path P h , the time when the drone arrives at the customer point R h ; randomly generate an initial population of M individuals
[0028] Define the fitness function: The time difference penalty C m = max(0, R h - R k - 10), the total time window penalty cost is P time , and the total cost P cost includes vehicle fixed costs, vehicle transportation costs, and drone transportation costs; the fitness function where w1 is the weight of the time window penalty and w2 is the weight of the total cost;
[0029] Based on the individual fitness calculated by the random forest model, select individuals with better quality to enter the next generation;
[0030] Perform crossover operations. The random forest model identifies whether the regional solution is a potential high-quality solution, thus guiding the mutation direction. Exchange part of the paths of two individuals, cross the truck paths, and cross the drone paths. Perform mutation operations to generate new individual P by rearranging the node order or the delivery method k ;
[0031] Update the random forest model, import the solution sets obtained in each iteration, and train a new fitness calculation model;
[0032] Perform iterative optimization. In each iteration, perform selection, crossover, and mutation operations to generate a new population;
[0033] Terminate when the maximum number of iterations is reached, and output the optimal solution.
[0034] Furthermore, construct a random forest model and train the random forest model. Specifically:
[0035] Determine the input features and target variables; the input feature vector X = {x1, x2,..., x d}, where d represents the feature dimension, including 9 types of feature dimensions, namely: customer node location, distance, time window constraint, demand, weather category, wind speed, wind direction, vehicle load, and drone load; x1 represents the customer node location; x2 represents the distance; x3 represents the time window constraint; x4 represents the demand; x5 represents the weather category; x6 represents the wind speed; x7 represents the wind direction; x8 represents the vehicle load; x9 represents the drone load;
[0036] In the input feature vector, x1, x2, x3, x4, x7, x8, and x9 are continuous variables, and the vectors of each feature dimension are standardized through normalization;
[0037] In the input feature vector, x7 and x5 are categorical variables. Encode the categorical variables. According to the angle of the wind direction, it is divided into 8 discrete categories, x7 = {0, 45, 90,..., 315}; the weather category x5 includes 6 different categories: sunny, cloudy, light rain, heavy rain, snowy, and foggy; among them, when it is sunny, x5 = [1, 0, 0, 0, 0, 0], when it is cloudy, x5 = [0, 1, 0, 0, 0, 0], when it is light rain, x5 = [0, 0, 1, 0, 0, 0], when it is heavy rain, x5 = [0, 0, 0, 1, 0, 0], when it is snowy, x5 = [0, 0, 0, 0, 1, 0], and when it is foggy, x5 = [0, 0, 0, 0, 0, 1];
[0038] The output target variable is the fitness function value y = (y time , y cost ), ytime is the time window penalty, y cost is the transportation cost;
[0039] Randomly select 70% of the data in the path planning database as the training data set, and the remaining 30% of the data as the test data set;
[0040] Randomly select samples from the training data set with replacement to generate subsets and generate G decision trees; For each tree, traverse and split downward at each node until reaching the leaf node to obtain the predicted value of a single tree; When splitting, randomly select u features (u < d) and split the samples according to the optimal splitting criterion, where the splitting criterion is to minimize the mean squared error of the target variable y after splitting;
[0041] The final prediction result of the random forest is the average value of all decision trees;
[0042] Evaluate the model through the mean squared error MSE and the coefficient of determination R 2 ;
[0043] Adjust the random forest model parameters through grid search. The search range for the number of trees is {50, 100, 150}, and the search range for the maximum depth (max_depth) of the tree is {8, 10, 12}, the minimum number of samples for splitting nodes, and select the group that minimizes the MSE on the validation set;
[0044] The obtained trained random forest model is used as the model for fitness calculation, where is the predicted value of the time window penalty, is the predicted value of the cost.
[0045] A system for the truck - drone path problem planning method considering weather conditions as described above, characterized by including a data collection module, a path planning module, a path planning solution module, and a distribution scheduling module;
[0046] The data collection module is used to collect and manage the distribution information of customer points, including customer point locations, customer demand quantities, customer service time windows, weather conditions, weather within the service time window, vehicle and drone information within the service time window; The weather within the service time window includes weather type, wind speed, and wind direction; The vehicle and drone information within the service time window includes quantity, load capacity, and battery capacity limits; The path planning module constructs a model based on the information collected by the data collection module; The path planning solution module is used to solve the obtained path planning module to obtain a distribution plan for the optimal path; The distribution scheduling module assigns tasks to trucks and drones based on the distribution plan for the optimal path to serve customer points.
[0047] A truck drone path planning device includes a processor and a memory. The memory stores computer-readable instructions that, when executed by the processor, perform the steps in the method for planning the truck drone path considering weather conditions.
[0048] A storage medium stores a computer program that, when executed by a processor, performs the steps in the method for planning the truck drone path considering weather conditions described above.
[0049] The beneficial effects of the present invention are as follows:
[0050] The method and system for planning the truck drone path considering weather conditions according to the present invention comprehensively consider the actual weather conditions, ensure that the optimal delivery route can be selected under different weather conditions, reduce the additional energy consumption and delays caused by bad weather. In addition, the efficient collaborative operation of the truck and the drone effectively reduces the overall operating cost, improves the delivery efficiency, reduces the energy consumption, and brings double advantages of cost-benefit and environmental benefits to the logistics industry. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. The following drawings are some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, it is obvious that other drawings can also be obtained based on these drawings.
[0052] Figure 1 It is a flowchart of the method for planning the truck drone path considering weather conditions according to the present invention.
[0053] Figure 2 It is a flowchart of the improved algorithm combining the random forest model and the genetic algorithm according to the present invention.
[0054] Figure 3 It is a schematic diagram of the system for planning the truck drone path considering weather conditions according to the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0055] The following details the embodiments of the present invention. The examples of the embodiments are shown in the drawings, where the same or similar reference numerals represent the same or similar elements or elements with the same or similar functions throughout. The embodiments described below with reference to the drawings are exemplary and are intended to explain the present invention and should not be construed as a limitation of the present invention.
[0056] In the description of the present invention, it should be understood that the orientation or positional relationship indicated by terms such as "center", "longitudinal", "transverse", "length", "width", "thickness", "upper", "lower", "axial", "radial", "vertical", "horizontal", "inner", "outer", etc. is based on the orientation or positional relationship shown in the drawings. It is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and thus should not be construed as a limitation of the present invention. In addition, the terms "first" and "second" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, the features defined with "first" and "second" may explicitly or implicitly include one or more of such features. In the description of the present invention, "a plurality" means two or more, unless otherwise specifically defined.
[0057] In the present invention, unless otherwise clearly defined and limited, terms such as "installation", "connection", "connection", "fixation", etc. should be understood in a broad sense. For example, it may be a fixed connection, a detachable connection, or an integral connection; it may be a mechanical connection or an electrical connection; it may be directly connected or indirectly connected through an intermediate medium, and it may be the communication inside two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0058] As Figure 1 shown, the method for planning the path of a truck drone considering weather conditions according to the present invention includes the following steps:
[0059] S01: Comprehensive data collection and processing, collecting and processing the weather data and delivery point information of the delivery area. The weather data includes wind speed, wind direction, and weather type, and these data are crucial for evaluating the flight conditions of the drone. The delivery point information includes customer location, demand volume, service time window, etc., and these information are the basis for path planning. Processing the weather data and delivery point information of the delivery area is a conventional signal processing means, generally denoising and normalizing the data.
[0060] S02: Based on the collected data, construct a joint delivery path planning model of a truck and a drone considering weather conditions. This model not only considers the constraints in traditional path planning problems, such as time windows and load limits, but also particularly considers the impact of weather conditions on drone delivery, such as the impact of wind speed on flight speed and energy consumption.
[0061] Determine whether the weather at the customer's point within the specified service time meets the conditions for using drone delivery. If it meets the conditions, either a truck or a drone can be used for service. When using drone service, the drone is still affected by wind speed and direction. If it does not meet the conditions, only a truck can be used for service.
[0062] The joint distribution path planning model of trucks and drones considering weather conditions is as follows:
[0063] The objective function includes vehicle dispatching cost, truck transportation cost, drone transportation cost, and time window penalty cost, as shown in the following formula:
[0064]
[0065] Constraints:
[0066]
[0067]
[0068] In the formula:
[0069] i, j, o represent customer node indices, i, j, o ∈ N; k represents vehicle index, k ∈ K; h represents drone index, h ∈ H; K represents the set of vehicles; H represents the set of drones; W represents the set of time windows, w ∈ W; w i represents the time window interval of customer point i; C1 represents the unit vehicle dispatching cost; C K represents the unit time vehicle transportation cost; C D represents the unit time drone transportation cost; represents a binary variable. If vehicle k performs a task from customer point i to customer point j, then otherwise it is 0; represents a binary variable. If vehicle k performs a task from customer point j to customer point i, then otherwise it is 0; represents a binary variable. If vehicle k departs from the warehouse and arrives at customer point j, then otherwise it is 0; represents a binary variable. If vehicle k departs from customer point i and arrives at the warehouse, then otherwise it is 0; represents a binary variable. If drone h performs a task from customer point i to customer point j, then otherwise it is 0; represents a binary variable. If drone h performs a task from customer point j to customer point i, then otherwise it is 0; represents the time taken for vehicle k to travel from customer point i to customer point j; Denotes the time taken by the UAV h to travel from customer point i to customer point j; Denotes the time when vehicle k arrives at customer point i; Denotes the time when UAV h arrives at customer point i; d i Denotes the demand at customer point i; E i Denotes the earliest service time within the time window of customer point i; L i Denotes the latest service time within the time window of customer point i; f denotes the penalty coefficient for earliness; e denotes the penalty coefficient for lateness; Q k Denotes the maximum load capacity of vehicle k; Q h Denotes the maximum load capacity of UAV h; V k Denotes the traveling speed of vehicle k; V h Denotes the traveling speed of UAV h; s ij Denotes the distance between customer point i and customer point j; S max Denotes the maximum traveling distance of the UAV; q h Denotes the load of UAV h; E max Denotes the maximum energy of the UAV; V w Denotes the wind speed; V a Denotes the rated airspeed of the UAV; E(V h ,q h ) Denotes the energy consumed by UAV h at a speed of V h and a load of q h ;
[0070] A w Denotes the abnormal weather indication variable
[0071] B iw Denotes the customer time window matching variable
[0072] C v Denotes the speed energy consumption coefficient; C w Denotes the load energy consumption coefficient; l jx ,l ix ,l jy ,l iy Respectively denote the abscissa and ordinate values of point j and point i in the rectangular coordinate system;
[0073] β h Denotes the wind direction angle, i.e., the angle between the wind and the flight direction of the UAV; when l jx -l ix ≥0, directly calculate the direction angle; when l jx -l ix <0, adjust the angle to meet the standard range;
[0074] T hretrun Denote the time when the drone h returns to the truck; T ih Denote the time when the drone leaves the truck; Denote the time taken by the drone from customer point i to customer point o. Denote the time taken by the drone from customer point o to customer point j. T ik Denote the time when the truck k arrives at customer point j;
[0075] Specific descriptions of the constraint conditions and objective functions: After the drone completes the delivery task, it needs to synchronize with the truck at the end point. The return time of the drone shall not be later than the time when the truck arrives at the agreed point, and the waiting time of the drone shall not exceed 10 minutes. If the drone delivering customer points can save the total delivery time, it is more inclined to be delivered by the drone. The objective function includes the fixed dispatch cost of the vehicle, the transportation costs of the truck and the drone, and the time window penalty cost. Formula (1) means that each customer can only be served once (by the vehicle or the drone); Formulas (2) and (3) mean that the delivery volume of the vehicle and the drone cannot exceed their maximum load; Formula (4) means that when the vehicle and the drone serve customers, they must meet the time window constraints of the customers, that is, the arrival time is between the earliest and the latest service times. If the service is advanced or delayed, penalties need to be calculated; Formula (5) means the no-fly constraint in abnormal weather; Formulas (6) and (7) mean that the truck must depart from and return to the warehouse; Formulas (8) and (9) mean the arc flow balance of the truck and the drone; Formula (10) calculates the travel time of the truck and the drone from customer point i to customer point j; Formula (11) means that the total flight distance of the drone does not exceed its maximum flight distance; Formulas (12) and (13) mean that the energy consumption of the drone on each path cannot exceed its battery capacity; Formulas (14)-(16) are the calculations of the actual speed of the drone under the influence of wind speed; Formulas (17)-(19) are the collaborative constraints of the drone. Formula (17) is the calculation of the return time of the drone. Formula (18) means that the time when the drone arrives at the recovery point after completing the task shall not be later than the arrival time of the truck. Formula (19) means that after the drone arrives at the recovery point and returns to the truck, it waits for at most 10 minutes.
[0076] S03: An improved algorithm combining the random forest model and the genetic algorithm is used to solve the constructed model to obtain the path planning scheme. The present invention adopts a hybrid algorithm combining the random forest model and the genetic algorithm. The random forest is used as the fitness calculation surrogate model in the genetic algorithm to help the genetic algorithm explore the regions with greater potential in the solution space, thereby avoiding premature convergence to the local optimum and improving the quality of the solution. The machine learning model can quickly predict the fitness value of an individual without the need to perform complex objective function calculations every time. For large-scale problems, this can significantly reduce the time complexity. And by learning the fitness of the existing solutions, a global understanding of the solution space is established, so as to provide accurate predictions in the fitness evaluation of new individuals. The steps are asFigure 2 as shown below:
[0077] S031: Collect data, including distribution point information (customer node location, demand, time window), vehicle and drone parameters (load capacity, speed, operating cost), and weather data (weather category, wind speed, wind direction).
[0078] S032: Construct a random forest model
[0079] Determine the input features and target variables; the input feature vector X = {x1, x2,..., x d}, where d represents the feature dimension, including 9 types of feature dimensions, namely: customer node location, distance, time window constraint, demand, weather category, wind speed, wind direction, vehicle load, and drone load. x1 represents the customer node location; x2 represents the distance; x3 represents the time window constraint; x4 represents the demand; x5 represents the weather category; x6 represents the wind speed; x7 represents the wind direction; x8 represents the vehicle load; x9 represents the drone load;
[0080] In the input feature vector, x1, x2, x3, x4, x7, x8, and x9 are continuous variables, and the vectors of each feature dimension are standardized through normalization;
[0081] In the input feature vector, x7 and x5 are categorical variables. Encode the categorical variables. According to the angle of the wind direction, it is divided into 8 discrete categories, x7 = {0, 45, 90,..., 315}; the weather category x5 includes 6 different categories: sunny, cloudy, light rain, heavy rain, snowy, and haze; among them, when it is sunny, x5 = [1, 0, 0, 0, 0, 0], when it is cloudy, x5 = [0, 1, 0, 0, 0, 0], when it is light rain, x5 = [0, 0, 1, 0, 0, 0], when it is heavy rain, x5 = [0, 0, 0, 1, 0, 0], when it is snowy, x5 = [0, 0, 0, 0, 1, 0], and when it is haze, x5 = [0, 0, 0, 0, 0, 1];
[0082] The output target variable is the fitness function value y = (y time , y cost ), y time is the time window penalty, and y cost is the transportation cost;
[0083] The random forest model learns the mapping relationship y = f(X) between X and y through the training data, so that when a new input feature x is given, the corresponding y value can be predicted. Specifically:
[0084] Randomly extract 70% of the data in the path planning database as the training data set, and the remaining 30% of the data as the test data set;
[0085] Randomly select samples from the training dataset with replacement to generate subsets and generate G decision trees. For each tree, traverse and split each node downward until reaching the leaf node to obtain the prediction value of a single tree. When splitting, randomly select u features (u < d) and split the samples according to the optimal splitting criterion, where the splitting criterion is to minimize the mean squared error of the target variable y after splitting;
[0086] The final prediction result of the random forest is the average of all decision trees;
[0087] Evaluate the model through the mean squared error MSE and the coefficient of determination R 2 ;
[0088] Adjust the random forest model parameters through grid search. The search range for the number of trees is {50, 100, 150}, the search range for the maximum depth (max_depth) of the tree is {8, 10, 12}, and the minimum number of samples (min_samples_split) for splitting nodes, where min_samples_split ≥ 10. Select the combination (N, max_depth, min_samples_split) to minimize the MSE on the validation set;
[0089] The trained random forest model obtained is used as the model for fitness calculation, where is the predicted value of the time window penalty, is the predicted value of the cost;
[0090] S033: After obtaining the fitness calculation model, initialize the genetic algorithm. First, perform individual coding. Each individual represents a solution for the joint distribution of trucks and drones, that is, C = {P k , P h , R k , R h}, which includes the truck k path P k , the truck arrival time at the customer point R k , the drone path P h , and the drone arrival time at the customer point R h ; Randomly generate an initial population of M individuals
[0091] S034: Define the fitness function. The time difference penalty C m between the truck and the drone = max(0, R h - R k - 10). If the drone arrival time is more than ten minutes later than the truck arrival time, the fitness function value will decrease and it will be excluded in the selection operation. The total time window penalty cost is P time , and the total cost Pcost It includes vehicle fixed costs, vehicle transportation costs, and drone transportation costs. The fitness function where w1 is the weight of the time window penalty, w2 is the weight of the total cost, and the larger the fitness value, the better the individual quality;
[0092] S035: Based on the individual fitness calculated by the random forest model, select individuals with better quality to enter the next generation;
[0093] S036: Perform crossover operations. The random forest model identifies whether the regional solution is a potential high-quality solution, thus guiding the mutation direction. Exchange part of the paths of two individuals, cross the truck paths, cross the drone paths, and perform mutation operations to generate new individuals P by changing the whole node order or distribution method k ;
[0094] Perform crossover and mutation operations. The random forest model identifies whether the regional solution is a potential high-quality solution, thus guiding the mutation direction. Crossover operation: Combine single-point crossover (randomly select a crossover point, cut the two parent individuals at the crossover point, and exchange the parts after the crossover point to generate two offspring individuals), two-point crossover (randomly select two crossover points and exchange the parts between the two crossover points of the two parent individuals to generate two offspring individuals), and uniform crossover (for each gene locus, randomly decide to inherit the gene from parent 1 or parent 2 to generate two offspring individuals). Randomly select one of the three crossover operations in the iteration and perform crossover on the selected individuals;
[0095] Mutation operation: Combine swap mutation (randomly select two gene loci and exchange the values of these two gene loci), insertion mutation (randomly select a gene locus and insert this gene into another random position), and inversion mutation (randomly select two gene loci and reverse the part between these two gene loci). Randomly select one of the three mutation operations in the iteration and perform mutation on the selected individuals.
[0096] S037: Update the random forest model, import the solution set obtained in each round of iteration, and train a new fitness calculation model.
[0097] S038: Perform iterative optimization. In each round of iteration, perform selection, crossover, and mutation operations to generate a new population.
[0098] S039: Terminate when the maximum number of iterations is reached and output the optimal solution. Otherwise, return to S035.
[0099] S04: According to the obtained optimal delivery plan, schedule the coordinated operation of vehicles and drones to serve customer points.
[0100] Such as Figure 3As shown in the figure, the truck and UAV joint distribution path planning system considering wind speed and wind direction according to the present invention includes a data collection module, a path planning module, a path planning solution module, and a distribution scheduling module.
[0101] The data collection module is used to collect and manage the distribution information of customer points, including customer point locations, customer demand quantities, customer service time windows, weather conditions, weather within the service time window, vehicle and UAV information; the weather within the service time window includes weather types, wind speed and wind direction; the truck and UAV information within the service time window includes quantity, load capacity, and battery capacity limits. The path planning module constructs a model based on the information collected by the data collection module; the path planning solution module is used to solve the obtained path planning module to obtain a distribution plan for the optimal path. The distribution scheduling module assigns tasks to the truck and UAV based on the distribution plan of the optimal path to serve the customer points.
[0102] A truck-UAV path planning device includes a processor and a memory, and the memory stores computer-readable instructions. When the computer-readable instructions are executed by the processor, the steps in the truck-UAV path problem planning method considering weather conditions are run.
[0103] A storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the truck-UAV path problem planning method considering weather conditions are run.
[0104] It should be understood that although this specification is described according to each embodiment, not every embodiment only contains an independent technical solution. This narrative way of the specification is only for clarity. Those skilled in the art should regard the specification as a whole, and the technical solutions in each embodiment can also be appropriately combined to form other embodiments that can be understood by those skilled in the art.
[0105] The series of detailed descriptions listed above are only specific descriptions of the feasible embodiments of the present invention, and they are not intended to limit the protection scope of the present invention. Any equivalent embodiments or changes made without departing from the technical spirit of the present invention should be included in the protection scope of the present invention.
Claims
1. The method for planning the path of a truck drone considering weather conditions according to the present invention is characterized in that, It includes the following steps: Comprehensive data collection and processing, collecting and processing the weather data and distribution point information of the distribution area; Based on the collected data, constructing a joint distribution path planning model for trucks and drones considering weather conditions; Using a random forest model to establish a fitness function calculation model; using a genetic algorithm combined with the random forest fitness calculation model to solve the joint distribution path planning model for trucks and drones considering weather conditions to obtain the optimal distribution plan; According to the obtained optimal distribution plan, scheduling vehicles and drones to cooperate and serve customer points.
2. The method for planning the path of a truck drone considering weather conditions according to claim 1, wherein The weather data of the distribution area includes weather type, wind speed and wind direction; the distribution point information includes customer location, customer demand, and information of vehicles and drones within the customer service time window.
3. The method for planning the path of a truck drone considering weather conditions according to claim 1, characterized in that, Constructing a joint distribution path planning model for trucks and drones considering weather conditions, specifically: The objective function includes vehicle delivery cost, truck transportation cost, drone transportation cost and time window penalty cost, as shown in the following formula: Constraint conditions: In the formula: i, j, o represent customer node indices, where i, j, o ∈ N; k represents vehicle index, k ∈ K; h represents drone index, h ∈ H; K represents the set of vehicles; H represents the set of drones; W represents the set of time windows, w ∈ W; w i represents the time window interval of customer point i; C1 represents the unit vehicle dispatch cost; C K represents the unit time vehicle transportation cost; C D represents the unit time drone transportation cost; represents if vehicle k executes a task from customer point i to customer point j, then otherwise it is 0; represents if vehicle k executes a task from customer point j to customer point i, then otherwise it is 0; represents if vehicle k departs from the warehouse and arrives at customer point j, then otherwise it is 0; represents if vehicle k departs from customer point i and arrives at the warehouse, then otherwise it is 0; represents if drone h executes a task from customer point i to customer point j, then otherwise it is 0; represents if drone h executes a task from customer point j to customer point i, then otherwise it is 0; represents the time taken for vehicle k to travel from customer point i to customer point j; represents the time taken for drone h to travel from customer point i to customer point j; represents the time when vehicle k arrives at customer point i; represents the time when drone h arrives at customer point i; d i represents the demand of customer point i; E i represents the earliest service time in the time window of customer point i; L i represents the latest service time in the time window of customer point i; f represents the penalty coefficient for early arrival; e represents the penalty coefficient for delay; Q k represents the maximum load capacity of vehicle k; Q h represents the maximum load capacity of drone h; V k represents the driving speed of vehicle k; V h represents the flying speed of drone h; s ij represents the distance from customer point i to customer point j; S max represents the maximum flying distance of the drone; q h represents the load of drone h; E max represents the maximum energy of the drone; V w represents the wind speed; V a represents the rated airspeed of the drone; E(V h ,q h ) represents the energy consumed by the drone h at a speed of V h and a payload of q h when consuming energy; A w Indicates an abnormal weather indicator variable B iw Indicates the customer time window matching variable C v represents the speed energy consumption coefficient; C w represents the load energy consumption coefficient; l ix , l iy represents the abscissa and ordinate values of customer point i in the rectangular coordinate system; l jx , l jy represents the abscissa and ordinate values of customer point j in the rectangular coordinate system; β h represents the wind direction angle; when l jx -l ix ≥ 0, directly calculate the direction angle; T h retrun represents the time when the drone h returns to the truck; T ih represents the time when the drone leaves the truck; represents the time taken by the drone from customer point i to customer point o; represents the time taken by the drone from customer point o to customer point j; T ik represents the time when the truck k arrives at customer point j.
4. The method for planning the path of a truck drone considering weather conditions according to claim 1, wherein Using a random forest model to establish a fitness function calculation model; using a genetic algorithm combined with the random forest fitness calculation model to solve the joint distribution path planning model for trucks and drones considering weather conditions to obtain the optimal distribution plan, specifically: Construct a random forest model and train the random forest model to obtain the trained random forest model As the model for fitness calculation, where is the predicted value of the time window penalty, is the predicted value of the cost; Initialization of genetic algorithm: First, perform individual coding. Each individual represents a solution for the joint distribution of trucks and drones, denoted as C = {P k , P h , R k , R h}, which includes the truck k path P k , the truck arrival time at the customer point R k , the drone path P h , and the drone arrival time at the customer point R h ; randomly generate an initial population of M individuals Define the fitness function: the time difference penalty C between the truck and the drone m = max(0, R h - R k - 10), the total time window penalty cost is P time , and the total cost P cost includes vehicle fixed costs, vehicle transportation costs, and drone transportation costs; the fitness function where w1 is the weight of the time window penalty and w2 is the weight of the total cost; Based on the individual fitness calculated by the random forest model, selecting individuals with better quality to enter the next generation; Perform the crossover operation, and the random forest model identifies whether the regional solution is a potential high-quality solution, thus guiding the mutation direction. Exchange part of the paths of two individuals, perform truck path crossover and drone path crossover, and perform the mutation operation to generate a new individual P by adjusting the node order or delivery method k ; Updating the random forest model, importing the solution sets obtained in each iteration, and training a new fitness calculation model; Performing iterative optimization, and performing selection, crossover, and mutation operations in each iteration to generate a new population; Terminate when the maximum number of iterations is reached, and output the optimal solution.
5. The method for planning the path of a truck drone considering weather conditions according to claim 4, wherein, Constructing a random forest model and training the random forest model, specifically: Determining input features and target variables; Input feature vector X = {x1, x2,..., x d}, where d represents the feature dimension, including 9 types of feature dimensions which are: customer node location, distance, time window constraint, demand quantity, weather category, wind speed, wind direction, vehicle load, and drone load; x1 represents the customer node location; x2 represents the distance; x3 represents the time window constraint; x4 represents the demand quantity; x5 represents the weather category; x6 represents the wind speed; x7 represents the wind direction; x8 represents the vehicle load; x9 represents the drone load; In the input feature vector, x1, x2, x3, x4, x7, x8, x9 are continuous variables, and the vectors of each feature dimension are standardized through normalization; In the input feature vector, x7 and x5 are categorical variables. Encoding the categorical variables, dividing them into 8 discrete categories according to the angle of the wind direction, x7 = {0, 45, 90,..., 315}; the weather category x5 includes 6 different categories: sunny, cloudy, light rain, heavy rain, snowy, and haze; among them, when it is sunny, x5 = [1, 0, 0, 0, 0, 0], when it is cloudy, x5 = [0, 1, 0, 0, 0, 0], when it is light rain, x5 = [0, 0, 1, 0, 0, 0], when it is heavy rain, x5 = [0, 0, 0, 1, 0, 0], when it is snowy, x5 = [0, 0, 0, 0, 1, 0], when it is haze, x5 = [0, 0, 0, 0, 0, 1]; The output target variable is the fitness function value y of the time window penalty and the cost, where y = (y time , y cost ), y time is the time window penalty, and y cost is the transportation cost; Randomly extracting 70% of the data in the path planning database as the training data set, and the remaining 30% of the data as the test data set; Randomly selecting samples from the training data set in a sampling with replacement manner to generate subsets, and generating G decision trees; for each tree, traversing and splitting each node downward until reaching the leaf node to obtain the predicted value of a single tree; when splitting, randomly select u features (u < d), and split the samples according to the optimal splitting criterion, where the splitting criterion is to minimize the mean square error of the target variable y after splitting. The final prediction result of the random forest is the average of all decision trees; Evaluate the model by mean square error MSE and coefficient of determination R 2 ; The parameters of the random forest model are adjusted by grid search. The search range for the number of trees is {50, 100, 150}, and the search range for the maximum depth (max_depth) of the tree is {8, 10, 12}. The minimum number of samples for splitting nodes is selected to minimize the MSE on the validation set; The obtained trained random forest model As the model for fitness calculation, where is the predicted value of the time window penalty, is the predicted value of the cost.
6. A system for a method of planning a truck drone path considering weather conditions according to any one of claims 1-5, characterized in that, It includes a data collection module, a path planning module, a path planning solution module, and a distribution scheduling module; The data collection module is used to collect and manage the distribution information of customer points, including customer point locations, customer demand quantities, customer service time windows, weather conditions, weather within the service time window, and vehicle and drone information within the service time window. The weather within the service time window includes weather type, wind speed, and wind direction. The truck and drone information within the service time window includes quantity, load capacity, and battery capacity limits. The path planning module constructs a model based on the information collected by the data collection module. The path planning solution module is used to solve the path planning module obtained to obtain a distribution plan for the optimal path; The distribution scheduling module assigns tasks to trucks and drones based on the distribution plan for the optimal path to serve customer points.
7. A truck drone path planning device, characterized in that, It includes a processor and a memory. The memory stores computer-readable instructions. When the computer-readable instructions are executed by the processor, the steps in the truck-drone path problem planning method considering weather conditions according to any one of claims 1-5 are run.
8. A storage medium, on which a computer program is stored, characterized in that, When the computer program is executed by the processor, the steps in the truck-drone path problem planning method considering weather conditions according to any one of claims 1-5 are run.