CN103885973B - A kind of RPC system and implementation method based on Web engines - Google Patents
A kind of RPC system and implementation method based on Web engines Download PDFInfo
- Publication number
- CN103885973B CN103885973B CN201210560751.XA CN201210560751A CN103885973B CN 103885973 B CN103885973 B CN 103885973B CN 201210560751 A CN201210560751 A CN 201210560751A CN 103885973 B CN103885973 B CN 103885973B
- Authority
- CN
- China
- Prior art keywords
- rpc
- web
- environment
- service
- rpc service
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/133—Protocols for remote procedure calls [RPC]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/02—Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/12—Protocol engines
Abstract
The invention discloses a kind of RPC systems and implementation method based on Web engines, it is applied in the RPC systems for include RPC requesting parties and RPC service side's composition, RPC requesting parties include that Web is applied and RPC service back-up environment, and RPC requesting parties perform following steps:Web is applied and is initiated RPC requests to RPC service back-up environment, and RPC requests include the call back function of various request results;RPC requests are transmitted to RPC service side by RPC service back-up environment, and wait response message;RPC service back-up environment receive from RPC service side response message, and by request results return to Web application;Web is applied and is called call back function according to the request results, and is operated accordingly.The Web applications that the present invention runs on Web engines can directly invoke the process realization on remote server to ask service, the Service Source in network be made full use of, so as to improve Consumer's Experience.
Description
Technical field
The present invention relates to Web fields, more particularly to a kind of RPC system and realization side based on Web engines
Method.
Background technology
Sea calculates(Sea Computing)The one-stop service based on internet is provided the user, is a kind of most simply may be used
The internet demand interactive mode of dependence.As long as user calculates input demand for services in sea, system just can clearly recognize this need
Ask, and the demand assignment is processed to optimal application or content resource provider, finally return that the result matched to user.
Cloud computing(cloud computing)Be based on internet related service increase, using and delivery mode, lead to
Often it is related to provide dynamic easily extension and the often resource of virtualization by internet.
With the development of extra large cloud computing, Web engines occupy increasingly consequence, the Web application hairs based on Web engines
Exhibition is increasingly faster, development especially with HTML5 and perfect, Web applications be provided with it is more before only locally applied just have
Characteristic, such as multithreading, audio and video playing, Socket communications, Notification, database manipulation etc..Web applications are big
Substituted traditional locally applied trend.Remote procedure call(Remote Procedure Call,RPC)It is that one kind can be with
The method for directly invoking remote process on the local machine, is adopted extensively in based on locally applied Distributed Calculation always
With.Compared to Web applications, locally applied to have development rate slow, the cycle is long, the shortcomings of using stability, robustness difference.With
Web is locally applied using gradually substituting, and in extra large cloud computing, to allow the weaker terminal of computing function quickly to perform complexity
Web calculate, make full use of other terminal resources of Hai Yunzhong, allow Web engines support RPC remote procedure calls, for Web should
Cluster and Distributed Calculation are significant.
The content of the invention
It is an object of the present invention to allow the mistake that the Web applications run on Web engines can be directly invoked on remote server
Cheng Shixian come ask service, the Service Source in extra large cloud environment is made full use of, so as to improve Consumer's Experience.
To achieve the above object, on the one hand, the invention provides a kind of RPC implementation methods based on Web engines, the method
It is applied in the RPC systems for include RPC requesting parties and RPC service side's composition, the RPC requesting parties include that Web takes using with RPC
Business back-up environment, the RPC requesting parties perform following steps:
The Web is applied and is initiated RPC requests to the RPC service back-up environment, and the RPC requests include various request knots
The call back function of fruit;
RPC requests are transmitted to the RPC service side by the RPC service back-up environment, and wait response message;
The RPC service back-up environment receives the response message from described RPC service side, and request results are returned
Give Web applications;
The Web is applied and is called call back function according to the request results, and is operated accordingly.
On the other hand, the invention provides a kind of RPC systems based on Web engines, the system include RPC request ends and
RPC service end, the RPC request ends include that Web is applied and RPC service back-up environment.
Web is using for being responsible for the initiation RPC requests of RPC service back-up environment, while being responsible for being called according to response message
Call back function, and operated accordingly.
The RPC that RPC service back-up environment is used to be responsible for being applied to RPC service end forwarding Web is asked, and reception comes from
The response message at RPC service end.
RPC service end is used to receive the RPC requests from RPC service back-up environment, and it is parsed, and performs corresponding
Operation, and the result of operation is returned into RPC service back-up environment.
The beneficial effects of the present invention are, service is asked by directly invoking the realization of the process on remote server, can
Make full use of the resource in network;Called by carrying out RPC in Web applications, adjusted based on locally applied RPC compared to existing
With its method of calling is simpler.
Brief description of the drawings
After being described in detail to embodiments of the present invention by way of example below in conjunction with accompanying drawing, it is of the invention its
His characteristics, features and advantages will be more obvious.
Fig. 1 is that a kind of remote procedure call implementation method flow based on Web engines provided in an embodiment of the present invention is illustrated
Figure;
Fig. 2 is a kind of RPC system structural representation based on Web engines provided in an embodiment of the present invention;
Fig. 3 is that a kind of RPC system information exchange based on Web engines provided in an embodiment of the present invention is illustrated
Figure.
Specific embodiment
Below by drawings and Examples, the technical scheme to the application is described in further detail.
Fig. 1 is that a kind of remote procedure call implementation method flow based on Web engines provided in an embodiment of the present invention is illustrated
Figure, the method is applied in the RPC systems for include RPC requesting parties and RPC service side's composition, and the RPC requesting parties include that Web is applied
With RPC service back-up environment.As shown in figure 1, the method comprising the steps of 101- steps 104.
In step 101, Web is applied and is initiated RPC requests to RPC service back-up environment, and the RPC requests include various requests
The call back function of result.
Web applications refer to that the Web realized with HTML, JavaScript or CSS script of standard is applied.Web is applied
One connection is set up by the domain name or IP address and service port number of the RPC service side for providing, due to current Web engine
Support HTML5 WebSocket, therefore can be set up using the connected mode of WebSocket Web apply and RPC service support
The connection of environment.For example, a connection URI for RPC service side(Uniform Resource Identifier, generic resource mark
Know symbol)Form is ws://example.com:Port, wherein ws represent WebSocket agreements, and example.com is service side
Domain name, port is the service port number of service side.
Illustrated below by way of JavaScript script fragments:
JavaScript script fragments are as follows
Wherein, rpc be one extension global JavaScript scripts RPC objects, the Object Creation when
Time needs designated domain name and port numbers, and connection is set up by calling rpc.connect.The object set up after successful connection is
A RPC request is initiated in session, session, an interface is identified here by the mode using URI+ function names,
One remote procedure call is initiated by session.call, first parameter in call is remote process title, below
Parameter is the parameter of function.Call back function function (res) and failure after having successfully after initiating remote procedure call
Call back function function afterwards(error,desc).
In step 102, RPC requests are transmitted to RPC service side by RPC service back-up environment, and wait response message.
Specifically, RPC service back-up environment is parsed after the RPC requests from Web applications are received to it, and
RPC is set up with RPC service side to be connected, forward the RPC that Web is applied to ask to it, and wait response message.RPC service support ring
Being formulated between border and RPC service side has communication protocol.The data form of its communication request is:Request type(1 byte)| request length
Degree(4 bytes)| the URI length URILength (4 byte) of request | the URI (URILength bytes) of request | the first of request
The length argLength1 (4 byte) of individual parameter | first parameter(ArgLength1 bytes)| ... | the n-th parameter of request
Length argLengthN (4 byte) | n-th parameter(ArgLengthN bytes), wherein the item in { } is option, wherein
Request type include RPC connection requests, RPC call requests, RPC disconnectings request, its length be 1 byte;Request length
Degree refers to the length of follow-up communication data, and it takes 4 bytes, then the maximum length of communication data can be 4294967296
Byte;Domain below is optional domain, the just presence only when request type is RPC call requests, and it is with function name and parameter
Order is arranged, and function name is specified with the form of URI, and its length is URILength bytes, and the length of follow-up parameter is respectively by it
Parameter length domain designated length above.
It should be noted that RPC service back-up environment needs the multiple RPC requests initiated multiple pages to be controlled,
By using asynchronous communication meanses, to avoid the generation of obstruction.
In step 103, RPC service back-up environment receives the response message from RPC service side, and request results are returned
Give Web applications.
Specifically, communicated according to the communication protocol formulated in advance between RPC service side and RPC service back-up environment,
After RPC service side receives the request from RPC service back-up environment, it is parsed, perform corresponding operation, and will behaviour
The result of work returns to RPC service back-up environment.
The data form that RPC service side returns to the response message of RPC service back-up environment is:Response length(4 bytes)|
Response result (1 byte) | the URI length URILength (4 byte) of response | the URI (URILength bytes) of response | | response
The length ackLength1 of data 1 (4 byte) | reply data 1 (ackLength1 bytes) | ... | reply data N length
AckLengthN (4 byte) | reply data N (ackLengthN bytes) }, wherein, response length is the length of whole reply data
Degree, response result is divided into successfully, failure, can be further divided into more detailed success, unsuccessfully defines.Response URI refers to this response correspondence
Web application RPC call.Equally, the domain in { } is option, contains the reply data after RPC is asked successfully.
RPC service back-up environment after the response message from RPC service side is received, then to the data in response message
Parsed, be packaged into the form that Web applications are capable of identify that, and return to Web applications.
In step 104, Web is applied and is called call back function according to response result, and is operated accordingly.
Specifically, Web is applied after the request results from RPC service back-up environment are received, and calls it initiating RPC
The call back function defined during request, if not defining the call back function of certain result in Web applications, will not carry out any behaviour
Make.
The embodiment of the present invention is called based on Web engines RPC and has been incorporated into Web applications, and what is allowed in whole network all sets
Resource-sharing is carried out in the aspect of Web applications between standby, calculating, the storage resource of whole network can be made full use of.
Fig. 2 is a kind of RPC system structural representation based on Web engines provided in an embodiment of the present invention.Such as
Shown in Fig. 2, the system includes RPC request ends 20 and RPC service end 30, and the RPC request ends 20 include that Web applies 21 and RPC
Service supporting environment 22.
Web is used to be responsible for initiate RPC requests to RPC service back-up environment using 21, while being responsible for being adjusted according to response message
With call back function, and operated accordingly.
The RPC that RPC service back-up environment 22 is used to be applied to the forwarding Web of RPC service end 30 is asked, and reception comes from
The response message at RPC service end 30.
Specifically, RPC service back-up environment 22 is parsed after the RPC requests from Web applications are received to it,
And set up RPC with RPC service side and be connected, forward RPC that Web is applied to ask to it.
RPC service end 30 is used to receive the RPC requests from RPC service back-up environment 22, and it is parsed, and performs
Corresponding operation, and the result of operation is returned into RPC service back-up environment 22.
Fig. 3 is a kind of RPC system information interactive process based on Web engines provided in an embodiment of the present invention
Schematic diagram.Such as Fig. 3's shows that the information interactive process of the system is as follows:
First by the Web application layers of RPC request ends, for example, being applied by the Web that JavaScript scripts are realized
Layer, sets up the connection of RPC, and initiates RPC to it and ask with RPC back-up environments layer.RPC back-up environments layer please to the RPC for receiving
Ask information to be parsed, and forward the RPC to ask to RPC service end.RPC service end is received from RPC service back-up environment layer
RPC requests after, it is parsed, perform corresponding operation, and the result of operation is returned into RPC service back-up environment
Layer.The result that RPC is asked is sent to Web application layers by RPC service back-up environment layer, and Web application layers are called according to response result
Call back function, and initiate remote procedure call request to RPC back-up environments layer.RPC back-up environments layer asks letter to the RPC for receiving
Breath is parsed, and forwards the RPC to ask to RPC service end.RPC service end receives the RPC from RPC service back-up environment layer
After request, it is processed, and return to result, Web application layers call call back function according to result.
The Web applications that the embodiment of the present invention is run on Web engines can directly invoke the process reality on remote server
Now come ask service, the Service Source in extra large cloud environment is made full use of, so as to improve Consumer's Experience.
It is clear that on the premise of without departing from true spirit and scope of the present invention, invention described herein can be with
There are many changes.Therefore, it is all it will be apparent to those skilled in the art that change, be intended to be included in present claims
Within the scope of book is covered.Scope of the present invention is only defined by described claims.
Claims (4)
1. a kind of RPC implementation methods based on Web engines, are applied to include the RPC systems that RPC requesting parties and RPC service side are constituted
In system, the RPC requesting parties include Web using and RPC service back-up environment, it is characterised in that the RPC requesting parties perform with
Lower step:
The Web is applied and is initiated RPC requests to the RPC service back-up environment, and the RPC requests include various request results
Call back function;Wherein, the Web is connected using setting up RPC with the RPC service side by JavaScript scripts;Institute
State Web and determine RPC service side using by specifying the domain name and port numbers of its agreement;
RPC requests are transmitted to the RPC service side by the RPC service back-up environment, and wait response message;Wherein,
The RPC request types include the request of RPC connection requests, RPC call requests and RPC disconnectings, and the length of the request is
The length of subsequent communications data, adjacent with the length of the request is optional domain, when the request type is called for RPC,
It is arranged with the order of function name and parameter, and the function name is with the format setting of UPI;When the RPC service back-up environment is needed
What is multiple pages initiated is controlled to the individual RPC requests, then by using asynchronous communication meanses;
The RPC service back-up environment receives the response message from described RPC service side, and request results are returned into institute
State Web applications;
The Web is applied and is called call back function according to the request results, and is operated accordingly;
The Web is applied to be set up by the connected mode of WebSocket with the RPC service back-up environment and is connected;
The Web applies the interface definition for specifying RPC to call using the form of universal resource identifier.
2. method according to claim 1, it is characterised in that:The RPC service back-up environment and the RPC service side it
Between formulate communication protocol, there is provided supported with the communication of the RPC service side.
3. method according to claim 1, it is characterised in that:The Web using including by CSS, HTML and
One or more application of script realization in JavaScript scripts.
4. a kind of RPC systems based on Web engines, including RPC request ends and RPC service end, the RPC request ends include Web
Using with RPC service back-up environment, it is characterised in that:
Web is applied, for being responsible for initiating RPC requests to the RPC service back-up environment, while being responsible for being called according to response message
Call back function, and operated accordingly;
RPC service back-up environment, for forwarding the RPC that the Web is applied to ask to the RPC service end, and reception comes from
The response message at RPC service end;
RPC service end, for receiving the RPC requests from the RPC service back-up environment, and parses to it, performs phase
The operation answered, and the result of operation is returned into the RPC service back-up environment;The Web is applied and supported with the RPC service
Environment sets up connection by the connected mode of WebSocket;
The Web applies the interface definition for specifying RPC to call using the form of universal resource identifier.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210560751.XA CN103885973B (en) | 2012-12-21 | 2012-12-21 | A kind of RPC system and implementation method based on Web engines |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210560751.XA CN103885973B (en) | 2012-12-21 | 2012-12-21 | A kind of RPC system and implementation method based on Web engines |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103885973A CN103885973A (en) | 2014-06-25 |
CN103885973B true CN103885973B (en) | 2017-07-07 |
Family
ID=50954868
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201210560751.XA Active CN103885973B (en) | 2012-12-21 | 2012-12-21 | A kind of RPC system and implementation method based on Web engines |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103885973B (en) |
Families Citing this family (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108093005B (en) * | 2016-11-22 | 2020-11-03 | 北京京东尚科信息技术有限公司 | Management method and system for interface abnormal call |
CN106815083B (en) * | 2016-12-20 | 2019-11-12 | 微梦创科网络科技(中国)有限公司 | A kind of client asynchronous processing method and client based on Memcache agreement |
CN107402826B (en) * | 2017-06-30 | 2018-09-21 | 武汉斗鱼网络科技有限公司 | A kind of method and device carrying out remote procedure call in an asynchronous manner |
CN107526624B (en) * | 2017-07-18 | 2020-12-08 | 杭州趣链科技有限公司 | Intelligent contract execution engine based on Java virtual machine |
CN107592358A (en) * | 2017-09-19 | 2018-01-16 | 广州视源电子科技股份有限公司 | Application programming interfaces call method and device based on HTTP service |
CN110430100B (en) * | 2019-08-27 | 2021-06-04 | 中国工商银行股份有限公司 | Network connectivity detection method and device |
CN112328410B (en) * | 2020-11-04 | 2023-08-08 | 网易(杭州)网络有限公司 | Method, device, equipment and storage medium for realizing remote procedure call |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP1933527A2 (en) * | 2006-12-14 | 2008-06-18 | Canon Kabushiki Kaisha | Information processing method and system |
CN101697139A (en) * | 2009-11-06 | 2010-04-21 | 金蝶软件(中国)有限公司 | Method, device and registry for remote procedure call |
CN102495677A (en) * | 2011-11-23 | 2012-06-13 | 浪潮电子信息产业股份有限公司 | Method for realizing KVM (kernel-based virtual machine) over IP (internet protocol) through WEB page |
CN102665127A (en) * | 2012-04-23 | 2012-09-12 | 中山大学 | Browser system of digital television |
-
2012
- 2012-12-21 CN CN201210560751.XA patent/CN103885973B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP1933527A2 (en) * | 2006-12-14 | 2008-06-18 | Canon Kabushiki Kaisha | Information processing method and system |
CN101697139A (en) * | 2009-11-06 | 2010-04-21 | 金蝶软件(中国)有限公司 | Method, device and registry for remote procedure call |
CN102495677A (en) * | 2011-11-23 | 2012-06-13 | 浪潮电子信息产业股份有限公司 | Method for realizing KVM (kernel-based virtual machine) over IP (internet protocol) through WEB page |
CN102665127A (en) * | 2012-04-23 | 2012-09-12 | 中山大学 | Browser system of digital television |
Non-Patent Citations (1)
Title |
---|
"基于Web+Services的RPC体系结构的研究";姜虹;《万方企业数据知识服务平台》;20100119;论文第3.4节、第4.1.1节、图4.1 * |
Also Published As
Publication number | Publication date |
---|---|
CN103885973A (en) | 2014-06-25 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103885973B (en) | A kind of RPC system and implementation method based on Web engines | |
CN109067914B (en) | web service proxy method, device, equipment and storage medium | |
US10027742B2 (en) | Techniques for sharing application states | |
WO2016127793A1 (en) | Message sending method, apparatus, system, and server | |
CN104301443B (en) | A kind of method and system that end ability interface is called on web page | |
US7634564B2 (en) | Systems and methods for invoking a service from a plurality of event servers in a network | |
EP2854376B1 (en) | Transmission method, device and system for media stream | |
US6119166A (en) | Controlling communications with local applications using a browser application | |
US10496245B2 (en) | Method for interactive response and apparatus thereof | |
CN110300050A (en) | Information push method, device, computer equipment and storage medium | |
EP3195580B1 (en) | System and method for enhancing user experience during interactive audio-visual communication | |
CN101960822A (en) | SIP-HTTP application correlator | |
CN109547547A (en) | Return source dispatching method, device and its storage medium | |
CN107979520B (en) | Message processing method and message processing device | |
US11843642B1 (en) | Serverless signaling in peer-to-peer session initialization | |
CN102571575A (en) | Session information creation method, device and system | |
US20050278417A1 (en) | Client access to web services | |
CN106357713B (en) | Method for realizing remote procedure call, client device and server device | |
US7418712B2 (en) | Method and system to support multiple-protocol processing within worker processes | |
CN110113298A (en) | Data transmission method, device, signal server and computer-readable medium | |
CN104219257A (en) | Web real-time communication method, system, server and client | |
JP2010511236A (en) | Method, apparatus and computer program for changing an endpoint reference representing a web service endpoint | |
US20140068001A1 (en) | Intermediate proxy server, communication method, and communication system based on http multi-level proxy | |
US10108588B2 (en) | Method and system for communicating between client pages | |
CN105359494B (en) | System, device, method and network server node is presented in mirror image between website |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right | ||
TR01 | Transfer of patent right |
Effective date of registration: 20210802 Address after: Room 1601, 16th floor, East Tower, Ximei building, No. 6, Changchun Road, high tech Industrial Development Zone, Zhengzhou, Henan 450001 Patentee after: Zhengzhou xinrand Network Technology Co.,Ltd. Address before: 100190, No. 21 West Fourth Ring Road, Beijing, Haidian District Patentee before: INSTITUTE OF ACOUSTICS, CHINESE ACADEMY OF SCIENCES |