A crowdsourcing vehicle-cargo matching method and its path optimization method
Through the improved Sparrow search algorithm, vehicle-cargo matching and path optimization are realized in the logistics industry, which solves the problems of increased vehicle travel distance and low truck utilization in the existing technology, and improves logistics efficiency and platform profits.
Patent Information
- Application Number
- CN202110388598.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-04-12
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2041-04-12
AI Technical Summary
Existing technologies fail to effectively solve the problems of crowdsourcing vehicle-cargo matching and route optimization in the logistics industry, resulting in increased vehicle distances, low truck utilization, and reduced platform profits.
The improved Sparrow search algorithm is used to calculate the cost function from the perspective of the driver and cargo to find the optimal matching sequence to achieve vehicle-cargo matching, and based on the matching results, path optimization is performed to reduce vehicle travel distance.
It improves the vehicle route optimization effect, reduces vehicle travel distance, improves truck utilization, and increases platform profits.
Smart Images

Figure CN112884253B
Abstract
Description
Technical Field
[0001] The present invention relates to a vehicle-cargo matching method and a path optimization method thereof in a crowdsourcing situation, and specifically relates to improving a sparrow search algorithm and optimizing its search performance, thereby realizing crowdsourcing vehicle-cargo matching operations and subsequent path optimization. Background Art
[0002] With the construction of network infrastructure in China, the Internet has become an inseparable part of people's lives. Various applications based on mobile Internet have sprung up like mushrooms after rain. Network technology has deeply transformed all aspects of traditional industries. Similarly, network technology has opened up a new world for the logistics industry. How to give full play to the advantages of information network technology, integrate idle transportation resources, and improve logistics efficiency has become an urgent need of the logistics industry.
[0003] Crowdsourcing is the integration of idle resources in society to carry out certain businesses. For example, Didi Taxi and Meituan’s crowdsourcing riders are good applications. Crowdsourcing generally has the following two characteristics: 1. There is a platform that matches the demand side and the supply side, and dispatches orders to the supply side; 2. The people who provide services on the supply side are not full-time employees, and they get income according to the number of orders completed.
[0004] Crowdsourcing in the logistics industry requires a system that can match shippers and drivers and plan routes for drivers. In this application scenario, there is a distribution center in a city, and the goods shipped from the city need to be transported to the distribution center for unified processing. Generally, shippers are randomly scattered in the city, and drivers are also randomly scattered in the city. The distribution pattern of drivers and shippers is uncertain.
[0005] In such a scenario, the cargo of the shipper needs to be transported to the distribution center for processing. Each shipper and driver has two numbers as coordinates, and the distance between drivers, between cargo and cargo, and between cargo and drivers is measured using Euclidean distance. Each shipper has a certain weight of cargo, and different drivers may have different trucks, so different drivers have different load limits. Whether the total weight of the cargo exceeds the sum of the loads of all drivers or is less than the sum of the loads of the drivers, it is necessary to improve the utilization rate of trucks. Improving the utilization rate of trucks can meet as many transportation needs as possible when there is a lot of cargo, reduce the number of trucks mobilized when there is less cargo, increase the profit of the platform, and reduce the total distance traveled by all drivers.
[0006] However, there is still no suitable algorithm or system in the industry that can be effectively applied to the above scenarios to achieve the corresponding technical effects. Summary of the invention
[0007] A brief summary of one or more aspects is given below to provide a basic understanding of these aspects. This summary is not an exhaustive overview of all conceived aspects, and is neither intended to identify the key or critical elements of all aspects nor to define the scope of any or all aspects. Its only purpose is to give some concepts of one or more aspects in a simplified form as a prelude to a more detailed description that will be given later.
[0008] The purpose of the present invention is to solve the above problems and provide a crowdsourcing vehicle-cargo matching method and a path optimization method thereof, so as to improve the effect of vehicle path optimization and reduce the final vehicle driving distance.
[0009] The technical solution of the present invention is: the present invention discloses a crowdsourcing vehicle-cargo matching method, the method comprising:
[0010] Step 1: Obtain vehicle driver information and cargo information;
[0011] Step 2: Determine whether the current vehicle is capable of transporting all the goods. If it is capable, proceed to step 3; if not, proceed to step 4;
[0012] Step 3: For a matching sequence, match the goods from the perspective of the driver, select the calculation method of the cost function, and then execute step 5;
[0013] Step 4: For a matching sequence, match the driver from the perspective of the goods, select the calculation method of the cost function, and then execute step 5;
[0014] Step 5: Use a combination optimization algorithm based on sparrow search to solve the cost function and obtain the optimal matching sequence corresponding to the minimum value of the cost function. This sequence corresponds to the optimal vehicle-cargo matching result.
[0015] According to an embodiment of the crowdsourcing vehicle-cargo matching method of the present invention, in step 2, whether the vehicle is capable of transporting all the cargo is determined by comparing the vehicle load and the total mass of the cargo. If the vehicle load is greater than the total mass of the cargo, it is considered that it is capable of transporting the cargo; if the vehicle load is less than the total mass of the cargo, it is considered that it is not capable of transporting the cargo.
[0016] According to an embodiment of the crowdsourcing vehicle-cargo matching method of the present invention, in step 3, the cost function is selected as: matching cargo from the perspective of the driver, calculating the intra-class distance of all drivers, and then calculating the average intra-class distance as the cost function; in step 4, the cost function is selected as: matching drivers from the perspective of cargo, calculating the intra-class distance of all drivers, and then calculating the average intra-class distance as the cost function.
[0017] According to an embodiment of the crowdsourcing vehicle-cargo matching method of the present invention, in step 5, the vehicle-cargo matching process is a process of finding an optimal matching sequence in a combinatorial optimization algorithm, wherein each matching sequence uniquely corresponds to a vehicle-cargo matching result.
[0018] According to an embodiment of the crowdsourcing vehicle-cargo matching method of the present invention, the combined optimization algorithm based on sparrow search in step 5 further includes:
[0019] Step 501: Determine parameters: producer ratio, probability of encountering danger, and alarm individual ratio;
[0020] Step 502: Set the sparrow population size, number of iterations, and dimension;
[0021] Step 503: Initialize the population;
[0022] Step 504: Initialize the cost function list, calculate the cost function value for each individual in the population to form a cost list, sort the population in ascending order according to the cost function list, and sort the cost function list in ascending order;
[0023] Step 505: Producers are generated by combining random competition with elite preservation;
[0024] Step 506: The producer forages to determine whether the population is in danger. If so, a random exchange is performed; if not, a neighbor exchange is performed. The values in the corresponding cost function list, the current optimal individual value, and the current minimum cost function value are updated.
[0025] Step 507: The follower forages and traverses the remaining individuals in the population. If the follower's rank is within the first range of the population, a first random number between 0 and 1 is generated, and a crossover operation between the current best individual and the current individual with a ratio of the first random number is performed. If the follower's rank is within the second range of the population, two random exchanges are performed. After each traversal, the value in the corresponding cost function list, the current best individual value, and the current minimum cost function value are updated.
[0026] Step 508: Randomly select an individual from the population as an alarm, traverse all alarms, and if the alarm is ranked in the first range of the population, perform two random exchange operations. If the alarm is ranked in the second range of the population, generate a second random number between 0.5 and 1, and perform a crossover operation between the current best individual and the current individual with a ratio of the second random number. After each traversal, update the value in the corresponding cost function list, the current best individual value, and the current minimum cost function value;
[0027] Step 509: sort the population in ascending order according to the cost function list, sort the cost function list in ascending order, and if the current minimum cost function value is less than the global minimum cost function value, update the global optimal individual to the current optimal individual and the global minimum cost function value to the current minimum cost function value;
[0028] Step 510: Determine whether the number of iterations reaches the number of iterations set in step 502. If not, jump to step 504. If reached, jump to step 511.
[0029] Step 511: The algorithm ends and the final global optimal individual and global minimum cost function are output.
[0030] The present invention also discloses a crowdsourcing vehicle-cargo matching and path optimization method, the method comprising:
[0031] Step 1: Obtain vehicle driver information and cargo information;
[0032] Step 2: Determine whether the current vehicle is capable of transporting all the goods. If it is capable, proceed to step 3; if not, proceed to step 4;
[0033] Step 3: For a matching sequence, match the goods from the perspective of the driver, select the calculation method of the cost function, and then execute step 5;
[0034] Step 4: For a matching sequence, match the driver from the perspective of the goods, select the calculation method of the cost function, and then execute step 5;
[0035] Step 5: Use the combination optimization algorithm based on sparrow search to solve the cost function and obtain the optimal matching sequence corresponding to the minimum value of the cost function. This sequence corresponds to the optimal vehicle-cargo matching result.
[0036] Step 6: Based on the list of goods matched to the driver, use a combinatorial optimization algorithm based on sparrow search to find the shortest path from the driver's location to all matching goods and finally reach the distribution center.
[0037] According to an embodiment of the crowdsourcing vehicle-cargo matching and path optimization method of the present invention, in step 2, whether the vehicle is capable of transporting all the goods is determined by comparing the vehicle load and the total mass of the goods. If the vehicle load is greater than the total mass of the goods, it is considered that it is capable of transporting the goods; if the vehicle load is less than the total mass of the goods, it is considered that it is not capable of transporting the goods.
[0038] According to an embodiment of the crowdsourcing vehicle-cargo matching and path optimization method of the present invention, in step 3, the cost function is selected as: matching cargo from the perspective of the driver, calculating the intra-class distance of all drivers, and then calculating the average intra-class distance as the cost function; in step 4, the cost function is selected as: matching drivers from the perspective of cargo, calculating the intra-class distance of all drivers, and then calculating the average intra-class distance as the cost function.
[0039] According to an embodiment of the crowdsourcing vehicle-cargo matching and path optimization method of the present invention, in step 5, the vehicle-cargo matching process is the process of finding an optimal matching sequence in the combinatorial optimization algorithm, wherein each matching sequence uniquely corresponds to a vehicle-cargo matching result.
[0040] According to an embodiment of the crowdsourcing vehicle-cargo matching and path optimization method of the present invention, the combined optimization algorithm based on sparrow search in step 5 further includes:
[0041] Step 501: Determine parameters: producer ratio, probability of encountering danger, and alarm individual ratio;
[0042] Step 502: Set the sparrow population size, number of iterations, and dimension;
[0043] Step 503: Initialize the population;
[0044] Step 504: Initialize the cost function list, calculate the cost function value for each individual in the population to form a cost list, sort the population in ascending order according to the cost function list, and sort the cost function list in ascending order;
[0045] Step 505: Producers are generated by combining random competition with elite preservation;
[0046] Step 506: The producer forages to determine whether the population is in danger. If so, a random exchange is performed; if not, a neighbor exchange is performed. The values in the corresponding cost function list, the current optimal individual value, and the current minimum cost function value are updated.
[0047] Step 507: The follower forages and traverses the remaining individuals in the population. If the follower's rank is within the first range of the population, a first random number between 0 and 1 is generated, and a crossover operation between the current best individual and the current individual with a ratio of the first random number is performed. If the follower's rank is within the second range of the population, two random exchanges are performed. After each traversal, the value in the corresponding cost function list, the current best individual value, and the current minimum cost function value are updated.
[0048] Step 508: Randomly select an individual from the population as an alarm, traverse all alarms, and if the alarm is ranked in the first range of the population, perform two random exchange operations. If the alarm is ranked in the second range of the population, generate a second random number between 0.5 and 1, and perform a crossover operation between the current best individual and the current individual with a ratio of the second random number. After each traversal, update the value in the corresponding cost function list, the current best individual value, and the current minimum cost function value;
[0049] Step 509: sort the population in ascending order according to the cost function list, sort the cost function list in ascending order, and if the current minimum cost function value is less than the global minimum cost function value, update the global optimal individual to the current optimal individual and the global minimum cost function value to the current minimum cost function value;
[0050] Step 510: Determine whether the number of iterations reaches the number of iterations set in step 502. If not, jump to step 504. If reached, jump to step 511.
[0051] Step 511: The algorithm ends and the final global optimal individual and global minimum cost function are output.
[0052] Compared with the prior art, the present invention has the following beneficial effects: the method of the present invention first performs vehicle-cargo matching and then performs path planning, that is, establishes a vehicle-cargo matching model whose goal is to minimize the intra-class distance, and uses an improved sparrow search-based combined optimization algorithm to solve the vehicle-cargo matching model to obtain a vehicle-cargo matching result, and then performs path optimization processing on this basis, which can improve the vehicle path optimization effect and reduce the vehicle driving distance. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] The above features and advantages of the present invention can be better understood after reading the detailed description of the embodiments of the present disclosure in conjunction with the following drawings. In the drawings, the components are not necessarily drawn to scale, and components with similar related properties or features may have the same or similar reference numerals.
[0054] Figure 1 A flow chart of an embodiment of the crowdsourcing vehicle-cargo matching method of the present invention is shown.
[0055] Figure 2 A flow chart of an embodiment of the crowdsourcing vehicle-cargo matching and path optimization method of the present invention is shown.
[0056] Figure 3 The flowchart of the combined optimization algorithm based on sparrow search in the present invention is shown.
[0057] Figure 4 A schematic diagram of an embodiment of a crowdsourcing vehicle-cargo matching system of the present invention is shown.
[0058] Figure 5 A schematic diagram of an embodiment of a crowdsourcing vehicle-cargo matching and path optimization system of the present invention is shown. DETAILED DESCRIPTION
[0059] The present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. Note that the aspects described below in conjunction with the accompanying drawings and specific embodiments are only exemplary and should not be construed as limiting the scope of protection of the present invention in any way.
[0060] Figure 1 The process of an embodiment of the crowdsourcing vehicle-cargo matching method of the present invention is shown. Figure 1 , the implementation steps of the method of this embodiment are described in detail as follows.
[0061] Step 1: Get vehicle driver information and cargo information.
[0062] The information in step 1 includes: cargo coordinates, cargo mass, driver coordinates, vehicle load, etc.
[0063] Step 2: Determine whether the current vehicle is capable of transporting all the goods. If it is capable, proceed to step 3; if not, proceed to step 4.
[0064] In this step, whether the vehicle is capable of transporting all the goods is determined by comparing the vehicle load and the total mass of the goods. If the vehicle load is greater than the total mass of the goods, it is considered capable of transporting the goods. If the vehicle load is less than the total mass of the goods, it is considered incapable of transporting the goods.
[0065] Step 3: Adopt a matching strategy for matching goods from the driver's perspective for a matching sequence.
[0066] Step 4: For a matching sequence, a matching strategy of matching drivers from the perspective of goods is adopted.
[0067] For both matching strategies, the cost function with the minimum average intra-driver distance and the highest load utilization rate is adopted. For the specific content of the cost function, please refer to the specific process of solving the vehicle-cargo matching model using the combined optimization algorithm based on sparrow search in the following text.
[0068] Step 5: Use a combination optimization algorithm based on sparrow search to solve the cost function and obtain the optimal matching sequence corresponding to the minimum value of the cost function. This sequence corresponds to the optimal vehicle-cargo matching result.
[0069] In this step, a combinatorial optimization algorithm based on sparrow search is used to solve and calculate the cost function to find the optimal matching sequence. The vehicle-cargo matching process is the process of finding an optimal matching sequence in the combinatorial optimization algorithm, and each matching sequence uniquely corresponds to a vehicle-cargo matching result.
[0070] like Figure 2 As shown, based on the optimal vehicle-cargo matching result obtained in the above embodiment, an embodiment of the crowdsourcing vehicle-cargo matching and path optimization method of the present invention further includes:
[0071] Step 6: Based on the list of goods matched to the driver, use a combinatorial optimization algorithm based on sparrow search to find the shortest path from the driver's location to all matching goods and finally reach the distribution center.
[0072] In this embodiment, the vehicle-cargo matching model is solved using a combined optimization algorithm based on sparrow search as follows.
[0073] Assume that there are M cargoes and n drivers. The maximum load of the i-th driver is bi. Let the maximum load vector be b = [b1, b2, b3, …, b n ] T Let the two-dimensional vector q be the coordinates of the distribution center, and the set of cargo coordinates be the two-dimensional vector group C = {c1, c2, ..., c M}, the coordinate set of the driver’s starting point is recorded as a two-dimensional vector set D = {d1, d3, …, d n}.remember<a,b> is the Euclidean distance between two vectors, let W = C∪{q} = {q,c1,c2,…,c M The distance matrix between each vector in the vector group W and the vector in W is recorded as A, wi is the i-th vector in W, that is, A ij = <w i ,w j >, where i,j∈{1,2,3,…,M+1}.
[0074] Let the discriminant variable k ij , recorded by k ij The matrix composed of K, K ij =k ij , let the i-th row of matrix K be K i* , k ij is defined as follows:
[0075]
[0076] Let p i is the discriminant vector of the points passed by driver i except the starting point, then p i =[1,K i1 ,K i2 ,K i3 ,…,K iM ] T where p i The first element of is 1, which means it must pass through the distribution center. Let l i =[Ki1 ,K i2 ,K i3 ,…,K iM ] T is the driver's load vector, and the load matrix L = [l1,l2,l3,…,l i ]. The distance between driver i and the delivery point and all goods is recorded as vector z i =[ <d i ,q>, <d i ,c1>, <d i ,c2>, <d i ,c3>,…, <d i ,c m >] T The optimization model of vehicle-cargo matching is:
[0077]
[0078] In the above model, s is a column vector with all 1s, and its number of rows is the same as the number of columns of the vector or matrix it is multiplied with. r is the number of drivers whose load vectors are not all 0. (1) is the objective function, which means minimizing the intra-class distance of the vehicle-cargo matching result; (2) means maximizing the utilization rate of the driver's load, and the division of the two vectors in this formula is element-by-element division; (3) is a constraint condition, p i is the discriminant vector of the points that driver i passes through except the starting point mentioned above, s is the column vector of all 1s mentioned above, and its number of rows is the same as the number of columns of the vector or matrix multiplied with it. This formula means that each cargo can only be assigned to one driver; (4) where m is the column vector arranged by the mass of each cargo, that is, g = [g1, g2, ..., g m ] T , where g i is the quality of the i-th item.
[0079] The intra-class distance CD for the i-th driver i , CDi is the content of the summation in the first optimization objective function in the above mathematical model. Let the set of driver numbers that have been assigned goods be ALLOC. If the i-th driver has no assigned goods, then CD i =0, CD i Another way to calculate is as follows:
[0080]
[0081] where x i ,x j ∈X={x0,x1,x2,…,x M′ ,x M′+1}, where x0 vector is the driver coordinate corresponding to the above di ,x1,x2,…,x M′ is the coordinates of the goods matched to the driver, M′ is the total number of goods matched to the driver, x M′+1 are the distribution center coordinates. ||x i -x j ||2 is the bi-norm of the difference between two vectors.
[0082] Let n be the number of drivers, then the calculation method of average intra-class distance avg is as follows:
[0083]
[0084] The second optimization objective in the above model, that is, expression (2), is the negative of the vehicle load utilization rate. Minimizing it is to maximize the vehicle load utilization rate. Let the vehicle load utilization rate be u. Then, according to expression (2), we get:
[0085]
[0086] The operation method of matching goods from the driver's perspective is as follows: it is necessary to traverse all vehicle lists, record the current traversal to the i-th driver, sort the distances of all goods to driver i in ascending order, and then traverse the sorted goods. The first traversed goods are the goods closest to the driver, and the second goods are the goods second closest to the driver. The current traversal to the j-th goods is the goods closest to the j-th driver. If the goods have not been matched and the remaining load of the i-th driver is enough to accommodate the goods, the goods will be assigned to the i-th driver. If the goods have been assigned, skip the goods and continue to traverse the j+1-th goods. If the load of the driver is not enough, the goods will be marked as goods that have not been matched to the driver.
[0087] The operation method of matching drivers from the perspective of goods is as follows: you need to traverse all the lists of goods, record the current traversal to the jth goods, sort the distances of all drivers to the jth goods in ascending order, and then traverse the sorted drivers. The first driver traversed is the driver closest to the goods, the second driver is the driver who is second closest to the goods, and the i-th driver traversed is the driver who is i-th closest to the goods. If the remaining load of the driver is enough to accommodate the goods, the goods will be assigned to the i-th driver for transportation. If it is not enough to accommodate the goods, the goods will be marked as goods that have not been matched with a driver.
[0088] The cost function selected by the two matching operation methods is defined as follows, where avg is the average intra-class distance and u is the vehicle load utilization rate:
[0089]
[0090] At present, the vehicle-cargo matching mainly adopts the above-mentioned greedy algorithm, which allocates the cargo to the nearest driver according to the time sequence of the cargo owner's transportation demand release, that is, matching drivers from the perspective of cargo. However, this method is prone to waste when dealing with many vehicles and few cargoes. In addition, the result of vehicle-cargo matching will affect the quality of the result obtained by path optimization. Therefore, it is necessary to find a vehicle-cargo matching method that is more conducive to path optimization.
[0091] The above matching process, whether matching goods from the driver's perspective or matching drivers from the goods' perspective, needs to traverse the driver sequence or the goods sequence. If the sequence is unreasonable, the previously allocated goods or previously allocated drivers may occupy the goods or drivers allocated later, resulting in failure to obtain the global optimum. In response to the above problems, this embodiment no longer considers how to allocate goods to achieve global optimality, but changes the idea to find the optimal matching sequence. The goal is to find a goods sequence or a driver sequence that minimizes the average intra-class distance avg obtained by matching drivers from the goods' perspective or matching goods from the driver's perspective. After selecting and completing this function (cost function), a combined optimization algorithm based on sparrow search is used to find the matching order with the minimum cost function.
[0092] After finding the optimal matching sequence, the optimal vehicle-cargo matching result can be obtained by using the previously selected method of matching the cargo from the driver's perspective or matching the driver from the cargo's perspective.
[0093] Finally, a route is planned for each driver based on the optimal vehicle-cargo matching result, requiring the shortest distance θ from the driver's current location through all cargo points to the distribution center. The calculation method of distance θ is described in the following formula:
[0094]
[0095] where x i ∈X={x0,x1,x2,…,x M′ ,x M′+1}, X is an ordered set, and the drivers pass by in the order of the elements in set X. The x0 vector is the driver's coordinate, indicating that the driver's starting position corresponds to an element in set D, x1, x2, ..., x M′ The coordinates of the goods corresponding to the order in which the driver picks up the goods. Here, it is the driver's pick-up operation. M' is the total number of goods matched to the driver. x M′+1 The coordinates of the distribution center represent the driver's final location. This system uses the Euclidean distance, ||x i -x j ||2 is the bi-norm of the difference between two vectors.
[0096] The sparrow search algorithm is an intelligent optimization algorithm. Based on the behavior of the sparrow population, there are three roles in the sparrow population: producers, followers, and alarms. Producers mean that there is more abundant food, which means that the cost function value is smaller than that of other individuals. If the population is in danger, the producer needs to move because it is responsible for leading the population out of danger. Followers will follow producers to forage and compete for their food, that is, compete for solutions with smaller cost functions. Followers in a very large area of the cost function are extremely hungry and need to go to other locations to find food, that is, search globally. Alarms are individuals in the sparrow population who are aware of danger. They will move their positions to escape danger. If a producer becomes an alarm, it will move randomly. If a follower becomes an alarm, it will move closer to the current optimal position.
[0097] The following definitions are required before implementing the combined optimization algorithm based on improved intelligent sparrow search:
[0098] Definition 1: Perform an adjacent exchange, that is, randomly select an exchange point i and exchange the positions of the i-th element and the i+1-th element in the sequence.
[0099] Definition 2: If in an exchange, the element at position i of the sequence is selected to be exchanged with the element at position j, then the tuple consisting of i and j is called an exchange point.
[0100] Definition 3: The exchange taboo table is a list of exchange points that stores the exchange points that have been used recently.
[0101] Definition 4: Perform a random exchange. Each sparrow has an exchange taboo table. Randomly select subscripts i and j as exchange points. If i≠j and the exchange point is not in the exchange taboo table of the sparrow, exchange the positions of the i-th element and the j-th element.
[0102] Definition 5: Perform a crossover operation between the s1 and s2 sequences with an exchange ratio of a. Let n1 and n2 be the lengths of the sequences s1 and s2 respectively. The operation steps are as follows:
[0103] Step 1: Calculate the number of crossovers , where a is the exchange ratio (see Definition 5)
[0104] Step 2: Randomly select numSwap elements from s1, and the s1 sequence generates numSwap vacancies;
[0105] Step 3: Put the numSwap elements selected in step 2 into the numSwap empty positions of the original s1 sequence in the order of their sequence in the s2 sequence. The crossover operation is now complete.
[0106] Definition 6: A random competition operation to generate producers in a population is as follows: Randomly select 2 individuals in population A, check their cost function values, and the one with the smaller cost function is used as a newly generated producer.
[0107] Combinatorial optimization requires an optimized objective function, which is called cost function. The operation steps of the combinatorial optimization algorithm based on sparrow search are as follows: Figure 3 As shown, the details are as follows:
[0108] Step 1: Determine the parameters: producer ratio pp%, probability of encountering danger ar, and alarm individual ratio par. Each individual here corresponds to a matching sequence, which can be a cargo sequence or a vehicle sequence. If the order of picking up is optimized, the individual here is a picking up sequence.
[0109] Step 2: Set the sparrow population size popSize, set the number of iterations numIt, and set the dimension dim. When matching goods from the perspective of drivers, dim is the number of drivers, and when matching drivers from the perspective of goods, dim is the number of goods. If the order of picking up goods is optimized, dim is the number of goods allocated to the driver.
[0110] Step 3: Initialize the population pop, that is, shuffle the [0,1,2,…,dim] sequence popSize times and record all the shuffled sequences as pop. The population in this algorithm is the set of different vehicle-cargo matching sequences. In the optimization of the pickup sequence, the population is different pickup sequences.
[0111] Step 4: Initialize the cost function list, calculate the cost function value for each individual in the population pop to form a cost function list. The cost here uses the cost function defined in the previous article when looking for a matching sequence. When optimizing the order of picking up goods, the distance can be directly calculated as the cost. Sort the population pop in ascending order according to the cost function list, and sort the cost function list in ascending order. Initialize the current best individual nbest as the first individual in the population pop, and the current minimum cost function value ncbest as the first value in the cost function list. Initialize the global best individual gbest as nbest, and the global minimum cost function gcbest as ncbest.
[0112] Step 5: Here, the idea of evolutionary computation is added to generate producers by combining random competition with elite preservation. The number of producers is 20% of the population, and the first 10% of individuals in the population pop serve as the first half of producers. The second half of producers are generated by multiple random competitions in the subpopulation composed of individuals ranked 10%-100% in the overall population.
[0113] Step 6: In this step, the producer forages for food. Determine whether the population is in danger. The probability of encountering danger is a manually set parameter. Traverse the first pp% of individuals in the population pop and randomly determine whether they are in danger according to the probability of encountering danger ar, that is, there is an ar% probability of encountering danger. If there is danger, perform 1 random exchange. If there is no danger, perform 1 adjacent exchange. Update the value, nbest value, and ncbest value in the corresponding cost function list.
[0114] Step 7: The remaining pp% to 100% of the population are followers. In this step, followers forage for food. Traverse the remaining pp% to 100% of the population. If the follower's rank is between pp% and 50% of the population, randomly generate a number a between 0 and 1, and perform a crossover operation between nbest and the current individual with an exchange ratio of a. If the follower's rank is between 50% and 100% of the population, perform two random exchanges. After each traversal, update the value in the corresponding cost function list, nbest value, and ncbest value.
[0115] Step 8: Randomly select par% of individuals in the population as alarms. If all alarms are traversed, if the alarm is ranked in the top pp% of the population, perform two random exchanges. If the alarm is ranked between pp% and 100% of the population, randomly generate a number a between 0.5 and 1, and perform a crossover operation between nbest and the current individual with a ratio of a. After each traversal, update the value in the corresponding cost function list, nbest value, and ncbest value.
[0116] Step 9: Sort the population pop (i.e., multiple different matching sequences, or different pickup orders) in ascending order according to the cost function list. Sort the cost function list in ascending order. If ncbest is less than gcbest, update gbest to nbest and gcbest to ncbest.
[0117] Step 10: Determine whether the number of iterations reaches numIt. If not, jump to step 4; if reached, jump to step 11.
[0118] Step 11: The algorithm ends and outputs the final global optimal individual gbest and global minimum cost function gcbest. So far, the goal of minimizing the average intra-driver distance and maximizing the vehicle load utilization rate has been achieved. Or the optimal pickup sequence achieves the shortest distance.
[0119] Figure 4 The principle of an embodiment of the crowdsourcing vehicle-cargo matching system of the present invention is shown. Figure 4The system of this embodiment includes: an information acquisition module, a judgment module, a cargo matching module, a driver matching module, and an optimal matching sequence solving module.
[0120] The information acquisition module is used to obtain vehicle driver information and cargo information.
[0121] The judgment module judges whether the current vehicle is capable of transporting all the goods. The judgment of whether the vehicle is capable of transporting all the goods is obtained by comparing the vehicle load and the total mass of the goods. If the vehicle load is greater than the total mass of the goods, it is considered capable of transporting. If the vehicle load is less than the total mass of the goods, it is considered incapable of transporting.
[0122] The cargo matching module is used to match cargo from the perspective of the driver for a matching sequence. The driver matching module is used to match drivers from the perspective of cargo for a matching sequence, and its cost function is the cost function defined above.
[0123] The optimal matching sequence solving module uses a combination optimization algorithm based on sparrow search to solve the cost function and obtain the optimal matching sequence corresponding to the minimum value of the cost function. This sequence corresponds to the optimal vehicle-cargo matching result. The vehicle-cargo matching process is the process of finding an optimal matching sequence in the combination optimization algorithm. Each matching sequence uniquely corresponds to a vehicle-cargo matching result.
[0124] The specific calculation of the combined optimization algorithm based on sparrow search in this embodiment has been described in detail in the aforementioned method embodiment, and will not be repeated here.
[0125] Figure 5 The principle of an embodiment of the crowdsourcing vehicle-cargo matching and path optimization system of the present invention is shown in FIG. Figure 5 The system of this embodiment includes: an information acquisition module, a judgment module, a cargo matching module, a driver matching module, an optimal matching sequence solving module, and a shortest path calculation module.
[0126] The information acquisition module is used to obtain vehicle driver information and cargo information.
[0127] The judgment module judges whether the current vehicle is capable of transporting all the goods. The judgment of whether the vehicle is capable of transporting all the goods is obtained by comparing the vehicle load and the total mass of the goods. If the vehicle load is greater than the total mass of the goods, it is considered capable of transporting. If the vehicle load is less than the total mass of the goods, it is considered incapable of transporting.
[0128] The cargo matching module is used to match cargo from the perspective of the driver for a matching sequence. The driver matching module is used to match drivers from the perspective of cargo for a matching sequence, and its cost function is the cost function defined above.
[0129] The optimal matching sequence solving module uses a combination optimization algorithm based on sparrow search to solve the cost function and obtain the optimal matching sequence corresponding to the minimum value of the cost function. This sequence corresponds to the optimal vehicle-cargo matching result. The vehicle-cargo matching process is the process of finding an optimal matching sequence in the combination optimization algorithm. Each matching sequence uniquely corresponds to a vehicle-cargo matching result.
[0130] The shortest path calculation module is used to find the shortest path from the driver's location through all matching goods to the distribution center based on the list of goods matched to the driver, using a combination optimization algorithm based on sparrow search.
[0131] The specific calculation of the combined optimization algorithm based on sparrow search in this embodiment has been described in detail in the aforementioned method embodiment, and will not be repeated here.
[0132] Although the above methods are illustrated and described as a series of actions for simplicity of explanation, it should be understood and appreciated that these methods are not limited by the order of the actions, because according to one or more embodiments, some actions may occur in a different order and / or concurrently with other actions from those illustrated and described herein or not illustrated and described herein but understandable to those skilled in the art.
[0133] Those skilled in the art will further appreciate that the various illustrative logic blocks, modules, circuits, and algorithm steps described in conjunction with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or a combination of the two. To clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, modules, circuits, and steps are generally described above in terms of their functionality. Whether such functionality is implemented as hardware or software depends on the specific application and the design constraints imposed on the overall system. The technician may implement the described functionality in different ways for each specific application, but such implementation decisions should not be interpreted as resulting in a departure from the scope of the present invention.
[0134] The various illustrative logic blocks, modules, and circuits described in conjunction with the embodiments disclosed herein may be implemented or performed with a general purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination thereof designed to perform the functions described herein. A general purpose processor may be a microprocessor, but in the alternative, the processor may be any conventional processor, controller, microcontroller, or state machine. The processor may also be implemented as a combination of computing devices, such as a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors in cooperation with a DSP core, or any other such configuration.
[0135] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. The software module may reside in a RAM memory, a flash memory, a ROM memory, an EPROM memory, an EEPROM memory, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art. An exemplary storage medium is coupled to a processor so that the processor can read and write information from / to the storage medium. In an alternative, a storage medium may be integrated into a processor. The processor and the storage medium may reside in an ASIC. The ASIC may reside in a user terminal. In an alternative, the processor and the storage medium may reside in a user terminal as discrete components.
[0136] In one or more exemplary embodiments, the functions described may be implemented in hardware, software, firmware, or any combination thereof. If implemented as a computer program product in software, each function may be stored on or transmitted by a computer-readable medium as one or more instructions or codes. Computer-readable media include both computer storage media and communication media, including any medium that facilitates the transfer of a computer program from one place to another. Storage media may be any available medium that can be accessed by a computer. As an example and not limitation, such a computer-readable medium may include RAM, ROM, EEPROM, CD-ROM or other optical disk storage, disk storage or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of an instruction or data structure and can be accessed by a computer. Any connection is also properly referred to as a computer-readable medium. For example, if the software is transmitted from a website, a server, or other remote source using a coaxial cable, a fiber optic cable, a twisted pair, a digital subscriber line (DSL), or wireless technologies such as infrared, radio, and microwaves, the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwaves are included in the definition of the medium. Disk and disc as used herein include compact disc (CD), laser disc, optical disc, digital versatile disc (DVD), floppy disk and Blu-ray disc, wherein disk often reproduces data magnetically, while disc reproduces data optically with lasers. Combinations of the above should also be included within the scope of computer-readable media.
[0137] The previous description of the disclosure is provided to enable any person skilled in the art to make or use the disclosure. Various modifications to the disclosure will be apparent to those skilled in the art, and the general principles defined herein may be applied to other variations without departing from the spirit or scope of the disclosure. Thus, the disclosure is not intended to be limited to the examples and designs described herein, but should be granted the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A crowdsourcing vehicle-cargo matching method, characterized in that: Methods include: Step 1: Obtain vehicle driver information and cargo information; Step 2: Determine whether the current vehicle is capable of transporting all the goods. If it is capable, proceed to step 3; if not, proceed to step 4. Step 3: For a matching sequence, match the goods from the perspective of the driver, select the calculation method of the cost function, and then execute step 5; Step 4: For a matching sequence, match the driver from the perspective of the goods, select the calculation method of the cost function, and then execute step 5; Step 5: Use the combinatorial optimization algorithm based on sparrow search to solve the cost function and obtain the optimal matching sequence corresponding to the minimum value of the cost function. This sequence corresponds to the optimal vehicle-cargo matching result. Among them, in step 5, the process of vehicle-cargo matching is the process of finding an optimal matching sequence in the combinatorial optimization algorithm, where each matching sequence uniquely corresponds to a vehicle-cargo matching result; Wherein, the combined optimization algorithm based on sparrow search in step 5 further includes: Step 501: Determine parameters: producer ratio, probability of encountering danger, and alarm individual ratio; Step 502: Set the sparrow population size, number of iterations, and dimension; Step 503: Initialize the population; Step 504: Initialize the cost function list, calculate the cost function value for each individual in the population to form a cost list, sort the population in ascending order according to the cost function list, and sort the cost function list in ascending order; Step 505: Producers are generated by combining random competition with elite preservation; Step 506: The producer forages to determine whether the population is in danger. If so, a random exchange is performed; if not, a neighbor exchange is performed. The value in the corresponding cost function list, the current optimal individual value, and the current minimum cost function value are updated. Step 507: The follower forages and traverses the remaining individuals in the population. If the follower's rank is within the first range of the population, a first random number between 0 and 1 is generated, and a crossover operation between the current best individual and the current individual with a ratio of the first random number is performed. If the follower's rank is within the second range of the population, two random exchanges are performed. After each traversal, the value in the corresponding cost function list, the current best individual value, and the current minimum cost function value are updated. Step 508: Randomly select an individual from the population as an alarm, traverse all alarms, and if the alarm is ranked in the first range of the population, perform two random exchange operations. If the alarm is ranked in the second range of the population, generate a second random number between 0.5 and 1, and perform a crossover operation between the current best individual and the current individual with a ratio of the second random number. After each traversal, update the value in the corresponding cost function list, the current best individual value, and the current minimum cost function value; Step 509: sort the population in ascending order according to the cost function list, sort the cost function list in ascending order, and if the current minimum cost function value is less than the global minimum cost function value, update the global optimal individual to the current optimal individual and the global minimum cost function value to the current minimum cost function value; Step 510: Determine whether the number of iterations reaches the number of iterations set in step 502. If not, jump to step 504. If reached, jump to step 511. Step 511: The algorithm ends and the final global optimal individual and global minimum cost function are output.
2. The crowdsourcing vehicle-cargo matching method according to claim 1, characterized in that: In step 2, whether the vehicle is capable of transporting all the goods is determined by comparing the vehicle load and the total mass of the goods. If the vehicle load is greater than the total mass of the goods, it is considered capable of transporting the goods. If the vehicle load is less than the total mass of the goods, it is considered incapable of transporting the goods.
3. The crowdsourcing vehicle-cargo matching method according to claim 1, characterized in that: In step 3, the cost function is selected as follows: matching goods from the perspective of drivers, calculating the intra-class distances of all drivers, and then calculating the average intra-class distance as the cost function; in step 4, the cost function is selected as follows: matching drivers from the perspective of goods, calculating the intra-class distances of all drivers, and then calculating the average intra-class distance as the cost function.
4. A crowdsourcing vehicle-cargo matching and path optimization method, characterized in that: Methods include: Step 1: Obtain vehicle driver information and cargo information; Step 2: Determine whether the current vehicle is capable of transporting all the goods. If it is capable, proceed to step 3; if not, proceed to step 4. Step 3: For a matching sequence, match the goods from the perspective of the driver, select the calculation method of the cost function, and then execute step 5; Step 4: For a matching sequence, match the driver from the perspective of the goods, select the calculation method of the cost function, and then execute step 5; Step 5: Use the combinatorial optimization algorithm based on sparrow search to solve the cost function and obtain the optimal matching sequence corresponding to the minimum value of the cost function. This sequence corresponds to the optimal vehicle-cargo matching result. Step 6: Based on the list of goods matched to the driver, use the combinatorial optimization algorithm based on sparrow search to find the shortest path from the driver's position to all matching goods and finally to the distribution center; Among them, in step 5, the process of vehicle-cargo matching is the process of finding an optimal matching sequence in the combinatorial optimization algorithm, where each matching sequence uniquely corresponds to a vehicle-cargo matching result; Wherein, the combined optimization algorithm based on sparrow search in step 5 further includes: Step 501: Determine parameters: producer ratio, probability of encountering danger, and alarm individual ratio; Step 502: Set the sparrow population size, number of iterations, and dimension; Step 503: Initialize the population; Step 504: Initialize the cost function list, calculate the cost function value for each individual in the population to form a cost list, sort the population in ascending order according to the cost function list, and sort the cost function list in ascending order; Step 505: Producers are generated by combining random competition with elite preservation; Step 506: The producer forages to determine whether the population is in danger. If so, a random exchange is performed; if not, a neighbor exchange is performed. The value in the corresponding cost function list, the current optimal individual value, and the current minimum cost function value are updated. Step 507: The follower forages and traverses the remaining individuals in the population. If the follower's rank is within the first range of the population, a first random number between 0 and 1 is generated, and a crossover operation between the current best individual and the current individual with a ratio of the first random number is performed. If the follower's rank is within the second range of the population, two random exchanges are performed. After each traversal, the value in the corresponding cost function list, the current best individual value, and the current minimum cost function value are updated. Step 508: Randomly select an individual from the population as an alarm, traverse all alarms, and if the alarm is ranked in the first range of the population, perform two random exchange operations. If the alarm is ranked in the second range of the population, generate a second random number between 0.5 and 1, and perform a crossover operation between the current best individual and the current individual with a ratio of the second random number. After each traversal, update the value in the corresponding cost function list, the current best individual value, and the current minimum cost function value; Step 509: sort the population in ascending order according to the cost function list, sort the cost function list in ascending order, and if the current minimum cost function value is less than the global minimum cost function value, update the global optimal individual to the current optimal individual and the global minimum cost function value to the current minimum cost function value; Step 510: Determine whether the number of iterations reaches the number of iterations set in step 502. If not, jump to step 504. If reached, jump to step 511. Step 511: The algorithm ends and the final global optimal individual and global minimum cost function are output.
5. The crowdsourcing vehicle-cargo matching and path optimization method according to claim 4 is characterized in that: In step 2, whether the vehicle is capable of transporting all the goods is determined by comparing the vehicle load and the total mass of the goods. If the vehicle load is greater than the total mass of the goods, it is considered capable of transporting the goods. If the vehicle load is less than the total mass of the goods, it is considered incapable of transporting the goods.
6. The crowdsourcing vehicle-cargo matching and path optimization method according to claim 4 is characterized in that: In step 3, the cost function is selected as follows: matching goods from the perspective of drivers, calculating the intra-class distances of all drivers, and then calculating the average intra-class distance as the cost function; in step 4, the cost function is selected as follows: matching drivers from the perspective of goods, calculating the intra-class distances of all drivers, and then calculating the average intra-class distance as the cost function.
Citation Information
Patent Citations
A trunk transportation vehicle-cargo matching algorithm based on big data
CN109359771A
Multi-stage vehicle-cargo matching method considering three-dimensional loading constraint
CN110189077A
Urban crowdsourcing distribution task optimization scheduling method based on path planning
CN110826968A
Crowdsourcing mode-based traditional industrial cluster cargo collection path optimization method
CN112085271A
Robot path planning method based on self-adaptive sparrow search algorithm
CN112461247A
