Task allocation method, device and computer readable storage medium
By dynamically adjusting the task allocation method, when the number of tasks exceeds the number of robots, only one task is assigned to each robot, and adjustments are made when a task is completed or a new robot is added. This solves the task waiting problem and improves the flexibility and efficiency of task execution.
Patent Information
- Application Number
- CN201710748498.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2017-08-28
- Publication Date
- 2025-10-24
- Estimated Expiration
- 2037-08-28
AI Technical Summary
In existing technologies, when the number of tasks exceeds the number of mobile robots, multiple tasks may be assigned to a single mobile robot. This results in all tasks having to wait for the mobile robot to complete its current task before they can be executed, leading to poor flexibility and affecting the efficiency of task execution.
A task allocation method is provided, which obtains the number of multiple tasks and mobile robots in the target area. When the number of tasks is greater than the number of robots, a task is assigned to each robot. The task allocation is dynamically adjusted after a robot completes a task or when a new robot is added, so as to ensure flexible task allocation.
This improves the flexibility of task allocation and overall execution efficiency, ensuring that remaining tasks can be promptly assigned to other robots for execution, thus avoiding task backlog.
Smart Images

Figure CN109426560B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of big data, and particularly relates to a task allocation method and device and a computer readable storage medium. BACKGROUND
[0002] At present, various mobile robots such as warehouse robots, sweeping robots, agricultural robots and patrol robots have been born, which can replace users to perform related tasks, such as carrying goods in a warehouse, sweeping the floor in an office, weeding on a lawn, harvesting crops in a field and the like, thereby saving labor cost and time cost and improving the efficiency of performing tasks, and bringing great convenience to people's life.
[0003] Taking a sweeping robot as an example, when multiple sweeping robots need to perform the task of sweeping a warehouse, a certain sweeping area is allocated to each sweeping robot according to the total area of the warehouse and the sweeping capacity of each sweeping robot, and the sweeping area determined for the sweeping robot with stronger sweeping capacity is larger.
[0004] In the process of implementing the embodiments of the present application, the inventors have found that the related art at least has the following problems:
[0005] The above task allocation method does not consider the number of tasks allocated to the mobile robot, and when the number of tasks is greater than the number of mobile robots, multiple tasks may be allocated to a certain mobile robot, and then these tasks have to wait for the mobile robot to complete the current task before being executed, and cannot be allocated to other mobile robots, which is poor in flexibility and affects the efficiency of performing tasks. SUMMARY
[0006] Embodiments of the present application provide a task allocation method, device and computer readable storage medium, which can solve the problem that the tasks that have been allocated but not executed in the related art cannot be allocated to other mobile robots. The technical solution is as follows:
[0007] In a first aspect, a task allocation method is provided, and the method comprises:
[0008] obtaining a plurality of tasks in a target area, the number of the plurality of tasks being a first number;
[0009] determining a plurality of mobile robots, the number of the plurality of mobile robots being a second number;
[0010] when the first number is greater than the second number, allocating one task to each mobile robot from the plurality of tasks.
[0011] In a possible implementation, after the step of assigning one task to each mobile robot from the plurality of tasks when the first number is greater than the second number, the method further includes:
[0012] selecting one task from the plurality of tasks that have not been assigned to assign to a first mobile robot in the plurality of mobile robots when the first mobile robot completes execution of a task;
[0013] selecting one task from the plurality of tasks that have not been assigned to assign to a second mobile robot when a new second mobile robot is added.
[0014] In another possible implementation, after the step of assigning one task to each mobile robot from the plurality of tasks when the first number is greater than the second number, the method further includes:
[0015] selecting a fourth mobile robot from the plurality of mobile robots that have not been assigned a task when a third mobile robot that has been assigned a first task in the plurality of tasks cancels execution of the first task;
[0016] assigning the first task to the fourth mobile robot.
[0017] In another possible implementation, the step of assigning one task to each mobile robot from the plurality of tasks when the first number is greater than the second number includes:
[0018] determining a current position of each mobile robot in the plurality of mobile robots;
[0019] calculating a generation value of each task executed by the each mobile robot respectively according to the current position of the each mobile robot;
[0020] determining a specified task assignment scheme with a minimum total generation value from a plurality of task assignment schemes according to the plurality of calculated generation values, each task assignment scheme in the plurality of task assignment schemes including one task uniquely corresponding to the each mobile robot.
[0021] In another possible implementation, the step of obtaining the plurality of tasks in the target area includes:
[0022] obtaining a plurality of sub-areas in the target area, each sub-area including at least one passage, and each passage including a plurality of grids;
[0023] obtaining a task of each passage to obtain the plurality of tasks, each task being to move from a starting grid of the corresponding passage to an ending grid of the passage along the passage.
[0024] In a possible implementation, the calculating the cost value of each task performed by each mobile robot respectively comprises:
[0025] For each mobile robot and each task, a moving path of the mobile robot moving from a start grid of a corresponding channel to an end grid of the channel is calculated;
[0026] The cost value of the mobile robot performing the task is calculated according to the moving path.
[0027] In a possible implementation, the calculating the cost value of the mobile robot performing the task according to the moving path comprises:
[0028] The moving distance corresponding to the moving path is obtained, and the moving distance is taken as the cost value of the mobile robot performing the task.
[0029] In a possible implementation, the calculating the cost value of the mobile robot performing the task according to the moving path comprises:
[0030] The moving distance corresponding to the moving path is obtained;
[0031] The income of the task is obtained, and the income is positively correlated with the priority of the task;
[0032] The difference between the moving distance and the income is calculated as the cost value of the mobile robot performing the task.
[0033] In a possible implementation, the target area comprises a plurality of sub-areas, each sub-area comprises at least one channel, the number of channels with the highest income of tasks in each sub-area is at least one, and the highest incomes of different sub-areas are equal.
[0034] In a possible implementation, the channel with the highest income of tasks in each sub-area is the first channel, the end grid of any channel in each sub-area is adjacent to the start grid of an adjacent channel, and the income of tasks of each channel in each sub-area decreases in turn according to a decreasing amplitude.
[0035] In a possible implementation, the determining the specified task allocation scheme with the minimum total cost value from the plurality of task allocation schemes of the tasks performed by each mobile robot comprises:
[0036] The plurality of generation values are composed into a generation value matrix, a first dimension of the generation value matrix is the mobile robots, a second dimension of the generation value matrix is the tasks, and an element in the generation value matrix is a generation value when a corresponding mobile robot performs a corresponding task;
[0037] A preset task allocation algorithm is used to obtain a matching matrix corresponding to the generation value matrix, an element in the matching matrix is a matching coefficient between a corresponding mobile robot and a corresponding task;
[0038] The mobile robots and the tasks corresponding to the matching coefficients equal to the specified value in the matching matrix are composed into a matching combination, a plurality of matching combinations are obtained, and the plurality of matching combinations constitute the specified allocation scheme.
[0039] In another possible implementation, the specified task allocation scheme with the smallest total generation value among the plurality of task allocation schemes in which each mobile robot performs a task is determined according to the plurality of calculated generation values, and the method comprises the following steps.
[0040] A capacity network is constructed, the capacity network comprises a source node, a sink node, a robot node corresponding to each mobile robot, and a task node corresponding to each task, the source node and each robot node are connected by a first type of path, each robot node and each task node are connected by a second type of path, and each task node and the sink node are connected by a third type of path;
[0041] The cost of each first type of path and each third type of path in the capacity network is configured as 0, and the cost of each second type of path is configured as a generation value when a mobile robot corresponding to a connected robot node performs a task corresponding to a connected task node;
[0042] A minimum cost maximum flow algorithm is used to obtain a plurality of second type of paths that are passed through when the total cost of the capacity network is the smallest and the total flow is the largest;
[0043] The mobile robots corresponding to the connected robot nodes and the tasks corresponding to the connected task nodes in the same second type of path in the plurality of second type of paths are composed into a matching combination, a plurality of matching combinations are obtained, and the plurality of matching combinations constitute the specified allocation scheme.
[0044] In another possible implementation, the plurality of sub-regions in the target region are obtained, each sub-region comprises at least one channel, and the method comprises the following steps.
[0045] The target region is divided into a plurality of grids, each grid has the same size, and a grid containing an obstacle is an obstacle grid;
[0046] partitioning grids in the target region other than the obstacle grids to obtain a plurality of sub-regions;
[0047] For each sub-region, the sub-region is divided into at least one channel with a length equal to the length of the sub-region and a width equal to one grid.
[0048] In another possible implementation, the partitioning of the grids in the target region other than the obstacle grids to obtain a plurality of sub-regions comprises:
[0049] In the process of scanning the target region once, when a first position where connectivity changes is scanned, and then a second position where connectivity changes is scanned, the region between the first position and the second position is divided according to the positions of the obstacle grids to obtain at least one sub-region, so that different sub-regions are separated by the obstacle grids.
[0050] The connectivity change refers to a change in the distribution of the obstacle grids.
[0051] In a second aspect, a task allocation apparatus is provided, and the apparatus comprises:
[0052] An acquisition module configured to acquire a plurality of tasks in a target region, wherein the number of the plurality of tasks is a first number;
[0053] A determination module configured to determine a plurality of mobile robots, wherein the number of the plurality of mobile robots is a second number;
[0054] An allocation module configured to allocate one task to each mobile robot from the plurality of tasks when the first number is greater than the second number.
[0055] In a possible implementation, the allocation module is further configured to select one task from the plurality of tasks that have not been allocated and allocate the task to a first mobile robot in the plurality of mobile robots when the first mobile robot completes execution of the task; or
[0056] The allocation module is further configured to select one task from the plurality of tasks that have not been allocated and allocate the task to a second mobile robot when the second mobile robot is added.
[0057] In another possible implementation, the allocation module is further configured to select a fourth mobile robot from the plurality of mobile robots that have not been allocated a task when a third mobile robot that has been allocated a first task in the plurality of tasks cancels execution of the first task; and allocate the first task to the fourth mobile robot.
[0058] In another possible implementation, the allocation module comprises:
[0059] determine a current position of each mobile robot in the plurality of mobile robots;
[0060] calculate a cost value of each task performed by each mobile robot according to the current position of each mobile robot;
[0061] The determining sub-module is further configured to determine a specified task allocation scheme with a minimum total cost value from a plurality of task allocation schemes according to the plurality of calculated cost values, each task allocation scheme in the plurality of task allocation schemes including one task corresponding to each mobile robot uniquely.
[0062] In another possible implementation, the obtaining module is further configured to obtain a plurality of sub-regions in the target region, each sub-region including at least one channel, and each channel including a plurality of grids;
[0063] The obtaining module is further configured to obtain a task of each channel to obtain the plurality of tasks, each task being from a starting grid of a corresponding channel to a terminal grid of the channel.
[0064] In another possible implementation, the calculating sub-module is further configured to, for each mobile robot and each task, calculate a movement path of the mobile robot from a starting grid of a corresponding channel to a terminal grid of the channel, and calculate a cost value of the mobile robot performing the task according to the movement path.
[0065] In another possible implementation, the calculating sub-module is further configured to obtain a movement distance corresponding to the movement path, and take the movement distance as the cost value of the mobile robot performing the task.
[0066] In another possible implementation, the calculating sub-module is further configured to obtain a movement distance corresponding to the movement path, and obtain a benefit of the task, the benefit being positively correlated with a priority of the task; and calculate a difference between the movement distance and the benefit as the cost value of the mobile robot performing the task.
[0067] In another possible implementation, the target region includes a plurality of sub-regions, each sub-region including at least one channel, and a number of channels with a highest benefit of tasks in each sub-region being at least one, and the highest benefits of different sub-regions being equal.
[0068] In another possible implementation, the first channel in each sub-region has the highest benefit, and the ending grid of any channel in each sub-region is adjacent to the starting grid of an adjacent channel, and the benefits of the tasks of the channels in each sub-region decrease in turn in a decreasing amplitude.
[0069] In another possible implementation, the determining sub-module comprises:
[0070] The component unit is configured to compose a plurality of generation value matrices from the plurality of generation values, a first dimension of each generation value matrix is a mobile robot, a second dimension of each generation value matrix is a task, and an element in each generation value matrix is a generation value when a corresponding mobile robot performs a corresponding task;
[0071] The obtaining unit is configured to obtain a matching matrix corresponding to the generation value matrix by using a preset task allocation algorithm, and an element in the matching matrix is a matching coefficient between a corresponding mobile robot and a corresponding task.
[0072] The component unit is further configured to group the mobile robots and the tasks corresponding to the matching coefficients equal to a specified value in the matching matrix into a matching combination, to obtain a plurality of matching combinations, and to form the specified allocation scheme by using the plurality of matching combinations.
[0073] In another possible implementation, the determining sub-module comprises:
[0074] The constructing unit is configured to construct a capacity network, the capacity network comprising a source node, a sink node, a robot node corresponding to each mobile robot, and a task node corresponding to each task, the source node and each robot node being connected by a first type of path, each robot node and each task node being connected by a second type of path, and each task node and the sink node being connected by a third type of path.
[0075] The configuring unit is configured to configure the cost of each first type of path and each third type of path in the capacity network as 0, and configure the cost of each second type of path as a generation value when a mobile robot corresponding to a connected robot node performs a task corresponding to a connected task node.
[0076] The obtaining unit is configured to obtain a plurality of second type of paths that are passed through when the total cost of the capacity network is minimum and the total flow is maximum by using a minimum cost maximum flow algorithm.
[0077] The component unit is configured to group the mobile robots corresponding to the robot nodes connected by a same second type of path in the plurality of second type of paths and the tasks corresponding to the task nodes connected by the same second type of path into a matching combination, to obtain a plurality of matching combinations, and to form the specified allocation scheme by using the plurality of matching combinations.
[0078] In another possible implementation manner, the acquisition module further includes:
[0079] The division sub-module is configured to divide the target region into a plurality of grids, each grid having the same size, and a grid containing an obstacle being an obstacle grid.
[0080] The partition sub-module is configured to partition the grids in the target region except the obstacle grids to obtain a plurality of sub-regions.
[0081] The division sub-module is configured to divide each sub-region into at least one channel having a length equal to a length of the sub-region and a width equal to one grid.
[0082] In another possible implementation manner, the division sub-module is configured to, in a process of scanning the target region once, when a first position where connectivity changes is scanned, and then a second position where connectivity changes is scanned, divide a region between the first position and the second position according to positions of the obstacle grids to obtain at least one sub-region, so that different sub-regions are separated by the obstacle grids.
[0083] The connectivity change refers to a change in distribution of the obstacle grids.
[0084] In a third aspect, a distribution device is provided, and the distribution device includes a processor and a memory; the memory is used to store a computer program; and the processor is used to execute the computer program stored in the memory to implement the method steps in the first aspect.
[0085] In a fourth aspect, a computer readable storage medium is provided, and the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the method steps in the first aspect.
[0086] The technical scheme provided by the embodiments of the present application has the following beneficial effects:
[0087] The method, device and computer readable storage medium provided by the embodiments of the present application consider the number of tasks allocated to the mobile robots in the process of allocating tasks, and only one task is allocated to each mobile robot, and the remaining tasks are in a state of waiting for allocation, so as to be allocated to other mobile robots subsequently, thereby improving flexibility and improving the overall execution efficiency of the tasks. BRIEF DESCRIPTION OF DRAWINGS
[0088] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings needed in the embodiments description. Obviously, the drawings in the following description only show some embodiments of the present application, and all other drawings obtained by those of ordinary skill in the art based on these drawings without creative effort should fall within the scope of the present application.
[0089] Figure 1 is a schematic diagram of an implementation environment provided by an embodiment of the present application;
[0090] Figure 2 is a flowchart of a task allocation method provided by an embodiment of the present application;
[0091] Figure 3A is a flowchart of a task allocation method provided by an embodiment of the present application;
[0092] Figure 3B is a schematic diagram of dividing a target region into a plurality of sub-regions provided by an embodiment of the present application;
[0093] Figure 3C is a schematic diagram of dividing a sub-region into at least one channel provided by an embodiment of the present application;
[0094] Figure 3D is a flowchart of a task allocation method provided by an embodiment of the present application;
[0095] Figure 3E is a schematic diagram of a capacity network provided by an embodiment of the present application;
[0096] Figure 4 is a structural schematic diagram of a task allocation apparatus provided by an embodiment of the present application;
[0097] Figure 5 is a structural schematic diagram of a terminal provided by an embodiment of the present application;
[0098] Figure 6 is a structural schematic diagram of a server provided by an embodiment of the present application. DETAILED DESCRIPTION
[0099] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of the present application.
[0100] Embodiments of the present application take the number of tasks as the first number and the number of mobile robots as the second number as an example for illustration, wherein the first number is greater than the second number. In addition, the first, second, third and fourth are only for the convenience of distinguishing description and do not contain other special meanings.
[0101] Embodiments of the present application take the mobile robot that completes the task as the first mobile robot, the newly added mobile robot as the second mobile robot, the mobile robot that cancels the task (such as the mobile robot that fails or the mobile robot that is assigned to perform other tasks) as the third mobile robot, and the mobile robot that is redistributed by the task of the third mobile robot as the fourth mobile robot as an example for illustration, wherein the first, second, third and fourth are only for the convenience of distinguishing description and do not contain other special meanings.
[0102] Figure 1 is a schematic diagram of an implementation environment provided by an embodiment of the present application, which includes: a distribution device 101 and a plurality of mobile robots 102, the distribution device 101 and the plurality of mobile robots 102 respectively establish a connection, and can communicate through the established connection, the connection includes a wireless fidelity (Wireless Fidelity, WI-FI) connection, a data network connection, etc.
[0103] When the plurality of mobile robots 102 need to perform tasks in the target area, the distribution device 101 is used to distribute tasks for each mobile robot 102, and each mobile robot 102 is used to perform the distributed task. Wherein, the distribution device 101 can be a computer, a mobile phone or a server, etc., and the mobile robot 102 can be a warehouse robot, a sweeping robot, an agricultural robot, a patrol robot, etc.
[0104] Figure 2 is a flowchart of a task distribution method provided by an embodiment of the present application. The execution subject of the embodiment of the present application is a distribution device, see Figure 2 , the method comprises:
[0105] 201, obtain a plurality of tasks in a target area, the number of the plurality of tasks is a first number.
[0106] 202, determine a plurality of mobile robots, the number of the plurality of mobile robots is a second number.
[0107] 203, when the first number is greater than the second number, distribute a task for each mobile robot from the plurality of tasks.
[0108] The method provided by the embodiment of the application considers the number of tasks assigned to the mobile robots in the process of assigning tasks, and only assigns one task to each mobile robot, and the remaining tasks are in a state of being to be assigned, so as to be subsequently assigned to other mobile robots, thereby improving flexibility and improving the overall execution efficiency of the tasks.
[0109] Optionally, after the one task is assigned to each mobile robot from the plurality of tasks when the first number is greater than the second number, the method further comprises:
[0110] when a first mobile robot in the plurality of mobile robots completes execution of a task, selecting one task from the plurality of tasks that have not been assigned to assign to the first mobile robot; or,
[0111] when a new second mobile robot is added, selecting one task from the plurality of tasks that have not been assigned to assign to the second mobile robot.
[0112] Optionally, after the one task is assigned to each mobile robot from the plurality of tasks when the first number is greater than the second number, the method further comprises:
[0113] when a third mobile robot that has been assigned a first task in the plurality of tasks cancels execution of the first task, selecting a fourth mobile robot from the plurality of mobile robots that have not been assigned a task;
[0114] assigning the first task to the fourth mobile robot.
[0115] Optionally, the assigning one task to each mobile robot from the plurality of tasks when the first number is greater than the second number comprises:
[0116] determining a current position of each mobile robot in the plurality of mobile robots;
[0117] calculating a generation value of each task executed by each mobile robot according to the current position of each mobile robot;
[0118] determining a specified task assignment scheme with a minimum total generation value from a plurality of task assignment schemes according to the plurality of calculated generation values, each task assignment scheme in the plurality of task assignment schemes comprising one task uniquely corresponding to each mobile robot.
[0119] Optionally, the obtaining the plurality of tasks in the target area comprises:
[0120] obtaining a plurality of sub-areas in the target area, each sub-area comprising at least one channel, and each channel comprising a plurality of grids;
[0121] obtaining a task of each channel to obtain the plurality of tasks, each task being from a start grid of a corresponding channel to a terminal grid of the channel along the channel.
[0122] Optionally, the cost value of each mobile robot performing each task is calculated according to the current position of each mobile robot, including:
[0123] For each mobile robot and each task, a movement path of the mobile robot moving to a start grid corresponding to the task is calculated, the task being from a start grid of a corresponding channel to a terminal grid of the channel along the channel.
[0124] The cost value of the mobile robot performing the task is calculated according to the movement path.
[0125] Optionally, the cost value of the mobile robot performing the task is calculated according to the movement path, including:
[0126] The movement distance corresponding to the movement path is obtained, and the movement distance is taken as the cost value of the mobile robot performing the task.
[0127] Optionally, the cost value of the mobile robot performing the task is calculated according to the movement path, including:
[0128] The movement distance corresponding to the movement path is obtained.
[0129] The income of the task is obtained, the income being positively related to the priority of the task.
[0130] The difference between the movement distance and the income is calculated as the cost value of the mobile robot performing the task.
[0131] Optionally, the target area includes a plurality of sub-areas, each sub-area including at least one channel, the number of channels with the highest income of tasks in each sub-area being at least one, and the highest income of different sub-areas being equal.
[0132] Optionally, the first channel in each sub-area has the highest income of tasks, and the terminal grid of any channel in each sub-area is adjacent to the start grid of an adjacent channel, and the income of tasks of each channel in each sub-area decreases in turn according to a decreasing amplitude.
[0133] Optionally, the specified task allocation scheme with the minimum total cost value among the plurality of task allocation schemes of the tasks performed by each mobile robot is determined according to the plurality of calculated cost values, including:
[0134] The plurality of generation values is composed into a generation value matrix, a first dimension of the generation value matrix is the mobile robots, a second dimension of the generation value matrix is the tasks, and an element in the generation value matrix is a generation value when a corresponding mobile robot performs a corresponding task;
[0135] A preset task allocation algorithm is adopted to obtain a matching matrix corresponding to the generation value matrix, an element in the matching matrix is a matching coefficient between a corresponding mobile robot and a corresponding task;
[0136] The mobile robots and the tasks corresponding to the matching coefficients equal to the specified value in the matching matrix are composed into a matching combination, a plurality of matching combinations are obtained, and the plurality of matching combinations constitute the specified allocation scheme.
[0137] Optionally, the specified task allocation scheme with the smallest total generation value among the plurality of task allocation schemes in which each mobile robot performs a task is determined according to the plurality of calculated generation values, and the specified task allocation scheme includes:
[0138] A capacity network is constructed, the capacity network includes a source node, a sink node, a robot node corresponding to each mobile robot, and a task node corresponding to each task, the source node and each robot node are connected by a first type of path, each robot node and each task node are connected by a second type of path, and each task node and the sink node are connected by a third type of path;
[0139] The cost of each first type of path and each third type of path in the capacity network is configured as 0, and the cost of each second type of path is configured as a generation value when a mobile robot corresponding to a connected robot node performs a task corresponding to a connected task node;
[0140] A minimum cost maximum flow algorithm is adopted to obtain a plurality of second type of paths that are passed through when the total cost of the capacity network is the smallest and the total flow is the largest, the paths being from the source node to the sink node;
[0141] The mobile robots corresponding to the connected robot nodes and the tasks corresponding to the connected task nodes in the same second type of path in the plurality of second type of paths are composed into a matching combination, a plurality of matching combinations are obtained, and the plurality of matching combinations constitute the specified allocation scheme.
[0142] Optionally, the target area is divided into a plurality of sub-areas, each sub-area includes at least one channel, and the method includes:
[0143] The target area is divided into a plurality of grids, each grid has the same size, and a grid containing an obstacle is an obstacle grid;
[0144] The grids in the target area except the obstacle grids are partitioned to obtain a plurality of sub-areas;
[0145] For each sub-region, the sub-region is divided into at least one channel with a length equal to the length of the sub-region and a width equal to one grid.
[0146] Optionally, the grid in the target region except the obstacle grid is partitioned to obtain a plurality of sub-regions, including:
[0147] In the process of scanning the target region once, when a first position where the connectivity changes is scanned, and then a second position where the connectivity changes is scanned, the region between the first position and the second position is divided according to the position of the obstacle grid to obtain at least one sub-region, so that different sub-regions are separated by the obstacle grid.
[0148] Wherein, the connectivity change refers to the change of the distribution of the obstacle grid.
[0149] The embodiment of the application provides a distribution scheme for the mobile robot to perform the task in the target region, considers the number of tasks distributed by the mobile robot, and ensures that the remaining tasks can be in a state to be distributed, so as to be executed by the mobile robot that has completed the execution of the task, and of course, the new mobile robot added in the system can also execute, thereby greatly improving the flexibility and the efficiency of executing the task.
[0150] The embodiment of the application can be applied to various scenes, and the target region and the task can be determined according to the actual scene of application. For example, when applied to the scene of finding a shelf in a warehouse, the target region is the warehouse, and the task is to find a target object; when applied to the scene of harvesting crops in a field, the target region is the field, and the task is to harvest crops; when applied to the scene of cleaning a mansion, the target region is the mansion, and the task is to clean. In addition, it can also be applied to the scenes of weeding in a lawn, carrying goods in a construction site, and the like, and will not be described here.
[0151] Especially, the embodiment of the application can be applied to the scene of "full area coverage", and the task of the scene is to traverse each position in the target region, and the embodiment of the application divides the target region into a plurality of channels, controls each mobile robot to move along the corresponding channel, and finally realizes the effect of traversing each position in the target region.
[0152] Figure 3A is a flowchart of a task distribution method provided by the embodiment of the application, and the method can be applied to Figure 1 the implementation environment shown in the figure, the interactive subject includes a distribution device and a plurality of mobile robots, referring to Figure 3A , the method includes:
[0153] 301, the distribution device acquires a plurality of tasks in the target region, and the number of the plurality of tasks is a first number.
[0154] For the process of determining the target region for the allocation device, the allocation device can install a mapping application, and in the process of running the mapping application, detect the operation of the user drawing the target region, so as to obtain the target region. Alternatively, the allocation device can obtain the map data imported by the user, or download the map data from the server, so as to select the target region from the map data.
[0155] In order to make the plurality of mobile robots perform division to share the overall task amount, the embodiment of the application refines and splits the target region: the target region is divided into a plurality of sub-regions, and each sub-region is further divided into at least one channel, and each mobile robot only needs to be responsible for the task of one channel at a time.
[0156] Specifically, the process of splitting the target region can include the following steps 3011-3013:
[0157] 3011, divide the target region into a plurality of grids.
[0158] In the embodiment of the application, the grid is the smallest unit for the target region to be divided, or the smallest unit for the mobile robot to move. The size of each grid is the same, for example, the size of each grid can be equal to the size of the mobile robot. Further, the length and width of each grid can also be the same, and the width of each grid can be equal to the width of the mobile robot, and the length of each grid can be equal to the length of the mobile robot.
[0159] For the grid containing an obstacle in the target region, the allocation device will set such a grid as an obstacle grid, and the subsequent process of dividing the sub-region will exclude the obstacle grid, so that the sub-region obtained by division and the channel obtained further will not contain the obstacle grid, and the subsequent mobile robot will not pass through the obstacle grid when performing the task along the channel, so as to avoid the obstacle and prevent the mobile robot from falling or being damaged due to the obstacle.
[0160] Among them, the allocation device can detect the selection operation on any grid in the target region, and take the grid selected by the user as the obstacle grid. Alternatively, the allocation device can analyze the map data in the target region to determine the obstacle in the map data, and take the position of the obstacle as the obstacle grid.
[0161] 3012, partition the grids in the target region except the obstacle grid to obtain a plurality of sub-regions.
[0162] For the grids except the obstacle grid, the allocation device will partition these grids according to the position of the obstacle grid to obtain a plurality of rectangular sub-regions, and different sub-regions are separated by the obstacle grid.
[0163] Specifically, the distribution device can adopt a Boustrophedon decomposition method, and scan in a target region along a certain scanning direction. In a scanning process, when a first position where connectivity changes is scanned, and then a second position where connectivity changes is scanned, the region between the first position and the second position is segmented according to the positions of the obstacle grids to obtain at least one sub-region. The scanning direction can be a direction of any edge of the target region, such as a horizontal direction or a vertical direction. Connectivity changes refer to changes in the distribution of obstacle grids.
[0164] In actual application, the target region can be a two-dimensional region, and the first position and the second position can be represented by a first straight line and a second straight line in the target region, respectively. Taking a third direction as the scanning direction, the distribution device can scan along the third direction in the target region. When the first straight line is scanned and the connectivity changes, and then the second straight line is scanned and the connectivity changes again, the region between the first straight line and the second straight line can be segmented according to the positions of the obstacle grids to obtain at least one sub-region.
[0165] The first straight line and the second straight line point to a fourth direction perpendicular to the third direction, and the connectivity changes refer to changes in the distribution of obstacle grids in the fourth direction. For example, when the third direction is a horizontal direction, the first straight line and the second straight line point to a vertical direction. The critical line between two columns of grids can be a straight line formed by connecting the edges of any column of grids in the target region. The connectivity changes refer to the fact that the distribution of obstacle grids in one column of grids before the current scanned position is different from the distribution of obstacle grids in one column of grids after the current scanned position. The distribution of obstacle grids includes the positions and quantities of obstacle grids.
[0166] In an example scenario, see Figure 3B which shows a schematic diagram of dividing a target region into multiple sub-regions, wherein the grids marked with X represent obstacle grids, and the region surrounded by the thick line frame and including the label is a sub-region obtained by division.
[0167] In the process of dividing the sub-region, scanning is performed from left to right, i.e., from the first column of grids to the last column of grids. When the position of the first straight line is scanned, since the fourth grid in the fourth column is an obstacle grid, and the fourth grid in the third column is not an obstacle grid, it is determined that the connectivity changes. When the position of the second straight line is scanned, since the fourth grid in the sixth column is an obstacle grid, and the fourth grid in the seventh column is not an obstacle grid, it is determined again that the connectivity changes. Therefore, the multiple grids between the first straight line and the second straight line are segmented according to the positions of the obstacle grids to obtain sub-region 2 and sub-region 3. The division processes of other sub-regions are similar.
[0168] 3013、For each sub-region, the sub-region is divided into at least one channel, each channel has a length equal to the length of the sub-region and a width equal to one grid.
[0169] When the target region is divided into a plurality of sub-regions, for each sub-region, the allocation device divides the sub-region into at least one channel, each channel has a length equal to the length of the corresponding sub-region and a width equal to one grid. For example, the allocation device can determine a first direction and a second direction of the sub-region, divide the sub-region in the first direction every other grid to obtain at least one channel along the second direction, each channel includes one grid in the first direction and a number of grids in the second direction equal to the number of grids included in the sub-region in the second direction. The first direction is the direction of the shorter edge of the sub-region, or the direction determined by the width of the sub-region, and the second direction is the direction of the longer edge of the sub-region, or the direction determined by the length of the sub-region.
[0170] In an example scenario, see Figure 3C which shows a schematic diagram of dividing a sub-region into at least one channel, each arrow symbol in the diagram points from a starting grid to an ending grid, indicating the moving direction in the channel when performing a task. Taking the division of sub-region 1 as an example, the length of sub-region 1 is equal to 8 grids and the width is equal to 3 grids, so sub-region 1 can be divided into 3 channels, each channel has a length of 8 grids and a width of 1 grid.
[0171] When the target region is divided into a plurality of channels through the above steps 3011-3013, for each channel in the plurality of channels, the allocation device determines the starting grid and the ending grid of the channel, and takes the movement from the starting grid of the channel to the ending grid of the channel as the task corresponding to the channel, thereby obtaining the task of each channel. In the embodiment of the present application, the total number of channels in the target region is referred to as the first number, and the total number of tasks in the target region is also the first number.
[0172] In a possible implementation, the allocation device can divide the target region into "oxen plowing type" channels, that is, in each sub-region, the ending grid of any channel is adjacent to the starting grid of the adjacent channel, that is, it is ensured that the moving direction of any channel is opposite to the moving direction of the adjacent channel, then, after the mobile robot moves from the starting grid to the ending grid in any channel to perform the task, if it needs to perform the task of the adjacent channel, it only needs to move one grid. For example, see Figure 3CFor example, referring to FIG. 1, if the starting grid of the channel 11 is in the lowermost row, the ending grid is in the uppermost row, and the moving direction is from bottom to top, and the starting grid of the channel 12 is in the uppermost row, the ending grid is in the lowermost row, and the moving direction is from top to bottom, then after the mobile robot completes the task of the channel 11, if it is required to perform the task of the channel 12, it only needs to move one grid to the right.
[0173] Further, for any two adjacent sub-regions in the target region, the assigning device can set the ending grid of the last channel of the former sub-region adjacent to the starting grid of the first channel of the latter sub-region, so that after the mobile robot completes the task of the former sub-region, if it is required to perform the task of the latter sub-region, it only needs to move one grid. Figure 3C For example, referring to FIG. 1, the ending grid of the channel 13 in the sub-region 1 is adjacent to the starting grid of the channel 21 in the sub-region 2, and the ending grid of the channel 33 in the sub-region 3 is adjacent to the starting grid of the channel 41 in the sub-region 4.
[0174] 302. The assigning device determines a plurality of mobile robots, the number of the plurality of mobile robots being the second number, and calculates the generation value of each mobile robot performing each task respectively.
[0175] In a possible implementation, for any mobile robot and any task, the generation value can be used as an index to measure the matching degree of the mobile robot and the task, and the smaller the generation value is, the higher the matching degree of the mobile robot and the task is, and the less time the mobile robot consumes when performing the task, and the higher the efficiency is. Then, after the target region is divided and the plurality of tasks are determined through the above step 301, the assigning device can determine a plurality of mobile robots, and calculate the generation value of each mobile robot performing each task respectively according to the current position of each mobile robot in the plurality of mobile robots.
[0176] Optionally, in the process of calculating the generation value, the assigning device can form a plurality of combinations by combining the plurality of mobile robots and the plurality of tasks, and calculate the generation value of each combination, so as to measure whether the mobile robot and the task in the combination match according to the generation value of the combination. For example, the assigning device can select any mobile robot from the plurality of mobile robots respectively, and can select any task from the plurality of tasks respectively, to form a plurality of combinations, each combination including one mobile robot and one task. Different combinations can have the same mobile robot but different tasks, or have the same task but different mobile robots, or have different mobile robots and different tasks. Assuming that the first number is J and the second number is K, i.e., there are J tasks in total and K mobile robots in total, then there are J*K combinations in total.
[0177] In determining the cost value of the mobile robot performing the task, it is considered that the mobile robot usually needs to move along a movement path before performing the task, which is the path for the mobile robot to move from the current position to the starting grid of the task. Among them, the movement distance, the number of turns, the obstacle distribution, the complexity and other factors in the movement path will affect the time consumed by the mobile robot in the preparation process for performing the task. In combination with this concept, for a certain mobile robot and a certain task, the assignment device can calculate the movement path corresponding to the mobile robot and the task, and calculate the cost value of the mobile robot performing the task according to the movement path.
[0178] In a possible implementation, the cost value can be calculated according to parameters such as the number of turns, the obstacle distribution, the complexity and the like in the movement path. For example, the more the number of turns, the greater the calculated cost value, the more the obstacle distribution, the greater the calculated cost value, and the more complex the movement path, the greater the calculated cost value.
[0179] In another possible implementation, the cost value can be calculated according to the movement distance in the movement path, specifically including the following steps 3021 or 3022:
[0180] 3021. Obtain the movement distance corresponding to the movement path, and take the movement distance as the cost value of the mobile robot performing the task.
[0181] In determining the cost value of the mobile robot performing the task, it is considered that the mobile robot usually needs to move a certain movement distance before performing the task, and the mobile robot should perform the task with a shorter movement distance first, and then perform the task with a longer movement distance. In combination with this concept, this step will obtain the movement distance corresponding to the movement path of the mobile robot performing the task, and take the movement distance as the cost value of performing the task. Among them, the movement distance refers to the distance of the mobile robot moving from the current position to the starting grid corresponding to the task, which can be represented by the number of grids that the mobile robot will pass through when moving from the current position to the starting grid. For example, when the mobile robot needs to move 3 grids to the left and then move 4 grids forward to reach the starting grid, the movement distance is 7, and the cost value is also 7.
[0182] 3022. Obtain the movement distance corresponding to the movement path and the income of the task, calculate the difference between the movement distance and the income as the cost value of the mobile robot performing the task.
[0183] Considering that different tasks have different priorities, the mobile robot should execute the task with higher priority first and then execute the task with lower priority. In combination with the idea, the embodiment of the present application sets the benefit as an index to represent the priority of the task, and the benefit is positively correlated with the priority of the task. If the priority of a task is higher, the allocation device considers that the task should be executed first, and thus determines a larger benefit for the task.
[0184] Specifically, the allocation device obtains the benefit of each task according to the priority of each task, and obtains the difference between the moving distance required for the mobile robot to execute the task and the benefit as the opportunity cost of the mobile robot executing the task. Then, the opportunity cost is positively correlated with the moving distance and negatively correlated with the priority. For example, when the moving distance of the mobile robot executing a task is 7 and the benefit of the task is 1, the opportunity cost is 7-1=6.
[0185] Further, considering that for multiple channels in the target area, the mobile robot usually moves to the channel with the highest benefit of the task to execute the task of the channel without considering the moving distance. In order to prevent multiple mobile robots from moving to the same sub-region to execute the task of a channel, causing interference between different mobile robots, the allocation device can set the number of channels with the highest benefit of the task in each sub-region to be at least one, and the highest benefit of different sub-regions is equal. Then, since each sub-region has a channel with the highest benefit of the task, multiple mobile robots will disperse and move to different channels in different sub-regions to execute the task, instead of gathering in the same sub-region.
[0186] Further, in combination with the scheme of the "ox plowing type" channel in the above step 301, in order to make a mobile robot execute a task and only move one grid to execute the next task, in the embodiment of the present application, the benefit of the task of the first channel in each sub-region can be set to be the highest, the terminal grid of any channel in each sub-region is adjacent to the starting grid of the adjacent channel, and the benefits of the tasks of the channels in each sub-region decrease in turn according to the decreasing amplitude. Then, theoretically, the task with the smallest opportunity cost in the multiple tasks that have not been allocated is the task whose starting grid is adjacent to the terminal grid of the previously allocated task.
[0187] In a possible implementation manner, taking Figure 3C for example, it is assumed that the benefits of the first channels in different sub-regions are all set to 300, the decreasing amplitudes of the benefits in different sub-regions are all set to 100, sub-region 1 includes channel 11, channel 12 and channel 13, and the benefits are 300, 200 and 100 respectively, sub-region 2 includes channel 21, channel 22 and channel 23, and the benefits are 300, 200 and 100 respectively, and the benefits of the channels in other sub-regions are in the same manner.
[0188] Suppose that there are 10 mobile robots to be assigned, and the above-mentioned benefits are used for calculation, the 10 mobile robots will be assigned to the passage 11, the passage 21, the passage 31 to the passage 101 respectively in the designated assignment scheme. Taking the mobile robot assigned to the passage 21 as an example, the first mobile robot assigned to the passage 21 completes the task, at this time, the remaining tasks include the tasks of the passage 12, the passage 22 to the passage 102, and the tasks of the passage 13, the passage 23 to the passage 103, among these passages, the mobile distance between the mobile robot and the passage 22 is 1, the benefit of the passage 22 is 200, and the combined value of the two is -199, and the mobile distance of the mobile robot and other unassigned tasks is greater than 1, and the benefit is not greater than 200, therefore, the mobile robot will assign the task corresponding to the passage 22, and the mobile robot only needs to move one grid to move to the passage 22 to perform the task.
[0189] 303、The assignment device determines a designated task assignment scheme with the smallest total value among a plurality of task assignment schemes according to the plurality of calculated values.
[0190] Optionally, a designated assignment scheme in a plurality of task assignment schemes can be determined, each task assignment scheme in the plurality of task assignment schemes includes a task uniquely corresponding to each mobile robot, and the designated assignment scheme is the assignment scheme with the smallest total value among the task assignment schemes, and the mobile robot and the task in the designated assignment scheme are the most matched from the global perspective.
[0191] Specifically, the assignment device can calculate a plurality of matching combinations according to the value of each mobile robot performing each task by using a preset task assignment algorithm or a minimum value maximum flow algorithm, each matching combination corresponds to a mobile robot and a task, and the plurality of matching combinations can form a designated task assignment scheme.
[0192] It should be noted that the above steps 303 and 304 are only described by taking the calculation of the value of each robot performing each task as an example to assign a task to each mobile robot, and in actual application, the calculation of the value is only an optional scheme for the allocation process. When the number of tasks (the first number) is greater than the number of robots (the second number), the allocation device can assign a task to each mobile robot through other ways. For example, the second number of tasks can be randomly selected from the plurality of tasks, and one selected task is randomly assigned to each mobile robot. For another example, the plurality of tasks can be sorted in order of priority from high to low, and the second number of tasks ranked in front can be selected, and one selected task is randomly assigned to each mobile robot. For another example, the plurality of tasks can be sorted in order of execution difficulty from low to high, and the second number of tasks ranked in front can be selected, and one selected task is randomly assigned to each mobile robot. Of course, other ways can also be used to assign a task to each mobile robot, as long as only one task is assigned to each mobile robot.
[0193] 304. The allocation device controls each mobile robot to perform the assigned task according to the specified allocation scheme.
[0194] When the specified allocation scheme is obtained, for each mobile robot, the allocation device controls the mobile robot to perform the assigned task. The control process is actually: controlling the mobile robot to move from the current position to the starting grid of the channel corresponding to the task, and then moving from the starting grid to the terminal grid along the channel.
[0195] Specifically, the allocation device can determine the first movement trajectory of the mobile robot from the current position to the starting grid and the second movement trajectory of the mobile robot from the starting grid to the terminal grid along the channel according to the channel corresponding to the task and the current position of the mobile robot, send the first notification message indicating the first movement trajectory to the mobile robot first, and when the mobile robot moves to the starting grid according to the first notification message and notifies the allocation device, the allocation device determines that the mobile robot is about to start performing the task, then the allocation device sends the second notification message to the mobile robot, indicating that the mobile robot is about to start performing the task and the second movement trajectory, and then the mobile robot starts performing the task according to the second notification message and moves from the starting grid to the terminal grid.
[0196] For example, the allocation device can first send the first notification message to the mobile robot: "move left 3 grids, and then move forward 10 grids", then the mobile robot will move left 3 grids, and then move forward 10 grids to reach the starting grid and notify the allocation device, and the allocation device sends the second notification message to the mobile robot: "start cleaning and move right 8 grids", then the mobile robot will start cleaning and moving right, and when the mobile robot moves right 8 grids, the mobile robot will notify the allocation device that the task has been completed.
[0197] Of course, the allocation device can not send two notification messages, but directly send a third notification message to the mobile robot indicating the first movement trajectory, the second movement trajectory and the task to be executed when starting to move along the second movement trajectory, then the mobile robot will move to the starting grid from the current position according to the third notification message, at this time, the task is started to be executed and moved from the starting grid to the ending grid
[0198] For example, the allocation device can send a third notification message to the mobile robot: "move 3 grids to the left, then move 10 grids forward, then start cleaning, and move 8 grids to the right", then the mobile robot will move 3 grids to the left, then move 10 grids forward, at this time, it will reach the starting grid, start cleaning and move to the right until it moves 8 grids to the right, then notify the allocation device that the task has been completed.
[0199] The embodiment of the present application also provides a scheme for allocating tasks to the mobile robots after allocating tasks to each mobile robot, details of which are shown in the following step 305, a scheme for allocating tasks to the newly added mobile robots, details of which are shown in the following step 306, and a scheme for reallocating the tasks originally allocated to a mobile robot to other mobile robots when the mobile robot fails or exits, details of which are shown in the following step 307.
[0200] 305、When the first mobile robot in the plurality of mobile robots completes the execution of the task, the allocation device selects a task from the plurality of tasks that have not been allocated to the first mobile robot.
[0201] Taking the completion of the execution of the task by the first mobile robot as an example, the allocation device can select a task from the plurality of tasks that have not been allocated to the first mobile robot. The allocation device can randomly select a task, or can select a task with the highest priority, or can select a task with the simplest execution difficulty, and of course, other ways of selecting a task can also be adopted.
[0202] In a possible implementation, the allocation device can select a task with the smallest execution cost from the plurality of tasks to be executed by the first mobile robot, and allocate the task to the first mobile robot. For example, the allocation device can calculate the movement path of the first mobile robot from the current position to the starting grid corresponding to each task in the plurality of tasks, calculate the execution cost according to the movement path, and determine the task with the smallest execution cost from the plurality of tasks, and allocate the task to the first mobile robot.
[0203] 306、When a new second mobile robot is added, the allocation device selects a task from the plurality of tasks that have not been allocated to the second mobile robot.
[0204] The step is similar to the above step 305, and a new second mobile robot is added. Taking the dispatching of the distribution device as an example, the distribution device can obtain a plurality of tasks that have not been distributed, select one task from the tasks, and assign the task to the first mobile robot. The distribution device can randomly select a task, or can select a task with the highest priority, or can select a task with the simplest execution difficulty, and of course other ways of selecting a task can also be used.
[0205] In a possible implementation, the distribution device can select a task with the smallest value from the plurality of tasks for the first mobile robot to execute, and assign the task to the first mobile robot. For example, the movement path of the first mobile robot from the current position to the starting grid corresponding to each task in the plurality of tasks can be calculated, the value of the movement path is calculated, and the task with the smallest value is determined from the plurality of tasks, and the task is assigned to the first mobile robot.
[0206] The distribution scheme provided by the above steps 305 or 306, when a specified distribution scheme has been determined, when a mobile robot needs to be assigned a task again, the task can be selected from the plurality of tasks that have not been assigned, without the need to redivide the target area, and without disturbing the existing matching combination. The step is simple, and the distribution efficiency is higher.
[0207] 307、When the third mobile robot assigned with the first task in the plurality of tasks cancels the execution of the first task, the distribution device selects a fourth mobile robot from the plurality of mobile robots that have not been assigned a task, and assigns the first task to the fourth mobile robot.
[0208] In view of the scenarios that a mobile robot fails, needs to be temporarily assigned to execute other tasks, is scheduled to leave the target area, and the like, the mobile robot cancels the assigned task, and at this time, the task originally assigned to the mobile robot needs to be re-assigned to other mobile robots.
[0209] Taking the third mobile robot assigned with the first task as an example, the distribution device obtains a plurality of mobile robots that have not been assigned a task, selects a fourth mobile robot from the mobile robots, and assigns the first task to the fourth mobile robot. The distribution device can randomly select a mobile robot, or can select a mobile robot with the strongest execution ability.
[0210] In a possible implementation, the allocation device can select a mobile robot with the minimum generation value for performing the first task from the mobile robots. For example, the allocation device can calculate the movement path of each mobile robot in the plurality of mobile robots from the current position to the starting grid corresponding to the task in the combination, calculate the generation value of the mobile robot for performing the first task according to the movement path, determine the fourth mobile robot corresponding to the minimum generation value, and allocate the first task to the fourth mobile robot. That is, the first task is recovered, and the mobile robot is re-allocated for the task.
[0211] Further, considering that the third mobile robot may have performed part of the first task when the fault occurs, that is, has moved a certain distance in the channel corresponding to the first task, the fourth mobile robot does not need to move in the section that the third mobile robot has moved, in other words, the fourth mobile robot does not need to move from the starting grid, but directly moves from the current position of the third mobile robot.
[0212] Therefore, the allocation device can directly update the starting position of the first task to the current position of the third mobile robot, allocate the updated first task to the fourth mobile robot, so as to control the fourth mobile robot to move from the position of the fourth mobile robot to the current position of the third mobile robot, and then start to perform the updated first task from the current position of the third mobile robot to the ending grid of the first task. In the determination of the fourth mobile robot, the mobile robot with the minimum generation value for performing the updated first task can be calculated according to the updated starting position of the first task and the current position of each mobile robot, as the fourth mobile robot.
[0213] The allocation scheme provided in this step, when a mobile robot fails or exits, and the task originally allocated to it needs to be re-allocated to other mobile robots, only needs to select a mobile robot from the plurality of unallocated mobile robots, without the need to re-divide the target area, and without disturbing the existing matching combination, the step is simple, and the allocation efficiency is higher.
[0214] In another possible implementation, if the third mobile robot allocated with the first task cancels the execution of the task, but other mobile robots have all been allocated with tasks, and there is no idle mobile robot, the allocation device will wait first, and when any mobile robot completes the allocated task, directly allocates the first task to the mobile robot.
[0215] The first point to be explained is that, in the process of each mobile robot performing a task along a respective channel, if a certain mobile robot encounters another mobile robot in the channel, an abnormal situation of being blocked occurs, the blocked mobile robot will notify the distribution device, and the distribution device will send an instruction message to the blocked mobile robot to move to make way. For example, the blocked mobile robot can obtain the identity and current position of the blocked mobile robot, send a notification message carrying the identity and current position to the distribution device, the distribution device determines the blocked mobile robot according to the identity, and determines the way-moving trajectory of the blocked mobile robot according to the current position. The way-moving trajectory can include the moving direction and distance that the blocked mobile robot should move when making way, and the like, and then sends an instruction message indicating the way-moving trajectory to the blocked mobile robot corresponding to the identity, and then the blocked mobile robot moves according to the way-moving trajectory to make way.
[0216] The second point to be explained is that, each time a certain mobile robot moves in a certain grid, the distribution device can add a cover mark to the grid in the target area, indicating that a mobile robot has moved in the grid, or that the task of the grid has been completed and does not need to move the mobile robot in the grid again. Then, when all the grids of the target area have added cover marks, it can be determined that the task of the target area has been completed, and the overall task ends. In addition, for the scene of finding a target object in the target area, when a certain mobile robot finds the target object, it will send a notification message to the distribution device, and the distribution device can determine that the task has been completed after receiving the notification message, and other mobile robots do not need to continue to perform the task, and the overall task ends.
[0217] In practical applications, the flowchart of the task distribution method executed by the distribution device can be as shown in Figure 3D The flowchart can be executed by four modules of the distribution device: task generation module, task distribution module, channel planning module, and task statistics module.
[0218] The task generation module is responsible for dividing the target area into multiple sub-areas, dividing each sub-area into at least one channel, and obtaining the task of each channel. The task allocation module is responsible for calculating the generation value of each mobile robot executing each task and determining a designated allocation scheme to determine which robots are at rest and which robots are working, and which task is specifically executed by the working robot. The path planning module is responsible for guiding the robot to move from the current position to the starting grid of the task according to the designated allocation scheme, and moving along the channel to the termination grid to complete the task. The task statistics module manages the target area, is responsible for recording the moving track of the mobile robot, setting the covered mark for the grid moved by the mobile robot, and is also responsible for counting the task completion, when the mobile robot is idle after the task is completed, the mobile robot is allowed to participate in the new task allocation, and the cycle is executed until all tasks are executed, and the overall task ends.
[0219] The method provided by the embodiment of the application considers the number of tasks allocated to the mobile robot in the process of allocating the task, only allocates one task to each mobile robot, and the remaining tasks are in a state of waiting for allocation, so as to be allocated to other mobile robots subsequently, improve flexibility, and improve the overall execution efficiency of the task.
[0220] Further, the current position of the mobile robot is considered in the process of allocating the task, the consideration is more comprehensive, and the execution efficiency of the task is prevented from being affected by the current position of the mobile robot. In addition, the sum of the generation values of the multiple mobile robots executing the task in the designated allocation scheme is as small as possible, the execution time of the overall task can be reduced, and the execution efficiency of the overall task is improved.
[0221] Further, the priority of each task is considered in the process of allocating the task, so that the task allocated to the mobile robot in the designated allocation scheme is the task with a higher priority in the target area, and the task with a higher priority is processed as much as possible.
[0222] Further, the number of channels with the highest income of tasks in each sub-area in the target area is at least one, multiple mobile robots can be dispersed to different sub-areas to execute tasks, and mutual interference of the mobile robots is prevented.
[0223] Further, the target sub-area is divided into "ox plowing type" channels, and the income of the task of each channel in each sub-area is set, not only the current allocation scheme is considered, but also the allocation scheme of the next task after the current task is executed, so that each mobile robot only needs to move one grid to execute the next task after executing the task, the moving distance is reduced, and the work efficiency is improved.
[0224] Further, after determining the specified task allocation scheme, when a mobile robot is assigned a new task or completes a task, the task is selected from the unassigned tasks and assigned to the mobile robot, without the need to re-divide the target area, and without disturbing the determined matching combination, thus simplifying the steps.
[0225] Further, when a mobile robot cancels a task, a scheme is provided to re-assign the task to another mobile robot, avoiding the situation that no one handles the task due to the failure of the mobile robot.
[0226] Based on the above Figure 3A The step 303 "determining a specified task allocation scheme with the smallest sum of generation values from the plurality of task allocation schemes according to the calculated generation values" of the embodiment can include the following two possible implementation manners:
[0227] Manner one: using a preset task allocation algorithm
[0228] Step S1, forming a generation value matrix from the plurality of generation values, the first dimension of the generation value matrix is the mobile robot, the second dimension is the task, and the element in the generation value matrix is the generation value when the corresponding mobile robot executes the corresponding task.
[0229] The dimension can include rows and columns, the first dimension is the row and the second dimension is the column, or the first dimension is the column and the second dimension is the row. Taking the first dimension as the row and the second dimension as the column as an example, each row represents a mobile robot and each column represents a task. The generation value matrix can be shown in Table 1 below, and the element R kij in the generation value matrix represents the generation value when the mobile robot k executes the task j of the sub-area i.
[0230] Table 1
[0231] [R 111 ]]> [R 112 ]] [R 113 ]] [R 121 ]]> …… [R 1ij ]]> [R 211 ]]> [R 212 ]] [R 213 ]]> [R 221 ]]> …… [R 2ij ]]> [R 311 ]]> [R 312 ]]> [R 313 ]]> [R 321 ]]> …… [R 3ij ]]> …… …… …… …… …… …… [R k11 ]]> [R k12 ]]> [R k13 ]]> [R k21 ]]> …… [R kij ]]>
[0232] Step S2, using a preset task allocation algorithm to obtain a matching matrix corresponding to the generation value matrix.
[0233] The preset task allocation algorithm can be a Hungarian algorithm, a market auction algorithm, etc. The input of the algorithm is the generation value matrix, and the output is a matching matrix composed of matching coefficients. The value of the matching coefficient in the matching matrix is a specified value or 0, wherein the matching coefficient equal to the specified value indicates that the mobile robot corresponding to the row and the task corresponding to the column match, i.e., the mobile robot and the task can form a matching combination, and the mobile robot can execute the task, while the matching coefficient equal to 0 indicates that the mobile robot corresponding to the row and the task corresponding to the column do not match. The specified value can be 1 or other positive integers other than 0.
[0234] It should be noted that, in order to ensure that each mobile robot is assigned only one task in the final designated task allocation scheme, the matching matrix can be calculated according to the constraint condition that the sum of the matching coefficients between the same mobile robot and each task in multiple tasks is not greater than a designated value during the process of obtaining the matching matrix.
[0235] Only one of the matching coefficients between the same mobile robot and each task is the designated value, and the other matching coefficients are 0, that is, the sum of the matching coefficients between the same mobile robot and each task is either the designated value, indicating that the mobile robot matches one task, or 0, indicating that the mobile robot does not match each task. Therefore, under the constraint condition that the sum of the matching coefficients between the same mobile robot and each task is not greater than the designated value, each mobile robot will match at most one task.
[0236] For example, corresponding to Table 1, the constraint condition can be expressed by the following formula with the designated value being 1:
[0237]
[0238] where k represents the identification of the mobile robot, i represents the identification of the target sub-region, I represents the number of target sub-regions, i is a positive integer not greater than I, j represents the identification of the task, J represents the number of tasks, J i represents the number of tasks of the target sub-region i, j is a positive integer not greater than J i , a kij is the matching coefficient, indicating whether the mobile robot k and the task j of the target sub-region i match, a kij is 1, indicating that the mobile robot k and the task j of the target sub-region i match, a kij is 0, indicating that the mobile robot k and the task j of the target sub-region i do not match.
[0239] Based on the example of Table 1 above, when the preset task allocation algorithm is used and the constraint condition is used to calculate the value matrix, the matching matrix shown in Table 2 below is obtained.
[0240] Table 2
[0241] a 111 ]]> a 112 ]]> a 113 ]]> a 121 ]]> …… a 1ij ]]> a 211 ]]> a 212 ]]> a 213 ]]> a 221 ]]> …… a 2ij ]]> a 311 ]]> a 312 ]]> a 313 ]]> a 321 ]]> …… a 3ij ]]> …… …… …… …… …… …… a k11 ]]> a k12 ]]> a k13 ]]> a k21 ]]> …… a kij ]]>
[0242] Step S3, the mobile robots and tasks corresponding to the matching coefficients equal to the designated value in the matching matrix are combined into a matching combination, and multiple matching combinations are obtained. The multiple matching combinations constitute the designated allocation scheme.
[0243] For the obtained matching matrix, the assigning device determines each matching coefficient equal to the specified value in the matching coefficient, obtains the mobile robot and the task corresponding to each matching coefficient, and groups the mobile robot and the task corresponding to the same matching coefficient to obtain a matching combination, and finally a plurality of matching combinations obtained are the specified assignment scheme.
[0244] Method two: using the minimum cost maximum flow algorithm
[0245] In order to facilitate understanding, the following introduction is made to the capacity network and the minimum cost maximum flow algorithm:
[0246] The starting node of the capacity network is the source node, and the terminal node is the sink node. A plurality of layers of nodes can be included between the source node and the sink node, and any two nodes can be connected to form a path. The capacity network can simulate a scenario in which a target starts from the source node, selects a node in each layer to pass through, and finally reaches the sink node. In this scenario, there are many optional paths, and different sizes of flow can be generated on each path.
[0247] The minimum cost maximum flow algorithm is an algorithm for selecting a path in the capacity network. The input of the minimum cost maximum flow algorithm is a capacity network in which the capacity and cost of each path have been determined. The output of the minimum cost maximum flow algorithm is a plurality of paths that need to be passed through from the source node to the sink node when the total cost of the capacity network is minimized and the total flow is maximized, and the flow on each path. The capacity of each path represents the maximum flow of the path, and the cost represents the cost generated when the path is passed through. When selecting a path, the flow conservation of each node in the capacity network needs to be satisfied, that is, the flow flowing into each node is equal to the flow flowing out of each node.
[0248] P1, construct a capacity network.
[0249] The capacity network can be as shown in Figure 3E includes a source node (Source), a sink node (Sink), a robot node (Worker) corresponding to each mobile robot, and a task node (Task) corresponding to each task. The source node and each robot node are connected by a first type of path, each robot node and each task node are connected by a second type of path, and each task node and the sink node are connected by a third type of path.
[0250] P2, configure the capacity and value of each path in the capacity network.
[0251] For the cost of each path in the capacity network, since the flow from the source node to the robot node and the flow from the task node to the sink node have no practical significance, the cost of each first type path and each third type path is configured as 0, and the flow from any robot node to any task node symbolizes that the corresponding mobile robot executes the corresponding task, and a corresponding value of the generation is generated, so the cost of each second type path is configured as the value of the generation when the mobile robot corresponding to the connected robot node executes the task corresponding to the connected task node. For example, see Figure 3E , the cost of the second type path connected by the robot node k and the task node ij is configured as the value of the generation R k of the task T ij executed by the robot W kij .
[0252] P3, using the minimum cost maximum flow algorithm, obtaining a plurality of second type paths when the total cost of the capacity network is minimum and the total flow is maximum.
[0253] It should be noted that in order to ensure that each mobile robot is only assigned one task in the final specified task assignment scheme, during the configuration of the capacity network, the capacity of each first type path in the capacity network can be configured as 1, indicating that the flow on the path can only be 0 or 1, so for each robot node, at most one second type path can be selected, that is, the robot node can be connected to at most one task node, ensuring that a mobile robot can be matched to at most one task, that is, uniquely corresponding to one task.
[0254] P4, the mobile robot corresponding to the connected robot node and the task corresponding to the connected task node in the same second type path in the plurality of second type paths form a matching combination, and a plurality of matching combinations are obtained.
[0255] When the minimum cost maximum flow algorithm is used to calculate the capacity network, a plurality of second type paths are obtained, and the mobile robot corresponding to the connected robot node and the task corresponding to the connected task node in the same second type path in the plurality of second type paths are matched. That is, each second type path obtained can determine a matching combination, for example, see Figure 3E , if the second type path connected by the robot node k and the task node ij is selected, the mobile robot W k and the task T ij form a matching combination, so that the mobile robot W k is assigned the task T ij .
[0256] Figure 4 is a structural schematic diagram of a task assignment device provided by an embodiment of the present application. See Figure 4The apparatus comprises an acquisition module 401, a determination module 402 and an allocation module 403.
[0257] The acquisition module 401 is configured to acquire a plurality of tasks in a target area, wherein the number of the plurality of tasks is a first number.
[0258] The determination module 402 is configured to determine a plurality of mobile robots, wherein the number of the plurality of mobile robots is a second number.
[0259] The allocation module 403 is configured to allocate one task to each mobile robot from the plurality of tasks when the first number is greater than the second number.
[0260] The apparatus provided by the embodiment of the present application considers the number of tasks allocated to the mobile robots in the process of allocating tasks, allocates one task to each mobile robot, and leaves the remaining tasks in a state of being to be allocated, so as to be allocated to other mobile robots subsequently, thereby improving flexibility and improving the overall execution efficiency of the tasks.
[0261] In a possible implementation, the allocation module 403 is further configured to select one task from the plurality of tasks that have not been allocated and allocate the task to a first mobile robot in the plurality of mobile robots when the first mobile robot completes execution of the task; or,
[0262] The allocation module 403 is further configured to select one task from the plurality of tasks that have not been allocated and allocate the task to a second mobile robot when the second mobile robot is added.
[0263] In another possible implementation, the allocation module 403 is further configured to select a fourth mobile robot from the plurality of mobile robots that have not been allocated a task when a third mobile robot that has been allocated a first task in the plurality of tasks cancels execution of the first task; and allocate the first task to the fourth mobile robot.
[0264] In another possible implementation, the allocation module 403 comprises:
[0265] A determination sub-module is configured to determine a current position of each mobile robot in the plurality of mobile robots.
[0266] A calculation sub-module is configured to calculate a generation value of each task executed by each mobile robot according to the current position of each mobile robot.
[0267] The determination sub-module is further configured to determine a specified task allocation scheme with a minimum total generation value from a plurality of task allocation schemes according to the plurality of calculated generation values, wherein each task allocation scheme in the plurality of task allocation schemes comprises one task corresponding to each mobile robot uniquely.
[0268] In another possible implementation, the acquisition module 401 is further configured to acquire a plurality of sub-regions in the target region, each of the sub-regions including at least one channel, and each of the channels including a plurality of grids.
[0269] The acquisition module 401 is further configured to acquire a task of each of the channels, to obtain a plurality of tasks, and each of the tasks being from a starting grid of a corresponding channel to a terminal grid of the channel.
[0270] In another possible implementation, the calculation sub-module is further configured to, for each of the mobile robots and each of the tasks, calculate a movement path of the mobile robot when moving to a starting grid corresponding to the task, the task being from a starting grid of a corresponding channel to a terminal grid of the channel, and calculate a cost value of the mobile robot when performing the task according to the movement path.
[0271] In another possible implementation, the calculation sub-module is further configured to acquire a movement distance corresponding to the movement path, and take the movement distance as the cost value of the mobile robot when performing the task.
[0272] In another possible implementation, the calculation sub-module is further configured to acquire a movement distance corresponding to the movement path, acquire a benefit of the task, the benefit being positively correlated with a priority of the task, and calculate a difference between the movement distance and the benefit as the cost value of the mobile robot when performing the task.
[0273] In another possible implementation, the target region includes a plurality of sub-regions, each of the sub-regions including at least one channel, a number of channels with the highest benefit of tasks in each of the sub-regions is at least one, and the highest benefits of different sub-regions are equal.
[0274] In another possible implementation, a first channel in each of the sub-regions has the highest benefit of tasks, a terminal grid of any channel in each of the sub-regions is adjacent to a starting grid of an adjacent channel, and benefits of tasks of the channels in each of the sub-regions decrease in turn according to a decreasing amplitude.
[0275] In another possible implementation, the determination sub-module includes:
[0276] A composition unit, configured to compose the plurality of cost values into a cost value matrix, a first dimension of the cost value matrix being a mobile robot, a second dimension of the cost value matrix being a task, and an element in the cost value matrix being a cost value of a corresponding mobile robot when performing a corresponding task;
[0277] An acquisition unit, configured to acquire a matching matrix corresponding to the cost value matrix by using a preset task allocation algorithm, and an element in the matching matrix being a matching coefficient between a corresponding mobile robot and a corresponding task.
[0278] The component unit is further configured to form a matching combination by combining the mobile robot corresponding to the robot node connected to the task node connected to the same second type path and the task corresponding to the task node, and obtain a plurality of matching combinations, and form the specified allocation scheme by using the plurality of matching combinations.
[0279] In another possible implementation, the determining sub-module comprises:
[0280] The constructing unit is configured to construct a capacity network, the capacity network comprising a source node, a sink node, a robot node corresponding to each mobile robot, and a task node corresponding to each task, the source node and each robot node being connected by a first type path, each robot node and each task node being connected by a second type path, and each task node and the sink node being connected by a third type path.
[0281] The configuring unit is configured to configure the cost of each first type path and each third type path in the capacity network as 0, and configure the cost of each second type path as the value of the mobile robot corresponding to the connected robot node when performing the task corresponding to the connected task node.
[0282] The obtaining unit is configured to obtain, by using a minimum cost maximum flow algorithm, a plurality of second type paths that are passed through when the total cost of the capacity network is minimum and the total flow is maximum.
[0283] The component unit is configured to form a matching combination by combining the mobile robot corresponding to the robot node connected to the task node connected to the same second type path and the task corresponding to the task node, and obtain a plurality of matching combinations, and form the specified allocation scheme by using the plurality of matching combinations.
[0284] In another possible implementation, the obtaining module 401 further comprises:
[0285] The dividing sub-module is configured to divide the target area into a plurality of grids, each grid having the same size, and a grid containing an obstacle being an obstacle grid.
[0286] The partition sub-module is configured to partition the grids other than the obstacle grids in the target area to obtain a plurality of sub-areas.
[0287] The dividing sub-module is configured to, for each sub-area, divide the sub-area into at least one channel having a length equal to the length of the sub-area and a width equal to that of one grid.
[0288] In another possible implementation, the dividing sub-module is configured to, in the process of scanning the target region once, when a first position where the connectivity changes is scanned, and then a second position where the connectivity changes is scanned, divide the region between the first position and the second position according to the positions of the obstacle grids to obtain at least one sub-region, so that different sub-regions are separated by the obstacle grids.
[0289] The connectivity change refers to a change in the distribution of the obstacle grids.
[0290] All the optional technical solutions described above can be combined to form optional embodiments of the present disclosure, and thus will not be repeated here.
[0291] It should be noted that the task allocation device provided in the above embodiments is only used as an example to illustrate the division of the above functional modules when allocating tasks. In actual applications, the above functions can be completed by different functional modules according to needs, that is, the internal structure of the allocation device is divided into different functional modules to complete all or part of the functions described above. In addition, the task allocation device and the task allocation method provided in the above embodiments belong to the same concept, and the specific implementation process is described in the method embodiments, which will not be repeated here.
[0292] Figure 5 is a structural schematic diagram of a terminal provided by an embodiment of the present application. The terminal can be used to implement the functions performed by the allocation device in the task allocation method shown in the above embodiments. Specifically,
[0293] The terminal 500 can include RF (Radio Frequency, radio frequency) circuit 110, memory 120 including one or more computer readable storage media, input unit 130, display unit 140, sensor 150, audio circuit 160, transmission module 170, processor 180 including one or more processing cores, and power supply 190, etc. Those skilled in the art can understand that Figure 5 The terminal structure shown in the above embodiments does not constitute a limitation on the terminal, and can include more or fewer components than those shown in the figure, or combine certain components, or different component arrangements. Among them:
[0294] The RF circuit 110 can be used for receiving and transmitting signals in the process of receiving or transmitting information or a call. In particular, after receiving downlink information from a base station, the RF circuit 110 delivers the information to the one or more processors 180 for processing. In addition, the RF circuit 110 transmits data related to uplink to the base station. Typically, the RF circuit 110 includes, but is not limited to, an antenna, at least one amplifier, a tuner, one or more oscillators, a Subscriber Identity Module (SIM) card, a transceiver, a coupler, a Low Noise Amplifier (LNA), a duplexer, etc. In addition, the RF circuit 110 can communicate with a network and other terminals through wireless communication. The wireless communication can use any communication standard, or protocol, including but not limited to GSM (Global System for Mobile communication), GPRS (General Packet Radio Service), CDMA (Code Division Multiple Access), WCDMA (Wideband Code Division Multiple Access), LTE (Long Term Evolution), Bluetooth®, Wi-Fi, Zigbee®, Z-Wave®, etc.
[0295] The memory 120 can be used to store software programs and modules, such as those corresponding to the terminal according to the exemplary embodiments described above, and the processors 180 can perform various functions and data processing, such as implementing video-based interaction, by running the software programs and modules stored in the memory 120. The memory 120 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application program required for a function (such as a sound play function, an image play function, etc.), etc., and the data storage area can store data (such as audio data, a phone book, etc.) created according to the use of the terminal 500, etc. In addition, the memory 120 can include a high-speed random access memory, and can further include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state memory device. Accordingly, the memory 120 can further include a memory controller to provide access to the memory 120 for the processors 180 and the input unit 130.
[0296] The input unit 130 can be configured to receive input digital or character information, and to generate a key signal, a mouse signal, a lever signal, an optical or a track ball signal related to a user's setting and function control. Specifically, the input unit 130 can include a touch sensitive surface 131 and other input terminals 132. The touch sensitive surface 131, also called a touch display screen or a touch pad, can collect a user's touch operation (e.g., the user's operation on or near the touch sensitive surface 131 using a finger, a stylus, or any suitable object or accessory) and drive a corresponding linked device according to a pre-set program. Optionally, the touch sensitive surface 131 can include two parts, a touch detection device and a touch controller. The touch detection device detects a user's touch position and detects a signal caused by the touch operation, and transmits the signal to the touch controller. The touch controller receives the touch information from the touch detection device, converts it into touch coordinates, and sends it to the processor 180, and can receive a command from the processor 180 and execute it. In addition, the touch sensitive surface 131 can be implemented in various types such as a resistive type, a capacitive type, an infrared type, and a surface acoustic wave type. In addition to the touch sensitive surface 131, the input unit 130 can include other input terminals 132. Specifically, the other input terminals 132 can include one or more of a physical keyboard, function keys (e.g., a volume control button, an on / off button, etc.), a trackball, a mouse, a lever, etc.
[0297] The display unit 140 can be configured to display information input by a user or information provided to the user, and various graphical user interfaces of the terminal 500, which can be composed of graphics, text, icons, video, and any combination thereof. The display unit 140 can include a display panel 141, which can be configured in the form of an LCD (Liquid Crystal Display), an OLED (Organic Light-Emitting Diode), etc. Further, the touch sensitive surface 131 can cover the display panel 141, and when the touch sensitive surface 131 detects a touch operation thereon or near thereto, transmits it to the processor 180 to determine the type of the touch event, and then the processor 180 provides a corresponding visual output on the display panel 141 according to the type of the touch event. Although in the above description, the touch sensitive surface 131 and the display panel 141 are implemented as two independent components to achieve input and output functions, in some embodiments, the touch sensitive surface 131 and the display panel 141 can be integrated to achieve input and output functions. Figure 5
[0298] The terminal 500 may also include at least one sensor 150, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 141 according to the brightness of the ambient light, and the proximity sensor may turn off the display panel 141 and / or the backlight when the terminal 500 is moved to the ear. As a type of motion sensor, the gravity acceleration sensor can detect the magnitude of acceleration in all directions (generally three axes), and can detect the magnitude and direction of gravity when stationary. It can be used for applications that recognize the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for other sensors that can be configured with the terminal 500, such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., they will not be described here.
[0299] Audio circuit 160, speaker 161, and microphone 162 provide an audio interface between the user and terminal 500. Audio circuit 160 can convert received audio data into electrical signals and transmit them to speaker 161, which then converts them into sound signals for output. Microphone 162, on the other hand, converts collected sound signals into electrical signals, which are then received by audio circuit 160 and converted into audio data. The audio data is then processed by processor 180 and transmitted via RF circuit 110 to, for example, another terminal. Alternatively, the audio data can be output to memory 120 for further processing. Audio circuit 160 may also include an earphone jack to allow communication between an external headset and terminal 500.
[0300] The terminal 500 can help users to send and receive emails, browse web pages and access streaming media through the transmission module 170, and it provides users with wireless or wired broadband Internet access. Figure 5 The transmission module 170 is shown, but it is understandable that it is not an essential component of the terminal 500 and can be omitted as needed without changing the essence of the invention.
[0301] Processor 180 is the control center of terminal 500, connecting all components of the phone using various interfaces and circuits. By running or executing software programs and / or modules stored in memory 120 and accessing data stored in memory 120, it executes various functions of terminal 500 and processes data, thereby providing overall monitoring of the phone. Optionally, processor 180 may include one or more processing cores; preferably, processor 180 may integrate an application processor and a modem processor, with the application processor primarily handling the operating system, user interface, and application programs, while the modem processor primarily handles wireless communications. It is understood that the modem processor may not be integrated into processor 180.
[0302] Terminal 500 also includes a power supply 190, such as a battery, for powering various components of the terminal 500. Preferably, the power supply 190 is configured to deliver power to the processor 180 via the power management system. Additionally, the power supply 190 can include one or more AC or DC power sources, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator light, and any other components associated with the generation, management and distribution of power in terminal 500.
[0303] Although not shown, terminal 500 can also include a camera, a Bluetooth module, and the like, which are not described herein. In the present embodiment, the display unit of terminal 500 is a touch screen display. Terminal 500 also includes a memory, and one or more programs stored in the memory and configured for execution by the one or more processors, the one or more programs including instructions for performing the operations described above as being performed by the allocation device of the embodiments described above.
[0304] Figure 6 FIG. 6 is a schematic diagram of a server 600 according to an embodiment of the present application. The server 600 can vary greatly in configuration and performance, and can include one or more central processing units (CPUs) 622 (e.g., one or more processors) and a memory 632, and one or more storage media 630 (e.g., one or more mass storage devices) storing applications 642 or data 644. The memory 632 and the storage media 630 can be volatile or non-volatile storage. The applications stored in the storage media 630 can include one or more modules (not shown in the figure), each of which can include a series of instructions for operating the server. Further, the CPU 622 can be configured to communicate with the storage media 630 and execute the series of instructions stored in the storage media 630 on the server 600.
[0305] The server 600 can also include one or more power supplies 626, one or more wired or wireless network interfaces 650, one or more input / output interfaces 658, one or more keyboards 656, and / or one or more operating systems 641, such as Windows Server TM , Mac OS X TM , Unix TM , Linux TM , FreeBSD TM , and the like.
[0306] The server 600 can be configured to perform the steps described above as being performed by the allocation device of the task allocation method provided by the embodiments described above.
[0307] In the example embodiments, a computer readable storage medium storing a computer program is also provided, for example, a memory storing a computer program, which, when executed by a processor, implements the task allocation method in the above embodiments. For example, the computer readable storage medium can be a Read-Only Memory (ROM), a Random Access Memory (RAM), a Compact Disc Read-Only Memory (CD-ROM), a magnetic tape, a floppy disk, an optical data storage device, etc.
[0308] Those of ordinary skill in the art can understand that all or part of the steps of the above embodiments can be completed by hardware, or by a program instructing relevant hardware, and the program can be stored in a computer readable storage medium, such as a Read-Only Memory, a magnetic disk or an optical disk, etc.
[0309] The above description is merely preferred embodiments of the present application, and is not intended to limit the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A method of task allocation, characterized by, The method is applied to a full-area coverage scenario, and a task of the scenario is to traverse each position of a target area, and the method comprises: dividing the target area into a plurality of grids, each grid having the same size, wherein a grid containing an obstacle is an obstacle grid; partitioning grids in the target area except the obstacle grids to obtain a plurality of sub-areas, wherein different sub-areas are separated by obstacle grids; for each sub-area, dividing the sub-area into at least one channel having a length equal to a length of the sub-area and a width equal to a width of one grid; obtaining a task of each channel to obtain a plurality of tasks, each task being to move from a starting grid of a corresponding channel to an ending grid of the channel along the channel, and a number of the plurality of tasks being a first number; determining a plurality of mobile robots, a number of the plurality of mobile robots being a second number; when the first number is greater than the second number, determining a current position of each mobile robot in the plurality of mobile robots, for each mobile robot and each task, calculating a movement path of the mobile robot when moving to a starting grid corresponding to the task, and obtaining a movement distance corresponding to the movement path; obtaining a benefit of the task, the benefit being positively correlated with a priority of the task; wherein a number of channels with the highest benefit of tasks in each sub-area is at least one, and the highest benefits of different sub-areas are equal; and calculating a difference between the movement distance and the benefit as a value of a generation of the mobile robot performing the task; determining, according to the plurality of calculated values of the generation, a specified task allocation scheme with a smallest sum of values of generations in a plurality of task allocation schemes, each task allocation scheme in the plurality of task allocation schemes including one task corresponding to each mobile robot uniquely.
2. The method of claim 1, wherein, After the specified task allocation scheme with the smallest sum of values of generations in the plurality of task allocation schemes is determined, the method further comprises: when a first mobile robot in the plurality of mobile robots completes task execution, selecting one task from a plurality of tasks that have not been allocated to assign to the first mobile robot; or when a new second mobile robot is added, selecting one task from the plurality of tasks that have not been allocated to assign to the second mobile robot.
3. The method of claim 1, wherein, After the specified task allocation scheme with the smallest sum of values of generations in the plurality of task allocation schemes is determined, the method further comprises: when a third mobile robot that has allocated a first task in the plurality of tasks cancels execution of the first task, selecting a fourth mobile robot from a plurality of mobile robots that have not been allocated tasks; allocating the first task to the fourth mobile robot.
4. The method according to any one of claims 1 to 3, characterized in that, The benefit of the task of a first channel in each sub-area is the highest, and an ending grid of any channel in each sub-area is adjacent to a starting grid of an adjacent channel, and the benefits of the tasks of the respective channels in each sub-area decrease in turn according to a decreasing amplitude.
5. The method according to any one of claims 1 to 3, characterized in that, The determining, according to the plurality of calculated values of the generation, of the specified task allocation scheme with the smallest sum of values of generations in a plurality of task allocation schemes of tasks performed by each mobile robot comprises: The multiple cost values are combined into a cost value matrix, wherein the first dimension of the cost value matrix is the mobile robot, the second dimension is the task, and the elements in the cost value matrix are the cost values when the corresponding mobile robot performs the corresponding task; Using a preset task allocation algorithm, a matching matrix corresponding to the cost value matrix is obtained, where the elements in the matching matrix are matching coefficients between corresponding mobile robots and corresponding tasks; The mobile robots and tasks corresponding to the matching coefficients in the matching matrix that are equal to the specified values are combined into a matching combination to obtain a plurality of matching combinations, and the specified task allocation scheme is constructed based on the plurality of matching combinations.
6. The method according to any one of claims 1 to 3, characterized in that, The step of determining, based on the calculated multiple cost values, a designated task allocation scheme having the smallest total cost value among multiple task allocation schemes for tasks performed by each mobile robot, includes: Constructing a capacity network, the capacity network including a source node, a sink node, a robot node corresponding to each mobile robot, and a task node corresponding to each task, the source node and each robot node are respectively connected via a first type of path, each robot node and each task node are respectively connected via a second type of path, and each task node and the sink node are respectively connected via a third type of path; Configuring the cost of each first-category path and each third-category path in the capacity network to be 0, and configuring the cost of each second-category path to be a cost value when the mobile robot corresponding to the connected robot node performs the task corresponding to the connected task node; Using a minimum cost maximum flow algorithm, obtaining multiple second-category paths that are passed from the source node to the sink node when the total cost of the capacity network is minimized and the total flow is maximized; The mobile robots corresponding to the robot nodes connected by the same second-type path in the multiple second-type paths and the tasks corresponding to the connected task nodes are formed into a matching combination to obtain multiple matching combinations, and the specified task allocation plan is constructed based on the multiple matching combinations.
7. The method according to any one of claims 1 to 3, characterized in that, The grids in the target area except the obstacle grid are partitioned to obtain a plurality of sub-areas, including: During a scan of the target area, when a first position where connectivity changes is scanned, and subsequently a second position where connectivity changes is scanned, the area between the first position and the second position is divided according to the position of the obstacle grid to obtain at least one sub-region, so that different sub-regions are separated by the obstacle grid; Among them, the change in connectivity refers to the change in the distribution of the barrier grid.
8. A task allocation apparatus characterized by comprising: The device is applied to a scenario of full area coverage, where the task of the scenario is to traverse each position of the target area, and the device includes: Acquisition module, the acquisition module includes a division submodule and a partition submodule: The division submodule is used to divide the target area into a plurality of grids, each grid having the same size, wherein the grid containing an obstacle is an obstacle grid; The partitioning submodule is used to partition the grids in the target area except the barrier grid to obtain a plurality of sub-areas, wherein different sub-areas are separated by barrier grids; The dividing module is further configured to divide each sub-region into at least one channel, the length of the channel being equal to the length of the sub-region and the width of the channel being equal to the width of one grid. The obtaining module is configured to obtain a task of each channel, thereby obtaining a plurality of tasks, each task being from a starting grid of the corresponding channel to a terminal grid of the channel, and the number of the plurality of tasks being a first number. The determining module is configured to determine a plurality of mobile robots, the number of the plurality of mobile robots being a second number. The distribution module comprises a determining sub-module and a calculating sub-module. The determining sub-module is configured to determine a current position of each mobile robot in the plurality of mobile robots when the first number is greater than the second number. The calculating sub-module is configured to calculate a generation value of each task performed by each mobile robot according to the current position of each mobile robot. The calculating sub-module is further configured to calculate, for each mobile robot and each task, a moving path of the mobile robot when the mobile robot moves to a starting grid corresponding to the task. The calculating sub-module is further configured to obtain a moving distance corresponding to the moving path, obtain a benefit of the task, the benefit being positively correlated with a priority of the task, and calculate a difference between the moving distance and the benefit as the generation value of the mobile robot performing the task, wherein the number of channels with the highest benefit of tasks in each sub-region is at least one, and the highest benefits of different sub-regions are equal. The determining sub-module is further configured to determine, according to the plurality of calculated generation values, a specified task distribution scheme with the smallest sum of generation values in a plurality of task distribution schemes, each task distribution scheme in the plurality of task distribution schemes comprising one task corresponding to each mobile robot.
9. The apparatus of claim 8, wherein, The distribution module is further configured to, when a first mobile robot in the plurality of mobile robots completes task performance, select one task from a plurality of tasks that have not been distributed and assign the task to the first mobile robot; or The distribution module is further configured to, when a new second mobile robot is added, select one task from a plurality of tasks that have not been distributed and assign the task to the second mobile robot.
10. The apparatus of claim 8, wherein, The distribution module is further configured to, when a third mobile robot that has been assigned a first task in the plurality of tasks cancels performance of the first task, select one fourth mobile robot from a plurality of mobile robots that have not been assigned tasks, and assign the first task to the fourth mobile robot.
11. The device according to any of claims 8-10, characterized in that The benefit of the task of the first channel in each sub-region is the highest, the terminal grid of any channel in each sub-region is adjacent to the starting grid of an adjacent channel, and the benefits of the tasks of the respective channels in each sub-region decrease in turn according to a decreasing amplitude.
12. The device of any one of claims 8-10, wherein, The determining sub-module comprises: A composing unit configured to compose the plurality of generation values into a generation value matrix, the first dimension of the generation value matrix being a mobile robot and the second dimension of the generation value matrix being a task, and an element in the generation value matrix being a generation value when a corresponding mobile robot performs a corresponding task. The acquisition unit is configured to acquire a matching matrix corresponding to the generation value matrix by using a preset task allocation algorithm, and an element in the matching matrix is a matching coefficient between a corresponding mobile robot and a corresponding task. The composition unit is further configured to compose a matching combination of a mobile robot and a task corresponding to a matching coefficient equal to a specified value in the matching matrix to obtain a plurality of matching combinations, and to form the specified task allocation scheme based on the plurality of matching combinations.
13. The apparatus of any one of claims 8-10, wherein, The determination sub-module comprises: The construction unit is configured to construct a capacity network, the capacity network comprising a source node, a sink node, a robot node corresponding to each mobile robot, and a task node corresponding to each task, the source node and each robot node being connected by a first type of path, each robot node and each task node being connected by a second type of path, and each task node and the sink node being connected by a third type of path. The configuration unit is configured to configure a cost of each first type of path and each third type of path in the capacity network as 0, and to configure a cost of each second type of path as a generation value when a mobile robot corresponding to a connected robot node performs a task corresponding to a connected task node. The acquisition unit is configured to acquire a plurality of second type of paths that are passed through when the total cost of the capacity network is minimum and the total flow is maximum by using a minimum cost maximum flow algorithm. The composition unit is configured to compose a matching combination of a mobile robot corresponding to a connected robot node and a task corresponding to a connected task node in a same second type of path in the plurality of second type of paths to obtain a plurality of matching combinations, and to form the specified task allocation scheme based on the plurality of matching combinations.
14. The apparatus of any one of claims 8-10, wherein, The division sub-module is configured to, in a process of performing one scan on the target region, when a first position where connectivity changes is scanned, and then a second position where connectivity changes is scanned, divide a region between the first position and the second position according to positions of obstacle grids to obtain at least one sub-region, so that different sub-regions are separated by obstacle grids. The connectivity change refers to a change in a distribution of obstacle grids.
15. A dispensing device characterized by The allocation device comprises a processor and a memory; the memory is used to store a computer program; the processor is used to execute the computer program stored in the memory to realize the method steps in any one of claims 1-7.
16. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program is executed by the processor to realize the method steps in any one of claims 1-7.
Citation Information
Patent Citations
Task allocation method for multi-rescue-robot system
CN105956748A
Robot controller and robot system
EP1815951B1
Multi-robot distributed task assignment formation method facing dynamic task
CN106875090A
Method and apparatus of assignment problem based on multi-robot and multi-task, user equipment
CN106982139A