CN110032458A - A kind of across language unity calling system of PHP - Google Patents

A kind of across language unity calling system of PHP Download PDF

Info

Publication number
CN110032458A
CN110032458A CN201910294370.3A CN201910294370A CN110032458A CN 110032458 A CN110032458 A CN 110032458A CN 201910294370 A CN201910294370 A CN 201910294370A CN 110032458 A CN110032458 A CN 110032458A
Authority
CN
China
Prior art keywords
service
information
module
services
unit
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
Application number
CN201910294370.3A
Other languages
Chinese (zh)
Other versions
CN110032458B (en
Inventor
金先友
巫嘉
周银燕
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chongqing Tianpeng Network Co Ltd
Original Assignee
Chongqing Tianpeng Network Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Chongqing Tianpeng Network Co Ltd filed Critical Chongqing Tianpeng Network Co Ltd
Priority to CN201910294370.3A priority Critical patent/CN110032458B/en
Publication of CN110032458A publication Critical patent/CN110032458A/en
Application granted granted Critical
Publication of CN110032458B publication Critical patent/CN110032458B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/544Buffers; Shared memory; Pipes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)
  • Telephonic Communication Services (AREA)

Abstract

The invention discloses a kind of across the language unity calling systems of PHP, including service providing module, service register center module, cache registration center's module, service consumption module and SDK source code generation module, called side in service consumption application calls the service consumption module to trigger across language call, information on services query unit in service consumption module provides unit to the information on services of caching registration center's module and initiates inquiry request, to obtain information on services, and the information on services that will acquire is sent to the service interface call unit initiation service call of the service consumption module.By one caching registration center module of setting, the service-seeking at the end PHP all passes through caching registration center and inquires and initiate that service providing module is called to realize across language call the present invention.

Description

A kind of across language unity calling system of PHP
Technical field
The present invention relates to multi-language system calling technology field more particularly to a kind of across the language unity calling systems of PHP.
Background technique
SOA system generally can all have unified service register center, and registration center is general to use Zookeeper conduct again The storage of data.PHP is the language suitable for quickly doing web exploitation, is suitable for the iteratively faster of Internet enterprises.Business development The case where will being related to multilingual calling to certain phase, some stable business can use other Languages such as java weight It writes and service is provided.This stage will be related to the problem of across language call.PHP passes through when calling the conventional way of this kind of service The Data Concurrent of the Zookeeper expanding query Zookeeper server of PHP, which rises, to be called.Since the extension is chronically at nobody Maintenance state and the Zookeeper node change data that often will appear the end PHP often and can not receive monitoring, provided that service Node is offline no longer to provide service, and the end PHP still will continue to call original service to lead to the failure influence business.If all passed through Zookeeper server query service is directly inquired, primary request will initiate multiple Zookeeper server inquiry, to even Connect it is several uncontrollable, may greatly press across Zookeeper server cause it is all service it is unavailable, Normal practice to interface call Access side, side is unfriendly, needs continuous referenced interface document.
Summary of the invention
For the defects in the prior art, the present invention provides a kind of across language unity calling system of PHP, and a caching is arranged Registration center's module, the service-seeking at the end PHP all passes through caching registration center and inquires and initiate to call, to promote calling rate.
The present invention solves above-mentioned technical problem by following technological means:
A kind of across language unity calling system of PHP, comprising: service providing module, service register center module, caching registration Center module, service consumption module and SDK source code generation module;
The service providing module is the component in service consumption application, externally provides http service, receives from PHP The request of application is held, analysis request parameter executes service corresponding operation and operating result is returned to PHP and calls end;
The service register center module receives the request of the service providing module registration service, records and can provide clothes Version, server ip and the port information of business are used for caching registration center's module polls;
Caching registration center's module is used to cache the information of the service register center module, is monitored by registration center Unit, service information pushing unit, information on services cache unit, information on services provide unit and service information query unit group At registration center's monitoring unit receives the service change message of the service register center module, when the registration center After monitoring unit receives service change message, become from the information on services query unit to the service register center module polls Information on services after more, then transfer to the service information pushing unit by the service information pushing after change to the information on services It caches in cache unit, is used so that the information on services provides unit inquiry;
The service consumption module be also service consumption application in component, by service consumption apply in called side call The service consumption module is triggered across language call, and the service consumption module is by information on services query unit and service interface Call unit composition;The information on services query unit provides unit to the information on services and initiates inquiry request, to obtain clothes Business information, and the information on services that will acquire is sent to the service interface call unit and initiates service call;
The SDK source code generation module is used to generate the realization code of the service consumption module.
Further, after the information on services provides the inquiry request that unit receives the information on services query unit, inquiry Information on services is simultaneously fed back to the information on services query unit by information on services in the information on services cache unit.
Further, information on services on startup, is sent to the service register center module and infused by the service consumption application Volume service, to show service that the service consumption application can be provided externally.
Further, it when the service interface call unit initiates service call, if calling failure, is connect by the service Mouth call unit record log, and return to the mistake of the called side malloc failure malloc;, whereas if call successfully, then basis Definition in information on services is sent to the called side after being formatted the data that service returns.
Further, the information on services includes IP and the port for the service that provides.
Further, the generation data source of the SDK source code generation module derives from service provider, service provider definition The data structure that service list to be offered, the parameter needed using service and service are returned, the generation data source and generation SDK source code afterwards is stored in source code memory module.
Further, the SDK source code generates the service that system generates the service consumption module using Code Template The realization code of information query unit and the service interface call unit language.
Further, the DK source code generates system and generates the Language Document for the service that service provider provides, calls service Function name, the parameter verification code for calling service, initiates information on services inquiry code, initiates clothes at the function parameter for calling service Code and processing call result code are called in business, and service call code is initiated in execution can initiate across language call.
The beneficial effects of the present invention are embodied in: the present invention passes through one caching registration center module of setting, the service at the end PHP Inquiry is all inquired by caching registration center and initiates to call, to promote calling rate.Caching registration center's module can be received in real time To the change of service register center module, business terminates and introduces unstable extension function into being used without, service code It writes simpler direct.Keep access way simpler direct after API SDK access code building, the code of IDE is made full use of to mention Show completion function, promotes the efficiency of access research and development, promote the efficiency to cooperate between each business end.
Detailed description of the invention
It, below will be to specific in order to illustrate more clearly of the specific embodiment of the invention or technical solution in the prior art Embodiment or attached drawing needed to be used in the description of the prior art are briefly described.In all the appended drawings, similar element Or part is generally identified by similar appended drawing reference.In attached drawing, each element or part might not be drawn according to actual ratio.
Fig. 1 is a kind of structural schematic diagram of the PHP across language unity calling system of the present invention.
Specific embodiment
It is described in detail below in conjunction with embodiment of the attached drawing to technical solution of the present invention.Following embodiment is only used for Clearly illustrate technical solution of the present invention, therefore be only used as example, and cannot be used as a limitation and limit protection model of the invention It encloses.
It should be noted that unless otherwise indicated, technical term or scientific term used in this application should be this hair The ordinary meaning that bright one of ordinary skill in the art are understood.
As shown in Figure 1, across the language unity calling system of a kind of PHP of the invention, comprising: service providing module, service note Volume center module, caching registration center's module, service consumption module and SDK source code generation module.
Service providing module is the component in service consumption application, externally provides http service, and receiving is answered from the end PHP Request, analysis request parameter execute service corresponding operation and operating result are returned to PHP and call end;Service consumption Using on startup, information on services is sent to service register center Module registers service, to show that the service consumption application can be with The service externally provided.
Service register center module receives the request of service providing module registration service, records service available version Originally, server ip and port information are used for caching registration center's module polls.
The information that registration center's module is used for buffer service registration center module is cached, by registration center's monitoring unit, clothes Information push unit, information on services cache unit, information on services offer unit and the service information query unit of being engaged in form, in registration Heart monitoring unit receives the service change message of service register center module, disappears when registration center's monitoring unit receives service change After breath, from information on services query unit to the change of service register center module polls after information on services, then transfer to information on services Push unit caches the service information pushing after change into information on services cache unit, looks into so that information on services provides unit It askes and uses.Registration center's monitoring unit, service information pushing unit and other units can be used different language and realize, It may operate on different servers and communicated by network, monitored in registration to solve PHP language in this way The unstable key problem of the heart.
Service consumption module be also service consumption application in component, by service consumption apply in called side call service Consumption module is triggered across language call, and service consumption module is by information on services query unit and service interface call unit group At;When calling, information on services query unit provides unit to information on services and initiates inquiry request, to obtain information on services, service Information on services after information provider unit receives the inquiry request of information on services query unit, in query service information cache unit And information on services is fed back into information on services query unit, the information on services that information on services query unit will acquire is sent to service Interface call unit initiates service call;Specifically, when service interface call unit initiates service call, if calling failure, Then by service interface call unit record log, and return to the mistake of called side malloc failure malloc;, whereas if call successfully, Be sent to called side, information on services includes mentioning after then the data that service returns being formatted according to the definition in information on services IP and port for service.
SDK source code generation module is used to generate the realization code of service consumption module, the generation number of SDK source code generation module Service provider is derived from according to source.Service provider defines service list to be offered, the parameter and service needed using service The data structure (abbreviation API definition thereafter) of return.SDK source code generation module generates service consumption module using Code Template The realization code of information on services query unit and service interface call unit language.SDK source code generation module generates the service Language Document, the function parameter for calling service, the parameter verification for calling service, initiates information on services at the function name for calling service Code is inquired, service call code is initiated and handles call result code (generating the returned data structure in API definition).It generates Service documents be included in code, can state that the service used needs parameters to be offered, parameters on document Type, the description of parameters and the data structure of calling the service to return, such developer compiled using IDE developing instrument Meeting automatic prompt uses the information of the service when writing code, and auto-complete calls code, to promote the efficiency of research and development used.Code Defined parameters verifying collection in template is generated, the verifying collection needed is extracted according to the parameter definition of service and generates code, if called Parameter error does not need then to initiate to call, directly return call parameters mistake.The realization code needs of different service creations are put Below different directories and the code of generation is not also identical, and complete Service name should be formed one by one with the file path for generating code Corresponding relationship, when calling, find the initiation service call code of generation further according to this corresponding relationship, execute and initiate service call Code can be initiated across language call.For the management convenient for cooperation and application between developer, SDK source code after generation and API definition is uniformly submitted in source code memory module, obtains API definition from source code memory module by SDK source code generation module SDK source code is generated to be then stored into source code memory module later.
Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention., rather than its limitations;To the greatest extent Pipe present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that: its according to So be possible to modify the technical solutions described in the foregoing embodiments, or to some or all of the technical features into Row equivalent replacement;And these are modified or replaceed, various embodiments of the present invention technology that it does not separate the essence of the corresponding technical solution The range of scheme should all cover within the scope of the claims and the description of the invention.

Claims (8)

1. a kind of across language unity calling system of PHP characterized by comprising service providing module, service register center mould Block, caching registration center's module, service consumption module and SDK source code generation module;
The service providing module is the component in service consumption application, externally provides http service, and receiving is answered from the end PHP Request, analysis request parameter execute service corresponding operation and operating result are returned to PHP and call end;
The service register center module receives the request of the service providing module registration service, records service available Version, server ip and port information are used for caching registration center's module polls;
Caching registration center's module is used to cache the information of the service register center module, is monitored by registration center single Member, service information pushing unit, information on services cache unit, information on services provide unit and service information query unit composition, Registration center's monitoring unit receives the service change message of the service register center module, when the registration center monitors After unit receives service change message, after being changed from the information on services query unit to the service register center module polls Information on services, then the service information pushing unit is transferred to cache the service information pushing after change to the information on services It caches in unit, is used so that the information on services provides unit inquiry;
The service consumption module be also service consumption application in component, as service consumption apply in called side call described in Service consumption module is triggered across language call, and the service consumption module is called by information on services query unit and service interface Unit composition;The information on services query unit provides unit to the information on services and initiates inquiry request, to obtain service letter Breath, and the information on services that will acquire is sent to the service interface call unit and initiates service call;
The SDK source code generation module is used to generate the realization code of the service consumption module.
2. across the language unity calling system of a kind of PHP according to claim 1, which is characterized in that the information on services mentions After the inquiry request for receiving the information on services query unit for unit, the service letter in the information on services cache unit is inquired It ceases and information on services is fed back into the information on services query unit.
3. across the language unity calling system of a kind of PHP according to claim 1, which is characterized in that the service consumption is answered With on startup, information on services is sent to the service register center Module registers service, to show that the service consumption application can With the service externally provided.
4. across the language unity calling system of a kind of PHP according to claim 1, which is characterized in that the service interface tune When initiating service call with unit, if calling failure, by the service interface call unit record log, and institute is returned to State the mistake of called side malloc failure malloc;, whereas if calling successfully, then the number returned to service according to the definition in information on services According to being sent to the called side after being formatted.
5. across the language unity calling system of a kind of PHP according to claim 4, which is characterized in that the information on services packet IP and the port of the service of offer are provided.
6. across the language unity calling system of a kind of PHP according to claim 1, which is characterized in that the SDK source code generates The generation data source of module derives from service provider, and service provider defines service list to be offered, is needed using service Parameter and service return data structure, it is described generate data source and generate after SDK source code be stored in source code storage mould In block.
7. across the language unity calling system of a kind of PHP according to claim 1, which is characterized in that the SDK source code generates System generates the information on services query unit of the service consumption module using Code Template and the service interface calls The realization code of unit language.
8. across the language unity calling system of a kind of PHP according to claim 7, which is characterized in that the DK source code generates System generates the Language Document for the service that service provider provides, the function name for calling service, the function parameter for calling service, calls The parameter verification code of service initiates information on services inquiry code, initiates service call code and processing call result code, holds Row, which initiates service call code, can initiate across language call.
CN201910294370.3A 2019-04-12 2019-04-12 PHP cross-language unified calling system Active CN110032458B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910294370.3A CN110032458B (en) 2019-04-12 2019-04-12 PHP cross-language unified calling system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910294370.3A CN110032458B (en) 2019-04-12 2019-04-12 PHP cross-language unified calling system

Publications (2)

Publication Number Publication Date
CN110032458A true CN110032458A (en) 2019-07-19
CN110032458B CN110032458B (en) 2020-07-10

Family

ID=67238354

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910294370.3A Active CN110032458B (en) 2019-04-12 2019-04-12 PHP cross-language unified calling system

Country Status (1)

Country Link
CN (1) CN110032458B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6772206B1 (en) * 2000-12-19 2004-08-03 Novell, Inc. XML-based integrated services bridging
CN102098296A (en) * 2010-12-29 2011-06-15 北京新媒传信科技有限公司 Method and system for realizing remote call
CN103973812A (en) * 2014-05-23 2014-08-06 上海斐讯数据通信技术有限公司 Service interface providing method and system based on uniform resource locator in HTTP
CN106325930A (en) * 2016-08-23 2017-01-11 北京百度网讯科技有限公司 Method and device for notifying change of configuration files
CN106411933A (en) * 2016-11-15 2017-02-15 深圳市彬讯科技有限公司 Lightweight RPC framework capable of service management and language calling
CN107665243A (en) * 2017-09-11 2018-02-06 安徽慧视金瞳科技有限公司 A kind of across language environment data interactive method based on database access
CN108255615A (en) * 2017-11-30 2018-07-06 平安科技(深圳)有限公司 Across language call method, server and storage medium
CN108614776A (en) * 2018-05-04 2018-10-02 艺龙网信息技术(北京)有限公司 Across the dynamic fixing method and system of language protocol test request
KR20190021897A (en) * 2017-08-24 2019-03-06 주식회사 마이콤마 Method for multilingual resistration of merchandise information using automatic translation and automated transaction matching

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6772206B1 (en) * 2000-12-19 2004-08-03 Novell, Inc. XML-based integrated services bridging
CN102098296A (en) * 2010-12-29 2011-06-15 北京新媒传信科技有限公司 Method and system for realizing remote call
CN103973812A (en) * 2014-05-23 2014-08-06 上海斐讯数据通信技术有限公司 Service interface providing method and system based on uniform resource locator in HTTP
CN106325930A (en) * 2016-08-23 2017-01-11 北京百度网讯科技有限公司 Method and device for notifying change of configuration files
CN106411933A (en) * 2016-11-15 2017-02-15 深圳市彬讯科技有限公司 Lightweight RPC framework capable of service management and language calling
KR20190021897A (en) * 2017-08-24 2019-03-06 주식회사 마이콤마 Method for multilingual resistration of merchandise information using automatic translation and automated transaction matching
CN107665243A (en) * 2017-09-11 2018-02-06 安徽慧视金瞳科技有限公司 A kind of across language environment data interactive method based on database access
CN108255615A (en) * 2017-11-30 2018-07-06 平安科技(深圳)有限公司 Across language call method, server and storage medium
CN108614776A (en) * 2018-05-04 2018-10-02 艺龙网信息技术(北京)有限公司 Across the dynamic fixing method and system of language protocol test request

Also Published As

Publication number Publication date
CN110032458B (en) 2020-07-10

Similar Documents

Publication Publication Date Title
US8954952B2 (en) Portable business process deployment model across different application servers
US8856800B2 (en) Service-level enterprise service bus load balancing
Kircher et al. Pattern-oriented software architecture, patterns for resource management
US9565092B2 (en) Enterprise service bus deployment at the level of individual services
JP4464525B2 (en) Centralized affinity maintenance apparatus and method in a client / server data processing system managed by workload
WO2010116676A1 (en) Service providing apparatus, service providing system, service providing apparatus data processing method and computer program
US20070174815A1 (en) Decentralized system services
US8768884B2 (en) Synchronization of dissimilar databases
US20070011274A1 (en) Data transfer in a multi-environment document management system access
US20090055511A1 (en) Non-programmatic access to data and to data transfer functions
CN114553960A (en) Data caching method, device, equipment and storage medium
US20130159468A1 (en) Computer implemented method, computer system, electronic interface, mobile computing device and computer readable medium
WO2023125755A1 (en) Service request processing method and apparatus based on large-scale cluster, and device and medium
CN110032458A (en) A kind of across language unity calling system of PHP
US20120173658A1 (en) Schema Validation Proxy
CN116414628A (en) Transaction request processing method and device in new and old system switching process
Ezenwoye et al. A Proxy-Based Approach to Enhancing the Autonomic Behavior in Composite Services.
KR20170122874A (en) Apparatus for managing log of application based on data distribution service
US6876995B1 (en) Web store events
Hahn et al. Modeling data transformations in data-aware service choreographies
KR101888131B1 (en) Method for Performing Real-Time Changed Data Publish Service of DDS-DBMS Integration Tool
Junaid et al. Analyzing the Performance of a DAPP Using Blockchain 3.0
US11582345B2 (en) Context data management interface for contact center
US11863649B2 (en) Systems and methods for context-aware event ordering protocol for distributed service systems
CN113590696B (en) Management method and system for distributed application coordination service

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
GR01 Patent grant
GR01 Patent grant