Specific embodiment
In being described below, for illustration and not for limitation, the tool of such as particular system structure, technology etc is proposed
Body details, to understand thoroughly the embodiment of the present invention.However, it will be clear to one skilled in the art that there is no these specific
The present invention also may be implemented in the other embodiments of details.In other situations, it omits to well-known system, device, electricity
The detailed description of road and method, in case unnecessary details interferes description of the invention.
In order to illustrate technical solutions according to the invention, the following is a description of specific embodiments.
Referring to Figure 1, Fig. 1 is the implementation process of the application and development method of intelligent robot provided in an embodiment of the present invention
Figure.Implementation process as shown in Figure 1 includes step S101 to S104, and the realization principle of each step is specific as follows:
S101: starting is installed on the remote procedure call protocol RPC client on terminal device in advance.
In the embodiment of the present invention, RPC refers to a kind of agreement of remote procedure call.It is led according to developer or manufacturer
The RPC framing program entered carries out integration processing to the exploitation client being installed on terminal device in advance, obtains RPC client.
Wherein, above-mentioned exploitation client is to provide the application program of programming development environment on terminal device, which includes
Code editor, compiler, debugger and graphic user interface etc..
Terminal device includes but is not limited to server, desktop computer, laptop, smart phone, plate and palm
Computer (Personal Digital Assistant, PDA) etc..
In the embodiment of the present invention, RPC framing program can be existing open source RPC framing program, such as gRPC, Apache
Thrift and bRPC etc. is also possible to a set of RPC framing program or combine open source RPC frame that developer voluntarily writes
The RPC framing program write, is not limited thereto.
When detecting that the RPC client functionality in exploitation client services enabled instruction, alternatively, detecting exploitation client
When end is activated, determines and start above-mentioned RPC client.
S102: by the RPC client, there is the intelligent robot at RPC service end to establish with operation and communicate to connect.
In the embodiment of the present invention, it is based on above-mentioned realization principle identical with RPC client, inside intelligent robot in advance
RPC service end is installed, difference is, for intelligent robot, the RPC framing program imported is for providing RPC clothes
Business end function, and for the exploitation client on developer's terminal device, the RPC framing program imported is for providing
RPC client functionality, therefore, there are partial function differences between the RPC framing program of the two, consequently lead to specific implementation generation
Difference between code.
When detecting that the RPC service end in intelligent robot is activated, start RPC service end function services.
In the embodiment of the present invention, with obtaining the network that developer or robot administrator input in RPC service end
Location and port numbers, alternatively, the automatic detection mode in address based on RPC service end, determine RPC service end network address and
Port numbers.Receive the network address and port numbers that developer is inputted in RPC client.
According to network address received by RPC client and port numbers, RPC client is in internet or local area network
Base unit search request is issued, to determine the network resource location at RPC service corresponding with network address end, and is requested and operation
The intelligent robot of the network resource location at RPC service end establishes communication connection.When detecting communication connection confirmation instruction,
Based on serve port corresponding to above-mentioned port numbers, long-range connection is established between RPC client and RPC service end.
Preferably, after the network resources address for determining RPC service end, communication connection request is issued, and in legitimacy
After the completion of certification, just it is attached with RPC service end.Legitimacy verification process includes but is not limited to account information certification, terminal
Equipment Serial Number certification and other authentication modes etc..
S103: associated data corresponding to the application program that user develops on the terminal device is obtained.
Developer carries out the exploitation of intelligent robot application program in above-mentioned exploitation client, that is, exploitation client
It can receive the application source code of user's input.Processing is compiled to source code using above-mentioned exploitation client, can be obtained
To the application program of required exploitation.
In the embodiment of the present invention, since RPC client needs to be led to based on binary RPC agreement with RPC service end
Letter, therefore, each parameter value relevant to application program is read out, and the chemical conversion of obtained each parameter value sequence is binary
Form.Above-mentioned parameter value include but is not limited to application program called method name, function name and other kinds type variable
Parameter etc..
S104: being transmitted to the intelligent robot for the associated data, so that the intelligent robot is preset soft
Application programming interface api function corresponding with the associated data is called in part development kit SDK library.
Preset that manufacturer, robot issued in the embodiment of the present invention, inside intelligent robot for development machines people function
Applicable SDK library.Wherein, above-mentioned SDK library is defaulted in inside intelligent robot by manufacturer.
Particularly, for having dispatched from the factory and the internal not stored intelligent robot for having SDK library, since its SDK library is by manufacturer
Therefore being provided separately to developer can be imported SDK library in intelligent robot by developer again.
When remote procedure call is initiated at RPC service end of the RPC client on terminal device into intelligent robot,
The parameter of method call needs the network protocol by bottom in RPC client, and the associated data after serializing is transmitted to
RPC service end.
For associated data corresponding to the application program after serializing, it is transmitted through the network to the intelligence having connected
Robot enables the associated data to be converted to intelligence so that intelligent robot carries out unserializing processing to the associated data
After the preset format that energy robot can be read, in the address space of intelligent robot, search corresponding with the associated data
Application programming interface (Application Programming Interface, API) function.
Intelligent robot calls above-mentioned from locally searching obtained api function.Since each api function is for controlling intelligence
Robot executes a Xiang Gongneng, for example, control intelligent robot is directly walked, turns or dances, it is thereby achieved that passing through exploit person
The terminal device of member carrys out the long-range control to intelligent robot.
In the embodiment of the present invention, mounted RPC client is started by the terminal device in user, realizes to utilize and be somebody's turn to do
RPC client communicates to connect to there is the intelligent robot at RPC service end to establish with operation, so that user is in development and application program
Afterwards, it directly can remotely control intelligent robot and execute feature operation corresponding with application program, therefore, in the running of control robot
During, exploitation need not be obtained executable program again and be burnt to intelligent robot by user, therefore reduce the behaviour of application and development
Make cumbersome degree;In addition, since SDK library defaults in intelligent robot, and user only need on the terminal device of oneself development machines
People's application, thus is no longer influenced by the limitation of SDK running environment and programming language, realize application and development platform-neutral,
Language independence, so that the effect of distributed deployment is presented in the exploitation program on terminal device and the control program in robot
Therefore fruit reduces user to the application and development difficulty of intelligent robot.
As an embodiment of the present invention, Fig. 2 shows the applications of intelligent robot provided in an embodiment of the present invention to open
The specific implementation flow of forwarding method S104, details are as follows:
S1041: the table of comparisons safeguarded in advance based on the RPC client is obtained corresponding with the call parameters name
Function identification code.
RPC client maintains a table of comparisons in advance, and the above-mentioned table of comparisons calls function name and function to know for storing
The corresponding relationship of other code.Function identification code indicates the unique identifying number of calling function, and the program code of function is called to set in terminal
Standby corresponding address space is associated with function identification code corresponding to the calling function.
In the embodiment of the present invention, each parameter value relevant to the application program of developer's exploitation includes needed for application program
The function name of the function of calling, i.e. calling function name.In the table of comparisons that above-mentioned RPC client is safeguarded, determine using journey
The corresponding function identification code of each function name institute called needed for sequence.Wherein, the form of expression of function identification code include but
It is not limited to the forms such as character string and integer value.
S1042: the associated data for carrying the function identification code is transmitted to the intelligent robot, so that described
The table of comparisons that intelligent robot is safeguarded according to the RPC service device is determining institute corresponding with the function identification code
It states after calling function name, in the function call duration, is called and the calling function name pair in preset SDK library
The api function answered.
When RPC client executes remote procedure call to intelligent robot, sequence is carried out to the associated data of application program
Change processing, the data flow characterized in binary form.For each function identification code determined, by the function identification code
It is additional to after its corresponding data flow for calling function name, the data flow for carrying function identification code is transmitted through the network to
The RPC service end of intelligent robot.
In the embodiment of the present invention, the RPC service end maintenance of intelligent robot has comparison list, and the table of comparisons is equally used for
The corresponding relationship of function name and function identification code is called in storage.Wherein, for same calling function name, in RPC visitor
The table of comparisons and the corresponding function identification code of institute is identical in the table of comparisons that RPC service end is safeguarded that family end is safeguarded.
When the RPC service of intelligent robot termination receives the data flow that RPC client transmissions come, which is flowed into
The processing of row unserializing, and function identification code included in its in extraction.Pair that intelligent robot is safeguarded at RPC service end
According in table, finding out and extract the corresponding calling function name of obtained function identification code.According to the function identification code, intelligent machine
Device people determines the address space for storage function code, with the api function generation for therefrom obtaining with calling function name to match
Code, and execute the api function code.
In the embodiment of the present invention, by RPC client and RPC service end safeguard respectively a calling function name and
The table of comparisons of function identification code corresponding relationship is avoided in RPC client executing remote procedure call, because RPC client with
RPC service end is distributed in different terminal devices or corresponding different address space and leads to not search by function pointer
The problem of api function code, ensure that the stability that RPC client is communicated with RPC service end, so that user only need to be certainly
Development machines people applies on oneself terminal device, without being limited again by SDK running environment and programming language, therefore,
User is reduced to the application and development difficulty of intelligent robot.
As an embodiment of the present invention, the application that Fig. 3 shows intelligent robot provided in an embodiment of the present invention is opened
Another specific implementation flow of forwarding method S104, details are as follows:
S1043: user calling function name set in the development process of the application program and letter are obtained
Number calls duration.
Developer can call a series of function, and big portion in the development process of application program in program code
Function is divided to be required to incoming parameter value, so that the output result of function can change because incoming parameter is different.Example
Such as, in minor function abc (), if developer needs to call function abc () in the application, incoming integer is needed
Parameter value a and b so that based on function abc () come to the parameter value a and b of input carry out operation after, output valve a can be obtained
With the product of b.
In the embodiment of the present invention, each calling function name according to associated by application program is obtained and the calling function name
Corresponding incoming parameter value.Wherein, for being passed to the calling function that parameter value includes time cycle length, it is passed to parameter value
It can also be function call duration.
S1044: the calling function name and function call duration are converted to the associated data of preset format.
In order to by each calling function name associated by application program and function call duration with binary data stream
Form is transmitted to the RPC service end of intelligent robot, in the embodiment of the present invention, to progress when calling function name and function call
Row serializing processing, to export the associated data of preset format.
Preferably, above-mentioned preset format for example can be protobuf.Language independent property based on protobuf guarantees
No matter user by which kind of language come development and application program, can also be converted to the relevant various parameter values of application program can
The serializing structured data formats of extension.
S1045: being transmitted to the intelligent robot for the associated data, so that the intelligent robot is to the association
After data are decoded, in the function call duration, persistently called and the calling function name pair in preset SDK library
The api function answered.
RPC service end is in received data flow, calling function name needed for parsing application program and each tune
With the corresponding parameter value of function name.Each api function that intelligent robot is stored in SDK library is searched and the calling function name
Corresponding api function, and the parameter value that parsing is obtained is as the incoming parameter of the api function.Therefore, when incoming parameter includes
When function call duration, intelligent robot will continuously carry out the api function searched and obtained in the function call duration.
In the embodiment of the present invention, by obtain user's calling function name set in the development process of application program with
And function call duration, and the associated data for carrying the calling function name and function call duration is transmitted to intelligence machine
People ensure that intelligent robot, can be specified by the developer after carrying out unserializing decoding process to associated data
In function call duration, api function corresponding with function name is called persistently is called therefore to realize in preset SDK library
While the local function stored to intelligent robot carries out far call control, control precision is improved, reaches more
For accurate control effect.
Refer to Fig. 4, Fig. 4 be another embodiment of the present invention provides intelligent robot application and development method realization stream
Cheng Tu.Implementation process as shown in Figure 4 includes step S401 to S405, and the realization principle of each step is specific as follows:
S401: starting is installed on the remote procedure call protocol RPC client on terminal device in advance.
S402: by the RPC client, there is the intelligent robot at RPC service end to establish with operation and communicate to connect.
S403: associated data corresponding to the application program that user develops on the terminal device is obtained.
S404: being transmitted to the intelligent robot for the associated data, so that the intelligent robot is preset soft
Application programming interface api function corresponding with the associated data is called in part development kit SDK library.
The step realization principle and other steps mentioned in the various embodiments that the embodiment of the present invention is not mentioned are realized former
It manages identical, therefore no longer repeats one by one.
S405: the function call result that the intelligent robot is returned by the RPC service end is obtained.
In intelligent robot, when RPC service end executes any api function in SDK library, whether the api function is detected
Success is called.If api function interrupts in calling process, alternatively, detecting that api function calls error message, then by letter
Number call error prompt information is sent to RPC client;If api function calls completion, do not occur any error message still,
Function call success prompt information is then sent to RPC client.
The all types of prompt informations that RPC client returns to the RPC service end received are shown.
Preferably, if api function interrupts in calling process, alternatively, detect that api function calls error message,
Then api function calling error message is uploaded to cloud server by intelligent robot, so that SDK post staff detects the API
Error code in function.Wherein, cloud server is the server that SDK issues manufacturer.
In the embodiment of the present invention, based on the function call that intelligent robot is detected when calling different api functions
As a result, the prompt information for being used to describe the function call result to be back to the RPC client of developer, so that developer
After far call intelligent robot executes corresponding function, it can be well understood and currently whether be successfully realized to intelligent machine
The control of device people, alternatively, can know the concrete reason of current control failure.For different failure causes, developer is needed
It to set about to be checked from different directions, therefore, the embodiment of the present invention improves developer and carries out to intelligent robot
Malfunction elimination efficiency during control.
It should be understood that the size of the serial number of each step is not meant that the order of the execution order in above-described embodiment, each process
Execution sequence should be determined by its function and internal logic, the implementation process without coping with the embodiment of the present invention constitutes any limit
It is fixed.
Corresponding to the application and development method of intelligent robot described in foregoing embodiments, Fig. 5 shows the embodiment of the present invention
The structural block diagram of the application and development device of the intelligent robot of offer illustrates only and the embodiment of the present invention for ease of description
Relevant part.
Referring to Fig. 5, which includes:
Start unit 51, for starting the remote procedure call protocol RPC client being installed on terminal device in advance.
Connection unit 52, for being established with the intelligent robot that operation has RPC service end logical by the RPC client
Letter connection.
First acquisition unit 53, for obtaining association corresponding to the application program that user develops on the terminal device
Data.
Transmission unit 54, for the associated data to be transmitted to the intelligent robot, so that the intelligent robot
Application programming interface api function corresponding with the associated data is called in preset Software Development Kit SDK library.
Optionally, the transmission unit 54 includes:
First obtains subelement, for obtaining user calling set in the development process of the application program
Function name and function call duration.
Converting unit, for the calling function name and function call duration to be converted to the incidence number of preset format
According to.
Call unit, for the associated data to be transmitted to the intelligent robot, so that the intelligent robot pair
After the associated data is decoded, in the function call duration, persistently called and the calling in preset SDK library
The corresponding api function of function name.
Optionally, the transmission unit 54 includes:
Second obtains subelement, and the table of comparisons for being safeguarded in advance based on the RPC client is obtained and the calling
The corresponding function identification code of parameter name.
Transmission subelement, for the associated data for carrying the function identification code to be transmitted to the intelligence machine
People, so that the table of comparisons that the intelligent robot is safeguarded according to the RPC service device, identifies determining with the function
After the corresponding calling function name of code, in the function call duration, called and the tune in preset SDK library
With the corresponding api function of function name.
Optionally, the connection unit 52 includes:
Third obtains subelement, for obtaining the network address and end that the user inputs in the RPC client
Slogan, the network address and the port numbers are corresponding with the RPC service end respectively.
Connection request subelement determines the RPC service end for being based on the network address and the port numbers
Network resource location, and request to establish with the intelligent robot for running the RPC service end and communicate to connect.
Optionally, the application and development device of the intelligent robot further include:
Second acquisition unit 55 passes through the function tune that the RPC service end is returned for obtaining the intelligent robot
With result.
In the embodiment of the present invention, mounted RPC client is started by the terminal device in user, realizes to utilize and be somebody's turn to do
RPC client communicates to connect to there is the intelligent robot at RPC service end to establish with operation, so that user is in development and application program
Afterwards, it directly can remotely control intelligent robot and execute feature operation corresponding with application program, therefore, in the running of control robot
During, exploitation need not be obtained executable program again and be burnt to intelligent robot by user, therefore reduce the behaviour of application and development
Make cumbersome degree;In addition, since SDK library defaults in intelligent robot, and user only need on the terminal device of oneself development machines
People's application, thus is no longer influenced by the limitation of SDK running environment and programming language, realize application and development platform-neutral,
Language independence, so that the effect of distributed deployment is presented in the exploitation program on terminal device and the control program in robot
Therefore fruit reduces user to the application and development difficulty of intelligent robot.
Fig. 6 is the schematic diagram for the terminal device that one embodiment of the invention provides.As shown in fig. 6, the terminal of the embodiment is set
Standby 6 include: processor 60, memory 61 and are stored in the meter that can be run in the memory 61 and on the processor 60
Calculation machine program 62, such as the application and development program of intelligent robot.The processor 60 executes real when the computer program 62
Step in the application and development embodiment of the method for existing above-mentioned each intelligent robot, such as step 101 shown in FIG. 1 is to 104.Or
Person, the processor 60 realize the function of each module/unit in above-mentioned each Installation practice when executing the computer program 62,
Such as the function of unit 51 to 55 shown in Fig. 5.
Illustratively, the computer program 62 can be divided into one or more module/units, it is one or
Multiple module/units are stored in the memory 61, and are executed by the processor 60, to complete the present invention.Described one
A or multiple module/units can be the series of computation machine program instruction section that can complete specific function, which is used for
Implementation procedure of the computer program 62 in the terminal device 6 is described.
The terminal device 6 can be the calculating such as desktop PC, notebook, palm PC and cloud server and set
It is standby.The terminal device may include, but be not limited only to, processor 60, memory 61.It will be understood by those skilled in the art that Fig. 6
The only example of terminal device 6 does not constitute the restriction to terminal device 6, may include than illustrating more or fewer portions
Part perhaps combines certain components or different components, such as the terminal device can also include input-output equipment, net
Network access device, bus etc..
Alleged processor 60 can be central processing unit (Central Processing Unit, CPU), can also be
Other general processors, digital signal processor (Digital Signal Processor, DSP), specific integrated circuit
(Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field-
Programmable Gate Array, FPGA) either other programmable logic device, discrete gate or transistor logic,
Discrete hardware components etc..General processor can be microprocessor or the processor is also possible to any conventional processor
Deng.
The memory 61 can be the internal storage unit of the terminal device 6, such as the hard disk or interior of terminal device 6
It deposits.The memory 61 is also possible to the External memory equipment of the terminal device 6, such as be equipped on the terminal device 6
Plug-in type hard disk, intelligent memory card (Smart Media Card, SMC), secure digital (Secure Digital, SD) card dodge
Deposit card (Flash Card) etc..Further, the memory 61 can also both include the storage inside list of the terminal device 6
Member also includes External memory equipment.The memory 61 is for storing needed for the computer program and the terminal device
Other programs and data.The memory 61 can be also used for temporarily storing the data that has exported or will export.
It is apparent to those skilled in the art that for convenience of description and succinctly, only with above-mentioned each function
Can unit, module division progress for example, in practical application, can according to need and by above-mentioned function distribution by different
Functional unit, module are completed, i.e., the internal structure of described device is divided into different functional unit or module, more than completing
The all or part of function of description.Each functional unit in embodiment, module can integrate in one processing unit, can also
To be that each unit physically exists alone, can also be integrated in one unit with two or more units, it is above-mentioned integrated
Unit both can take the form of hardware realization, can also realize in the form of software functional units.In addition, each function list
Member, the specific name of module are also only for convenience of distinguishing each other, the protection scope being not intended to limit this application.Above system
The specific work process of middle unit, module, can refer to corresponding processes in the foregoing method embodiment, and details are not described herein.
In the above-described embodiments, it all emphasizes particularly on different fields to the description of each embodiment, is not described in detail or remembers in some embodiment
The part of load may refer to the associated description of other embodiments.
Those of ordinary skill in the art may be aware that list described in conjunction with the examples disclosed in the embodiments of the present disclosure
Member and algorithm steps can be realized with the combination of electronic hardware or computer software and electronic hardware.These functions are actually
It is implemented in hardware or software, the specific application and design constraint depending on technical solution.Professional technician
Each specific application can be used different methods to achieve the described function, but this realization is it is not considered that exceed
The scope of the present invention.
In embodiment provided by the present invention, it should be understood that disclosed device/terminal device and method, it can be with
It realizes by another way.For example, device described above/terminal device embodiment is only schematical, for example, institute
The division of module or unit is stated, only a kind of logical function partition, there may be another division manner in actual implementation, such as
Multiple units or components can be combined or can be integrated into another system, or some features can be ignored or not executed.Separately
A bit, shown or discussed mutual coupling or direct-coupling or communication connection can be through some interfaces, device
Or the INDIRECT COUPLING or communication connection of unit, it can be electrical property, mechanical or other forms.
The unit as illustrated by the separation member may or may not be physically separated, aobvious as unit
The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple
In network unit.It can select some or all of unit therein according to the actual needs to realize the mesh of this embodiment scheme
's.
It, can also be in addition, the functional units in various embodiments of the present invention may be integrated into one processing unit
It is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated list
Member both can take the form of hardware realization, can also realize in the form of software functional units.
If the integrated module/unit be realized in the form of SFU software functional unit and as independent product sale or
In use, can store in a computer readable storage medium.Based on this understanding, the present invention realizes above-mentioned implementation
All or part of the process in example method, can also instruct relevant hardware to complete, the meter by computer program
Calculation machine program can be stored in a computer readable storage medium, the computer program when being executed by processor, it can be achieved that on
The step of stating each embodiment of the method.Wherein, the computer program includes computer program code, the computer program
Code can be source code form, object identification code form, executable file or certain intermediate forms etc..Computer-readable Jie
Matter may include: can carry the computer program code any entity or device, recording medium, USB flash disk, mobile hard disk,
Magnetic disk, CD, computer storage, read-only memory (ROM, Read-Only Memory), random access memory (RAM,
Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium etc..It should be noted that described
The content that computer-readable medium includes can carry out increasing appropriate according to the requirement made laws in jurisdiction with patent practice
Subtract, such as does not include electric carrier signal and electricity according to legislation and patent practice, computer-readable medium in certain jurisdictions
Believe signal.
Embodiment described above is merely illustrative of the technical solution of the present invention, rather than its limitations;Although referring to aforementioned reality
Applying example, invention is explained in detail, those skilled in the art should understand that: it still can be to aforementioned each
Technical solution documented by embodiment is modified or equivalent replacement of some of the technical features;And these are modified
Or replacement, the spirit and scope for technical solution of various embodiments of the present invention that it does not separate the essence of the corresponding technical solution should all
It is included within protection scope of the present invention.