CN116442214A - Service parallel processing method, device, equipment and medium for robot - Google Patents

Service parallel processing method, device, equipment and medium for robot Download PDF

Info

Publication number
CN116442214A
CN116442214A CN202310254582.5A CN202310254582A CN116442214A CN 116442214 A CN116442214 A CN 116442214A CN 202310254582 A CN202310254582 A CN 202310254582A CN 116442214 A CN116442214 A CN 116442214A
Authority
CN
China
Prior art keywords
service
node
robot
service node
subtask
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310254582.5A
Other languages
Chinese (zh)
Inventor
赖志林
苏青源
杨晓东
李良源
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Saite Intelligent Technology Co Ltd
Original Assignee
Guangzhou Saite Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Saite Intelligent Technology Co Ltd filed Critical Guangzhou Saite Intelligent Technology Co Ltd
Priority to CN202310254582.5A priority Critical patent/CN116442214A/en
Publication of CN116442214A publication Critical patent/CN116442214A/en
Pending legal-status Critical Current

Links

Classifications

    • BPERFORMING OPERATIONS; TRANSPORTING
    • B25HAND TOOLS; PORTABLE POWER-DRIVEN TOOLS; MANIPULATORS
    • B25JMANIPULATORS; CHAMBERS PROVIDED WITH MANIPULATION DEVICES
    • B25J9/00Programme-controlled manipulators
    • B25J9/16Programme controls
    • B25J9/1679Programme controls characterised by the tasks executed
    • BPERFORMING OPERATIONS; TRANSPORTING
    • B25HAND TOOLS; PORTABLE POWER-DRIVEN TOOLS; MANIPULATORS
    • B25JMANIPULATORS; CHAMBERS PROVIDED WITH MANIPULATION DEVICES
    • B25J9/00Programme-controlled manipulators
    • B25J9/16Programme controls
    • B25J9/1602Programme controls characterised by the control system, structure, architecture
    • BPERFORMING OPERATIONS; TRANSPORTING
    • B25HAND TOOLS; PORTABLE POWER-DRIVEN TOOLS; MANIPULATORS
    • B25JMANIPULATORS; CHAMBERS PROVIDED WITH MANIPULATION DEVICES
    • B25J9/00Programme-controlled manipulators
    • B25J9/16Programme controls
    • B25J9/1656Programme controls characterised by programming, planning systems for manipulators
    • B25J9/1661Programme controls characterised by programming, planning systems for manipulators characterised by task planning, object-oriented languages
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]

Abstract

The application discloses a service parallel processing method, device, equipment and medium of a robot, and belongs to the field of artificial intelligence. The method comprises the following steps: sending out a starting instruction to start the main node and at least one service node; receiving a connection request of a service node through a master node, and registering the service node according to the connection request and a 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 main node to obtain at least one sub-task and execution time sequence information among the sub-tasks; determining the service node corresponding to the subtask through the main node according to the registration result of each service node, and issuing the service node to the corresponding service node; and controlling the robot to complete each subtask based on the execution time sequence information through the service node. By the technical scheme, the service processing capacity of the robot and the development efficiency of service nodes by research personnel can be improved.

Description

Service parallel processing method, device, equipment and medium for robot
Technical Field
The application belongs to the technical field of artificial intelligence, and particularly relates to a service parallel processing method, device, equipment and medium of a robot.
Background
With the continuous development of artificial intelligence, more and more fields begin to utilize robots to execute services, and functions and service performances of the robots are also continuously perfected. In order to enable the robot to adapt to more complex task scenes and process more complex businesses, setting a better business processing program for the robot becomes a hot spot for people to study.
Currently, in order to enable a robot to process more tasks and improve the program response speed when the robot processes services, a single-process multi-thread service processing node is usually arranged in the robot. Specifically, the single-process multithreading service processing node generally runs a plurality of different threads in one program at the same time, and different tasks are executed by the plurality of different threads at the same time, so that the purpose of improving the service processing speed of the robot is achieved.
Because the single-process multi-thread service processing nodes share the same set of program, namely the code areas of a plurality of threads are shared, the coupling degree among the codes of the threads is higher, and the interdependence among the codes is more serious. Meanwhile, in order to make the functions of the robot more perfect, the number of threads is required to be increased continuously on the basis of the original codes, so that the performance of the robot is limited, and the difficulty of developing robot teams by research and development personnel is increased. Therefore, the problems of poor robot humanization capability, high coupling degree among robot running codes and high difficulty in team development of the robot service nodes by research personnel exist in the prior art for setting the service processing procedure for the robot.
Disclosure of Invention
The embodiment of the application aims to provide a service parallel processing method, device, equipment and medium for a robot, which can solve the problems of poor robot humanization, higher coupling degree between running codes of the robot and higher difficulty in team development of service nodes of the robot by research personnel, register a main node and at least one service node, receive a service instruction, determine a target task, split the target task by the main node to obtain sub-tasks, and issue each sub-task to a corresponding service node according to a registration result of each service node, so that each sub-task is controlled by the service node to complete the robot, thereby enhancing service processing performance of the robot, reducing the code coupling degree between the service nodes and improving development efficiency of the service nodes.
In a first aspect, an embodiment of the present application provides a method for parallel processing of services of a robot, where the method is performed by a robot control system, and the method includes:
sending out a starting instruction to start the main node and at least one service node; wherein each service node is respectively connected with the main node;
receiving a connection request of a service node through a master node, and registering the service node according to the connection request and a 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 main node to obtain at least one sub-task and execution time sequence information among the sub-tasks; the master node is pre-configured with protocol rules for splitting tasks;
determining service nodes corresponding to the subtasks through the main node according to the registration result of each service node, and respectively issuing each subtask to the corresponding service node;
and controlling the robot to complete each subtask based on the execution time sequence information through the service node.
Further, before performing the start operation in response to the start instruction, the method further includes:
and constructing a master node by adopting the shell script, and constructing at least one service node according to the working parameters of the robot.
Further, building at least one service node according to the working parameters of the robot, including:
acquiring a hardware unit for executing tasks of the robot; the hardware unit comprises one or more of a mechanical arm, a base and a motor;
and determining the number of service nodes according to the number of the hardware units so as to build at least one service node.
Further, splitting the target task by the master node to obtain at least one subtask, including:
determining a hardware unit required in the execution process of the target task according to a pre-configured protocol rule;
and splitting the target task at the node position where the hardware unit is switched in the execution process of the target task to obtain at least one subtask.
Further, according to the registration result of each service node, determining the service node corresponding to the subtask by the master node, and respectively issuing each subtask to the corresponding service node, including:
determining hardware units associated with each service node according to the registration result of each service node, and establishing a publishing and subscribing mechanism between each service node and a main node based on the hardware units obtained by association;
acquiring a hardware unit required in the execution process of the subtask obtained by splitting the main node, and issuing the subtask based on the hardware unit required in the execution process;
and completing the issuing operation of each subtask to the corresponding service node according to the publishing and subscribing mechanism.
Further, before receiving the service instruction and determining the target task by the master node, the method further includes:
Acquiring a hardware unit for executing tasks of the robot;
determining a development branch of the service content according to the hardware unit;
and developing the service content by adopting a single-branch development mode according to the development branch of the service content.
Further, after the development of the service content is performed by adopting a single-branch development mode according to the development branch of the service content, the method further comprises:
receiving a new requirement of the business content;
determining a target business branch to be modified based on the newly added demand;
generating a service content newly-added instruction of a target service branch so as to adjust the service content of the target service branch;
and distributing the adjusted business content through the master node.
In a second aspect, an embodiment of the present application provides a service parallel processing apparatus of a robot, where the apparatus includes:
the starting instruction issuing module is used for issuing a starting instruction to start the main node and at least one service node; wherein each service node is respectively connected with the main node;
the service node registration module is used for 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;
The target task determining module is used for receiving the service instruction and determining a target task through the main node;
the target task splitting module is used for splitting the target task through the main node to obtain at least one sub-task and execution time sequence information among the sub-tasks; the master node is pre-configured with protocol rules for splitting tasks;
the subtask issuing module is used for determining the service node corresponding to the subtask through the main node according to the registration result of each service node and issuing each subtask to the corresponding service node respectively;
and the subtask completion module is used for controlling the robot to complete each subtask based on the execution time sequence information through the service node.
In a third aspect, embodiments of the present application provide an electronic device comprising a processor, a memory and a program or instruction stored on the memory and executable on the processor, the program or instruction implementing the steps of the method according to the first aspect when executed by the processor.
In a fourth aspect, embodiments of the present application provide a readable storage medium having stored thereon a program or instructions which when executed by a processor implement the steps of the method according to the first aspect.
In a fifth aspect, embodiments of the present application provide a chip, where the chip includes a processor and a communication interface, where the communication interface is coupled to the processor, and where the processor is configured to execute a program or instructions to implement a method according to the first aspect.
In the embodiment of the application, a starting instruction is sent out to start a main node and at least one service node; wherein each service node is respectively connected with the main node; receiving a connection request of a service node through a master node, and registering the service node according to the connection request and a 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 main node to obtain at least one sub-task and execution time sequence information among the sub-tasks; the master node is pre-configured with protocol rules for splitting tasks; determining service nodes corresponding to the subtasks through the main node according to the registration result of each service node, and respectively issuing each subtask to the corresponding service node; and controlling the robot to complete each subtask based on the execution time sequence information through the service node. The service parallel processing method of the robot can solve the problems of poor robot performance, high coupling degree between robot operation codes and high difficulty in team development of service nodes of the robot by research personnel, registers and receives service instructions by a main node and at least one service node, determines a target task, splits the target task by the main node to obtain sub-tasks, and issues the sub-tasks to corresponding service nodes according to registration results of the service nodes, so that the service nodes control the robot to complete the sub-tasks, service processing performance of the robot can be enhanced, the code coupling degree between the service nodes can be reduced, and development efficiency of the service nodes can be improved.
Drawings
Fig. 1 is a schematic diagram of an internal structure of service parallel processing of a robot provided in the present application.
Fig. 2 is a flow chart of a method for parallel processing of services of a robot according to an embodiment of the present application;
fig. 3 is a flow chart of a method for parallel processing of services of a robot according to a second embodiment of the present application;
fig. 4 is a schematic structural diagram of a service parallel processing device of a robot according to a third embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present application more apparent, the following detailed description of specific embodiments thereof is given with reference to the accompanying drawings. It is to be understood that the specific embodiments described herein are merely illustrative of the application and not limiting thereof. It should be further noted that, for convenience of description, only some, but not all of the matters related to the present application are shown in the accompanying drawings. Before discussing exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart depicts operations (or steps) as a sequential process, many of the operations can be performed in parallel, concurrently, or at the same time. Furthermore, the order of the operations may be rearranged. The process may be terminated when its operations are completed, but may have additional steps not included in the figures. The processes may correspond to methods, functions, procedures, subroutines, and the like.
Technical solutions in the embodiments of the present application will be clearly described below with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present application are within the scope of the protection of the present application.
The terms first, second and the like in the description and in the claims, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged, as appropriate, such that embodiments of the present application may be implemented in sequences other than those illustrated or described herein, and that the objects identified by "first," "second," etc. are generally of a type and not limited to the number of objects, e.g., the first object may be one or more. Furthermore, in the description and claims, "and/or" means at least one of the connected objects, and the character "/", generally means that the associated object is an "or" relationship.
The method, the device, the equipment and the medium for parallel processing of the service of the robot provided by the embodiment of the application are described in detail through specific embodiments and application scenes thereof with reference to the accompanying drawings.
Example 1
Fig. 1 is a schematic diagram of an internal structure of service parallel processing of a robot provided in the present application.
Fig. 2 is a flow chart of a method for parallel processing of services of a robot according to an embodiment of the present application. The method is performed by a robotic control system. As shown in fig. 2, the method specifically comprises the following steps:
s101, sending out a starting instruction to start a main node and at least one service node; wherein each service node is respectively connected with the main node;
firstly, the use scenario of the solution may be a scenario in which the service processing function of the robot needs to be improved, and in particular, may be a scenario in which the service processing node of the single process of the robot is improved. By increasing the number of service processing nodes of the robot, the coupling degree between service processing codes of the robot can be reduced, and the service processing capacity of the robot can be improved.
Based on the above usage scenario, it can be appreciated that the execution subject of the present application may be a robot control system with information receiving, information processing and encoding capabilities, such as: upper computer, etc., and is not limited herein.
In an embodiment, the start-up instruction may be an instruction to start or run the robot, for example: a power-on instruction, etc. The master node may be a master node in the internal system of the robot, which is used for receiving and forwarding an external input instruction or information, and the service node may be a node for controlling the execution terminal of the robot to enable the execution terminal to execute a task, or may be a node for processing and forwarding the received instruction, data, information, and the like. The main node is started before the service nodes, and can be connected with a plurality of different service nodes at the same time, so that the task to be processed is forwarded to the different service nodes according to the task type and the task content; and after receiving the task forwarded by the main node, the service node controls the corresponding execution terminal to execute the task or directly process the task, and after the task processing is finished, the execution terminal or the processed data result can be forwarded back to the main node. After receiving an externally input task instruction, the robot control system sends a starting instruction to the robot through a program code so as to start a main node and at least one service node of the robot, wherein each service node is connected with the main node through different processes.
Different service nodes have different service processing functions, and the service processing capacity of the robot can be improved by developing and creating a plurality of service nodes with different functions and connecting the service nodes with the main node. For example: one service node can process 10 services, and by creating N service nodes and simultaneously starting and connecting the N service nodes to the master node, the robot can have N service processing functions and can process 10N services.
In an embodiment, optionally, before performing the start operation in response to the start instruction, the method further comprises:
and constructing a master node by adopting the shell script, and constructing at least one service node according to the working parameters of the robot.
In one embodiment, the script may be a program stored in plain text, a bar of text commands that can be viewed, edited, etc., and when executed, the script program is translated by an interpreter of the system into machine-recognizable instructions and executed in program order. A shell is a command interpreter that can operate and control an operating system through shell commands, and start, pause, and stop the running of programs or control a computer by accepting shell commands input by a user. The shell script is an execution file composed of shell commands, some commands are integrated into one file, business logic is processed, the operation is interpreted and executed through an interpreter, the most important of the shell script is the use and combination of the shell commands, and the required functions are completed by using some language characteristics supported by the shell script.
The working parameters of the robot may include parameters of the robot's own configuration, parameters of the type of task that can be performed, etc., such as: the terminal of the robot executes the tool configuration parameters, the parameters for executing the tool control, and the like. The shell script can support more operation commands and more execution functions of the node program, and the like, so that the shell script can be adopted to build a main node and at least one service node according to the working parameters of the robot before the starting operation is executed in response to the starting command. Specifically, the building mode of the master node by adopting the shell script may be that the master node is written and developed by using code languages such as C++, the shell script is used as a program script for starting the master node when the machine is started, and the program script is resident in the background of the robot control system. And determining the task type of the robot according to the working parameters of the robot, further determining service nodes required by executing the task type, wherein the content of the task executed by different service nodes is different, and the different service nodes are respectively connected with the master node based on a publishing and subscribing mode. Thus, the number of service nodes is at least one and the service nodes can be built by a shall script and connected with the master node.
In an embodiment, before the starting operation is executed in response to the starting instruction, the shell script is adopted to build the master node, and at least one service node is built according to the working parameters of the robot, so that binding of the master node and the service node can be facilitated, and the efficiency of connecting the service node and the master node is improved.
In an embodiment, optionally, building at least one service node according to the working parameters of the robot includes:
acquiring a hardware unit for executing tasks of the robot; the hardware unit comprises one or more of a mechanical arm, a base and a motor;
and determining the number of service nodes according to the number of the hardware units so as to build at least one service node.
In an embodiment, the hardware unit may be a hardware execution tool that is required by the robot when executing the task instruction, including one or more of a mechanical arm, a base, and a motor. The hardware unit may determine, according to the type of task performed by the robot, for example: the cleaning robot needs to perform tasks such as cleaning, garbage collection and walking, and the hardware units of the cleaning robot comprise a mechanical arm for cleaning and garbage collection, a base for controlling walking, a motor and other hardware units. The service nodes are used for controlling the hardware units and returning data fed back by the hardware units, so that the number of the service nodes is at least one, and the more the number of the service nodes is, the more task types the robot can execute, namely the stronger the service processing capacity of the robot is. According to the number of the hardware units, the number of task types which can be executed by the robot can be determined, the number of service nodes is further determined according to the number of the task types, and at least one service node is built according to the number of the service nodes.
In an embodiment, by acquiring hardware units of the robot for executing tasks and determining the number of service nodes according to the number of the hardware units, at least one service node is built, so that the convenience and accuracy of building the service nodes can be improved, and further the service processing efficiency of the service nodes is improved.
S102, receiving a connection request of a service node through a main node, and registering the service node according to the connection request and a node ID of the service node;
in an embodiment, the node ID of the service node may be a number capable of distinguishing the node from other nodes, and the node ID may include an identity of the service node, a service processing type, and a controlled terminal execution tool type, and the node ID may be composed of one or more of a number, a symbol, and a letter. After the robot control system sends out a starting instruction and starts a main node and at least one service node, the service node actively sends out a connection request connected with the main node, the robot control system receives the connection request of the service node through the main 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 service node registration may be to enable the service node to correspond to the master node, so that the master node may allocate the received task to the corresponding service node according to the task type. The registration information of the service node may include a name of the service node, a connection mode of the service node and the master node, a connection process code, and the like, which are not limited herein. The master node stores the registration information internally using a mapping mechanism.
S103, receiving a service instruction, and determining a target task through the master node;
in an embodiment, the service instruction may be an instruction externally input to the robot control system. Specifically, the service instruction may include service content and service type that can be processed by the service node of the robot, and may also include service content that cannot be processed by the service node of the robot. The target task may be a service that can be executed or processed by the service node in the service instruction, and the robot control system may receive an externally input service instruction through a background or a display interface of the robot control system, and determine, through registration information of the service node stored in the master node, a target task that can be processed by the service node in the service instruction.
S104, splitting the target task through the main node to obtain at least one sub-task and execution time sequence information among the sub-tasks; the master node is pre-configured with protocol rules for splitting tasks;
in an embodiment, the subtasks may be part or all of the target tasks, and the subtasks may be processed by corresponding service nodes. The execution time sequence information between the subtasks may be information such as execution time length and execution sequence of the subtasks, for example: the execution time sequence information of the transfer robot may include sub-task execution sequence information, such as a task of carrying up the article by using the mechanical arm, a task of transporting by using the chassis, a task of putting down the article by using the mechanical arm again after reaching the target position, and time length information used for executing each sub-task. The protocol rule for splitting the task may be a protocol rule for splitting and distributing the target task to the corresponding service node according to the service processing type of the service node and the hardware unit controlled by the service node, for example: JSON or XML, etc. Splitting the target task through a protocol rule of a splitting task and registration information of a service node which are pre-configured in the main node to obtain at least one sub-task, and determining execution time sequence information among the sub-tasks according to the content of the target task and the type of each service node.
In an embodiment, optionally, splitting, by the master node, the target task to obtain at least one subtask includes:
determining a hardware unit required in the execution process of the target task according to a pre-configured protocol rule;
and splitting the target task at the node position where the hardware unit is switched in the execution process of the target task to obtain at least one subtask.
In an embodiment, the hardware unit required in the execution process of the target task may be determined according to the protocol rule pre-configured in the master node and the task content of the target task, and the same hardware unit may be used multiple times in the execution process of the target task. Different hardware units are controlled by different service nodes, namely, different hardware units correspond to different service nodes, if switching of the hardware units occurs in the execution process of the target task, namely, adjacent hardware units are different, the switching of the service nodes is indicated, and the switching position of the hardware units is the switching position of the service nodes. Therefore, the target task can be split according to the node position where the hardware unit is switched in the execution process of the target task, and at least one subtask is obtained.
In an embodiment, by determining a hardware unit required in the execution process of the target task according to a pre-configured protocol rule, splitting the target task at a node position where the hardware unit is switched in the execution process of the target task, so as to obtain at least one subtask, the accuracy of splitting the target task can be improved, and further, the efficiency of service processing of the service node of the robot is improved.
S105, determining the service node corresponding to the subtask through the main node according to the registration result of each service node, and respectively issuing each subtask to the corresponding service node;
in an embodiment, the registration result of each service node may include a result of whether each service node successfully registers with the master node and registration information of the service node that successfully registers. The registration information may include a name of a service node, a type of service handled, a connection manner with the master node, a connection process code, and the like. Specifically, the registration result of each service node may be a result of whether the master node can be connected with the service node and split and transmit the received task information to the corresponding service node, or may be a result of whether the service node can receive and process the subtasks forwarded by the master node and transmit the processing result data back to the master node. If the service node and the master node are successfully registered, the master node can store the registration information of the service node. The robot control system can determine whether the subtasks have corresponding service nodes according to the registration results of the service nodes, determine the service nodes corresponding to the subtasks according to the registration information of the service nodes stored in the main node, and respectively issue the subtasks to the corresponding service nodes. And the main node program can store the registration result of the service node with the mapping relation with the main node by utilizing the MAP data structure. The mapping relationship may be a relationship that the service processing type of each service node corresponds to the service received by the master node.
In an embodiment, optionally, according to a registration result of each service node, determining, by the master node, a service node corresponding to the subtask, and respectively issuing each subtask to the corresponding service node, including:
determining hardware units associated with each service node according to the registration result of each service node, and establishing a publishing and subscribing mechanism between each service node and a main node based on the hardware units obtained by association;
acquiring a hardware unit required in the execution process of the subtask obtained by splitting the main node, and issuing the subtask based on the hardware unit required in the execution process;
and completing the issuing operation of each subtask to the corresponding service node according to the publishing and subscribing mechanism.
In an embodiment, the publishing and subscribing mechanism may be a mapping mechanism between the service node and the master node, and specifically may be a mechanism that the service node sends a subscribing request to the master node according to its own service processing type, and the master node publishes each subtask to a corresponding node according to the subscribing request of the service node. According to the registration result of each service node stored in the master node, the hardware unit controlled by each service node can be determined, and the hardware unit can comprise hardware with the same function and different models. The task processing type of each service node can be determined based on the determined hardware unit, the mapping relation between each service node and the main node is determined according to the task processing type of each service node, and then a publishing and subscribing mechanism between each service node and the main node can be established based on the mapping relation.
According to the task type of the subtask obtained by splitting the main node, a hardware unit required in the execution process of the subtask can be obtained, further, a service node for controlling the hardware unit can be determined, and the subtask is issued to the corresponding service node. Specifically, the publishing mode of the subtasks may be that each subtask is issued to a service node subscribing the subtask through the main node according to the publishing subscription mechanism.
In an embodiment, according to the registration result of each service node, determining the hardware unit associated with each service node, so as to establish a publishing and subscribing mechanism between each service node and the main node based on the associated hardware unit, obtain the hardware unit required in the execution process of splitting and obtaining the subtasks by the main node, and publish the subtasks based on the hardware unit required in the execution process, and finish the issuing operation of each subtask to the corresponding service node according to the publishing and subscribing mechanism, thereby avoiding the preemption of program resources in the service processing process of the robot and improving the efficiency and accuracy of the service processing of the robot.
S106, controlling the robot to complete each subtask based on the execution time sequence information through the service node.
In an embodiment, the service nodes interact with each other through a local network and a protocol, and the same service nodes process the same task type, and no program code is coupled between the service nodes. The robot control system can control the robot to complete each subtask based on the execution time sequence information through the service node. Specifically, the execution time sequence information may be determined according to the content of the target task and the split sub-tasks, that is, the completion sequence of each sub-task completed by the service node, and the service node may be controlled to complete each sub-task according to the execution time sequence information, so as to complete the whole target task.
According to the technical scheme provided by the embodiment, a starting instruction is sent out to start the main node and at least one service node; wherein each service node is respectively connected with the main node; receiving a connection request of a service node through a master node, and registering the service node according to the connection request and a 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 main node to obtain at least one sub-task and execution time sequence information among the sub-tasks; the master node is pre-configured with protocol rules for splitting tasks; determining service nodes corresponding to the subtasks through the main node according to the registration result of each service node, and respectively issuing each subtask to the corresponding service node; and controlling the robot to complete each subtask based on the execution time sequence information through the service node. The service parallel processing method of the robot can solve the problems of poor robot performance, high coupling degree between robot operation codes and high difficulty in team development of service nodes of the robot by research personnel, registers and receives service instructions by a main node and at least one service node, determines a target task, splits the target task by the main node to obtain sub-tasks, and issues the sub-tasks to corresponding service nodes according to registration results of the service nodes, so that the service nodes control the robot to complete the sub-tasks, service processing performance of the robot can be enhanced, the code coupling degree between the service nodes can be reduced, and development efficiency of the service nodes can be improved.
Example two
Fig. 3 is a flow chart of a method for parallel processing of services of a robot according to a second embodiment of the present application. As shown in fig. 3, the method specifically comprises the following steps:
s201, sending out a starting instruction to start a main node and at least one service node; wherein each service node is respectively connected with the main node;
s202, receiving a connection request of a service node through a main node, and registering the service node according to the connection request and a node ID of the service node;
s203, receiving a service instruction, and determining a target task through the master node;
in an embodiment, optionally, before receiving the service instruction, determining, by the master node, the target task, the method further includes:
acquiring a hardware unit for executing tasks of the robot;
determining a development branch of the service content according to the hardware unit;
and developing the service content by adopting a single-branch development mode according to the development branch of the service content.
In an embodiment, the service content may be a service that can be processed by a robot, and may be determined according to a service processing type of the robot. For example: the business content of the medical robot can be positioning, operation, imaging and the like; the business content of the logistics robot can be sorting, carrying, transporting and the like. The development branch of the service content may be a processing branch process of the service content, and the processing branch process is at least one. The robot control system can determine the hardware unit required by the robot when the robot executes the task according to the service processing type of the robot. According to the hardware unit, a development branch of the service content of the robot can be determined, and specifically, the same type of hardware unit can be used as the development branch of the service content of the same robot. The single-branch development mode can be a development mode of single-process single-thread, namely, one branch is only responsible for processing one item or one kind of things, and different single branches respectively correspond to different service nodes and are used for processing different subtasks. The system can utilize git to carry out code management on the operation programs of the development branches of the business contents, so that the operation programs of each development branch are independently managed and submitted, the problems of code combination and code interaction are avoided, and research personnel can develop all branches simultaneously. The robot control system can develop the service content by adopting a single-branch development mode for each development branch according to the development branch of the service content.
In an embodiment, before a target task is determined by the master node, a development branch of the service content of the robot is determined by acquiring a hardware unit of the execution task of the robot, and the development branch of the service content is developed by adopting a single-branch development mode, so that the service content is developed, the coupling degree of an internal operation code of the robot can be reduced, the interaction among service nodes of the robot is reduced, and the service processing capability of the robot is improved.
In an embodiment, optionally, after the developing of the service content according to the developing branch of the service content using the single-branch developing mode, the method further includes:
receiving a new requirement of the business content;
determining a target business branch to be modified based on the newly added demand;
generating a service content newly-added instruction of a target service branch so as to adjust the service content of the target service branch;
and distributing the adjusted business content through the master node.
In an embodiment, after the development of the service content is performed according to the development branch of the service content by adopting a single-branch development mode, the new requirement of the service content may be received. The new requirements may be requirements input externally for adding or perfecting the service processing functions of the robot, and the new requirements may be requirements related to development branches of a certain current service content, or requirements unrelated to development branches of all current service content. The target business branch may be a business content development branch related to the new demand, and the score of the new demand may be modified on the basis of the program of the business content development branch. And determining a target service branch to be modified based on the newly-increased demand content, and generating a service content newly-increased instruction for the target branch so as to adjust the service content of the target service branch. Specifically, the service content adjustment of the target service branch may be a process of adding the service processing content in the new requirement to the original service content of the target branch to obtain the new service content of the target service branch. The adjusted service content is issued by the master node, specifically, the service node subscribes the service content of each branch after adjustment by the master node, and the robot control system issues the adjusted service content to the corresponding service node by the master node after receiving the service processing instruction.
In an embodiment, after the development of the service content is performed according to the development branch of the service content by adopting a single-branch development mode, a target service branch to be modified is determined based on the new requirement by receiving the new requirement of the service content, and a service content new instruction of the target service branch is generated to perform service content adjustment of the target service branch, so that the main node issues the adjusted service content, thereby improving the development efficiency of the service node of the robot and the convenience of development of a robot team by a developer.
S204, splitting the target task through the main node to obtain at least one sub-task and execution time sequence information among the sub-tasks; the master node is pre-configured with protocol rules for splitting tasks;
s205, determining the service node corresponding to the subtask through the main node according to the registration result of each service node, and respectively issuing each subtask to the corresponding service node;
s206, controlling the robot to complete each subtask based on the execution time sequence information through the service node.
According to the technical scheme provided by the embodiment of the application, before a service instruction is received and a target task is determined through the main node, a development branch of service content of the robot is determined by acquiring a hardware unit of an execution task of the robot, and the development branch of the service content is developed by adopting a single-branch development mode, so that the development of the service content is performed; after the service content is developed according to the development branches of the service content by adopting a single branch development mode, a new demand of the service content is received, a target service branch to be modified is determined based on the new demand, and a service content new instruction of the target service branch is generated so as to adjust the service content of the target service branch, and further the adjusted service content is issued through the main node, so that the coupling degree of the running codes in the robot can be reduced, the mutual influence among service nodes of the robot is reduced, the service processing capacity of the robot is improved, and the development efficiency of the service nodes of the robot is improved.
Example III
Fig. 4 is a schematic structural diagram of a service parallel processing device of a robot according to a third embodiment of the present application. As shown in fig. 4, the method specifically includes the following steps:
a start instruction issuing module 301, configured to issue a start instruction to start the master node and at least one service node; wherein each service node is respectively connected with the main node;
a service node registration module 302, configured to receive a connection request of a service node through a master node, and register the service node according to the connection request and a node ID of the service node;
a target task determining module 303, configured to receive a service instruction, and determine a target task through the master node;
the target task splitting module 304 is configured to split the target task through the master node to obtain at least one subtask and execution timing information between the subtasks; the master node is pre-configured with protocol rules for splitting tasks;
a subtask issuing module 305, configured to determine, according to a registration result of each service node, a service node corresponding to the subtask through the master node, and issue each subtask to the corresponding service node respectively;
And the subtask completion module 306 is configured to control, by the service node, the robot to complete each subtask based on the execution timing information.
Further, the start instruction issuing module 301 is further configured to:
and constructing a master node by adopting the shell script, and constructing at least one service node according to the working parameters of the robot.
Further, the start instruction issuing module 301 is specifically configured to:
acquiring a hardware unit for executing tasks of the robot; the hardware unit comprises one or more of a mechanical arm, a base and a motor;
and determining the number of service nodes according to the number of the hardware units so as to build at least one service node.
Further, the target task splitting module 304 is specifically configured to:
determining a hardware unit required in the execution process of the target task according to a pre-configured protocol rule;
and splitting the target task at the node position where the hardware unit is switched in the execution process of the target task to obtain at least one subtask.
Further, the subtask issuing module 305 is specifically configured to:
determining hardware units associated with each service node according to the registration result of each service node, and establishing a publishing and subscribing mechanism between each service node and a main node based on the hardware units obtained by association;
Acquiring a hardware unit required in the execution process of the subtask obtained by splitting the main node, and issuing the subtask based on the hardware unit required in the execution process;
and completing the issuing operation of each subtask to the corresponding service node according to the publishing and subscribing mechanism.
Further, the target task determining module 303 is further configured to:
acquiring a hardware unit for executing tasks of the robot;
determining a development branch of the service content according to the hardware unit;
and developing the service content by adopting a single-branch development mode according to the development branch of the service content.
Further, the target task determining module 303 is specifically configured to:
receiving a new requirement of the business content;
determining a target business branch to be modified based on the newly added demand;
generating a service content newly-added instruction of a target service branch so as to adjust the service content of the target service branch;
and distributing the adjusted business content through the master node.
According to the technical scheme provided by the embodiment, the starting instruction issuing module is used for issuing a starting instruction to start the main node and at least one service node; wherein each service node is respectively connected with the main node; the service node registration module is used for 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; the target task determining module is used for receiving the service instruction and determining a target task through the main node; the target task splitting module is used for splitting the target task through the main node to obtain at least one sub-task and execution time sequence information among the sub-tasks; the master node is pre-configured with protocol rules for splitting tasks; the subtask issuing module is used for determining the service node corresponding to the subtask through the main node according to the registration result of each service node and issuing each subtask to the corresponding service node respectively; and the subtask completion module is used for controlling the robot to complete each subtask based on the execution time sequence information through the service node. The service parallel processing device of the robot can solve the problems of poor robot performance, high coupling degree between robot running codes and high difficulty in team development of service nodes of the robot by research personnel, registers and receives service instructions by the main node and at least one service node, determines target tasks, splits the target tasks by the main node to obtain sub-tasks, and issues the sub-tasks to corresponding service nodes according to registration results of the service nodes, so that the service nodes control the robot to complete the sub-tasks, service processing performance of the robot can be enhanced, the code coupling degree between the service nodes can be reduced, and development efficiency of the service nodes can be improved.
The service parallel processing device of the robot in the embodiment of the application can be a device, and also can be a component, an integrated circuit or a chip in a terminal. The device may be a mobile electronic device or a non-mobile electronic device. By way of example, the mobile electronic device may be a cell phone, tablet computer, notebook computer, palm computer, vehicle-mounted electronic device, wearable device, ultra-mobile personal computer (ultra-mobile personal computer, UMPC), netbook or personal digital assistant (personal digital assistant, PDA), etc., and the non-mobile electronic device may be a server, network attached storage (Network Attached Storage, NAS), personal computer (personal computer, PC), television (TV), teller machine or self-service machine, etc., and the embodiments of the present application are not limited in particular.
The service parallel processing device of a robot in the embodiment of the present application may be a device with an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiments of the present application.
The service parallel processing device of the robot provided in the embodiment of the present application can implement each process implemented by the method embodiments of fig. 1 to fig. 2, and in order to avoid repetition, a description is omitted here.
Example IV
As shown in fig. 5, the embodiment of the present application further provides an electronic device 400, which includes a processor 401, a memory 402, and a program or an instruction stored in the memory 402 and capable of running on the processor 401, where the program or the instruction implements each process of the foregoing embodiment of the service parallel processing method of a robot when executed by the processor 401, and the process can achieve the same technical effect, so that repetition is avoided, and no further description is given here.
The electronic device in the embodiment of the application includes the mobile electronic device and the non-mobile electronic device described above.
Example five
The embodiment of the present application further provides a readable storage medium, where a program or an instruction is stored on the readable storage medium, and when the program or the instruction is executed by a processor, the processes of the embodiment of the service parallel processing method of a robot are implemented, and the same technical effects can be achieved, so that repetition is avoided, and no redundant description is provided herein.
Wherein the processor is a processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium such as a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk or an optical disk, and the like.
Example six
The embodiment of the application further provides a chip, the chip includes a processor and a communication interface, the communication interface is coupled with the processor, the processor is used for running a program or an instruction, each process of the embodiment of the service parallel processing method of the robot is implemented, the same technical effect can be achieved, and in order to avoid repetition, the description is omitted here.
It should be understood that the chips referred to in the embodiments of the present application may also be referred to as system-on-chip chips, chip systems, or system-on-chip chips, etc.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element. Furthermore, it should be noted that the scope of the methods and apparatus in the embodiments of the present application is not limited to performing the functions in the order shown or discussed, but may also include performing the functions in a substantially simultaneous manner or in an opposite order depending on the functions involved, e.g., the described methods may be performed in an order different from that described, and various steps may also be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solutions of the present application may be embodied essentially or in a part contributing to the prior art in the form of a computer software product stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk), comprising several instructions for causing a terminal (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the methods described in the embodiments of the present application.
The embodiments of the present application have been described above with reference to the accompanying drawings, but the present application is not limited to the above-described embodiments, which are merely illustrative and not restrictive, and many forms may be made by those of ordinary skill in the art without departing from the spirit of the present application and the scope of the claims, which are also within the protection of the present application.
The foregoing description is only of the preferred embodiments of the present application and the technical principles employed. The present application is not limited to the specific embodiments described herein, but is capable of numerous obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the present application. Therefore, while the present application has been described in connection with the above embodiments, the present application is not limited to the above embodiments, but may include many other equivalent embodiments without departing from the spirit of the present application, and the scope of the present application is determined by the scope of the claims.

Claims (10)

1. A method of parallel processing of services by a robot, the method being performed by a robot control system, the method comprising:
sending out a starting instruction to start the main node and at least one service node; wherein each service node is respectively connected with the main node;
receiving a connection request of a service node through a master node, and registering the service node according to the connection request and a 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 main node to obtain at least one sub-task and execution time sequence information among the sub-tasks; the master node is pre-configured with protocol rules for splitting tasks;
Determining service nodes corresponding to the subtasks through the main node according to the registration result of each service node, and respectively issuing each subtask to the corresponding service node;
and 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 prior to performing the boot operation in response to the boot instruction, the method further comprises:
and constructing a master node by adopting the shell script, and constructing at least one service node according to the working parameters of the robot.
3. The method according to claim 2, characterized in that the building of at least one service node according to the working parameters of the robot comprises:
acquiring a hardware unit for executing tasks of the robot; the hardware unit comprises one or more of a mechanical arm, a base and a motor;
and determining the number of service nodes according to the number of the hardware units so as to build at least one service node.
4. A method according to claim 3, wherein splitting the target task by the master node results in at least one sub-task, comprising:
Determining a hardware unit required in the execution process of the target task according to a pre-configured protocol rule;
and splitting the target task at the node position where the hardware unit is switched in the execution process of the target task to obtain at least one subtask.
5. The method according to claim 1, wherein determining, by the master node, the service node corresponding to the subtask according to the registration result of each service node, and respectively issuing each subtask to the corresponding service node, includes:
determining hardware units associated with each service node according to the registration result of each service node, and establishing a publishing and subscribing mechanism between each service node and a main node based on the hardware units obtained by association;
acquiring a hardware unit required in the execution process of the subtask obtained by splitting the main node, and issuing the subtask based on the hardware unit required in the execution process;
and completing the issuing operation of each subtask to the corresponding service node according to the publishing and subscribing mechanism.
6. The method of claim 1, wherein prior to receiving a business instruction, determining, by the master node, a target task, the method further comprises:
Acquiring a hardware unit for executing tasks of the robot;
determining a development branch of the service content according to the hardware unit;
and developing the service content by adopting a single-branch development mode according to the development branch of the service content.
7. The method according to claim 6, wherein after the development of the service contents is performed in the single-branch development mode according to the development branches of the service contents, the method further comprises:
receiving a new requirement of the business content;
determining a target business branch to be modified based on the newly added demand;
generating a service content newly-added instruction of a target service branch so as to adjust the service content of the target service branch;
and distributing the adjusted business content through the master node.
8. A service parallel processing apparatus of a robot, the apparatus being configured with a robot control system, the apparatus comprising:
the starting instruction issuing module is used for issuing a starting instruction to start the main node and at least one service node; wherein each service node is respectively connected with the main node;
the service node registration module is used for 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;
The target task determining module is used for receiving the service instruction and determining a target task through the main node;
the target task splitting module is used for splitting the target task through the main node to obtain at least one sub-task and execution time sequence information among the sub-tasks; the master node is pre-configured with protocol rules for splitting tasks;
the subtask issuing module is used for determining the service node corresponding to the subtask through the main node according to the registration result of each service node and issuing each subtask to the corresponding service node respectively;
and the subtask completion module is used for controlling the robot to complete each subtask based on the execution time sequence information through the service node.
9. An electronic device comprising a processor, a memory and a program or instruction stored on the memory and executable on the processor, which when executed by the processor, implements the steps of the method for parallel processing of traffic of a robot according to any of claims 1-7.
10. A readable storage medium, characterized in that the readable storage medium has stored thereon a program or instructions which, when executed by a processor, implement the steps of the method for parallel processing of traffic of a robot according to any of claims 1-7.
CN202310254582.5A 2023-03-15 2023-03-15 Service parallel processing method, device, equipment and medium for robot Pending CN116442214A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310254582.5A CN116442214A (en) 2023-03-15 2023-03-15 Service parallel processing method, device, equipment and medium for robot

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310254582.5A CN116442214A (en) 2023-03-15 2023-03-15 Service parallel processing method, device, equipment and medium for robot

Publications (1)

Publication Number Publication Date
CN116442214A true CN116442214A (en) 2023-07-18

Family

ID=87119246

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310254582.5A Pending CN116442214A (en) 2023-03-15 2023-03-15 Service parallel processing method, device, equipment and medium for robot

Country Status (1)

Country Link
CN (1) CN116442214A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117591565A (en) * 2024-01-19 2024-02-23 深圳市极限网络科技有限公司 Instance processing method, instance processing device and storage medium for virtual robot

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117591565A (en) * 2024-01-19 2024-02-23 深圳市极限网络科技有限公司 Instance processing method, instance processing device and storage medium for virtual robot

Similar Documents

Publication Publication Date Title
CN107391114B (en) Page visual rendering method and device
CA2657233C (en) Distributing services in graph-based computations
JP4536817B2 (en) Dynamic relocation of workflow by end user
CN111399897A (en) Application issuing method and system based on kubernets
CN109040152B (en) Service request and providing method and device based on service arrangement and electronic equipment
CN104813318B (en) The technology that message is grouped based on context for translation
JP2018200686A (en) Approval method and system using messenger
CN109284184A (en) A kind of building method of the distributed machines learning platform based on containerization technique
CN107391736B (en) Page display method and device
CN101976199A (en) Object-oriented middleware distributed system development platform
US20140310328A1 (en) Method for automated generation of minimal partitioning of a process specification for supporting its distributed execution
CN116442214A (en) Service parallel processing method, device, equipment and medium for robot
US20120272190A1 (en) Method and System for Graphically Enabled Service Oriented Architecture
GB2377779A (en) Computer apparatus for implementing a workflow with graphical representation
CN105100180A (en) Cluster node dynamic loading method, device and system
AU2015288125B2 (en) Control in initiating atomic tasks on a server platform
Shetty et al. Cloud based application development for mobile devices for accessing LBS
CN105144107A (en) Method, processing modules and system for executing an executable code
US11567742B2 (en) Method, apparatus, and computer program product for generating updated network application interfaces
CN106302125A (en) A kind of solicited message is responded method, Apparatus and system
CN115934656A (en) Information processing method, service processing method and device
US20030018698A1 (en) Apparatus and method for workflow
EP4044043A1 (en) Storage process running method and apparatus, database system, and storage medium
CN116643854A (en) Service arrangement method and device, flow controller and task processor
Rahman et al. Multi agent knowledge management architecture

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination