CN108509282A - Across the language call service administering methods of rpc based on golang reflection technologies - Google Patents

Across the language call service administering methods of rpc based on golang reflection technologies Download PDF

Info

Publication number
CN108509282A
CN108509282A CN201810129499.4A CN201810129499A CN108509282A CN 108509282 A CN108509282 A CN 108509282A CN 201810129499 A CN201810129499 A CN 201810129499A CN 108509282 A CN108509282 A CN 108509282A
Authority
CN
China
Prior art keywords
client
rpc
golang
service
language
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
Application number
CN201810129499.4A
Other languages
Chinese (zh)
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.)
Xiamen Kuaishangtong Technology Corp ltd
Original Assignee
Xiamen Kuaishangtong Technology Corp 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 Xiamen Kuaishangtong Technology Corp ltd filed Critical Xiamen Kuaishangtong Technology Corp ltd
Priority to CN201810129499.4A priority Critical patent/CN108509282A/en
Publication of CN108509282A publication Critical patent/CN108509282A/en
Pending legal-status Critical Current

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/547Remote procedure calls [RPC]; Web services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/541Client-server

Abstract

The invention discloses across the language call service administering methods of rpc based on golang reflection technologies, including use the communication protocol between gRPC or thrift instrument definition processes;The foundation code of the foundation code and consumer client at producer server end is generated using gRPC or thrift tools;Server-side code realizes the interface function of interface description file, and after starting server, local IP and port are registered to service register center;Client code is called the interface function of interface description file, and after starting client, server end clusters of machines is found from service register center, will be in communication request load balancing to different server services.Rpc communication interfaces are converted into http communication interfaces by client by the reflex mechanism of golang language;Client is docked on api gateways, http interface services are provided to outer net.The method of the present invention supports that the rpc across language is called;Promote the robustness of the efficiency and performance and micro services system architecture that are communicated between service processes.

Description

Across the language call service administering methods of rpc based on golang reflection technologies
Technical field
The present invention relates to across language call fields, and in particular to a kind of across the language tune of rpc based on golang reflection technologies With service administering method.
Background technology
In micro services increasingly mature today, the telecommunication management ever more important between service processes.At present between the process of mainstream There are mainly two types of the methods of communication, is http agreements and rpc remote function calls agreements respectively.The programming language of mainstream is all at present The rpc between the language difference process is supported to call communication.
However in micro services system architecture, each component may be developed using different programming languages, use http Agreement can solve the problems, such as the communication for service between language, but http agreements are text based procotols, and performance is poor, Network overhead is big, and the communication not being suitable between Intranet service is suitable for providing service to outer net;Rpc is based on binary protocol Communication, performance is good, and network overhead is small, is highly suitable for communicating between the service of corporate intranet.It is relied primarily on across the rpc calling of language In gRPC and two tools of thrift, however gRPC has no with thrift and communicates the service of carrying out to rpc and administer operation, this make across The service call poor robustness of language.
Invention content
It is an object of the invention to overcome prior art problem, a kind of rpc based on golang reflection technologies of proposition is across language Speech calls service administering method.
To reach above-mentioned purpose, the present invention adopts the following technical scheme that:
A kind of across the language call service administering methods of rpc based on golang reflection technologies, including it is as follows:
(1) communication protocol between process is defined:
Use the communication protocol between gRPC or thrift instrument definition processes, i.e. interface description file;
(2) foundation code is generated:
The foundation code that producer server end is generated using gRPC or thrift tools, uses gRPC or thrift tools Generate the foundation code of consumer client;
(3) the local IP of server end is registered to service register center with port:
Server end foundation code realizes the interface function of interface description file, after starting server, will service The local IP at device end with using port information be registered to service register center;
(4) client will be in load balancing to different server services:
The interface function of client foundation code interface description file is called, after starting client, from service registration Center finds server end clusters of machines, will be in communication request load balancing to different server services.
Further, across the language call service administering methods of the rpc further include,
Rpc communication interfaces are converted into http communication interfaces by client by the reflex mechanism of golang language;By client End is docked on api gateways, and http interface services are provided to outer net.
Further, the arbitrary programming language that the foundation code gRPC or thrift at the producer server end are supported.
Further, the foundation code of the consumer client is golang programming languages.
Further, the service register center by zookeeper, etcd, consul any one or two Kind and its above distributed coordination service aid realize service.
Across the language call service administering methods of the rpc based on golang reflection technologies through the invention, and the prior art, Advantageous effect below can be reached:
(1) during the service inside micro services is administered, support that the rpc across language is called;
(2) efficiency and performance communicated between service processes is promoted;
(3) robustness of micro services system architecture is promoted;
(4) while by golang reflection technologies, api gateways is connected, unified http interface services are externally provided.
Description of the drawings
Attached drawing described herein is used for providing further understanding invention, constitutes the part of the present invention, the present invention Illustrative embodiments and their description for explaining the present invention, do not constitute improper limitations of the present invention.In the accompanying drawings:
Fig. 1 is that the present invention is based on the principle schematics of across the language call service administering methods of the rpc of golang reflection technologies.
Specific implementation mode
In order to keep technical problems, technical solutions and advantages to be solved clearer, clear, tie below Drawings and examples are closed, the present invention will be described in further detail.It should be appreciated that specific embodiment described herein is only used To explain the present invention, it is not intended to limit the present invention.
An embodiment of the present invention provides a kind of across the language call service administering methods of rpc based on golang reflection technologies, Fig. 1 is the present invention is based on the principle schematic of across the language call service administering methods of the rpc of golang reflection technologies, and system includes Service register center, api gateways, client 1, client 2, server cluster 1, server cluster 2.
Across the language call service administering methods of the rpc include as follows:
(1) communication protocol between process is defined:
Use the communication protocol between gRPC or thrift instrument definition processes, i.e. interface description file;
(2) foundation code is generated:
The foundation code that producer server end is generated using gRPC or thrift tools, uses gRPC or thrift tools Generate the foundation code of consumer client;
(3) the local IP of server end is registered to service register center with port:
Server end foundation code realizes the interface function of interface description file, after starting server, will service The local IP at device end with using port information be registered to service register center;
(4) client will be in load balancing to different server services:
The interface function of client foundation code interface description file is called, after starting client, from service registration Center finds server end clusters of machines, will be in communication request load balancing to different server services.
Further, across the language call service administering methods of the rpc further include,
Rpc communication interfaces are converted into http communication interfaces by client by the reflex mechanism of golang language;By client End is docked on api gateways, and http interface services are provided to outer net.
Further, the arbitrary programming language that the foundation code gRPC or thrift at the producer server end are supported.
Further, the foundation code of the consumer client is golang programming languages.
Further, the service register center by zookeeper, etcd, consul any one or two Kind and its above distributed coordination service aid realize service.
Description above describe the preferred embodiment of the present invention, it is to be understood that the present invention is not limited to above-mentioned implementation Example, and excluding other embodiments should not be regarded as.Enlightenment through the invention, those skilled in the art combine known or existing The change that technology, knowledge are carried out also should be regarded as within the scope of the present invention.

Claims (5)

1. a kind of across the language call service administering methods of rpc based on golang reflection technologies, which is characterized in that
Across the language call service administering methods of rpc include as follows:
(1) communication protocol between process is defined:
Use the communication protocol between gRPC or thrift instrument definition processes, i.e. interface description file;
(2) foundation code is generated:
The foundation code that producer server end is generated using gRPC or thrift tools is generated using gRPC or thrift tools The foundation code of consumer client;
(3) the local IP of server end is registered to service register center with port:
Server end foundation code realizes the interface function of interface description file, after starting server, by server end Local IP with using port information be registered to service register center;
(4) client will be in load balancing to different server services:
The interface function of client foundation code interface description file is called, after starting client, from service register center It was found that server end clusters of machines, it will be in communication request load balancing to different server services.
2. across the language call service administering methods of the rpc according to claim 1 based on golang reflection technologies, feature It is,
Across the language call service administering methods of rpc further include,
Rpc communication interfaces are converted into http communication interfaces by client by the reflex mechanism of golang language;
Client is docked on api gateways, http interface services are provided to outer net.
3. across the language call service administering methods of the rpc according to claim 1 based on golang reflection technologies, feature It is,
The arbitrary programming language that the foundation code gRPC or thrift at the producer server end are supported.
4. across the language call service administering methods of the rpc according to claim 1 based on golang reflection technologies, feature It is,
The foundation code of the consumer client is golang programming languages.
5. across the language call service administering methods of the rpc according to claim 1 based on golang reflection technologies, feature It is,
The service register center by any one or two kinds in zookeeper, etcd, consul and its more than point Cloth coordination service tool realizes service.
CN201810129499.4A 2018-02-08 2018-02-08 Across the language call service administering methods of rpc based on golang reflection technologies Pending CN108509282A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810129499.4A CN108509282A (en) 2018-02-08 2018-02-08 Across the language call service administering methods of rpc based on golang reflection technologies

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810129499.4A CN108509282A (en) 2018-02-08 2018-02-08 Across the language call service administering methods of rpc based on golang reflection technologies

Publications (1)

Publication Number Publication Date
CN108509282A true CN108509282A (en) 2018-09-07

Family

ID=63374973

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810129499.4A Pending CN108509282A (en) 2018-02-08 2018-02-08 Across the language call service administering methods of rpc based on golang reflection technologies

Country Status (1)

Country Link
CN (1) CN108509282A (en)

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109597693A (en) * 2018-09-25 2019-04-09 国网浙江省电力有限公司信息通信分公司 The application method of GRPC communication protocol in distributed software system
CN109714332A (en) * 2018-12-26 2019-05-03 北京字节跳动网络技术有限公司 The method for converting protocol and device parsed based on Thrift and syntax tree
CN109729160A (en) * 2018-12-20 2019-05-07 新华三大数据技术有限公司 Implementation method, Thrift server node and the client of Thrift server service
CN109995758A (en) * 2019-02-28 2019-07-09 北京创鑫旅程网络技术有限公司 Data parallel processing method and device
CN110138755A (en) * 2019-04-30 2019-08-16 广东侍卫长北斗科技股份公司 A kind of gateway communication interactive service method of multi-protocols Beidou data acquisition
CN110191164A (en) * 2019-05-20 2019-08-30 中国工商银行股份有限公司 Distributed Services access system and method
CN110798380A (en) * 2019-10-23 2020-02-14 北京奇艺世纪科技有限公司 Data acquisition method, system, device, test equipment and test server
CN111930541A (en) * 2020-08-17 2020-11-13 湖南快乐阳光互动娱乐传媒有限公司 Dynamic calling method and system for GRPC (Global positioning System) service
CN112199184A (en) * 2020-11-02 2021-01-08 杭州安恒信息技术股份有限公司 Cross-language task scheduling method, device, equipment and readable storage medium
CN112199219A (en) * 2020-11-17 2021-01-08 南开大学 Cross-language operation remote calling method
CN113434622A (en) * 2021-06-28 2021-09-24 大连海事大学 gPC-based distributed electronic chart information system and information interaction method
CN113992749A (en) * 2021-10-08 2022-01-28 浪潮云信息技术股份公司 Http reverse proxy method and system based on go language
CN115292074A (en) * 2022-10-09 2022-11-04 中科星图测控技术(合肥)有限公司 gPC protocol-based track analysis algorithm service calling method and device
CN117155991A (en) * 2023-10-27 2023-12-01 中科星图测控技术股份有限公司 gRPC-gateway proxy gateway generation method based on configuration
CN117270833A (en) * 2023-11-21 2023-12-22 支付宝(杭州)信息技术有限公司 Service calling and issuing method, medium and computer equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101533361A (en) * 2009-04-16 2009-09-16 腾讯科技(深圳)有限公司 Method, system and equipment for transferring and generating service interface information in remote course
US8266639B2 (en) * 2009-12-04 2012-09-11 International Business Machines Corporation Remote procedure call (RPC) bind service with physical interface query and selection
CN103546557A (en) * 2013-10-22 2014-01-29 乐视致新电子科技(天津)有限公司 Data interaction method of platform-level services, service platform and systems
CN106411933A (en) * 2016-11-15 2017-02-15 深圳市彬讯科技有限公司 Lightweight RPC framework capable of service management and language calling
CN107480251A (en) * 2017-08-14 2017-12-15 福建新大陆软件工程有限公司 A kind of system for managing data access

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101533361A (en) * 2009-04-16 2009-09-16 腾讯科技(深圳)有限公司 Method, system and equipment for transferring and generating service interface information in remote course
US8266639B2 (en) * 2009-12-04 2012-09-11 International Business Machines Corporation Remote procedure call (RPC) bind service with physical interface query and selection
CN103546557A (en) * 2013-10-22 2014-01-29 乐视致新电子科技(天津)有限公司 Data interaction method of platform-level services, service platform and systems
CN106411933A (en) * 2016-11-15 2017-02-15 深圳市彬讯科技有限公司 Lightweight RPC framework capable of service management and language calling
CN107480251A (en) * 2017-08-14 2017-12-15 福建新大陆软件工程有限公司 A kind of system for managing data access

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
DAPANGZI88: "grpc-gateway:grpc转换为http协议对外提供服务", 《HTTPS://BLOG.CSDN.NET/DAPANGZI88/ARTICLE/DETAILS/63686334》 *
WEIXIN_33859231: "gRPC服务发现&负载均衡", 《HTTPS://BLOG.CSDN.NET/WEIXIN_33859231/ARTICLE/DETAILS/89068601》 *
ZENHOBBY: "RPC入门总结(七)Thrift+Zookeeper实现服务治理", 《HTTPS://BLOG.CSDN.NET/KINGCAT666/ARTICLE/DETAILS/78620290》 *

Cited By (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109597693A (en) * 2018-09-25 2019-04-09 国网浙江省电力有限公司信息通信分公司 The application method of GRPC communication protocol in distributed software system
CN109729160A (en) * 2018-12-20 2019-05-07 新华三大数据技术有限公司 Implementation method, Thrift server node and the client of Thrift server service
CN109714332A (en) * 2018-12-26 2019-05-03 北京字节跳动网络技术有限公司 The method for converting protocol and device parsed based on Thrift and syntax tree
CN109995758A (en) * 2019-02-28 2019-07-09 北京创鑫旅程网络技术有限公司 Data parallel processing method and device
CN110138755A (en) * 2019-04-30 2019-08-16 广东侍卫长北斗科技股份公司 A kind of gateway communication interactive service method of multi-protocols Beidou data acquisition
CN110191164A (en) * 2019-05-20 2019-08-30 中国工商银行股份有限公司 Distributed Services access system and method
CN110798380A (en) * 2019-10-23 2020-02-14 北京奇艺世纪科技有限公司 Data acquisition method, system, device, test equipment and test server
CN111930541A (en) * 2020-08-17 2020-11-13 湖南快乐阳光互动娱乐传媒有限公司 Dynamic calling method and system for GRPC (Global positioning System) service
CN112199184A (en) * 2020-11-02 2021-01-08 杭州安恒信息技术股份有限公司 Cross-language task scheduling method, device, equipment and readable storage medium
CN112199219A (en) * 2020-11-17 2021-01-08 南开大学 Cross-language operation remote calling method
CN113434622A (en) * 2021-06-28 2021-09-24 大连海事大学 gPC-based distributed electronic chart information system and information interaction method
CN113992749A (en) * 2021-10-08 2022-01-28 浪潮云信息技术股份公司 Http reverse proxy method and system based on go language
CN115292074A (en) * 2022-10-09 2022-11-04 中科星图测控技术(合肥)有限公司 gPC protocol-based track analysis algorithm service calling method and device
CN115292074B (en) * 2022-10-09 2023-01-24 中科星图测控技术(合肥)有限公司 gPC protocol-based track analysis algorithm service calling method and device
CN117155991A (en) * 2023-10-27 2023-12-01 中科星图测控技术股份有限公司 gRPC-gateway proxy gateway generation method based on configuration
CN117155991B (en) * 2023-10-27 2023-12-29 中科星图测控技术股份有限公司 gRPC-gateway proxy gateway generation method based on configuration
CN117270833A (en) * 2023-11-21 2023-12-22 支付宝(杭州)信息技术有限公司 Service calling and issuing method, medium and computer equipment
CN117270833B (en) * 2023-11-21 2024-04-26 支付宝(杭州)信息技术有限公司 Service calling and issuing method, medium and computer equipment

Similar Documents

Publication Publication Date Title
CN108509282A (en) Across the language call service administering methods of rpc based on golang reflection technologies
CN105721473B (en) A kind of method and system of WEB terminal far call optimization
EP3399715B1 (en) Protocol conversion method, platform, and protocol conversion gateway
AU2006233221B2 (en) Message sequencing and data translation architecture for telecommunication services
AU2006233229B2 (en) Service broker integration layer for supporting telecommunication client service requests
CN102710554B (en) The service state detection method of distributed information system and distributed information system
EP1780983B1 (en) Service broker integration layer for supporting telecommunication client service requests
CN111935738B (en) Method and system for multi-operator core network docking MEC
CN103117960A (en) System and method of broadband user speeding up access bandwidth in self-service mode
CN111258627B (en) Interface document generation method and device
US8799478B2 (en) Web services and session initiation protocol endpoint for converged communication over internet protocol networks
CN107181806A (en) A kind of distributed service processing system and method based on dubbo
CN109656688A (en) A kind of method that realizing distributed service rule, system and server
CN108924243A (en) Data distribution and processing method based on micro services framework
CN105005469A (en) Non-blocking calling method based on Zookeeper and RabbitMQ
CN114978683A (en) Reverse proxy system based on MQTT protocol
CN105812182B (en) The method and system of dynamic configuration SIP phone
WO2010031303A1 (en) Method and apparatus for processing multi-channel request subscription under service management platform
CN100484014C (en) Distributed cluster service management system and service management method in intelligent network
Liu et al. WSIP-Web service SIP endpoint for converged multimedia/multimodal communication over IP
CN108494606B (en) WCF technology-based data service framework building method
CN105050056B (en) A kind of triggering method for realizing cluster multi call business based on IMS frames
CN110636073A (en) Distributed asynchronous remote service arranging and calling technology
EP2157760A1 (en) Handling of H248 digitmap timers
CN106961687B (en) Information interaction 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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20180907