Task processing method based on robot system, robot system and equipment
By introducing a multi-threaded task acquisition executor and an asynchronous multi-threaded executor into the robot system, the problems of task allocation serialization and priority imbalance in ROS2 are solved, realizing multi-threaded concurrent task acquisition and asynchronous execution, reducing scheduling latency and enhancing system stability.
Patent Information
- Application Number
- CN202510864085.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-25
- Publication Date
- 2025-11-07
AI Technical Summary
In the robot operating system ROS2, under the requirements of high concurrency and low latency, the serialization of task allocation, the increase in scheduling latency and the imbalance of priorities lead to low utilization of multi-threaded resources, increased message latency, and low-priority tasks are easily blocked by high-priority tasks.
A multi-threaded executor for task acquisition and an asynchronous multi-threaded executor are introduced. Through thread binding and thread group configuration, the decoupling of multi-threaded concurrent task acquisition and asynchronous execution is achieved, ensuring parallelism and stable priority of task acquisition.
Significantly reduce task scheduling latency, stabilize message scheduling delay, eliminate priority starvation, enhance system robustness, and isolate the risk of business code blocking.
Smart Images

Figure CN120909761A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of robot control, and in particular to a task processing method based on a robot system, a robot system and equipment. BACKGROUND
[0002] In the Robot Operating System (ROS2), MultiThreadedExecutor is used as the default multi-threaded executor, which is responsible for task scheduling and message distribution of nodes. The working principle is as follows: the global mutex (wait_mutex) is used to control task acquisition; get_next_ready_executable is called in the main loop to obtain executable objects; if there is no ready task, wait_for_work is called to enter a waiting state; the mutex is released and the task is executed.
[0003] Under the conditions of high concurrency and low latency, the following problems exist: task allocation serialization: the global mutex causes the task acquisition to be unable to be parallel, and the multi-threaded resource utilization is low; scheduling delay increases linearly: after the node is componentized, the message delay increases significantly with the increase of the task quantity (the measured delay is up to 41,288 μs when the task quantity is 10,000 per second); priority imbalance: low-priority tasks (such as sensor subscription) are easily blocked by high-priority control instructions, and there is a risk of “starvation”.
[0004] When ROS2 runs all nodes in the same process in the form of Component, in order to fully utilize system resources, efficient task scheduling and communication need to be realized through the multi-threaded executor of ROS2. However, the traditional MultiThreadedExecutor has significant performance bottlenecks: scheduling delay: the process communication delay is mainly concentrated in the scheduling link of MultiThreadedExecutor, especially after the node is componentized, the message delay increases linearly with the task quantity. Task acquisition serialization: the executable tasks are serially acquired through wait_mutex in the main loop, which causes the task allocation to be blocked in the multi-threaded environment. get_next_executable cannot be executed concurrently, which greatly increases the scheduling delay of the message; priority “starvation” phenomenon: tasks are acquired according to priority (Timer>Subscription>Waitable), and low-priority tasks may be unable to be executed for a long time. Task execution duration is uncontrollable: the blocking of a single task may affect the overall message distribution efficiency. All nodes are synchronously executed in the thread pool of MultiThreadedExecutor, which causes the nodes to affect each other. SUMMARY
[0005] Therefore, it is necessary to provide a task processing method based on a robot system, a robot system and equipment to realize decoupling of multi-thread concurrent task acquisition and asynchronous execution and reduce task scheduling delay. Especially when the amount of messages in the system increases significantly, the scheduling delay of messages can be greatly reduced compared with the prior art, the scheduling delay of messages is ensured to remain stable, in addition, the priority "starvation" phenomenon is effectively eliminated, the system robustness is enhanced, and the risk of blocking business code by asynchronous execution flow is adopted.
[0006] In a first aspect, a task processing method based on a robot system is provided. The robot system has a task acquisition multi-threaded executor and an asynchronous multi-threaded executor. Each thread in the task acquisition multi-threaded executor is configured to extract executable tasks from a corresponding node. Each thread group in the asynchronous multi-threaded executor is configured to execute executable tasks of a corresponding node submitted by the task acquisition multi-threaded executor. The method comprises:
[0007] Each thread of the task acquisition multi-threaded executor extracts executable tasks of a corresponding node and submits the executable tasks to the asynchronous multi-threaded executor.
[0008] The asynchronous multi-threaded executor assigns the executable tasks to a corresponding thread group according to the node to which the executable tasks belong, so that the thread group executes the executable tasks of the node.
[0009] In some examples, each thread of the task acquisition multi-threaded executor is provided with an independent node set, any node is bound to the node set of any thread, and each thread is configured to acquire executable tasks of the node bound in the node set.
[0010] The asynchronous multi-threaded executor has a plurality of thread groups, any node is configured in any thread group, and the asynchronous multi-threaded executor is configured to submit executable tasks of a node to a corresponding thread group for execution according to the thread group to which the node belongs.
[0011] In some examples, each thread of the task acquisition multi-threaded executor extracts executable tasks of a corresponding node, comprising:
[0012] According to the node set bound by the node, the task acquisition multi-threaded executor extracts executable tasks of the node through a corresponding thread and submits the executable tasks to the asynchronous multi-threaded executor.
[0013] In some examples, the asynchronous multi-threaded executor assigns the executable tasks to a corresponding thread group according to the node to which the executable tasks belong, so that the thread group executes the executable tasks of the node, comprising:
[0014] The asynchronous multi-threaded executor determines the corresponding thread group according to the node to which the executable task belongs.
[0015] The executable task is allocated to the task queue corresponding to the thread group, so that the thread group takes the executable task from the task queue and executes the executable task, wherein different thread groups have independent task queues.
[0016] In a second aspect, a robot system is provided, which introduces a task acquisition multi-threaded executor and an asynchronous multi-threaded executor, wherein each thread in the task acquisition multi-threaded executor is used to extract an executable task from a corresponding node, and each thread group in the asynchronous multi-threaded executor is used to execute the executable task of the corresponding node submitted by the task acquisition multi-threaded executor, wherein
[0017] Each thread of the task acquisition multi-threaded executor extracts an executable task of a corresponding node and submits the executable task to the asynchronous multi-threaded executor.
[0018] The asynchronous multi-threaded executor allocates the executable task to the corresponding thread group according to the node to which the executable task belongs, so that the thread group executes the executable task of the node.
[0019] In some examples, wherein: each thread of the task acquisition multi-threaded executor is provided with an independent node set, any node is bound to the node set of any thread, and each thread is used to acquire the executable task of the node bound in the node set;
[0020] The asynchronous multi-threaded executor is configured with a plurality of thread groups, any node is configured in any thread group, and the asynchronous multi-threaded executor is used to submit the executable task of the node to the corresponding thread group for execution according to the thread group to which the node belongs.
[0021] In some examples, each thread of the task acquisition multi-threaded executor extracts an executable task of a corresponding node, specifically:
[0022] According to the node set bound by the node, the task acquisition multi-threaded executor extracts the executable task of the node through the corresponding thread and submits the executable task to the asynchronous multi-threaded executor.
[0023] In some examples, the asynchronous multi-threaded executor allocates the executable task to the corresponding thread group according to the node to which the executable task belongs, so that the thread group executes the executable task of the node, specifically:
[0024] The asynchronous multi-threaded executor determines the corresponding thread group according to the node to which the executable task belongs.
[0025] allocating the executable task into a task queue corresponding to the thread group so that the thread group takes the executable task from the task queue and executes the executable task, wherein different thread groups have independent task queues.
[0026] In a third aspect, a robot is provided, comprising the robot system according to the second aspect.
[0027] In a fourth aspect, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, when the processor executes the program, the steps of the task processing method based on the robot system according to the first aspect and any possible implementation manner of the first aspect are implemented.
[0028] In a fifth aspect, a computer readable storage medium is provided, which stores a computer program, when the program is executed by a processor, the steps of the task processing method based on the robot system according to the first aspect and any possible implementation manner of the first aspect are implemented.
[0029] In a sixth aspect, a computer program product is provided, which stores a computer program, when the program is executed by a processor, the steps of the task processing method based on the robot system according to the first aspect and any possible implementation manner of the first aspect are implemented.
[0030] By introducing the task acquisition multi-threaded executor and the asynchronous multi-threaded executor, the decoupling of multi-threaded concurrent task acquisition and asynchronous execution is achieved, and the task scheduling delay is greatly reduced. Especially when the amount of messages in the system increases significantly, compared with the prior art, the message scheduling delay can be greatly reduced, and the message scheduling delay is kept stable. In addition, the priority "starvation" phenomenon is effectively eliminated, the system robustness is enhanced, and the risk of blocking business code is isolated by using asynchronous execution flow. BRIEF DESCRIPTION OF DRAWINGS
[0031] Other characteristics, objects and advantages of the present application will become more apparent from the following detailed description of non-restrictive embodiments, made with reference to the attached drawings:
[0032] Figure 1 Flowchart of the task processing method based on the robot system provided by the embodiments of the present application;
[0033] Figure 2 Task scheduling schematic diagram for the task acquisition multi-threaded executor;
[0034] Figure 3 Another task scheduling schematic diagram for the task acquisition multi-threaded executor;
[0035] Figure 4 A schematic diagram of a task scheduling execution strategy combining a task acquisition multithreaded executor and an asynchronous multithreaded executor for a task;
[0036] Figure 5 A structural block diagram of a robot system provided by an embodiment of the present application;
[0037] Figure 6 A structural block diagram of a computer device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0038] The present application will be further described below in conjunction with embodiments and drawings. It can be understood that the specific embodiments described herein are only used to explain the related application, and not to limit the application. In addition, it should be noted that only parts related to the application are shown in the drawings for ease of description.
[0039] It should be noted that the features of the embodiments in the present application, i.e., the features of the embodiments, can be combined with each other without conflict. The present application will be described in detail below with reference to the drawings and in conjunction with the embodiments.
[0040] The task processing method based on a robot system, the robot system and the device according to the embodiments of the present application are described in detail below in conjunction with the drawings.
[0041] Before describing the task processing method based on a robot system, the robot system and the device according to the embodiments of the present application, the robot system is first described, taking ROS2 as an example. The robot system introduces a task acquisition multithreaded executor and an asynchronous multithreaded executor. Each thread in the task acquisition multithreaded executor is used to extract executable tasks from a corresponding node, and each thread group in the asynchronous multithreaded executor is used to execute the executable tasks of the corresponding node submitted by the task acquisition multithreaded executor.
[0042] Among them, the task acquisition multithreaded executor is denoted as ConcurrentExecutor, and the asynchronous multithreaded executor is denoted as AnyExecutable. Each thread of the task acquisition multithreaded executor ConcurrentExecutor is provided with an independent node set, any node is bound to the node set of any thread, and each thread is used to acquire the executable tasks of the node bound in its node set. The asynchronous multithreaded executor AnyExecutable is configured with multiple thread groups, any node is configured in any thread group, and the asynchronous multithreaded executor AnyExecutable is used to submit the executable tasks of the node to the corresponding thread group for execution according to the thread group to which the node belongs.
[0043] That is, a task acquisition multithreaded executor ConcurrentExecutor is designed to acquire executable tasks AnyExecutable of a Node, and an asynchronous multithreaded executor TaskExecutor is designed to execute the executable tasks AnyExecutable of the Node; each thread of the thread group in the ConcurrentExecutor has an independent data set and a Node set, which ensures lock-free concurrency between threads. The Node is uniformly bound to a single thread inside the ConcurrentExecutor, and the Node is uniformly dispersed to all threads, thereby ensuring that the thread group acquires the Node tasks concurrently; the asynchronous multithreaded executor TaskExecutor allocates thread groups according to the configuration, and the TaskExecutor submits the executable tasks of the Node to the thread group for asynchronous execution according to the thread group to which the Node belongs.
[0044] Figure 1 is a flowchart of a task processing method based on a robot system according to an embodiment of the present application. As shown in Figure 1 the task processing method based on a robot system according to an embodiment of the present application includes the following steps:
[0045] S101: Each thread of the task acquisition multithreaded executor extracts executable tasks of a corresponding Node, and submits the executable tasks to the asynchronous multithreaded executor.
[0046] In an embodiment of the present application, each thread of the task acquisition multithreaded executor extracts executable tasks of a corresponding Node, including: according to the Node set to which the Node is bound, the task acquisition multithreaded executor extracts executable tasks of the Node through a corresponding thread, and submits the executable tasks to the asynchronous multithreaded executor.
[0047] S102: The asynchronous multithreaded executor distributes the executable tasks to a corresponding thread group according to the Node to which the executable tasks belong, so that the thread group executes the executable tasks of the Node.
[0048] In an embodiment of the present application, the asynchronous multithreaded executor distributes the executable tasks to a corresponding thread group according to the Node to which the executable tasks belong, so that the thread group executes the executable tasks of the Node, including: the asynchronous multithreaded executor determines the corresponding thread group according to the Node to which the executable tasks belong; the asynchronous multithreaded executor distributes the executable tasks to a task queue corresponding to the thread group, so that the thread group takes the executable tasks from the task queue and executes the executable tasks, wherein different thread groups have independent task queues.
[0049] For example, as shown in Figure 2 The scheduling strategy of the task acquisition multi-threaded executor ConcurrentExecutor when the number of processes Node is less than the number of thread pool threads is shown, for example, Thread1 is responsible for monitoring Node1, Thread2 is responsible for monitoring Node2, Thread3 is responsible for monitoring Node3, Thread4 has no monitorable Node and is in an idle state. The second task W3 of Node3 needs to wait for the first task W3 to be executed; the callback of task T1 has been executed, and Thread1 is executing task S1.
[0050] As shown in Figure 3 The scheduling strategy of the task acquisition multi-threaded executor ConcurrentExecutor when the number of processes Node is greater than the number of thread pool threads is shown, for example: Thread1 is responsible for monitoring Node1, Node5, Thread2 is responsible for monitoring Node2, Node6, Thread3 and Thread4 are responsible for monitoring Node3, Node4 respectively. When task T5 is executed, task S5 has been triggered, and its S priority is greater than W, so Thread1 takes task S5 instead of task W1, and Thread4 is in a waiting task state after executing task T4.
[0051] As shown in Figure 4 The scheduling strategy of the task acquisition multi-threaded executor ConcurrentExecutor combined with the asynchronous multi-threaded executor TaskExecutor is shown, for example: the execution thread groups corresponding to Node1-6 are Thread_group1-6 respectively, the task execution of Thread1 is submitted to the thread group corresponding to Node1 / 2 for execution, the execution order of task S1 and task W1 of Node1 may be reversed, and task T5 in Thread1 is always extracted before task W1.
[0052] The specific workflow is as follows: ConcurrentExecutor is only responsible for extracting the tasks to be extracted and submitting them to TaskExecutor; TaskExecutor puts the tasks into the Task queue of the corresponding business thread group according to the name of the Node scheduling group to which the Task belongs; different business thread groups in TaskExecutor take tasks from their own Task queue to execute tasks.
[0053] Thus, the concurrency of obtaining the Node executable task is improved, the task obtaining and execution are asynchronous, the decoupling of ROS2 and business code execution is realized, the decoupling of callback tasks of different business nodes is realized, since the task execution of the Node has a clear thread group, a basis for monitoring the resource occupation of the Node is provided, and the'starvation' phenomenon caused by the priority of get_next_ready_executable when obtaining the task is avoided.
[0054] According to the task processing method based on the robot system provided in the embodiments of the present application, by introducing the task obtaining multi-threaded executor and the asynchronous multi-threaded executor, the decoupling of multi-threaded concurrent task obtaining and asynchronous execution is realized, and the task scheduling delay is greatly reduced. Especially when the amount of system messages increases greatly, compared with the prior art, the message scheduling delay can be greatly reduced, the message scheduling delay is ensured to be stable, in addition, the priority'starvation' phenomenon is effectively eliminated, the system robustness is enhanced, and the risk of blocking of business code by asynchronous execution flow is adopted.
[0055] Figure 5 is a structural block diagram of a robot system according to an embodiment of the present application. As shown in Figure 5 According to the robot system provided in the embodiments of the present application, it comprises a task obtaining multi-threaded executor 510 and an asynchronous multi-threaded executor 520, wherein:
[0056] Each thread in the task obtaining multi-threaded executor is used to extract executable tasks from the corresponding node, and each thread group in the asynchronous multi-threaded executor is used to execute the executable tasks of the corresponding node submitted by the task obtaining multi-threaded executor, wherein,
[0057] Each thread of the task obtaining multi-threaded executor extracts the executable tasks of the corresponding node and submits the executable tasks to the asynchronous multi-threaded executor.
[0058] The asynchronous multi-threaded executor distributes the executable tasks to the corresponding thread group according to the node to which the executable tasks belong, so that the thread group executes the executable tasks of the node.
[0059] In an embodiment of the present application, each thread of the task obtaining multi-threaded executor is provided with an independent node set, any node is bound to the node set of any thread, and each thread is used to obtain the executable tasks of the node bound in the node set of the thread.
[0060] A plurality of thread groups are configured in the asynchronous multi-threaded executor, any node is configured in any thread group, and the asynchronous multi-threaded executor is used to submit the executable tasks of the node to the corresponding thread group for execution according to the thread group to which the node belongs.
[0061] In an embodiment of the present application, the task acquisition multi-threaded executor extracts executable tasks of the corresponding node for each thread, specifically:
[0062] According to the node set bound by the node, the task acquisition multi-threaded executor extracts executable tasks of the node through the corresponding thread, and submits the executable tasks to the asynchronous multi-threaded executor.
[0063] In an embodiment of the present application, the asynchronous multi-threaded executor distributes the executable tasks to the corresponding thread group according to the node to which the executable tasks belong, so that the thread group executes the executable tasks of the node, specifically:
[0064] The asynchronous multi-threaded executor determines the corresponding thread group according to the node to which the executable tasks belong;
[0065] The executable tasks are distributed to the task queue corresponding to the thread group, so that the thread group takes out the executable tasks from the task queue and executes the executable tasks, wherein different thread groups have independent task queues.
[0066] According to the robot system of the embodiment of the present application, by introducing the task acquisition multi-threaded executor and the asynchronous multi-threaded executor, the decoupling of multi-threaded concurrent task acquisition and asynchronous execution is realized, and the task scheduling delay is greatly reduced. Especially when the amount of messages in the system increases significantly, compared with the prior art, the message scheduling delay can be greatly reduced, and the message scheduling delay can be kept stable. In addition, the priority "starvation" phenomenon is effectively eliminated, the system robustness is enhanced, and the risk of blocking business code by asynchronous execution flow is eliminated.
[0067] The specific limitations of the robot system can be referred to the limitations of the task processing method based on the robot system described above, which will not be repeated here. The above robot system modules can be realized by software, hardware and their combinations. The above modules can be embedded in or independent of the processor in the computer device in hardware form, or stored in the memory of the computer device in software form, so that the processor calls and executes the operations corresponding to the above modules.
[0068] In one embodiment, a robot is provided, comprising: the robot system according to any one of the above embodiments, the robot decouples the multi-thread concurrent task acquisition and the asynchronous execution by introducing the task acquisition multi-thread executor and the asynchronous multi-thread executor, greatly reduces the task scheduling delay. Especially when the amount of messages in the system increases significantly, compared with the prior art, the message scheduling delay can be greatly reduced, the message scheduling delay is ensured to remain stable, in addition, the priority "starvation" phenomenon is effectively eliminated, the system robustness is enhanced, and the asynchronous execution flow is adopted to isolate the business code blocking risk.
[0069] In addition, other configurations and effects of the robot according to the embodiments of the present application are known to those skilled in the art, and will not be described here.
[0070] In one embodiment, a computer device is provided. Figure 6 For the structural block diagram of the computer device provided in the embodiments of the present application, reference is made to Figure 6 . The computer device comprises a memory and a processor, the memory stores a computer program, and the processor executes the computer program to implement the above-mentioned task processing method based on the robot system. For example, each thread of the task acquisition multi-thread executor extracts executable tasks of the corresponding node and submits the executable tasks to the asynchronous multi-thread executor.
[0071] The asynchronous multi-thread executor distributes the executable tasks to the corresponding thread group according to the node to which the executable tasks belong, so that the thread group executes the executable tasks of the node.
[0072] The embodiments of the present application also provide a computer readable storage medium, which stores a computer program, and the processor executes the computer program to implement the above-mentioned task processing method based on the robot system. For example, each thread of the task acquisition multi-thread executor extracts executable tasks of the corresponding node and submits the executable tasks to the asynchronous multi-thread executor.
[0073] The asynchronous multi-thread executor distributes the executable tasks to the corresponding thread group according to the node to which the executable tasks belong, so that the thread group executes the executable tasks of the node.
[0074] The embodiments of the present application provide a computer program product, which comprises instructions, when the instructions are executed, the method as described in the embodiments of the present application is executed. For example, the above-mentioned task processing method based on the robot system can be executed. Figure 1The steps of the task processing method based on the robot system shown are, for example, the following: each thread of the task acquisition multi-threaded executor extracts the executable task of the corresponding node and submits the executable task to the asynchronous multi-threaded executor;
[0075] The asynchronous multithreaded executor assigns the executable task to the corresponding thread group according to the node to which the executable task belongs, so that the thread group can execute the executable task of the node.
[0076] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the methods described above. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, or optical storage, etc. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.
[0077] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0078] The above embodiments merely illustrate several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. A method for task processing based on a robot system, characterized by, The robot system introduces a task acquisition multi-threaded executor and an asynchronous multi-threaded executor, wherein each thread in the task acquisition multi-threaded executor is used to extract executable tasks from a corresponding node, each thread group in the asynchronous multi-threaded executor is used to execute executable tasks of the corresponding node submitted by the task acquisition multi-threaded executor, and the method comprises: Each thread of the task acquisition multi-threaded executor extracts executable tasks of the corresponding node and submits the executable tasks to the asynchronous multi-threaded executor; The asynchronous multi-threaded executor distributes the executable tasks to the corresponding thread group according to the node to which the executable tasks belong, so that the thread group executes the executable tasks of the node.
2. The robot system-based task processing method according to claim 1, characterized by, Wherein: Each thread of the task acquisition multi-threaded executor is provided with an independent node set, any node is bound to the node set of any thread, and each thread is used to acquire executable tasks of the node bound in the node set; The asynchronous multi-threaded executor is configured with a plurality of thread groups, any node is configured in any thread group, and the asynchronous multi-threaded executor is used to submit executable tasks of the node to the corresponding thread group for execution according to the thread group to which the node belongs.
3. The robot system-based task processing method according to claim 2, characterized by, Each thread of the task acquisition multi-threaded executor extracts executable tasks of the corresponding node, comprising: According to the node set bound by the node, the task acquisition multi-threaded executor extracts executable tasks of the node through the corresponding thread and submits the executable tasks to the asynchronous multi-threaded executor.
4. The robot system-based task processing method according to claim 2, wherein, The asynchronous multi-threaded executor distributes the executable tasks to the corresponding thread group according to the node to which the executable tasks belong, so that the thread group executes the executable tasks of the node, comprising: The asynchronous multi-threaded executor determines the corresponding thread group according to the node to which the executable tasks belong; The executable tasks are distributed to the task queue corresponding to the thread group, so that the thread group takes out the executable tasks from the task queue and executes the executable tasks, wherein different thread groups have independent task queues.
5. A robot system, characterized by The robot system introduces a task acquisition multi-threaded executor and an asynchronous multi-threaded executor, wherein each thread in the task acquisition multi-threaded executor is used to extract executable tasks from a corresponding node, each thread group in the asynchronous multi-threaded executor is used to execute executable tasks of the corresponding node submitted by the task acquisition multi-threaded executor, wherein, Each thread of the task acquisition multi-threaded executor extracts executable tasks of the corresponding node and submits the executable tasks to the asynchronous multi-threaded executor; The asynchronous multi-threaded executor distributes the executable tasks to the corresponding thread group according to the node to which the executable tasks belong, so that the thread group executes the executable tasks of the node.
6. The robotic system of claim 5, wherein, Wherein: Each thread of the task acquisition multi-threaded executor is provided with an independent node set, any node is bound to the node set of any thread, and each thread is used to acquire executable tasks of the node bound in the node set; The asynchronous multi-threaded executor is configured with a plurality of thread groups, any node is configured in any thread group, and the asynchronous multi-threaded executor is used to submit executable tasks of the node to the corresponding thread group for execution according to the thread group to which the node belongs. The asynchronous multi-threaded executor is configured with multiple thread groups, any node is configured in any thread group, and the asynchronous multi-threaded executor is used for submitting an executable task of a node to a corresponding thread group for execution according to a thread group to which the node belongs.
7. The robotic system of claim 6, wherein, Each thread of the task acquisition multi-threaded executor extracts an executable task of a corresponding node, specifically as follows: According to the node set to which the node is bound, the task acquisition multi-threaded executor extracts the executable task of the node through a corresponding thread, and submits the executable task to the asynchronous multi-threaded executor.
8. The robotic system of claim 6, wherein, The asynchronous multi-threaded executor distributes the executable task to a corresponding thread group according to a node to which the executable task belongs, so that the thread group executes the executable task of the node, specifically as follows: The asynchronous multi-threaded executor determines a corresponding thread group according to a node to which the executable task belongs; The executable task is distributed to a task queue corresponding to the thread group, so that the thread group takes out the executable task from the task queue and executes the executable task, wherein different thread groups have independent task queues.
9. A robot, characterized in that The robot system comprises: The robot system according to any one of claims 5-8.
10. A computer device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the program, the robot system-based task processing method according to any one of claims 1-4 is implemented.
Citation Information
Cited By
Distributed task scheduling system and method for multi-robot collaborative drawing
CN121217828A