CN103885973A - Web-engine-based remote procedure call system and implementation method thereof - Google Patents
Web-engine-based remote procedure call system and implementation method thereof Download PDFInfo
- Publication number
- CN103885973A CN103885973A CN201210560751.XA CN201210560751A CN103885973A CN 103885973 A CN103885973 A CN 103885973A CN 201210560751 A CN201210560751 A CN 201210560751A CN 103885973 A CN103885973 A CN 103885973A
- Authority
- CN
- China
- Prior art keywords
- rpc
- request
- web application
- rpc service
- supporting environment
- 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.)
- Granted
Links
Images
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 Web-engine-based remote procedure call system and an implementation method thereof applied to an RPC system comprising an RPC requestor and an RPC server. The RPC requestor includes a Web application and an RPC service support environment. The PRC requestor executes the steps: the Web application issues an RPC request, including a callback function of various request results, to the PRC service support environment; the RPC service support environment forwards the RPC request to the RPC server and awaits a response message; the RPC service support environment receives the response message from the RPC server and returns request results to the Web application; the Web application calls the callback function according to the request results and performs corresponding operations. The Web application running on a Web engine can directly call a procedure on a remote server to request service, service resources of a network can be fully utilized, and user experience is improved accordingly.
Description
Technical field
The present invention relates to Web field, relate in particular to a kind of RPC system and implementation method based on Web engine.
Background technology
(Sea Computing) calculated for user provides the one-stop service based on internet in sea, is the simplest dependable internet of one demand interactive mode.User is as long as calculate input demand for services in sea, system is this demand of energy explicit recognition just, and processes this demand assignment to optimum application or content resource provider, finally returns to the result that user matches.
Cloud computing (cloud computing) is increase, use and the delivery mode of the related service based on internet, and being usually directed to is provided dynamically easily expansion and be often virtualized resource by internet.
Along with the development of extra large cloud computing, Web engine occupy more and more consequence, Web application development based on Web engine is more and more faster, especially along with the development and improvement of HTML5, Web application has had more characteristics of only having local application just to have before, such as multithreading, audio frequency and video are play, Socket communication, Notification, database manipulation etc.Web application has greatly the trend that replaces traditional this locality application.Remote procedure call (Remote Procedure Call, RPC) is a kind of method that can directly call remote process on local machine, is widely adopted in the Distributed Calculation based on this locality application always.Than Web application, local application has tempo of development slow, and the cycle is long, applies the shortcomings such as stability, robustness is poor.Along with Web application substitutes local application gradually, in extra large cloud computing, allowing the more weak terminal of computing function can carry out fast complicated Web calculates, make full use of other terminal resource of Hai Yunzhong, allow Web engine support RPC remote procedure call, significant for cluster and the Distributed Calculation of Web application.
Summary of the invention
The object of the invention is to, allow the Web that moves on Web engine apply the process implementation that can directly call on remote server and carry out request service, make full use of the Service Source in extra large cloud environment, experience thereby improve user.
For achieving the above object, on the one hand, the invention provides a kind of RPC implementation method based on Web engine, the method is applied in the RPC system that comprises RPC requesting party and RPC service side formation, described RPC requesting party comprises Web application and RPC service supporting environment, and described RPC requesting party carries out following steps:
Described Web application is initiated RPC request to described RPC service supporting environment, and described RPC request comprises the call back function of multiple request results;
Described RPC request is transmitted to described RPC service side by described RPC service supporting environment, and wait acknowledge information;
Described RPC service supporting environment receives the response message from described RPC service side, and request results is returned to described Web application;
Described Web applies according to described request call by result call back function, and operates accordingly.
On the other hand, the invention provides a kind of RPC system based on Web engine, this system comprises RPC request end and RPC service end, and described RPC request end comprises Web application and RPC service supporting environment.
Web is used for being responsible for initiating RPC request to RPC service supporting environment, is responsible for calling call back function according to response message simultaneously, and operates accordingly.
RPC service supporting environment is for being responsible for forwarding to RPC service end the RPC request of Web application, and reception is from the response message of RPC service end.
RPC service end is asked for receiving from the RPC of RPC service supporting environment, and it is resolved, and carries out operation accordingly, and the result of operation is returned to RPC service supporting environment.
Beneficial effect of the present invention is, carrys out request service by the process implementation directly calling on remote server, can make full use of the resource in network; Call by carry out RPC in Web application, call than the existing RPC based on this locality application, its method of calling is simpler.
Accompanying drawing explanation
After embodiments of the present invention being described in detail with way of example below in conjunction with accompanying drawing, other features of the present invention, feature and advantage will be more obvious.
A kind of remote procedure call implementation method schematic flow sheet based on Web engine that Fig. 1 provides for the embodiment of the present invention;
A kind of RPC system structural representation based on Web engine that Fig. 2 provides for the embodiment of the present invention;
A kind of RPC system information interaction schematic diagram based on Web engine that Fig. 3 provides for the embodiment of the present invention.
Embodiment
Below by drawings and Examples, the application's technical scheme is described in further detail.
A kind of remote procedure call implementation method schematic flow sheet based on Web engine that Fig. 1 provides for the embodiment of the present invention, the method is applied in the RPC system that comprises RPC requesting party and RPC service side formation, and this RPC requesting party comprises Web application and RPC service supporting environment.As shown in Figure 1,101-step 104 that the method comprising the steps of.
In step 101, Web application is initiated RPC request to RPC service supporting environment, and described RPC request comprises the call back function of multiple request results.
Web application refers to the Web application realizing with HTML, the JavaScript of standard or CSS script.Domain name by the RPC service side that provides of Web application or IP address and service port number are set up a connection, because current Web engine is supported the WebSocket of HTML5, therefore can adopt the connected mode of WebSocket to set up being connected of Web application and RPC service supporting environment.For example, a RPC service side's connection URI(Uniform Resource Identifier, universal resource identifier) form is ws: //example.com:port, wherein ws represents WebSocket agreement, example.com is service side's domain name, and port is service side's service port number.
Describe by JavaScript script fragment below:
JavaScript script fragment is as follows
Wherein, rpc is the RPC object of the overall JavaScript script of an expansion, needs designated domain name and port numbers when this Object Creation, connects by calling rpc.connect.Object after connecting is successfully session, in session, initiate a RPC request, herein by identify an interface by the mode of URI+ function name, initiate a remote procedure call by session.call, first parameter in call is remote process title, the parameter that parameter is below function.Call back function function(error, desc after call back function function (res) after having successfully after initiating remote procedure call and failure).
In step 102, RPC request is transmitted to RPC service side by RPC service supporting environment, and wait acknowledge information.
Particularly, RPC service supporting environment, after the RPC request receiving from Web application, is resolved it, and sets up RPC with RPC service side and is connected, and the RPC that forwards Web application to it asks, and wait acknowledge information.Between RPC service supporting environment and RPC service side, formulate and have communication protocol.The data layout of its communication request is: request type (1 byte) | request length (4 byte) | the URI length URILength (4 byte) of request | the URI (URILength byte) of request | the length argLength1 (4 byte) of first parameter of request | first parameter (argLength1 byte) | ... | the length argLengthN (4 byte) of N parameter of request | N parameter (argLengthN byte) }, wherein the item in { } is option, request type wherein comprises RPC connection request, RPC call request, the request of RPC disconnecting, its length is 1 byte, request length refers to the length of follow-up communication data, and it takies 4 bytes, and the maximum length of communication data can be 4294967296 bytes, territory is below optional territory, only in the time that request type is RPC call request, just exist, its order with function name and parameter is arranged, and function name is specified with the form of URI, its length is URILength byte, and the length of follow-up parameter is respectively by the parameter length territory designated length before it.
It should be noted that, multiple RPC requests that RPC service supporting environment need to be initiated multiple pages are controlled, by adopting asynchronous communication means, with the generation of avoiding blocking.
In step 103, RPC service supporting environment receives the response message from RPC service side, and request results is returned to described Web application.
Particularly, between RPC service side and RPC service supporting environment, communicate according to the communication protocol of formulating in advance, RPC service side receives after the request from RPC service supporting environment, and it is resolved, carry out corresponding operation, and the result of operation is returned to RPC service supporting environment.
The data layout that RPC service side returns to the response message of RPC service supporting environment is: reply length (4 byte) | response result (1 byte) | and the URI length URILength (4 byte) replying | the URI (URILength byte) replying | | reply data 1 length ackLength1 (4 byte) | reply data 1 (ackLength1 byte) | ... | reply data N length ackLengthN (4 byte) | reply data N (ackLengthN byte) }, wherein, reply the length that length is whole reply data, response result is divided into successfully, failure, can be further divided into more detailed success, failure definition.Reply URI and refer to that this RPC that replys corresponding Web application calls.Equally, the territory in { } is option, has comprised the reply data after RPC asks successfully.
RPC service supporting environment, after the response message receiving from RPC service side, then is resolved the data in response message, is packaged into Web and applies the form that can identify, and return to Web application.
In step 104, Web application is called call back function according to response result, and operates accordingly.
Particularly, Web is applied in after the request results receiving from RPC service supporting environment, calls the call back function of its definition in the time initiating RPC request, if do not define the call back function of certain result in Web application, can not carry out any operation.
The embodiment of the present invention is called and has been incorporated in Web application based on Web engine RPC, allows and in the aspect of Web application, carries out resource sharing between all devices on whole network, can make full use of calculating, the storage resources of whole network.
A kind of RPC system structural representation based on Web engine that Fig. 2 provides for the embodiment of the present invention.As shown in Figure 2, this system comprises RPC request end 20 and RPC service end 30, and described RPC request end 20 comprises Web application 21 and RPC service supporting environment 22.
RPC service supporting environment 22 is for forward the RPC request of Web application to RPC service end 30, and reception is from the response message of RPC service end 30.
Particularly, RPC service supporting environment 22, after the RPC request receiving from Web application, is resolved it, and sets up RPC with RPC service side and is connected, and the RPC that forwards Web application to it asks.
RPC service end 30 is asked for receiving from the RPC of RPC service supporting environment 22, and it is resolved, and carries out operation accordingly, and the result of operation is returned to RPC service supporting environment 22.
A kind of RPC system information interactive process schematic diagram based on Web engine that Fig. 3 provides for the embodiment of the present invention.As showing of Fig. 3, the information interactive process of this system is as follows:
First by the Web application layer of RPC request end, for example, the Web application layer realizing by JavaScript script, sets up being connected of RPC with RPC back-up environment layer, and initiates RPC request to it.RPC back-up environment layer is resolved the RPC solicited message receiving, and forwards this RPC request to RPC service end.RPC service end receives after the RPC request from RPC service supporting environment layer, and it is resolved, and carries out operation accordingly, and the result of operation is returned to RPC service supporting environment layer.The result of RPC request is sent to Web application layer by RPC service supporting environment layer, and Web application layer is called call back function according to response result, and initiate remote procedure call request to RPC back-up environment layer.RPC back-up environment layer is resolved the RPC solicited message receiving, and forwards this RPC request to RPC service end.RPC service end receives after the RPC request from RPC service supporting environment layer, it is processed, and return to result, and Web application layer is called call back function according to result.
The Web that the embodiment of the present invention is moved on Web engine applies the process implementation that can directly call on remote server and carrys out request service, makes full use of the Service Source in extra large cloud environment, experiences thereby improve user.
Obviously, do not departing under the prerequisite of true spirit of the present invention and scope, the present invention described here can have many variations.Therefore, all changes that it will be apparent to those skilled in the art that, within all should being included in the scope that these claims contain.The present invention's scope required for protection is only limited by described claims.
Claims (8)
1. the RPC implementation method based on Web engine, is applied in the RPC system that comprises RPC requesting party and RPC service side formation, and described RPC requesting party comprises Web application and RPC service supporting environment, it is characterized in that, described RPC requesting party carries out following steps:
Described Web application is initiated RPC request to described RPC service supporting environment, and described RPC request comprises the call back function of multiple request results;
Described RPC request is transmitted to described RPC service side by described RPC service supporting environment, and wait acknowledge information;
Described RPC service supporting environment receives the response message from described RPC service side, and request results is returned to described Web application;
Described Web applies according to described request call by result call back function, and operates accordingly.
2. method according to claim 1, is characterized in that: described Web application is set up RPC by JavaScript script with described RPC service side and is connected.
3. method according to claim 1, is characterized in that: between described RPC service supporting environment and described RPC service side, formulate communication protocol, the support of communicating by letter with described RPC service side is provided.
4. method according to claim 1, is characterized in that: described Web application comprises the application by one or more scripts are realized in CSS, HTML and JavaScript script.
5. method according to claim 1, is characterized in that: described Web application connects by the connected mode of WebSocket with described RPC service supporting environment.
6. method according to claim 1, is characterized in that: described Web application is determined RPC service side by domain name and the port numbers of specifying its agreement.
7. method according to claim 1, is characterized in that: the interface definition that described Web application adopts the form of universal resource identifier to specify RPC to call.
8. the RPC system based on Web engine, comprises RPC request end and RPC service end, and described RPC request end comprises Web application and RPC service supporting environment, it is characterized in that:
Web application, initiates RPC request for being responsible for to described RPC service supporting environment, is responsible for calling call back function according to response message simultaneously, and operates accordingly;
RPC service supporting environment, for forward the RPC request of described Web application to described RPC service end, and receives the response message from RPC service end;
RPC service end, for receiving the RPC request from described RPC service supporting environment, and resolves it, carries out operation accordingly, and the result of operation is returned to described RPC service supporting environment.
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 true CN103885973A (en) | 2014-06-25 |
CN103885973B 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) |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106815083A (en) * | 2016-12-20 | 2017-06-09 | 微梦创科网络科技(中国)有限公司 | A kind of client asynchronous processing method and client based on Memcache agreements |
CN107402826A (en) * | 2017-06-30 | 2017-11-28 | 武汉斗鱼网络科技有限公司 | A kind of method and device for carrying out remote procedure call in an asynchronous manner |
CN107526624A (en) * | 2017-07-18 | 2017-12-29 | 杭州趣链科技有限公司 | A kind of intelligent contract enforcement 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 |
CN108093005A (en) * | 2016-11-22 | 2018-05-29 | 北京京东尚科信息技术有限公司 | A kind of management method and system of interface exception call |
CN110430100A (en) * | 2019-08-27 | 2019-11-08 | 中国工商银行股份有限公司 | Network connectivty detection method and device |
CN112328410A (en) * | 2020-11-04 | 2021-02-05 | 网易(杭州)网络有限公司 | Method, device, equipment and storage medium for realizing remote procedure call |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2008152397A (en) * | 2006-12-14 | 2008-07-03 | Canon Inc | Information processing method and device, and information processing system |
CN101697139B (en) * | 2009-11-06 | 2013-04-17 | 金蝶软件(中国)有限公司 | 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
Non-Patent Citations (1)
Title |
---|
姜虹: ""基于Web+Services的RPC体系结构的研究"", 《万方企业数据知识服务平台》 * |
Cited By (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108093005A (en) * | 2016-11-22 | 2018-05-29 | 北京京东尚科信息技术有限公司 | A kind of management method and system of interface exception call |
CN108093005B (en) * | 2016-11-22 | 2020-11-03 | 北京京东尚科信息技术有限公司 | Management method and system for interface abnormal call |
CN106815083A (en) * | 2016-12-20 | 2017-06-09 | 微梦创科网络科技(中国)有限公司 | A kind of client asynchronous processing method and client based on Memcache agreements |
CN106815083B (en) * | 2016-12-20 | 2019-11-12 | 微梦创科网络科技(中国)有限公司 | A kind of client asynchronous processing method and client based on Memcache agreement |
CN107402826A (en) * | 2017-06-30 | 2017-11-28 | 武汉斗鱼网络科技有限公司 | A kind of method and device for carrying out remote procedure call in an asynchronous manner |
CN107526624A (en) * | 2017-07-18 | 2017-12-29 | 杭州趣链科技有限公司 | A kind of intelligent contract enforcement 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 |
CN110430100A (en) * | 2019-08-27 | 2019-11-08 | 中国工商银行股份有限公司 | Network connectivty detection method and device |
CN112328410A (en) * | 2020-11-04 | 2021-02-05 | 网易(杭州)网络有限公司 | Method, device, equipment and storage medium for realizing remote procedure call |
CN112328410B (en) * | 2020-11-04 | 2023-08-08 | 网易(杭州)网络有限公司 | Method, device, equipment and storage medium for realizing remote procedure call |
Also Published As
Publication number | Publication date |
---|---|
CN103885973B (en) | 2017-07-07 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103885973A (en) | Web-engine-based remote procedure call system and implementation method thereof | |
JP6093482B2 (en) | Method and apparatus for displaying search results on portable terminal | |
US10496245B2 (en) | Method for interactive response and apparatus thereof | |
US9794242B2 (en) | Method, apparatus and application platform for realizing logon to an application service website | |
US10455014B2 (en) | Method and apparatus for synchronizing content | |
WO2016127793A1 (en) | Message sending method, apparatus, system, and server | |
CN102393857B (en) | Method and system for local call based on web page | |
US20180343214A1 (en) | Information Exchange Method, Client, and Apparatus | |
KR20140001798A (en) | Application discovery | |
CN108540515B (en) | Data processing method and server | |
CN104378436A (en) | Information push system and method based on server push | |
US11379446B1 (en) | Session-based data storage for chat-based communication sessions | |
CN109274705A (en) | Service providing method, apparatus and system based on user identity | |
US20190370293A1 (en) | Method and apparatus for processing information | |
TW201818317A (en) | Business realization method, payment method, business realization apparatus and payment server | |
CN109218272B (en) | Media content pushing method, device, server, system and storage medium | |
CN112804366B (en) | Method and device for resolving domain name | |
US10108588B2 (en) | Method and system for communicating between client pages | |
CN104602047A (en) | Share method of EPG (error pattern generator) data, server, terminal and system | |
CN109600452B (en) | Server cluster, message pushing method and related server | |
CN103440134A (en) | Webkit kernel-based storage resource service local extension method | |
CN105224573B (en) | A kind of regular data configuration method and device, system | |
WO2017173967A1 (en) | Redirection method, service provider, unstructured supplementary service data center, and system | |
EP3079338B1 (en) | Method for web service supporting synchronous hosting of multiple devices | |
CN112783842A (en) | Log collection method and device |
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 |