CN108418901A - High performance remote procedure calling (PRC) method based on PHP - Google Patents
High performance remote procedure calling (PRC) method based on PHP Download PDFInfo
- Publication number
- CN108418901A CN108418901A CN201810306549.1A CN201810306549A CN108418901A CN 108418901 A CN108418901 A CN 108418901A CN 201810306549 A CN201810306549 A CN 201810306549A CN 108418901 A CN108418901 A CN 108418901A
- Authority
- CN
- China
- Prior art keywords
- php
- remote
- client
- call
- server
- 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.)
- Pending
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/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
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
-
- 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/34—Network arrangements or protocols for supporting network services or applications involving the movement of software or configuration parameters
-
- 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/50—Network services
- H04L67/51—Discovery or management thereof, e.g. service location protocol [SLP] or web services
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer And Data Communications (AREA)
Abstract
The invention discloses a kind of high performance remote procedure calling (PRC) method based on PHP, this method realize the suction parameter of remote method and the data interaction of outlet parameter by way of http protocol.So as to realize the local either PHP remote procedure calls based on intranet INTRANET or based on internet INTERNET;The present invention can be applied to the far call middleware under the frameworks such as SOA, the micro services based on PHP technologies by realizing remote method call by JSON+HTTP technologies under PHP technology stacks.Long-range PHP method functions can be called as calling nation method by only needing to quote fraction of PHP document frameworks using client after the method for the present invention, the serializings of data, telecommunication and, out-of-the-box invisible to user of acting on behalf of details.Ensure the characteristics such as simple, easy-to-use, lightweight, safety, high-performance with real.
Description
Technical field:
The present invention relates to the serializings of data object and unserializing, network-based procedure calling (PRC) method, especially relate to
And remote procedure call (RPC) method based on http protocol.
Background technology:
More representational remote procedure call realization mechanism includes the component object mould of Microsoft in existing technology
The Remoting and WCF technology of type Component Object Model+ technologies, that is, COM+ technologies, microemulsion sample injection platform, it is public
Object request broker architecture Common Object Request Broker Architecture technologies, that is, CORBA technologies,
And enterprise software component model Enterprise Java Beans technologies, that is, Java EJB technologies.COM+ technologies and .NET
Remoting and WCF technology be only suitable for using and can only using the technologies such as VB, C# of mirosoftware under windows platform
Stack, Java EJB technologies only support Java language to develop, and implement to need according to lazy Java Virtual Machine Java Virtual Machine
That is the support of JVM.And the above-mentioned prior art all cannot comprehensively realize following demand:
1. PHP language technology stacks can be supported;
2. the cross-platform support of lightweight;
3. the resilient infrastructure of the system of support, the exploitation from lightweight to platform class can be realized under a kind of architecture mode;
4. the serializing based on JS object tag JavaScript Object Notation, that is, JSON data formats is supported;
5. based on pure hypertext transfer protocol, that is, http protocol;
6. dynamic is supported;
7. relevant function is administered in the service of offer;
8. plug and play is supported;
Therefore a kind of far call frame (implementation) is needed, the tune of remote method can be realized based on PHP technology stacks
It only needs to quote fraction of PHP document frameworks with, client and can call long-range PHP method letters as calling nation method
Number, the serializings of data, telecommunication and, out-of-the-box invisible to user of acting on behalf of details.It is simple, easy-to-use, light with real guarantee
The characteristics such as magnitude, safety, high-performance.
Invention content:
The technical problem to be solved in the present invention is to avoid the deficiencies in the prior art place and propose to give a kind of long-range
The frame method of the invocation of procedure (RPC), it is local either based on intranet INTRANET or based on mutual so as to realize
The PHP remote procedure calls of networking INTERNET;The present invention under PHP technology stacks by JSON+HTTP technologies by being realized
Remote method call, can be applied to the far call middleware under the frameworks such as SOA, the micro services based on PHP technologies.
The method of remote procedure call proposed by the present invention is assisted on the basis of having grasped PHP technologies by HTTP
The mode of view realizes the suction parameter of remote method and the data interaction of outlet parameter.
The present invention, which solves the technical problem, to be achieved through the following technical solutions:
High performance remote procedure calling (PRC) method based on PHP, includes the following steps:
A. propose the remote method Routing Protocol under a kind of communication modes based on HTTP, can provide client Client and
Method between server-side Server and method signature agreement;
B. a kind of Data Serialization method based on JSON is proposed, it can be to PHP basic data types, PHP complex datas
Type, PHP user-defined dada types carry out automatically serializing and unserializing;
C. a kind of long range positioning model is proposed, it can be according to the agreement+IP address or domain name+port+module+method of offer
Mode (the http of name://127.0.0.1:It 8080/user/useradd) is addressed to position;
D. it proposes that the remote method of server-side is marked as remote invocation method in a kind of mode, succession machine may be used
System or name are advised general mode and are realized;
E. propose that a kind of agent way is applied to client, agency is packaged remote method, makes client call remote
Cheng Fangfa is like that nation method is called equally to be simple and efficient;
F. it proposes that a kind of data compression algorithm is optional to compress communication data, reduces the bandwidth during far call
Flow point is used, and allowing far call speed, faster bandwidth occupancy is less;
G. a kind of wrong tracking and feedback mechanism extremely are proposed, facilitates the abnormal problem generated in control far call, just
It is convenient as local debug in the progress DEBUG debugging in far call;
H. it proposes a kind of log mechanism, records the recalls information in remote procedure call and error message;
I. it proposes a kind of service register center mechanism of Publish-subscribe, reduces client Client and server-side Server
The coupling of remote procedure call;
J. it proposes a kind of monitoring mechanism, the call relation and calling amount of service can be monitored;
K. a kind of authority mechanism is proposed, can control client can have the right which is called service;
L. it proposes a kind of fusing mechanism, can be arranged that threshold values index which far call that fuses when reaching threshold values is asked
It asks, to ensure the part far call process occurred;
The high performance remote invocation of procedure (RPC) frame of scheme of the present invention based on PHP, is researched and developed for PHP language
Distribution service using being carried out telecommunication with service and method call, be to client Client/ server ends
Server invocation pattern applications play the role of basic framework, and core content wherein included includes the sequence of various data objects
Change and unserializing, the serializing of remote method and the communication of unserializing, client to server-side.
So, only needing to quote fraction of PHP document frameworks using client after the method for the present invention can be as calling
Nation method equally calls long-range PHP method functions, the serializings of data, telecommunication and act on behalf of details can not to user
See, out-of-the-box.Ensure the characteristics such as simple, easy-to-use, lightweight, safety, high-performance with real.
Description of the drawings:
It is further illustrated the present invention below in conjunction with the drawings and specific embodiments.
Fig. 1 is that the high performance remote procedure calling (PRC) method of the present invention based on PHP is illustrated in the flow of specific embodiment
Figure.
Specific implementation mode:
In order to make the technical means, the creative features, the aims and the efficiencies achieved by the present invention be easy to understand, tie below
Conjunction is specifically illustrating, and the present invention is further explained.
As shown in Figure 1, the present invention is to propose that a kind of remote procedure calling (PRC) method based on PHP technology stacks, the frame are used for
Network system including server-side and client.The server end for realizing the software and hardware of service function by forming.It is described
Client for realizing the software and hardware of client functionality by forming.The client is by based on hypertext transfer protocol, that is, HTTP
Agreement is established the link with server-side.Described method includes following steps:
As shown in step 104 in Fig. 1, server-side will need the class for being exposed to client and method to be marked as remote process side
Method, class need to inherit GyRpc classes, and method needs are terminated with GyFunc, can be set method to by above two step
The method of calling, supply client use.Code sample is as follows:
Class Contract extends GyRpc remote method Similar integral GyRpc classes
Public function getContractGyFunc ($ params) remote method is ended up with GyFunc
As shown in step 101 in Fig. 1, client needs to create the agency of remote procedure call, this agency is exactly to pass through this
Frame generates, and remote process method can be called by agency.Code sample is as follows:
use GyRpc\Client;Quote this frame
$ rpc=Yaf_Registry::get(“GyRpc”);According to configuration initialization remote procedure call agency
$this->Contract=Client::create($rpc->host.’contract’,false);It creates long-range
The agency of method class
As shown in step 102 in Fig. 1, after the agency for creating remote procedure calling (PRC) method, so that it may be adjusted with using agency
With remote method, used as using nation method.Code sample is as follows:
$ contractDoc=$ this->Contract->getContractGyFunc($contractSysNo);It calls
Remote process method is passed to method signature parameter and the return value of adquisitiones
As shown in step 103 in Fig. 1, remote procedure call frame can carry out data sequence to the data of client and behavior
Change, the data transmission in remote procedure call, serializing completion afterframe foundation is facilitated to link and sending long-range with server-side
Procedure call information is to server-side.
As shown in step 106 and 107 in Fig. 1, the data that server-side has received client transmission are parsed.And to solution
Analysis carries out the method call relationship that unserializing generates localization.
As shown in step 108 and 109 in Fig. 1, framework services end is local with being carried out according to the request logic and data of client
Change method call, carry out serializing after the completion of calling and returns to client.
As shown in step 120 and 121 in Fig. 1, Client Agent obtains server-side return after completing a far call
Call result information data acts on behalf of the local PHP data class for carrying out unserializing parsing to data and returning to remote method return
Type.
The above shows and describes the basic principles and main features of the present invention and the advantages of the present invention.The technology of the industry
Personnel are it should be appreciated that the present invention is not limited to the above embodiments, and the above embodiments and description only describe this
The principle of invention, without departing from the spirit and scope of the present invention, various changes and improvements may be made to the invention, these changes
Change and improvement all fall within the protetion scope of the claimed invention.The claimed scope of the invention by appended claims and its
Equivalent thereof.
Claims (2)
1. the high performance remote procedure calling (PRC) method based on PHP, includes the following steps:
A. it proposes the remote method Routing Protocol under a kind of communication modes based on HTTP, client Client and service can be provided
Hold the method and method signature agreement between Server;
B. propose a kind of Data Serialization method based on JSON, can to PHP basic data types, PHP complex data types,
PHP user-defined dada types carry out automatically serializing and unserializing;
C. a kind of long range positioning model is proposed, it can be according to agreement+IP address of offer or domain name+port+module+method name
Mode is addressed to position;
D. propose that the remote method of server-side is marked as remote invocation method in a kind of mode, may be used inheritance mechanism or
It is that the general mode of name rule is realized;
E. propose that a kind of agent way is applied to client, agency is packaged remote method, allows client call remote parties
Method is like that nation method is called equally to be simple and efficient;
F. it proposes that a kind of data compression algorithm is optional to compress communication data, reduces the bandwidth traffic during far call
Point is used, and allowing far call speed, faster bandwidth occupancy is less;
G. a kind of abnormal tracking of mistake and feedback mechanism are proposed, the abnormal problem generated in control far call is facilitated, convenient for
DEBUG debugging is carried out when far call, it is convenient as local debug;
H. it proposes a kind of log mechanism, records the recalls information in remote procedure call and error message;
I. it proposes a kind of service register center mechanism of Publish-subscribe, it is long-range to reduce client Client and server-side Server
The coupling of the invocation of procedure;
J. it proposes a kind of monitoring mechanism, the call relation and calling amount of service can be monitored;
K. a kind of authority mechanism is proposed, can control client can have the right which is called service;
L. it proposes a kind of fusing mechanism, threshold values index can be set and fused when reaching threshold values the request of which far call,
To ensure the part far call process occurred.
2. the high performance remote procedure calling (PRC) method according to claim 1 based on PHP, which is characterized in that in the method
Server-side will need the class for being exposed to client and method to be marked as remote process method, and class needs to inherit GyRpc classes, and method needs
To be terminated with GyFunc.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810306549.1A CN108418901A (en) | 2018-04-08 | 2018-04-08 | High performance remote procedure calling (PRC) method based on PHP |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810306549.1A CN108418901A (en) | 2018-04-08 | 2018-04-08 | High performance remote procedure calling (PRC) method based on PHP |
Publications (1)
Publication Number | Publication Date |
---|---|
CN108418901A true CN108418901A (en) | 2018-08-17 |
Family
ID=63134911
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810306549.1A Pending CN108418901A (en) | 2018-04-08 | 2018-04-08 | High performance remote procedure calling (PRC) method based on PHP |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108418901A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113010899A (en) * | 2021-04-16 | 2021-06-22 | 上海交通大学 | PHP deserialization vulnerability exploitation chain detection method |
CN114356592A (en) * | 2021-11-30 | 2022-04-15 | 北京大生在线科技有限公司 | PHP-based high-performance remote procedure call system and method thereof |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20080209451A1 (en) * | 2007-01-29 | 2008-08-28 | Mashery, Inc. | Methods for analyzing, limiting, and enhancing access to an internet API, web service, and data |
CN101610282A (en) * | 2009-07-16 | 2009-12-23 | 浪潮电子信息产业股份有限公司 | A kind of method that combines based on the centralized management of storage multinode and the single node management of http protocol |
US20170344618A1 (en) * | 2010-12-23 | 2017-11-30 | Eliot Horowitz | Systems and methods for managing distributed database deployments |
-
2018
- 2018-04-08 CN CN201810306549.1A patent/CN108418901A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20080209451A1 (en) * | 2007-01-29 | 2008-08-28 | Mashery, Inc. | Methods for analyzing, limiting, and enhancing access to an internet API, web service, and data |
CN101610282A (en) * | 2009-07-16 | 2009-12-23 | 浪潮电子信息产业股份有限公司 | A kind of method that combines based on the centralized management of storage multinode and the single node management of http protocol |
US20170344618A1 (en) * | 2010-12-23 | 2017-11-30 | Eliot Horowitz | Systems and methods for managing distributed database deployments |
Non-Patent Citations (2)
Title |
---|
SPENCER MORTENSEN: "JSON-RPC over HTTP(S) for PHP", 《GITHUB》 * |
张羽: "一种分布式服务治理框架的设计与实现", 《中国优秀硕士学位论文全文数据库 信息科技辑》 * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113010899A (en) * | 2021-04-16 | 2021-06-22 | 上海交通大学 | PHP deserialization vulnerability exploitation chain detection method |
CN114356592A (en) * | 2021-11-30 | 2022-04-15 | 北京大生在线科技有限公司 | PHP-based high-performance remote procedure call system and method thereof |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP1204259B1 (en) | Data management framework for policy management | |
Hong et al. | Web-based intranet services and network management | |
US6782420B1 (en) | Telecommunications network with a distributive network management system | |
US7509431B2 (en) | Performing message and transformation adapter functions in a network element on behalf of an application | |
EP2561656B1 (en) | Servlet api and method for xmpp protocol | |
US7698416B2 (en) | Application layer message-based server failover management by a network element | |
US6665674B1 (en) | Framework for open directory operation extensibility | |
US20030069922A1 (en) | Network transaction portal to control multi-service provider transactions | |
US20050044188A1 (en) | Service providing system allowing flexible cooperation between applications exploiting different protocols | |
US20060167897A1 (en) | Administration of a broker-based publish/subscribe messaging system | |
MXPA04002729A (en) | Transmitting and receiving messages through a customizable communication channel and programming model. | |
EP1401169A1 (en) | Method and system using a Meta service selector for deploying services over a plurality of networks | |
Bernstein et al. | Using XMPP as a transport in Intercloud Protocols | |
US11411812B2 (en) | Dynamic service creation for microservice-based integration service | |
CN108418901A (en) | High performance remote procedure calling (PRC) method based on PHP | |
CN112988409A (en) | Interface calling method and device, computer equipment and storage medium | |
CN103391294A (en) | Remote method invocation based on service description | |
Stopper et al. | Service-oriented architecture design aspects of OPC UA for industrial applications | |
WO2003024054A2 (en) | Inbound connector | |
Chou et al. | Web service enablement of communication services | |
KR100395223B1 (en) | TEM and CIO Albier Interworking System | |
Calladine | Giving legs to the legacy—Web Services integration within the enterprise | |
Sunkari et al. | Integration of WhatsApp with Salesforce by RESTful Services | |
Zhu et al. | Enhancing ESB based execution platform to support flexible communication Web services over heterogeneous networks | |
Binder et al. | Service invocation triggers: a lightweight routing infrastructure for decentralised workflow orchestration |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20180817 |
|
WD01 | Invention patent application deemed withdrawn after publication |