Task allocation method and device, electronic equipment, storage medium and program product
By identifying and prioritizing tasks based on their scenarios, and combining this with scenario classification models and routing tables, the problems of resource mismatch and scheduling chaos in task allocation were solved. This enabled precise matching and orderly execution of tasks and robot clusters, improving task execution efficiency and system stability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-03
- Publication Date
- 2026-04-07
AI Technical Summary
Existing task allocation methods are prone to resource mismatch and scheduling chaos, failing to meet the immediate response requirements of urgent tasks. Furthermore, the single priority sorting strategy leads to disordered task execution, reducing overall task processing efficiency and system stability.
By recognizing the scene of the task to be assigned, the scene classification model is used to accurately match the task with the robot cluster. The task queue is sorted by priority and creation time to ensure orderly task allocation and execution. The model architecture of embedding layer, attention layer, pooling layer and fully connected layer is adopted to improve the accuracy of scene recognition. The scene routing table and preset execution time are used to trigger task allocation.
It achieves precise matching between tasks and robot clusters, avoids resource mismatch and cross-scenario interference, improves task execution efficiency and system stability, meets the immediate response requirements of emergency tasks, and reduces scheduling complexity and resource waste.
Smart Images

Figure CN121809906A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of task allocation technology, and more specifically, to a task allocation method, apparatus, electronic device, computer-readable storage medium, and computer program product. Background Technology
[0002] With the development of computer technology, the amount of tasks undertaken by robots continues to increase. Efficient task management and allocation have become the key to ensuring the orderly execution of tasks. However, existing task allocation methods still suffer from resource mismatch and scheduling chaos. Summary of the Invention
[0003] This application provides a task allocation method, apparatus, electronic device, computer-readable storage medium, and computer program product, aiming to solve the technical problems of resource mismatch and scheduling chaos that are prone to occur in existing task allocation methods.
[0004] Firstly, a task allocation method is provided, which includes: Obtain the tasks to be assigned and determine the scenario information of the tasks to be assigned; Determine the corresponding target task queue and target robot cluster based on the scene information; Obtain the priority information of the tasks to be assigned, and add the tasks to be assigned to the target task queue based on the priority information; Based on the target task queue, the tasks to be assigned are sequentially assigned to the robots in the target robot cluster for execution.
[0005] In this embodiment, by identifying the scenario of the task to be assigned, the task to be assigned is accurately matched with the task queue and robot cluster, reducing the resource consumption of finding available robots, avoiding resource mismatch between tasks and robots and cross-scenario interference, and by combining priority task queues of different scenarios to orderly allocate tasks of the same scenario to the robot cluster, orderly task scheduling under the same scenario is achieved, and task execution efficiency is improved.
[0006] In some possible implementations, the task to be assigned is obtained, and the scenario information of the task to be assigned is determined, including: Obtain the task to be assigned. If the task to be assigned does not include scene information, input the task to be assigned into the preset scene classification model to obtain the scene classification result. Based on the scene classification results, determine the scene information of the tasks to be assigned.
[0007] In this embodiment, the scene classification model is used to identify the scene corresponding to the task to be assigned, which improves the accuracy and efficiency of scene identification. This not only avoids resource mismatch problems, but also effectively improves the accuracy and efficiency of task allocation.
[0008] In some possible implementations, the scene classification model includes an embedding layer, an attention layer, a pooling layer, a fully connected layer, and a decoding layer; Input the task to be assigned into a preset scene classification model to obtain scene classification results, including: Obtain the task to be assigned. If the task to be assigned does not include scene information, input the task to be assigned into the embedding layer to obtain the initial sequence vector. The initial sequence vector is input into the attention layer to obtain the semantic association vector; The semantic association vector is input into the pooling layer to obtain the task feature vector; The task feature vector is input into the fully connected layer to obtain the classification vector; The classification vector is input into the decoding layer to obtain the scene classification result.
[0009] In this embodiment, task information is transformed into vectors through the embedding layer of the scene classification model, and then the attention mechanism is used to accurately capture key information. Finally, the most representative task features are extracted through pooling and fully connected layers, and the accurate scene classification result is output after decoding. This model architecture design can improve the accuracy of scene classification, has stronger robustness and generalization ability, thereby improving the accuracy of task allocation.
[0010] In some possible implementations, the scene classification result includes at least one predicted scene information and the confidence level of each predicted scene information; Based on the scene classification results, the scene information for the tasks to be assigned is determined, including: If there is at least one predicted scenario information whose confidence level is greater than or equal to a preset confidence threshold, then the predicted scenario information with the highest confidence level is the scenario information for the task to be assigned. If the confidence level is less than the preset confidence threshold, task allocation will stop and an error message for the pending tasks will be generated.
[0011] In this embodiment, by selecting the scenario with the highest confidence level when the threshold is met, the probability of scenario mismatch can be reduced, ensuring that tasks can be accurately routed to the corresponding target task queue, avoiding the distribution of tasks to robot clusters with mismatched scenarios, and improving the reliability and stability of the overall task scheduling system.
[0012] In some possible implementations, the corresponding target task queue and target robot cluster are determined based on scene information, including: Based on scene information and a preset scene routing table, the target task queue and target robot cluster corresponding to the tasks to be assigned are obtained; the scene routing table includes the correspondence between scene information and target task queue and the correspondence between scene information and target robot cluster.
[0013] In this embodiment, the corresponding target task queue and target robot cluster are determined from the scene routing table based on the scene information. The target task queue and robot cluster are quickly determined based on the scene routing table, avoiding task mismatch, reducing errors, and improving task allocation efficiency.
[0014] In some possible implementations, the priority information includes priority and creation time; Obtain the priority information of the tasks to be assigned, and add the tasks to be assigned to the target task queue based on the priority information, including: Get the priority and creation time of the tasks to be assigned; Tasks to be assigned are added to the target task queue based on priority and creation time.
[0015] In this embodiment, priority hierarchical structure ensures that high-priority tasks are always at the front of the queue, preventing low-priority tasks from occupying critical resources and meeting the immediate response needs of urgent tasks. By sorting tasks of the same level by creation time, scheduling chaos caused by disordered insertion of tasks of the same priority is avoided, the long waiting time of early created tasks is reduced, and the efficiency and stability of overall task allocation and execution are improved.
[0016] In some possible implementations, tasks to be assigned are added to the target task queue based on priority and creation time, including: The priority position of the task to be assigned in the target task queue is determined based on priority. Based on creation time, adjust priority positions to add tasks to be assigned to the target task queue.
[0017] In this embodiment, by introducing priority and creation time, the backlog of early tasks and long waiting times caused by disordered arrangement can be reduced. When adding tasks to the task queue, they are sorted based on creation time. In subsequent task allocation, there is no need to additionally judge the execution priority of tasks of the same level. Resources are directly called and allocated to the corresponding robots in order, which effectively reduces the complexity and time consumption of scheduling decisions, reduces the problems of duplicate task allocation and missed allocation caused by fuzzy sorting rules, and further improves the efficiency of overall task flow and the stability of scheduling system operation.
[0018] In some possible implementations, the priority information includes priority and creation time; Based on the target task queue, tasks to be assigned are sequentially distributed to robots in the target robot cluster for execution, including: Determine the execution time of each task to be assigned in the target task queue; Based on the target task queue, the execution time of each task to be assigned is compared with the current time in turn; If the current time reaches the execution time of the task to be assigned, the target task is obtained; The target task is assigned to a robot in the target robot cluster to perform the target task.
[0019] In this embodiment, by strictly triggering tasks according to the preset execution time, all operations are guaranteed to start on time, meeting the timeliness requirements of the business. By combining priority and creation time for sorting, the most urgent and important tasks are always processed first, avoiding resource waste and task backlog. When a task reaches its execution time, the system can immediately assign it to the appropriate target robot, realizing a seamless connection from task scheduling to resource allocation, maximizing the utilization rate of the robot cluster and the overall task execution efficiency.
[0020] In some possible implementations, the priority information may also include the number of retries; Obtain the priority information of the tasks to be assigned, and add the tasks to be assigned to the target task queue based on the priority information, including: The priority position of the task to be assigned in the target task queue is determined based on priority. If there are tasks with the same priority to be assigned, the priority position is adjusted based on the number of retries; If there are tasks waiting to be assigned with the same number of retries, their priority will be adjusted based on their creation time. Tasks to be assigned are added to the target task queue based on their priority position.
[0021] In this embodiment, tasks to be assigned are precisely inserted into the target task queue based on priority, number of retries, and creation time. This avoids disordered sorting when tasks are re-entered due to assignment failure, making task scheduling more reasonable and further improving task allocation efficiency.
[0022] In some possible implementations, based on the target task queue, tasks to be assigned are sequentially distributed to robots in the target robot cluster for execution, including: Retrieve the target task from the head of the target task queue and determine the execution time of the target task; Determine if the current time has reached the execution time; If the current time has not reached the execution time, the number of retries for the target task is increased, and based on the increased number of retries, the target task is added back to the target task queue. The process of retrieving the target task from the head of the target task queue continues until the current time reaches the execution time. If the current time reaches the execution time, the target task will be assigned to a robot in the target robot cluster to execute the target task.
[0023] In this embodiment, tasks are first retrieved from the head of the queue to determine their execution time. If the time has not yet arrived, the number of retries is increased and the task is re-added to the queue until the execution time is reached. Then, the task is assigned, which avoids tasks that have not yet reached their execution time from waiting for a long time and occupying resources. This ensures that tasks are accurately assigned according to their execution time, further improving the timeliness of task scheduling and the stability of execution.
[0024] In some possible implementations, the target robot cluster includes at least one robot and energy efficiency information for each robot; Assigning target tasks to robots within the target robot cluster to perform the target tasks, including: If there are idle robots in the target robot cluster, the target robot is determined from the idle robots based on the energy efficiency information of each robot. The target task is assigned to the target robot to perform the target task.
[0025] In this embodiment, selecting target robots based on energy efficiency information can avoid resource waste caused by random allocation, reduce energy consumption and time costs during robot task execution, improve task execution efficiency, prevent some robots from prematurely entering maintenance state due to frequent high-energy-consuming and long-distance tasks, extend the service life of the overall cluster equipment, and reduce equipment maintenance costs.
[0026] Secondly, a task allocation device is provided, the device comprising: The acquisition module is used to acquire tasks to be assigned and determine the scenario information of the tasks to be assigned. The queue determination module is used to determine the corresponding target task queue and target robot cluster based on scene information; The priority determination module is used to obtain the priority information of the tasks to be assigned and add the tasks to be assigned to the target task queue based on the priority information. The allocation module is used to sequentially allocate tasks to robots in the target robot cluster based on the target task queue, so that the tasks can be executed.
[0027] Thirdly, an electronic device is provided, the electronic device comprising: A memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of any of the methods in the first aspect of this application.
[0028] Fourthly, a computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements a task allocation method as shown in any of the first aspects of this application.
[0029] Fifthly, a computer program product is provided, comprising a computer program that, when executed by a processor, implements the steps of any one of the methods in the first aspect of this application. Attached Figure Description
[0030] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments of this application will be briefly introduced below.
[0031] Figure 1 This is a schematic diagram illustrating an application scenario of a task allocation method provided in an embodiment of this application. Figure 2 A flowchart illustrating a task allocation method provided in an embodiment of this application; Figure 3 A schematic diagram illustrating the correspondence between scenarios, queues, and clusters in a task allocation method provided in an embodiment of this application; Figure 4 A schematic diagram of a target task queue in a task allocation method provided in an embodiment of this application; Figure 5 A flowchart illustrating an example of a task allocation method provided in an embodiment of this application; Figure 6 This is a schematic diagram of the structure of a task allocation device provided in an embodiment of this application; Figure 7 This is a schematic diagram of the structure of an electronic device to which a task allocation method is applicable, as provided in an embodiment of this application. Detailed Implementation
[0032] The embodiments of this application are described below with reference to the accompanying drawings. It should be understood that the embodiments described below with reference to the accompanying drawings are exemplary descriptions for explaining the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions of the embodiments of this application.
[0033] Those skilled in the art will understand that, unless otherwise stated, the singular forms “a,” “an,” “the,” and “the” used herein may also include the plural forms. It should be further understood that the terms “comprising” and “including” as used in the embodiments of this application mean that the corresponding feature can be implemented as the presented feature, information, data, step, operation, element, and / or component, but do not exclude implementation as other features, information, data, step, operation, element, component, and / or combinations thereof supported by the art. It should be understood that when we say that an element is “connected” or “coupled” to another element, the one element can be directly connected or coupled to the other element, or it can mean that the one element and the other element establish a connection relationship through an intermediate element. Furthermore, “connected” or “coupled” as used herein can include wireless connection or wireless coupling. The terms “or,” “and / or,” “including at least one of the following,” etc., as used in this application, can be interpreted as inclusive, or mean any one or any combination thereof. For example, "including at least one of the following: A, B, C" means "any one of the following: A; B; C; A and B; A and C; B and C; A and B and C", and "A, B or C" or "A, B and / or C" means "any one of the following: A; B; C; A and B; A and C; B and C; A and B and C".
[0034] In the embodiments of this application, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.
[0035] In the specific embodiments of this application, any data related to the object, such as data involved in the use of the application, is required. When the embodiments of this application are applied to specific products or technologies, permission or consent from the object is required, and the collection, use, and processing of the relevant data must comply with the relevant laws, regulations, and standards of the relevant countries and regions. In other words, if any of the aforementioned object-related data is involved in the embodiments of this application, this data must be obtained with the object's authorization and consent, and in accordance with the relevant laws, regulations, and standards of the country and region.
[0036] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0037] Current technologies primarily rely on two core strategies for task allocation to robots: First-In-First-Out (FIFO) and single-priority sorting. However, both have significant limitations. While the FIFO principle is simple to implement and ensures fair execution of tasks in the order they are requested, it completely ignores the urgency and importance of tasks. When a high-priority task arrives, it must wait for lower-priority tasks to complete. For example, when emergency equipment failure monitoring or energy criticality warnings enter the queue, routine environmental data collection must be completed first, failing to meet the need for immediate response and potentially leading to delays in critical information and increased system risk. On the other hand, the single-priority sorting strategy lacks a unified sorting rule for tasks of the same priority, relying solely on tasks entering randomly and executing in sequence. This is prone to disordered execution, such as multiple multi-area tasks with the same priority being executed out of order. This can lead to conflicts in robot resource allocation, chaotic data transmission logic, and reduced overall task processing efficiency and system stability.
[0038] This application provides a task allocation method, apparatus, electronic device, computer-readable storage medium, and computer program product, which aim to solve at least one of the above-mentioned technical problems of the prior art.
[0039] In view of at least one of the above-mentioned technical problems or areas for improvement in related technologies, this application proposes a task allocation method, apparatus, electronic device, computer-readable storage medium, and computer program product. The task allocation method provided by this solution achieves accurate matching between the task to be allocated and the task queue and robot cluster by identifying the scenario of the task to be allocated, reducing the resource consumption of finding available robots, avoiding resource mismatch and cross-scenario interference between tasks and robots, and orderly allocating tasks in the same scenario to the robot cluster by combining priority task queues of different scenarios, thereby realizing orderly task scheduling in the same scenario and improving task execution efficiency.
[0040] The technical solutions of this application and their effects are described below through several exemplary embodiments. It should be noted that the following embodiments can be referenced, borrowed from, or combined with each other. Identical terms, similar features, and similar implementation steps in different embodiments will not be repeated.
[0041] Figure 1 This is a schematic diagram of an application scenario for the task allocation method provided in the embodiments of this application. The application environment may include a server 100 and robot clusters corresponding to different scenarios. The server 100 is used for scenario pairing.
[0042] The aforementioned robot cluster may include at least one robot, such as Figure 1As shown, robot cluster 1 can include robot 1, robot 2 and robot 3, robot cluster 2 can include robot 4 and robot 5, ..., robot n can include robot n, robot n+1 and robot n+2, where n is an integer greater than 0.
[0043] Specifically, server 100 obtains the tasks to be assigned, determines the scenario information of the tasks to be assigned, determines the corresponding target task queue and target robot cluster based on the scenario information, obtains the priority information of the tasks to be assigned, adds the tasks to be assigned to the target task queue based on the priority information, and assigns the tasks to be assigned to the robots in the target robot cluster in turn based on the target task queue to execute the tasks to be assigned.
[0044] In the specific implementation process, the application environment of this application may include a factory environment, which may include multiple different work areas. The work areas are different scenarios in the above task allocation method. At least one robot is deployed in each work area. The work content of different work areas is different. It is necessary to process the task scheduling and allocation of robots in different work areas. Using the method of this application can ensure the orderly allocation and execution of tasks in different work areas.
[0045] For example, the task allocation method in this application embodiment can be applied to component installation tasks of robots in the installation workshop of an automobile factory, motherboard welding tasks of robots in an electronics workshop, transfer tasks of robot parts or materials in a parts warehouse, handling and placement tasks of robots in a warehouse, and operation tasks of robotic arms in an operation workshop. Specifically, it can be adapted to the changes in the application scenario.
[0046] The above application scenario is just an example and does not limit the application scenarios of the task allocation method in this application.
[0047] Those skilled in the art will understand that a server can include a server equipped with algorithms capable of processing robot task instruction parsing, task priority sorting, resource conflict coordination, and real-time scheduling. The server can be an independent physical server deployed locally in the factory, a server cluster or distributed system composed of multiple local physical servers, or a cloud server or edge-cloud collaborative server cluster providing basic industrial cloud services such as industrial-grade cloud services, edge computing services, real-time data processing services, equipment collaborative management services, task scheduling algorithm cloud deployment services, production data cloud storage services, industrial network security services, equipment status monitoring services, and robot task big data analysis and intelligent optimization platforms. The embodiments of this application can be applied to various factory scenarios, including but not limited to robot cluster scheduling in automotive manufacturing workshops, robot task allocation in electronic component assembly lines, path planning and scheduling for warehousing and logistics robots, and collaborative operation scheduling for heavy industrial robots. The specific application can also be determined based on the actual application environment, application scenario, robot type (such as industrial robotic arms, collaborative robots, etc.), and production task requirements, and is not limited here.
[0048] In some possible implementations, taking a server as the execution entity as an example, embodiments of this application provide a task allocation method, such as... Figure 2 As shown, it may include the following steps: S210, Obtain the task to be assigned and determine the scenario information of the task to be assigned; The tasks to be assigned may include, but are not limited to, creation time, execution time, execution status, and priority information. The scenario information may be the workspace corresponding to the task to be assigned.
[0049] Specifically, the task to be assigned is obtained. The scene information of the task to be assigned can be preset. If the task to be assigned has scene information, the scene information can be obtained directly. If the task to be assigned does not have scene information, the task to be assigned can be matched with multiple preset scene features to determine the scene information. Alternatively, the scene information of the task to be assigned can be determined based on a scene classification model.
[0050] In a specific implementation, the task to be assigned may include information about the task initiator, the target location, the resources required, and related materials. The information about the task initiator, the target location, the required resources, and related materials are analyzed to obtain task characteristics. These task characteristics are then matched against a preset scene feature library to determine the scene information corresponding to the task to be assigned. The preset scene feature library includes scene characteristics corresponding to each scene. When a new scene is added, its characteristics can be added to the preset scene feature library so that tasks corresponding to the new scene can determine their scene information based on these characteristics, ensuring accurate task allocation and avoiding mismatches.
[0051] S220 determines the corresponding target task queue and target robot cluster based on scene information; The target task queue includes at least one task to be assigned, and the target robot cluster includes at least one robot.
[0052] Specifically, based on the scenario information of the tasks to be assigned, the corresponding target task queue and target robot cluster are determined, thereby accurately assigning the tasks to the robots with the correct functions for processing and improving the accuracy of task assignment.
[0053] In this embodiment, corresponding task queues and robot clusters are pre-set for different scenarios. When a new task to be assigned is obtained, the task is added to the corresponding target task queue based on the scenario information of the task. Then, the task is assigned to the robots in the robot cluster in an orderly manner based on the priority relationship of the target task queue, and the robots are controlled to execute the corresponding tasks. Through the task allocation process of different scenarios, the task and robot capabilities are accurately matched. The task queues set for different scenarios enable the tasks to be scheduled in an orderly manner according to priority, avoiding resource mismatch and cross-scenario interference, and efficiently ensuring the efficient allocation of tasks in different scenarios.
[0054] S230, Obtain the priority information of the tasks to be assigned, and add the tasks to be assigned to the target task queue based on the priority information; Specifically, the priority information of the task to be assigned is obtained, and the priority information is matched with the priority of the existing tasks in the target task queue to determine the position of the task to be assigned in the queue, thereby inserting the task to be assigned into the target task queue.
[0055] In a specific implementation, priority information may include priority and creation time. First, tasks of the same priority as the task to be assigned can be determined based on priority. Then, the creation time of the task to be assigned is compared with that of the tasks of the same priority to determine the sorting position of the task to be assigned among the tasks of the same priority. Thus, the task to be assigned is inserted into the target task queue. Placing tasks with higher priority at the head of the target task queue ensures that important tasks can be executed first. Placing tasks with earlier creation times at the head of the target task queue can reduce task waiting time.
[0056] S240, based on the target task queue, sequentially assigns the tasks to be assigned to the robots in the target robot cluster for execution.
[0057] The target task queue includes at least one task to be assigned. The tasks to be assigned are sorted according to their priority, with the higher priority tasks being located at the head of the target task queue.
[0058] Specifically, based on the target task queue, the process traverses from the head to the tail, sequentially taking out tasks to be assigned and assigning them. It is then determined whether the tasks to be assigned meet the first preset assignment condition. If they do, it is determined whether the robots in the target robot cluster meet the second preset assignment condition. If the robots in the target robot cluster meet the second preset assignment condition, the tasks to be assigned are assigned to the robots in the target robot cluster for execution, and the traversal of tasks to be assigned in the target task queue is stopped. The process then restarts from the head of the target task queue and repeats the above process until all tasks to be assigned in the target task queue have been assigned and executed.
[0059] In a specific implementation, when traversing the tasks to be assigned, it is determined whether the tasks to be assigned meet the first preset assignment condition. If the first preset assignment condition is met, it is determined whether the robots in the target robot cluster meet the second preset assignment condition. If the first preset assignment condition is not met, the traversal process is stopped, and the tasks to be assigned are retrieved from the head of the target task queue for judgment again, until a target assignment task that meets the first preset assignment condition is found. Then, it is determined whether the robots in the target robot cluster meet the second preset assignment condition. If the robots in the target robot cluster meet the second preset assignment condition, the target assignment task is assigned to the robot. If the second preset assignment condition is not met, the current traversal process is stopped, and the tasks to be assigned are traversed again from the head of the target task queue. The above process is repeated until all tasks to be assigned in the target task queue are assigned and executed.
[0060] In some possible implementations, the steps of obtaining the task to be assigned and determining the scenario information of the task to be assigned include: Obtain the task to be assigned. If the task to be assigned does not include scene information, input the task to be assigned into the preset scene classification model to obtain the scene classification result. Based on the scene classification results, determine the scene information of the tasks to be assigned.
[0061] Specifically, the process involves acquiring tasks to be assigned. If the tasks do not include scene information, they are input into a pre-defined scene classification model to obtain scene classification results. These results can directly include scene information or include multiple scenes and their corresponding confidence levels. Based on the confidence levels of each scene, the scene with the highest confidence level exceeding a pre-defined threshold is identified, thus providing the scene information for the tasks to be assigned. By using the scene classification model to identify the scene corresponding to the tasks to be assigned, the accuracy and efficiency of scene identification are improved. This approach avoids resource mismatch issues and effectively enhances the accuracy and efficiency of task allocation. In specific implementations, such as Figure 3As shown, the task to be assigned is obtained. If the task to be assigned does not include scene information, the task to be assigned is input into the scene selector to obtain the scene classification result. Based on the scene classification result, the scene information of the task to be assigned is determined, and then the robot cluster corresponding to the scene information is determined. Thus, the robot corresponding to the task to be assigned is determined from the robot cluster. The scene selector includes, but is not limited to, large models and CNN models.
[0062] In some possible implementations, the above steps involve inputting the task to be assigned into a preset scene classification model to obtain scene classification results, including: Obtain the task to be assigned. If the task to be assigned does not include scene information, input the task to be assigned into the embedding layer to obtain the initial sequence vector. The initial sequence vector is input into the attention layer to obtain the semantic association vector; The semantic association vector is input into the pooling layer to obtain the task feature vector; The task feature vector is input into the fully connected layer to obtain the classification vector; The classification vector is input into the decoding layer to obtain the scene classification result.
[0063] The scene classification model includes an embedding layer, an attention layer, a pooling layer, a fully connected layer, and a decoding layer.
[0064] Specifically, the process involves obtaining the task to be assigned. If the task does not include scene information, it is input into the embedding layer to obtain an initial sequence vector. This initial sequence vector is then input into the attention layer to obtain a semantic association vector. The semantic association vector is input into the pooling layer to obtain a task feature vector. This task feature vector is then input into the fully connected layer to obtain a classification vector. Finally, the classification vector is input into the decoding layer to obtain the scene classification result. By converting task information into vectors through the embedding layer of the scene classification model, and then using the attention mechanism to accurately capture key information, the most representative task features are extracted through pooling and fully connected layers. After decoding, an accurate scene classification result is output. This model architecture design can improve the accuracy of scene classification, has stronger robustness and generalization ability, thereby improving the accuracy of task assignment.
[0065] In a specific implementation, a task sample set is obtained, containing multiple task samples, each labeled with a corresponding scene classification label. These task samples are then input one by one into the scene classification model to obtain scene classification results. Based on the output scene classification results and scene classification labels, the parameters of the scene classification model are updated until a predetermined termination condition is met, ending the training and obtaining a trained scene classification model. During training, a task sample set containing multiple task samples, each labeled with a corresponding scene classification label, can be obtained first. These multiple task samples are then divided into a training set, a validation set, and a test set according to a predetermined ratio. The parameters of the encoder and decoder in the scene classification model are then adjusted and determined based on the task samples included in the training set, validation set, and test set, resulting in a trained scene classification model.
[0066] In some possible implementations, the above steps, based on the scene classification results, determine the scene information of the task to be assigned, including: If there is at least one predicted scenario information whose confidence level is greater than or equal to a preset confidence threshold, then the predicted scenario information with the highest confidence level is the scenario information for the task to be assigned. If the confidence level is less than the preset confidence threshold, task allocation will stop and an error message for the pending tasks will be generated.
[0067] The scene classification results include at least one predicted scene information and the confidence level of each predicted scene information.
[0068] Specifically, if the confidence level of at least one predicted scenario is greater than or equal to a preset confidence threshold, the predicted scenario with the highest confidence level is selected as the scenario information for the task to be assigned. If the confidence levels of all scenarios are less than the preset confidence threshold, task assignment is stopped and an error message for the task to be assigned is generated. Selecting the scenario with the highest confidence level when the threshold is met can reduce the probability of scenario mismatch, ensure that tasks can be accurately routed to the corresponding target task queue, avoid assigning tasks to robot clusters with mismatched scenarios, and improve the reliability and stability of the overall task scheduling system.
[0069] In a specific implementation, if a task is created without scene information, we classify it using a scene selector. The classifier outputs the scene and its corresponding confidence level. If the confidence level is greater than a set threshold, the task is routed to the target task queue. If the confidence level for multiple scenes is less than the threshold, an error message is generated and fed back to the task submitter, indicating that the scene information is unclear.
[0070] In some possible implementations, the steps described above, which involve determining the corresponding target task queue and target robot cluster based on scene information, include: Based on scene information and a preset scene routing table, the target task queue and target robot cluster corresponding to the tasks to be assigned are obtained.
[0071] The scene routing table includes the correspondence between scene information and target task queues, as well as the correspondence between scene information and target robot clusters.
[0072] Specifically, when a task is submitted for assignment, the scene information can be determined through a scene selector. The scene selector has a scene routing table, and the corresponding target task queue and target robot cluster are determined from the scene routing table based on the scene information. The target task queue and robot cluster are quickly determined based on the scene routing table, avoiding task mismatch. This not only reduces errors but also improves task allocation efficiency.
[0073] In the specific implementation process, when adding a new scenario, a corresponding queue is created. The task queue and robot cluster corresponding to the scenario can be added directly to the scenario routing table. This allows for direct location of the task queue and the robot with the matching function based on the scenario information. When adding a robot, it can be directly added to the corresponding cluster without spending a lot of time and resources to establish the correspondence between the new robot and the task. This demonstrates the flexibility and scalability of the task allocation scheme in this application.
[0074] In the specific implementation process, a version record can be generated after each routing table update. The version record includes the update time, update content and operator. If a routing anomaly occurs after the update, such as a task mismatch in the queue, it can be rolled back to the historical version with one click based on the version record to avoid affecting the task scheduling process and ensure the stable allocation of tasks.
[0075] In some possible implementations, obtaining the priority information of the task to be assigned in the above steps, and adding the task to be assigned to the target task queue based on the priority information, includes: Get the priority and creation time of the tasks to be assigned; Tasks to be assigned are added to the target task queue based on priority and creation time.
[0076] The priority information includes priority and creation time.
[0077] Specifically, the process involves obtaining the priority and creation time of the tasks to be assigned. First, based on the priority, tasks with the same priority in the target task queue are identified. Then, based on the creation time, the target position of the task to be assigned among tasks with the same priority is determined. The task to be assigned is then added to the target position in the target task queue. Through priority stratification, high-priority tasks are always placed at the front of the queue, preventing low-priority tasks from occupying critical resources and meeting the immediate response needs of urgent tasks. By sorting tasks of the same level by creation time, scheduling chaos caused by disordered insertion of tasks with the same priority is avoided, the long waiting time of early-created tasks is reduced, and the overall efficiency and stability of task allocation and execution are improved.
[0078] In the specific implementation process, priority information can include priority, number of retries, and creation time. First, the scenario corresponding to the task to be assigned is determined, resulting in a corresponding task queue. The task queue is then sorted according to the task's priority, number of retries, and creation time. Higher priority tasks are closer to the head of the queue, more retries result in a closer position to the head, and earlier creation times also place tasks closer to the head. Figure 4 As shown, rc represents the number of retries, ti represents the creation time, priority 3 is higher than priority 2, and priority 2 is higher than priority 1. When there is a new task, based on the priority of the new task, its approximate location is determined to be near priority 2. Then, the number of retries of the new task is compared with the number of retries of all tasks with priority 2. If the number of retries is the same, based on the creation time of the new task, the location of the new task is determined to be between the tasks created at 13:46 and 13:55, and the new task is inserted into the task queue.
[0079] In some possible implementations, the steps described above, which involve adding the tasks to be assigned to the target task queue based on priority and creation time, include: The priority position of the task to be assigned in the target task queue is determined based on priority. Based on creation time, adjust priority positions to add tasks to be assigned to the target task queue.
[0080] Specifically, the priority position of the task to be assigned in the target task queue is determined based on priority. Then, the task to be assigned is compared with tasks of the same priority. Based on the creation time, the position of the task to be assigned in the tasks of the same priority is adjusted so that the task to be assigned can be added to the target task queue.
[0081] In this embodiment, by introducing priority and creation time, the backlog of early tasks and long waiting times caused by disordered arrangement can be reduced. When adding tasks to the task queue, they are sorted based on creation time. In subsequent task allocation, there is no need to additionally judge the execution priority of tasks of the same level. Resources are directly called and allocated to the corresponding robots in order, which effectively reduces the complexity and time consumption of scheduling decisions, reduces the problems of duplicate task allocation and missed allocation caused by fuzzy sorting rules, and further improves the efficiency of overall task flow and the stability of scheduling system operation.
[0082] In some possible implementations, the above steps, based on the target task queue, sequentially assign tasks to robots in the target robot cluster for execution, including: Determine the execution time of each task to be assigned in the target task queue; Based on the target task queue, the execution time of each task to be assigned is compared with the current time in turn; If the current time reaches the execution time of the task to be assigned, the target task is obtained; The target task is assigned to a robot in the target robot cluster to perform the target task.
[0083] The priority information includes priority and creation time.
[0084] Specifically, the execution time of each task to be assigned in the target task queue is determined. Based on the target task queue, the execution time of each task to be assigned is compared with the current time. If the current time reaches the execution time of the task to be assigned, the target task is obtained and assigned to a robot in the target robot cluster for execution. If there is no task in the target task queue that has reached its execution time, the step of comparing the execution time of each task to be assigned with the current time is repeated until all tasks in the target task queue are assigned.
[0085] In the specific implementation process, a task to be assigned is taken from the head of the target task queue. It is then determined whether the current time has reached the execution time of the task to be assigned. If so, the task to be assigned is the target task, and the target task is assigned to a robot in the target robot cluster to execute the target task. If not, the current time is checked sequentially from the head to the tail of the target task queue to determine whether the current time has reached the execution time of the corresponding task to be assigned. If an execution time that meets the current time is found, the task to be assigned is assigned as the target task to the corresponding robot cluster. If no such time is found, the assignment fails, and the process of taking a task to be assigned from the head of the target task queue continues until all tasks in the target task queue have been assigned.
[0086] In this embodiment, by strictly triggering tasks according to the preset execution time, all operations are guaranteed to start on time, meeting the timeliness requirements of the business. By combining priority and creation time for sorting, the most urgent and important tasks are always processed first, avoiding resource waste and task backlog. When a task reaches its execution time, the system can immediately assign it to the appropriate target robot, realizing a seamless connection from task scheduling to resource allocation, maximizing the utilization rate of the robot cluster and the overall task execution efficiency.
[0087] In a specific implementation, the robot cluster task queue continuously receives task requests from various business systems. Each time a task is taken from the head of the queue, it is first determined whether the execution time of the task has arrived. If the execution time of the task has not arrived, no task allocation is performed. If the time has arrived, the task is allocated to a robot in the target robot cluster according to the following allocation strategy.
[0088] In a specific implementation, the execution time of tasks near the tail of the target task queue can be earlier than the execution time of tasks at the head of the task queue. When traversing the tasks to be assigned, it is determined whether the execution time of the assigned task has been reached. If the execution time has been reached, it is determined whether the robots in the target robot cluster meet the second preset allocation condition. If the execution time has not been reached, the traversal continues, determining whether the next assigned task has reached its execution time, until all target assigned tasks whose execution time is met are traversed. Then, it is determined whether the robots in the target robot cluster meet the second preset allocation condition. If the robots in the target robot cluster meet the second preset allocation condition, the target assigned task is assigned to a robot. If the second preset allocation condition is not met, the current traversal process stops, and the traversal of assigned tasks restarts from the head of the target task queue, repeating the above process until all assigned tasks in the target task queue are assigned and executed.
[0089] In a specific implementation, the task to be assigned may include priority, execution status, creation time and execution time. The execution status may include pending execution, in execution, failed, paused, canceled and completed. Monitoring the execution status can not only efficiently allocate resources, but also quickly respond to abnormal situations such as failure or cancellation, and support complex operations such as pausing and resuming. Ultimately, it can achieve automation, observability and high reliability of task management.
[0090] In some possible implementations, obtaining the priority information of the task to be assigned in the above steps, and adding the task to be assigned to the target task queue based on the priority information, includes: The priority position of the task to be assigned in the target task queue is determined based on priority. If there are tasks with the same priority to be assigned, the priority position is adjusted based on the number of retries; If there are tasks waiting to be assigned with the same number of retries, their priority will be adjusted based on their creation time. Tasks to be assigned are added to the target task queue based on their priority position.
[0091] The priority information includes priority, creation time, and number of retries.
[0092] Specifically, the priority position of the task to be assigned in the target task queue is determined based on priority. If there are tasks to be assigned with the same priority, the priority position is adjusted based on the number of retries. If there are tasks to be assigned with the same number of retries, the priority position is adjusted based on the creation time. The task to be assigned is added to the target task queue based on the priority position. By determining the position of the task to be assigned in the target task queue through priority information of three dimensions, the orderly execution of tasks can be guaranteed.
[0093] In the specific implementation process, priority information can include priority, number of retries, and creation time. First, the scenario corresponding to the task to be assigned is determined, resulting in a corresponding task queue. The task queue is sorted according to the task's priority, number of retries, and creation time. The higher the priority, the closer it is to the head of the target task queue; the more retries, the closer it is to the head of the target task queue; and the earlier the creation time, the closer it is to the head of the queue. In actual implementation, when a task to be assigned is retried, the retry count is incremented by one, and the task to be assigned is reinserted into the task queue. At this time, random positions may occur. Therefore, sorting based on the number of retries can avoid disorder when tasks re-enter the queue, allowing tasks with more retries to be placed at the front, reducing repeated waiting for tasks, ensuring more reasonable scheduling of tasks with the same priority, and further improving task allocation efficiency.
[0094] In some possible implementations, the above steps, based on the target task queue, sequentially assign tasks to robots in the target robot cluster for execution, including: Retrieve the target task from the head of the target task queue and determine the execution time of the target task; Determine if the current time has reached the execution time; If the current time has not reached the execution time, the number of retries for the target task is increased, and based on the increased number of retries, the target task is added back to the target task queue. The process of retrieving the target task from the head of the target task queue continues until the current time reaches the execution time. If the current time reaches the execution time, the target task will be assigned to a robot in the target robot cluster to execute the target task.
[0095] Specifically, a target task is retrieved from the head of the target task queue, and its execution time is determined. It is then checked whether the current time has reached the execution time. If the current time has not reached the execution time, the retry count for the target task is increased. Based on the increased retry count, the target task is added back to the target task queue, and the process of retrieving the target task from the head of the target task queue continues until the current time reaches the execution time. If the current time has reached the execution time, the target task is assigned to a robot in the target robot cluster to execute the target task, thus preventing tasks that have not yet reached their execution time from occupying resources and ensuring the orderly allocation of tasks.
[0096] In practical implementation, the retry count is the number of times a task to be assigned is retried when it fails to be assigned to the target robot cluster due to specific abnormal conditions. Abnormal conditions include, but are not limited to: the execution time of the task to be assigned has not arrived, there are no idle robots in the target cluster, there is a resource mismatch between the robot and the task, and the assignment instruction is not delivered due to a temporary network interruption. When a task is first created, the number of retries for the task is equal to 0. In actual implementation, when a task to be assigned is retried, the retry count is incremented by one, and the task to be assigned is reinserted into the task queue. At this time, there may be random positions. Therefore, the retry count is used to ensure that tasks with higher priority are executed first.
[0097] In some possible implementations, the steps described above, which assign the target task to robots within the target robot cluster to perform the target task, include: If there are idle robots in the target robot cluster, the target robot is determined from the idle robots based on the energy efficiency information of each robot. The target task is assigned to the target robot to perform the target task.
[0098] The target robot cluster includes at least one robot and energy efficiency information for each robot, including but not limited to estimated arrival time, estimated energy consumption, route congestion, reliability risks, and remaining power.
[0099] Specifically, if there are idle robots in the target robot cluster, the target robot is determined from the idle robots based on the energy efficiency information of each robot, and the target task is assigned to the target robot to execute the target task. If there are no idle robots, the above steps are repeated to redetermine the target task and determine whether there are idle robots in the target robot cluster.
[0100] In a specific implementation, the robot allocation process includes: first, checking if there are any idle robots in the target robot cluster. If there are idle robots, the task is directly assigned to one of them. If multiple idle robots exist, the allocation is based on the principle of optimal energy efficiency. This energy efficiency priority is typically calculated using energy efficiency information, including but not limited to: estimated arrival time, estimated energy consumption, route congestion, reliability risk, and remaining battery power. If there are no idle robots, the retry count for the task to be assigned is incremented by one, and the task is re-added to the queue. The more retries, the closer the task is to the head of the queue. The number of retries is used to avoid random placement of the task when it is re-added to the queue after the retry count is incremented, ensuring that important tasks are executed first.
[0101] In this embodiment, since tasks are sorted according to their priority, number of retries, and execution time when they are added to the queue, when there is no suitable robot to execute the task, the task will be inserted at the head of the tasks with the same priority.
[0102] In the above embodiments, by identifying the scenario of the task to be assigned, the task to be assigned is accurately matched with the task queue and robot cluster, reducing the resource consumption of finding available robots, avoiding resource mismatch between tasks and robots and cross-scenario interference, and by combining priority task queues of different scenarios to orderly allocate tasks of the same scenario to the robot cluster, orderly task scheduling under the same scenario is achieved, and task execution efficiency is improved.
[0103] In one example, the task allocation method of this application is as follows: Figure 5 As shown, it may include: In one scenario, the target robot cluster consists of only one robot. There are three tasks for this robot: inspection, product inspection, and meeting. These tasks have priorities of low, medium, and high. The current tasks are: inspection at equipment point 1, inspection at equipment point 2, inspection at safety point 1, inspection at safety point 2, product inspection point 1 pickup, and product inspection point 2 placement. These tasks are submitted to the target task queue, as shown in Table 1 below. Table 1
[0104] The right side represents the head position of the target task queue.
[0105] In this embodiment, task allocation begins. The task for product inspection point 1 is retrieved from the head of the target task queue, and its corresponding execution time is determined. If the current time reaches the execution time of the task for product inspection point 1, and the robots in the target robot cluster are idle, the task is assigned to a robot in the target robot cluster for execution. Then, the task for product inspection point 2 is retrieved from the queue. If the execution time has not yet arrived, the retry count is incremented by one. If the execution time has arrived, an attempt is made to assign it to a robot in the target robot cluster. Since there is currently only one robot in the cluster and no idle robots, the assignment of the task for product inspection point 2 fails, and the corresponding retry count is incremented by one. The task for product inspection point 2 is then put back into the queue. Since the retry count is currently the largest among tasks of the same priority, this task will be placed at the head of the priority group. This process is repeated until the robot becomes idle. When the task for product inspection point 1 is completed, the robot becomes idle, and the task for product inspection point 2 is retrieved from the head of the queue and assigned to a robot for execution.
[0106] In this embodiment, during the product delivery inspection at point 2, the robot retrieves the device point 1 inspection task from the head of the queue. Since there are no idle robots, the retry count for this task is incremented, and this process continues in a loop. During this loop, a new task request to hold a meeting is received. Because the meeting has a higher priority than the device point 1 inspection task, the meeting task is added to the head of the queue. After the product delivery inspection at point 2 is completed, the meeting task is retrieved from the head of the queue and assigned to a robot for execution, instead of the previous device point 1 inspection. During the execution of the meeting task, the device point 1 inspection task from the head of the queue is retrieved and attempted to be assigned to a robot. Because the robot is currently in a meeting, the retry count for device point 1 inspection continues to increase. When the task is returned to the queue, it is placed at the head of the lower priority queue. This process is repeated until the target task queue is empty and no more tasks are assigned, completing the task allocation process for this scenario.
[0107] The task allocation method described above achieves accurate matching between tasks to be allocated, task queues, and robot clusters by identifying the scenarios of the tasks to be allocated. This reduces the resource consumption of finding available robots, avoids resource mismatch between tasks and robots and cross-scenario interference, and by combining priority task queues for different scenarios, it orderly allocates tasks in the same scenario to the robot cluster, thus achieving orderly task scheduling in the same scenario and improving task execution efficiency.
[0108] This application provides a task allocation device, such as... Figure 6 As shown, the task allocation device 60 may include: an acquisition module 610, a queue determination module 620, a priority determination module 630, and an allocation module 640, wherein, The acquisition module 610 is used to acquire the tasks to be assigned and determine the scenario information of the tasks to be assigned. The queue determination module 620 is used to determine the corresponding target task queue and target robot cluster based on scene information; The priority determination module 630 is used to obtain the priority information of the tasks to be assigned and add the tasks to be assigned to the target task queue based on the priority information. The allocation module 640 is used to sequentially allocate tasks to be assigned to robots in the target robot cluster based on the target task queue, so that the tasks to be assigned can be executed.
[0109] As an optional embodiment, in this device, the acquisition module 610 is specifically used for: Obtain the task to be assigned. If the task to be assigned does not include scene information, input the task to be assigned into the preset scene classification model to obtain the scene classification result. Based on the scene classification results, determine the scene information of the tasks to be assigned.
[0110] As an optional embodiment, in this device, the acquisition module 610 is specifically used for: Obtain the task to be assigned. If the task to be assigned does not include scene information, input the task to be assigned into the embedding layer to obtain the initial sequence vector. The initial sequence vector is input into the attention layer to obtain the semantic association vector; The semantic association vector is input into the pooling layer to obtain the task feature vector; The task feature vector is input into the fully connected layer to obtain the classification vector; The classification vector is input into the decoding layer to obtain the scene classification result.
[0111] As an optional embodiment, in this device, the acquisition module 610 is specifically used for: If there is at least one predicted scenario information whose confidence level is greater than or equal to a preset confidence threshold, then the predicted scenario information with the highest confidence level is the scenario information for the task to be assigned. If the confidence level is less than the preset confidence threshold, task allocation will stop and an error message for the pending tasks will be generated.
[0112] As an optional embodiment, in this device, the queue determination module 620 is specifically used for: Based on scene information and a preset scene routing table, the target task queue and target robot cluster corresponding to the tasks to be assigned are obtained; the scene routing table includes the correspondence between scene information and target task queue and the correspondence between scene information and target robot cluster.
[0113] As an optional embodiment, in this device, the priority determination module 630 is specifically used for: Get the priority and creation time of the tasks to be assigned; Tasks to be assigned are added to the target task queue based on priority and creation time.
[0114] As an optional embodiment, in this device, the priority determination module 630 is specifically used for: The priority position of the task to be assigned in the target task queue is determined based on priority. Based on creation time, adjust priority positions to add tasks to be assigned to the target task queue.
[0115] As an optional embodiment, in this device, the distribution module 640 is specifically used for: Determine the execution time of each task to be assigned in the target task queue; Based on the target task queue, the execution time of each task to be assigned is compared with the current time in turn; If the current time reaches the execution time of the task to be assigned, the target task is obtained; The target task is assigned to a robot in the target robot cluster to perform the target task.
[0116] As an optional embodiment, in this device, the priority determination module 630 is specifically used for: The priority position of the task to be assigned in the target task queue is determined based on priority. If there are tasks with the same priority to be assigned, the priority position is adjusted based on the number of retries; If there are tasks waiting to be assigned with the same number of retries, their priority will be adjusted based on their creation time. Tasks to be assigned are added to the target task queue based on their priority position.
[0117] As an optional embodiment, in this device, the distribution module 640 is specifically used for: Retrieve the target task from the head of the target task queue and determine the execution time of the target task; Determine if the current time has reached the execution time; If the current time has not reached the execution time, the number of retries for the target task is increased, and based on the increased number of retries, the target task is added back to the target task queue. The process of retrieving the target task from the head of the target task queue continues until the current time reaches the execution time. If the current time reaches the execution time, the target task will be assigned to a robot in the target robot cluster to execute the target task.
[0118] As an optional embodiment, in this device, the distribution module 640 is specifically used for: If there are idle robots in the target robot cluster, the target robot is determined from the idle robots based on the energy efficiency information of each robot. The target task is assigned to the target robot to perform the target task.
[0119] This application provides a task allocation device that, through scene recognition of the tasks to be allocated, achieves accurate matching between the tasks to be allocated, the task queue, and the robot cluster. This reduces the resource consumption of finding available robots, avoids resource mismatch between tasks and robots and cross-scene interference, and, by combining priority task queues of different scenes, orderly allocates tasks of the same scene to the robot cluster, thereby achieving orderly task scheduling in the same scene and improving task execution efficiency.
[0120] The apparatus in this application embodiment can execute the method provided in this application embodiment, and its implementation principle is similar, and it has corresponding technical effects. The actions performed by each module in the apparatus of each embodiment of this application correspond to the steps in the method of each embodiment of this application. For a detailed functional description of each module of the apparatus, please refer to the description in the corresponding method shown above, which will not be repeated here.
[0121] This application provides an electronic device including a memory, a processor, and a computer program stored in the memory. The processor executes the computer program to implement the steps of the method provided in any optional embodiment of this application. Compared with the prior art, it can achieve the following: by identifying the scene of the task to be assigned, it realizes accurate matching between the task to be assigned, the task queue, and the robot cluster, reduces the resource consumption of finding available robots, avoids resource mismatch and cross-scene interference between tasks and robots, and orderly allocates tasks in the same scene to the robot cluster by combining priority task queues of different scenes, realizing orderly task scheduling in the same scene and improving task execution efficiency.
[0122] In one alternative embodiment, an electronic device is provided, such as Figure 7 As shown, Figure 7 The illustrated electronic device 7000 includes a processor 7001 and a memory 7003. The processor 7001 and the memory 7003 are connected, for example, via a bus 7002. Optionally, the electronic device 7000 may further include a transceiver 7004, which can be used for data interaction between the electronic device and other electronic devices, such as sending and / or receiving data. It should be noted that in practical applications, the transceiver 7004 is not limited to one type, and the structure of the electronic device 7000 does not constitute a limitation on the embodiments of this application.
[0123] Processor 7001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 7001 may also be a combination that implements computational functions, such as including one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.
[0124] Bus 7002 may include a pathway for transmitting information between the aforementioned components. Bus 7002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. Bus 7002 can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 7 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0125] The memory 7003 may be ROM (Read Only Memory) or other types of static storage devices capable of storing static information and instructions, RAM (Random Access Memory) or other types of dynamic storage devices capable of storing information and instructions, or EEPROM (Electrically Erasable Programmable Read Only Memory), CD-ROM (Compact Disc Read Only Memory) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media, other magnetic storage devices, or any other medium capable of carrying or storing computer programs and capable of being read by a computer, without limitation herein.
[0126] The memory 7003 is used to store computer programs that execute the embodiments of this application, and its execution is controlled by the processor 7001. The processor 7001 is used to execute the computer programs stored in the memory 7003 to implement the steps shown in the foregoing method embodiments.
[0127] Among them, electronic devices include, but are not limited to, electronic devices capable of implementing the above task allocation method.
[0128] This application provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it can implement the steps and corresponding content of the aforementioned method embodiments.
[0129] It should be noted that the computer-readable storage medium described above in this application can be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof.
[0130] This application also provides a computer program product, including a computer program that, when executed by a processor, can implement the steps and corresponding content of the aforementioned method embodiments.
[0131] The terms "first," "second," "third," "fourth," "1," "2," etc. (if present) in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in a sequence other than that shown in the illustrations or text descriptions.
[0132] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0133] It should be understood that although arrows indicate various operation steps in the flowcharts of this application's embodiments, the order in which these steps are implemented is not limited to the order indicated by the arrows. Unless explicitly stated herein, in some implementation scenarios of this application's embodiments, the implementation steps in each flowchart can be executed in other orders as required. Furthermore, some or all steps in each flowchart, based on the actual implementation scenario, may include multiple sub-steps or multiple stages. Some or all of these sub-steps or stages can be executed at the same time, and each sub-step or stage can also be executed at different times. In scenarios where execution times differ, the execution order of these sub-steps or stages can be flexibly configured according to requirements, and this application's embodiments do not limit this.
[0134] The above description is only an optional implementation method for some implementation scenarios of this application. It should be noted that for those skilled in the art, other similar implementation methods based on the technical concept of this application without departing from the technical concept of this application also fall within the protection scope of the embodiments of this application.
Claims
1. A task allocation method, characterized in that, include: Obtain the tasks to be assigned and determine the scenario information of the tasks to be assigned; Based on the scenario information, the corresponding target task queue and target robot cluster are determined; Obtain the priority information of the task to be assigned, and add the task to be assigned to the target task queue based on the priority information; Based on the target task queue, the tasks to be assigned are sequentially assigned to robots in the target robot cluster for execution.
2. The task allocation method according to claim 1, characterized in that, The step of obtaining the task to be assigned and determining the scenario information of the task to be assigned includes: Obtain the task to be assigned. If the task to be assigned does not include the scene information, input the task to be assigned into a preset scene classification model to obtain the scene classification result. Based on the scene classification results, the scene information of the task to be assigned is determined.
3. The task allocation method according to claim 2, characterized in that, The scene classification model includes an embedding layer, an attention layer, a pooling layer, a fully connected layer, and a decoding layer; The step of inputting the task to be assigned into a preset scene classification model to obtain the scene classification result includes: If the task to be assigned does not include scene information, then the task to be assigned is input into the embedding layer to obtain an initial sequence vector. The initial sequence vector is input into the attention layer to obtain the semantic association vector; The semantic association vector is input into the pooling layer to obtain the task feature vector; The task feature vector is input into the fully connected layer to obtain the classification vector; The classification vector is input into the decoding layer to obtain the scene classification result.
4. The task allocation method according to claim 2, characterized in that, The scene classification result includes at least one predicted scene information and the confidence level of each predicted scene information; The step of determining the scene information of the task to be assigned based on the scene classification result includes: If the confidence level of at least one of the predicted scene information is greater than or equal to a preset confidence threshold, then the predicted scene information with the highest confidence level is the scene information of the task to be assigned. If all the confidence levels are less than the preset confidence threshold, then task allocation is stopped and an error message for the task to be allocated is generated.
5. The task allocation method according to claim 1, characterized in that, The step of determining the corresponding target task queue and target robot cluster based on the scenario information includes: Based on the scene information and the preset scene routing table, the target task queue and target robot cluster corresponding to the task to be assigned are obtained; the scene routing table includes the correspondence between the scene information and the target task queue and the correspondence between the scene information and the target robot cluster.
6. The task allocation method according to claim 1, characterized in that, The priority information includes priority and creation time; The step of obtaining the priority information of the task to be assigned and adding the task to be assigned to the target task queue based on the priority information includes: Obtain the priority and creation time of the task to be assigned; The task to be assigned is added to the target task queue based on the priority and the creation time.
7. The task allocation method according to claim 6, characterized in that, Adding the task to be assigned to the target task queue based on the priority and the creation time includes: The priority position of the task to be assigned in the target task queue is determined based on the priority. Based on the creation time, the priority position is adjusted to add the task to be assigned to the target task queue.
8. The task allocation method according to claim 6, characterized in that, The step of sequentially assigning the tasks to be assigned to robots in the target robot cluster based on the target task queue for execution includes: Determine the execution time of each of the tasks to be assigned in the target task queue; Based on the target task queue, the execution time of each task to be assigned is compared with the current time in turn; If the current time reaches the execution time of the task to be assigned, the target task is obtained; The target task is assigned to a robot in the target robot cluster to perform the target task.
9. The task allocation method according to claim 6, characterized in that, The priority information also includes the number of retries; The step of obtaining the priority information of the task to be assigned and adding the task to be assigned to the target task queue based on the priority information includes: The priority position of the task to be assigned in the target task queue is determined based on the priority. If there are tasks to be assigned with the same priority, the priority position is adjusted based on the number of retries; If there are tasks to be assigned with the same number of retries, the priority position is adjusted based on the creation time; The task to be assigned is added to the target task queue based on its priority position.
10. The task allocation method according to claim 9, characterized in that, The step of sequentially assigning the tasks to be assigned to robots in the target robot cluster based on the target task queue for execution includes: Take the target task from the head of the target task queue and determine the execution time of the target task; Determine whether the current time has reached the specified execution time; If the current time has not reached the execution time, the number of retries for the target task is increased, and based on the increased number of retries, the target task is added back to the target task queue, and the step of retrieving the target task from the head of the target task queue continues to be executed until the current time reaches the execution time. If the current time reaches the execution time, the target task is assigned to a robot in the target robot cluster to execute the target task.
11. The task allocation method according to claim 8 or 10, characterized in that, The target robot cluster includes at least one robot and energy efficiency information for each robot; The step of assigning the target task to robots in the target robot cluster to execute the target task includes: If there are idle robots in the target robot cluster, the target robot is determined from the idle robots based on the energy efficiency information of each robot. The target task is assigned to the target robot to perform the target task.
12. A task allocation device, characterized in that, include: The acquisition module is used to acquire tasks to be assigned and determine the scenario information of the tasks to be assigned. The queue determination module is used to determine the corresponding target task queue and target robot cluster based on the scenario information. The priority determination module is used to obtain the priority information of the task to be assigned, and add the task to be assigned to the target task queue based on the priority information; The allocation module is used to sequentially allocate the tasks to be allocated to robots in the target robot cluster based on the target task queue, so as to execute the tasks to be allocated.
13. An electronic device comprising a memory, a processor, and a computer program stored in the memory, characterized in that, The processor executes the computer program to implement the steps of the task allocation method according to any one of claims 1-11.
14. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the task allocation method according to any one of claims 1-11.
15. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the task allocation method according to any one of claims 1-11.