A ROS2 node distributed dynamic loading system
Through the collaboration of SOA management architecture and domain manager and node manager, distributed dynamic loading and fault handling of ROS2 nodes are realized, which solves the problem of low efficiency of ROS2 node loading and fault location, improves system reliability and development efficiency, and realizes Virtualization and automatic fault handling of hardware resources.
Patent Information
- Application Number
- CN202311498292.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-10
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2043-11-10
AI Technical Summary
There are inefficiencies and management difficulties in loading and fault locating ROS2 nodes in unmanned special equipment scenarios. Existing technologies such as SSH remote control methods have security issues, lack flexibility and monitoring frameworks, and cannot achieve dynamic loading and automatic fault handling.
A ROS2 node distributed dynamic loading system is designed, which adopts SOA management architecture and realizes hardware resource virtualization and load balancing through the cooperation of domain manager and node manager, dynamically loads ROS2 nodes, and has real-time monitoring and fault handling capabilities. , avoiding manual node operations and statically specifying hardware platforms.
It improves resource utilization and application deployment efficiency, enhances system reliability, realizes flexible dynamic loading and automatic fault handling of ROS2 nodes, simplifies multi-computing resource management, and improves the efficiency and robustness of unmanned special equipment development.
Smart Images

Figure CN117573225B
Abstract
Description
[Technical field]
[0001] The present invention relates to the technical field of unmanned special equipment, and in particular to a ROS2 node distributed dynamic loading system. [Background technology]
[0002] The predecessor of ROS2 is ROS, which stands for Robot Operating System. However, ROS itself is not an operating system, but a software library and tool set. ROS is a highly flexible software architecture used to write robot software programs, which can improve the reusability of functional modules. With the launch of ROS2, ROS is becoming more and more perfect and is the best choice for robot software development.
[0003] SOA (Service-Oriented Architecture) is a service-oriented architecture. It is a coarse-grained, loosely coupled service architecture. Services communicate through simple and precisely defined interfaces. It does not involve underlying programming interfaces and communication models. It connects different functional units of an application (called services) through well-defined interfaces and contracts between these services.
[0004] Whether in the civilian or military fields, intelligent unmanned operations will be a trend in the future. With the rapid development of artificial intelligence technology, a large number of intelligent unmanned equipment such as "unmanned mining vehicles", "unmanned sanitation vehicles", and "unmanned reconnaissance aircraft" have emerged and are used in actual combat. At present, most unmanned special equipment uses ROS or ROS2 as the middle layer for data interaction, and intelligent algorithms are given on the basis of this framework.
[0005] As open source projects, ROS or ROS2 has a relatively large number of open source algorithms to match, and can quickly perform prototype verification of products such as unmanned special equipment; but because it is open source, its robustness and ease of use are relatively poor, users spend a long time verifying the product, and the product has poor stability and poor reusability.
[0006] In the early stages of ROS development, it was mainly used on independent computing resources. As the scenarios became more complex, the computing power requirements increased dramatically. One computing resource could already meet the computing power requirements, so it was necessary to distribute ROS nodes to different computing resources. At this time, ROS could no longer meet the needs of various complex scenarios. Therefore, the ROS development team launched the second-generation robot operating system (ROS2). ROS2 canceled the ROS master node mechanism and adopted the Data Distribution Service (DDS) communication mechanism as the underlying communication mechanism, realizing true distributed computing.
[0007] However, in the actual application of ROS2 in scenarios such as unmanned special equipment, there are still some deficiencies in node loading and fault location. When multiple computing resources are running ROS2 tasks, the control of node loading and unloading requires manual node operations on each computing resource. This method is inefficient, the nodes are not easy to manage, and the location problem is difficult.
[0008] In order to solve the above problems, a Chinese patent with publication number CN116302252A discloses a ROS2 node remote control method and system, which controls other boards through SSH (Secure Shell Protocol) to start the ROS2 node. However, this method has the following shortcomings: 1. SSH authentication is required, which is inconvenient for debugging. If login is not required, there will be security issues; 2. This method can only statically specify ROS2 to the corresponding board, which is not flexible; 3. There is no monitoring framework, and when the node is abnormal, no corresponding processing can be made; 4. All hardware platforms need to have ROS2 application packages in advance, and the remote operation only starts the corresponding node.
[0009] The present invention aims at the technical problems of inconvenient ROS2 node loading operation and difficult fault location, and improves the ROS2 node distributed dynamic loading system. [Summary of the invention]
[0010] The purpose of the present invention is to propose a ROS2 node distributed dynamic loading system with high resource utilization, application deployment efficiency and strong reliability.
[0011] To achieve the above-mentioned purpose, the technical solution adopted by the present invention is a ROS2 node distributed dynamic loading system, including a management computing device and several other computing devices, the computing device is used to dynamically load several ROS2 nodes, the computing devices are connected through a management bus, and the computing devices communicate business data through a business bus;
[0012] A node manager is deployed on the computing device, and a domain manager is also deployed on the management computing device. The node manager is registered with the domain manager, and the ROS2 nodes dynamically loaded on the computing device are registered with the node manager to form a node tree structure managed by the domain manager.
[0013] The computing device stores a SOA management architecture program module. When the computing device executes the SOA management architecture program module:
[0014] The node manager models the computing device hardware resources to obtain a static hardware resource attribute description file, and the domain manager parses the static hardware resource attribute description file to integrate all computing device hardware resource information to generate a virtual hardware resource pool;
[0015] The domain manager parses the application description file to obtain the hardware resource information of all ROS2 nodes that need to be dynamically loaded, queries the virtual hardware resource pool, matches the hardware resource information of each ROS2 node that needs to be dynamically loaded with the hardware resource information of the computing device in the virtual hardware resource pool, and dynamically loads the ROS2 node to the corresponding computing device in a distributed manner.
[0016] Preferably, the computing device is a board on unmanned special equipment.
[0017] Preferably, the hardware resources include computing resources, network resources, storage resources, image resources and peripheral resources.
[0018] Preferably, the domain manager only participates in management bus communication and does not participate in service bus communication.
[0019] Preferably, the computing device executes the SOA management architecture program module to implement ROS2 node distributed dynamic loading, specifically including the following steps:
[0020] S1. Modeling is performed according to the hardware resource situation and application function, and a static hardware resource attribute description file and an application description file are generated respectively. The static hardware resource attribute description file is distributed to the corresponding node manager and the application description file is distributed to the domain manager through the deployment tool;
[0021] S2. Start the SOA management architecture, the node manager parses the static hardware resource attribute description file, the domain manager establishes connections with all node managers, and generates a virtual hardware resource pool based on the static hardware resource attributes of each computing device and the dynamic information formed by each node manager calling the environment abstraction layer;
[0022] S3, application loading, after receiving the application hardware resource attribute description file, the domain manager parses the application hardware resource attribute description file;
[0023] S4. The domain manager queries the virtual hardware resource pool and calls the load balancing algorithm to match the hardware resource information of each ROS2 node that needs to be dynamically loaded with the most appropriate computing device hardware resource information in the virtual hardware resource pool. If the match is successful, the corresponding node manager is called to load the ROS2 node, otherwise the application loading fails.
[0024] S5. After all ROS2 nodes are dynamically loaded, the ROS2 nodes are started according to the orchestration strategy. If there is no exception, the application loading is completed. Otherwise, the reason for the exception is output.
[0025] Preferably, the computing device executes the SOA management architecture program module to implement the ROS2 node distributed dynamic loading step S2, which specifically includes the following sub-steps:
[0026] S21. On the management computing device, start the domain manager;
[0027] S22. Start the node manager on all computing devices.
[0028] S23, the node manager parses the static hardware resource attribute description file and calls the environment abstraction layer interface to obtain the CPU load rate, memory usage rate, and I / O load rate of the computing device;
[0029] S24, the node manager registers with the domain manager and creates a global object request broker;
[0030] S25, the domain manager obtains static hardware resource attributes and dynamic information of all computing devices by calling the query interface of the node manager to form a virtual hardware resource pool;
[0031] S26. The node manager configures and starts the ROS2 working environment. The ROS2 workspace defaults to the directory where the node manager static hardware resource attribute description file is located.
[0032] Preferably, the computing device executes the SOA management architecture program module to implement the ROS2 node distributed dynamic loading step S4 load balancing algorithm, which specifically includes the following sub-steps:
[0033] S41, the domain manager calls the environment abstraction layer through the node manager to obtain the memory usage, CPU load, and I / O load rate of all computing devices during operation;
[0034] S42. The domain manager uses a weighted algorithm to match the most appropriate computing device hardware resource information in the virtual hardware resource pool for each ROS2 node hardware resource information that needs to be dynamically loaded.
[0035] Preferably, the computing device executing the SOA management architecture program module to implement ROS2 node distributed dynamic loading also includes the following steps:
[0036] S6. Monitor ROS2 nodes.
[0037] Preferably, the computing device executes the SOA management architecture program module to implement the ROS2 node distributed dynamic loading step S6, which specifically includes the following sub-steps:
[0038] S61, the node manager monitors the status information of the ROS2 nodes on the computing device in real time;
[0039] S62, if the node manager finds that a ROS2 node is abnormal, it stops the abnormal ROS2 node from communicating with other ROS2 nodes, broadcasts to all ROS2 nodes, and then notifies the domain manager to update the virtual hardware resource pool;
[0040] S63, the domain manager records the abnormal ROS2 node information, notifies the node manager to uninstall the abnormal ROS2 node and restore the stack space;
[0041] S64, the domain manager queries the virtual hardware resource pool according to the recorded node tree structure, matches the ROS2 node hardware resource information with the most appropriate computing device hardware resource information in the virtual hardware resource pool, and if there is, executes step S65, otherwise, the application reconstruction fails;
[0042] S65. The domain manager calls the node manager to reload the ROS2 node to the corresponding computing device, and the application reconstruction is successful.
[0043] Preferably, the status information of the ROS2 node includes memory usage, stack, and number of processes.
[0044] The ROS2 node distributed dynamic loading system of the present invention has the following beneficial effects: first, a SOA management architecture is designed based on the SOA architecture, which mainly includes a domain manager and a node manager. The management collaboration between boards is realized by commanding the node manager through the domain management, without exposing user login, etc., and has security; second, computing resources are virtualized and managed by the domain manager, so that the resources of the unmanned special equipment cluster can be publicized and the ROS2 nodes can be dynamically deployed to different hardware resources; third, the domain management monitors the running status of the node, promptly uninstalls the node from the resource in the abnormal state, and redeploys it on the resource in the normal state, thereby improving the system reliability.
Brief Description of the Drawings
[0045] Figure 1 It is a schematic diagram of the relationship between the SOA management architecture of the ROS2 node distributed dynamic loading system and the ROS2 distributed nodes.
[0046] Figure 2 It is a hardware virtualization diagram of the SOA management architecture of the ROS2 node distributed dynamic loading system.
[0047] Figure 3 The present invention is a schematic diagram of ROS2 node distributed dynamic loading system SOA management architecture for ROS2 node distributed dynamic loading.
[0048] Figure 4 It is a ROS2 node distributed dynamic loading system ROS2 node distributed dynamic loading flow chart.
[0049] Figure 5 It is a startup flow chart of the SOA management architecture of the ROS2 node distributed dynamic loading system.
[0050] Figure 6 It is a flow chart of ROS2 node monitoring and management based on SOA management architecture of ROS2 node distributed dynamic loading system. [Specific implementation method]
[0051] The present invention will be further described below in conjunction with embodiments and with reference to the accompanying drawings.
[0052] Example
[0053] This embodiment implements a ROS2 node distributed dynamic loading system.
[0054] This embodiment aims to provide a ROS2 node distributed dynamic loading system based on the SOA management architecture, which effectively improves system resource utilization, application deployment efficiency and system reliability.
[0055] The system of this embodiment designs a software framework that can manage the life cycle of ROS2 nodes based on the SOA management architecture, which greatly simplifies the process of manual operation required for the control process such as the startup and destruction of each ROS2 node when multiple computing devices run ROS2 tasks. At the same time, the software framework has the ability to virtualize hardware resources. ROS2 nodes can automatically match appropriate hardware resources (including computing resources, network resources, storage resources, image resources, peripheral resources, etc.) according to computing power requirements, without manually specifying which computing device the ROS2 node runs on. The system of this embodiment effectively improves the development efficiency in fields such as unmanned special equipment, and has strong robustness, fault tolerance and scalability.
[0056] Figure 1 This is a schematic diagram of the relationship between the SOA management architecture of the ROS2 node distributed dynamic loading system and the ROS2 distributed nodes. Figure 1 As shown, after the modeling is completed, the system of this embodiment determines and manages hardware resources according to the actual situation. The domain manager is deployed on the management computing device, and all computing devices, that is, the management computing device and other computing devices, deploy node managers. The node manager registers with the domain manager, and the domain manager calls the node manager to load the ROS2 nodes to the corresponding target computing devices. At the same time, the loaded ROS2 nodes register with the node manager, forming a tree structure managed by the domain manager. The domain manager only participates in management communication, not business communication.
[0057] Figure 2 This is a hardware virtualization diagram of the SOA management architecture of the ROS2 node distributed dynamic loading system. Figure 2As shown, the SOA management architecture of this embodiment is based on a hardware resource virtualization technology, which integrates the computing device hardware resource modeling according to the (customer or user) hardware resource requirements to generate a static hardware resource attribute description file; when modeling, the computing device node manager parses the static hardware resource attribute description file to obtain the computing device hardware resource information, and at the same time calls the environment abstraction layer interface to obtain dynamic information such as the computing device CPU load, memory usage, I / O load rate, etc., and then the domain management counts the computing device hardware resource information obtained by all node managers to form a virtual hardware resource pool. Figure 3 This is a schematic diagram of the ROS2 node distributed dynamic loading system SOA management architecture for ROS2 node distributed dynamic loading. Figure 3 As shown, in this embodiment, when the ROS2 node is loaded, the SOA management architecture parses the application hardware resource attribute description file to obtain the hardware resource information of all ROS2 nodes, and then queries the virtual hardware resource pool, matches the ROS2 node hardware resource information with the computing device hardware resource information in the virtual hardware resource pool, and automatically deploys (distributed call loading) the ROS2 node to the corresponding target computing device, so there is no need to bind the ROS2 node to the specified computing device.
[0058] Figure 4 This is a ROS2 node distributed dynamic loading system ROS2 node distributed dynamic loading flow chart. Figure 4 As shown, the system of this embodiment can realize the distributed dynamic loading of ROS2 nodes by executing the SOA management architecture through the above method. The specific steps are as follows:
[0059] Step 1: First, model the hardware resources and application functions, and generate node manager attribute description files (i.e. static hardware resource attribute description files) and application description files (i.e. application hardware resource attribute description files, which have a larger scope and include the hardware resources required by the application and the connection relationships between some nodes). Use the deployment tool to distribute the node manager attribute description files and application description files to the corresponding computing devices.
[0060] Step 2: The SOA management architecture is started, the node manager parses the node manager attribute description file, and then the domain manager establishes connections with all node managers, and forms a virtual hardware resource pool based on the node manager attributes and the dynamic information formed by the node management call environment abstraction layer;
[0061] Step 3: When the application is loaded, the domain manager receives the instruction and starts parsing the application description file;
[0062] Step 4: The domain manager searches for the virtual hardware resource pool, calls load balancing and other algorithms to find the most suitable hardware according to the actual situation, and then calls the corresponding node manager to load the ROS2 node. If the corresponding hardware resources are not found, the application loading fails.
[0063] Step 5: After all ROS2 nodes are loaded, start the ROS2 nodes according to the corresponding orchestration strategy. If there is no exception, the application loading is completed. If there is, the corresponding failure reason is output.
[0064] The specific principle steps for the system in this embodiment to implement the distributed dynamic loading of ROS2 nodes in step 1 by executing the SOA management architecture are as follows:
[0065] Step 1.1: Confirm the management computing device according to the actual hardware situation, and then upload the application description file and node manager attribute description file to the domain manager through the deployment tool;
[0066] Step 1.2: Distribute the node manager property description file and the node manager framework to the management computing device and other computing devices through a deployment tool.
[0067] Figure 5 This is a startup flow chart of the SOA management architecture of the ROS2 node distributed dynamic loading system. Figure 5 As shown, the system of this embodiment implements the distributed dynamic loading of ROS2 nodes by executing the SOA management architecture. The specific process steps of step 2 management framework startup are as follows:
[0068] Step 2.1: On the management computing device, start the domain manager (it starts automatically after deployment is complete);
[0069] Step 2.2: On all computing devices, start the node manager (it will start automatically after deployment is complete);
[0070] Step 2.3: The node manager parses the attribute description file and calls the environment abstract interface to obtain dynamic information such as CPU load rate, memory usage rate, I / O load rate, etc.
[0071] Step 2.4: The node manager registers with the domain manager and creates a global object request broker;
[0072] Step 2.5: The domain manager obtains the static and dynamic attribute information of all nodes by calling the query interface of the node manager to form a hardware virtual resource pool;
[0073] Step 2.6: Configure the node manager and start the ROS2 related environment. The ROS2 workspace defaults to the directory where the node manager property description file is located.
[0074] Among them, the system of this embodiment implements the distributed dynamic loading of ROS2 nodes by executing the SOA management architecture. The specific steps of step 4 using the responsible balancing algorithm are as follows:
[0075] Step 4.1: The domain manager calls the environment abstraction layer through the node manager to obtain the memory usage, CPU load, I / O load rate, etc. of all computing devices (boards) during operation;
[0076] Step 4.2: Mainly through the weighted algorithm, to match the most suitable hardware resources for the ROS2 node.
[0077] Figure 6 This is a ROS2 node distributed dynamic loading system SOA management architecture to monitor and manage ROS2 nodes. Figure 6 As shown, further, the system of this embodiment also has the ability to monitor ROS2 nodes by executing the SOA management architecture. The specific steps are as follows:
[0078] Step 6.1: The node manager monitors the status information of the ROS2 nodes it manages in real time, such as memory usage, stack, number of processes, etc.
[0079] Step 6.2: If an abnormality is found in a ROS2 node, the communication between this node and other nodes is stopped and broadcast to all nodes. Then the node manager notifies the domain manager to update the virtual resource pool.
[0080] Step 6.3: The domain manager records the information of the node, and then notifies the node manager to uninstall the corresponding ROS2 node, restore the stack space, etc.
[0081] Step 6.4: The domain manager queries the virtual resource pool based on the recorded node information. If there is any, it proceeds to the next step of loading. If not, the application reconstruction fails.
[0082] Step 6.5: The domain manager calls the node manager to reload the node, and the application reconstruction is successful.
[0083] Those skilled in the art will appreciate that all or part of the steps to implement the above embodiments may be accomplished by hardware, or by a program to instruct related hardware, and the program may be stored in a computer-readable storage medium, wherein the storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0084] The above is only a preferred embodiment of the present invention. It should be pointed out that ordinary technicians in this technical field can make several improvements and supplements without departing from the principle of the present invention. These improvements and supplements should also be regarded as the scope of protection of the present invention.
Claims
1. A ROS2 node distributed dynamic loading system, comprising a management computing device and several other computing devices, wherein the computing device is used to dynamically load several ROS2 nodes, the computing devices are connected via a management bus, and the computing devices communicate business data via a business bus; characterized in that: A node manager is deployed on the computing device, and a domain manager is also deployed on the management computing device. The node manager is registered with the domain manager, and the ROS2 nodes dynamically loaded on the computing device are registered with the node manager to form a node tree structure managed by the domain manager. The computing device stores a SOA management architecture program module. When the computing device executes the SOA management architecture program module: The node manager models the computing device hardware resources to obtain a static hardware resource attribute description file, and the domain manager parses the static hardware resource attribute description file to integrate all computing device hardware resource information to generate a virtual hardware resource pool; The domain manager parses the application description file to obtain the hardware resource information of all ROS2 nodes that need to be dynamically loaded, queries the virtual hardware resource pool, matches the hardware resource information of each ROS2 node that needs to be dynamically loaded with the hardware resource information of the computing device in the virtual hardware resource pool, and dynamically loads the ROS2 node to the corresponding computing device in a distributed manner.
2. A ROS2 node distributed dynamic loading system according to claim 1, characterized in that: The computing device is a board on unmanned special equipment.
3. A ROS2 node distributed dynamic loading system according to claim 1, characterized in that: The computing device hardware resources include computing resources, network resources, storage resources, image resources and peripheral resources.
4. A ROS2 node distributed dynamic loading system according to claim 1, characterized in that: The domain manager only participates in management bus communication and does not participate in service bus communication.
5. A ROS2 node distributed dynamic loading system according to claim 1, characterized in that The computing device executes the SOA management architecture program module to implement ROS2 node distributed dynamic loading, which specifically includes the following steps: S1. Modeling is performed according to the hardware resource situation and application function, and static hardware resource attribute description files and application description files are generated respectively. The static hardware resource attribute description files are distributed to the corresponding node managers and the application description files are distributed to the domain managers through the deployment tool; S2. Start the SOA management architecture, the node manager parses the static hardware resource attribute description file, the domain manager establishes connections with all node managers, and generates a virtual hardware resource pool based on the static hardware resource attributes of each computing device and the dynamic information formed by each node manager calling the environment abstraction layer; S3, application loading, after receiving the application description file, the domain manager parses the application description file; S4. The domain manager queries the virtual hardware resource pool and calls the load balancing algorithm to match the hardware resource information of each ROS2 node that needs to be dynamically loaded with the most appropriate computing device hardware resource information in the virtual hardware resource pool. If the match is successful, the corresponding node manager is called to load the ROS2 node, otherwise the application loading fails. S5. After all ROS2 nodes are dynamically loaded, the ROS2 nodes are started according to the orchestration strategy. If there is no exception, the application loading is completed. Otherwise, the reason for the exception is output.
6. A ROS2 node distributed dynamic loading system according to claim 5, characterized in that The step S2 of the computing device executing the SOA management architecture program module to implement the distributed dynamic loading of ROS2 nodes specifically includes the following sub-steps: S21. On the management computing device, start the domain manager; S22. Start the node manager on all computing devices. S23, the node manager parses the static hardware resource attribute description file and calls the environment abstraction layer interface to obtain the CPU load rate, memory usage rate, and I / O load rate of the computing device; S24, the node manager registers with the domain manager and creates a global object request broker; S25, the domain manager obtains static hardware resource attributes and dynamic information of all computing devices by calling the query interface of the node manager to form a virtual hardware resource pool; S26. The node manager configures and starts the ROS2 working environment. The ROS2 workspace defaults to the directory where the node manager static hardware resource attribute description file is located.
7. A ROS2 node distributed dynamic loading system according to claim 6, characterized in that The load balancing algorithm in step S4 specifically includes the following sub-steps: S41, the domain manager calls the environment abstraction layer through the node manager to obtain the memory usage, CPU load, and I / O load rate of all computing devices during operation; S42. The domain manager uses a weighted algorithm to match the most appropriate computing device hardware resource information in the virtual hardware resource pool for each ROS2 node hardware resource information that needs to be dynamically loaded.
8. A ROS2 node distributed dynamic loading system according to claim 7, characterized in that The computing device executing the SOA management architecture program module to implement ROS2 node distributed dynamic loading also includes the following steps: S6. Monitor ROS2 nodes.
9. A ROS2 node distributed dynamic loading system according to claim 8, characterized in that The step S6 specifically includes the following sub-steps: S61, the node manager monitors the status information of the ROS2 nodes on the computing device in real time; S62, if the node manager finds that a ROS2 node is abnormal, it stops the abnormal ROS2 node from communicating with other ROS2 nodes, broadcasts to all ROS2 nodes, and then notifies the domain manager to update the virtual hardware resource pool; S63, the domain manager records the abnormal ROS2 node information, notifies the node manager to uninstall the abnormal ROS2 node and restore the stack space; S64, the domain manager queries the virtual hardware resource pool according to the recorded node tree structure, matches the ROS2 node hardware resource information with the most appropriate computing device hardware resource information in the virtual hardware resource pool, and if there is, executes step S65, otherwise, the application reconstruction fails; S65. The domain manager calls the node manager to reload the ROS2 node to the corresponding computing device, and the application reconstruction is successful.
10. A ROS2 node distributed dynamic loading system according to claim 9, characterized in that The status information of the ROS2 node in step S6 includes memory usage, stack, and number of processes.
