Summary of the invention
The purpose of the application is, provides the communications module using RPC technology, client can with remote call service end,
Specific function is realized by server-side and feeds back result processed to client, reduces hardware cost whereby, meanwhile, it solves long-range
Debug user's site problems.
According to the first aspect of the embodiments of the present disclosure, a kind of remote invocation method is provided, applied to communication customer end and far
Journey server-side, wherein the remote service end is for providing preset business function, which comprises establishes the communication
The communication connection of client and the remote service end;Long-range adjust is sent to the remote service end by the communication customer end
It is requested with agreement RPC;The far call agreement RPC request is parsed by the remote service end, and executes the long-range tune
With agreement RPC request in business function call instruction, to obtain implementing result corresponding with business function;Implementing result is anti-
It is fed to the communication customer end, to realize the corresponding business function.
Further, the remote service end includes communications module, wherein the communication customer end and described established
The step of communication connection at remote service end includes: to establish connection by the communications module and the communication customer end;It is described
The IP address and the remote service end that communication customer end is transmitted according to the communications module establish the communication connection.
Further, the communication customer end further includes RPC connector, and the RPC connector is for maintaining communication clients
The interface channel at end and the remote service end, the IP address that the communication customer end is transmitted according to the communications module with it is described
The step of communication connection is established at remote service end are as follows: by described in the RPC connector and remote service end foundation
Communication connection.
Further, the communication customer end includes RPC client, it is described by the communication customer end to described long-range
Server-side sends the step of far call agreement RPC request, comprising: when the communication customer end receives the IP address,
Control starts the RPC client;The RPC client carries out coding to calling data information and forms the far call agreement
RPC request;Far call agreement RPC request is sent to the remote service end by the RPC connector.
Further, the remote service end includes that RPC calls device and RPC receiver, described to pass through the remote service
End parses the far call agreement RPC request, and the business function calling executed in the far call agreement RPC request refers to
The step of enabling, comprising: the far call agreement RPC is received by the RPC receiver and is requested;Device is called by the RPC
It calls specific business function algorithm to parse far call agreement RPC request, and executes the long-range tune
With the business function call instruction in agreement RPC request.
Present invention also provides a kind of far call device, described device includes: communication unit, for establishing the communication
The communication connection of client and the remote service end;Transmission unit, for passing through the communication customer end to the long-range clothes
Business end sends far call agreement RPC request;Receiving unit is assisted for parsing the far call by the remote service end
RPC request is discussed, and executes the business function call instruction in far call agreement RPC request, to obtain and business function
Corresponding implementing result;Feedback unit, for implementing result to be fed back to the communication customer end, to realize the corresponding industry
Business function.
Further, the remote service end includes communications module, and the communication unit is also used to: passing through the communication mould
Group establishes connection with the communication customer end;IP address that the communication customer end is transmitted according to the communications module and described remote
Journey server-side establishes the communication connection.
Present invention also provides a kind of far call systems, and the system comprises communication customer end and remote service end, institutes
It states communication customer end and the remote service end is established and communicated to connect;The communication customer end sends remote to the remote service end
Journey invocation protocol RPC request;The remote service end parses the far call agreement RPC request, and executes the long-range tune
With agreement RPC request in business function call instruction, to obtain implementing result corresponding with business function;The remote service
Implementing result is fed back to the communication customer end by end, to realize the corresponding business function.
It further, include communications module, RPC calling device and RPC in the remote service end in the far call system
Receiver, wherein the communications module is connect for establishing Preliminary Communications with communication customer end;The RPC calls device for adjusting
It takes interface and returns to call result;The RPC receiver, for establishing the far call system and the communication customer end
Connection;The communication customer end further includes RPC client and RPC connector, and the RPC client is for realizing remote interface;
The RPC connector is used to maintain the interface channel of communication customer end and the remote service end.
Present invention also provides a kind of computer storage medium, the computer storage medium has one or more programs,
One or more of programs are executed by one or more processors, to realize remote invocation method described in any of the above embodiments
Step.
Remote procedure calling (PRC) method and device provided in an embodiment of the present invention can receive the communication clients end equipment hair
The remote procedure call protocol RPC request sent;Remote service end parses RPC request according to preset RPC agreement,
It obtains the recalls information in the RPC request and executes the business function call instruction in the far call agreement RPC request,
To obtain implementing result corresponding with business function, and implementing result is fed back into the communication customer end, it is corresponding to realize
The business function, realize reduces cost, the flexible purpose of maintenance mode whereby.
Specific embodiment
In order to make those skilled in the art more fully understand the technical solution in this specification, below in conjunction with this explanation
Attached drawing in book embodiment is clearly and completely described the technical solution in this specification embodiment, it is clear that described
Embodiment be merely a part but not all of the embodiments of the present application.Based on this specification embodiment, this field
Those of ordinary skill's every other embodiment obtained without creative efforts, all should belong to the application
The range of protection.
Fig. 1 is a kind of overall architecture schematic diagram that the scheme of this specification is related under a kind of practical application scene.This is whole
In body framework, at least one client (RPC client) and at least one mould group (RPC service), client are specifically included that
End directly carries out the transmission of data with mould group by interconnection of telecommunication network, and client is specific by calling the interface in mould group to realize
Function, and by result feed back to client to realize specific function.It in addition to this, can also include clothes in the overall architecture
Equipment where business end, RPC service itself should be provided by server-side.In practical applications, RPC service can be at least partly complete
It is standby, be also possible to there is no;It is finished for example, server-side itself may be developed not yet, this does not influence the side of this specification
The implementation of case.Based on the above overall architecture, the scheme of this specification is described in detail below.
Fig. 2 is a kind of flow diagram for remote invocation method that this specification embodiment provides.The process is possible to be held
Row main body includes but is not limited to following equipment: personal computer, mobile phone, tablet computer, intelligent wearable device, vehicle device, medium-sized
Computer, computer cluster etc..After remote invocation method provided by the present application starts, step be can be automatically operated, Ke Yigen
It successively carries out, can also be run simultaneously according to sequence, specifically without limitation, remote invocation method provided in this embodiment, including such as
Lower step.
Step S310 establishes the communication connection of the communication customer end and the remote service end.
Specifically, which is applied in communication customer end and remote service end.Wherein, communication customer end is
The demand end of remote call service is requested, remote service end is to execute in advance according to the request of the remote call service of communication customer end
If the supply and demand end of function.In the present embodiment, remote service end includes communications module, communication customer end can for computer,
The equipment that mobile terminal etc. is configured with communication function, remote service end are the server for configuring concrete function and RPC interface.Step
The specific implementation step of S310 may include steps of:
Step S3101 establishes connection by the communications module and the communication customer end;Specifically, communications module can
Think mobile data communication mould group, such as: the communication networks such as 3G, 4G are also possible to radio communication mold group, for example, WiFi communication
Or the mould group of telecommunication connection may be implemented in other.When starting remote server, communications module meeting and communication customer end
Establish data transmission connection.
Step S3102, the IP address and the communication customer end that the communication customer end is transmitted according to the communications module
Establish the communication connection.Specifically, communication customer end includes RPC connector.Communications module and communication customer end establish data
After transmission connection, server passes through communications module for the IP address of server.Wherein, the remote service end further includes that RPC connects
Device is connect, for for maintaining the interface channel of communication customer end and the remote service end, which comprises by described
The communication connection is established at RPC connector and the remote service end, wherein communication connection is used for transmission communication customer end and remote
Request data package etc. between journey server-side.
Step S320 sends far call agreement RPC request to the remote service end by the communication customer end.
Specifically, communication customer end includes RPC client, and the agency for being responsible for importing remote interface realizes, in this embodiment party
In formula, the remote interface program for specifically needing to call is written in communication customer end.Step S320 can be real as follows
It is existing:
Step S3201, when the communication customer end receives the IP address, control starts the RPC client;Tool
Body, when communication customer end determines, and IP address has been received, control starting RPC client, wherein used in RPC client
In importing remote interface.
Step S3202, the RPC client carry out coding to calling data information and form the far call agreement RPC
Request;Specifically, communication customer end includes that RPC calls device, wherein RPC calls device to be used to be called according to preset PRC agreement
Data information is encoded, wherein calling data information includes identifying long-range mistake including following unsigned integer field with independent
Journey: program number, program version number and process number.It is specific called by calling data information that can determine for remote service end
Interface.
Far call agreement RPC request is sent to the long-range clothes by the RPC connector by step S3203
Business end.Specifically, RPC calls device to request edited far call agreement RPC, i.e. network packet, is sent to RPC connection
Device, RPC connector send remote service end by the communication connection established for the network packet received.
Step S330 parses the far call agreement RPC by the remote service end and requests, and executes described long-range
Business function call instruction in invocation protocol RPC request, to obtain implementing result corresponding with business function.
Specifically, the remote service end includes that RPC calls device and RPC receiver, described to pass through the remote service end
The far call agreement RPC request is parsed, and executes the business function call instruction in the far call agreement RPC request
The step of, comprising:
Step S3301 receives the far call agreement RPC by the RPC receiver and requests;
Step S3302 calls device that specific business function algorithm is called to assist the far call by the RPC
View RPC request is parsed, and executes the business function call instruction in the far call agreement RPC request.Specifically,
RPC calls device to be parsed the far call agreement RPC request received to obtain specific data and believe according to RPC protocol stack
Then breath calls interface algorithm corresponding with data information according to data information, and execute corresponding business function calling and refer to
It enables to obtain specific processing result.That is, really calling process is carried out at remote service end.
Implementing result is fed back to the communication customer end by step S340, to realize the corresponding business function.
Specifically, RPC calls device to send implementing result in RPC receiver, is led to implementing result by RPC receiver
Communication connection is crossed to be sent in the RPC connector of communication customer end.
By above embodiment, the remote procedure call protocol RPC that the communication clients end equipment is sent can receive
Request;Remote service end parses RPC request according to preset RPC agreement, obtains the calling in the RPC request
Information simultaneously executes the business function call instruction in the far call agreement RPC request, corresponding with business function to obtain
Implementing result, and implementing result is fed back into the communication customer end, to realize the corresponding business function, drop is realized whereby
Low cost, the flexible purpose of maintenance mode.
Present invention also provides a kind of far call device, described device includes: communication unit, transmission unit, receives list
Member and feedback unit, particular content are as follows.
Communication unit, for establishing the communication connection of the communication customer end and the remote service end.Specifically, this is remote
Journey call method is applied in communication customer end and remote service end.Wherein, communication customer end is request remote call service
Demand end, remote service end are the supply and demand end that preset function is executed according to the request of the remote call service of communication customer end.?
In present embodiment, remote service end includes communications module, and communication customer end can be computer, mobile terminal etc. configured with logical
The equipment of telecommunication function, remote service end are the server for configuring concrete function and RPC interface.Communication unit includes that Preliminary Communications are built
Vertical unit and final connection setup unit.Preliminary Communications establish unit, for passing through the communications module and the communication clients
Connection is established at end;Specifically, communications module can be mobile data communication mould group, such as: the communication networks such as 3G, 4G, it can also be with
Radio communication mold group, for example, WiFi communication or other may be implemented telecommunication connection mould group.In starting remote service
When device, communications module can establish data transmission connection with communication customer end.Final connection setup unit, for so that the communication
The IP address and the communication customer end that client is transmitted according to the communications module establish the communication connection.Specifically, lead to
Believe that client includes RPC connector.After communications module and communication customer end establish data transmission connection, server passes through communication mould
Group is by the IP address of server.Wherein, the remote service end further includes RPC connector, for for maintaining communication customer end
With the interface channel at the remote service end, which comprises established by the RPC connector and the remote service end
The communication connection, wherein communication connection is used for transmission the request data package etc. between communication customer end and remote service end.
Transmission unit is asked for sending far call agreement RPC to the remote service end by the communication customer end
It asks.Specifically, communication customer end includes RPC client, and the agency for being responsible for importing remote interface realizes, in the present embodiment,
The remote interface program for specifically needing to call is written in communication customer end.Transmission unit include start unit, coding unit and
Data transmission unit.
Wherein, start unit, for when the communication customer end receives the IP address, control to start the RPC
Client;Specifically, when communication customer end determines, and IP address has been received, control starting RPC client, wherein RPC visitor
For importing remote interface in the end of family.
Coding unit carries out coding to calling data information for the RPC client and forms the far call agreement
RPC request;Specifically, communication customer end includes that RPC calls device, wherein RPC calls device to be used for will according to preset PRC agreement
Data information is called to be encoded, wherein call data information including including following unsigned integer field, it is remote independently to identify
Journey process: program number, program version number and process number.By calling data information that can determine specifically quilt for remote service end
Calling interface.
Data transmission unit, it is described for being sent to far call agreement RPC request by the RPC connector
Remote service end.Specifically, RPC calls device to request edited far call agreement RPC, i.e. network packet, is sent to
RPC connector, RPC connector send remote service end by the communication connection established for the network packet received.
Receiving unit is requested for parsing the far call agreement RPC by the remote service end, and described in execution
Business function call instruction in far call agreement RPC request, to obtain implementing result corresponding with business function.Specifically
Ground parses the far call agreement RPC by the remote service end and requests, and executes the far call agreement RPC and ask
Business function call instruction in asking, to obtain implementing result corresponding with business function.The remote service end includes RPC tune
With device and RPC receiver, receiving unit includes data receipt unit and call unit.
Data receipt unit is requested for receiving the far call agreement RPC by the RPC receiver;
Call unit, for calling device to call specific business function algorithm to the long-range tune by the RPC
It is parsed with agreement RPC request, and executes the business function call instruction in the far call agreement RPC request.Specifically
Ground, RPC call device to be parsed the far call agreement RPC request received specifically to be counted according to RPC protocol stack
It is believed that breath, then calls interface algorithm corresponding with data information according to data information, and execute corresponding business function tune
With instruction to obtain specific processing result.That is, really calling process is carried out at remote service end
Feedback unit, for implementing result to be fed back to the communication customer end, to realize the corresponding business function.
Specifically, RPC calls device to send implementing result in RPC receiver, and implementing result is passed through communication link by RPC receiver
It receives and sends into the RPC connector of communication customer end.
By above embodiment, the remote procedure call protocol RPC that the communication clients end equipment is sent can receive
Request;Remote service end parses RPC request according to preset RPC agreement, obtains the calling in the RPC request
Information simultaneously executes the business function call instruction in the far call agreement RPC request, corresponding with business function to obtain
Implementing result, and implementing result is fed back into the communication customer end, to realize the corresponding business function, drop is realized whereby
Low cost, the flexible purpose of maintenance mode.
The application also provides a kind of far call system, described the system comprises communication customer end and remote service end
Communication customer end and the remote service end, which are established, to be communicated to connect;The communication customer end sends long-range to the remote service end
Invocation protocol RPC request;The remote service end parses the far call agreement RPC request, and executes the far call
Business function call instruction in agreement RPC request, to obtain implementing result corresponding with business function;The remote service end
Implementing result is fed back into the communication customer end, to realize the corresponding business function.
Specifically far call system is illustrated below in conjunction with Fig. 4.
Communication customer end includes client, RPC client, RPC agency, RPC calling device, RPC connector and RPC agreement
Stack.
Wherein, client is the equipment for supporting operation RPC far call, and RPC client is for importing remote interface;RPC
Agency realizes for the agency of remote interface, RPC calls device for encoding recalls information and sending far call request to service
Side simultaneously waits final result to return;RPC connector for be responsible for maintaining the communication connection at communication customer end and remote service end and
Send data to remote service end;RPC protocol stack is used for according to agreement coding/decoding.
Remote service end includes server, RPC service device, RPC agency, RPC processor, RPC receiver and RPC agreement
Stack.
Wherein, server is used to support the server of operation RPC far call;RPC service device is long-range for being responsible for export
Interface;The agency of RPC agent remote interface realizes;RPC processor controls calling process at remote service end for being responsible for, including
Thread pool, time-out time etc. are called in management;RPC receiver is requested and is returned for being responsible for receiving the far call of communication customer end
Request results;RPC protocol stack is used for according to agreement coding/decoding.
The application provides a kind of far call system, is also used to realize following method.
Further, the remote service end includes communications module, wherein the communication customer end and described established
The step of communication connection at remote service end includes: to establish connection by the communications module and the communication customer end;It is described
The IP address and the remote service end that communication customer end is transmitted according to the communications module establish the communication connection.
Further, the communication customer end further includes RPC connector, and the RPC connector is for maintaining communication clients
The interface channel at end and the remote service end, the IP address that the communication customer end is transmitted according to the communications module with it is described
The step of communication connection is established at remote service end are as follows: by described in the RPC connector and remote service end foundation
Communication connection.
Further, the communication customer end includes RPC client, it is described by the communication customer end to described long-range
Server-side sends the step of far call agreement RPC request, comprising: when the communication customer end receives the IP address,
Control starts the RPC client;The RPC client carries out coding to calling data information and forms the far call agreement
RPC request;Far call agreement RPC request is sent to the remote service end by the RPC connector.
Further, the remote service end includes that RPC calls device and RPC receiver, described to pass through the remote service
End parses the far call agreement RPC request, and the business function calling executed in the far call agreement RPC request refers to
The step of enabling, comprising: the far call agreement RPC is received by the RPC receiver and is requested;Device is called by the RPC
It calls specific business function algorithm to parse far call agreement RPC request, and executes the long-range tune
With the business function call instruction in agreement RPC request.
The application also provides a kind of computer storage medium, and the computer storage medium has one or more programs, institute
It states one or more programs to be executed by one or more processors, is applied to communication customer end and remote service end, wherein described
Remote service end is for providing preset business function, to realize following steps: establishing the communication customer end and described long-range
The communication connection of server-side;Far call agreement RPC request is sent to the remote service end by the communication customer end;It is logical
It crosses the remote service end and parses the far call agreement RPC request, and execute in the far call agreement RPC request
Business function call instruction, to obtain implementing result corresponding with business function;Implementing result is fed back into the communication clients
End, to realize the corresponding business function.
Further, the remote service end includes communications module, wherein the communication customer end and described established
The step of communication connection at remote service end includes: to establish connection by the communications module and the communication customer end;It is described
The IP address and the remote service end that communication customer end is transmitted according to the communications module establish the communication connection.
Further, the communication customer end further includes RPC connector, and the RPC connector is for maintaining communication clients
The interface channel at end and the remote service end, the IP address that the communication customer end is transmitted according to the communications module with it is described
The step of communication connection is established at remote service end are as follows: by described in the RPC connector and remote service end foundation
Communication connection.
Further, the communication customer end includes RPC client, it is described by the communication customer end to described long-range
Server-side sends the step of far call agreement RPC request, comprising: when the communication customer end receives the IP address,
Control starts the RPC client;The RPC client carries out coding to calling data information and forms the far call agreement
RPC request;Far call agreement RPC request is sent to the remote service end by the RPC connector.
Further, the remote service end includes that RPC calls device and RPC receiver, described to pass through the remote service
End parses the far call agreement RPC request, and the business function calling executed in the far call agreement RPC request refers to
The step of enabling, comprising: the far call agreement RPC is received by the RPC receiver and is requested;Device is called by the RPC
It calls specific business function algorithm to parse far call agreement RPC request, and executes the long-range tune
With the business function call instruction in agreement RPC request.
The application also provides a kind of computer storage medium, and the system comprises communication customer end and remote service end, institutes
It states communication customer end and the remote service end is established and communicated to connect;The communication customer end sends remote to the remote service end
Journey invocation protocol RPC request;The remote service end parses the far call agreement RPC request, and executes the long-range tune
With agreement RPC request in business function call instruction, to obtain implementing result corresponding with business function;The remote service
Implementing result is fed back to the communication customer end by end, to realize the corresponding business function.
Each technical characteristic of embodiment described above can be combined arbitrarily, for simplicity of description, not to above-mentioned reality
It applies all possible combination of each technical characteristic in example to be all described, as long as however, the combination of these technical characteristics is not deposited
In contradiction, all should be considered as described in this specification.
The several embodiments of the application above described embodiment only expresses, the description thereof is more specific and detailed, but simultaneously
It cannot therefore be construed as limiting the scope of the patent.It should be pointed out that coming for those of ordinary skill in the art
It says, without departing from the concept of this application, various modifications and improvements can be made, these belong to the protection of the application
Range.Therefore, the scope of protection shall be subject to the appended claims for the application patent.