Fresh agricultural product distribution route optimization method and system based on real-time road condition detection
Through the fresh agricultural product distribution path optimization method based on real-time road condition detection, combined with the YOLOv7 algorithm and Kmeans multiple group evolution whale optimization algorithm, the problem of low efficiency in cold chain logistics path selection is solved, efficient and timely logistics distribution is achieved, and transportation costs and cargo loss rate are reduced.
Patent Information
- Application Number
- CN202411419425.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-12
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2044-10-12
AI Technical Summary
How to optimize the path selection of cold chain logistics, make transportation more efficient, ensure product quality, reduce cargo loss rate, and make logistics more timely.
A method for optimizing distribution paths of fresh agricultural products based on real-time road condition detection is proposed. By obtaining the initial information of the distribution center and each demand point, the paths between each node are initially screened and the traffic conditions are detected. The YOLOv7 algorithm is used to identify the number of driving vehicles and lanes, and the congestion index and pass time are calculated based on the vehicle speed, the actual load rate and fuel consumption of each path are analyzed, and the end distribution path optimization model of fresh agricultural products is established based on the transportation distance and time, and the Kmeans multiple group evolution whale optimization algorithm is used for solving.
By optimizing the path selection of cold chain logistics, distribution efficiency is improved, transportation costs are reduced, product quality is ensured, cargo loss rate is reduced, and logistics is more timely and efficient.
Smart Images

Figure CN118917515B_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 the distribution path of fresh agricultural products based on real-time road condition detection. Background Art
[0002] With the economic growth and the improvement of people's purchasing power, the demand for cold chain foods such as vegetables, fruits, and dairy products is increasing, and people's quality requirements for cold chain foods are getting higher and higher. For general product distribution, only the fixed cost of distribution vehicles and transportation costs need to be considered. However, fresh products are inherently different from ordinary products in the distribution process due to their perishable characteristics.
[0003] Since fresh agricultural products are perishable, easy to consume, and have a short shelf life, how to minimize the time of terminal delivery has become a key issue in terminal transportation. Most of the routes for terminal delivery are located in urban areas, where traffic conditions are complex and changeable, and congestion is very likely to occur. This brings great uncertainty to the terminal delivery of fresh agricultural products, so we cannot only consider the distance when planning the route. In order to eliminate this uncertainty, it is very necessary to detect traffic congestion on each delivery route, which can make the model more realistic and better guide the formulation of delivery routes.
[0004] After obtaining real-time traffic information through congestion detection, the corresponding distribution model needs to be solved. Since the distribution path optimization problem of fresh agricultural products is more complicated than that of ordinary commodities, it is still a hot research topic. In order to make the terminal distribution model of fresh agricultural products closer to the actual situation, domestic and foreign researchers have proposed many model improvement methods based on practical problems, considering the influence of factors such as travel time, time window, customer satisfaction, and product freshness. In model solving, heuristic algorithms such as genetic algorithms and ant colony algorithms have also been widely used, but the accuracy of the solution still has room for further improvement.
[0005] Optimizing the path selection of cold chain logistics can make transportation more efficient, ensure product quality, reduce cargo damage rate, and make logistics more timely. The present invention aims to take the vehicle distribution path optimization problem in cold chain logistics as the research object, comprehensively consider factors such as refrigeration, cargo damage, carbon emissions, load capacity, traffic conditions, etc., to establish a cold chain low-carbon logistics distribution path optimization model with the minimum total cost as the goal, and propose an improved whale optimization algorithm for optimization and solution. It is conducive to improving distribution efficiency and sales of fresh products, thereby reducing costs, increasing the profitability of enterprises, and is conducive to improving the operating efficiency and economic benefits of the entire logistics system, and can improve service quality and customer satisfaction. Summary of the invention
[0006] In view of the above-mentioned problems, the present invention is proposed.
[0007] Therefore, the technical problem solved by the present invention is: how to optimize the path selection of cold chain logistics, make transportation more efficient, ensure product quality, reduce cargo damage rate, and make logistics more timely.
[0008] In order to solve the above technical problems, the present invention provides the following technical solutions: a method for optimizing the distribution path of fresh agricultural products based on real-time road condition detection, comprising: obtaining initial information of a distribution center and each demand point;
[0009] Preliminarily screen the paths between nodes and detect their traffic conditions. Use the YOLOv7 algorithm to identify the number of vehicles and lanes on each path, and calculate the congestion index and travel time of each path based on the vehicle speed.
[0010] Compare the travel time between nodes, take the path with the shortest travel time as the transportation path between nodes, and record the corresponding transportation distance and transportation time into the information matrix;
[0011] Analyze the actual load rate of each route, calculate the vehicle fuel consumption, combine the transportation distance and time, complete the parameter setting of each part of the model cost, and establish the terminal distribution route optimization model of fresh agricultural products;
[0012] The Kmeans multi-population evolutionary whale optimization algorithm is used to solve the fresh agricultural product terminal delivery path optimization model, output the fresh agricultural product terminal delivery path optimization plan, and perform vehicle scheduling and path planning based on the optimization results.
[0013] As a preferred solution of the method for optimizing the distribution path of fresh agricultural products based on real-time road condition detection described in the present invention, wherein: the acquisition of initial information of the distribution center and each demand point includes constructing a supply-demand relationship matrix according to the storage of the distribution center and the demand of the demand point, and establishing a location information matrix according to the location information of the distribution center and each demand point;
[0014] Calculate the time required to unload at each demand point based on initial information;
[0015] The number of vehicles required to complete the delivery task is estimated in advance based on the total demand of each demand point, the load weight of a single transport vehicle in the distribution center, the type and volume of the goods, and the maximum loading volume of the vehicle. The calculation formula is:
[0016] ,
[0017] ,
[0018] ,
[0019] in, represents the estimated number of vehicles in terms of cargo weight, represents the number of vehicles estimated in terms of cargo volume, Indicates the number of vehicles required to complete the delivery task; represents the rounding function; represents the total number of demand points; Indicates demand point Quantity of demand; Indicates the volume occupied by cargo per unit weight. The value depends on the type of cargo. Indicates the volume of cargo that can be loaded in a single vehicle compartment. Indicates the maximum load of the vehicle; express The vehicle loading factor, express vehicle loading factor.
[0020] As a preferred solution of the method for optimizing the delivery path of fresh agricultural products based on real-time road condition detection described in the present invention, wherein: the preliminary screening of the paths between the nodes and the detection of their traffic conditions include, when the vehicle is traveling on the road section to be detected, recording the vehicle speed through the vehicle's driving recorder and uploading the picture to be identified, using YOLOv7 as the vehicle and lane line detection algorithm to detect it, and obtaining the average vehicle speed, the number of vehicles and lane lines within the identifiable range, and using them as the criteria for judging congestion, assigning weights to calculate and obtain the congestion index;
[0021] The congestion index is calculated based on the difference between the average speed and the maximum speed limit, and the ratio of the number of vehicles detected on the congested road section to the number of lanes.
[0022] The difference between the average speed and the maximum speed limit is assigned a weight of 1, and the ratio of the number of vehicles detected on the congested road section to the number of lanes is assigned a weight of 2. The calculation formula is:
[0023] ,
[0024] in, represents the congestion index, Indicates the maximum speed limit. represents the average speed of traffic, Indicates the number of lanes, Indicates the number of vehicles detected in the congested road section;
[0025] The predicted speed is calculated as:
[0026] ,
[0027] in, represents the predicted travel speed, Indicates the length of the interval where the average speed is detected. Indicates the lower speed limit of the interval where the average speed is detected. Indicates the length of the interval where the congestion index is located. Indicates the upper limit congestion index of the congestion index range.
[0028] As a preferred solution of the method for optimizing the delivery route of fresh agricultural products based on real-time road condition detection according to the present invention, wherein: the recording of the corresponding transportation distance and transportation time into the information matrix includes: if the demand solution Car pair The distribution problem of demand points, then the input contains One-dimensional array of numbers ;
[0029] Sort x and store the results in an array In the array remain unchanged;
[0030] Iterating over an array and with the array Compare and output the elements in The position in the array middle;
[0031] Define a value of all 0 For array ,set up for Middle elements, for Middle elements, Assign to ,make As an array Index of , traverse the array , do the following:
[0032] ,
[0033] ,
[0034] in, express The updated value, express Updated value;
[0035] Remove from this Repeat the elements from 1 to arrangement;
[0036] The array Medium to large The element value is changed to , used to separate the front and rear, indicating the next transport vehicle, less than The elements are the demand points. Divide Each part represents a car, and the order of visiting demand points is from front to back;
[0037] Traversing the Matrix , enter its information into the three-dimensional path access order matrix middle.
[0038] As a preferred solution of the method for optimizing the distribution path of fresh agricultural products based on real-time road condition detection according to the present invention, wherein: the analysis of the actual load rate of each path includes traversing the array in reverse order And refer to the access order matrix , the demand of each demand point is accumulated to the corresponding path in turn and recorded in the matrix middle;
[0039] Calculate actual load factor :
[0040] ,
[0041] in, Indicates vehicle From the demand point To the demand point Actual load on the transport route;
[0042] Calculate fuel consumption :
[0043] ,
[0044] in, From the demand point To the demand point Transportation distance; Indicates the fuel consumption per unit distance traveled when the vehicle is unloaded; Indicates the fuel consumption per unit distance traveled when the vehicle is fully loaded;
[0045] Substitute the congestion index, actual load factor and fuel consumption into the model.
[0046] As a preferred solution of the method for optimizing the delivery path of fresh agricultural products based on real-time road condition detection described in the present invention, wherein: the establishment of the optimization model for the terminal delivery path of fresh agricultural products includes: if the number of demand points is , the initial predicted number of delivery vehicles is , then the vehicle fixed cost The calculation formula is:
[0047] ,
[0048] in, Indicates The vehicle type corresponds to the sum of the driver's salary, vehicle depreciation and maintenance costs for one trip; the matrix Row index 1 to Indicates the corresponding Demand points, row index Represents the matrix index of the distribution center, with column index 1 to Indicates the corresponding delivery vehicles, matrix The values are:
[0049] ,
[0050] The total shipping cost is calculated as:
[0051] Multiply the delivery cost of each route by a coefficient , when the vehicle When it is passable ,otherwise , is an infinite positive number;
[0052] Assume the unit oil price is , then the total transportation cost for:
[0053] ,
[0054] in, Indicates vehicle From Location To the location The traffic coefficient at ; Used to record the vehicle's driving trajectory. The specific values are as follows:
[0055] ,
[0056] Cargo damage cost The calculation formula is:
[0057] ,
[0058] in, Indicates the unit price of the product. Indicates the deterioration rate of goods during transportation. Indicates the deterioration rate of goods during unloading, ranging from 1 to Indicates the demand point, Indicates that the vehicle is from Click to The transportation time of the point, Indicates that the vehicle is at the demand point The time taken to unload the cargo;
[0059] The cooling cost is calculated as:
[0060] Precooling time The assignment method is as follows:
[0061] Frozen products: When the set temperature is -20℃ and the ambient temperature is >30℃, =2h; 30℃>ambient temperature>20℃, =1.5h; when the ambient temperature is <20℃, =1h;
[0062] Refrigerated goods: Set the temperature to 4°C, when the ambient temperature is >30°C, =1.5h; 30℃>ambient temperature>20℃, =1h; when the ambient temperature is <20℃, =2 / 3h;
[0063] During the vehicle precooling process, the refrigeration cost of the cold chain vehicle per unit time is ; During the transportation process, the refrigeration cost of the cold chain vehicle in transporting products per unit time is ; During the unloading process, the refrigeration cost incurred by the cold chain vehicle in unloading the goods per unit time is ; represents the effect of temperature on cooling energy consumption, then the cooling cost for:
[0064] ,
[0065] The time window cost is calculated as follows:
[0066] set up For vehicles to reach the demand point time, is the waiting cost per unit time of the vehicle, is the vehicle's lateness cost per unit time; For demand point The expected time window, For demand point The upper limit of the expected time window, For demand point The lower limit of the expected time window; For demand point The acceptable time window, For demand point The upper limit of the acceptable time window, For demand point The acceptable lower limit of the time window; then the demand point The penalty cost for:
[0067] , the acceptable time window, For demand point The upper limit of the acceptable time window, For demand point The acceptable lower limit of the time window; then the demand point The penalty cost for:
[0068] ,
[0069] Total demand points, the total penalty cost for:
[0070] ,
[0071] Carbon emissions costs The calculation method is:
[0072] set up represents the unit carbon tax price, represents the carbon dioxide emission factor, Indicates the energy consumption per unit time of the refrigeration equipment. The calculation formula is:
[0073] ,
[0074] Overload penalty cost The calculation method is:
[0075] ,
[0076] in, represents the overload penalty coefficient, Indicates The maximum load of the vehicle during transportation;
[0077] The fresh agricultural product terminal delivery route optimization model aims to minimize the total cost, including vehicle fixed cost, transportation cost, cargo damage cost, refrigeration cost, time window cost, carbon emission cost and overload penalty cost;
[0078] Each demand point completes the goods delivery at one time without repeated visits. The constraints are as follows:
[0079] ,
[0080] The number of vehicles returning to the distribution center is equal to the number of vehicles dispatched for delivery. The constraints are as follows:
[0081] ,
[0082] matrix The matrix The calculation shows that the relationship is as follows:
[0083] ,
[0084] ,
[0085] matrix The internal variables all satisfy the 0-1 constraints, including:
[0086] ,
[0087] The terminal distribution path optimization model of fresh agricultural products is expressed as:
[0088] .
[0089] As a preferred solution of the method for optimizing the delivery path of fresh agricultural products based on real-time road condition detection described in the present invention, the method comprises: solving the optimization model of the terminal delivery path of fresh agricultural products includes: using the Kmeans clustering algorithm to classify the whale population, classifying the population into three sub-populations of the same size, and each population moves according to different strategies; at the same time, introducing the multi-population evolution strategy in MEWOA, after each position update, each population performs a population evolution in the next iteration;
[0090] The movement strategies of Kmeans multi-population whale optimization algorithm include the movement strategy of exploratory sub-population, the migration strategy of development sub-population and the movement strategy of moderate sub-population;
[0091] The movement strategy of the exploratory subpopulation includes: the movement strategy of the KMWOA exploratory subpopulation is a sine-cosine random search, and the formula is:
[0092] ,
[0093] in, is the position vector of the individual’s current solution, is the position vector of the individual solution after the next iteration, , , , represents a random number that follows a uniform distribution, where belongs to [0,2], belongs to [0,2], , belongs to [0,1], , The value range is [-1,1]. The current individual will Get closer and conduct a global search;
[0094] The migration strategy of the development sub-population includes implementing the mobile strategy of the development sub-population using the development phase of WOA, and the formula is:
[0095] ,
[0096] ,
[0097] in, represents the location of the optimal solution, represents the distance between the current individual and the optimal individual, , , , Both represent the relevant parameters of spiral approach in the whale optimization algorithm. represents the natural logarithm;
[0098] The movement strategy of the moderate subpopulation includes the formula:
[0099] ,
[0100] The population evolution of the exploratory subpopulation is carried out as follows:
[0101] ,
[0102] ,
[0103] in, Represents a random number between [1,2];
[0104] The population evolution of the development sub-population is carried out with the formula:
[0105] ,
[0106] ,
[0107] in, Represents a random number whose value is between [0,2];
[0108] Perform population evolution of the moderate sub-population and let the individuals in the moderate sub-population evolve their positions based on OBL. The formula is:
[0109] ,
[0110] ,
[0111] in, represents the lower boundary of the problem space, Represents the upper boundary of the problem space; represents the objective function, Indicates the new position based on the OBL.
[0112] A fresh agricultural product distribution route optimization system based on real-time road condition detection, characterized in that it includes: an initial information acquisition module: acquiring initial information of a distribution center and each demand point;
[0113] Path screening and measurement module: preliminarily screens the paths between nodes and detects their traffic conditions. YOLOv7 algorithm is used to identify the number of vehicles and lanes in each path, and the congestion index and travel time of each path are calculated based on the vehicle speed.
[0114] Optimal path determination module: compares the travel time between nodes, takes the path with the shortest travel time as the transportation path between nodes, and records the corresponding transportation distance and transportation time into the information matrix;
[0115] Cost analysis and model building module: Analyze the actual load rate of each route, calculate the vehicle fuel consumption, combine the transportation distance and time, complete the parameter setting of each part of the model cost, and establish the terminal distribution route optimization model of fresh agricultural products;
[0116] Optimization solution and scheduling module: Use the Kmeans multi-population evolutionary whale optimization algorithm to solve the fresh agricultural product terminal distribution path optimization model, output the fresh agricultural product terminal distribution path optimization plan, and perform vehicle scheduling and path planning based on the optimization results.
[0117] A computer device comprises: a memory and a processor; the memory stores a computer program, wherein: the processor implements the steps of any one of the methods of the present invention when executing the computer program.
[0118] A computer-readable storage medium stores a computer program, wherein: when the computer program is executed by a processor, the steps of any one of the methods of the present invention are implemented.
[0119] Beneficial effects of the present invention: The cold chain logistics distribution path optimization method based on the improved whale optimization algorithm of the present invention is based on the transportation conditions of the goods, and takes into account the vehicle load and the traffic conditions around the demand point, and constructs a site selection model with the goal of minimizing the total logistics cost, so that the selection and optimization of the cold chain logistics distribution path is more realistic and reasonable, which helps to select the optimal path for the distribution vehicle, thereby reducing the cost of the entire logistics process. An improved whale optimization algorithm is proposed. Compared with the traditional optimization algorithm, the improved whale optimization algorithm has a certain improvement in high-dimensional accuracy. For complex functions, the algorithm can effectively avoid falling into local optimality, and its convergence speed is also faster than other optimization algorithms. Applying it to the cold chain logistics distribution path optimization problem can effectively avoid the shortcomings of slow convergence speed and low convergence accuracy, thereby optimizing the algorithm. BRIEF DESCRIPTION OF THE DRAWINGS
[0120] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. 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 creative work. Among them:
[0121] Figure 1 A flow chart of a method for optimizing the delivery route of fresh agricultural products based on real-time road condition detection provided by the first embodiment of the present invention;
[0122] Figure 2 A schematic diagram of an algorithm flow of a cold chain distribution path optimization method based on an improved whale optimization algorithm provided in a first embodiment of the present invention;
[0123] Figure 3 Iteration diagrams of algorithms tested using Example 1 in the method for optimizing the fresh agricultural product distribution path based on real-time road condition detection provided in the second embodiment of the present invention;
[0124] Figure 4 Iteration diagrams of algorithms tested using Example 2 in the fresh agricultural product distribution route optimization method based on real-time road condition detection provided in the second embodiment of the present invention;
[0125] Figure 5 A distribution plan diagram output by the KMEWOA algorithm in Example 1 of the method for optimizing the distribution path of fresh agricultural products based on real-time road condition detection provided in the second embodiment of the present invention;
[0126] Figure 6 This is a distribution plan diagram output by the KMEWOA algorithm in Example 2 of the fresh agricultural product distribution path optimization method based on real-time road condition detection provided in the second embodiment of the present invention. DETAILED DESCRIPTION
[0127] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary persons in the art without creative work should fall within the scope of protection of the present invention.
[0128] Example 1, reference Figure 1 , Figure 2 , which is an embodiment of the present invention, provides a method for optimizing the delivery path of fresh agricultural products based on real-time road condition detection, comprising:
[0129] S1: Obtain the initial information of the distribution center and each demand point.
[0130] A supply-demand relationship matrix is constructed based on the storage of the distribution center and the demand of the demand points. A location information matrix is established based on the location information of the distribution center and each demand point. The time required for unloading at each demand point is calculated based on the initial information. The number of vehicles required to complete the delivery task is estimated in advance based on the total demand of each demand point and the load weight, cargo type and volume of a single transport vehicle of the distribution center and the maximum loading volume of the vehicle. The method for estimating the number of vehicles is as follows:
[0131] ,
[0132] ,
[0133] , (1)
[0134] in, represents the estimated number of vehicles in terms of cargo weight, represents the number of vehicles estimated in terms of cargo volume, Indicates the number of vehicles required to complete the delivery task; represents the rounding function; represents the total number of demand points; Indicates demand point Quantity of demand; Indicates the volume occupied by cargo per unit weight. The value depends on the type of cargo. Indicates the volume of cargo that can be loaded in a single vehicle compartment. Indicates the maximum load of the vehicle; express The vehicle loading factor, express The vehicle loading factor is related to the complexity of loading and vehicle constraints, including cargo type, loading method, weight constraint and volume constraint.
[0135] S2: Preliminarily screen the paths between nodes and detect their traffic conditions. Use the YOLOv7 algorithm to identify the number of vehicles and lanes in each path, and calculate the congestion index and travel time of each path based on the vehicle speed.
[0136] When a vehicle equipped with specific navigation software is traveling on a road section that needs to be detected, the vehicle's driving recorder records the vehicle speed and uploads the picture to be identified. YOLOv7 is used as the vehicle and lane line detection algorithm to detect it, and the average vehicle speed, the number of vehicles and lane lines within the identifiable range are obtained. These three variables are used as the criteria for judging congestion. The three variables are each given a certain weight to calculate the congestion index, so as to judge congestion more scientifically and accurately.
[0137] If there are multiple vehicles equipped with specific navigation software on a road section, the congestion index of different locations on the road section can be obtained. The congestion index obtained by averaging them can more accurately reflect the congestion situation of the entire route. The advantage of this method is that it does not depend on the number of users. Even if only one car owner provides data, it can give a rough judgment on the traffic situation. The more car owners use navigation software, the more accurate the judgment of this method. Compared with the detection only for intersections, it can reflect the congestion situation of the entire road and has a wider range of application.
[0138] The specific method is: the higher the average speed of the vehicles, the smaller the possibility of congestion; the more vehicles detected, the greater the possibility of congestion, and the slower the speed of clearing after congestion; the more lanes, the smaller the possibility of congestion, and the faster the speed of clearing after congestion. Congestion is judged based on the average speed and supplemented by the number of vehicles and lanes.
[0139] The difference between the average speed and the maximum speed limit is used as the basis, and the ratio of the number of vehicles detected on the congested road section to the number of lanes is used as an auxiliary to calculate the congestion index. The larger the congestion index, the more likely it is to cause congestion, and the smaller the index, the smoother the road. Since the average speed is the basis, the difference between the average speed and the maximum speed limit is assigned a weight of 1; since the number of lanes is calculated based on the total number of lanes in both directions, the ratio of the number of vehicles detected on the congested road section to the number of lanes is assigned a weight of 2. The specific calculation method is shown in formula (2).
[0140] , (2)
[0141] in, Congestion Index Indicates Limit Speed (maximum speed limit), Indicates Average Speed (average speed of traffic). Indicates the Number of Lanes. Indicates Number of Vehicles (the number of vehicles detected on the congested road section).
[0142] The average speed recorded by the dashcam is the current speed of the road section. After the terminal path planning is completed, the speed of the transport vehicle passing through the road section may be different from the average speed recorded before. In order to better guide the selection of the distribution path, the corresponding relationship between the congestion coefficient and the subsequent predicted travel speed should be established, so as to complete the prediction of the travel time by quantifying the degree of congestion. The author measures the vehicle speed and identifies the vehicle and lane lines on some sections of Nanjing, calculates the congestion index, and tests the target section again after a period of time. Through the above data, the corresponding relationship between the congestion index and the travel speed is inferred as shown in Table 1, thereby finding the corresponding relationship between the congestion coefficient and the travel time. The travel speed calculation formula is shown in formula (3).
[0143] Table 1
[0144] Congestion Index Passing speed (0,10] (42,50] (10,18] (33,42] (18,24] (28,33] (24,28] (24,28] (28,50] (0,24]
[0145] ,(3)
[0146] In the formula, represents the predicted travel speed, Indicates the length of the interval where the average speed is detected. Indicates the lower speed limit of the interval where the average speed is detected. Indicates the length of the interval where the congestion index is located. Indicates the upper limit congestion index of the congestion index range.
[0147] S3: Compare the travel time between the nodes, take the path with the shortest travel time as the transportation path between the nodes, and record the corresponding transportation distance and transportation time in the information matrix.
[0148] The search agent address composed of random variables in the optimization algorithm is converted into a vehicle path matrix. In the past, when solving path optimization problems, people mostly used ant colony algorithms and genetic algorithms. This is because the position updates of such algorithms are easy to correspond to the path access order. The present invention proposes a method that can convert a set of irregular one-dimensional arrays of arbitrary values into a matrix representing the path access order, so that algorithms such as whale optimization can more easily solve path optimization problems. The steps are as follows:
[0149] a. If you need to solve Car pair The distribution problem of demand points, then the input contains One-dimensional array of numbers .
[0150] b.Yes Sort and store the results in an array In the array Remain unchanged.
[0151] c. Traverse the array and with the array Compare and output the elements in The position in the array middle.
[0152] d. Define a set of all 0s For array ,set up for Middle elements, for Middle elements, Assign to ,make As an array , traverse array B and do the following:
[0153] (4)
[0154] middle, express The updated value, express The updated value.
[0155] e. The array Medium to large The element value is changed to , used to separate the front and rear, indicating the next transport vehicle, less than The elements of are the demand points, so Divide There are parts, each part represents a car, and the order from front to back is the order of visiting demand points.
[0156] f. Traverse the matrix , enter its information into the three-dimensional path access order matrix middle.
[0157] S4: Analyze the actual load rate of each route, calculate the vehicle fuel consumption, combine the transportation distance and time, complete the parameter setting of each part of the model cost, and establish the terminal distribution route optimization model of fresh agricultural products.
[0158] Dynamically analyzing the actual load rate of each route improves the shortcoming of most models that fuel consumption is only related to the transportation distance, thereby being able to more accurately calculate vehicle transportation costs and carbon emission costs.
[0159] Load Matrix , actual load rate The calculation steps of fuel consumption are as follows:
[0160] a. Traverse the array in reverse order And refer to the access order matrix , the demand of each demand point is accumulated to the corresponding path in turn and recorded in the matrix middle.
[0161] b. Calculate the actual load rate according to formula (5):
[0162] ,(5)
[0163] Where: Represents the actual load of vehicle k on the transportation path from demand point i to demand point j.
[0164] Calculate the fuel consumption according to formula (6):
[0165] ,(6)
[0166] Where: Represents the transportation distance from demand point i to demand point j; Indicates the fuel consumption per unit distance traveled when the vehicle is unloaded; It represents the fuel consumption per unit distance when the vehicle is fully loaded; Formula (6) is the total fuel consumption on the transportation path from demand point i to demand point j.
[0167] By substituting the congestion index, actual load rate and fuel consumption into the model, it is possible to more accurately calculate vehicle transportation costs and carbon emission costs, making the model closer to actual conditions.
[0168] Taking into account multiple factors such as refrigeration, cargo damage, carbon emissions, time windows, road restrictions, etc., and fully analyzing the impact of load capacity, traffic conditions and different vehicle models on the total cost, the mathematical model construction method for optimizing the terminal distribution path of fresh agricultural products is as follows. The objective function of the terminal distribution path optimization scheme of fresh agricultural products consists of 7 costs, including:
[0169] (1) Vehicle cost
[0170] The distribution center uses refrigerated delivery vehicles to provide services to various demand points, which incurs certain fixed costs. These costs mainly include driver wages, vehicle depreciation costs, and maintenance costs. They are related to the number and type of cold chain vehicles used, but not to the driving distance. The number of delivery vehicles used by the distribution center should be arranged reasonably to avoid waste and excessive costs. If the number of demand points is , the initial predicted number of delivery vehicles is , then the vehicle fixed cost is:
[0171] ,(7)
[0172] In the formula, represents the sum of the driver's salary, vehicle depreciation and maintenance costs for a trip of the kth vehicle corresponding to the vehicle model. In the present invention, this part of the cost is only related to the number of trips and the vehicle model, but has nothing to do with the driving distance and time each time. The matrix Used to record which vehicle delivers each demand point, matrix Row index 1 to Indicates the corresponding Demand points, row index Represents the matrix index of the distribution center, with column index 1 to Indicates the corresponding delivery vehicles, matrix The values are:
[0173] ,
[0174] (2) Transportation costs
[0175] Transportation cost generally refers to the fuel consumption cost during vehicle transportation. The fuel consumption during transportation is determined by the actual load rate of the cold chain vehicle and the transportation distance. The actual load rate is calculated according to formula (5):
[0176] ,(5)
[0177] Calculate the fuel consumption according to the formula (6):
[0178] ,(6)
[0179] Since most of the final delivery is in urban areas, large transport vehicles may not be able to pass through some sections of the road. In order to find a reasonable and feasible delivery route, the delivery cost of each section should be multiplied by the coefficient , when the vehicle When it is passable ,otherwise , is an infinite positive number.
[0180] Formula (6) has given the total fuel consumption on a route. Assume the unit fuel price is , the total transportation cost is:
[0181] ,(8)
[0182] In the formula, Used to record the vehicle's driving trajectory. The specific values are as follows:
[0183] ,
[0184] (3) Cargo damage costs
[0185] Cargo damage cost refers to the loss cost of cold chain goods caused by the passage of time and temperature changes during transportation and unloading. Its expression is as follows:
[0186] ,(9)
[0187] In the formula, Indicates the unit price of the product. Indicates the deterioration rate of goods during transportation. Indicates the deterioration rate of goods during unloading, ranging from 1 to Indicates the demand point, Indicates that the vehicle is from Click to The transportation time of the point, For vehicles at demand points Time taken to unload at the port, transportation time The specific calculation method will be given in the subsequent important parameter settings.
[0188] (4) Refrigeration cost
[0189] Precooling time The assignment method is as follows:
[0190] Frozen products: When the set temperature is -20℃ and the ambient temperature is >30℃, =2h; 30℃>ambient temperature>20℃, =1.5h; when the ambient temperature is <20℃, =1h.
[0191] Refrigerated goods: Set the temperature to 4°C, when the ambient temperature is >30°C, =1.5h; 30℃>ambient temperature>20℃, =1h; when the ambient temperature is <20℃, =2 / 3h.
[0192] During the vehicle precooling process, the refrigeration cost of the cold chain vehicle per unit time is p41 ; During the transportation process, the refrigeration cost of the cold chain vehicle in transporting products per unit time is ; During the unloading process, the refrigeration cost incurred by the cold chain vehicle in unloading the goods per unit time is ; Indicates the effect of temperature on cooling energy consumption, then the cooling cost is:
[0193] , (10)
[0194] (5) Time window cost
[0195] Time window cost refers to the cost incurred when a vehicle cannot reach the demand point within the specified time period, including waiting cost and late arrival cost. For vehicles to reach the demand point time, is the waiting cost per unit time of the vehicle, is the vehicle’s lateness cost per unit time, For demand point The expected time window, is the time window that demand point i can accept, then demand point The penalty cost is:
[0196] ,(11)
[0197] In the formula, is an infinite positive number.
[0198] If the number of demand points is n, the total penalty cost is:
[0199] ,
[0200] (6) Carbon emission costs
[0201] Carbon emission cost refers to the cost of carbon dioxide emissions caused by vehicle energy consumption and refrigerant consumption during transportation. The fuel consumption of a vehicle is related to factors such as the vehicle's driving distance, load and speed, and the more fuel it consumes, the more carbon dioxide it emits. represents the unit carbon tax price, represents the carbon dioxide emission factor, represents the energy consumption per unit time of the refrigeration equipment, and the fuel consumption of each path is given by formula (6). Therefore, the total carbon emission cost of vehicle operation and refrigeration equipment is:
[0202] ,(12)
[0203] (7) Overload penalty cost
[0204] Since transport vehicles cannot be overloaded, the objective function must also meet the vehicle load constraint. The present invention takes into account the impact of different vehicle models on costs and requires specific analysis of different vehicle models. The model of the vehicle is The maximum load capacity of this model is , then for any , To facilitate algorithm programming, the present invention integrates the constraint that the vehicle cannot be overloaded into the objective function of the shortest path, and obtains the overload penalty cost as:
[0205] ,(13)
[0206] in, Represents the overload penalty coefficient, which is usually set to a very large positive value; Indicates The maximum load of the vehicle during transportation.
[0207] In summary, the terminal distribution path optimization model of this scheme aims to minimize the total cost, including vehicle fixed cost, transportation cost, cargo damage cost, refrigeration cost, time window cost, carbon emission cost and overload penalty cost. Since most previous researchers only estimated the overall situation of traffic congestion on the transportation path, it is difficult to accurately predict the impact on transportation time. Therefore, the present invention establishes a quantification method for the congestion index and establishes a corresponding relationship between the congestion index and the travel time, so that the vehicle transportation time t is closer to the actual situation and the cargo damage cost and refrigeration cost calculation are more accurate.
[0208] In addition, each demand point completes the delivery of goods at one time without repeated visits. The constraints are as follows:
[0209] ,(14)
[0210] The number of vehicles returning to the distribution center is equal to the number of vehicles dispatched for delivery. The constraints are as follows:
[0211] ,(15)
[0212] matrix The matrix The calculation shows that the relationship between the two is as follows:
[0213] ,(16)
[0214] ,(17)
[0215] matrix The internal variables all satisfy the 0-1 constraints, and we have:
[0216] ,(18)
[0217] In summary, we get:
[0218] ,(19)
[0219] Optimize the cold chain distribution path model.
[0220] S5: Use the Kmeans multi-population evolutionary whale optimization algorithm to solve the fresh agricultural product terminal delivery path optimization model, output the fresh agricultural product terminal delivery path optimization plan, and perform vehicle scheduling and path planning based on the optimization results.
[0221] refer to Figure 2 , the whale population is classified by using the Kmeans clustering algorithm. In order to balance the two behaviors of global search and local utilization, the population is classified into three sub-populations of equal size, and each population moves according to different strategies; at the same time, the multi-population evolution strategy in MEWOA is introduced. After each position update, each population will evolve in the next iteration, thereby improving population diversity and convergence speed and eliminating local optimality. In addition, the linear movement in the random search process is changed to the movement of sine and cosine functions, making the individual movement of random search more flexible and conducive to global search.
[0222] The movement strategy of the Kmeans multi-group whale optimization algorithm is as follows:
[0223] (1) Movement strategy of the exploratory subpopulation
[0224] Individuals in the exploration subpopulation are far away from the local optimal solution due to poor fitness. Therefore, it is necessary to make individuals in the exploratory subpopulation committed to global exploration to explore new areas and find new solutions. The movement strategy of the KMWOA exploration subpopulation is sine-cosine random search, and the formula is as follows.
[0225] ,(20)
[0226] In the formula, is the position vector of the individual’s current solution, is the position vector of the individual solution after the next iteration, represents a random number that follows a uniform distribution, where belong , belong , belongs to [0,1], , The value range is [-1,1]. The current individual will Closer, thus conducting a global search.
[0227] (2) Developing a subpopulation movement strategy
[0228] When an individual approaches the current optimal solution, it searches the area around it. This behavior is called local search, which can improve the convergence speed and solution accuracy. Since the fitness of the development sub-population is close to the current optimal solution, the development sub-population needs to concentrate its energy on local development to improve the convergence speed and solution accuracy. Therefore, the development phase of WOA is used to implement the mobile strategy of the development sub-population, as follows:
[0229] ,
[0230] ,(twenty one)
[0231] (3) Movement strategy of the moderate subpopulation
[0232] The fitness of the moderate subpopulation is between good and bad. Therefore, individuals in the moderate subpopulation either explore to find new solutions or locally exploit to increase the convergence rate, thereby achieving a stochastic balance between exploration and exploitation. The movement strategy of the moderate subpopulation is given in formula (22):
[0233] ,(twenty two)
[0234] The evolutionary strategies of each subpopulation are as follows:
[0235] (1) Population evolution of exploratory subpopulations
[0236] Individuals in the exploratory subpopulation expand the search range by increasing the absolute value of the position vector to enhance the global exploration ability. Formula (24) gives the evolution process of the exploratory subpopulation:
[0237] ,(twenty three)
[0238] ,(twenty four)
[0239] in, is a random number between [1,2]. If the current position is a local optimum, formula (24) can help the individual escape from the local optimum with a certain probability. This is because under the effect of formula (24), the absolute value of the current position vector increases, allowing the individual to explore other areas away from the current position. MEWOA can search other areas, making the global search capability more powerful.
[0240] (2) Population evolution of development subpopulations
[0241] Individuals in the exploiting subpopulation evolve their positions by performing deep local search around the current optimal solution, see formula (26):
[0242] , (25)
[0243] , (26)
[0244] in, Represents a random number whose value is between [0,2]. The position of the individual in the development subpopulation is increased or decreased by the position vector of the current optimal solution, thereby realizing the current optimal solution of the search area around. This evolutionary strategy can make full use of the position information of the current optimal solution to accelerate convergence and improve accuracy.
[0245] (3) Population evolution of fit subpopulations
[0246] OBL is often used to improve the performance of metaheuristic algorithms, and it can help increase the diversity of the population. Therefore, we let the individuals in the moderate subpopulation evolve their positions based on OBL, as shown in formula (28):
[0247] , (27)
[0248] , (28)
[0249] in, represents the lower boundary of the problem space, Indicates the upper boundary. represents the objective function, represents the new location based on OBL. OBL increases the population diversity of MEWOA, enabling it to escape from local optimality and explore new areas.
[0250] Furthermore, the specific methods for optimizing the terminal delivery route of fresh agricultural products are as follows:
[0251] a. First, obtain the initial information matrix and find available delivery paths.
[0252] b. Return real-time detected road condition information and identify vehicles and lane lines.
[0253] c. Substitute the traffic information and calculate the congestion index.
[0254] d. Use the congestion index to calculate travel time.
[0255] d. Generate path access sequence.
[0256] e. Calculate the load matrix and fuel consumption of each path through the path access sequence.
[0257] f. Substitute the above data into the mathematical model.
[0258] g. Set this model as the objective function and use the relevant information given at the beginning to initialize the optimization algorithm, including the scope of the solution space, the number of search agents, the number of initial populations, and the number of iterations. Use the Kmeans multi-population whale optimization algorithm to solve it, and after a certain number of iterations, output the optimized delivery path and minimum cost, and use this result to guide the terminal delivery of fresh agricultural products.
[0259] The above embodiment also includes a fresh agricultural product distribution route optimization system based on real-time road condition detection, including:
[0260] Initial information acquisition module: obtain the initial information of the distribution center and each demand point.
[0261] Path screening and measurement module: Preliminarily screen the paths between nodes and detect their traffic conditions. Use the YOLOv7 algorithm to identify the number of vehicles and lanes on each path, and calculate the congestion index and travel time of each path based on the vehicle speed.
[0262] Optimal path determination module: compares the travel time between nodes, takes the path with the shortest travel time as the transportation path between nodes, and records the corresponding transportation distance and transportation time into the information matrix.
[0263] Cost analysis and model building module: Analyze the actual load rate of each route, calculate the vehicle fuel consumption, combine the transportation distance and time, complete the parameter setting of each part of the model cost, and establish an optimization model for the terminal distribution route of fresh agricultural products.
[0264] Optimization solution and scheduling module: Use the Kmeans multi-population evolutionary whale optimization algorithm to solve the fresh agricultural product terminal distribution path optimization model, output the fresh agricultural product terminal distribution path optimization plan, and perform vehicle scheduling and path planning based on the optimization results.
[0265] The computer device may be a server. The computer device includes a processor, a memory, an input / output interface (I / O for short) and a communication interface. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface is connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data cluster data of the power monitoring system. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a method for optimizing the distribution path of fresh agricultural products based on real-time road condition detection is implemented.
[0266] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0267] Example 2, reference Figure 3~Figure 6 ,The following is an embodiment of the present invention, which provides a method for optimizing the delivery path of ,fresh agricultural products based on real-time road condition detection. ,In order to verify the beneficial effects of the present invention, scientific ,demonstration is carried out through experiments.
[0268] The present invention relates to a method for optimizing the terminal delivery path of fresh agricultural products based on real-time road condition detection, which comprises the following steps:
[0269] (1) Obtain the initial information of the terminal fresh agricultural product market and distribution center and construct an information matrix. nodes, then establish The matrix needs to be calculated The best situation between nodes.
[0270] (2) Preliminarily filter the paths between nodes by the distances of each path provided by the navigation system, and find three relatively reasonable paths between nodes. The conditions of each path need to be calculated, and a congestion quantification method is proposed to measure the traffic conditions of each path.
[0271] (3) For the road sections involved in the above path, use YOLOv7 through the method described in step 2 to identify the number of vehicles and lanes recorded by the driving recorders of the moving vehicles, and calculate the congestion index and travel time based on the vehicle speed.
[0272] (4) Compare the travel time of the three paths between each node, take the path with the shortest travel time as the transportation path between the nodes, and record the corresponding transportation distance and transportation time. Information matrix.
[0273] (5) Analyze the actual load rate of each path, calculate the vehicle fuel consumption, and combine the transportation distance and time to complete the parameter setting of each part of the model cost.
[0274] (6) Based on the above information matrix and parameter settings, a terminal distribution path optimization model for fresh agricultural products is established.
[0275] (7) An improved whale optimization algorithm is proposed. The improved algorithm classifies the population through the Kmeans clustering algorithm and combines the multi-population evolution strategy of MEWOA to greatly improve the performance of the algorithm. The model is solved using the Kmeans multi-population evolution whale optimization algorithm (KMEWOA).
[0276] (8) The optimization solution for the terminal delivery route of fresh agricultural products output after the optimization is completed is used to guide vehicle scheduling and route planning.
[0277] First, for the mathematical modeling of the optimization of the terminal distribution path of fresh agricultural products, the following assumptions are made:
[0278] a. The demand quantity, geographical location and time window of each demand point are required to be known, and the goods are delivered once every morning.
[0279] bThe fixed cost of vehicle dispatch is known and only depends on the number of delivery vehicles.
[0280] c. The distance and travel time from the distribution center to each demand point have been calculated in step 4.
[0281] d. The price of cold chain products is calculated using the average price.
[0282] e. The unit price of the commodity is known, and the price of oil is known.
[0283] f. The load capacity of the delivery vehicles is the same.
[0284] The initial information obtained in step (1) includes a supply-demand relationship matrix constructed according to the storage of the distribution center and the demand of the demand points, and a location information matrix established according to the location information of the distribution center and each demand point; and the time required for unloading at each demand point is calculated based on the initial information; in this example, it is assumed that the Nanjing Agricultural and Sideline Products Logistics Center located in Jiangning District, Nanjing City provides distribution services to 10 fresh agricultural product terminal communities in the city. The latitude and longitude coordinates of the Nanjing Agricultural and Sideline Products Logistics Center are (118.895287, 31.994337). The distribution vehicle departs at 7:00. There are three types of distribution vehicles, with maximum load capacities Q of 6, 7, and 8 tons respectively, and a maximum loading volume QV of 8 The fixed cost of each vehicle for each of the three types of vehicles is 200, 250, and 300 respectively. The fuel consumption per unit distance when the vehicle is unloaded is =0.066L / (km*t), the fuel consumption cost per unit distance when fully loaded is =0.218L / (km*t), idle fuel consumption coefficient = 0.15, gasoline price = 8.5 yuan / L, assume that m vehicles start from the selected distribution center, the vehicle speed is 50km / h, the unloading time is proportional to the unloading amount here, the proportional coefficient is 1 / 15, the unit price of cold chain products is 4000 yuan / t, the deterioration rate during transportation is 0.01, the deterioration rate during unloading is 0.03, the refrigeration cost generated by the pre-cooling of the cold chain vehicle is 10 yuan / h, the refrigeration cost generated by the transportation of goods is 20 yuan / h, the refrigeration cost of unloading goods is 25 yuan / h, the energy consumption of the refrigeration equipment is 0.003L / t.km, the unit carbon tax price is 0.04 yuan / kg, and the carbon dioxide emission coefficient is 2.254kg / L. The relevant data of the demand point are shown in Table 2, and the time window of the demand point is shown in Table 3.
[0285] Table 2 Demand point related data
[0286]
[0287] Table 3 Demand point time window
[0288] Demand Points EET ET LT LLT 1 7:30 8:00 8:30 9:00 2 7:00 7:30 8:00 8:30 3 7:00 7:30 8:00 8:30 4 7:15 7:45 8:30 9:00 5 7:00 7:15 7:45 8:30 6 7:15 7:45 8:30 9:00 7 7:00 7:15 7:45 8:30 8 7:30 8:00 8:30 9:00 9 7:00 7:30 8:00 8:30 10 7:00 7:30 8:00 9:00
[0289] The number of vehicles required to complete the delivery task is estimated in advance based on the total demand of each demand point, the load weight of a single transport vehicle in the distribution center, the type and volume of the goods, and the maximum loading volume of the vehicle.
[0290] In this example, the vehicle loading factor is =1, =1, unit cargo volume =0.5, then = =6, = =3, number of delivery vehicles =5.
[0291] Among them, real-time road condition detection is applied to terminal delivery route planning, so that the transportation time can be controlled more accurately and in real time, reducing the time window penalty cost and cargo damage cost. The road congestion detection and quantification scheme in step (2) is as follows: when a vehicle equipped with a specific navigation software is driving on a road section that needs to be detected, the vehicle speed is recorded by the vehicle's driving recorder and the picture to be identified is uploaded. YOLOv7 is used as a vehicle and lane line detection algorithm to detect it, and the average vehicle speed, the number of vehicles and lane lines within the identifiable range are obtained. These three variables are used as the criteria for judging congestion. The three variables are each given a certain weight to calculate the congestion index to determine congestion more scientifically and accurately.
[0292] If there are multiple vehicles equipped with specific navigation software on a road section, the congestion index of different locations on the road section can be obtained. The congestion index obtained by averaging them can more accurately reflect the congestion situation of the entire route. The advantage of this method is that it does not depend on the number of users. Even if only one car owner provides data, it can give a rough judgment on the traffic situation. The more car owners use navigation software, the more accurate the judgment of this method. Compared with the detection only for intersections, it can reflect the congestion situation of the entire road and has a wider range of application.
[0293] The specific method is: the higher the average speed of the vehicles, the smaller the possibility of congestion; the more vehicles detected, the greater the possibility of congestion, and the slower the speed of clearing after congestion; the more lanes, the smaller the possibility of congestion, and the faster the speed of clearing after congestion. Congestion is judged based on the average speed and supplemented by the number of vehicles and lanes.
[0294] According to the above judgment method, the difference between the average speed and the maximum speed limit is used as the basis, and the ratio of the number of vehicles detected in the congested section to the number of lanes is used as an auxiliary to calculate the congestion index. The larger the congestion index, the easier it is to cause congestion, and the smaller the index, the smoother the road. Since the average speed is the basis, the difference between the average speed and the maximum speed limit is assigned a weight of 1; since the number of lanes is calculated based on the total number of lanes in both directions, the ratio of the number of vehicles detected in the congested section to the number of lanes is assigned a weight of 2.
[0295] Among them, the calculation method of the subsequent travel time in the step (3) is as follows: the average speed recorded by the driving recorder in step (2) is the current speed of the road section, and the speed of the transport vehicle passing through the road section after the terminal path planning is completed may be different from the average speed recorded before. In order to better guide the selection of the distribution path, a corresponding relationship between the congestion coefficient and the subsequent predicted travel speed should be established, so as to complete the prediction of the travel time by quantifying the degree of congestion. The author calculated the congestion index by measuring the vehicle speed and identifying the vehicle and lane lines on some sections of Nanjing, and tested the target section again after a period of time. Through the above data, the corresponding relationship between the congestion index and the travel speed is inferred as shown in Table 4, thereby finding the corresponding relationship between the congestion coefficient and the travel time. The travel speed calculation formula is shown in Formula 3.
[0296] Table 4
[0297] Congestion Index Passing speed (0,10] (42,50] (10,18] (33,42] (18,24] (28,33] (24,28] (24,28] (28,50] (0,24]
[0298] According to steps (2) and (3), we first need to preliminarily screen and find out the more reasonable paths between the nodes. Taking the logistics center to demand point 1 as an example, the more reasonable path information between the two points is shown in Table 5.
[0299] Table 5 Transportation plan from logistics center to demand point 1
[0300] plan Transport distance (km) Congestion Index Travel speed (km / h) Estimated transportation time (h) 1 22.7 10.6 41.3 0.55 2 21.4 12.6 39.1 0.58 3 22.5 14.8 36.6 0.62
[0301] Among the above solutions, Solution 1 has the shortest transportation time, and Solution 2 has the shortest transportation distance. The solution selection is based on the actual needs of these two goals. In this example, we discuss the two solutions that only consider the shortest transportation distance and only consider the shortest transportation time, and compare their advantages and disadvantages. To simplify the calculation, it is assumed that the transportation time in different directions of the same transportation route is the same.
[0302] If only the shortest transportation distance is considered, the distribution path from the logistics center to demand point 1 should be plan 2, and its relevant information is recorded in the information matrix. The optimal path between each node considering only the shortest transportation distance is analyzed, and the node transportation distance matrix and the node transportation time matrix are constructed. The matrix is an upper triangular matrix, and node 0 represents the Nanjing agricultural and sideline products logistics center. If the roads between the nodes do not allow cold chain vehicles to pass, the transportation distance and transportation time are marked as inf, as shown in Tables 6 and 7.
[0303] Table 6 Distance matrix of Example 1
[0304] distance 0 1 2 3 4 5 6 7 8 9 10 0 0 21.4 14.2 7.8 18.9 7.1 10.8 22.3 19.8 31.2 12.1 1 0 12.7 29.2 18.6 24.2 10.9 3.9 6.5 28.3 12.9 2 0 21.3 7.9 18.4 4.8 17 7.4 20.1 4.5 3 0 19.8 3.0 16.6 31.4 24.8 33.8 17.1 4 0 17.5 11.0 21.4 12.2 14.8 8.3 5 0 15.4 30.3 22.8 31.3 15.1 6 0 14.2 8.7 24.0 inf 7 0 10.7 31.5 16.4 8 0 21.7 8.6 9 0 20.5 10 0
[0305] Table 7 Example 1 Time Matrix
[0306] time 0 1 2 3 4 5 6 7 8 9 10 0 0 0.58 0.87 0.47 0.87 0.5 0.55 0.85 1.13 1.22 0.72 1 0 0.88 1.02 0.92 1.13 0.58 0.23 0.38 1.02 0.8 2 0 0.95 0.52 1.03 0.45 0.82 0.57 0.85 0.52 3 0 1.2 0.33 0.85 1.18 1.45 1.57 0.98 4 0 1.02 0.65 0.92 0.7 0.52 0.67 5 0 0.75 1.08 1.27 1.3 0.92 6 0 0.72 0.73 0.9 inf 7 0 0.48 1.1 0.9 8 0 0.87 0.97 9 0 1.12 10 0
[0307] If only the shortest transportation time is considered, the distribution path from the logistics center to demand point 1 should be plan 1, and its relevant information is recorded in the information matrix. Analyze the optimal path between each node considering only the shortest transportation distance, and construct the node transportation distance matrix and node transportation time matrix. The matrix is an upper triangular matrix, and node 0 represents the Nanjing agricultural and sideline products logistics center, as shown in Tables 8 and 9.
[0308] Table 8 Distance matrix of Example 2
[0309] distance 0 1 2 3 4 5 6 7 8 9 10 0 0 22.7 17.1 8.1 19.3 7.1 12.8 23.4 23.2 33.7 13.3 1 0 16.0 35.1 22.5 28.5 11.3 3.9 7.3 35.4 13.2 2 0 23.9 8.4 20.6 4.9 17 7.9 23.5 5.1 3 0 39.9 3.0 16.6 41.0 26.1 45.8 23.1 4 0 21.0 11.1 21.4 12.2 14.8 8.3 5 0 15.4 40.6 24.9 47.2 15.7 6 0 14.7 9.6 24.0 inf 7 0 10.7 32.9 16.4 8 0 21.7 11.2 9 0 20.8 10 0
[0310] Table 9 Example 2 Time Matrix
[0311] time 0 1 2 3 4 5 6 7 8 9 10 0 0 0.55 0.8 0.43 0.83 0.5 0.53 0.82 0.97 1.05 0.67 1 0 0.82 0.72 0.85 1.02 0.57 0.23 0.35 0.82 0.78 2 0 0.85 0.48 0.97 0.42 0.82 0.47 0.75 0.48 3 0 0.7 0.33 0.85 0.83 1.3 0.75 0.88 4 0 0.93 0.62 0.92 0.7 0.52 0.67 5 0 0.75 0.88 1.18 0.78 0.85 6 0 0.65 0.67 0.9 inf 7 0 0.48 0.85 0.9 8 0 0.87 0.88 9 0 1.08 10 0
[0312] In order to make the model construction and algorithm calculation easier, an innovative modeling method is used in step (4) to convert the search agent address composed of random variables in the optimization algorithm into a vehicle path matrix. In the past, when solving path optimization problems, people mostly used ant colony algorithms and genetic algorithms. This is because the position updates of such algorithms are easy to correspond to the path access order. The present invention proposes a method that can convert a set of irregular one-dimensional arrays with arbitrary values into a matrix representing the path access order, so that algorithms such as whale optimization can more easily solve path optimization problems. The steps are as follows:
[0313] a. If you need to solve Car pair The distribution problem of each demand point, then the input contains One-dimensional array of numbers .
[0314] In this example =10, =5, then assuming that the random whale individual =(25, 43, 8, 66, 5, 99, 25, 34, 67, 66, 12, 83, 91, 69).
[0315] b.Yes Sort and store the results in array A. Remain unchanged.
[0316] but =(5, 8, 12, 25, 25, 34, 43, 66, 66, 67, 69, 83, 91, 99).
[0317] c. Traverse the array and with the array Compare and output the elements in The position in the array middle.
[0318] but =(4, 7, 2, 8, 1, 14, 4, 6, 10, 8, 3, 12, 13, 11).
[0319] d. Define a set of all 0s For array ,set up for Middle elements, Assign to ,make As an array Index of , traverse the array , do the following:
[0320] (18)
[0321] This removed Repeat the elements from 1 to Strictly arranged.
[0322] at this time =(4, 7, 2, 8, 1, 14, 5, 6, 10, 9, 3, 12, 13, 11).
[0323] e. The array Medium to large The element value is changed to , used to separate the front and rear, indicating the next transport vehicle, less than The elements of are the demand points, so Divide Each part represents a car, and the order of visiting demand points is from front to back. It means the access order of 6 vehicles is: Vehicle 1: 0-4-7-2-8-1-0; Vehicle 2: 0-5-6-10-9-3-0; Vehicle 3: 0-0; Vehicle 4: 0--0; Vehicle 5: 0-0; among them, vehicles 3, 4, and 5 are not delivered.
[0324] f. Traverse the matrix , enter its information into the three-dimensional path access order matrix middle.
[0325] Among them, step (5) dynamically analyzes the actual load rate of each path, which improves the shortcoming of most models that fuel consumption is only related to the transportation distance, so that the vehicle transportation cost and carbon emission cost can be calculated more accurately.
[0326] Load Matrix , actual load rate The calculation steps of fuel consumption are as follows:
[0327] a. Traverse the array in reverse order And refer to the access order matrix , the demand of each demand point is accumulated to the corresponding path in turn and recorded in the matrix middle.
[0328] b. Calculate the actual load rate according to formula (5).
[0329] c. Calculate the fuel consumption according to formula (6).
[0330] By substituting the congestion index, actual load rate and fuel consumption into the model, it is possible to more accurately calculate vehicle transportation costs and carbon emission costs, making the model closer to actual conditions.
[0331] Among them, the present invention comprehensively considers multiple factors such as refrigeration, cargo damage, carbon emissions, time windows, road restrictions, etc., fully analyzes the impact of load capacity, traffic conditions and different vehicle models on the total cost, and constructs a mathematical model for optimizing the terminal distribution path of fresh agricultural products in step (6).
[0332] In summary, the terminal distribution path optimization model of this scheme aims to minimize the total cost, including vehicle fixed cost, transportation cost, cargo damage cost, refrigeration cost, time window cost, carbon emission cost and overload penalty cost. Since most previous researchers only estimated the overall situation of traffic congestion on the transportation path, it is difficult to accurately predict the impact on transportation time. Therefore, the present invention establishes a quantification method for the congestion index and establishes a corresponding relationship between the congestion index and the travel time, so that the vehicle transportation time t is closer to the actual situation and the cargo damage cost and refrigeration cost calculation are more accurate.
[0333] Among them, step (7) proposes an improved whale optimization algorithm. By using the Kmeans clustering algorithm to classify the whale population, in order to balance the two behaviors of global search and local utilization, the population is classified into three sub-populations of equal size, and each population moves according to different strategies; at the same time, the multi-population evolution strategy in MEWOA is introduced. After each position update, each population will evolve in the next iteration, thereby improving population diversity and convergence speed and eliminating local optimality. In addition, the linear movement in the random search process is changed to the movement of sine and cosine functions, making the individual movement of random search more flexible and conducive to global search.
[0334] The movement strategy of the Kmeans multi-group whale optimization algorithm is as follows:
[0335] (1) Movement strategy of the exploratory subpopulation
[0336] Individuals in the exploration subpopulation are far away from the local optimal solution due to poor fitness. Therefore, it is necessary to make individuals in the exploratory subpopulation committed to global exploration to explore new areas and find new solutions. The movement strategy of the KMWOA exploration subpopulation is sine-cosine random search.
[0337] (2) Developing a subpopulation movement strategy
[0338] When an individual approaches the current optimal solution, it searches the area around it. This behavior is called local search, which can improve the convergence speed and solution accuracy. Since the fitness of the development sub-population is close to the current optimal solution, the development sub-population needs to concentrate its energy on local development to improve the convergence speed and solution accuracy. Therefore, the development phase of WOA is used to implement the mobile strategy of the development sub-population.
[0339] (3) Movement strategy of the moderate subpopulation
[0340] The fitness of the moderate subpopulation is between good and bad. Therefore, individuals in the moderate subpopulation either explore to find new solutions or locally exploit to increase the convergence rate, thereby achieving a stochastic balance between exploration and exploitation. The movement strategy of the moderate subpopulation is given in formula (22).
[0341] The evolutionary strategies of each subpopulation are as follows:
[0342] (1) Population evolution of exploratory subpopulations
[0343] Individuals in the exploratory subpopulation expand the search range by increasing the absolute value of the position vector to enhance the global exploration ability. Formula (24) gives the evolution process of the exploratory subpopulation.
[0344] (2) Population evolution of development subpopulations
[0345] Individuals in the exploiting subpopulation evolve their positions by performing deep local search around the current optimal solution, see formula (26).
[0346] (3) Population evolution of fit subpopulations
[0347] OBL is often used to improve the performance of metaheuristic algorithms, and it can help increase the diversity of the population. Therefore, we let the individuals in the moderate subpopulation evolve their positions based on OBL, as shown in Equation (28).
[0348] A set of 23 commonly used benchmark functions provided by the International Conference on Evolutionary Computation (CEC) was used for testing, among which the first 7 benchmark functions are single-mode benchmark functions, the 8th to 13th are multi-modal benchmark functions, and the rest are composite benchmark functions. To prove the effectiveness of the Kmeans multi-population whale optimization algorithm (KMWOA), 9 commonly used heuristic algorithms were used for comparison in multiple dimensions. These 9 algorithms are multiverse algorithm (MVO), ant lion algorithm (ALO), sine cosine algorithm (SCA), grey wolf algorithm (GWO), whale optimization algorithm (WOA), Bayesian optimization (BO), moth-to-flame optimization algorithm (MFO), raccoon algae optimization algorithm (WWPA) and multi-population evolutionary whale optimization algorithm (MEWOA).
[0349] The CEC2005 test set was used for testing. The test function is shown in Table 10, and the corresponding parameters of the tested algorithm are shown in Table 11, where maxiter represents the maximum number of iterations. In the iteration, t represents the current number of iterations; S represents the population size, a represents a constant used to calculate the individual update direction; b represents a constant used to define the shape of the spiral; P represents the weight; WEP_Max represents the maximum wormhole survival rate, and WEP_Min represents the minimum wormhole survival rate; power_exponent represents the balance parameter used to control the exploration and utilization in Bayesian optimization, Population_size represents the number of subpopulations, and sensory_modality represents the weight of a specific modality in multimodal optimization.
[0350] The test results are shown in Table 12. F1~F23 are the function formulas corresponding to each other from top to bottom in Table 10. The test iteration process is shown in the attached figure. Figure 3 As shown in the figure, compared with traditional optimization algorithms, the improved whale optimization algorithm (KMEWOA) has a certain improvement in high-dimensional accuracy. For complex functions, the algorithm can effectively avoid falling into local optimality, and its convergence speed is faster than other optimization algorithms. Applying it to the optimization problem of terminal distribution paths of fresh agricultural products can effectively avoid the shortcomings of slow convergence speed and low convergence accuracy.
[0351] Table 10 Algorithm test function
[0352] ,
[0353] ,
[0354] ,
[0355]
[0356] Table 11 Parameters of each test algorithm
[0357] MVO ALO SCA GWO WOA BO MFO WWPA MEWOA KMWOA maxiter=500 maxiter=500 maxiter=500 maxiter=500 maxiter=500 maxiter=500 maxiter=500 maxiter=500 maxiter=500 maxiter=500 S=30 S=30 S=30 S=30 S=30 S=30 S=30 S=30 S=30 S=30 WEP_Max=1 a=2 b=1 P=0.8 b=1 b=1 b=1 WEP_Min=0.2 power_exponent=0.1 Population_size=3 Population_size=3 sensory_modality=0.01
[0358] Table 12 Algorithm test results
[0359] function MVO ALO SCA GWO WOA BO MFO WWPA MEWOA KMWOA F1 0.017612 3.9114e-09 1.4256e-14 3.1392e-59 1.9242e-79 1.0257e-11 5.7437e-15 0.0777 0 0 F2 0.024897 7.3665e-05 1.0032e-09 4.4412e-34 2.0007e-56 4.8177e-09 4.9394e-09 3.7243 0 0 F3 0.1099 0.087383 0.00029068 1.933e-26 10.1335 9.0428e-12 0.078656 0.074931 0 0 F4 0.12984 0.00058468 0.00062396 7.165e-19 11.3413 5.7911e-09 0.011847 0.049416 0 0 F5 8.5905 8.9966 7.9986 6.6252 7.0061 8.9619 1.2021 17.8363 8.6343 1.2956e-05 F6 0.017253 4.4799e-09 0.40858 2.6149e-06 0.00053237 1.1455 8.7883e-14 0.069809 1.6752e-06 9.4372e-11 F7 0.0022686 0.073799 0.00058309 0.0011264 0.00077974 0.0015473 0.009161 1.1283 0.00025204 5.9648e-06 F8 -2886.8618 -2162.4056 -1947.1403 -3714.1998 -3111.758 -2624.8587 -3474.6477 -2162.4056 -3005.4296 -4189.7262 F9 13.9371 20.894 7.1054e-13 1.4211e-14 0 40.6932 12.9345 1.9165 0 0 F10 0.059309 1.1551 3.816e-08 7.9936e-15 4.4409e-15 2.6814e-09 5.3264e-07 3.262 8.8818e-16 8.8818e-16 F11 0.44161 0.18214 0.3219 0.018302 0 1.7486e-13 0.12546 0.14994 0 0 F12 0.00070289 4.235 0.18789 0.020243 0.0012832 0.13345 0.31101 0.15365 8.8269e-07 5.8079e-07 F13 0.0038227 3.0101e-07 0.17426 5.3709e-06 0.089085 0.33211 0.010987 0.36371 0.9 3.1687e-10 F14 0.998 0.998 0.99876 0.998 0.998 1.001 4.9505 0.998 12.6705 0.998 F15 0.020363 0.00081366 0.0015276 0.020363 0.00046698 0.00040252 0.0016554 0.0023468 0.0003657 0.00034253 F16 -1.0316 -1.0316 -1.0316 -1.0316 -1.0316 -1.0316 -1.0316 0.74577 -1.0175 -1.0316 F17 0.39789 0.39789 0.39983 0.39789 0.39789 0.40003 0.39789 0.78127 0.40243 0.39789 F18 3 3 3.0001 3 3.0001 3.0051 3 6.4173 30.123 3.0188 F19 -3.8628 -3.8628 -3.8477 -3.8625 -3.8619 -4.0802 -3.8628 -3.0883 -3.4434 -3.858 F20 -3.2018 -3.322 -2.9931 -3.1418 -3.321 -3.4035 -3.2031 -1.6576 -1.5798 -1.9372 F21 -10.1524 -2.6305 -0.87896 -10.1525 -5.0552 -3.8026 -10.1532 -3.3865 -5.0552 -10.1532 F22 -10.4026 -5.0877 -4.6574 -10.4014 -5.0876 -3.9709 -5.0877 -3.3605 -5.0876 -10.4026 F23 -10.5356 -5.1756 -4.0191 -10.5356 -5.1284 -4.6149 -10.5364 -4.8452 -10.5362 -10.5364
[0360] The specific method of optimizing the terminal delivery route of fresh agricultural products in step (8) is as follows:
[0361] a. First, obtain the initial information matrix and find available delivery paths.
[0362] b. Return real-time detected road condition information and identify vehicles and lane lines.
[0363] c. Calculate the congestion index.
[0364] d. Use the congestion index to calculate travel time.
[0365] d. Generate path access sequence.
[0366] e. Calculate the load matrix and fuel consumption of each path through the path access sequence.
[0367] f. Substitute the above data into the mathematical model.
[0368] g. Set this model as the objective function and use the relevant information given at the beginning to initialize the optimization algorithm, including the scope of the solution space, the number of search agents, the number of initial populations, and the number of iterations. Use the Kmeans multi-population whale optimization algorithm to solve the problem. After a certain number of iterations, output the optimized delivery path and minimum cost, and use this result to guide the terminal delivery of fresh agricultural products. The iterations of each algorithm in Example 1 and Example 2 are shown in the attached figure. Figure 3 , Attachment Figure 4 As shown; the distribution plan output by KMEWOA algorithm in Example 1 and Example 2 is shown in the attached Figure 5 , Attachment Figure 6 As shown, attached Figure 5 and attached Figure 6 The horizontal axis represents longitude, the vertical axis represents latitude, and the five colored segments represent five different vehicles respectively. The output data of Example 1 is shown in Table 13, and the output data of Example 2 is shown in Table 14. KMEWOA not only converges faster than other traditional algorithms, but also has higher accuracy than other algorithms. It can be well applied in the location selection problem of cold chain logistics distribution center.
[0369] Table 13 Test results of Example 1
[0370] Algorithm Name Vehicle path sequence Shipping costs Total Cost MVO 0-9-8-0,0-7-1-0,0-3-2-0,0-5-10-0,0-6-4-0 125.358242857143 3737.2472 ALO 0-7-3-0,0-1-2-0,0-9-8-0,0-4-6-0,0-5-10-0 141.560942857143 3760.8238 SCA 0-1-6-0,0-7-2-0,0-3-4-0,0-9-8-0,0-5-10-0 137.629814285714 3805.8662 WOA 0-1-2-0,0-3-9-0,0-7-8-0,0-5-10-0,0-4-6-0 142.406085714286 3782.4866 MEWOA 0-3-5-0,0-4-6-0,0-7-1-0,0-2-8-0,0-9-10-0 132.192000000000 3855.6119 KMEWOA 0-7-1-0,0-6-4-0,0-5-10-0,0-3-8-0,0-2-9-0 135.024928571429 3714.4205
[0371] Table 14 Test results of Example 2
[0372] Algorithm Name Vehicle path sequence Shipping costs Total Cost MVO 0-9-2-0,0-5-10-0,0-7-1-0,0-6-4-0,0-3-8-0 134.875571428571 3667.4481 ALO 0-1-2-0,0-7-3-0,0-9-8-0,0-5-10-0,0-6-4-0 146.701257142857 3693.4983 SCA 0-1-2-0,0-3-10-0,0-4-6-0,0-9-8-0,0-7-5-0 171.905214285714 3732.1216 WOA 0-5-10-0,0-6-4-0,0-9-8-0,0-3-2-0,0-7-1-0 137.107914285714 3683.7111 MEWOA 0-6-4-0,0-7-8-0,0-1-2-0,0-3-9-0,0-5-10-0 145.323528571429 3694.8273 KMEWOA 0-7-1-0,0-2-8-0,0-3-9-0,0-5-10-0,0-6-4-0 126.511814285714 3655.1618
[0373] By comparison, we can see that the minimum total cost of the solutions obtained by each algorithm in Example 2 is better than that obtained by each algorithm in Example 1. Moreover, since the path selection in Example 2 is based on the transportation time, the solution is easier to meet the time window constraint and it is easier to obtain a feasible solution. The cost comparison of each algorithm solution in Example 1 and Example 2 is shown in Table 15, and the solution with lower cost is bolded.
[0374] Table 15 Instance cost comparison
[0375]
[0376] Table 15 shows that the carbon emission cost and transportation cost of each scheme in Example 1 are lower, and the cargo damage cost, refrigeration cost and time window cost of Example 2 are lower. Since cargo damage cost and refrigeration cost account for most of the total cost in cold chain logistics transportation, and these two costs are closely related to transportation time, the total cost of the scheme in Example 2 is significantly lower than that of the scheme in Example 1. Therefore, in cold chain logistics transportation, we should not only care about the distance of transportation, but also reduce the transportation time. Therefore, it is very necessary to use road condition detection and congestion quantification technology in cold chain logistics terminal transportation.
[0377] From the above examples, it can be seen that the method for optimizing the terminal delivery path of fresh agricultural products based on real-time road condition detection in the present invention has certain scientificity. Through this method, the expenses of enterprises in optimizing the terminal delivery path of fresh agricultural products can be reduced, the service quality of logistics can be improved, and the transportation costs of enterprises can be reduced.
[0378] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.
Claims
1. A method for optimizing the distribution path of fresh agricultural products based on real-time road condition detection, characterized in that: include: Obtain initial information about distribution centers and demand points; Preliminarily screen the paths between nodes and detect their traffic conditions. When a vehicle is traveling on a road section that needs to be detected, the vehicle speed is recorded by the vehicle's driving recorder and the image to be identified is uploaded. YOLOv7 is used as the vehicle and lane detection algorithm to detect the vehicle, and the average vehicle speed, the number of vehicles and lanes within the identifiable range are obtained. These are used as the criteria for judging congestion, and weights are assigned to calculate the congestion index. The congestion index is calculated based on the difference between the average speed and the maximum speed limit, and the ratio of the number of vehicles detected on the congested road section to the number of lanes. The difference between the average speed and the maximum speed limit is assigned a weight of 1, and the ratio of the number of vehicles detected on the congested road section to the number of lanes is assigned a weight of 2. The calculation formula is: , Among them, CI represents the congestion index, LS represents the maximum speed limit, AS represents the average speed, NL represents the number of lanes, and NV represents the number of vehicles detected in the congested section; The travel time is calculated as follows: , Where V represents the predicted speed, L v Indicates the length of the interval where the average speed is detected, ν lb Indicates the lower speed limit of the detection average speed interval, L CI Indicates the length of the congestion index interval, CI ub Indicates the upper limit congestion index of the congestion index interval; Compare the travel time between the nodes, take the path with the shortest travel time as the transportation path between the nodes, and record the corresponding transportation distance and transportation time into the information matrix; Analyze the actual load rate of each route, calculate the vehicle fuel consumption, combine the transportation distance and time, complete the parameter setting of each part of the model cost, and establish the terminal distribution route optimization model of fresh agricultural products; The Kmeans multi-population evolutionary whale optimization algorithm is used to solve the fresh agricultural product terminal delivery path optimization model, and the Kmeans clustering algorithm is used to classify the whale population. The population is classified into three sub-populations of the same size, and each population moves according to different strategies. At the same time, the multi-population evolution strategy in MEWOA is introduced. After each position update, each population will evolve in the next iteration, and the fresh agricultural product terminal delivery path optimization plan is output. Vehicle scheduling and path planning are performed based on the optimization results.
2. The method for optimizing the distribution path of fresh agricultural products based on real-time road condition detection according to claim 1, characterized in that: The obtaining of the initial information of the distribution center and each demand point includes constructing a supply-demand relationship matrix according to the storage of the distribution center and the demand of the demand point, and establishing a location information matrix according to the location information of the distribution center and each demand point; Calculate the time required to unload at each demand point based on initial information; The number of vehicles required to complete the delivery task is estimated in advance based on the total demand of each demand point, the load weight of a single transport vehicle in the distribution center, the type and volume of the goods, and the maximum loading volume of the vehicle. The calculation formula is: , m=max(m1,m2), Among them, m1 represents the number of vehicles estimated from the weight of the goods, m2 represents the number of vehicles estimated from the volume of the goods, and m represents the number of vehicles required to complete the delivery task; represents the rounding function; n represents the total number of demand points; g i represents the demand at demand point i; f represents the volume occupied by the unit weight of goods, and its value is determined by the type of goods; Q V It represents the cargo volume that can be loaded in a single vehicle compartment, Q represents the maximum load of the vehicle; λ1 represents the vehicle loading factor of m1, and λ2 represents the vehicle loading factor of m2.
3. The method for optimizing the distribution path of fresh agricultural products based on real-time road condition detection according to claim 2, characterized in that: Recording the corresponding transportation distance and transportation time into the information matrix includes: if the problem of distribution of m vehicles to n demand points is to be solved, then a one-dimensional array x containing n+m-1 numbers is input; Sort x and store the result in array A, while array x remains unchanged; Traverse array x and compare it with array A, output the position of the elements in A and store them in array B; Define an array C of n+m-1 with all zeros, let Bi be the i-th element in B, Ch be the h-th element in C, assign Bi to h, make h the index of array C, traverse array B, and perform the following operations: Ball * =Bi+Ch, Ch * =Ch+1, Among them, Bi * Indicates the updated value of Bi, Ch * Indicates the updated value of Ch; Thus, duplicate elements in B are removed, so that it is arranged from 1 to n+m-1; Change the value of the element in array B that is greater than n+1 to n+1 to separate the front and back elements, indicating the next transport vehicle. The elements that are less than n+1 are the demand points. Divide B into m parts, each part represents a vehicle, and the order from front to back is the order of visiting the demand points. Traverse the matrix B and enter its information into the three-dimensional path access order matrix s.
4. The method for optimizing the distribution path of fresh agricultural products based on real-time road condition detection according to claim 3, characterized in that: The analysis of the actual load rate of each path includes traversing the array B in reverse order and referring to the access order matrix s, accumulating the demand of each demand point to the corresponding path in turn and recording it in the three-dimensional matrix p; Calculate the actual load rate U: U=p i,j,k / Q, Among them, p i,j,k represents the actual load of vehicle k on the transportation path from demand point i to demand point j; Calculate the fuel consumption C': C′=d i,j [e1+p i,j,k (e2-e1) / Q], Among them, d i,j represents the transportation distance from demand point i to demand point j; e1 represents the fuel consumption per unit distance when the vehicle is unloaded; e2 represents the fuel consumption per unit distance when the vehicle is fully loaded; Substitute the congestion index, actual load factor and fuel consumption into the model.
5. The method for optimizing the distribution path of fresh agricultural products based on real-time road condition detection according to claim 4, characterized in that: The establishment of the optimization model for the terminal delivery route of fresh agricultural products includes: if the number of demand points is n, the initial predicted number of delivery vehicles is m, then the vehicle fixed cost C1 calculation formula is: , Among them, F k represents the sum of the driver's salary, vehicle depreciation and maintenance costs for one trip of the k-th vehicle of the corresponding model; n+1,k Represents the matrix of the kth vehicle at the distribution center; the row index 1 to n of the matrix y represents the corresponding n demand points, the row index n+1 represents the matrix index of the distribution center, and the column index 1 to k represents the corresponding m distribution vehicles. The values of the matrix y are: , The total shipping cost is calculated as: Multiply the distribution cost of each road section by the coefficient α. When vehicle k can pass, α=1, otherwise α=inf, where inf is an infinite positive number. Assuming the unit oil price is a, the total transportation cost C2 is: , Among them, α i,j,k represents the traffic coefficient of vehicle k from location i to location j; s i,j,k Used to record the vehicle's driving trajectory. The specific values are as follows: , The calculation formula for cargo damage cost C3 is: , where p3 represents the unit price of the commodity, q1 represents the deterioration rate of the commodity during transportation, q2 represents the deterioration rate of the commodity during unloading, 1 to n represent the demand points, and t i,j represents the transportation time of the vehicle from point i to point j, T j represents the time taken by the vehicle to unload at demand point j; The cooling cost is calculated as: Precooling time T pre The assignment method is as follows: Frozen goods: When the set temperature is -20℃ and the ambient temperature is >30℃, T pre =2h; 30℃>ambient temperature>20℃, T pre =1.5h; when the ambient temperature is <20℃, T pre =1h; Refrigerated goods: Set temperature to 4°C, ambient temperature>30°C, T pre =1.5h; 30℃>ambient temperature>20℃, T pre =1h; when the ambient temperature is <20℃, T pre =2 / 3h; During the vehicle precooling process, the refrigeration cost of the cold chain vehicle per unit time is p 41 During the transportation process, the refrigeration cost of the cold chain vehicle in transporting products per unit time is p 42 ; During the unloading process, the refrigeration cost incurred by the cold chain vehicle in unloading the goods per unit time is p 43 ; β represents the impact of temperature on refrigeration energy consumption, and the refrigeration cost C4 is: , the time window cost is calculated as: Assume ti is the time when the vehicle arrives at demand point i, pw is the waiting cost per unit time of the vehicle, pl is the late cost per unit time of the vehicle, (ETi, LTi) is the expected time window of demand point i, ETi is the lower limit of the time window expected by demand point i, LTi is the upper limit of the time window expected by demand point i, (EETi, LLTi) is the time window that demand point i can accept, EETi is the lower limit of the time window that demand point i can accept, LLTi is the upper limit of the time window that demand point i can accept; then the penalty cost C5(i) at demand point i is: , There are n demand points in total, so the total penalty cost C5 is: , The calculation method of carbon emission cost C6 is: Let p c represents the unit carbon tax price, e r represents the carbon dioxide emission coefficient, E represents the energy consumption per unit time of the refrigeration equipment, and the calculation formula is: , the overload penalty cost C7 is calculated as: , Where M represents the overload penalty coefficient, p k-max Indicates the maximum load of the vehicle during transportation; The fresh agricultural product terminal delivery route optimization model aims to minimize the total cost, including vehicle fixed cost, transportation cost, cargo damage cost, refrigeration cost, time window cost, carbon emission cost and overload penalty cost; Each demand point completes the goods delivery at one time without repeated visits. The constraints are as follows: , The number of vehicles returning to the distribution center is equal to the m vehicles dispatched for delivery, subject to the following constraints: , The matrix y can be calculated from the matrix s, and the relationship is as follows: , The variables in the matrix y all satisfy the 0-1 constraints, including: and i,j,k (and i,j,k-1 )=0, The terminal distribution path optimization model of fresh agricultural products is expressed as: minC=C1+C2+C3+C4+C5+C6+C7.
6. The method for optimizing the distribution path of fresh agricultural products based on real-time road condition detection according to claim 5, characterized in that: The movement strategies of Kmeans multi-population whale optimization algorithm include the movement strategy of exploratory sub-population, the migration strategy of development sub-population and the movement strategy of moderate sub-population; The movement strategy of the exploratory subpopulation includes: the movement strategy of the KMWOA exploratory subpopulation is a sine-cosine random search, and the formula is: , where X(t) is the current position of the individual, X(t+1) is the position of the individual after the next iteration, r3, r4, r5, and p3 represent random numbers that obey uniform distribution, where r4 belongs to [0,2], r5 belongs to [0,2], r3 and p3 belong to [0,1], and r3*sinr4 and r3*cosr4 range from [-1,1]. The current individual will move towards the random individual X rand (t) Approach and conduct a global search; The migration strategy of the development sub-population includes implementing the mobile strategy of the development sub-population using the development phase of WOA, and the formula is: D L =|G*X * (t)-X(t)|, , Among them, X * (t) represents the optimal solution position, D L represents the distance between the current individual and the optimal individual, H, G, b, l all represent the relevant parameters of spiral approach in the whale optimization algorithm, and e represents the natural logarithm; The movement strategy of the moderate subpopulation includes the formula: , to carry out population evolution of exploratory subpopulations, the formula is: r1=rand[0,1]+1, X(t+1)=X(t)*r 1, Among them, r1 represents a random number between [1,2]; The population evolution of the development sub-population is carried out with the formula: r2=2*rand[0,1], X(t+1)=X(t)*r 2, Among them, r2 represents a random number, whose value is between [0,2]; Perform population evolution of the moderate sub-population and let the individuals in the moderate sub-population evolve their positions based on OBL. The formula is: , Among them, lb represents the lower boundary of the problem space, ub represents the upper boundary of the problem space; fit represents the objective function, Indicates the new position based on the OBL.
7. A fresh agricultural product distribution route optimization system based on real-time road condition detection using the method according to any one of claims 1 to 6, characterized in that: Initial information acquisition module: obtain the initial information of the distribution center and each demand point; Path screening and measurement module: preliminarily screens the paths between nodes and detects their traffic conditions. YOLOv7 algorithm is used to identify the number of vehicles and lanes in each path, and the congestion index and travel time of each path are calculated based on the vehicle speed. Optimal path determination module: compares the travel time between nodes, takes the path with the shortest travel time as the transportation path between nodes, and records the corresponding transportation distance and transportation time into the information matrix; Cost analysis and model building module: Analyze the actual load rate of each route, calculate the vehicle fuel consumption, combine the transportation distance and time, complete the parameter setting of each part of the model cost, and establish the terminal distribution route optimization model of fresh agricultural products; Optimization solution and scheduling module: Use the Kmeans multi-population evolutionary whale optimization algorithm to solve the fresh agricultural product terminal delivery path optimization model, use the Kmeans clustering algorithm to classify the whale population, and classify the population into three sub-populations of the same size. Each population moves according to different strategies; at the same time, the multi-population evolution strategy in MEWOA is introduced. After each position update, each population will evolve in the next iteration, output the fresh agricultural product terminal delivery path optimization plan, and perform vehicle scheduling and path planning based on the optimization results.
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 the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Multi-expert united belief rule base complex system health state assessment method
CN118916653A