A business parallel processing method, device and equipment of a robot and a medium
By using the registration and task splitting mechanism of master node and business nodes, the problems of poor robot performance and high code coupling are solved, thereby improving the robot's business processing performance and development efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-15
- Publication Date
- 2026-03-27
AI Technical Summary
The problems include poor robot performance, high coupling between running code, and the difficulty for R&D personnel to develop robot business nodes as a team.
The robot registers with at least one business node through the master node, receives business instructions, determines the target task and breaks it down into sub-tasks, distributes the sub-tasks to the corresponding nodes according to the registration results of the business nodes, and uses the business nodes to control the robot to complete each sub-task.
It enhances the robot's business processing performance, reduces code coupling between business nodes, and improves the development efficiency of business nodes.
Smart Images

Figure CN116442214B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of artificial intelligence, and particularly relates to a business parallel processing method, device and equipment of a robot and a medium. BACKGROUND
[0002] With the continuous development of artificial intelligence, more and more fields begin to use robots to perform business, and the functions and use performance of the robots are constantly improved. In order to enable the robots to adapt to more complex task scenarios and to process more complex business, it has become a research hotspot for people to set a more optimal business processing program for the robots.
[0003] Currently, in order to enable the robots to process more tasks and improve the program response speed during the business processing of the robots, a single-process multi-thread business processing node is usually set in the robot. Specifically, the single-process multi-thread business processing node usually runs multiple different threads in one program, executes different tasks through the multiple different threads at the same time, and thus achieves the purpose of improving the business processing speed of the robots.
[0004] Since the single-process multi-thread business processing node shares the same program, that is, the code areas of the multiple threads are shared, the coupling degree between the threads is high, and the mutual dependence between the codes is serious. At the same time, in order to make the functions of the robots more perfect, it is necessary to continuously increase the number of threads on the basis of the original code, which not only limits the performance of the robots, but also increases the difficulty for the development personnel to develop the robot team. Therefore, there are problems of poor performance of the robots, high coupling degree between the running codes of the robots, and great difficulty for the development personnel to develop the robot business node in team in the prior art. SUMMARY
[0005] The purpose of the embodiments of the present application is to provide a business parallel processing method, device and equipment of a robot and a medium, which can solve the problems of poor performance of the robots, high coupling degree between the running codes of the robots, and great difficulty for the development personnel to develop the robot business node in team. The main node and at least one business node are registered and receive business instructions, the target task is determined, the main node is used to split the target task to obtain a subtask, each subtask is distributed to the corresponding business node according to the registration result of each business node, and then the business node controls the robot to complete each subtask, which can enhance the business processing performance of the robot, reduce the code coupling degree between the business nodes, and improve the development efficiency of the business nodes.
[0006] In a first aspect, the embodiments of the present application provide a business parallel processing method of a robot, which is executed by a robot control system, and the method comprises the following steps.
[0007] sending a starting instruction to start the master node and at least one service node; wherein each service node is connected with the master node respectively;
[0008] receiving a connection request of the service node by the master node, and registering the service node according to the connection request and a node ID of the service node;
[0009] receiving a service instruction, and determining a target task by the master node;
[0010] splitting the target task by the master node to obtain at least one subtask and execution time sequence information between the subtasks; wherein the master node is pre-configured with a protocol rule for splitting the task;
[0011] determining the service node corresponding to the subtask according to a registration result of each service node by the master node, and respectively issuing each subtask to the corresponding service node;
[0012] controlling the robot to complete each subtask based on the execution time sequence information by the service node.
[0013] Further, before responding to the starting instruction and performing the starting operation, the method further comprises:
[0014] using a shell script to build the master node, and building at least one service node according to working parameters of the robot.
[0015] Further, building at least one service node according to the working parameters of the robot comprises:
[0016] obtaining a hardware unit for executing a task of the robot; wherein the hardware unit comprises one or more of a mechanical arm, a base and a motor;
[0017] determining the number of service nodes according to the number of hardware units to build at least one service node.
[0018] Further, splitting the target task by the master node to obtain at least one subtask comprises:
[0019] determining a hardware unit required in a target task execution process according to the pre-configured protocol rule;
[0020] splitting the target task to obtain at least one subtask at a node position where the hardware unit switches in the target task execution process.
[0021] Further, determining the service node corresponding to the subtask according to the registration result of each service node by the master node, and respectively issuing each subtask to the corresponding service node comprises:
[0022] According to the registration result of each service node, the hardware unit associated with each service node is determined to establish the publish-subscribe mechanism between each service node and the master node based on the associated hardware unit;
[0023] The hardware unit required in the execution process of the subtask split by the master node is obtained, and the subtask is published based on the hardware unit required in the execution process;
[0024] According to the publish-subscribe mechanism, the delivery operation of each subtask to the corresponding service node is completed.
[0025] Further, before receiving the service instruction and determining the target task through the master node, the method further comprises:
[0026] Obtain the hardware unit of the robot executing the task;
[0027] According to the hardware unit, determine the development branch of the service content;
[0028] According to the development branch of the service content, a single-branch development mode is adopted to develop the service content.
[0029] Further, after developing the service content according to the development branch of the service content using a single-branch development mode, the method further comprises:
[0030] Receive the new demand of the service content;
[0031] Determine the target service branch that needs to be modified based on the new demand;
[0032] Generate a service content addition instruction of the target service branch to adjust the service content of the target service branch;
[0033] Publish the adjusted service content through the master node.
[0034] In a second aspect, the embodiments of the present application provide a robot service parallel processing device, the device comprises:
[0035] A start instruction delivery module is configured to issue a start instruction to start a master node and at least one service node; wherein each service node is connected to the master node;
[0036] A service node registration module is configured to receive a connection request of a service node through the master node, and register the service node according to the connection request and the node ID of the service node;
[0037] A target task determination module is configured to receive a service instruction and determine a target task through the master node;
[0038] The target task splitting module is configured to split the target task by the master node to obtain at least one subtask and execution timing information between the subtasks; wherein the master node is preconfigured with a protocol rule for splitting the task;
[0039] The subtask issuing module is configured to determine the service node corresponding to the subtask by the master node according to the registration result of each service node, and issue each subtask to the corresponding service node respectively.
[0040] The subtask completion module is configured to control the robot to complete each subtask based on the execution timing information by the service node.
[0041] In a third aspect, an electronic device is provided, which includes a processor, a memory, and a program or instructions stored in the memory and executable on the processor. When the program or instructions are executed by the processor, the steps of the method according to the first aspect are implemented.
[0042] In a fourth aspect, a readable storage medium is provided, which stores a program or instructions. When the program or instructions are executed by a processor, the steps of the method according to the first aspect are implemented.
[0043] In a fifth aspect, a chip is provided, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is configured to execute a program or instructions to implement the method according to the first aspect.
[0044] In the embodiment of the present application, a start instruction is sent to start a master node and at least one service node; each service node is connected with the master node respectively; a connection request of the service node is received through the master node, and the service node is registered according to the connection request and a node ID of the service node; a service instruction is received, and a target task is determined through the master node; the target task is split through the master node to obtain at least one subtask and execution time sequence information between the subtasks; the master node is pre-configured with a protocol rule for splitting the task; the service node corresponding to the subtask is determined through the master node according to the registration result of the service node, and each subtask is respectively distributed to the corresponding service node; the robot is controlled to complete each subtask through the service node based on the execution time sequence information. Through the above robot service parallel processing method, the problems of poor robot performance, high coupling degree between robot running codes, and high difficulty of team development of the robot service node by the research and development personnel can be solved. The target task is determined through the master node and at least one service node, the target task is split into subtasks through the master node, and each subtask is distributed to the corresponding service node according to the registration result of the service node, and then the robot is controlled to complete each subtask through the service node, which can enhance the business processing performance of the robot, reduce the code coupling degree between the service nodes, and improve the development efficiency of the service node. BRIEF DESCRIPTION OF DRAWINGS
[0045] Figure 1 FIG. 1 is an internal structure schematic diagram of a robot service parallel processing provided by the present application.
[0046] Figure 2 FIG. 2 is a flowchart of a robot service parallel processing method provided by the first embodiment of the present application;
[0047] Figure 3 FIG. 3 is a flowchart of a robot service parallel processing method provided by the second embodiment of the present application;
[0048] Figure 4 FIG. 4 is a structure schematic diagram of a robot service parallel processing device provided by the third embodiment of the present application;
[0049] Figure 5 FIG. 5 is a structure schematic diagram of an electronic device provided by the fourth embodiment of the present application. DETAILED DESCRIPTION
[0050] In order to make the purposes, technical solutions and advantages of the present application clearer, the specific embodiments of the present application are further described in detail below with reference to the drawings. It can be understood that the specific embodiments described herein are only used to explain the present application, but not to limit the present application. In addition, it should be noted that, for the convenience of description, only parts related to the present application are shown in the drawings, but not all. Before discussing the example embodiments in more detail, it should be mentioned that some example embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts describe the operations (or steps) as sequential processes, many of the operations can be implemented in parallel, concurrently or simultaneously. In addition, the order of the operations can be rearranged. The processes can be terminated when the operations are completed, but can also have additional steps not included in the drawings. The processes can correspond to methods, functions, procedures, subroutines, etc.
[0051] The technical solutions in the embodiments of the present application will be described clearly below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art belong to the scope of protection of the present application.
[0052] The terms "first", "second" and the like in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second" and the like are usually a class, not limited to the number of objects, for example, the first object can be one or more. In addition, "and / or" in the specification and claims means at least one of the connected objects, and the character " / ", generally means that the front and rear associated objects are in an "or" relationship.
[0053] The business parallel processing method, device, equipment and medium of a robot provided by the embodiments of the present application will be described in detail below with reference to the drawings, through specific embodiments and application scenarios.
[0054] Embodiment one
[0055] Figure 1 is the internal structure schematic diagram of the business parallel processing of the robot provided by the present application.
[0056] Figure 2 is the flowchart of the business parallel processing method of a robot provided by the first embodiment of the present application. The method is executed by a robot control system. As shown in Figure 2 , the specific steps include the following steps:
[0057] S101, issuing a start instruction to start a master node and at least one service node; wherein each service node is connected with the master node respectively;
[0058] Firstly, the use scenario of the scheme can be a scenario in which the robot service processing function needs to be improved, specifically, it can be a scenario in which the robot single-process service processing node is improved. By increasing the number of robot service processing nodes, the coupling degree between robot service processing codes can be reduced and the service processing capacity of the robot can be improved.
[0059] Based on the above use scenario, it can be understood that the execution subject of the application can be a robot control system with information receiving, information processing and coding capabilities, such as a host computer, etc., which is not limited here.
[0060] In an embodiment, the start instruction can be an instruction for starting or running the robot, such as a power-on instruction, etc. The master node can be a master node in the internal system of the robot for receiving and forwarding external input instructions or information, and the service node can be a node for controlling the robot execution terminal to enable the execution terminal to perform tasks, and also a node for processing and forwarding received instructions, data and information, etc. The master node is started before the service node, and can connect multiple different service nodes at the same time, for forwarding tasks to be processed to different service nodes according to task types and task contents; after receiving the tasks forwarded by the master node, the service node controls the corresponding execution terminal to perform tasks or directly processes the tasks, and after the task processing is completed, the execution terminal or the processed data result can also be forwarded back to the master node. After the robot control system receives the externally input task instruction, it issues a start instruction to the robot through program code to start the master node and at least one service node of the robot, and each service node is connected with the master node through different processes respectively.
[0061] Different service nodes have different service processing functions. By developing and creating multiple service nodes with different functions and connecting them with the master node, the service processing capacity of the robot can be improved. For example, one service node can process 10 services, by creating N service nodes, starting the N service nodes at the same time and connecting them to the master node, the robot can have N service processing functions and can process 10N services.
[0062] In an embodiment, optionally, before performing the start operation in response to the start instruction, the method further comprises:
[0063] The shell script is used to build the master node, and at least one service node is built according to the working parameters of the robot.
[0064] In an embodiment, the script can be a program saved in pure text, which is a series of text commands that can be viewed and edited, etc. When the script program is executed, it is translated into machine-recognizable instructions by a system interpreter, and executed in program order. The shell is a command interpreter, which can operate and control the operating system through shell commands, and control the computer by starting, pausing, and stopping the program running through the shell commands input by the user. The shell script is an execution file composed of shell commands, which integrates some commands into a file to process business logic, and is run by an interpreter. The most important thing in the shell script is the use and combination of shell commands, and the use of some language features supported by the shell script to complete the desired function.
[0065] The working parameters of the robot can include self-configuration parameters of the robot and parameters of the types of tasks that can be executed, such as: end execution tool configuration parameters of the robot and parameters for controlling the execution tool. The shell script can support more operation commands and more execution functions of the node program, etc. Therefore, before responding to the start instruction and executing the start operation, the shell script can be used to build the master node, and at least one business node can be built according to the working parameters of the robot. Specifically, the shell script can be used to build the master node, which can be developed by using C++ code language, and the shell script can be used as a program script for starting the master node, and can be resident in the background of the robot control system. The execution task type of the robot is determined according to the working parameters of the robot, and the business nodes required for executing the task type are determined. Different business nodes execute different task contents, and different business nodes are connected to the master node based on the publish / subscribe mode. Therefore, the number of business nodes is at least one, and the business nodes can be built by the shell script and connected to the master node.
[0066] In an embodiment, before responding to the start instruction and executing the start operation, the shell script can be used to build the master node, and at least one business node can be built according to the working parameters of the robot, which can facilitate the binding of the master node and the business node, and improve the efficiency of connecting the business node to the master node.
[0067] In an embodiment, optionally, at least one business node can be built according to the working parameters of the robot, including:
[0068] Obtaining a hardware unit for executing a task of the robot; wherein the hardware unit includes one or more of a mechanical arm, a base, and a motor;
[0069] According to the number of hardware units, the number of service nodes is determined to build at least one service node.
[0070] In an embodiment, the hardware units can be hardware execution tools required by the robot when executing task instructions, including one or more of mechanical arms, bases, and motors. The hardware units can be determined according to the type of task executed by the robot, for example: a cleaning robot needs to perform cleaning, garbage collection, and walking tasks, and the hardware units of the cleaning robot include mechanical arms for cleaning and garbage collection, bases and motors for controlling walking, and other hardware units. The service node is used to control the hardware unit and return the data feedback by the hardware unit, therefore, the number of service nodes is at least one, and the more the number of service nodes, the more the types of tasks that the robot can perform, that is, the stronger the service processing capability of the robot. According to the number of hardware units, the number of types of tasks that the robot can perform can be determined, and then the number of service nodes is determined according to the number of types of tasks, and at least one service node is built according to the number of service nodes.
[0071] In an embodiment, by obtaining the hardware units of the robot performing tasks, and according to the number of hardware units, the number of service nodes is determined to build at least one service node, which can improve the simplicity and accuracy of building service nodes, and further improve the service processing efficiency of service nodes.
[0072] S102, receiving a connection request of a service node by a master node, and registering the service node according to the connection request and a node ID of the service node;
[0073] In an embodiment, the node ID of the service node can be a number or the like capable of distinguishing the node from other nodes, which can include the identity of the service node, the service processing type, the type of the terminal execution tool controlled, and the like, and can be composed of one or more of numbers, symbols, and letters. After the robot control system sends a start instruction and starts the master node and at least one service node, the service node actively sends a connection request for connecting with the master node, the robot control system receives the connection request of the service node through the master node, and registers the service node through a shall script according to the connection request and the node ID of the service node. The purpose of the registration of the service node can be to correspond the service node with the master node, so that the master node can distribute the received tasks to the corresponding service node according to the task type. The registration information of the service node can include the name of the service node, the connection mode of the service node with the master node, and the connection process code, and the like, which is not limited here. The master node internally uses a mapping mechanism to save the registration information.
[0074] S103, receiving a service instruction, determining a target task through the master node;
[0075] In an embodiment, the service instruction can be an instruction input by an external to the robot control system. Specifically, the service instruction can include the service content and the service type that can be processed by the service node of the robot, and can also include the service content that cannot be processed by the service node of the robot. The target task can be the service in the service instruction that can be executed or processed by the service node, and the robot control system can receive the externally input service instruction through the background or the display interface of the robot control system, and determine the target task in the service instruction that can be processed by the service node through the registration information of the service node saved in the master node.
[0076] S104, splitting the target task through the master node to obtain at least one subtask and the execution time sequence information between the subtasks; wherein the master node is pre-configured with a protocol rule for splitting tasks;
[0077] In an embodiment, the sub-tasks can be part or all of the target task, and the sub-tasks can be processed by the corresponding service nodes. The execution timing information between the sub-tasks can be information such as execution duration and execution order of the sub-tasks. For example, the execution timing information of the handling robot can include sub-task execution order information such as first using the mechanical arm to perform the task of picking up the object, then using the chassis to perform the task of transportation, and then using the mechanical arm to perform the task of putting down the object after reaching the target position, and duration information for executing each sub-task. The protocol rule for splitting the task can be a protocol rule for splitting and assigning the target task to the corresponding service node according to the business processing type of the service node and the hardware unit controlled by the service node, such as JSON or XML. The target task is split into at least one sub-task by the protocol rule for splitting the task and the registration information of the service node pre-configured in the master node, and the execution timing information between the sub-tasks is determined according to the content of the target task and the type of each service node.
[0078] In an embodiment, the target task is split into at least one sub-task by the master node, including:
[0079] According to the pre-configured protocol rule, determining the hardware unit required in the execution process of the target task;
[0080] Splitting the target task at the node position where the hardware unit switching occurs in the execution process of the target task to obtain at least one sub-task.
[0081] In an embodiment, the hardware unit required in the execution process of the target task can be determined according to the pre-configured protocol rule in the master node and the task content of the target task. The same hardware unit can be used multiple times in the execution process of the target task. Different hardware units are controlled by different service nodes, that is, different hardware units correspond to different service nodes. If the hardware unit switching occurs in the execution process of the target task, that is, the adjacent hardware units are different, it means that the service node switching occurs, and the position of the hardware unit switching is the position of the service node switching. Therefore, the target task can be split into at least one sub-task according to the node position where the hardware unit switching occurs in the execution process of the target task.
[0082] In an embodiment, by determining the hardware unit required in the execution process of the target task according to the pre-configured protocol rule, and splitting the target task at the node position where the hardware unit switching occurs in the execution process of the target task to obtain at least one sub-task, the accuracy of splitting the target task can be improved, and the efficiency of the service node of the robot in processing the service can be improved.
[0083] S105, according to the registration result of each service node, determining the service node corresponding to the subtask through the master node, and respectively issuing each subtask to the corresponding service node;
[0084] In an embodiment, the registration result of each service node can include the result of whether each service node is successfully registered with the master node and the registration information of the service node successfully registered. The registration information can include the name of the service node, the type of service processed, the connection mode with the master node, and the connection process code, etc. Specifically, the registration result of each service node can be whether the master node can connect with the service node and the result of splitting and transmitting the received task information to the corresponding service node, and also can be whether the service node can receive and process the subtask forwarded by the master node and return the processing result data to the master node. If the service node is successfully registered with the master node, the registration information of the service node can be stored in the master node. The robot control system can determine whether the subtask has a corresponding service node according to the registration result of each service node, and determine the service node corresponding to the subtask through the registration information of the service node stored in the master node, and respectively issue each subtask to the corresponding service node. The master node program can use a MAP data structure to save the registration result of the service node having a mapping relationship with the master node. The mapping relationship can be the relationship between the service processing type of each service node and the service received by the master node.
[0085] In an embodiment, optionally, according to the registration result of each service node, determining the service node corresponding to the subtask through the master node, and respectively issuing each subtask to the corresponding service node, includes:
[0086] According to the registration result of each service node, determining the hardware unit associated with each service node, to establish a publish-subscribe mechanism between each service node and the master node based on the associated hardware unit;
[0087] Obtaining the hardware unit required in the execution process of the subtask split by the master node, and publishing the subtask based on the hardware unit required in the execution process;
[0088] According to the publish-subscribe mechanism, completing the issuing operation of each subtask to the corresponding service node.
[0089] In an embodiment, the publish-subscribe mechanism can be a mapping mechanism between the service nodes and the master node, specifically, the service nodes can send a subscription request to the master node according to the service processing type of the service nodes, and the master node can publish each subtask to the corresponding node according to the subscription request of the service node. According to the registration result of each service node saved in the master node, the hardware units controlled by each service node can be determined, which can include hardware of the same function and different types. Based on the determined hardware units, the task processing type of each service node can be determined, the mapping relationship between the service node and the master node can be determined according to the task processing type of each service node, and then the publish-subscribe mechanism between each service node and the master node can be established based on the mapping relationship.
[0090] According to the task type of the subtask split by the master node, the hardware units required in the execution process of the subtask can be obtained, and then the service node controlling the hardware units can be determined, and the subtask can be published to the corresponding service node. Specifically, the publishing method of the subtask can be to distribute each subtask to the service node subscribing to the subtask through the master node according to the publish-subscribe mechanism.
[0091] In an embodiment, according to the registration result of each service node, the hardware units associated with each service node are determined, and the publish-subscribe mechanism between each service node and the master node is established based on the associated hardware units. The hardware units required in the execution process of the subtask split by the master node are obtained, and the subtask is published based on the hardware units required in the execution process. According to the publish-subscribe mechanism, the distribution operation of each subtask to the corresponding service node is completed, which can avoid the occupation of program resources in the robot service processing process, and improve the efficiency and accuracy of the robot service processing.
[0092] S106, the robot is controlled by the service node based on the execution timing information to complete each subtask.
[0093] In an embodiment, the service nodes interact through a local network and a protocol, and the same service node processes the same task type, and there is no coupling of program code between the service nodes. The robot control system can control the robot to complete each subtask based on the execution timing information by the service node. Specifically, the execution timing information, i.e., the completion order of each subtask by the service node, can be determined according to the content of the target task and the split subtask, and the service node can complete each subtask in order according to the execution timing information, and then complete the entire target task.
[0094] The technical scheme provided in the embodiment sends a starting instruction to start a master node and at least one service node, wherein each service node is connected with the master node respectively; a connection request of the service node is received through the master node, and the service node is registered according to the connection request and a node ID of the service node; a service instruction is received, and a target task is determined through the master node; the target task is split through the master node to obtain at least one subtask and execution time sequence information between the subtasks; wherein the master node is preconfigured with a protocol rule for splitting the task; the service node corresponding to the subtask is determined through the master node according to the registration result of the service node, and each subtask is respectively distributed to the corresponding service node; and the robot is controlled to complete each subtask through the service node based on the execution time sequence information. Through the above robot service parallel processing method, the problems of poor robot performance, high coupling degree between robot running codes, and great difficulty for a team of developers to develop the robot service node can be solved. The target task is determined through the master node and the at least one service node after the service node is registered and the service instruction is received, the subtask is obtained by splitting the target task through the master node, and each subtask is distributed to the corresponding service node according to the registration result of the service node, and then the robot is controlled to complete each subtask through the service node, so that the business processing performance of the robot can be enhanced, the code coupling degree between the service nodes can be reduced, and the development efficiency of the service node can be improved.
[0095] Embodiment two
[0096] Figure 3 is a flowchart of a robot service parallel processing method provided in embodiment two of the application. As shown in Figure 3 , the method specifically comprises the following steps:
[0097] S201, a starting instruction is sent to start a master node and at least one service node, wherein each service node is connected with the master node respectively;
[0098] S202, a connection request of the service node is received through the master node, and the service node is registered according to the connection request and a node ID of the service node;
[0099] S203, a service instruction is received, and a target task is determined through the master node;
[0100] In an embodiment, optionally, before the service instruction is received and the target task is determined through the master node, the method further comprises:
[0101] obtaining a hardware unit for executing a task of the robot;
[0102] determining a development branch of the service content according to the hardware unit;
[0103] According to the development branch of the business content, a single-branch development mode is adopted to develop the business content.
[0104] In an embodiment, the business content can be a business that can be handled by a robot, and can be determined according to a business handling type of the robot. For example, the business content of a medical robot can be positioning, surgery, imaging, etc.; the business content of a logistics robot can be sorting, carrying, transportation, etc. The development branch of the business content can be a handling branch process of the business content, and the handling branch process is at least one. The robot control system can determine a hardware unit required by the robot when performing a task according to the business handling type of the robot. According to the hardware unit, the development branch of the business content of the robot can be determined, specifically, the same type of hardware unit can be taken as the development branch of the business content of the same robot. The single-branch development mode can be a single-process single-thread development mode, that is, one branch is only responsible for handling one or a type of thing, and different single branches correspond to different business nodes to handle different sub-tasks. The running program of each development branch of the business content can be managed by using git, so that the running program of each development branch is managed and submitted separately, avoiding the problems of code merging and code interaction, so that the developers can develop each branch at the same time. The robot control system can adopt a single-branch development mode according to the development branch of the business content to develop each development branch of the business content.
[0105] In an embodiment, before receiving a business instruction and determining a target task through the master node, the development branch of the business content of the robot is determined by acquiring a hardware unit of the robot performing a task, and the development branch of the business content is developed by adopting a single-branch development mode, and then the development of the business content is performed, which can reduce the coupling degree of the internal running code of the robot, reduce the mutual influence between the business nodes of the robot, and improve the business handling capability of the robot.
[0106] In an embodiment, after the single-branch development mode is adopted according to the development branch of the business content to develop the business content, the method further includes:
[0107] receiving a new requirement of the business content;
[0108] determining a target business branch that needs to be modified based on the new requirement;
[0109] generating a business content addition instruction of the target business branch to adjust the business content of the target business branch;
[0110] publishing the adjusted business content through the master node.
[0111] In an embodiment, after the development of the business content according to the development branch of the business content in a single-branch development mode, a new requirement for the business content can be received. The new requirement can be an externally input requirement for increasing or improving the robot business processing function, and the new requirement can be a requirement related to the development branch of a current business content or a requirement unrelated to the development branch of all current business contents. The target business branch can be a business content development branch related to the new requirement, and the score of the target business branch can be modified based on the program of the target business branch to meet the new requirement. Based on the new requirement content, the target business branch that needs to be modified can be determined, and a business content addition instruction for the target branch can be generated to adjust the business content of the target business branch. Specifically, the adjustment of the business content of the target business branch can be a process of adding the business processing content in the new requirement to the original business content of the target branch to obtain new business content of the target branch. The adjusted business content can be published through the master node. Specifically, the business nodes can subscribe to the adjusted business content of each branch through the master node, and the robot control system can publish the adjusted business content to the corresponding business nodes through the master node after receiving the business processing instruction.
[0112] In an embodiment, after the development of the business content according to the development branch of the business content in a single-branch development mode, a new requirement for the business content can be received. The new requirement can be an externally input requirement for increasing or improving the robot business processing function, and the new requirement can be a requirement related to the development branch of a current business content or a requirement unrelated to the development branch of all current business contents. The target business branch can be a business content development branch related to the new requirement, and the score of the target business branch can be modified based on the program of the target business branch to meet the new requirement. Based on the new requirement content, the target business branch that needs to be modified can be determined, and a business content addition instruction for the target branch can be generated to adjust the business content of the target business branch. Specifically, the adjustment of the business content of the target business branch can be a process of adding the business processing content in the new requirement to the original business content of the target branch to obtain new business content of the target branch. The adjusted business content can be published through the master node. Specifically, the business nodes can subscribe to the adjusted business content of each branch through the master node, and the robot control system can publish the adjusted business content to the corresponding business nodes through the master node after receiving the business processing instruction.
[0113] S204, the target task is split through the master node to obtain at least one subtask and execution timing information between the subtasks; wherein the master node is preconfigured with a protocol rule for splitting tasks;
[0114] S205, according to the registration result of each business node, the master node determines the business node corresponding to the subtask, and respectively distributes each subtask to the corresponding business node;
[0115] S206, the business node controls the robot to complete each subtask based on the execution timing information.
[0116] The technical scheme provided in the embodiments of the present application can reduce the coupling degree of the internal running code of the robot, reduce the mutual influence between the business nodes of the robot, improve the business processing capability of the robot, and improve the development efficiency of the business nodes of the robot.
[0117] Embodiment three
[0118] Figure 4 is a structural schematic diagram of a business parallel processing device of a robot provided in the third embodiment of the present application. As shown in the figure, the device specifically comprises the following: Figure 4
[0119] The starting instruction issuing module 301 is configured to issue a starting instruction to start the master node and at least one business node; wherein each business node is connected with the master node respectively;
[0120] The business node registration module 302 is configured to receive a connection request of a business node through the master node, and register the business node according to the connection request and the node ID of the business node;
[0121] The target task determination module 303 is configured to receive a business instruction, and determine a target task through the master node;
[0122] The target task splitting module 304 is configured to split the target task through the master node to obtain at least one subtask and the execution time sequence information between the subtasks; wherein the master node is preconfigured with a protocol rule for splitting tasks;
[0123] The subtask issuing module 305 is configured to determine the business node corresponding to the subtask through the master node according to the registration result of each business node, and issue each subtask to the corresponding business node respectively;
[0124] The subtask completion module 306 is configured to control the robot to complete each subtask based on the execution time sequence information through the business node.
[0125] Further, the starting instruction issuing module 301 is further configured to:
[0126] The shell script is used for building the master node, and at least one service node is built according to the working parameters of the robot.
[0127] Further, the starting instruction issuing module 301 is specifically used for:
[0128] Obtaining a hardware unit of the robot for executing a task; wherein the hardware unit comprises one or more of a mechanical arm, a base, and a motor;
[0129] According to the number of hardware units, the number of service nodes is determined to build at least one service node.
[0130] Further, the target task splitting module 304 is specifically used for:
[0131] According to a pre-configured protocol rule, a hardware unit required in a target task execution process is determined;
[0132] At a node position where a hardware unit switching occurs in the target task execution process, the target task is split to obtain at least one subtask.
[0133] Further, the subtask issuing module 305 is specifically used for:
[0134] According to a registration result of each service node, a hardware unit associated with each service node is determined to establish a publish-subscribe mechanism between each service node and the master node based on the associated hardware unit;
[0135] Obtaining a hardware unit required in a subtask execution process split from the master node, and publishing the subtask based on the hardware unit required in the execution process;
[0136] According to the publish-subscribe mechanism, a subtask is issued to a corresponding service node.
[0137] Further, the target task determining module 303 is also used for:
[0138] Obtaining a hardware unit of the robot for executing a task;
[0139] According to the hardware unit, a development branch of a service content is determined;
[0140] According to the development branch of the service content, a single-branch development mode is used to develop the service content.
[0141] Further, the target task determining module 303 is specifically used for:
[0142] Receiving a new demand for a service content;
[0143] determine a target service branch that needs to be modified based on the new requirement;
[0144] generate a service content adding instruction of the target service branch to adjust the service content of the target service branch;
[0145] publish the adjusted service content through the master node.
[0146] The technical scheme provided in the embodiment comprises a start instruction issuing module configured to issue a start instruction to start a master node and at least one service node; each service node is connected to the master node; a service node registration module configured to receive a connection request of a service node through the master node, and register the service node according to the connection request and a node ID of the service node; a target task determination module configured to receive a service instruction and determine a target task through the master node; a target task splitting module configured to split the target task through the master node to obtain at least one subtask and execution time sequence information between the subtasks; the master node is pre-configured with a protocol rule for splitting tasks; a subtask issuing module configured to determine a service node corresponding to the subtask through the master node according to a registration result of each service node, and issue each subtask to the corresponding service node; and a subtask completion module configured to control a robot to complete each subtask based on the execution time sequence information through the service node. The above service parallel processing device of the robot can solve the problems of poor performance of the robot, high coupling degree between robot running codes, and high difficulty of team development of the robot service node by a research and development personnel. The master node and the at least one service node are registered and receive a service instruction to determine a target task, the master node splits the target task to obtain a subtask, each subtask is issued to the corresponding service node according to the registration result of each service node, and then the service node controls the robot to complete each subtask, which can enhance the service processing performance of the robot, reduce the code coupling degree between the service nodes, and improve the development efficiency of the service nodes.
[0147] The business parallel processing apparatus of the robot in the embodiments of the present application can be an apparatus, or a component in a terminal, an integrated circuit, or a chip. The apparatus can be a mobile electronic device or a non-mobile electronic device. Exemplarily, the mobile electronic device can be a mobile phone, a tablet computer, a notebook computer, a palm computer, a vehicle-mounted electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), etc., and the non-mobile electronic device can be a server, a network attached storage (NAS), a personal computer (PC), a television (TV), a teller machine, or a self-service machine, etc., which are not limited in the embodiments of the present application.
[0148] The business parallel processing apparatus of the robot in the embodiments of the present application can be an apparatus with an operating system. The operating system can be an Android operating system, an iOS operating system, or other possible operating systems, which are not limited in the embodiments of the present application.
[0149] The business parallel processing apparatus of the robot provided in the embodiments of the present application can implement the method embodiments. Figures 1 to 2 The processes implemented by the method embodiments are not repeated here to avoid repetition.
[0150] Embodiment Four
[0151] As shown in Figure 5 , the embodiments of the present application further provide an electronic device 400, which includes a processor 401, a memory 402, and a program or instructions stored in the memory 402 and executable on the processor 401. The program or instructions are executed by the processor 401 to implement the processes of the above-mentioned business parallel processing method of the robot, and achieve the same technical effects. The processes are not repeated here to avoid repetition.
[0152] It should be noted that the electronic device in the embodiments of the present application includes the above-mentioned mobile electronic device and non-mobile electronic device.
[0153] Embodiment Five
[0154] The embodiments of the present application further provide a readable storage medium, which stores a program or instructions. The program or instructions are executed by a processor to implement the processes of the above-mentioned business parallel processing method of the robot, and achieve the same technical effects. The processes are not repeated here to avoid repetition.
[0155] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0156] Embodiment six
[0157] The embodiment of the application further provides a chip, which comprises a processor and a communication interface, the communication interface is coupled with the processor, the processor is used for running programs or instructions, and each process of the business parallel processing method of the robot is realized, and the same technical effects can be achieved. To avoid repetition, details are not described here.
[0158] It should be understood that the chip mentioned in the embodiment of the application can also be referred to as a system-level chip, a system chip, a chip system, or a system-on-chip chip.
[0159] It should be noted that in this paper, the term "including", "containing" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or device. Without more limitations, the element defined by the statement "including a" does not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the method and device in the embodiment of the application is not limited to the order of functions shown or discussed, and can also include functions performed in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method can be performed in an order different from that described, and various steps can also be added, omitted or combined. In addition, the features described with reference to some examples can be combined in other examples.
[0160] From the above description of the embodiments, those skilled in the art can clearly understand that the above-mentioned embodiment method can be realized by means of software and necessary general hardware platform, of course, it can also be realized by hardware, but in many cases, the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a plurality of instructions for making a terminal (which can be a mobile phone, computer, server, or network equipment, etc.) execute the method described in each embodiment of the present application.
[0161] The embodiments of the present application are described above with reference to the drawings, but the present application is not limited to the specific embodiments described above, and the specific embodiments described above are merely illustrative, but not restrictive, and those of ordinary skill in the art can make many forms without departing from the purpose of the present application and the scope protected by the claims under the inspiration of the present application, which all belong to the protection of the present application.
[0162] The above are only the preferred embodiments of the present application and the technical principles used. The present application is not limited to the specific embodiments described herein, and various obvious changes, readjustments and replacements made by those skilled in the art will not deviate from the scope of protection of the present application. Therefore, although the present application is described in more detail through the above embodiments, the present application is not limited to the above embodiments, and more other equivalent embodiments can be included without departing from the concept of the present application, and the scope of the present application is determined by the scope of the claims.
Claims
1. A business parallel processing method of a robot, characterized by, The method is executed by a robot control system, and the method comprises: issuing a start instruction to start a master node and at least one service node; wherein each service node is connected to the master node respectively; receiving a connection request of the service node through the master node, and registering the service node according to the connection request and the node ID of the service node; receiving a service instruction, and determining a target task through the master node; splitting the target task through the master node to obtain at least one subtask and execution time sequence information between the subtasks; wherein the master node is pre-configured with a protocol rule for splitting a task; determining the hardware unit associated with each service node based on the registration result of each service node, establishing a publish-subscribe mechanism between each service node and the master node based on the associated hardware unit, obtaining the hardware unit required in the execution process of the subtask split by the master node, and publishing the subtask based on the hardware unit required in the execution process, and completing the delivery operation of each subtask to the corresponding service node according to the publish-subscribe mechanism; controlling the robot to complete each subtask based on the execution time sequence information through the service node.
2. The method of claim 1, wherein, Before responding to the start instruction and performing the start operation, the method further comprises: using a shell script to build the master node, and building at least one service node according to the working parameters of the robot.
3. The method of claim 2, wherein, Building at least one service node according to the working parameters of the robot comprises: obtaining the hardware unit of the robot for executing a task; wherein the hardware unit comprises one or more of a mechanical arm, a base and a motor; determining the number of service nodes according to the number of hardware units to build at least one service node.
4. The method of claim 3, wherein, Splitting the target task through the master node to obtain at least one subtask comprises: determining the hardware unit required in the execution process of the target task according to the pre-configured protocol rule; splitting the target task to obtain at least one subtask at the node position where the hardware unit switches during the execution process of the target task.
5. The method of claim 1, wherein, Before receiving the service instruction and determining the target task through the master node, the method further comprises: obtaining the hardware unit of the robot for executing a task; determining the development branch of the service content according to the hardware unit; developing the service content in a single-branch development mode according to the development branch of the service content.
6. The method of claim 5, wherein, After developing the service content in a single-branch development mode according to the development branch of the service content, the method further comprises: receiving a new requirement for the service content; determining the target service branch that needs to be modified based on the new requirement; generating a service content addition instruction of the target service branch to adjust the service content of the target service branch; publishing the adjusted service content through the master node.
7. A business parallel processing device of a robot, characterized by comprising: The device is configured with a robot control system, and the device comprises: a start instruction delivery module for issuing a start instruction to start a master node and at least one service node; wherein each service node is connected to the master node respectively; The service node registration module is configured to receive a connection request of a service node through the master node, and register the service node according to the connection request and a node ID of the service node; The target task determination module is configured to receive a service instruction, and determine a target task through the master node; The target task splitting module is configured to split the target task through the master node to obtain at least one subtask and execution time sequence information between the subtasks; wherein the master node is pre-configured with a protocol rule for splitting tasks; The subtask issuing module is configured to determine a hardware unit associated with each service node according to a registration result of each service node, establish a publish / subscribe mechanism between each service node and the master node based on the associated hardware unit, acquire a hardware unit required in an execution process of the subtask split by the master node, and issue the subtask based on the hardware unit required in the execution process, and complete an issuing operation of each subtask to a corresponding service node according to the publish / subscribe mechanism; The subtask completion module is configured to control a robot to complete each subtask based on the execution time sequence information through the service node.
8. An electronic device, comprising: A processor, a memory, and a program or instructions stored on the memory and executable on the processor are included, and the program or instructions are executed by the processor to implement the steps of the business parallel processing method of the robot according to any one of claims 1-6.
9. A readable storage medium, characterized by, A readable storage medium stores a program or instructions, and the program or instructions are executed by a processor to implement the steps of the business parallel processing method of the robot according to any one of claims 1-6.
Citation Information
Patent Citations
Batch processing method and device, equipment and storage medium
CN112948077A