A method and device for dynamic asynchronous remote procedure call of a robot

By introducing ICE-based virtual clients and virtual servers into the robot control system, using the request queue to manage remote process call requests, the problem of task blocking and poor real-time performance in the robot control process is solved, and asynchronous remote process call is realized Efficient execution.

CN107247634BActive Publication Date: 2025-02-11GUANGZHOU SHIYUAN ELECTRONICS CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN201710417466.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2017-06-06
Publication Date
2025-02-11
Estimated Expiration
2037-06-06

AI Technical Summary

Technical Problem

In the prior art, there are problems of task blocking and poor real-time performance during robot control.

Method used

The virtual client and virtual server based on the Internet communication engine ICE are adopted to initiate remote procedure calls through the virtual client. The request queue in the virtual server manages the remote procedure call request and sends it to the robot in turn.

Benefits of technology

It realizes asynchronous execution of remote procedure calls, avoids task blockage, and improves the real-time performance of the robot control system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN107247634B_ABST
    Figure CN107247634B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, device, robot and storage medium for dynamic asynchronous remote procedure call of a robot. The method comprises: creating a virtual client for remotely calling a robot and a virtual server with a request queue, creating a programming interface based on an Internet communication engine ICE that supports asynchronous remote calls; initiating a call function through the virtual client and the programming interface to send a remote procedure call request to the virtual server; if there are unprocessed requests in the request queue, adding the received request to the request queue, and sending the requests in the request queue to the robot in sequence according to the order in the request queue. The method can continuously send remote procedure calls, and request the next remote procedure call without waiting for the callback result of a remote procedure call. The remote procedure call avoids task blocking through request queue management, and realizes the asynchronous implementation of remote procedure calls.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of robots, and in particular to a method and device for dynamic asynchronous remote procedure calling of robots. Background Art

[0002] ROS (Robot Operating System) is an open source robot operating system that implements the Remote Procedure Call (RPC) function through Service. However, ROS Service only supports the synchronous call mode. Therefore, in the application process, when a call is initiated, it is necessary to wait for the callback result before executing subsequent tasks in the thread, which will cause blocking and affect the real-time performance of the robot control system. Summary of the invention

[0003] The embodiments of the present invention provide a method, device, robot and storage medium for dynamic asynchronous remote procedure call of a robot, so as to solve the problems of task blocking and poor real-time performance in the robot control process in the prior art.

[0004] The first aspect adopts a method for dynamic asynchronous remote procedure call of a robot, comprising:

[0005] Create a virtual client for remotely calling the robot and a virtual server with a request queue, and create a programming interface that supports asynchronous remote calls based on the Internet communication engine ICE;

[0006] Initiate a call function through the virtual client and programming interface to send a remote procedure call request to the virtual server;

[0007] If there are unprocessed requests in the request queue, the received request is added to the request queue, and the requests in the request queue are sent to the robot in sequence according to the order in the request queue.

[0008] The second aspect adopts a robot dynamic asynchronous remote procedure call device, comprising:

[0009] An initialization unit, used to create a virtual client for remotely calling the robot and a virtual server with a request queue, and to create a programming interface supporting asynchronous remote calls based on the Internet communication engine ICE;

[0010] A request sending unit, used for initiating a call function through the virtual client and a programming interface to send a remote procedure call request to the virtual server;

[0011] The first processing unit is configured to add the received request to the request queue if there are unprocessed requests in the request queue, and send the requests in the request queue to the robot in sequence according to the order in the request queue.

[0012] The third aspect adopts a robot, the robot comprising:

[0013] one or more processors;

[0014] a memory for storing one or more programs,

[0015] When the one or more programs are executed by one or more processors, the one or more processors implement the robot dynamic asynchronous remote procedure call method as described above.

[0016] The fourth aspect adopts a storage medium containing computer executable instructions, which, when executed by a computer processor, are used to perform the robot dynamic asynchronous remote procedure call method as described above.

[0017] The beneficial effects of the present invention are as follows: a virtual client and a virtual server based on ICE are set up, the virtual client initiates a remote procedure call to the robot through the virtual server, the request queue in the virtual server manages the remote procedure call, and sends the remote procedure call requests to the robot in sequence; the virtual client can send remote procedure calls continuously, and can request the next remote procedure call without waiting for the callback result of a remote procedure call. The remote procedure call avoids task blocking through request queue management, thereby realizing asynchronous implementation of the remote procedure call. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments of the present invention. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the contents of the embodiments of the present invention and these drawings without paying any creative work.

[0019] Figure 1 It is a method flow chart of the first embodiment of a method for dynamic asynchronous remote procedure call of a robot provided in a specific implementation manner of the present invention.

[0020] Figure 2 It is a method flow chart of a second embodiment of a method for dynamic asynchronous remote procedure call of a robot provided in a specific implementation manner of the present invention.

[0021] Figure 3It is a structural block diagram of a first embodiment of a device for dynamic asynchronous remote procedure call of a robot provided in a specific implementation manner of the present invention.

[0022] Figure 4 It is a structural block diagram of a second embodiment of a robot dynamic asynchronous remote procedure call device provided in a specific implementation manner of the present invention.

[0023] Figure 5 It is a schematic diagram of the structure of a robot provided in a specific embodiment of the present invention. DETAILED DESCRIPTION

[0024] In order to make the technical problems solved by the present invention, the technical solutions adopted and the technical effects achieved clearer, the technical solutions of the embodiments of the present invention will be further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0025] Please refer to Figure 1 , which is a method flow chart of a first embodiment of a method for dynamic asynchronous remote procedure call of a robot provided in a specific implementation mode of the present invention. As shown in the figure, the method includes:

[0026] Step S101: Create a virtual client for remotely calling a robot and a virtual server with a request queue, and create an ICE-based programming interface that supports asynchronous remote calls.

[0027] ICE (Internet Communications Engine) is a middleware that aims to provide efficient network communications for upper-layer applications. It provides object-oriented remote calls, grid computing, and publish / subscribe mechanisms. ICE can run on most mainstream operating systems, such as Linux, Solaris, Windows, and MacOS X, and supports C++, Java, .NET languages ​​(such as C# or Visual Basic), Objective-C, Python, PHP, and Ruby. ICE applications can be deployed in a variety of environments, and virtual clients and virtual servers can be implemented in different programming languages; at the same time, it can run on different operating system platforms and different hardware architectures, effectively solving problems such as poor compatibility of the C / S model and high development costs.

[0028] In the prior art, the user directly sends instructions to the robot through the human-computer interaction interface, which is equivalent to the virtual client directly talking to the robot. Only after the robot responds to the previous instruction can the user send the next instruction, that is, the two can only be called synchronously. In this solution, a virtual client and a virtual server based on ICE are created, and the human-computer interaction interface is set on the virtual client. The user operates the virtual client to input the request for the remote procedure call. The virtual server is provided with a request queue, which is used to manage the request for the remote procedure call. It should be noted that the virtual client and the virtual server in this solution are not distinguished on the hardware body. The two are actually virtual existences, that is, the virtual client and the virtual server can be set on the same hardware body or on different hardware bodies. In addition, the hardware body where the virtual client and the virtual server are located can be independently set and connected to the robot, or directly integrated into the robot.

[0029] Step S102: Initiate a call function through the virtual client and the programming interface to send a remote procedure call request to the virtual server.

[0030] The remote procedure call request is entered by the user in the human-machine interface to control the robot. The virtual client does not interact directly with the robot, but sends the remote procedure call request to the virtual server, which processes the remote procedure call.

[0031] Step S103: If there are unprocessed requests in the request queue, the received request is added to the request queue, and the requests in the request queue are sent to the robot in sequence according to the order in the request queue.

[0032] After receiving the remote procedure call request, the virtual server processes it according to the current state of the request queue. If there are unprocessed requests in the request queue, the robot cannot respond to multiple instructions at the same time, so the received request needs to be added to the request queue first. On the contrary, if there are no unprocessed remote procedure call requests in the request queue, it means that the robot can respond to new instructions at this time, and the remote procedure request can be directly sent to the robot.

[0033] To summarize, a virtual client and a virtual server based on ICE are set up. The virtual client initiates a remote procedure call to the robot through the virtual server. The request queue in the virtual server manages the remote procedure call and sends the remote procedure call requests to the robot in sequence. The virtual client can send remote procedure calls continuously and can request the next remote procedure call without waiting for the callback result of a remote procedure call. The remote procedure call avoids task blocking through request queue management, thereby realizing asynchronous implementation of remote procedure calls.

[0034] Please refer to Figure 2 , which is the flowchart of the second embodiment of a method for robot dynamic asynchronous remote procedure call provided in the specific implementation manner of the present invention. As shown in the figure, the method includes:

[0035] Step S201: Create a virtual client for remotely calling a robot and a virtual server with a request queue constructed, and create a programming interface based on ICE that supports asynchronous remote calls.

[0036] The cross-platform and cross-language nature of ICE is mainly implemented based on Slice (Specification language of ICE, the specific object definition language of ICE). Design a remote procedure call interface file through the Slice language of ICE, compile the interface file into the target programming language through the Slice compiler provided by ICE, and provide a series of programming interfaces that support asynchronous remote calls. The target programming language can be C / C++, Java, Java-Script, Python, Ruby. Regardless of what the target programming language is, the implementation is based on the virtual client and virtual server of ICE.

[0037] Step S202: Generate a request data packet based on the received remote procedure call according to the template definition, and convert the request data packet into a serialized binary data packet.

[0038] During the remote procedure call process, the transmitted data packet is defined by a template, that is, various data templates for remote procedure calls are established, and it is converted into a serialized binary data packet by calling the ros::serialization::serialize method or the protobuf method. The data template is specifically transmitted in the form of a serialized binary data packet. Of course, it can also be transmitted through other standard format-based methods.

[0039] In the virtual client, an asynchronous remote procedure call is initiated through a pre-generated member function, and the request data is directly sent out. In the definition of this member function, if there is a backlog of the current request, it is first placed in the request queue without blocking the current calling thread.

[0040] The data template of the request is defined in the member function. The form of the member function is <int(string, template, template, template)>. The first parameter is an instruction identifier of string type. The second to fourth parameters are templates defined by template, which support the user to specify the data type when using. When initiating an asynchronous call, call the ros::serialization::serialize method or the protobuf method to convert the second to fourth parameters into a serialized binary data packet.

[0041] Step S203: Send the binary data packet to the virtual server through the virtual client and the programming interface.

[0042] Step S204: Deserialize the binary data packet at the virtual server to generate a request data packet defined according to the template.

[0043] After receiving the binary data packet, the virtual server calls ros::serialization::Deserialize to deserialize the binary data packet into the data packet format defined by the template.

[0044] Step S205: If there are unprocessed requests in the request queue, the received request is added to the request queue, and the requests in the request queue are sent to the robot in sequence according to the order in the request queue; otherwise, the request is sent to the robot.

[0045] This step is to process the unprocessed remote procedure call requests in the request queue and send them to the robot in sequence according to the order in which the requests are generated. The process of sending the remote procedure call to the robot and the robot responding to the remote procedure call is the same as the process of controlling the robot in the prior art, and will not be explained separately here.

[0046] It should be noted that whether the remote procedure call is sent directly to the robot after receiving it or the remote procedure call request in the request queue is sent to the robot, it is sent only after receiving the callback result of the previous remote procedure call request.

[0047] Step S206: Return a query object for querying the call status of the request to the virtual client, so as to query whether the call is completed and obtain the call result through the query object.

[0048] The call result is returned to the virtual client through the virtual server. Specifically, a callback function mechanism can be established on the virtual server. When the user uses it, the callback function of the virtual server can be dynamically bound by passing the function pointer. Of course, the virtual server can also directly respond to the received call result and return the call result to the virtual client after receiving it.

[0049] Specifically, define a public data member of function pointer type: call Boost::Function method, define<int(string,bytes,bytes,bytes)> Type function pointer m_fP; then define a<void(fP)> The member function of type is recorded as registerF in this article for the convenience of description, and a virtual server callback function registration mechanism is established: the parameter of this member function is the function pointer fp, and the key behavior inside the member function is to assign the parameter fp to the public data member m_fp of the function pointer type; for the virtual server class I_A, a pure virtual function will be generated, and the name of this pure virtual function is also O_A. The virtual server needs to implement the pure virtual function O_A of the inherited I_A class; when there is an element in the request queue, the O_A function will be automatically triggered. There is a key behavior in the implementation of the O_A function: the four parameters of the (string, bytes, bytes, bytes) type passed in from the virtual client when the O_A function is triggered are used as parameters to call the function pointer m_fP. In this way, when using it, the user can dynamically bind the asynchronous callback response function of the virtual server by calling registerF to pass different function pointers.

[0050] After receiving the call structure, the virtual client can save and back up the corresponding record of the sent request for subsequent analysis of the operation process.

[0051] Step S207: Sending a status query instruction from the virtual client to the virtual server through a programming interface to query status information of requests in the request queue.

[0052] Step S208: Return the status information from the virtual server to the virtual client through the programming interface.

[0053] To facilitate users to monitor the execution of remote procedure calls, users can send instructions to the virtual server to query the status of the request queue, such as the number of remaining requests, content, and estimated execution time.

[0054] Step S209: Generate a request adjustment instruction according to the state information, and send the request adjustment instruction from the virtual client to the virtual server through the programming interface to delete or adjust the order of the requests in the request queue.

[0055] If necessary, the user can generate operation instructions for the request queue. After receiving the operation instructions, the virtual client can delete the requests in the request queue, adjust the order, and perform other operations. However, because the robot has high requirements on the timing of executing operations, such operations need to maintain strict logic before and after the instructions.

[0056] In summary, a virtual client and a virtual server based on ICE are set up, and the virtual client initiates a remote procedure call to the robot through the virtual server. The request queue in the virtual server manages the remote procedure call and sends the remote procedure call requests to the robot in sequence. The virtual client can send remote procedure calls continuously without waiting for the callback result of a remote procedure call to request the next remote procedure call. The remote procedure call avoids task blocking through the request queue management, and realizes the asynchronous implementation of the remote procedure call. At the same time, the subsequent processing of the remote procedure call request enables the user to better monitor the running process.

[0057] The following is an embodiment of a device for dynamic asynchronous remote procedure call of a robot provided in a specific implementation mode of the present invention. The embodiment of the device is implemented based on the embodiment of the aforementioned method. For any incomplete description in the embodiment of the device, please refer to the embodiment of the aforementioned method.

[0058] Please refer to Figure 3 , which is a structural block diagram of a first embodiment of a device for dynamic asynchronous remote procedure call of a robot provided in a specific implementation mode of the present invention. As shown in the figure, the device includes:

[0059] Initialization unit 310, used to create a virtual client for remotely calling the robot and a virtual server with a request queue, and to create a programming interface supporting asynchronous remote calling based on the Internet communication engine ICE;

[0060] A request sending unit 320, configured to initiate a call function through the virtual client and programming interface to send a remote procedure call request to the virtual server;

[0061] The first processing unit 330 is configured to add the received request to the request queue if there are unprocessed requests in the request queue, and send the requests in the request queue to the robot in sequence according to the order in the request queue.

[0062] To summarize, the above-mentioned units work together, and a virtual client and a virtual server based on ICE are set up. The virtual client initiates a remote procedure call to the robot through the virtual server. The request queue in the virtual server manages the remote procedure call and sends the remote procedure call requests to the robot in sequence. The virtual client can send remote procedure calls continuously and can request the next remote procedure call without waiting for the callback result of a remote procedure call. The remote procedure call avoids task blocking through request queue management, thereby realizing asynchronous implementation of remote procedure calls.

[0063] Please refer to Figure 4, which is a structural block diagram of a second embodiment of a robot dynamic asynchronous remote procedure call device provided in a specific implementation mode of the present invention. As shown in the figure, the device includes:

[0064] Initialization unit 310, used to create a virtual client for remotely calling the robot and a virtual server with a request queue, and to create an ICE-based programming interface supporting asynchronous remote calls;

[0065] The request sending unit 320 is used for the virtual client to initiate a call function through the programming interface to send a remote procedure call request to the virtual server;

[0066] The first processing unit 330 is configured to add the received request to the request queue if there are unprocessed requests in the request queue, and send the requests in the request queue to the robot in sequence according to the order in the request queue.

[0067] Among them, it also includes:

[0068] The second processing unit 340 is specifically configured to send the request to the robot through the virtual server if the request queue is empty.

[0069] Wherein, the device further comprises:

[0070] The result returning unit 350 is used to return a query object for querying the calling status of the request to the virtual client.

[0071] The query object can be used to query whether the call is completed and obtain the call result.

[0072] Wherein, the device further comprises:

[0073] A status query unit 360, configured to send a status query instruction from the virtual client to the virtual server through the programming interface to query status information of requests in the request queue;

[0074] The information feedback unit 370 is used to return the state information from the virtual server to the virtual client through the programming interface.

[0075] Wherein, the device further comprises:

[0076] The queue adjustment unit 380 is used to generate a request adjustment instruction according to the state information, and send the request adjustment instruction from the virtual client to the virtual server through the programming interface to delete or adjust the order of the requests in the request queue.

[0077] The calling request unit 320 includes:

[0078] The parameter encoding module 321 is used to generate a request data packet according to the template definition of the received remote procedure call, and convert the request data packet into a serialized binary data packet;

[0079] A data sending module 322, used to send the binary data packet to the virtual server through the virtual client and the programming interface;

[0080] The data decoding module 323 is used for the virtual server to deserialize the binary data packet to generate a request data packet defined according to the template.

[0081] In summary, the above units work together, and a virtual client and a virtual server based on ICE are set up. The virtual client initiates a remote procedure call to the robot through the virtual server. The request queue in the virtual server manages the remote procedure call and sends the remote procedure call requests to the robot in sequence. The virtual client can send remote procedure calls continuously, and can request the next remote procedure call without waiting for the callback result of a remote procedure call. The remote procedure call avoids task blocking through the request queue management, and realizes the asynchronous implementation of the remote procedure call. At the same time, the subsequent processing of the remote procedure call request enables the user to better monitor the running process.

[0082] Please refer to Figure 5 , which is a schematic structural diagram of a robot provided in a specific implementation manner of the present invention. Figure 5 A block diagram of an exemplary robot 12 suitable for use in implementing embodiments of the present invention is shown. Figure 5 The robot 12 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0083] like Figure 5 As shown, the functional components of the robot 12 for implementing data processing and interaction are presented in the form of a general-purpose computing device. The components of the robot 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 connecting different system components (including the system memory 28 and the processing unit 16).

[0084] Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. By way of example, these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.

[0085] The robot 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the robot 12, including volatile and non-volatile media, removable and non-removable media.

[0086] The system memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. The robot 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 34 may be used to read and write non-removable, non-volatile magnetic media ( Figure 5 not shown, usually called a "hard drive"). Although Figure 5 Not shown in the figure, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 18 via one or more data medium interfaces. The memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present invention.

[0087] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in the memory 28. Such program modules 42 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. The program modules 42 generally perform the functions and / or methods of the embodiments described herein.

[0088] The robot 12 may also communicate with one or more external devices 14 (e.g., keyboards, pointing devices, displays 24, etc.), one or more devices that enable a user to interact with the robot 12, and / or any device that enables the robot 12 to communicate with one or more other computing devices (e.g., network cards, modems, etc.). Such communication may be performed via an input / output (I / O) interface 22. Furthermore, the computer device 12 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 20. As shown, the network adapter 20 communicates with other modules of the robot 12 via the bus 18. It should be understood that although Figure 5Not shown, other hardware and / or software modules may be used in conjunction with the robot 12, including but not limited to microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0089] The processing unit 16 executes various functional applications and data processing by running the programs stored in the system memory 28, such as implementing the method for dynamic asynchronous remote procedure call of the robot provided in the embodiment of the present invention:

[0090] That is, when the processing unit 16 executes the program, it achieves: creating a virtual client for remotely calling the robot and a virtual server with a request queue, creating a programming interface based on the Internet communication engine ICE that supports asynchronous remote calls; initiating a call function through the virtual client and the programming interface to send a remote procedure call request to the virtual server; if there are unprocessed requests in the request queue, adding the received request to the request queue, and sending the requests in the request queue to the robot in sequence according to the order in the request queue.

[0091] A computer-readable storage medium is also provided in a specific embodiment of the present invention, on which a computer program is stored. When the program is executed by a processor, the method for dynamic asynchronous remote procedure call of a robot provided in all the embodiments of the present invention is implemented:

[0092] That is, when the program is executed by the processor, it achieves: creating a virtual client for remotely calling the robot and a virtual server with a request queue, creating a programming interface based on the Internet communication engine ICE that supports asynchronous remote calls; initiating a call function through the virtual client and the programming interface to send a remote procedure call request to the virtual server; if there are unprocessed requests in the request queue, adding the received request to the request queue, and sending the requests in the request queue to the robot in sequence according to the order in the request queue.

[0093] Any combination of one or more computer-readable media may be used. A computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, device, or device.

[0094] Computer-readable signal media may include a data signal propagated in baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including, but not limited to, electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0095] Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0096] Computer program code for performing the operations of the present invention may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0097] The technical principle of the present invention is described above in conjunction with specific embodiments. These descriptions are only for explaining the principle of the present invention and cannot be interpreted as limiting the scope of protection of the present invention in any way. Based on the explanations herein, those skilled in the art can associate other specific implementations of the present invention without paying creative labor, and these methods will fall within the scope of protection of the present invention.

Claims

1. A method for dynamic asynchronous remote procedure call of a robot, characterized in that: include: Create a virtual client for remotely calling the robot and a virtual server with a request queue, and create a programming interface that supports asynchronous remote calls based on the Internet communication engine ICE; Initiating a call function through the virtual client and the programming interface to send a remote procedure call request to the virtual server, wherein the remote procedure call request is input by a user in the virtual client; Through the virtual server, if there are unprocessed requests in the request queue, the received request is added to the request queue, and the requests in the request queue are sent to the robot in sequence according to the order in the request queue; If the request queue is empty, the request is sent to the robot through the virtual server.

2. The method according to claim 1, characterized in that The method further comprises: A query object for querying the call status of the request is returned to the virtual client, so as to query whether the call is completed and obtain the call result through the query object.

3. The method according to claim 1, characterized in that The method further comprises: Sending a status query instruction from the virtual client to the virtual server through the programming interface to query the status information of the requests in the request queue; The state information is returned from the virtual server to the virtual client through the programming interface.

4. The method according to claim 3, characterized in that After returning the state information from the virtual server to the virtual client through the programming interface, the method further includes: A request adjustment instruction is generated according to the state information, and the request adjustment instruction is sent from the virtual client to the virtual server through the programming interface to delete or adjust the order of the requests in the request queue.

5. The method according to claim 1, characterized in that The initiating a call function through the virtual client and the programming interface to send a remote procedure call request to the virtual server includes: Generate a request data packet based on the template definition of the received remote procedure call, and convert the request data packet into a serialized binary data packet; Sending the binary data packet to the virtual server through the virtual client and programming interface; The binary data packet is deserialized at the virtual server to generate a request data packet defined according to the template.

6. A device for dynamic asynchronous remote procedure call of a robot, characterized in that: include: An initialization unit, used to create a virtual client for remotely calling the robot and a virtual server with a request queue, and to create a programming interface supporting asynchronous remote calls based on the Internet communication engine ICE; A request sending unit, configured to initiate a call function through the virtual client and a programming interface to send a remote procedure call request to the virtual server, wherein the remote procedure call request is input by a user in the virtual client; A first processing unit is configured to add the received request to the request queue through the virtual server if there are unprocessed requests in the request queue, and send the requests in the request queue to the robot in sequence according to the order in the request queue; The second processing unit is configured to send the request to the robot through the virtual server if the request queue is empty.

7. The device according to claim 6, characterized in that The device further comprises: The result returning unit is used to return a query object used to query the calling status of the request to the virtual client so as to query whether the calling is completed and obtain the calling result through the query object.

8. The device according to claim 6, characterized in that The device further comprises: A status query unit, used to send a status query instruction from the virtual client to the virtual server through the programming interface to query the status information of the requests in the request queue; The information feedback unit is used to return the state information from the virtual server to the virtual client through the programming interface.

9. A robot, characterized in that: The robot comprises: one or more processors; a memory for storing one or more programs, When the one or more programs are executed by one or more processors, the one or more processors implement the robot dynamic asynchronous remote procedure call method as described in any one of claims 1-5.

10. A storage medium comprising computer executable instructions, wherein when the computer executable instructions are executed by a computer processor, the computer executable instructions are used to execute the robot dynamic asynchronous remote procedure call method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Cloud robot system and implementation method

    CN106534338A

  • Internet-based robot long-distance control method

    CN1743144A

  • Method and system for synchronizing robot with server

    US10341413B2

  • Distributed type job scheduling engine based on ICE (internet communication engine)

    CN102033777A

  • Automatic test method and system for software and module

    CN102157037A