A multi-agv task allocation method
Patent Information
- Application Number
- CN202410233416.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-29
- Publication Date
- 2026-10-09
- Estimated Expiration
- 2044-02-29
AI Technical Summary
但蚁群算法搜索时间长、易陷入局部最优且动态规划能力弱等缺陷
[0026] (1) This scheme adds the kmeans algorithm in the early stage of the ant colony algorithm, which clusters the tasks to be assigned according to the number of AGVs, making the task allocation more reasonable, avoiding the problem of unbalanced task allocation leading to overload of a certain AGV, and improving the overall calculation speed of the algorithm.
Smart Images

Figure CN118246476B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the task allocation and execution order of multiple AGVs in intelligent warehousing, and specifically to a method for task allocation of multiple AGVs. Background Technology
[0002] With the continuous development of intelligent robot technology, more and more processing workshops are transforming towards intelligentization, using AGVs to undertake automated handling and loading / unloading tasks on behalf of human workers. Therefore, how to rationally allocate tasks to AGVs has become an important research issue. A suitable task allocation scheme can reduce the overall travel distance and route conflicts of AGVs, thereby improving work efficiency.
[0003] Currently, the task allocation problem for AGVs is generally solved using intelligent algorithms or other algorithms. However, these methods place high demands on system communication and are not computationally efficient enough. Ant colony optimization (ACO) is a biomimetic algorithm and one of the main algorithms currently under research. ACO features distributed computing, decentralized control, and indirect communication between distributed components, making it easy to combine with other optimization algorithms. It demonstrates the ability to solve complex problems through simple interactions between individuals and is widely used in solving optimization problems. However, ACO has drawbacks such as long search time, susceptibility to local optima, and weak dynamic programming capabilities. Summary of the Invention
[0004] Purpose of the invention: In response to the problems pointed out in the background art, this invention proposes a multi-AGV task allocation method, which combines an improved ant colony algorithm with the k-means algorithm. By incorporating task point clustering, the multi-AGV task allocation problem is transformed into a single AGV task allocation problem. Furthermore, the ant colony algorithm is improved by adding a reward and punishment mechanism and a dynamic pheromone evaporation factor ρ. This method has the advantages of improving algorithm efficiency, optimization ability, avoiding the algorithm from getting trapped in local optima, and improving the quality of algorithm solution.
[0005] Technical solution: This invention discloses a method for assigning tasks to multiple AGVs, comprising the following steps:
[0006] Step 1: Determine the tasks to be assigned and the coordinates of the AGV;
[0007] Step 2: There are m tasks to be assigned and n AGVs. In the early stage of the ant colony algorithm, the K-means algorithm is added to cluster the tasks to be assigned into n groups according to the number of AGVs.
[0008] Step 3: Assign the divided n groups of tasks to corresponding AGVs, then perform calculation respectively in accordance with the improved ant colony algorithm to determine the task execution sequence of AGVs, so as to minimize the total distance of multiple AGVs performing their respective tasks. On the basis of the traditional ant colony algorithm, the improved ant colony algorithm sorts the lengths of the ant travel paths obtained by each iteration, wherein shorter lengths correspond to higher rankings, improves the pherometer updating mechanism, and adds a reward and punishment mechanism.
[0009] Further, in the step 2, before determining the task execution sequence, the Kmeans clustering algorithm is added, which takes the number of AGVs to be allocated as the number of clustering points, clusters the task points to be allocated, and converts the multi-task multi-AGV problem into the task execution sequence problem of a single AGV.
[0010] Further, before determining the task execution sequence, the Kmeans clustering algorithm is added to divide the tasks to be allocated into n groups according to the number of AGVs, and the specific steps are as follows:
[0011] Step 201: Determine that the number of AGVs is n, and the set of task points T={T1,T2,…,T m}, randomly select n clustering sets from the task point set T, then the set of to-be-allocated clustering points μ={μ1,μ2,…,μ n};
[0012] Step 202: Traverse the distances from all remaining task points to each clustering point, and allocate these task points to the nearest clustering point. The coordinate of the b-th task is (X b ,Y b ), the coordinate of the a-th clustering point is (X a ,Y a ), the distance function between the b-th task and the a-th clustering point allocate these task points to the nearest clustering point, wherein μ a is the coordinate of the a-th clustering point, T b is the coordinate of the b-th task;
[0013] Step 203: Calculate the average value of all task points in each cluster, and update the clustering points. The formula for updating clustering points is as follows: wherein μ a is the coordinate of the a-th clustering point, n a is the number of tasks in the a-th clustering point, which is n;
[0014] Step 204, when the objective function |P i+1 -P i |<M, output the algorithm result; wherein, P i is the squared error between the i-th clustering point and the task points allocated to it, xit is the coordinate of the t-th task assigned by the algorithm to the i-th cluster point, and M is the set termination threshold.
[0015] Furthermore, in step 3, Euclidean distance is used as the cost required to execute the task. Assuming the coordinates of task T1 are (X1, Y1) and the coordinates of task T2 are (X2, Y2), the cost required for the AGV to move from task T1 to T2 is... Suppose that the i-th AGV is assigned k tasks, represented by a set. The cost required for the i-th AGV to complete its assigned task in This represents the cost incurred by the i-th robot in performing the task from r to r+1. Let $C$ represent the cost for the $i$-th robot to perform tasks from task $k$ to the first task. The total cost for all robots to complete all tasks is $Cost$. Using this as the objective function, optimization is performed to minimize the cost.
[0016] Furthermore, the specific formula for the pheromone update mechanism in step 3 is as follows:
[0017]
[0018] In the pheromone update formula, elite ants are added, and in each iteration, the edge corresponding to the best path is given extra pheromone, while the accumulation of pheromone is reduced for the poor path.
[0019] The specific formula can be expressed as:
[0020] The specific formula is shown below.
[0021] The specific formula is shown below.
[0022] Where ρ represents the evaporation coefficient of pheromones along the path. Let represent the amount of pheromone left by the k-th ant on edge ij in this iteration. L represents the increment of pheromones released by elite ants on edge ij. best R is the total length of the optimal path. best L is the optimal path in this iteration. r Let be the length of the travel path of the ant ranked r, Q be a positive constant, and m be the number of ants. To prevent premature convergence of the algorithm, the pheromone level along the ant's search path is limited to [τ]. min ,τ max Within the interval, the specific formula is:
[0023]
[0024] Furthermore, in step 3, based on the traditional ant colony algorithm, an adaptive evaporation factor ρ is proposed. In the early stage of the algorithm, ρ is set to ρ_i. max However, if the optimal solution remains unchanged in three consecutive iterations, the value of ρ is automatically adjusted to ensure global optimization and prevent the algorithm from getting stuck in local optima. A lower limit ρ for the volatile coefficient is also set. min To ensure the convergence of the algorithm, the formula for updating the pheromone volatile factor is:
[0025] Beneficial effects:
[0026] (1) This scheme adds the kmeans algorithm in the early stage of the ant colony algorithm, which clusters the tasks to be assigned according to the number of AGVs, making the task allocation more reasonable, avoiding the problem of unbalanced task allocation leading to overload of a certain AGV, and improving the overall calculation speed of the algorithm.
[0027] (2) This scheme improves the pheromone update formula of the ant colony algorithm by adding a reward and punishment mechanism. The length of the ant travel paths in each iteration is ranked, with shorter paths appearing first. In each iteration, the ant with the best path can obtain additional pheromones, while the ant with a relatively poor path length will have its pheromone accumulation reduced. This allows the ants to find the optimal solution more quickly, resulting in a faster convergence speed of the algorithm.
[0028] (3) In the improved pheromone update formula of the ant colony algorithm, this scheme adopts the natural logarithm weighted method to update the pheromone. The pheromone increases more gradually, avoiding the rapid increase of pheromone and limiting the pheromone to a certain range. This effectively avoids the fact that a certain path is much larger than other paths, so that the algorithm no longer spreads and gets trapped in a local optimum.
[0029] (4) This scheme improves the pheromone evaporation factor ρ of the ant colony algorithm by adding a judgment mechanism and referencing linear changes. This ensures global search capability in the early stage, increases the diversity of solutions, and avoids the optimal solution from getting trapped in local optima. Furthermore, a lower limit ρ of the evaporation factor is set. min This is to ensure the convergence of the algorithm in the later stages. Attached Figure Description
[0030] Figure 1 It is the task allocation result of the improved ant colony algorithm;
[0031] Figure 2 This is the task allocation result of the ant colony algorithm;
[0032] Figure 3 This is a comparison chart of the improved ant colony algorithm and the unimproved ant colony algorithm;
[0033] Figure 4 This is a flowchart of multi-AGV task allocation. Detailed Implementation
[0034] The technical solutions and advantages of the present invention will be further described in detail below with reference to the embodiments of the present invention.
[0035] This invention discloses a method for assigning tasks to multiple AGVs, which specifically includes the following steps:
[0036] Step 1: Analyze the problem, determine the optimization goal, and determine the tasks to be assigned, as well as the number and coordinates of AGVs.
[0037] Using Euclidean distance as the cost of performing the task, assuming the coordinates of task T1 are (X1, Y1) and the coordinates of task T2 are (X2, Y2), the cost required for the AGV to move from task T1 to T2 is... Suppose that the i-th AGV is assigned k tasks, represented by a set. The cost required for the i-th AGV to complete its assigned task in This represents the cost incurred by the i-th robot in performing the task from r to r+1. Let $C$ represent the cost for the $i$-th robot to perform tasks from task $k$ to the first task. Therefore, the total cost for all robots to complete all tasks is $Cost$. Using this as the objective function, optimization is performed to minimize the cost.
[0038] Step 2: Determine the number of tasks to be assigned as m and the number of AGVs as n. Add the K-means algorithm in the early stage of the ant colony algorithm. First, according to the number of AGVs, randomly select n cluster points from the task points, and then use the K-means algorithm to divide the m task points into n groups.
[0039] Step 201: Determine the number of AGVs as n, and the task point set T = {T1, T2, ..., T}. m If n cluster sets are randomly selected from the task point set T, then the cluster point set to be assigned is μ = {μ1, μ2, ..., μ...} n}
[0040] Step 202: Iterate through the distances from all remaining task points to each cluster point and assign these task points to the nearest cluster point. The coordinates of the b-th task are (X... b ,Y b The coordinates of the a-th cluster point are (X... a ,Y a The distance function from the b-th task to the a-th cluster point. Assign these task points to the closest cluster point.
[0041] Step 203: calculate the average of all task points in each cluster and update the cluster points. The formula for updating cluster points is as follows: where μ a is the coordinate of the a-th cluster point, n a is the number of tasks in the a-th cluster.
[0042] Step 204: when the objective function |P i+1 -P i | < M, output the algorithm result, where where, P i is the squared error between the i-th cluster point and the task points assigned thereto, x it is the coordinate of the t-th task assigned to the i-th cluster point by the algorithm, and M is a set termination threshold.
[0043] Step 3: assign the grouped n sets of tasks to corresponding AGVs, then perform calculation respectively according to the improved ant colony algorithm, and confirm the task execution sequence of each AGV, so as to minimize the total distance of multiple AGVs executing their respective tasks.
[0044] Step 301: obtain the task set assigned to each cluster point, the i-th AGV is assigned k tasks, and the optimal distance solution is solved respectively for each cluster point task set. Initialize the number of ants m, pheromone factor α, heuristic function factor β, improved pheromone volatilization factor ρ, pheromone constant Q, maximum number of iterations t, etc.
[0045] Step 302: place each ant randomly at different starting points, for each ant k (k=1, 2, ..., m), calculate the probability of transferring to another city through the calculation formula, then select the next city according to the roulette wheel algorithm until all ants have visited all cities.
[0046] Step 303: calculate the path length L traveled by each ant, record the optimal solution (shortest path) in the current iteration, sort all ants in this iteration according to the length of their travel paths, with shorter paths ranked first. A reward and punishment mechanism is added, and the pheromone concentration on each city connection path is updated according to the improved pheromone concentration update formula. The specific formula of the pheromone update mechanism is:
[0047]
[0048] In the formula, elite ants are added. In each iteration, additional pheromone is added to the edge corresponding to the optimal path, and the pheromone accumulation of poor paths is reduced. The specific formula can be expressed as: The specific formula is shown below. The specific formula is shown below. ρ represents the evaporation coefficient of pheromones along the path. This represents the amount of pheromone left on edge ij by the k-th ant in this iteration. L represents the increment of pheromones released by elite ants on edge ij. best R is the total length of the optimal path. best L is the optimal path in this iteration. r Let be the length of the travel path of the ant ranked r, Q be a positive constant, and m be the number of ants. To prevent premature convergence of the algorithm, the pheromone level along the ant's search path is limited to [τ]. min ,ρ max Within the interval, the specific formula is as follows:
[0049] Step 304: Check the update status of the optimal solution. If the optimal solution has not changed in three consecutive iterations, update the pheromone evaporation factor ρ.
[0050] Step 305: Determine if the maximum number of iterations has been reached. If yes, output the globally optimal path length; otherwise, go to step 302 and continue execution.
[0051] In step 304, in the early stage of the algorithm, the value of ρ is ρ max To ensure convergence speed, if the optimal solution remains unchanged after multiple iterations, the value of ρ is automatically adjusted to ensure global optimization and avoid getting trapped in local optima. A lower limit ρ for the volatile coefficient is also set. min This ensures the convergence of the algorithm. The formula for updating the pheromone volatile factor is:
[0052] In this embodiment of the invention, 31 task points and 3 AGVs were selected. The allocation results of the ant colony algorithm and the allocation results of the improved ant colony algorithm were compared. The relevant data are shown in Table 1.
[0053] Table 1 Coordinates
[0054]
[0055] from Figure 1 It can be seen that the improved ant colony algorithm assigns the following three groups:
[0056] Group 1 serial numbers: 1, 11, 12, 13, 14, 15, 29, AGV1 travels a distance of 5940.8.
[0057] Group 2 serial numbers: 20, 21, 22, 24, 25, 26, 27, 28, 30, 31, the travel distance of AGV2 is 4642.9.
[0058] Group 3 serial numbers: 2, 3, 4, 5, 6, 7, 8, 9, 10, 16, 17, 18, 19, 23, the travel distance of AGV3 is 5434.7.
[0059] from Figure 2 It can be seen that the ant colony algorithm assigns the following 3 groups:
[0060] Group 1 serial numbers: 1, 11, 12, 13, 14, 15, 23, 24, 29, 30, 31, the travel distance of AGV1 is 7415.5.
[0061] Group 2 serial numbers: 3, 17, 18, 19, 20, 21, 22, 25, 26, 27, 28, the travel distance of AGV2 is 4485.3.
[0062] Group 3 serial numbers: 2, 4, 5, 6, 7, 8, 9, 10, 16, the travel distance of AGV3 is 4885.5.
[0063] In the ant colony algorithm, the total travel distance of AGVs is too large, the difference in travel distance between AGVs is too large, and path conflicts may occur. However, in the improved ant colony algorithm of this invention, clustering is performed according to the location of the task, dividing them into 3 categories. This simplifies the task allocation problem of multiple AGVs into the task allocation problem of a single AGV. With the minimum total travel distance of the three AGVs, the travel distance of the three AGVs is more balanced and reasonable, and there are no conflicts in their respective travel routes. Figure 4 As can be seen, the improved ant colony algorithm converges faster than the unimproved ant colony algorithm, finding the optimal solution more quickly in the early stages.
[0064] The above embodiments are only for illustrating the technical concept and features of the present invention, and are intended to enable those skilled in the art to understand the content of the present invention and implement it accordingly. They should not be construed as limiting the scope of protection of the present invention. All equivalent transformations or modifications made in accordance with the spirit and essence of the present invention should be covered within the scope of protection of the present invention.
Claims
1. A method for assigning tasks to multiple AGVs, characterized in that, Includes the following steps: Step 1: Determine the tasks to be assigned and the coordinates of the AGV; Step 2: There are m tasks to be assigned and n AGVs. In the early stage of the ant colony algorithm, the K-means algorithm is added to cluster the tasks to be assigned into n groups according to the number of AGVs. Step 3: Assign the n groups of tasks to the corresponding AGVs, and then calculate according to the improved ant colony algorithm to confirm the task execution order of the AGVs so that the total distance of the multiple AGVs executing their respective tasks is minimized. The improved ant colony algorithm is based on the traditional ant colony algorithm, sorts the length of the ant travel path in each iteration, and ranks the shorter path first. It also improves the pheromone update mechanism and adds a reward and punishment mechanism. The specific formula for the pheromone update mechanism in step 3 is as follows: ; In the pheromone update formula, elite ants are added, and in each iteration, the edge corresponding to the best path is given extra pheromone, while the accumulation of pheromone is reduced for the poor path. The specific formula can be expressed as: ; The specific formula is shown below. ; The specific formula is shown below. ; in, This represents the volatile factor of pheromones along the path. Let represent the amount of pheromone left by the k-th ant on edge ij in this iteration. L represents the increment of pheromones released by elite ants on edge ij. best R is the total length of the optimal path. best This is the optimal path in this iteration. Let be the length of the travel path of the ant ranked r, Q be a positive constant, m be the number of ants, and to prevent the algorithm from prematurely convergent, the pheromone along the ant's search path is limited to [...]. Within the interval, the specific formula is: ; Based on the traditional ant colony algorithm, an adaptive volatile factor is also proposed. In the early stages of the algorithm, The value is However, if the optimal solution remains unchanged in the three consecutive iterations, then automatic adjustment will occur. The value of is determined to ensure global optimization of the algorithm and avoid getting trapped in local optima, while also setting a lower limit for the volatile factor. To ensure the convergence of the algorithm, the formula for updating the pheromone volatile factor along the path is: .
2. The multi-AGV task allocation method according to claim 1, characterized in that, In step 2, the K-means clustering algorithm is added before determining the task execution order. The number of AGVs to be assigned is used as the number of cluster points to cluster the task points to be assigned, thus transforming the multi-task, multi-AGV problem into a single AGV task execution order problem.
3. The multi-AGV task allocation method according to claim 2, characterized in that, Before determining the task execution order, a K-means clustering algorithm is added to divide the tasks to be assigned into n groups according to the number of AGVs. The specific steps are as follows: Step 201: Determine the number of AGVs as n, and the task point set T = {T1, T2, ..., T}. m If n cluster sets are randomly selected from the task point set T, then the cluster point set to be assigned is μ = {μ1, μ2, ..., μ...} n }; Step 202: Iterate through the distances from all remaining task points to each cluster point, and assign these task points to the nearest cluster point. The coordinates of the b-th task are (X... b ,Y b The coordinates of the a-th cluster point are (X... a ,Y a The distance function from the b-th task to the a-th cluster point. These task points are assigned to the nearest cluster point, where These are the coordinates of the a-th cluster point. These are the coordinates of the b-th task; Step 203: Calculate the average value of all task points in each cluster and update the cluster points. The formula for updating the cluster points is as follows: ,in These are the coordinates of the a-th cluster point. It represents the number of tasks for the a-th cluster point; Step 204, when the objective function Then output the algorithm result; where, , is the coordinate of the t-th task assigned by the algorithm to the i-th cluster point, and M is the set termination threshold.
4. The multi-AGV task allocation method according to claim 1, characterized in that, In step 3, Euclidean distance is used as the cost required to execute the task. Assuming the coordinates of task T1 are (X1, Y1) and the coordinates of task T2 are (X2, Y2), the cost for the AGV to move from task T1 to T2 is... Suppose that the i-th AGV is assigned k tasks, represented by a set. The cost required for the i-th AGV to complete its assigned task is ,in This represents the cost incurred by the i-th robot in performing the task from r to r+1. Let $C$ represent the cost for the $i$-th robot to perform tasks from task $k$ to the first task. The total cost for all robots to complete all tasks is $Cost$. Using this as the objective function, optimization is performed to minimize the cost.
Citation Information
Patent Citations
Improved AGV path planning algorithm based on grid map model
CN113093758A
Path planning method based on fusion of improved ant colony and genetic algorithm
CN117387619A