CN106686021B - Service calling method and gateway - Google Patents
Service calling method and gateway Download PDFInfo
- Publication number
- CN106686021B CN106686021B CN201510744686.XA CN201510744686A CN106686021B CN 106686021 B CN106686021 B CN 106686021B CN 201510744686 A CN201510744686 A CN 201510744686A CN 106686021 B CN106686021 B CN 106686021B
- Authority
- CN
- China
- Prior art keywords
- service
- calling
- service information
- http
- parameter
- 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
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/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
- H04L12/00—Data switching networks
- H04L12/66—Arrangements for connecting between networks having differing types of switching systems, e.g. gateways
-
- 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/60—Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer And Data Communications (AREA)
Abstract
The application discloses a service calling method and a gateway, wherein the method comprises the following steps: calling a service request direction to provide a system of a service and sending an Http parameter, wherein the Http parameter carries calling service information; the gateway of the system for providing the service analyzes the received Http parameter by using Http protocol to obtain the calling service information, calls a service framework Application Programming Interface (API) through the system according to the calling service information, calls a corresponding service, and returns a calling result to the calling service requester. The invention can realize service calling between cross-language systems and is easy to develop and use.
Description
Technical Field
The present invention relates to computer network technology, and in particular, to a service invocation method and a gateway.
Background
At present, a large website or a large system is realized by adopting a service oriented architecture component model (SOA), the whole system is subdivided into a plurality of subsystems by the project of the same language, and the subsystems are interacted through a service calling framework, so that the efficiency of the system is improved. However, when the external system is a cross-language system and the present system is a cross-language system, the current problem cannot be solved only by a service invocation mode, and at this time, each service subsystem needs to be published as webservice or other similar services for the external system to invoke. Thus, a WebService interface service that separately writes calls for calls that provide external systems is needed.
Because the number of interfaces for calling the current system by the external system is large in the prior art, the complexity of system development and use is inevitably increased by adopting the method of issuing the WebService interface service for each interface for external system calling. At present, a scheme capable of effectively solving the problems is not provided.
Disclosure of Invention
In view of the above, the main objective of the present invention is to provide a service invocation method and a gateway, which can implement service invocation between cross-language systems and are easy to develop and use.
In order to achieve the purpose, the technical scheme provided by the invention is as follows:
a service invocation method, comprising:
calling a service request direction to provide a system of a service and sending a hypertext transfer protocol Http parameter, wherein the Http parameter carries calling service information;
the gateway of the system for providing the service analyzes the received Http parameter by using Http protocol to obtain the calling service information, calls a service framework Application Programming Interface (API) through the system according to the calling service information, calls a corresponding service, and returns a calling result to the calling service requester.
A service invocation gateway, comprising:
the analysis module is used for carrying calling service information after receiving the Http parameter sent by the calling service request party, and analyzing the received Http parameter by using the Http protocol to obtain the calling service information;
and the calling module is used for calling a service framework Application Programming Interface (API) through the system according to the calling service information, calling corresponding services and returning a calling result to the calling service requester.
An apparatus for service invocation, comprising:
a memory; and
a processor coupled to the memory, the processor configured to perform any of the methods described above based on instructions stored in the memory.
A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, implements the method of any of the above.
In summary, the service invocation method and the gateway provided by the invention are based on the Http protocol, and are responsible for converting Http parameters of service invocation of each external system into corresponding service invocation by using one gateway, so that a seamless connection result of the invocation between cross-language systems can be achieved. Therefore, WebService interface service for independently writing and calling for calling of the external system is not needed, and complexity of system development and use can be greatly reduced.
Drawings
FIG. 1 is a schematic flow chart of a method according to an embodiment of the present invention;
fig. 2 is a schematic diagram of a gateway structure according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in further detail with reference to the accompanying drawings and specific embodiments.
The core idea of the invention is as follows: for each application system, a gateway is utilized, based on an Http protocol, to process Http requests of service calls of each subsystem in the external system to the external system, specifically, the gateway calls a corresponding interface service of the external system according to call service information in the Http requests, and returns a result to the external system. Therefore, each interface does not need to be issued into a WebService interface service to be called by an external system, and further the WebService interface service which is independently written and called for calling the external system is not needed, so that the complexity of system development and use can be greatly reduced.
Fig. 1 is a schematic flow chart of a method according to an embodiment of the present invention, as shown in fig. 1, the embodiment mainly includes:
In this step, the service calling requester does not need to call the service in the form of WebService interface call, but only needs to notify the system providing the service of the calling service information in the form of Http parameter. Therefore, on one hand, during system development, developers do not need to write and call the WebService interface service independently for providing external system calls, and on the other hand, during use, a call service requester does not need to master a large amount of WebService interface information, so that complexity of service call development and use can be greatly reduced.
Preferably, the calling parameter information includes: the name of the service, the name of the method, the parameters, and the name of the group that are invoked.
And step 102, the gateway of the system for providing the service analyzes the received Http parameter by using Http protocol to obtain the calling service information, calls a service framework API through the system according to the calling service information, calls a corresponding service, and returns a calling result to the calling service requester.
In this step, the system for providing services uses a gateway to perform unified processing on the call request of the external system, and analyzes corresponding call service information from the Http parameter sent by the call service requester based on the Http protocol, and then uses the system call service framework API to directly call corresponding services according to the call service information, and returns the result to the caller. Therefore, when the system interface is developed, a set of external system calling interfaces do not need to be developed independently, and cross-language service calling can be realized by directly calling and converting through the gateway.
In this step, the specific method for parsing out the calling service information based on the Http protocol and the specific method for directly calling the corresponding service by using the system calling service framework API are known to those skilled in the art, and are not described herein again.
In practical application, if the service provided by the system is a service deployed by a cluster, the gateway can route the service to different clusters according to the incoming parameter data and the routing information configured in the routing configuration table.
Fig. 2 is a schematic structural diagram of a service invocation gateway corresponding to the above method, and as shown in fig. 2, the gateway includes:
the analysis module is used for carrying calling service information after receiving the Http parameter sent by the calling service request party, and analyzing the received Http parameter by using the Http protocol to obtain the calling service information;
and the calling module is used for calling a service framework Application Programming Interface (API) through the system according to the calling service information, calling corresponding services and returning a calling result to the calling service requester.
Preferably, the calling parameter information includes: the name of the service, the name of the method, the parameters, and the name of the group that are invoked.
In summary, the above description is only a preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims (4)
1. A service invocation method, characterized by comprising:
calling a service request direction to provide a system of a service and sending a hypertext transfer protocol Http parameter, wherein the Http parameter carries calling service information; the calling service information includes: the called service name, method name, parameter and group name; the calling service information is used for the system for providing the service to directly call the corresponding service by calling a service framework Application Programming Interface (API);
the gateway of the system for providing the service analyzes the received Http parameter by using Http protocol to obtain the calling service information, calls a service framework Application Programming Interface (API) through the system according to the calling service information, calls a corresponding service, and returns a calling result to the calling service requester.
2. A service invocation gateway, characterized in that it comprises:
the analysis module is used for carrying calling service information after receiving the Http parameter sent by the calling service request party, and analyzing the received Http parameter by using the Http protocol to obtain the calling service information; the calling service information includes: the called service name, method name, parameter and group name; the calling service information is used for the system for providing the service to directly call the corresponding service by calling a service framework Application Programming Interface (API);
and the calling module is used for calling a service framework Application Programming Interface (API) through the system according to the calling service information, calling corresponding services and returning a calling result to the calling service requester.
3. An apparatus for service invocation, comprising:
a memory; and
a processor coupled to the memory, the processor configured to perform the method of claim 1 based on instructions stored in the memory.
4. A computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, carries out the method as claimed in claim 1.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510744686.XA CN106686021B (en) | 2015-11-05 | 2015-11-05 | Service calling method and gateway |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510744686.XA CN106686021B (en) | 2015-11-05 | 2015-11-05 | Service calling method and gateway |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106686021A CN106686021A (en) | 2017-05-17 |
CN106686021B true CN106686021B (en) | 2021-06-29 |
Family
ID=58857597
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510744686.XA Active CN106686021B (en) | 2015-11-05 | 2015-11-05 | Service calling method and gateway |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106686021B (en) |
Families Citing this family (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109510846B (en) * | 2017-09-14 | 2020-11-03 | 北京金山云网络技术有限公司 | API calling system, method and device, electronic equipment and storage medium |
CN107592358A (en) * | 2017-09-19 | 2018-01-16 | 广州视源电子科技股份有限公司 | Application program interface calling method and device based on HTTP service |
CN109660573B (en) * | 2017-10-10 | 2021-10-15 | 北京京东尚科信息技术有限公司 | Data transmission method and device |
CN110113394A (en) * | 2019-04-19 | 2019-08-09 | 浙江数链科技有限公司 | API Calls method and apparatus |
CN110191164B (en) * | 2019-05-20 | 2022-03-22 | 中国工商银行股份有限公司 | Distributed service access system and method |
CN110365751B (en) * | 2019-06-26 | 2020-10-27 | 口碑(上海)信息技术有限公司 | Service processing method, device and equipment of gateway system |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1909551B (en) * | 2005-08-03 | 2010-08-11 | 北京航空航天大学 | Data exchanging method based on Web service |
CN101022431B (en) * | 2007-03-09 | 2010-08-04 | 中国移动通信集团福建有限公司 | Interface gateway and interface gateway data processing method |
CN101686253A (en) * | 2008-09-23 | 2010-03-31 | 华为技术有限公司 | Service selecting method, device and system thereof |
CN102279773B (en) * | 2011-07-28 | 2014-07-09 | 迈普通信技术股份有限公司 | Bidirectional remote calling method and system |
CN103139234B (en) * | 2011-11-23 | 2016-01-20 | 中国移动通信集团公司 | A kind of device and method of data, services encapsulation |
CN104270470A (en) * | 2014-10-24 | 2015-01-07 | 杭州高达软件系统股份有限公司 | Remote service invocation method, device and system |
-
2015
- 2015-11-05 CN CN201510744686.XA patent/CN106686021B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN106686021A (en) | 2017-05-17 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106686021B (en) | Service calling method and gateway | |
CN106131213B (en) | Service management method and system | |
CN109284197B (en) | Distributed application platform based on intelligent contract and implementation method | |
CN110008045B (en) | Method, device and equipment for aggregating microservices and storage medium | |
US11716264B2 (en) | In situ triggered function as a service within a service mesh | |
CN110365751B (en) | Service processing method, device and equipment of gateway system | |
CN107463434B (en) | Distributed task processing method and device | |
CN103179133B (en) | Based on the client of entity class and the method for server communication | |
CN108255614A (en) | A kind of interface calling system and method based on micro services framework | |
CN102810069A (en) | JAVA object requesting and responding methods, devices and systems and terminal | |
US20150067013A1 (en) | Methods for servicing web service requests using parallel agile web services and devices thereof | |
CN111200606A (en) | Deep learning model task processing method, system, server and storage medium | |
CN112511591A (en) | Method, device, equipment and medium for realizing hospital interface data interaction | |
CN105183299A (en) | Human-computer interface service processing system and method | |
US20230179546A1 (en) | Processor and implementation method, electronic device, and storage medium | |
CN110347374A (en) | A kind of encapsulation of rich client business service and calling system, method and apparatus | |
CN112995261A (en) | Configuration method and device of service table, network equipment and storage medium | |
CN104731650A (en) | Acquisition method and device for system interface call information | |
CN104980511B (en) | A kind of game data access method, system and game web page server | |
CN103002047A (en) | RPC (Remote Procedure Call) type WEB SOA (Service-Oriented Architecture) method | |
CN108762762B (en) | Session information management method, device, equipment and computer storage medium | |
US8037124B2 (en) | System and method for describing and locating web services | |
CN103870280A (en) | Webpage seamless combining processing method based on FLEX and JSP | |
JP7427775B2 (en) | Stored procedure execution method, device, database system, and storage medium | |
CN112615773B (en) | Message processing method and system |
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 |