Navigation task control method, mobile device, electronic device and medium
By executing subtasks of navigation tasks in the navigation system in the same process, and using shared memory and zero-copy technology, the problems of large resource consumption and low computing efficiency in the existing navigation task control methods are solved, and efficient navigation task control and process stability are achieved.
Patent Information
- Application Number
- CN202411999366.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-04-22
AI Technical Summary
The existing control methods of navigation tasks have problems such as high resource usage and high resource consumption, which leads to low computing efficiency and poor process stability.
Through multiple modules in the navigation system, multiple subtasks of navigation tasks are performed under the same process, data communication between modules is realized using shared memory, and data is transmitted using zero copy method to reduce resource consumption and improve computing efficiency.
It realizes efficient call to multiple modules in one process, reduces data transmission time through shared memory, reduces resource consumption, improves computing efficiency, and improves process stability of the navigation system.
Smart Images

Figure CN119862052A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of navigation technology, and in particular to a navigation task control method, a mobile device, an electronic device and a medium. Background Art
[0002] With the continuous advancement of science and technology, people's lives and work are gradually developing in the direction of intelligence. For example, in the process of controlling the movement of a mobile device, the trajectory of the mobile device can be planned and the mobile device can be controlled to move along the planned trajectory through the control method of the navigation task. However, the current control method of the navigation task has the problems of high resource occupation and high resource consumption, which leads to low computational efficiency. Summary of the invention
[0003] In view of this, embodiments of the present application provide a navigation task control method, a mobile device, an electronic device, and a medium, which can improve the computing efficiency of the navigation task control process.
[0004] In a first aspect, an embodiment of the present application provides a method for controlling a navigation task, wherein the method for controlling a navigation task executes multiple subtasks of the navigation task under the same process through multiple modules in a navigation system, wherein the multiple modules include a first module and a second module, and the multiple subtasks include a first subtask and a second subtask, wherein the method for controlling the navigation task includes: controlling the first module to execute a first subtask in the navigation task, obtaining execution result data, and storing the execution result data in a shared memory; controlling the second module to obtain execution result data according to the storage address of the execution result data, and executing the second subtask in the navigation task according to the execution result data.
[0005] In a second aspect, an embodiment of the present application provides a control device for a navigation task, which executes multiple subtasks of the navigation task under the same process through multiple modules in a navigation system, the multiple modules include a first module and a second module, and the multiple subtasks include a first subtask and a second subtask, wherein the control device for the navigation task includes: a first control module, used to control the first module to execute the first subtask in the navigation task, obtain execution result data, and store the execution result data in a shared memory; a second control module, used to control the second module to obtain execution result data according to the storage address of the execution result data, and execute the second subtask in the navigation task according to the execution result data.
[0006] In a third aspect, an embodiment of the present application provides a mobile device, including a control module, wherein the control module is used to execute the control method of the navigation task described in the first aspect above.
[0007] In a fourth aspect, an embodiment of the present application provides an electronic device, comprising: a processor; and a memory for storing processor executable instructions, wherein the processor is used to execute the control method of the navigation task described in the first aspect above.
[0008] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the storage medium stores a computer program, and the computer program is used to execute the control method of the navigation task described in the first aspect above.
[0009] In a sixth aspect, an embodiment of the present application provides a computer program product, which includes a computer program. When the computer program is executed by a processor of a computer device, the computer device is enabled to perform the control method of the navigation task described in the first aspect above.
[0010] In a seventh aspect, an embodiment of the present application provides a chip, comprising: a processor; and a memory for storing processor executable instructions, wherein the processor is used to execute the control method of the navigation task described in the first aspect above.
[0011] The embodiment of the present application provides a control method for a navigation task, a mobile device, an electronic device and a medium, wherein multiple modules in a navigation system execute multiple subtasks of a navigation task under the same process, a first module in multiple modules is controlled to execute the first subtask in the navigation task, and execution result data is obtained, and the execution result data is stored in a shared memory, and a second module in multiple modules is controlled to obtain the execution result data according to the storage address of the execution result data, and the second subtask in the navigation task is executed according to the execution result data. In this way, the control method for a navigation task provided by the embodiment of the present application can call multiple modules in a process, and realize data communication between multiple modules in a shared memory manner, so that data transmission can be realized in a zero-copy manner, thereby reducing resource consumption, reducing data transmission time, and improving computing efficiency. Moreover, communication is realized between each module under the same process by a shared memory manner, which can realize the lightweight of the navigation system or the algorithm framework. In addition, since the navigation system is used to execute the navigation task under the same process, the interaction between the navigation system and the hardware device can be reduced, and the influence of the failure or state switching of the hardware device on the data flow in the navigation system can be reduced, thereby improving the stability of the process in the navigation system. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] Figure 1 Shown is a schematic diagram of the system architecture of a navigation system provided by an exemplary embodiment of the present application.
[0013] Figure 2 Shown is a flow chart of a method for controlling a navigation task provided by an exemplary embodiment of the present application.
[0014] Figure 3 Shown is a flow chart of a method for controlling a navigation task provided by another exemplary embodiment of the present application.
[0015] Figure 4 Shown is a schematic structural diagram of a control device for a navigation task provided by an exemplary embodiment of the present application.
[0016] Figure 5 Shown is a block diagram of an electronic device for executing a control method for a navigation task provided by an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0017] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0018] Application Overview
[0019] The existing navigation control algorithm framework is compatible with cross-machine communication, cross-process communication and intra-process communication, and this navigation control algorithm framework can realize more functions. However, since these communications involve different categories of languages, it is necessary to convert the data in this navigation control algorithm framework into a language of a unified category during data transmission. For example, during communication, it is necessary to perform standardized and unified serialization and deserialization operations on the data. Based on this, when defining the interface in this navigation control algorithm framework, it is necessary to define an interface description file (such as an IDL file, a MAG file), which is a standard file for interpreting data flows. As a result, in the existing navigation control algorithm framework, the interface call process is complicated.
[0020] Furthermore, this navigation control algorithm framework may need to interact with hardware devices (such as network cards). The failure or state switching of hardware devices will affect the data flow within the algorithm and have an impact on the stability of a single process.
[0021] In summary, the existing navigation control algorithm framework, or the existing navigation task control method, has the problem of high resource occupation and high resource consumption, and thus has the problem of low computational efficiency. In addition, the existing navigation task control method has the problem of poor process stability.
[0022] In view of the above technical problems, the embodiment of the present application provides a control method for a navigation task, wherein multiple modules in a navigation system execute multiple subtasks of a navigation task under the same process, a first module in the multiple modules is controlled to execute the first subtask in the navigation task, execution result data is obtained, and the execution result data is stored in a shared memory, and a second module in the multiple modules is controlled to obtain the execution result data according to the storage address of the execution result data, and the second subtask in the navigation task is executed according to the execution result data. In this way, the control method for a navigation task provided by the embodiment of the present application can call multiple modules in a process, and realize data communication between multiple modules in a shared memory manner, so that data transmission can be realized in a zero-copy manner, thereby reducing resource consumption, reducing data transmission time, and improving computing efficiency. Moreover, communication is realized between the modules under the same process by a shared memory manner, which can realize the lightweight of the navigation system or the algorithm framework. In addition, since the navigation system is used to execute the navigation task under the same process, the interaction between the navigation system and the hardware device can be reduced, and the influence of the failure or state switching of the hardware device on the data flow in the navigation system can be reduced, thereby improving the stability of the process in the navigation system.
[0023] Exemplary Systems
[0024] Figure 1 FIG. 1 is a schematic diagram of a system architecture of a navigation system provided by an exemplary embodiment of the present application. Figure 1 As shown, the navigation system 100 may include a navigation server 110 and a mobile device 120, and data communication may be performed between the navigation server 110 and the mobile device 120. The navigation server 110 may include multiple modules, and the navigation server 110 in the navigation system 100 may call multiple modules to perform multiple subtasks of the navigation task under the same process. The navigation server 110 may be a cloud server, a server cluster, or other types of servers. The navigation server 110 may be used to perform a control method for a navigation task, for example, it may be used to provide a navigation task for the mobile device 120 to control the mobile device 120 to travel from a starting point to an end point. The mobile device 120 may be a device for performing a driving task, such as a vehicle, a robot, etc.
[0025] The plurality of modules may include a first module and a second module. The navigation server 110 may be used to: control the first module to execute a first subtask in the navigation task, obtain execution result data, and store the execution result data in a shared memory; control the second module to obtain the execution result data according to a storage address of the execution result data, and execute a second subtask in the navigation task according to the execution result data.
[0026] In one example, the first module is a planning service module 111 for planning a path for the mobile device 120, and the second module is a control service module 112 for controlling the mobile device 120 to travel from the starting point to the end point according to the planned path. Specifically, the navigation server 110 can be used to: control the planning service module 111 to perform the path planning subtask in the navigation task, obtain the path planning result data, and store the path planning result data in the shared memory; control the control service module 112 to obtain the path planning result data according to the storage address of the path planning result data, and perform the travel control subtask in the navigation task according to the path planning result data.
[0027] Further, the multiple modules also include: a map module 113 for storing maps, a perception module 114 for obtaining environmental perception information, and a mobile device module 115 for storing structural information of the mobile device 120. Specifically, different modules can be used to perform different subtasks in the navigation task. Each module can obtain corresponding execution result data by executing the corresponding subtask. Multiple modules can execute corresponding subtasks concurrently, and the input data of at least one module can be the execution result data of other modules. For example, the navigation server 110 can control the map module 113 to build or update the map according to the execution result data (such as environmental perception information) of the perception module 114; the navigation server 110 can control the planning service module 111 to plan the path according to the execution result data (such as map) of the map module 113; the navigation server 110 can control the control service module 112 according to at least one of the execution result data (such as path planning result data) of the planning service module 111, the execution result data (such as footprint information of the mobile device) of the mobile device module 115, and the execution result data (such as map) of the map module 113, so as to control the mobile device 120 to travel through the control service module 112.
[0028] Furthermore, the navigation server 110 also includes an algorithm library. When calling a specific module, the navigation server 110 can implement the specific function of the module by calling the specific algorithm in the algorithm library. For example, the algorithm library includes multiple algorithms, and the multiple algorithms may include a first algorithm, a second algorithm, a third algorithm, and a fourth algorithm. Specifically, the first algorithm may be a conventional algorithm (expressed as Common), the second algorithm may be a mathematical algorithm (expressed as Math), the third algorithm may be a geometric algorithm (expressed as Geometry), and the fourth algorithm may be a computer algorithm (expressed as Algorithm).
[0029] Furthermore, the navigation server 110 may also include: a first data acquisition module 116, which may be used to acquire the positioning information and odometer information (or speed information) of the mobile device 120, and a second data acquisition module 117, which may be used to acquire information such as the user's input instructions. For example, the control service module 112 may control the driving process of the mobile device 120 in real time according to the positioning information and the odometer information. The user's input instructions may include the location of the starting point and the location of the end point, and the planning service module 111 may plan the path of the mobile device 120 according to the location of the starting point and the location of the end point. The perception module 114 may acquire environmental perception information near the current location of the mobile device according to the positioning information (such as the current location) acquired by the first data acquisition module 116.
[0030] In one example, the navigation server 110 may be provided with a behavior tree engine 118 (or a behavior tree module), and the navigation task may be executed through a behavior tree. The behavior tree engine may call multiple modules through the behavior tree to execute multiple subtasks of the navigation task in the same process.
[0031] In one example, the navigation server 110 may further include an adaptation module 119 for receiving user requests and driving the behavior tree engine to work according to the user requests.
[0032] In other examples, the navigation server 110 may be integrated into the mobile device 120 , that is, the above-mentioned control method of the navigation task may be executed by the mobile device 120 , that is, the above-mentioned various modules may be deployed on the mobile device 120 .
[0033] It should be understood that the above application scenario examples are only shown to facilitate understanding of the spirit and principle of the present application, and the embodiments of the present application are not limited thereto. On the contrary, the embodiments of the present application can be applied to any scenario that may be applicable.
[0034] Exemplary Methods
[0035] Figure 2 Shown is a flow chart of a method for controlling a navigation task provided by an exemplary embodiment of the present application. Figure 2 The method can be Figure 1 The navigation server 110 or the mobile device 120 in the navigation task is executed. For the convenience of description, the following description is taken as an example of the navigation server 110 executing the method. The control method of the navigation task can execute multiple subtasks of the navigation task under the same process through multiple modules in the navigation system. The multiple modules may include a first module and a second module, and the multiple subtasks include a first subtask and a second subtask. Figure 2 As shown, the control method of the navigation task may include the following contents.
[0036] 210: Control the first module to execute the first subtask in the navigation task, obtain execution result data, and store the execution result data in the shared memory.
[0037] Specifically, multiple modules may be used to execute different subtasks under the same process in the same process.
[0038] In one example, the process may correspond to a navigation task, that is, a navigation task corresponds to a process. A process may include multiple threads, and multiple threads may correspond to multiple subtasks in a navigation task, that is, a thread may correspond to a subtask or multiple subtasks in a navigation task. The control method provided in an embodiment of the present application may be applicable to a navigation task scenario of a single process. In one example, a process may be the basic unit for allocating resources in a navigation system. A single process may have an independent address space and resources (such as CPU time, memory, etc.). A thread may be an execution unit in a process, such as the basic unit of CPU scheduling and dispatching. Threads may share the resources of a process (such as memory, files, etc.), but have their own execution path.
[0039] In the same process, the memory space can be shared, all objects and data are visible, and the corresponding objects or data can be found through the storage address. For example, different modules can obtain different execution result data after executing corresponding subtasks, and each module can store the corresponding execution result data in the shared memory. The shared memory can be the storage space in the navigation server, or the storage space outside the navigation server and can communicate with the navigation server. Multiple modules can share the data in the shared memory.
[0040] 220: Control the second module to obtain the execution result data according to the storage address of the execution result data, and execute the second subtask in the navigation task according to the execution result data.
[0041] Specifically, the execution result data of each module can be stored in the shared memory. In one example, the specific location of the execution result data of each module in the shared memory can be represented by a storage address.
[0042] The first module is used to execute the first subtask in the navigation task, and the second module is used to execute the second subtask in the navigation task. The first subtask and the second subtask can be executed concurrently. In one example, the execution of the second subtask can depend on the execution result of the first subtask, that is, the second module needs to execute the second subtask in the navigation task according to the execution result data output by the first module.
[0043] The second module may obtain the execution result data output by the first module through the storage address corresponding to the execution result data output by the first module, and execute the second subtask based on the execution result data output by the first module.
[0044] In one example, the storage address corresponding to the execution result data output by the first module can be directly transmitted to the second module through the first module. For example, the first module can be controlled to directly transmit the storage address corresponding to the execution result data output by the first module to the second module by means of a function call. Specifically, a trigger condition for the storage address transmission can be pre-set, and when the trigger condition is met, the storage address can be transmitted to the second module. In one example, the trigger condition can be that the first module outputs the execution result data, that is, when the first module outputs the execution result data, the trigger condition is met, and at this time, the first module can be controlled to transmit the storage address corresponding to the execution result data output by the first module to the second module by means of a function call.
[0045] Optionally, the storage address corresponding to the execution result data output by the first module can be transmitted to the second module through the intermediate module. For example, the intermediate module can be controlled to call the storage address corresponding to the execution result data output by the first module and transmit it to the second module by means of a function call. Specifically, the trigger condition for the storage address transmission can be pre-set, and when the trigger condition is met, the storage address can be transmitted to the second module. In one example, the trigger condition can be that the first module outputs the execution result data, that is, when the first module outputs the execution result data, the trigger condition is met, and at this time, the intermediate module can be controlled to call the storage address corresponding to the execution result data output by the first module and transmit it to the second module by means of a function call. In one example, the intermediate module can be a behavior tree engine or a node of a behavior tree, or other modules that can realize the transmission of the storage address to the second module.
[0046] The embodiment of the present application provides a control method for a navigation task, wherein multiple modules in a navigation system execute multiple subtasks of a navigation task under the same process, a first module in the multiple modules is controlled to execute the first subtask in the navigation task, execution result data is obtained, and the execution result data is stored in a shared memory, a second module in the multiple modules is controlled to obtain the execution result data according to the storage address of the execution result data, and the second subtask in the navigation task is executed according to the execution result data. In this way, the control method for a navigation task provided by the embodiment of the present application can call multiple modules in a process, and realize data communication between multiple modules in a shared memory manner, so that data transmission can be realized in a zero-copy manner, thereby reducing resource consumption, reducing data transmission time, and improving computing efficiency. Moreover, communication is realized between each module under the same process by a shared memory manner, which can realize the lightweight of the navigation system or the algorithm framework. In addition, since the navigation system is used to execute the navigation task under the same process, the interaction between the navigation system and the hardware device can be reduced, and the influence of the failure or state switching of the hardware device on the data flow in the navigation system can be reduced, thereby improving the stability of the process in the navigation system.
[0047] In one example, since multiple modules communicate within one process, there is no need to define a file to describe the interface between modules. All data in the navigation system can use the same type of language, or in other words, each module shares the same type of language, that is, it is sufficient to define a method or class within the process. Therefore, there is no need to additionally interpret the data (which can be a storage address) during data transmission. The interface design is simple, saving additional development operations. For example, data can be shared directly by passing parameters through member methods. The parameters are in memory and shared throughout the process, so serialization and deserialization are not required. In one example, the storage address will not be modified during the transmission process.
[0048] According to an embodiment of the present application, the navigation task is executed through a behavior tree, a behavior tree engine is provided in the navigation system, a first module corresponds to a first node in the behavior tree, a second module corresponds to a second node in the behavior tree, and the behavior tree engine calls multiple modules through the behavior tree to execute multiple subtasks of the navigation task under the same process. The above step 210 may include: controlling the first module to execute the first subtask in the navigation task through the behavior tree, and obtaining execution result data.
[0049] Specifically, each module can be controlled to perform a corresponding subtask through a specific algorithm, code, behavior tree or other means. In one example, each module can be controlled to perform a subtask in a navigation task through a behavior tree to obtain corresponding execution result data. For example, the implementation of the entire navigation task can be supported by a behavior tree.
[0050] In one example, each of the multiple modules may correspond to a node, such as a leaf node in a behavior tree. Each node in the behavior tree may call one or more modules in the multiple modules. The behavior tree itself can be regarded as a node module located on the upper layer of multiple modules, that is, a behavior tree module (also known as a behavior tree engine), which is used to implement upper-layer scheduling. The multiple modules in the navigation system may have basic algorithm capabilities. Through the scheduling of the behavior tree, the multiple modules may be controlled to perform path planning subtasks while performing mobile device travel control subtasks. Specifically, the first module among the multiple modules may be controlled to perform the path planning subtask, and the second module among the multiple modules may be controlled to perform the travel control subtask.
[0051] In one example, each node (such as a leaf node) of a behavior tree can be regarded as an action, and a node connecting multiple leaf nodes can be called a control node. A behavior tree can also have subtrees. A behavior tree can be run, and actions or tasks can be executed in sequence. For example, when executing a navigation task, you can first obtain the current position (corresponding to action1), then plan a path from the current position to the target position (corresponding to action2), and finally control the mobile device to travel along the path according to the path (corresponding to action3). Here, the current position can be the position of the starting point, and the target position can be the position of the end point. Here, action2 can involve calling the first module, and action3 can involve calling the second module. Furthermore, during the driving process of the mobile device, path replanning operations may also be performed, and the path replanning operations can also be controlled by nodes in the behavior tree.
[0052] In one example, the interaction between the behavior tree engine and multiple modules can also be achieved through data sharing, without the need to describe the interface through a definition file.
[0053] In this embodiment, each module is controlled to execute corresponding subtasks through the behavior tree, and each subtask can be arranged in a certain order. In this way, at least some modules can be triggered to execute corresponding subtasks in sequence or at the same time according to actual needs, so as to achieve efficient control of each subtask. Furthermore, when the subtasks executed by some modules change, or some subtasks in the navigation task need to be deleted, or subtasks in the navigation task need to be added, the corresponding effect can be achieved by modifying the parameters corresponding to the nodes in the behavior tree, so as to improve the modification efficiency of the control algorithm corresponding to the entire navigation task.
[0054] According to an embodiment of the present application, the control method of the navigation task further includes: adjusting the thread corresponding to the first module by rewriting the target field of the first node in the configuration file. The configuration file is a tree structure, and the tree structure of the configuration file can correspond to the master-slave relationship between multiple modules.
[0055] Specifically, the target field may be a field in the configuration file for adjusting the thread of the module, for example, may be a runner field.
[0056] In one example, a single process may include multiple threads, a module may correspond to a separate thread, or multiple modules may share a thread. The thread corresponding to each module may be configured separately through a configuration file.
[0057] In one example, there may be a master-slave relationship (or subordinate relationship) between multiple modules under the navigation system, and the master-slave relationship may be maintained through a tree structure.
[0058] In one example, the configuration file can be a tree structure, which can represent the spatial logical relationship between various modules. For example, the tree structure of the configuration file is completely mapped to the organizational relationship between the modules. The tree structure of the behavior tree can represent the temporal relationship of each node, that is, the order in which each module executes the corresponding subtask. The tree structure of the configuration file can correspond to the master-slave relationship between multiple modules. Of course, the tree structure of the configuration file may not correspond to the master-slave relationship between multiple modules. The nodes in the behavior tree may correspond to the modules one by one, or the nodes in the behavior tree may not correspond to the modules one by one.
[0059] In one example, the configuration file can be used to allocate threads to modules, such as allocating CPU resources, so as to drive the corresponding module to execute the corresponding subtask on the thread. In other words, the configuration file can be used to allocate computing resources to modules, so as to drive the module to execute the subtask based on the computing resources. For example, a common CPU resource can be allocated to multiple modules through the configuration file. Alternatively, a separate CPU resource can be allocated to a module so that the corresponding module can execute the corresponding subtask according to the corresponding CPU resource, thereby improving the execution efficiency of the subtask and reducing the interference of other subtasks on the execution process of the subtask.
[0060] In one example, by rewriting the target field of the first node in the configuration file, the thread corresponding to the first module can be adjusted, so that the first subtask corresponding to the first module can be submitted to the adjusted thread for execution. For example, by modifying the target field of the first node in the configuration file, the computing resources corresponding to the first subtask can be increased or decreased.
[0061] According to an embodiment of the present application, the control method of the navigation task further includes: allocating a thread corresponding to the parent node of the first node in the configuration file to the first module by deleting the target field of the first node in the configuration file.
[0062] In one example, each layer in the tree structure of the configuration file can specify a runner field. If the runner field is specified, an executor (i.e., execution unit, or thread) will be assigned to the node corresponding to this layer. If the runner field is not specified, the executor corresponding to the parent node of the entire node will be used.
[0063] For example, the next layer of the parent node of the first node in the configuration file may include multiple nodes, including the first node and other nodes. After deleting the target field of the first node in the configuration file, the first module corresponding to the first node may share the thread corresponding to the parent node.
[0064] In one example, the configuration file may be a file written in the YAML language or a file written in other languages.
[0065] In this embodiment, the threads corresponding to each subtask can be adjusted by adjusting the target field in the configuration file, so that the threads can be flexibly configured according to the requirements, thereby improving the efficiency of thread development. For example, a single thread can be opened by only modifying the configuration file and restarting the navigation system, that is, corresponding computing resources are allocated to the module corresponding to the thread. In one example, thread development can be implemented in a datadrive manner according to the data in the configuration file.
[0066] According to an embodiment of the present application, the control method of the navigation task also includes: in response to receiving a first scheduling instruction, the behavior tree engine instructs the asynchronous action nodes in the behavior tree that match the first scheduling instruction to perform a first scheduling operation corresponding to the first scheduling instruction during the execution of an asynchronous subtask among multiple subtasks; monitors the execution status of the asynchronous action nodes; and in response to receiving a second scheduling instruction, when the execution status of all asynchronous action nodes that execute the first scheduling operation is in a successful state, instructs the asynchronous action nodes in the behavior tree that match the second scheduling instruction to perform a second scheduling operation corresponding to the second scheduling instruction.
[0067] In an example, the basic structure of a behavior tree includes nodes and connections. Nodes are the basic units of a behavior tree and are responsible for executing specific behaviors or decisions. According to different functions, nodes can be divided into the following categories: control nodes, action nodes, and conditional nodes. Control nodes are used to control the execution order and logic of child nodes, such as selectors and sequencers. Selector nodes execute child nodes in sequence until a node succeeds; while sequencer nodes execute child nodes in sequence until a node fails. Action nodes are used to perform specific navigation actions, such as moving to a specified location, stopping movement, etc. Condition nodes are used to return Boolean values based on the current state or condition to control the execution of the process. Connections are used to connect nodes to form a tree structure. Common connection types include sequence connection and selector connection. Sequence connection means that child nodes are executed in sequence until a node fails; while selector connection means that child nodes are executed in sequence until a node succeeds.
[0068] In one example, in robot navigation, asynchronous subtasks refer to tasks that do not need to be completed immediately or can be executed in the background without blocking the main program flow. These tasks usually involve long-running operations or calculations or processing that need to be performed while the main program continues to execute other tasks. Asynchronous subtasks allow the robot to continue other processing work while waiting for these tasks to complete, thereby improving overall efficiency and responsiveness. For example, asynchronous subtasks can be path planning subtasks, map building subtasks, etc. Asynchronous action nodes refer to action nodes in behavior trees that execute asynchronous subtasks.
[0069] In an embodiment of the present application, when the behavior tree engine receives a first scheduling instruction during the execution of an asynchronous subtask, based on the first scheduling instruction, it instructs the asynchronous action node in the behavior tree that matches the first scheduling instruction to execute a first scheduling operation corresponding to the first scheduling instruction.
[0070] Optionally, the first scheduling instruction may be a pause instruction, which is used to instruct the behavior tree engine to pause the execution of the current asynchronous subtask; or may be a cancel instruction, which is used to instruct the behavior tree engine to cancel the execution of the current asynchronous subtask.
[0071] When the first scheduling instruction is a pause instruction, the asynchronous action node matching the pause instruction executes a pause operation; when the first scheduling instruction is a cancel instruction, the asynchronous action node matching the cancel instruction executes a cancel operation.
[0072] In addition to the pause instruction and the cancel instruction, the first scheduling instruction may also include other types of instructions, such as a switching instruction, an update instruction, a re-planning instruction, an emergency instruction, and the like.
[0073] In the embodiment of the present application, after the behavior tree engine instructs the asynchronous action nodes matching the first scheduling instruction to execute the first scheduling operation, it enters the monitoring stage of the execution status of these asynchronous action nodes. In this stage, the behavior tree engine periodically queries the execution status of these asynchronous action nodes through a preset time period. This periodic checking mechanism enables the behavior tree engine to accurately grasp the progress of each asynchronous action node.
[0074] In this embodiment, by receiving the first scheduling instruction, the corresponding asynchronous action node in the behavior tree is triggered to perform the first scheduling operation, and after all relevant asynchronous action nodes complete the current operation, based on the received second scheduling instruction, the asynchronous action node matching the second scheduling instruction is instructed to perform the second scheduling operation. This mechanism ensures that all asynchronous action nodes have completed their current tasks before executing new tasks, effectively reducing the risk of system instability caused by task conflicts, and significantly improving the success rate of robot task execution and the stability of the overall system.
[0075] As an implementable method, the behavior tree engine can monitor the execution status of the asynchronous action node in the form of a node list. Specifically, when the behavior tree engine receives the first scheduling instruction, it traverses the behavior tree, identifies the asynchronous action node that matches the first scheduling instruction, and records the identifier of the matched asynchronous action node into the node list.
[0076] It should be noted that the above node list can be created after the behavior tree engine executes the asynchronous subtask, or after receiving the first scheduling instruction. This application does not limit its creation time.
[0077] Through the identifiers of the asynchronous action nodes recorded in the node list, the behavior tree engine can periodically query the execution status of each asynchronous action node. This process involves periodically calling the first interface corresponding to each identifier to obtain the execution status of the corresponding asynchronous action node, wherein the first interface is pre-configured for each asynchronous action node and is used to query the execution status of the corresponding asynchronous action node.
[0078] The execution status of an asynchronous action node usually includes: running status (running), success status (success) and failure status (failure).
[0079] The running state indicates that the asynchronous action node is executing a task; the successful state indicates that the asynchronous action node successfully completes a task; and the failed state indicates that the asynchronous action node encounters an error or exception when executing a task and fails to complete the task.
[0080] In the embodiment of the present application, when the behavior tree engine executes an asynchronous subtask, the asynchronous subtask will be decomposed into multiple subtasks, and each subtask will be executed by a different asynchronous action node. When the behavior tree engine instructs these asynchronous action nodes to execute the corresponding first scheduling operation based on the first scheduling instruction, these asynchronous action nodes need a certain amount of time to complete the first scheduling operation. During the process of the asynchronous action nodes executing the first scheduling operation, the behavior tree engine will monitor the execution status of these asynchronous action nodes until they return to a success state or a failure state.
[0081] It should be noted that if the behavior tree engine detects that the execution status of an asynchronous action node is in a failed state, it can respond according to the pre-configuration of the behavior tree. For example, the behavior tree engine executes a pre-defined error recovery process, or directly stops running the behavior tree, etc.
[0082] The node list in the embodiment of the present application can be set in the cache of the robot navigation system, so that the behavior tree engine can quickly access and update the execution status of the asynchronous action node, thereby accelerating the decision-making process of the behavior tree engine.
[0083] Furthermore, the behavior tree engine may also delete the identifier of the asynchronous action node whose execution status is a success status from the node list.
[0084] The embodiment of the present application can reduce the size of the node list by removing the identifiers of nodes that have been successfully executed, thereby reducing the memory resource usage of the robot navigation system; and as the number of entries in the node list decreases, the time required for the behavior tree engine to query the execution status of the asynchronous action node will also be reduced, thereby improving the overall operating efficiency.
[0085] In the embodiment of the present application, the behavior tree engine needs to ensure that the previous tasks have been successfully completed before executing the subsequent operations. Specifically, when receiving the second scheduling instruction, the behavior tree engine will not immediately instruct the asynchronous action node that matches the second scheduling instruction to perform the corresponding operation, but will continue to monitor all asynchronous action nodes that execute the first scheduling operation until they all return a success status. Only when the execution status of all asynchronous action nodes that execute the first scheduling operation is a success status, will the asynchronous action node that matches the second scheduling instruction in the behavior tree be instructed to execute the second scheduling operation corresponding to the second scheduling instruction.
[0086] This strategy not only improves the reliability of task execution, but also enhances the responsiveness and flexibility of the system. By ensuring that each step starts after the previous step has been successfully completed, the behavior tree engine is able to maintain a clear and orderly task execution process, which is essential for complex and dynamic robot navigation tasks. In this way, the robot can seamlessly transition to the next task after the successful completion of one task, thereby achieving efficient and smooth operation.
[0087] Furthermore, before the execution status of all asynchronous action nodes that execute the first scheduling operation is in a successful state, if a second scheduling instruction is received, the second scheduling quality is stored in the cache, and after the execution status of all asynchronous action nodes that execute the first scheduling operation is in a successful state, the second scheduling instruction is obtained from the cache to instruct the asynchronous action nodes in the behavior tree that match the second scheduling instruction to execute the second scheduling operation corresponding to the second scheduling instruction.
[0088] The following takes the case where the first scheduling instruction is a pause instruction and the second scheduling instruction is a resume instruction as an example to illustrate the implementation process of the above-mentioned scheduling processing method based on the behavior tree.
[0089] For example, the scheduling processing method based on the behavior tree may include two asynchronous action nodes, and the two asynchronous action nodes include asynchronous action node 1 and asynchronous action node 2. In actual applications, the number of asynchronous action nodes is set according to actual needs. When the behavior tree engine receives an asynchronous subtask initiated by a caller, the behavior tree engine starts the behavior tree to execute the asynchronous subtask. The asynchronous subtask is divided into subtask 1 and subtask 2, which are executed by asynchronous action node 1 and asynchronous action node 2 respectively. The caller here can be a user or a logical entity located at the upper layer of the behavior tree in the robot navigation system.
[0090] During the process of the behavior tree engine executing the asynchronous subtask, if the behavior tree engine receives the pause instruction sent by the caller, the behavior tree engine first matches the asynchronous action node 1 and the asynchronous action node 2 according to the pause instruction, then caches the identifiers of the asynchronous action node 1 and the asynchronous action node 2 in the node list, then notifies the asynchronous action node 1 to suspend the execution of subtask 1, notifies the asynchronous action node 2 to suspend the execution of subtask 2, and then periodically calls the first interface of the asynchronous action node 1 and the asynchronous action node 2 from the node list based on the identifiers of the asynchronous action node 1 and the asynchronous action node 2 to query the execution status of the asynchronous action node 1 and the asynchronous action node 2. When the execution status of the asynchronous action node 1 is successfully completed, the identifier of the asynchronous action node 1 can be deleted from the node list, and only the execution status of the asynchronous action node 2 needs to be queried periodically in the future. When the record in the node list is empty, it means that the asynchronous action node 1 and the asynchronous action node 2 have successfully suspended the execution of the corresponding task. At this time, according to the received resume instruction, the asynchronous action node 1 and the asynchronous action node 2 are instructed to resume the execution of subtask 1 and subtask 2 respectively.
[0091] Based on the same concept, the embodiment of the present application also provides a scheduling processing method based on a behavior tree, which can be applied in a robot navigation system, wherein the robot navigation system has a built-in behavior tree engine and a behavior tree corresponding to at least one asynchronous subtask, and the robot navigation system can be set in any computer device with data storage and processing capabilities, can be set on the server side, or can be set in a computer terminal with strong data processing capabilities. The execution subject of the method can be a control node in a behavior tree engine, and includes the following steps: the control node in the behavior tree monitors the execution status of the asynchronous action node under the control node in response to receiving an abnormal message during the process of the behavior tree engine executing the asynchronous subtask, wherein the abnormal message is used to indicate that the asynchronous action node under the control node has a fault; in response to all asynchronous action nodes under the control node terminating execution, an error message is sent to the behavior tree engine, so that the behavior tree engine executes an error recovery process according to the received error message, or stops running the behavior tree.
[0092] When a control node in a behavior tree receives an exception message, it means that one or more asynchronous action nodes under the control node encountered a failure or error when executing asynchronous subtasks.
[0093] In the prior art, when a control node receives an exception message, it will immediately feedback an error message to the behavior tree engine based on the exception message. However, for the asynchronous action nodes under the control node, since they execute asynchronous subtasks, it takes a certain amount of time to terminate the execution. If the control node feedbacks an error message to the behavior tree engine, the execution status of the asynchronous action node under the control node is still in the running state. After receiving the error message, the behavior tree engine will execute the subsequent error recovery process or stop running the behavior tree. At this time, task conflict will occur, thereby increasing the risk of system instability.
[0094] Therefore, the embodiment of the present application introduces a monitoring mechanism, which monitors the execution status of the asynchronous action nodes under the control node when the control node receives an abnormal message. The introduction of this mechanism avoids rushing to feed back error messages to the behavior tree engine when the asynchronous action node has not yet completely terminated, thereby reducing the risk of task conflicts and system instability.
[0095] When all asynchronous action nodes under the control node are monitored to terminate execution, an error message is sent to the behavior tree engine, so that the behavior tree engine executes the error recovery process according to the received error message, or stops running the behavior tree.
[0096] As an implementable method, when the behavior tree engine executes an asynchronous subtask, the control node can identify all asynchronous action nodes under the control node by traversing all nodes under the control node, and record the identifiers of the identified asynchronous action nodes into the node list.
[0097] Through the identifiers of the asynchronous action nodes recorded in the node list, the control node can periodically query the execution status of each asynchronous action node. This process involves periodically calling the first interface corresponding to each identifier to obtain the execution status of the corresponding asynchronous action node, wherein the first interface is pre-configured for each asynchronous action node and is used to query the execution status of the corresponding asynchronous action node.
[0098] The node list in the embodiment of the present application can be set in the cache of the robot navigation system, so that the behavior tree engine can quickly access and update the execution status of the asynchronous action node, thereby accelerating the decision-making process of the behavior tree engine.
[0099] In addition, the control node involved in the embodiments of the present application may be, but is not limited to, a decorator node, and the decorator node is used to modify and enhance the behavior of its child nodes.
[0100] In the embodiment of the present application, after receiving the abnormal message, the control node will not immediately send an error message to the behavior tree engine, but will feedback the error message to the behavior tree engine after confirming that all related asynchronous action nodes have terminated execution, triggering the necessary error recovery process or deciding whether to stop the further operation of the behavior tree. This mechanism not only improves the responsiveness of the behavior tree to abnormal situations, but also enhances the stability and reliability of the entire robot navigation system when facing asynchronous action node failures. This sophisticated error handling and monitoring mechanism enables the behavior tree engine to perform subsequent error recovery or stop operations after ensuring that all tasks are safely terminated, thereby protecting the integrity of the system and the safe operation of the robot.
[0101] The following takes the control node as a decorator node as an example to illustrate the implementation process of the above behavior tree-based scheduling processing method.
[0102] For example, a scheduling processing method based on a behavior tree may include an asynchronous action node to represent all asynchronous action nodes under a control node. In actual applications, the number of asynchronous action nodes under a control node is set according to actual needs. When the behavior tree engine receives an asynchronous subtask initiated by a caller, the behavior tree engine starts the behavior tree to execute the asynchronous subtask. The caller here can be a user or a logical entity located at the upper layer of the behavior tree in the robot navigation system. During the process of the behavior tree engine executing the asynchronous subtask, the control node caches the identifiers of all asynchronous action nodes under it into a node list. When an exception message is received, the control node queries from the node list whether all asynchronous action nodes under it have terminated execution. When all asynchronous action nodes under it have terminated execution, an error message is returned to the behavior tree engine, and the behavior tree engine then executes the error recovery process or stops running the behavior tree.
[0103] In one example, the first scheduling instruction may be a cancel instruction, which may instruct the mobile device to stop driving. After the behavior tree engine instructs the asynchronous action nodes that match the first scheduling instruction to perform the first scheduling operation, it enters the monitoring stage of the execution status of these asynchronous action nodes. In this stage, the behavior tree engine periodically queries the execution status of these asynchronous action nodes through a preset time period. When all these asynchronous action nodes return a success status, it means that the execution status of these asynchronous action nodes is a success status, or that these asynchronous action nodes have stopped running, that is, the mobile device has stopped driving. At this time, the asynchronous action nodes that match the second scheduling instruction in the behavior tree may be instructed to perform the second scheduling operation corresponding to the second scheduling instruction.
[0104] Specifically, if a mobile device encounters an accident during driving, it needs to stop driving. However, the process of stopping the mobile device needs to go through a deceleration process, so the mobile device needs a certain amount of time to stop driving. After receiving the first scheduling instruction, the behavior tree engine can send the first scheduling instruction to the asynchronous action node related to the first scheduling instruction in the behavior tree, and continuously monitor or periodically monitor whether the asynchronous action node stops running through the first interface (such as the asynchronous pause interface). If all asynchronous action nodes related to the first scheduling instruction stop running, it means that the execution status of these asynchronous action nodes are all successful, and the successful status can be returned to the caller of the behavior tree engine through the asynchronous pause interface. At this time, the behavior tree engine can start subsequent tasks.
[0105] In one example, an asynchronous pause interface may be provided between a leaf node and a behavior tree engine. The asynchronous pause interface may be a functional module for periodically monitoring whether the action of the corresponding leaf node is stopped.
[0106] In one example, a corresponding asynchronous pause interface can be set for each leaf node in the behavior tree, so that the corresponding asynchronous pause interface can be started as needed to monitor whether the action of the corresponding leaf node is stopped.
[0107] In one example, the module can be encapsulated into several actions through the behavior tree interface, and these actions are strung together through some rules in the behavior tree configuration file. These rules are parsed by the behavior tree engine, and the corresponding actions can be called according to the rules.
[0108] In one example, the caller of the first scheduling instruction is generally a user, or an upper-level control logic entity in the behavior tree, such as an adaptation module. When the upper layer in the behavior tree needs to stop the mobile device, the first scheduling instruction (controlling the mobile device to stop driving) is triggered.
[0109] In this embodiment, the corresponding state of the node in the behavior tree is monitored through the asynchronous pause interface, and whether the action of the node is stopped can be monitored. After the action of the node is really stopped, the first scheduling instruction (controlling the mobile device to stop driving) can be sent to the behavior tree engine. In this way, the behavior tree engine can avoid sending a start driving instruction to the node in the behavior tree when the action of the node is not completely stopped, thereby reducing the probability of failure in the control process and improving the safety of the control process.
[0110] According to an embodiment of the present application, the first module is a planning service module for planning a path for a mobile device, the second module is a control service module for controlling the mobile device to travel from a starting point to an end point according to the planned path, the first subtask includes a path planning subtask, the execution result data includes path planning result data, and the second subtask includes a travel control subtask. The above step 210 may include: controlling the planning service module to execute the path planning subtask in the navigation task to obtain the path planning result data. The above step 220 may include: controlling the control service module to obtain the path planning result data according to the storage address of the path planning result data, and executing the travel control subtask in the navigation task according to the path planning result data.
[0111] In one example, the navigation task may include a path planning subtask and a travel control subtask. The planning service module may be used to plan a path from the starting point to the end point to obtain path planning result data. The path planning result data may include the path from the starting point to the end point; or the path planning result data may include the path from the starting point to the end point and time information, that is, the trajectory from the starting point to the end point.
[0112] In one example, the control service module may obtain the path planning result data according to the storage address of the path planning result data, and control the mobile device to travel from the starting point to the end point according to the path planning result data.
[0113] In this embodiment, the path planning result data obtained by the planning service module can be stored in a shared memory. The control service module can obtain the path planning result data through the storage address of the path planning result data, and control the mobile device from the starting point to the end point according to the path planning result data. In this way, in the process of implementing the navigation task, the efficiency of data transmission between modules can be improved, and the sensitivity of the real-time control process of the navigation task can be improved.
[0114] According to one embodiment of the present application, the multiple modules also include a map module, wherein the control method of the navigation task also includes: obtaining a polygon outline based on contour information of the target object collected by the sensor; obtaining a second coordinate matrix based on a coordinate transformation matrix and a first coordinate matrix corresponding to the polygon outline, wherein the first coordinate matrix includes the coordinates of each vertex of the polygon outline in the sensor coordinate system corresponding to the sensor, and the second coordinate matrix includes the coordinates of each vertex of the polygon outline in the map coordinate system corresponding to the map in the map module.
[0115] In one example, at least one of a path planning subtask and a travel control subtask in an executable navigation task is performed based on a map.
[0116] In one example, the sensor can be used to collect environmental information around the mobile device, and the environmental information can include contour information of the target object, etc. For example, the target object can be an obstacle, and the image collected by the sensor can identify the target object, thereby obtaining the contour information of the target object, or the contour information of the target object can be directly collected by the sensor. In one example, the sensor can be at least one of a laser radar sensor, an ultrasonic sensor, a visual sensor, etc. In one example, the map module can be used to store a map and update the map according to the target objects around the mobile device.
[0117] According to the contour information of the target object collected by the sensor, a polygonal contour can be obtained. In one example, the contour information can be processed by the sensor to obtain the polygonal contour, or the contour information can be processed by other image processing modules to obtain the polygonal contour, such as the image processing module can approximate the contour information to obtain the polygonal contour.
[0118] The polygonal outline may include multiple vertices, and a first coordinate matrix may be obtained based on the coordinates of the multiple vertices in the sensor coordinate system corresponding to the sensor. For example, the number of the multiple vertices is N, and the first coordinate matrix may be a 2xN matrix or an Nx2 matrix.
[0119] In one example, the coordinate transformation matrix can be used to transform the coordinates of a point in one coordinate system to another coordinate system. For example, the second coordinate matrix can be obtained according to the coordinate transformation matrix and the first coordinate matrix, that is, the coordinates of each vertex on the polygon outline in the map coordinate system corresponding to the map are obtained. Specifically, the first coordinate matrix can be left-multiplied or right-multiplied by the coordinate transformation matrix to obtain the second coordinate matrix.
[0120] In one example, the polygon outline may be Eigen data, and the optimization method within Eigen may be used to accelerate the matrix transformation process (the transformation process of vertex coordinates). Of course, in other examples, the polygon outline may also be other types of data, which is not limited in the present application.
[0121] In other examples, each vertex on the polygon outline may be transformed separately to obtain the coordinates of each vertex in the map coordinate system.
[0122] In this embodiment, the coordinates of each vertex on the polygonal contour are uniformly placed in a matrix to obtain a first coordinate matrix, and the first coordinate matrix can be transformed by matrix multiplication to obtain a second coordinate matrix. In this way, the process of coordinate transformation for each vertex can be transformed into a process of transforming the coordinate matrix once, so that the calculation process of single instruction multiple data (SIMD) can be realized, thereby improving the efficiency of coordinate transformation. Furthermore, Eigen can be supported by a mature library to do matrix multiplication, such as four multiplications can be calculated at one time, thereby further improving the efficiency of coordinate transformation.
[0123] According to an embodiment of the present application, the multiple modules further include a map module for storing maps, a perception module for acquiring environmental perception information, and a mobile device module for storing structural information of a mobile device.
[0124] In one example, the mobile device module may be used to obtain and store at least one of the following information: footprint information of the mobile device, and a three-dimensional model of the mobile device.
[0125] In one example, the perception module may be used to obtain environmental perception information, and the environmental perception information may include at least one of information such as a polygonal outline of the target object and a three-dimensional bounding box of the target object.
[0126] In one example, the map module can be used to store the map and update the map according to the target object around the mobile device. Further, the map module can update the map according to the environmental perception information obtained by the perception module, such as marking the location of the target object on the map.
[0127] In one example, the planning service module can be used to plan a path from a starting point to an end point and obtain path planning result data. The planning service module can be used for global path planning and / or local path planning. The control service module can obtain the path planning result data according to the storage address of the path planning result data, and control the mobile device to travel from the starting point to the end point according to the path planning result data.
[0128] In one example, the planning service module can perform a path planning subtask based on the footprint information obtained by the mobile device module and the map obtained by the map module to avoid obstacles. The control service module can perform a travel control subtask based on the footprint information and the path planning result data to avoid obstacles.
[0129] In one example, when executing the three-dimensional path planning subtask and the three-dimensional travel control subtask, the corresponding subtasks may be executed according to the three-dimensional model of the mobile device acquired by the mobile device module.
[0130] In this embodiment, by setting a plurality of modules, different subtasks in the navigation task can be executed by different modules, and the execution process of the plurality of modules can be parallelized, thus improving the execution efficiency and sensitivity of the navigation task.
[0131] Figure 3 Shown is a flow chart of a method for controlling a navigation task provided by another exemplary embodiment of the present application. Figure 3 The embodiment is Figure 2 For the example of the embodiment, in order to avoid repetition, the same points can be referred to the description in the above embodiment, which will not be repeated here. Figure 3 As shown, the control method of the navigation task may include the following contents.
[0132] 310: Adjust the thread corresponding to the first module by rewriting the target field of the first node in the configuration file.
[0133] The first node may correspond to the planning service module. Optionally, the thread corresponding to the parent node of the first node in the configuration file may be allocated to the first module by deleting the target field of the first node in the configuration file.
[0134] 320: Control the perception module to obtain a polygonal contour according to contour information of the target object collected by the sensor.
[0135] 330: Control the map module to obtain a second coordinate matrix based on the coordinate transformation matrix and the first coordinate matrix corresponding to the polygon outline, and update the map based on the second coordinate matrix.
[0136] Specifically, the second coordinate matrix may include the coordinates of each vertex on the polygonal outline corresponding to the target object in the map coordinate system. Therefore, the map may be updated according to the second coordinate matrix to mark the position of the target object on the map.
[0137] 340: Control the planning service module to execute the path planning subtask in the navigation task according to the map and the footprint information obtained by the mobile device module, obtain the path planning result data, and store the path planning result data in the shared memory.
[0138] The path planning result data may include a path that avoids a target object on a map. The map may be a map updated in real time.
[0139] 350: The control service module obtains the path planning result data according to the storage address of the path planning result data, and executes the travel control subtask in the navigation task according to the path planning result data, the map and the footprint information obtained by the mobile device module.
[0140] Specifically, executing the travel control subtask in the navigation task based on the path planning result data, the map, and the footprint information obtained by the mobile device module can reduce the risk of the mobile device colliding with the target object during the path-based driving process.
[0141] The execution order of the above steps 310 to 350 can be adjusted as needed, and some steps can be omitted according to actual needs.
[0142] Exemplary Devices
[0143] Figure 4 The structure diagram of the control device of the navigation task provided by an exemplary embodiment of the present application is shown. The control device of the navigation task executes multiple subtasks of the navigation task in the same process through multiple modules in the navigation system, the multiple modules include a first module and a second module, and the multiple subtasks include a first subtask and a second subtask. Figure 4 As shown, the control device 400 for the navigation task includes: a first control module 410 and a second control module 420 .
[0144] The first control module 410 is used to control the first module to execute the first subtask in the navigation task, obtain execution result data, and store the execution result data in the shared memory; the second control module 420 is used to control the second module to obtain the execution result data according to the storage address of the execution result data, and execute the second subtask in the navigation task according to the execution result data.
[0145] The embodiment of the present application provides a control device for a navigation task, which executes multiple subtasks of the navigation task under the same process through multiple modules in the navigation system, controls the first module in the multiple modules to execute the first subtask in the navigation task, obtains execution result data, and stores the execution result data in a shared memory, controls the second module in the multiple modules to obtain the execution result data according to the storage address of the execution result data, and executes the second subtask in the navigation task according to the execution result data. In this way, the control device for the navigation task provided by the embodiment of the present application can call multiple modules in one process, realize data communication between multiple modules in a shared memory manner, so that data transmission can be realized in a zero-copy manner, thereby reducing resource consumption, reducing data transmission time, and improving computing efficiency. Moreover, communication is realized between the modules under the same process by a shared memory manner, which can realize the lightweight of the navigation system or the algorithm framework. In addition, since the navigation system is used to execute the navigation task under the same process, the interaction between the navigation system and the hardware device can be reduced, and the influence of the failure or state switching of the hardware device on the data flow in the navigation system can be reduced, thereby improving the stability of the process in the navigation system.
[0146] According to an embodiment of the present application, the navigation task is executed through a behavior tree, a behavior tree engine is provided in the navigation system, the first module corresponds to the first node in the behavior tree, the second module corresponds to the second node in the behavior tree, and the behavior tree engine calls multiple modules through the behavior tree to execute multiple subtasks of the navigation task under the same process. The first control module 410 is used to control the first module to execute the first subtask in the navigation task through the behavior tree to obtain execution result data.
[0147] According to one embodiment of the present application, the control device 400 for the navigation task also includes a rewrite module 430, which is used to adjust the thread corresponding to the first module by rewriting the target field of the first node in the configuration file, wherein the configuration file is a tree structure, and the tree structure of the configuration file corresponds to the master-slave relationship between multiple modules.
[0148] According to an embodiment of the present application, the control device 400 for the navigation task further includes a deletion module 440 for allocating a thread corresponding to the parent node of the first node in the configuration file to the first module by deleting the target field of the first node in the configuration file.
[0149] According to an embodiment of the present application, the control device 400 of the navigation task also includes an execution module 450, which is used to: in response to receiving a first scheduling instruction, during the process of executing an asynchronous subtask among multiple subtasks, the behavior tree engine instructs the asynchronous action nodes matching the first scheduling instruction in the behavior tree to execute a first scheduling operation corresponding to the first scheduling instruction; monitors the execution status of the asynchronous action nodes; and in response to receiving a second scheduling instruction, when the execution status of all asynchronous action nodes executing the first scheduling operation is in a successful state, instructs the asynchronous action nodes matching the second scheduling instruction in the behavior tree to execute a second scheduling operation corresponding to the second scheduling instruction.
[0150] According to an embodiment of the present application, the multiple modules also include a map module, wherein the control device 400 for the navigation task also includes an acquisition module 460, which is used to: obtain a polygon outline based on the contour information of the target object collected by the sensor; obtain a second coordinate matrix based on the coordinate transformation matrix and the first coordinate matrix corresponding to the polygon outline, wherein the first coordinate matrix includes the coordinates of each vertex of the polygon outline in the sensor coordinate system corresponding to the sensor, and the second coordinate matrix includes the coordinates of each vertex of the polygon outline in the map coordinate system corresponding to the map in the map module.
[0151] According to an embodiment of the present application, the first module is a planning service module for planning a path for a mobile device, the second module is a control service module for controlling the mobile device to travel from a starting point to an end point according to the planned path, the first subtask includes a path planning subtask, the execution result data includes path planning result data, and the second subtask includes a travel control subtask. The first control module 410 is used to control the planning service module to execute the path planning subtask in the navigation task and obtain the path planning result data. The second control module 420 is used to control the control service module to obtain the path planning result data according to the storage address of the path planning result data, and execute the travel control subtask in the navigation task according to the path planning result data.
[0152] According to an embodiment of the present application, the multiple modules further include a map module for storing maps, a perception module for acquiring environmental perception information, and a mobile device module for storing structural information of a mobile device.
[0153] It should be understood that the operations and functions of the first control module 410, the second control module 420, the rewriting module 430, the deleting module 440, the executing module 450 and the acquiring module 460 in the above embodiment can refer to the above Figure 2 or Figure 3 The description of the control method of the navigation task provided in the embodiment will not be repeated here to avoid repetition.
[0154] An embodiment of the present application further provides a mobile device, which includes a control module, and the control module is used to execute the control method of the navigation task provided in any of the above embodiments.
[0155] In some embodiments, the mobile device may be a robot, such as a dual-arm robot, a wheeled robot, or other type of robot, or may be a vehicle or other device that can be used to perform a specific task.
[0156] The operation and functions of the mobile device provided in the embodiments of the present application can refer to the above Figure 2 or Figure 3 The description of the control method of the navigation task provided in the embodiment will not be repeated here to avoid repetition.
[0157] Figure 5 The block diagram of an electronic device 500 for executing a control method for a navigation task provided by an exemplary embodiment of the present application is shown. The electronic device 500 may specifically be a server, a mobile device, a control device of a mobile device, a server interacting with a mobile device, or other devices.
[0158] Reference Figure 5, the electronic device 500 includes a processing component 510, which further includes one or more processors, and a memory resource represented by a memory 520 for storing instructions executable by the processing component 510, such as an application. The application stored in the memory 520 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 510 is configured to execute the instructions to perform the control method of the above-mentioned navigation task.
[0159] The electronic device 500 may also include a power supply component configured to perform power management of the electronic device 500, a wired or wireless network interface configured to connect the electronic device 500 to a network, and an input / output (I / O) interface. The electronic device 500 may be operated based on an operating system stored in the memory 520, such as Windows Server 2008. TM , Mac OSX TM , Unix TM , Linux TM , FreeBSD TM or similar.
[0160] A non-temporary computer-readable storage medium, when instructions in the storage medium are executed by a processor of the electronic device 500, enables the electronic device 500 to perform a control method for a navigation task.
[0161] A computer program product includes a computer program. When the computer program is executed by a processor of a computer device, the computer device is enabled to execute the control method of a navigation task provided in any of the above embodiments.
[0162] All the above optional technical solutions can be arbitrarily combined to form optional embodiments of the present application, and will not be described one by one here.
[0163] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0164] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0165] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0166] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0167] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0168] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, and other media that can store program check codes.
[0169] It should be noted that, in the description of this application, the terms "first", "second", "third", etc. are used for descriptive purposes only and cannot be understood as indicating or implying relative importance. In addition, in the description of this application, unless otherwise specified, the meaning of "plurality" is two or more.
[0170] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0171] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A navigation task control method, characterized in that: The control method of the navigation task executes multiple subtasks of the navigation task in the same process through multiple modules in the navigation system, the multiple modules include a first module and a second module, and the multiple subtasks include a first subtask and a second subtask, wherein the control method of the navigation task includes: Controlling the first module to execute the first subtask in the navigation task, obtaining execution result data, and storing the execution result data in a shared memory; The second module is controlled to obtain the execution result data according to the storage address of the execution result data, and execute the second subtask in the navigation task according to the execution result data.
2. The control method of the navigation task according to claim 1, characterized in that: The navigation task is executed through a behavior tree. The navigation system is provided with a behavior tree engine. The first module corresponds to a first node in the behavior tree. The second module corresponds to a second node in the behavior tree. The behavior tree engine calls the multiple modules through the behavior tree to execute multiple subtasks of the navigation task in the same process. The controlling the first module to execute the first subtask in the navigation task to obtain execution result data includes: The first module is controlled by the behavior tree to execute the first subtask in the navigation task, and the execution result data is obtained.
3. The control method of the navigation task according to claim 1, characterized in that: Also includes: The thread corresponding to the first module is adjusted by rewriting the target field of the first node in the configuration file, wherein the configuration file is a tree structure, and the tree structure of the configuration file corresponds to the master-slave relationship between the multiple modules.
4. The control method of the navigation task according to claim 1, characterized in that: Also includes: By deleting the target field of the first node in the configuration file, a thread corresponding to the parent node of the first node in the configuration file is allocated to the first module.
5. The control method of the navigation task according to claim 2, characterized in that: Also includes: In response to receiving a first scheduling instruction during the execution of an asynchronous subtask among the plurality of subtasks, the behavior tree engine instructs an asynchronous action node in the behavior tree that matches the first scheduling instruction to execute a first scheduling operation corresponding to the first scheduling instruction; Monitoring the execution status of the asynchronous action node; In response to receiving a second scheduling instruction, when the execution status of all asynchronous action nodes that execute the first scheduling operation is a success status, instructing the asynchronous action nodes in the behavior tree that match the second scheduling instruction to execute a second scheduling operation corresponding to the second scheduling instruction.
6. The control method of the navigation task according to claim 1, characterized in that: The multiple modules also include a map module, wherein the control method of the navigation task also includes: According to the contour information of the target object collected by the sensor, a polygonal contour is obtained; Based on the coordinate transformation matrix and the first coordinate matrix corresponding to the polygonal outline, a second coordinate matrix is obtained, wherein the first coordinate matrix includes the coordinates of each vertex of the polygonal outline in the sensor coordinate system corresponding to the sensor, and the second coordinate matrix includes the coordinates of each vertex of the polygonal outline in the map coordinate system corresponding to the map in the map module.
7. The control method of the navigation task according to claim 1, characterized in that: The first module is a planning service module for planning a path for the mobile device, the second module is a control service module for controlling the mobile device to travel from a starting point to an end point according to the planned path, the first subtask includes a path planning subtask, the execution result data includes path planning result data, and the second subtask includes a travel control subtask. The controlling the first module to execute the first subtask in the navigation task to obtain execution result data includes: controlling the planning service module to execute the path planning subtask in the navigation task to obtain the path planning result data, The controlling the second module to obtain the execution result data according to the storage address of the execution result data, and executing the second subtask in the navigation task according to the execution result data, includes: The control service module is controlled to obtain the path planning result data according to the storage address of the path planning result data, and execute the travel control subtask in the navigation task according to the path planning result data.
8. The control method of a navigation task according to any one of claims 1 to 7, characterized in that: The plurality of modules further include a map module for storing a map, a perception module for acquiring environmental perception information, and a mobile device module for storing structural information of the mobile device.
9. A mobile device, characterized in that: It comprises a control module, and the control module is used to execute the control method of the navigation task described in any one of claims 1 to 8.
10. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor, Wherein, the processor is used to execute the control method of the navigation task described in any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and the computer program is used to execute the control method of the navigation task according to any one of claims 1 to 8.
12. A computer program product, characterized in that The computer program product includes a computer program, and when the computer program is executed by a processor of a computer device, the computer device is enabled to execute the control method of the navigation task described in any one of claims 1 to 8.
Citation Information
Cited By
Scheduling processing method based on behavior tree
CN119973978A
A behavior tree-based scheduling processing method
CN119973978B
Vehicle path decision-making method, system and device, chip and storage medium
CN121246845A