Task allocation method and system considering robot fault in fire rescue
By optimizing the robot task allocation in fire rescue, considering the situation of robot failure, using Boolean constraints and optimization algorithms for task encoding and reallocation, the problems of low task allocation efficiency and poor fault handling in the existing technology are solved, and the problem of low task allocation efficiency and poor fault handling is achieved More efficient and safer fire rescue.
Patent Information
- Application Number
- CN202411469663.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-21
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2044-10-21
AI Technical Summary
The existing technology has low efficiency in robot task allocation in fire rescue, and it fails to effectively consider the possible failure of robots during the execution of tasks, and cannot meet the timeliness requirements of complex rescue tasks.
A task allocation method that considers robot failure in fire rescue is proposed. By dividing and initializing the fire rescue environment, describing the robot's tasks using Boolean constraints, preprocessing the shortest path and distance between task cells, and adopting discrete The Northern Goshawk optimization algorithm optimizes task coding and uses an auction algorithm to reassign tasks when the robot fails.
It effectively improves the efficiency of robots in fire rescue, reduces the risk of fire scenes, reduces casualties and property losses, saves rescue time, and improves the robustness of the system.
Smart Images

Figure CN119443601A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of robots, and in particular relates to a task allocation method and system taking robot failure into consideration in fire rescue. Background Art
[0002] With the rapid development of artificial intelligence technology and the actual needs of social production, robots have been widely used, such as cooperative combat robots in the military field, inspection robots in the field of environmental detection, and firefighting robots used in the rescue field. The field of fire rescue is very special, and the requirements for robots are more urgent. The investment of robots in the field of fire rescue can effectively reduce the casualties of firefighters and improve the efficiency and stability of rescue. Task allocation is the premise for determining whether robots can reasonably and efficiently complete the assigned tasks. For example, after a fire occurs, robots first need to reasonably allocate tasks in order to complete the search and rescue tasks and fire extinguishing tasks of trapped people in a timely manner. The robot task allocation method refers to: considering the initial state, according to the number and location distribution of tasks, reasonably assign tasks to each robot, and the robot plans an effective path from the starting point to each task point and avoids obstacles according to the obtained task sequence, and the path of the entire robot system is as short as possible.
[0003] In recent years, the research on robots in the field of firefighting and rescue has gradually become a hot topic. However, the existing methods consider relatively simple tasks, have low solution efficiency, and do not consider the situation where the robot fails during the execution of the assigned tasks, which does not meet the urgent requirements of the complexity and timeliness of rescue tasks. Tasks with Boolean constraints mainly include the logic of AND, OR, and NOT, which can realize some complex high-level task descriptions, such as requiring robots to perform tasks such as searching and rescuing trapped people and extinguishing fires during the execution of tasks, selectively performing tasks such as closing gas valves, and avoiding certain areas that are affected by fire and cannot be passed. Summary of the invention
[0004] The purpose of the present invention is to overcome the problem of low efficiency of existing robots in fire rescue, and propose a task allocation method and system that takes robot failure into consideration in fire rescue.
[0005] In order to achieve the above object, the present invention adopts the following technical scheme: A method for task allocation in fire rescue considering robot failures comprises the following steps: The fire rescue global environment is divided to obtain the divided fire rescue environment. After the robot in the divided fire rescue environment is initialized, the robot's task is formally described using Boolean constraints to obtain the robot's task description with Boolean constraints. After constructing the adjacency matrix of the task cells in the divided fire rescue environment, the shortest path and shortest distance between each task cell are obtained through Dijkstra algorithm preprocessing; After initial task encoding of the robot's task description with Boolean constraints, an initial task encoding method is obtained, and all tasks are assigned to each robot according to the initial task encoding method; The discretized Northern Goshawk optimization algorithm is used to iterate the Northern Goshawk optimization operation and update the task coding for the initial task coding method to obtain the optimal task coding sequence and the shortest path; After decoding the optimal task coding sequence, the shortest path and shortest distance between each task cell obtained by preprocessing are combined to calculate the shortest path and shortest distance of each robot; When a robot fails, the global environment of fire rescue is updated, and the auction algorithm is used to reallocate the remaining tasks when the robot fails to the robots that are not failed. The shortest path of each robot before and after the failure and the total distance of all robots are output.
[0006] Further, the robot's task includes a path task of the robot, and the path task of the robot includes an AND task, an OR task, and a non-task; The tasks represent the tasks that the robot must perform in the global environment of fire rescue; The or tasks represent tasks that the robot selectively performs in the global environment of fire rescue; The non-task represents a task area that the robot should always avoid in the global environment of fire rescue; The robot's task description with Boolean constraints is as follows:
[0007] in, For robot tasks with Boolean constraints, For the mission, represents the number of tasks that the robot must perform in the global environment of fire rescue; For non-task; represents the tasks that the robot selectively performs in the global environment of fire rescue, represents the number of tasks that the robot selectively performs in the global environment of fire rescue, , Indicates the robot's A group or task is in a collection Select a task to perform. For or task.
[0008] Furthermore, the adjacency matrix is shown in the following formula:
[0009] in, M is a symmetric adjacency matrix of n×n. M The distance relationship between task cells in the divided fire rescue environment is stored in Represents adjacent cells and The distance between ,like , then the cell and They are not adjacent or cannot pass through; Calculate the adjacent cells using the Dijkstra algorithm and The shortest path between and the shortest distance And remove non-task cells in the adjacency matrix.
[0010] Furthermore, the initial task encoding is shown in the following formula:
[0011]
[0012]
[0013] in, represents the initial task encoding; It represents the task cells that satisfy the robot path task in the divided fire rescue environment. is the mapping of a task cell in the pathway task; Indicates the task cells that meet the robot's terminal task in the divided fire rescue environment; A mapping of a task cell in the endpoint task; 0 means the end of the current robot path task, and tasks are assigned in sequence starting from the first robot; all robots need to complete Pathway tasks and k The terminal tasks are randomly assigned to k A robot, represents the number of tasks that the robot must perform in the global environment of fire rescue, represents the number of tasks that the robot selectively performs in the global environment of fire rescue, k Indicates the number of robots in the divided fire rescue environment.
[0014] Furthermore, the objective function of the discretized northern goshawk optimization algorithm is as follows:
[0015] is the encoding, the objective function value For encoding The sum of the shortest distances of each robot in the process of performing tasks, N is the number of individuals in the initial population, The discretized Northern Goshawk optimization algorithm uses the cost value corresponding to the task cell for calculation and update. The cost value is the average of the Euclidean distances from the initial cell to the task cell of the robot. The task unit and its corresponding cost value in the code are as follows:
[0016]
[0017] in, Path Task Cell The cost value, The terminal task cell The cost value of k , k is the number of robots.
[0018] Furthermore, the initial task code is updated by using a discretized northern goshawk optimization algorithm to perform a northern goshawk optimization operation to obtain an optimal task code sequence and a shortest path, specifically: Update the cost value corresponding to each task cell in the code, sort them in ascending order and evenly distribute them to each robot in turn. The update consists of the recognition phase update and the pursuit phase update. In the identification phase, starting from the first iteration, the objective function value is ,in, For the current individual, select the current population N The individual with the smallest objective function As a reference individual, the objective function value after updating in the identification phase satisfies , the recognition phase is updated using the following formula: ,in, For the current individual In the task cell j The corresponding cost value at each position is The optimal individual in the task cell is the reference j The corresponding cost value at the position is, r is a random number between [0,1], and I takes a random value of 1 or 2; The updated individual in the identification phase is , if the current individual is the best individual, it is directly retained; In the pursuit phase, after combining the Cauchy mutation method to update the pursuit phase, the pursuit phase update is performed using the following formula: , the individual after the pursuit phase is updated ,in, According to the Cauchy distribution The random disturbance generated, ,in w is the current iteration number, W is the total number of iterations; The discretized Northern Goshawk optimization algorithm updates the following parameters after completing the task encoding iteration: The optimal coding individual: ; robot i The optimal task sequence is: ; The path corresponding to the optimal task sequence: ; Shortest distance: ; The optimal objective function value: .
[0019] Furthermore, the auction algorithm comprises the following steps: Constructing the cost matrix V As shown below:
[0020] in, o is The number of remaining path tasks after the failure, z is the number of robots remaining after the failure, is the cost from the new cell position of the robot after the failure to the remaining task cell position, is the cost between the new cell position of the robot after the failure and the cell position of each task; Create a bidding price table and initialize the robot's bid for the task to 0, as shown in the following formula:
[0021] The first round has z Robot pair o Task bidding, set the minimum bidding price to , then the second task Assign to the first robot , as shown below:
[0022] Update the first robot in the cost matrix during the next bidding round The position of the second robot to bid for the task Position, the other robots' bids remain unchanged, and in the second round of bidding o -1 task, set the minimum bid to , the first task Assign to the second robot , as shown below:
[0023] Repeat the above process until all tasks are assigned, and then bid on the terminal tasks to obtain the tasks and sequences completed after each robot fails. The bidding for the terminal tasks is as follows: .
[0024] A task allocation system considering robot failure in fire rescue, comprising: The module for describing tasks with Boolean constraints is used to divide the global environment of fire rescue to obtain the divided fire rescue environment, initialize the robots in the divided fire rescue environment, and use Boolean constraints to formally describe the tasks of the robots to obtain the task descriptions of the robots with Boolean constraints; The module for calculating the shortest path and shortest distance of task cells is used to construct an adjacency matrix for the task cells in the divided fire rescue environment, and then obtain the shortest path and shortest distance between each task cell through Dijkstra algorithm preprocessing; The module for allocating initial tasks is used to encode the robot's task description with Boolean constraints and the terminal task to obtain the initial task encoding method, and to allocate all tasks to each robot according to the initial task encoding method; The initial task coding module is optimized to use the discretized northern goshawk optimization algorithm to perform northern goshawk optimization operation iteration and update task coding on the initial task coding method to obtain the optimal task coding sequence and the shortest path; The module for calculating the shortest path and shortest distance of the robot is used to decode the optimal task coding sequence and then calculate the shortest path and shortest distance of each robot by combining the shortest path and shortest distance between each task cell obtained by preprocessing; The task reallocation module after robot failure is used to update the global environment of fire rescue when a robot fails, and use the auction algorithm to reallocate the remaining tasks when the robot fails to the remaining robots, and output the shortest path of each robot before and after the failure and the total distance of all robots.
[0025] An electronic device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements a task allocation method taking robot failure into consideration in fire rescue when executing the computer program.
[0026] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, a task allocation method considering robot failures in fire rescue is implemented.
[0027] Compared with the prior art, the present invention has the following beneficial technical effects: The present invention proposes a task allocation method that takes robot failure into consideration in fire rescue, which allows the robot to move the shortest distance while meeting the rescue mission requirements, thereby effectively improving the robot rescue efficiency, reducing the risk at the fire scene, reducing casualties and property losses, and saving rescue time. It has good application prospects and practical significance. The tasks considered in the fire scene are relatively complex, and Boolean constraints can be used to describe complex tasks. At the same time, the execution order of tasks is random, which is essentially a type of combinatorial optimization problem. The different tasks selected by the robot and the different orders in the process of executing tasks will have a great impact on the robot's moving distance. Therefore, it is of great significance to consider how the robot reasonably selects tasks, how to reasonably select the order of executing tasks, and how to select an effective path to avoid obstacles. The present invention firstly stores the optimal path and the shortest distance between each cell through Dijkstra algorithm preprocessing; secondly, randomly generates tasks satisfying Boolean constraints through task coding and operates through discretized Northern Goshawk optimization algorithm to obtain the optimal coding individual, the optimal objective function value, and the optimal path of each robot; further considers that the robot fails at any time, then updates the robot set and the task set, and stores the information before the failure; uses the auction method to allocate the remaining tasks after the failure, and finally considers the two parts of the situation before and after the failure, finds the globally corresponding shortest moving path and the optimal path, and can be experimented on the Gazebo simulation software; the method proposed by the present invention can quickly find the optimal task sequence, the optimal task path and the corresponding shortest distance, greatly improves the rescue efficiency of the robot, can replace humans to complete complex task requirements, and effectively reduce the casualty rate of firefighters, and has good practical application prospects and practical significance.
[0028] Furthermore, the method proposed in the present invention is mainly designed for the task needs in the field of fire rescue. At the same time, it also has good application prospects in other rescue fields that have high requirements on the robustness of the robot system while considering robot failures. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] The drawings described herein are for explanation purposes only and are not intended to limit the scope of the present invention in any way. In addition, the shapes and proportional dimensions of the components in the drawings are only for illustration purposes to help understand the present invention, and are not intended to specifically limit the shapes and proportional dimensions of the components of the present invention. In the drawings: Figure 1 The present invention is a flowchart of a method for allocating tasks in consideration of robot failures during fire rescue.
[0030] Figure 2 This is a structural diagram of a task allocation system that takes robot failure into consideration during fire rescue according to the present invention.
[0031] Figure 3 This is an electronic device diagram of a task allocation method that takes robot failure into consideration during fire rescue according to the present invention.
[0032] Figure 4 This is a flowchart of a method for allocating tasks in fire rescue taking robot failure into consideration, provided in Embodiment 5 of the present invention.
[0033] Figure 5 This is the initial environment of the robot in the Gazebo simulation in Example 5.
[0034] Figure 6 This is the grid map that the robot initially corresponds to in Example 5.
[0035] Figure 7 This is an environmental diagram of the robot failure in Gazebo simulation in Example 5.
[0036] Figure 8 This is a schematic diagram of the optimal path corresponding to the robot in the grid map in Example 5.
[0037] Fig. 9 This is a flowchart of the operation process of using the Northern Goshawk algorithm in Example 5. DETAILED DESCRIPTION
[0038] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0039] Embodiment 1 See also Figure 1 ,A task allocation method considering robot failure in fire rescue, comprising the following steps: The fire rescue global environment is divided to obtain the divided fire rescue environment. After the robot in the divided fire rescue environment is initialized, the robot's task is formally described using Boolean constraints to obtain the robot's task description with Boolean constraints. After constructing the adjacency matrix of the task cells in the divided fire rescue environment, the shortest path and shortest distance between each task cell are obtained through Dijkstra algorithm preprocessing; After initial task encoding of the robot's task description with Boolean constraints, an initial task encoding method is obtained, and all tasks are assigned to each robot according to the initial task encoding method; The discretized Northern Goshawk optimization algorithm is used to iterate the Northern Goshawk optimization operation and update the task coding for the initial task coding method to obtain the optimal task coding sequence and the shortest path; After decoding the optimal task coding sequence, the shortest path and shortest distance between each task cell obtained by preprocessing are combined to calculate the shortest path and shortest distance of each robot; When a robot fails, the global environment of fire rescue is updated, and the auction algorithm is used to reallocate the remaining tasks when the robot fails to the robots that are not failed. The shortest path of each robot before and after the failure and the total distance of all robots are output.
[0040] The robot's tasks include the robot's path tasks, and the robot's path tasks include AND tasks, OR tasks, and non-tasks; and tasks represent the tasks that the robot must perform in the global environment of fire rescue; Or the task represents the task that the robot selectively performs in the global environment of fire rescue; Non-tasks represent task areas that the robot must always avoid in the global environment of fire rescue; The robot's task description with Boolean constraints is as follows:
[0041] in, For robot tasks with Boolean constraints, For the mission, represents the number of tasks that the robot must perform in the global environment of fire rescue; For non-task; represents the tasks that the robot selectively performs in the global environment of fire rescue, represents the number of tasks that the robot selectively performs in the global environment of fire rescue, , Indicates the robot's A group or task is in a collection Select a task to perform. For the Group or task.
[0042] The adjacency matrix is shown below:
[0043] in, M is a symmetric adjacency matrix of n×n. M The distance relationship between task cells in the divided fire rescue environment is stored in Represents adjacent cells and The distance between ,like , then the cell and They are not adjacent or cannot pass through; Calculate the adjacent cells using the Dijkstra algorithm and The shortest path between and the shortest distance And remove non-task cells in the adjacency matrix.
[0044] The initial task encoding is as follows:
[0045]
[0046]
[0047] in, represents the initial task encoding; It represents the task cells that satisfy the robot path task in the divided fire rescue environment. is the mapping of a task cell in the pathway task; Indicates the task cells that meet the robot's terminal task in the divided fire rescue environment; A mapping of a task cell in the endpoint task; 0 means the end of the current robot path task, and tasks are assigned in sequence starting from the first robot; all robots need to complete Pathway tasks and k The terminal tasks are randomly assigned to k A robot, represents the number of tasks that the robot must perform in the global environment of fire rescue, represents the number of tasks that the robot selectively performs in the global environment of fire rescue, k Indicates the number of robots in the divided fire rescue environment.
[0048] The objective function of the discretized northern goshawk optimization algorithm is as follows:
[0049] is the encoding, the objective function value For encoding The sum of the shortest distances of each robot in the process of performing tasks, N is the number of individuals in the initial population, The discretized Northern Goshawk optimization algorithm uses the cost value corresponding to the task cell for calculation and update. The cost value is the average of the Euclidean distance from the initial cell to the task cell of the robot. The task unit and its corresponding cost value in the encoding are as follows:
[0050]
[0051] in, Path Task Cell The cost value, The terminal task cell The cost value of k , k is the number of robots.
[0052] The initial task code is updated by using the discretized Northern Goshawk optimization algorithm to perform Northern Goshawk optimization operations to obtain the optimal task code sequence and the shortest path, specifically: Update the cost value corresponding to each task cell in the code, sort them in ascending order and evenly distribute them to each robot in turn. The update consists of the recognition phase update and the pursuit phase update. In the identification phase, starting from the first iteration, the objective function value is ,in, For the current individual, select the current population N The individual with the smallest objective function As a reference individual, the objective function value after updating in the identification phase satisfies , the recognition phase is updated using the following formula: ,in, For the current individual In the task cell j The corresponding cost value at each position is The optimal individual in the task cell is the reference j The corresponding cost value at the position is,r is a random number between [0,1], and I takes a random value of 1 or 2; The updated individual in the identification phase is , if the current individual is the best individual, it is directly retained; In the pursuit phase, after combining the Cauchy mutation method to update the pursuit phase, the pursuit phase update is performed using the following formula: , the individual after the pursuit phase is updated to ,in, According to the Cauchy distribution The random disturbance generated, ,in w is the current iteration number, W is the total number of iterations; The discretized Northern Goshawk optimization algorithm updates the following parameters after completing the task encoding iteration: The optimal coding individual: ;robot i The optimal task sequence is: ; The path corresponding to the optimal task sequence: ; Shortest distance: ; Optimal objective function value: .
[0053] The auction algorithm includes the following steps: Constructing the cost matrix V As shown below:
[0054] in, o is The number of remaining path tasks after the failure, z is the number of robots remaining after the failure, is the cost from the new cell position of the robot after the failure to the remaining task cell position, is the cost between the new cell position of the robot after the failure and the cell position of each task; Create a bidding price table and initialize the robot's bid for the task to 0, as shown in the following formula:
[0055] The first round has z Robot pair o Task bidding, set the minimum bidding price to , then the second task Assign to the first robot , as shown below:
[0056] Update the first robot in the cost matrix during the next bidding round The position of the second robot to bid for the task Position, the other robots' bids remain unchanged, and in the second round of bidding o -1 task, set the minimum bid to , the first task Assign to the second robot , as shown below:
[0057] Repeat the above process until all tasks are assigned, and then bid on the terminal tasks to obtain the tasks and sequences completed after each robot fails. The bidding for the terminal tasks is as follows: .
[0058] Embodiment 2 See also Figure 2 , a task allocation system considering robot failure in fire rescue, comprising: The module for describing tasks with Boolean constraints is used to divide the global environment of fire rescue to obtain the divided fire rescue environment, initialize the robots in the divided fire rescue environment, and use Boolean constraints to formally describe the tasks of the robots to obtain the task descriptions of the robots with Boolean constraints; The module for calculating the shortest path and shortest distance of task cells is used to construct an adjacency matrix for the task cells in the divided fire rescue environment, and then obtain the shortest path and shortest distance between each task cell through Dijkstra algorithm preprocessing; The module for allocating initial tasks is used to encode the robot's task description with Boolean constraints and the terminal task to obtain the initial task encoding method, and to allocate all tasks to each robot according to the initial task encoding method; The initial task coding module is optimized to use the discretized northern goshawk optimization algorithm to perform northern goshawk optimization operation iteration and update task coding on the initial task coding method to obtain the optimal task coding sequence and the shortest path; The module for calculating the shortest path and shortest distance of the robot is used to decode the optimal task coding sequence and then calculate the shortest path and shortest distance of each robot by combining the shortest path and shortest distance between each task cell obtained by preprocessing; The task reallocation module after robot failure is used to update the global environment of fire rescue when a robot fails, and use the auction algorithm to reallocate the remaining tasks when the robot fails to the remaining robots, and output the shortest path of each robot before and after the failure and the total distance of all robots.
[0059] Embodiment 3 See also Figure 3 , an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, a task allocation method considering robot failures in fire rescue described in Embodiment 1 is implemented.
[0060] Embodiment 4 A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for allocating tasks in fire rescue taking robot failure into consideration as described in Embodiment 1 is implemented.
[0061] Embodiment 5 Reference Figure 4 ,A task allocation method considering robot failure in fire rescue, comprising the following steps: Step 1: Model and divide the robot's environment, initialize the robot set and task positions, and give a task description with Boolean specifications; Step 2: Propose a coupled solution method, construct an adjacency matrix, obtain the shortest path and distance between each task cell through a preprocessing algorithm, and save them; Step 3: Perform task encoding and assign all tasks in the initial task set to each robot; Step 4: Extract the coding information and calculate the shortest path and shortest distance corresponding to each robot in the coding; Step 5: Design a coding method to discretize the northern goshawk optimization algorithm; Step 6: Perform northern goshawk optimization operation on the initial task code to complete the task code update; output the optimal task code sequence and the shortest path; Step 7: Consider the robot failure and update the environment; Step 8: Use the auction method to reallocate the remaining tasks to the remaining robots; Step 9: Output the shortest path of each robot before and after the fault and the total shortest distance of the system.
[0062] Step 1 is as follows: First, the global environment of fire rescue is rasterized and divided into n grid cells, using express; Indicates that there is k A robot; represents the initial unit position of the robot, where , k Robots kInitial cells, the environment Divide into mission area, Indicates the path task, Indicates the terminal task, is the set of endpoint tasks; the three types of path tasks described by Boolean constraints are “and”, “or” and “not”, respectively. , , express; Boolean constraint "AND task": represents the task that the robot must perform in the environment, using the set express, Indicates the number of tasks that must be executed. The "AND task" described by the Boolean constraint can be expressed as: ; Boolean constraint "or task": indicates the tasks that the robot can choose to perform in the map environment, using the set Indicates that Indicates the number of optional tasks that need to be performed, , ,like The first group or task of the robot system is in the set Select a task to perform. The robot system Groups or tasks are in the collection Select a task to execute in the Boolean constraint description. A group "or task" can be represented as: ; Boolean constraint "non-task": indicates the task area that the robot should always avoid in the map environment, using the set It indicates that among them there are There are task areas that need to prohibit paths. The "non-task" described by the Boolean constraint can be expressed as: ; Above , , The Boolean specification of task composition can be described as: .
[0063] Step 2 is as follows: Use Dijkstrs algorithm to preprocess the obtained n The shortest path and distance between grid cells are as follows: First, use the adjacency matrix M The distance relationship between cells in the storage environment, M is a The symmetric matrix is expressed as:
[0064] in , indicating adjacent cells and The distance between ,like and If they are not adjacent or cannot pass through, the distance , calculate the cell through Dijkstra algorithm and The shortest path between and the shortest distance And store them, and the "non" task cells are removed from the adjacency matrix and no longer considered.
[0065] Step three is as follows: and These are tasks that require robots to perform. express, represents the robot's terminal task; it is necessary to consider the path task , and terminal tasks Assigned to k To distinguish the path tasks of different robots, the number 0 is used as a separator to indicate the end of the path task of the current robot. Tasks are assigned in sequence starting from the first robot. represents the unit that satisfies the robot's path task and terminal task, where , ; According to the encoding method of the task, the robot system needs to complete Pathway tasks and The terminal tasks are randomly assigned to k A robot, is the mapping of a cell in the pathway task, A mapping of a cell in the endpoint task.
[0066] Step 4 is as follows: extract the task encoding method of step 3 to obtain the order in which each robot performs the task in turn, such as i The path task units of the robots are: , the terminal task unit is ; Insert robot i Initial position and the end position cell , call the data stored in the preprocessing method in step 2 to get the robot i Detailed path , Task Sequence and the shortest distance .
[0067] Step 5 is as follows: The encoding method of the method of this embodiment is to start from the task set , And the terminal task set Randomly select task cells from the , generate a set of initial codes, and then consider using the improved northern goshawk optimization algorithm (I_NGO) for iteration and update. The initial population is N Individuals, , the corresponding objective function , each of which Corresponding to a set of codes, the objective function value Specifically for encoding The sum of the shortest distances of each robot in the process of performing the task is the total shortest distance of the robot system; the cost value corresponding to the task cell is used for calculation and update during the algorithm update process, and the cost value is k The mean Euclidean distance from the initial cell to the task cell of each robot, and Robot The horizontal and vertical coordinates of the initial cell, and Pathway Task Cell The horizontal and vertical coordinates of and Terminal task cells The horizontal and vertical coordinates of the path task cell The cost value It can be expressed as: , the terminal task cell The cost value for: ,in k , the task units and their corresponding cost values in the encoding are as follows: ; .
[0068] Step 6 is as follows: N The improved northern goshawk algorithm optimization operation is performed on the coded individuals, which mainly includes two stages: identification and pursuit. Starting from the first iteration, the current individual , corresponding to the objective function value , is the sum of the shortest distances of all robots in the system; select the current population N The individual with the smallest objective function As a reference individual, use the formula Update, the objective function value satisfies ,in For the current individual In the task cell j The corresponding cost value at each position is The optimal individual in the task cell is the reference j The corresponding cost value at the position is, r is a random number between [0,1], I randomly takes the value 1 or 2; the individual updated in the identification stage is ; If the current individual is the best individual, it is directly retained; in the pursuit stage, the Cauchy mutation method is incorporated to increase the perturbation to further improve the quality of the solution and escape the local optimum, using the formula After updating, the updated individual is ,in, According to the Cauchy distribution The random disturbance generated, ,in w is the current iteration number, W is the total number of iterations; after the operation, the cost value corresponding to each task cell in the code is updated, sorted in ascending order and evenly distributed to each robot in turn. After the algorithm is iterated, the following operations are performed to update: The optimal coding individual: ;robot i The optimal task sequence is: ; The corresponding path: ; Shortest distance: ; The optimal objective function value of the system .
[0069] Step 7 is as follows: Assume that at a certain moment t , the robot malfunctions, k The probability of any robot failing is Satisfies exponential distribution ,in w is the current iteration number, W is the total number of iterations, is a coefficient; in practice, if one robot fails, the probability of subsequent robots failing is small; therefore k The probability of a robot failing is expressed as: ,in At the same time, in order to complete the task, at least one of the robots must not fail. Therefore, the probability of failure of all robots in the robot system can be expressed as: .
[0070] Update the robot collection after a failure, For malfunctioning robots, , the remaining robot set is , is a collection of completed path tasks. ; Represents a set of unfinished path tasks, specifically , considering that the terminal task is executed last, the remaining robots after the failure correspond to several terminal tasks; i Robot failures, corresponding to the paths completed before the failure , completed task sequence , total distance ; The initial position set of the robot after the failure is updated to .
[0071] Step 8 is as follows: After the failure, use the auction method to assign the remaining tasks to the remaining robots. Assuming that there are still o Pathway tasks, z robots, construct the cost matrix V :
[0072] The cost of storing the new cell position of the robot after the failure to the remaining task cell positions and the cost between each task cell location ; Start the auction algorithm, first create a bidding price table, and initialize the robot's bid for the task to 0, as shown below:
[0073] The first round has z Robot pair o Task bidding, assuming the minimum bid is , then the task Assign to the corresponding robot , as shown below:
[0074] The tasks performed by the method of this embodiment have a certain order, and are updated in the next round of bidding. Location to Position, the remaining robots have not won the task, so the corresponding bids remain unchanged, and the second round of bidding begins. o -1 task, assuming the minimum bid is , the task Assign to the corresponding robot , as shown below:
[0075] Repeat the above process until all tasks are assigned, and then bid for the terminal task, as shown below:
[0076] Finally, we can get the corresponding completed tasks after each robot fails. and sequence, such as i +1 robot: , corresponding to the completed path and the shortest distance after the fault .
[0077] Step 9 is as follows: If only the robot is i If a failure occurs, the shortest path is , the shortest distance is , specifically , ;robot i The shortest path and distance corresponding to +1 are and , specifically ; The overall objective function of the robot system .
[0078] The following is a specific example of task allocation considering failures of three robots in a fire rescue environment, using a task allocation method considering robot failures in fire rescue: Step 1: Model and divide the robot's environment, initialize the robot set and task position, and give a task description with Boolean specifications; the robot's initial environment map in this embodiment is as follows Figure 5 As shown, the robot's initial grid map is as follows Figure 6 As shown, , 3 robots, using the collection Indicates that the environment is divided into 20 areas, using indicates; among them Indicates that the robots are from cells , , Set off, Indicates that the robot needs to stay at the Area, the cells contained in the area are shown in Table 1 below: Table 1 The cells in the area where the robot needs to stay at the end
[0079] The path tasks are represented as follows: "With Tasks": Collection , indicating that the number of tasks that the robot must perform is 8, and the “AND task” described by the Boolean constraint is: ; "or task": collection ,in , indicating that the robot has a set of tasks to choose from. A task is randomly selected to execute, and the "or task" described by the Boolean constraint is: ; "Non-task": collection , which means that during the task execution, the robot must always avoid the above four areas. The "non-task" described by the Boolean constraint is: ; The Boolean specification for all tasks is:
[0080] Step 2: Propose a coupled solution method, construct an adjacency matrix, obtain the shortest path and distance between each task cell through a preprocessing algorithm, and store the data; the adjacency matrix in this embodiment for The distance between adjacent cells is 1, and the distance from any cell to the cells contained in the forbidden area is set to ; The distance between adjacent non-connected cells is also ; First, by Figure 6 The grid map can be written as an adjacency matrix : , , , , , , , , , , , , , , , , , ; Secondly, use the Dijkstra algorithm to obtain the shortest path between each cell except the prohibited area And the corresponding shortest distance , the data calculated in this embodiment are shown in Table 2: Table 2 The shortest path between cells And the corresponding shortest distance
[0081]
[0082] From the above data, when the robot is assigned to a task, the corresponding optimal path can be obtained, that is, the task and path are coupled and associated, without the need for repeated calculations, which greatly saves allocation efficiency.
[0083] Step 3: Perform task encoding and assign all tasks in the initial task set to each robot. In this embodiment, the tasks include 8 must-perform tasks, 1 group of optional tasks, and 3 terminal tasks. First, each robot randomly selects a task cell from the must-perform task area. Second, a task cell is randomly selected from the group of optional tasks and then randomly assigned to any robot. Further, a terminal task cell is randomly assigned to each robot. Finally, a 0 separator is inserted. For example, a set of randomly generated tasks is coded as follows: ; Indicates that the first robot needs to execute Task, the second robot needs to execute in sequence Task, the third robot needs to execute in sequence Tasks. Need to pay attention to meet The first position cannot be a 0 separator, the last position must be a 0 separator, and there cannot be two adjacent 0 separators to constrain each robot to perform the task. Step 4: Extract the coding information and calculate the shortest path and shortest distance corresponding to each robot in the coding; in this embodiment, the initial position of each robot is: , the encoding of step three Decoding can get The path task cells that need to be visited in sequence are: , the terminal task cell is ; Call the data in step 2 to get Corresponding task sequence ; Optimal path: , the shortest distance ; The same applies to other robots.
[0084] Step 5: Design a coding method to discretize the northern goshawk optimization algorithm; In this embodiment, the three robots perform a task area that includes 33 task cells, as shown in Table 1; The cost value of each task cell is the robot's cost from the initial cell position The mean of the Euclidean distance to the task cell location and the destination cell location is shown in Table 3 below: Table 3 Cost value of each task cell
[0085] In this embodiment, if a code randomly generated in the above steps is considered , then the corresponding cost value is: ,In the subsequent iterative update process of the algorithm, the cost value corresponding to each task cell is used for calculation.
[0086] Step 6: Perform an improved northern goshawk optimization operation on the initial task code to complete the task code update; output the optimal task code sequence and the shortest distance; see Fig. 9 In this embodiment, the number of goshawk individuals initially randomly generated is 30, and optimization operations are performed on all individuals, such as the current reference individual The code is From Table 3, we can get the cost value , the corresponding objective function value is , the best individual in the current population Encoded as , the cost value is , the corresponding objective function value Therefore, the reference individual needs to be updated in the direction of the optimal individual, calculated using the encoded cost value, and assigned to each robot in order from small to large to obtain the updated individual The code is , the updated objective function value is In this embodiment, the above operation is continuously performed until a better solution is obtained. In the 248th iteration: Encoded individuals: ; The optimal task sequence for the robot: ; ; ; Optimal path: ; ; ; Shortest distance: ; ; ; The optimal objective function value of the system: =58, the 12th individual is the best individual.
[0087] Step 7: Consider the robot failure and update the environment; the environment map after the failure is as follows Figure 7 As shown, in this embodiment, the robot speed is 1. t =8, robot 2 fails. , the remaining robots ; Path completed before failure:
[0088]
[0089] ; Total distance before failure .
[0090] The robot's initial position set after the failure is updated to: , completed tasks , remaining tasks .
[0091] Step 8: Use the auction method to reallocate the remaining tasks to the remaining robots; In this embodiment, there are 6 path tasks and 2 robots left after the failure. , , , The cost matrix is V :
[0092] Start the auction algorithm and initialize the robot's bid for the task to 0, as shown below:
[0093] In the first round, 2 robots bid for 6 tasks. The lowest bid is 0, so the task Assign to the corresponding robot , as shown below:
[0094] In the second round of bidding, there are still 5 tasks, and the minimum bid is , the task Assign to the corresponding robot , as shown below:
[0095] In the third round of bidding, there are still 4 tasks, and the minimum bid is , the task Assign to the corresponding robot , as shown below:
[0096] In the fourth round of bidding, there are still 3 tasks, and the lowest bid is 2.2. Assign to the corresponding robot , as shown below:
[0097] In the fifth round of bidding, there are still 2 tasks, and the minimum bid is 2.8. Assign to the corresponding robot , as shown below:
[0098] In the sixth round of bidding, there is still one task left, and the minimum bid is 3.6. Assign to the corresponding robot , as shown below:
[0099] At this point, the path tasks have been assigned, and the 3 end tasks are assigned. The minimum bid is 2. Assign to the corresponding robot , the task Assign to the corresponding robot , as shown below:
[0100] After the final failure, the tasks of each robot are: ; ; The task sequences are: ; ; The optimal path and shortest distance after the failure are: ; ; The shortest distances are: ; ; The shortest distance of the system .
[0101] Step 9: Output the shortest path of each robot before and after the fault and the total shortest distance of the system.
[0102] In this embodiment, three robots, initial position , The initial optimal encoding is: ,The specific paths before the robot fails are: ; ; ; At t=8, In case of a fault, the shortest distance of the system , the new position of the remaining robots after the failure , the specific paths after the failure are: ; ; The shortest distance of the system ; Therefore, during the operation of the system, the robot The optimal path is:
[0103] ; robot The optimal path is: ; robot The optimal path is:
[0104] ; The shortest distance of the system . The shortest distance of the system includes the two parts before and after the robot fails. During the operation, there is a robot A failure occurred, but the remaining robots still completed the task requirements of the Boolean constraints and achieved the shortest possible total distance of the system. The optimal path after the failure is as follows: Figure 8 shown.
[0105] This embodiment first uses the grid method to model the environment, gives a task area set, and associates the task with the optimal path through a preprocessing method according to the adjacency matrix, and stores the optimal path and the shortest distance information, and then gives the Boolean requirements of complex tasks considered in this method; secondly, a set of codes that meet the task requirements are randomly generated, and the northern goshawk algorithm combined with Cauchy mutation is used for optimization to obtain an initial better solution; further considering the situation where any robot fails, the robot set and the task set are updated after the failure, and the unfinished tasks are reallocated to the robot that has not failed using the auction method; considering the situation before and after the failure, the optimal path and the shortest moving distance of each robot are given; finally, experiments are carried out on the Gazebo simulation software to prove the effectiveness of this method. The present invention considers that the robot system, under the premise of meeting the task requirements and failure, makes the total moving distance the shortest, greatly reduces the movement cost of the robot, improves the work efficiency, and at the same time, the consideration of the failure situation also greatly improves the robustness of the robot system, ensures the stability and reliability in the rescue process, and has good application prospects and practical significance.
[0106] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0107] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
Claims
1. A task allocation method considering robot failure in fire rescue, characterized in that: The following steps are involved: The fire rescue global environment is divided to obtain the divided fire rescue environment. After the robot in the divided fire rescue environment is initialized, the robot's task is formally described using Boolean constraints to obtain the robot's task description with Boolean constraints. After constructing the adjacency matrix of the task cells in the divided fire rescue environment, the shortest path and shortest distance between each task cell are obtained through Dijkstra algorithm preprocessing; After initial task encoding of the robot's task description with Boolean constraints, an initial task encoding method is obtained, and all tasks are assigned to each robot according to the initial task encoding method; The discretized Northern Goshawk optimization algorithm is used to iterate the Northern Goshawk optimization operation and update the task coding for the initial task coding method to obtain the optimal task coding sequence and the shortest path; After decoding the optimal task coding sequence, the shortest path and shortest distance between each task cell obtained by preprocessing are combined to calculate the shortest path and shortest distance of each robot; When a robot fails, the global environment of fire rescue is updated, and the auction algorithm is used to reallocate the remaining tasks when the robot fails to the robots that are not failed. The shortest path of each robot before and after the failure and the total distance of all robots are output.
2. The method for task allocation in fire rescue considering robot failure according to claim 1, characterized in that: The robot's tasks include the robot's path tasks and end tasks, and the robot's path tasks include AND tasks, OR tasks, and non-tasks; The tasks represent the tasks that the robot must perform in the global environment of fire rescue; The or tasks represent tasks that the robot selectively performs in the global environment of fire rescue; The non-tasks represent tasks that the robot should always avoid in the global environment of fire rescue; The robot's task description with Boolean constraints is as follows: in, For robot tasks with Boolean constraints, For the mission, represents the number of tasks that the robot must perform in the global environment of fire rescue; For non-task; represents the tasks that the robot selectively performs in the global environment of fire rescue, represents the number of tasks that the robot selectively performs in the global environment of fire rescue, , Indicates the robot's A group or task is in a collection Select a task to perform. For the Group or task.
3. The method for task allocation in fire rescue considering robot failure according to claim 1, characterized in that: The adjacency matrix is shown below: in, M is a symmetric adjacency matrix of n×n. M The distance relationship between task cells in the divided fire rescue environment is stored in Represents adjacent cells and The distance between ,like , then the cell and They are not adjacent or cannot pass through; Calculate the adjacent cells using the Dijkstra algorithm and The shortest path between and the shortest distance And remove non-task cells in the adjacency matrix.
4. The method for task allocation in fire rescue considering robot failure according to claim 1, characterized in that: The initial task encoding is shown as follows: in, represents the initial task encoding; It represents the task cells that satisfy the robot path task in the divided fire rescue environment. is the mapping of a task cell in the pathway task; Indicates the task cells that meet the robot's terminal task in the divided fire rescue environment; A mapping of a task cell in the endpoint task; 0 means the end of the current robot path task, and tasks are assigned in sequence starting from the first robot; all robots need to complete Pathway tasks and k The terminal tasks are randomly assigned to k A robot, represents the number of tasks that the robot must perform in the global environment of fire rescue, represents the number of tasks that the robot selectively performs in the global environment of fire rescue, k Indicates the number of robots in the divided fire rescue environment.
5. The method for task allocation in fire rescue considering robot failure according to claim 1, characterized in that: The objective function of the discretized northern goshawk optimization algorithm is as follows: is the encoding, the objective function value For encoding The sum of the shortest distances of each robot in the process of performing tasks, N is the number of individuals in the initial population, The discretized Northern Goshawk optimization algorithm uses the cost value corresponding to the task cell for calculation and update. The cost value is the average of the Euclidean distances from the initial cell to the task cell of the robot. The task unit and its corresponding cost value in the code are as follows: in, Path Task Cell The cost value, The terminal task cell The cost value of k , k is the number of robots.
6. The method for task allocation in fire rescue considering robot failure according to claim 5, characterized in that: The initial task coding method uses a discretized northern goshawk optimization algorithm to perform a northern goshawk optimization operation to update the task coding, and obtains the optimal task coding sequence and the shortest path, specifically: Update the cost value corresponding to each task cell in the code, sort them in ascending order and evenly distribute them to each robot in turn. The update consists of the recognition phase update and the pursuit phase update. In the identification phase, starting from the first iteration, the objective function value is ,in, For the current individual, select the current population N The individual with the smallest objective function As a reference individual, the objective function value after updating in the identification phase satisfies , the recognition phase update is performed using the following formula: in, For the current individual In the task cell j The corresponding cost value at each position is The optimal individual in the task cell is the reference j The corresponding cost value at the position is, r is a random number between [0,1], and I takes a random value of 1 or 2; The updated individual in the identification phase is , if the current individual is the best individual, it is directly retained; In the pursuit phase, after combining the Cauchy mutation method to update the pursuit phase, the pursuit phase update is performed using the following formula: in, According to the Cauchy distribution The random disturbance generated by ,in w is the current iteration number, W is the total number of iterations, and the individual after stage update is ; The discretized Northern Goshawk optimization algorithm updates the following parameters after completing the task encoding iteration: The optimal coding individual: ; robot i The optimal task sequence is: ; The path corresponding to the optimal task sequence: ; Shortest distance: ; The optimal objective function value: .
7. The method for task allocation in fire rescue considering robot failure according to claim 1, characterized in that: The auction algorithm comprises the following steps: Constructing the cost matrix V As shown below: in, o is The number of remaining path tasks after the failure, z is the number of robots remaining after the failure, is the cost from the new cell position of the robot after the failure to the remaining task cell position, is the cost between the new cell position of the robot after the failure and the cell position of each task; Create a bidding price table and initialize the robot's bid for the task to 0, as shown in the following formula: The first round has z Robot pair o Task bidding, set the minimum bidding price to , then the second task Assign to the first robot , as shown below: Update the first robot in the cost matrix during the next bidding round The position of the second robot to bid for the task Position, the other robots' bids remain unchanged, and in the second round of bidding o -1 task, set the minimum bid to , the first task Assign to the second robot , as shown below: Repeat the above process until all tasks are assigned, and then bid on the terminal tasks to obtain the tasks and sequences completed after each robot fails. The bidding for the terminal tasks is as follows: 。 8. A task allocation system considering robot failure in fire rescue, characterized in that: include: The module for describing tasks with Boolean constraints is used to divide the global environment of fire rescue to obtain the divided fire rescue environment, initialize the robots in the divided fire rescue environment, and use Boolean constraints to formally describe the tasks of the robots to obtain the task descriptions of the robots with Boolean constraints; The module for calculating the shortest path and shortest distance of task cells is used to construct an adjacency matrix for the task cells in the divided fire rescue environment, and then obtain the shortest path and shortest distance between each task cell through Dijkstra algorithm preprocessing; The module for allocating initial tasks is used to encode the robot's task description with Boolean constraints and the terminal task to obtain the initial task encoding method, and to allocate all tasks to each robot according to the initial task encoding method; The initial task coding module is optimized to use the discretized northern goshawk optimization algorithm to perform northern goshawk optimization operation iteration and update task coding on the initial task coding method to obtain the optimal task coding sequence and the shortest path; The module for calculating the shortest path and shortest distance of the robot is used to decode the optimal task coding sequence and then calculate the shortest path and shortest distance of each robot by combining the shortest path and shortest distance between each task cell obtained by preprocessing; The task reallocation module after robot failure is used to update the global environment of fire rescue when a robot fails, and use the auction algorithm to reallocate the remaining tasks when the robot fails to the remaining robots, and output the shortest path of each robot before and after the failure and the total distance of all robots.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method for allocating tasks in fire rescue taking robot failures into consideration as described in any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the method for assigning tasks in consideration of robot failures in fire rescue as claimed in any one of claims 1 to 7.
Citation Information
Patent Citations
Multi-robot multi-target point rescue route planning method fit for after-calamity environment
CN105203097A
Multi-robot disaster search and rescue task assignment method based on improved BP neural network
CN108985580A
Robot optimal path planning method based on Boolean constraint
CN113819919A
Multi-target emergency material center site selection method based on improved hunter optimization algorithm
CN115907238A
Robot complex task path planning method and system under uncertain environment and motion
CN117075596A