Remote object calling method and system

A remote object and information calling technology, applied in the field of distributed services, can solve problems such as development language limitations, low service network performance, and difficult maintenance, and achieve the effects of flexible expansion, high transmission efficiency, and simple maintenance

Inactive Publication Date: 2018-01-30
SHENZHEN PRAFLY TECH
3 Cites 11 Cited by

AI-Extracted Technical Summary

Problems solved by technology

These remote calling methods have the following common problems: Each service needs to define a calling interface. With the rapid increase of the number of services, a large number of interfaces need to be maintained during the development process, which is troublesome to expand and difficult to maintain.
[0003] Furthermore, the above remote calling methods still have restrictions on the development language. If the client wants to call the object method on the server, the server ...
the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Method used

ICE is a kind of high-performance RPC communication middleware of open source, cross-platform, cross-language, and it supports the development language C++ of mainstream, Java, C#, PHP, Python and android, mobile end development languages ​​such as iOS, support Window, Linux, Unix and other operating system platforms; RPC is the basic function provided by ICE, which supports synchronous and asynchronous method calls, adopts binary communication protocol, data compression, and high transmission efficiency.
ICE is a kind of high-performance RPC communication middleware of open source, cross-platform, cross-language, and it supports the development language C++ of mainstream, Java, C#, PHP, Python and android, mobile terminal development languages ​​such as iOS, support Window, Linux, Unix and other operating system platforms; RPC is the basic function provided by ICE, which supports synchronous and asynchronous method calls, adopts binary communication protocol, data compression, and high transmiss...
the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Abstract

The invention discloses a remote object calling method and system. The method comprises the following steps of S1, defining a unified service interface at a server; S2, uploading corresponding callinginformation by a client according to a to-be-called service object; and S3, performing instantiation for each piece of the received calling information by the unified service interface to obtain thecorresponding service object. All business services provide access entries for outside through the unified service interface; new business services can be extended only by realizing specific businessservices without defining interfaces for the new business services; the system is flexible and convenient to expand and simple to maintain; furthermore, the client communicates with the server throughRPC communication middleware; multiple common development languages and operation system platforms are supported; synchronous and asynchronous method calling is supported; a binary communication protocol is adopted; and data compression and transmission efficiency is high.

Application Domain

Technology Topic

Point of entryAsynchronous method invocation +4

Image

  • Remote object calling method and system
  • Remote object calling method and system

Examples

  • Experimental program(1)

Example Embodiment

[0033] In order to have a clearer understanding of the technical features, purposes and effects of the present invention, the specific implementation manners of the present invention will now be described in detail with reference to the accompanying drawings.
[0034] refer to figure 1 , is a schematic diagram of the structure of the remote object calling system of the present invention.
[0035] A remote object invocation system generally includes a client and a server. Usually, when a client accesses a business service on the server, a service interface needs to be defined for this business development. However, in a complex system, many business service modules are often involved, so , each time a business service is added, a new service interface needs to be defined, which requires maintenance of a large number of business service interfaces, which is extremely inconvenient for system expansion and maintenance.
[0036] In order to solve the above problems, the present invention defines a unified service interface on the server side, so as to uniformly process calls from clients to business services. Specifically, after the client uploads corresponding invocation information according to the service object to be invoked, the unified service interface instantiates each received invocation information to obtain the corresponding service object.
[0037] Further, in order to solve the problems of cross-platform call obstruction and low transmission efficiency in the prior art, the client and the server communicate through RPC communication middleware in the present invention. Preferably, ICE middleware can be specifically used.
[0038] ICE is an open source, cross-platform, cross-language high-performance RPC communication middleware, which supports mainstream development languages ​​C++, Java, C#, PHP, Python, android, iOS and other mobile development languages, and supports Window, Linux, Unix and other operating system platforms; RPC is the basic function provided by ICE, which supports synchronous and asynchronous method calls, adopts binary communication protocol, data compression, and high transmission efficiency.
[0039] The implementation of the unified calling service of the present invention will be introduced in detail below.
[0040] Specifically, the definition of a unified service interface includes: defining a unified service interface function, the parameters of the function include: a string representing the service class name, method name and parameter type of the called service; a string representing the class method parameter ; a string representing the class constructor parameter; a string representing the method's return result.
[0041] For example, in a specific embodiment, the unified service interface is defined as follows:
[0042] bool RemoteObjectCall(string strClassFullName, string strMethodParam, string strInitParam, out string strOutResult);
[0043] Regarding the parameter description in the above RemoteObjectCall function:
[0044] (a) strClassFullName: specifies the parameters of the service class name, method name and parameter type"
[0045] (b) strMethodParam: class method parameter string;
[0046] (c) strInitParam: class constructor parameter string;
[0047] (d) strOutResult: The method returns the result string.
[0048] Specifically, the uploading of the corresponding call information includes: the client uploads the call information through a call function, the parameters of the call function represent the call information, and the parameters of the call function include: the service class name of the called service, the method Parameters with names and parameter types; strings representing class method parameters; and strings representing method return results.
[0049] For example, in a specific embodiment, the calling function is as follows:
[0050]RPCProxyer.CallObject("class.method(string,int,…)",stringmethodparam,out string strOutResult);
[0051] RPCProxyer represents the API installed on the client. CallObject is the calling function. The first parameter includes the service class name, method name and parameter type of the called service. The value of this part of the parameter will be assigned to the first RemoteObjectCall above. The parameter strClassFullName; the second parameter represents the method parameter, and the value of this part of the parameter will be assigned to the second parameter strMethodParam of the above-mentioned RemoteObjectCall; the third parameter strInitParam of RemoteObjectCall is the default value; the value of the fourth parameter strOutResult of RemoteObjectCall will be Assigned to the third parameter strOutResult of CallObject.
[0052] Specifically, the unified service interface includes the following units:
[0053] The parameter parsing unit is used to obtain the calling information from the relevant parameters of the calling function of the client, and parse out the service class name, method name and parameter type from the calling information; for example, parse from the strClassFullName string in the above-mentioned RemoteObjectCall function Display the service class name, method name and parameter type.
[0054] The assembly object determination unit is used to use the reflection mechanism to locate the assembly object where the service class is located according to the name of the service class;
[0055] A class instance object creation unit, which is used to dynamically create class instance objects by using assembly objects;
[0056] The instance method calling unit is used to obtain the instance method according to the method name of the service class, and call the instance method;
[0057] The result return unit is used to assign the return result strOutResult of the method call to the related parameter strOutResult of the calling function to return to the client. The method here returns the result strOutResult in the form of a string, which can be in formats such as XML and JSon.
[0058] Correspondingly, the present invention also discloses a method for invoking a remote object, comprising the following steps:
[0059] S1. Define a unified service interface on the server side, including: define a unified service interface function, the parameters of the function include: a string representing the service class name, method name and parameter type of the called service; a string representing the class method parameter ; a string representing the class constructor parameter; a string representing the method's return result.
[0060] For example, in a specific embodiment, the unified service interface is defined as follows:
[0061] bool RemoteObjectCall(string strClassFullName, string strMethodParam, string strInitParam, out string strOutResult);
[0062] Regarding the parameter description in the above RemoteObjectCall function:
[0063] (a) strClassFullName: specifies the parameters of the service class name, method name and parameter type"
[0064] (b) strMethodParam: class method parameter string;
[0065] (c) strInitParam: class constructor parameter string;
[0066] (d) strOutResult: The method returns the result string.
[0067] S2. The client uploads the corresponding call information according to the service object to be called, including: the client uploads the call information through a call function, and the parameters of the call function include: the service class name, method name and parameter type of the called service Parameters; a string representing the class method's parameters; and a string representing the method's return result.
[0068] For example, in a specific embodiment, the calling function is as follows:
[0069] RPCProxyer.CallObject("class.method(string,int,…)",stringmethodparam,out string strOutResult);
[0070] RPCProxyer represents the API installed on the client. CallObject is the calling function. The first parameter includes the service class name, method name and parameter type of the called service. The value of this part of the parameter will be assigned to the first RemoteObjectCall above. The parameter strClassFullName; the second parameter represents the method parameter, and the value of this part of the parameter will be assigned to the second parameter strMethodParam of the above-mentioned RemoteObjectCall; the third parameter strInitParam of RemoteObjectCall is the default value; the value of the fourth parameter strOutResult of RemoteObjectCall will be Assigned to the third parameter strOutResult of CallObject.
[0071] S3. The unified service interface instantiates the corresponding service object for each received call information, specifically including:
[0072] S31. Obtain call information from the relevant parameters of the call function of the client, and parse out the service class name, method name and parameter type from the call information; for example, parse out the service class name from the strClassFullName string in the above-mentioned RemoteObjectCall function , method name and parameter type;
[0073] S32. Use the reflection mechanism to locate the assembly object where the service class is located according to the service class name;
[0074] S33. Using the assembly object to dynamically create a class instance object;
[0075] S34. Obtain an instance method according to the method name of the service class, and call the instance method;
[0076] S35. Assign the return result strOutResult of the method call to the related parameter strOutResult of the calling function to return to the client. The method here returns the result strOutResult in the form of a string, which can be in formats such as XML and JSon.
[0077] Further, in order to solve the problems of cross-platform call obstruction and low transmission efficiency in the prior art, the client and the server communicate through RPC communication middleware in the present invention. Preferably, ICE middleware can be specifically used.
[0078] ICE is an open source, cross-platform, cross-language high-performance RPC communication middleware, which supports mainstream development languages ​​C++, Java, C#, PHP, Python, android, iOS and other mobile development languages, and supports Window, Linux, Unix and other operating system platforms; RPC is the basic function provided by ICE, which supports synchronous and asynchronous method calls, adopts binary communication protocol, data compression, and high transmission efficiency.
[0079] In summary, implementing the remote object calling method and system of the present invention has the following beneficial effects: the present invention defines a unified service interface on the server side, and the unified service interface instantiates the corresponding service object for each received calling information , that is, all business services provide external access through the unified service interface. To expand new business services, it is only necessary to implement specific business services. There is no need to define interfaces for new business services. The system is flexible and convenient to expand and easy to maintain; Further, in the present invention, the client and the server communicate through RPC communication middleware, support multiple common development languages ​​and operating system platforms; support synchronous and asynchronous method calls, adopt binary communication protocol, data compression, and high transmission efficiency .
[0080] Embodiments of the present invention have been described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementations, and the above-mentioned specific implementations are only illustrative, rather than restrictive, and those of ordinary skill in the art will Under the enlightenment of the present invention, many forms can also be made without departing from the gist of the present invention and the protection scope of the claims, and these all belong to the protection of the present invention.
the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

no PUM

Description & Claims & Application Information

We can also present the details of the Description, Claims and Application information to help users get a comprehensive understanding of the technical details of the patent, such as background art, summary of invention, brief description of drawings, description of embodiments, and other original content. On the other hand, users can also determine the specific scope of protection of the technology through the list of claims; as well as understand the changes in the life cycle of the technology with the presentation of the patent timeline. Login to view more.
the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Similar technology patents

Electronic signature verifying method and device

InactiveCN1350258AEasy to expandVerifying markings correctnessThird partyPlaintext
Owner:上海电子商务安全证书管理中心有限公司

Plane structure health monitoring integration system and method

ActiveCN104062446AImprove monitoring efficiencyEasy to expandMaterial analysisIntegrated approachIn plane
Owner:CHINA AIRPLANT STRENGTH RES INST

Classification and recommendation of technical efficacy words

  • Easy maintenance
  • Easy to expand

High clearance vehicle

InactiveUS6454294B1Big gapEasy maintenanceAgricultural machinesVehicle body-frame connectionsSpray nozzleHinge angle
Owner:CNH IND AMERICA LLC

Vulnerability scanning method based on movable agent

ActiveCN103200230AEasy to expandTransmissionVulnerability scanningInformation system
Owner:BANK OF BEIJING CONSUMER FINANCE CO
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products