CN111212119B - Dubbo service calling method and system - Google Patents

Dubbo service calling method and system Download PDF

Info

Publication number
CN111212119B
CN111212119B CN201911345122.3A CN201911345122A CN111212119B CN 111212119 B CN111212119 B CN 111212119B CN 201911345122 A CN201911345122 A CN 201911345122A CN 111212119 B CN111212119 B CN 111212119B
Authority
CN
China
Prior art keywords
service
dubbo
gateway
dubbo service
calling
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
Application number
CN201911345122.3A
Other languages
Chinese (zh)
Other versions
CN111212119A (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.)
State Grid Corp of China SGCC
State Grid Jiangsu Electric Power Co Ltd
NARI Group Corp
Nari Technology Co Ltd
NARI Nanjing Control System Co Ltd
Original Assignee
State Grid Corp of China SGCC
State Grid Jiangsu Electric Power Co Ltd
NARI Group Corp
Nari Technology Co Ltd
NARI Nanjing Control System 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 State Grid Corp of China SGCC, State Grid Jiangsu Electric Power Co Ltd, NARI Group Corp, Nari Technology Co Ltd, NARI Nanjing Control System Co Ltd filed Critical State Grid Corp of China SGCC
Priority to CN201911345122.3A priority Critical patent/CN111212119B/en
Publication of CN111212119A publication Critical patent/CN111212119A/en
Application granted granted Critical
Publication of CN111212119B publication Critical patent/CN111212119B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/34Network arrangements or protocols for supporting network services or applications involving the movement of software or configuration parameters 
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1044Group management mechanisms 
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling 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)
  • Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer And Data Communications (AREA)

Abstract

The application discloses a dubbo service calling method and a system, which directly send a dubbo service calling request through a C++ client, realize the dubbo service calling through service gateways at two ends and solve the problem that the C++ client cannot call the dubbo service.

Description

Dubbo service calling method and system
Technical Field
The application relates to a dubbo service calling method and system, and belongs to the technical field of power system information.
Background
The production control cloud (called 'regulation cloud', dCloud, dc is used as short in domain name) is a scheduling management mode adapting to 'unified management and hierarchical scheduling', and the regulation cloud adopts a hierarchical deployment design combining unified and distribution to form two-stage deployment of national-division leading nodes and provincial cooperative nodes. The national cloud platform is used as a master-node of the regulation cloud, and the provincial cloud platform is used as a slave-node of the regulation cloud to form a complete regulation cloud system.
At present, a set of dubbo distributed service frameworks are respectively deployed in the national cloud and the provincial cloud for service communication in the national cloud and the provincial cloud, and the conventional dubbo service calling is based on the interface of a dubbo client to call, so that a large number of C++ clients in the national cloud and the provincial cloud cannot call the dubbo service.
Disclosure of Invention
The application provides a dubbo service calling method and a system, which solve the problem that a C++ client cannot call the dubbo service.
In order to solve the technical problems, the application adopts the following technical scheme:
a dubbo service calling method comprises the following steps,
receiving a dubbo service call request sent by a C++ client;
sending the dubbo service call request to a corresponding opposite-end service gateway;
receiving a dubbo service calling result of the opposite-end service gateway;
and feeding back the dubbo service calling result to the C++ client.
The dubbo service invocation request includes a service header, endpoint information, and a service body.
The service header comprises a remote domain name, a full-path service name and standby information; the endpoint information comprises a C++ client process name, a node name where the C++ client is located and a domain name; the service body requests content for the dubbo service.
And positioning the corresponding opposite-end service gateway according to different opposite-end service gateway states and the dubbo service call requests, and sending the dubbo service call requests to the positioned opposite-end service gateway.
A dubbo service calling method comprises the following steps,
receiving a dubbo service call request sent by a service gateway of an opposite terminal;
and calling the corresponding dubbo service according to the dubbo service calling request, and feeding back the dubbo service calling result to the opposite-end service gateway.
And subscribing the service information of the dubbo service registry, and calling the corresponding dubbo service according to the dubbo service calling request.
And subscribing the service information of the dubbo service registration center, judging whether the dubbo service to be called is positioned on a preset white list according to the dubbo service call request, and if so, calling the corresponding dubbo service.
The contents of the dubbo service call result include whether the call was successful, error information, and returned response contents.
A dubbo service calling system comprises a plurality of cloud platforms,
the cloud platform comprises a C++ client, a service gateway and a dubbo service;
c++ client: sending a dubbo service call request to a service gateway; receiving a dubbo service calling result fed back by the service gateway;
if the cloud platform is a dubbo service call request end:
service gateway: sending the dubbo service call request to a corresponding opposite-end service gateway, and receiving a dubbo service call result of the opposite-end service gateway;
if the cloud platform is the dubbo service calling result feedback end:
service gateway: receiving a dubbo service call request sent by the opposite-end service gateway, calling corresponding dubbo service according to the dubbo service call request, and feeding back a dubbo service call result to the opposite-end service gateway.
The system also comprises a dubbo service registry, wherein the dubbo service is registered in the dubbo service registry.
The application has the beneficial effects that: according to the method and the device for calling the dubbo service, the C++ client directly sends the dubbo service calling request, and the dubbo service calling is realized through the service gateways at the two ends, so that the problem that the C++ client cannot call the dubbo service is solved.
Drawings
Fig. 1 is a block diagram of the system of the present application.
Detailed Description
The application is further described below with reference to the accompanying drawings. The following examples are only for more clearly illustrating the technical aspects of the present application, and are not intended to limit the scope of the present application.
A dubbo service calling method comprises a dubbo service calling request end method and a dubbo service calling result feedback end method.
The dubbo service call requester method is as follows:
a1 Receiving a dubbo service call request sent by the c++ client.
The dubbo service call request accords with the dubbo protocol, and is packaged and sent by the C++ client interface.
The dubbo service call request includes a service header (ServiceHead), endpoint information (EndPointInfo), and a Body (Body).
The service header includes a remote domain name (domain), a full path service name (sname), and standby information (spare). The remote domain name is used for locating the service location by the service gateway, the full path service name is used for finding the dubbo service, and the standby information is used for later extension protocols.
Endpoint information includes a c++ client process name (pname), a node name (node) where the c++ client resides, and a domain name (domain). Endpoint information is obtained by the client and transmitted to the service via the protocol for service tracking and monitoring.
The service body requests content for the dubbo service.
a2 A dubbo service invocation request is sent to the corresponding opposite service gateway.
And positioning the corresponding opposite-end service gateway according to different opposite-end service gateway states and the dubbo service call requests, and sending the dubbo service call requests to the positioned opposite-end service gateway.
a3 Receiving the dubbo service call result of the opposite terminal service gateway.
a4 Feeding the dubbo service call result back to the c++ client.
The dubbo service call result feedback end method is as follows:
b1 Receiving a dubbo service call request sent by the opposite-end service gateway.
b2 Subscription to the service information of the dubbo service registry, calling the corresponding dubbo service according to the dubbo service calling request, and feeding back the dubbo service calling result to the opposite-end service gateway.
Before the dubbo service is called, white list filtering is needed, namely service information of a dubbo service registration center is subscribed, whether the dubbo service to be called is located on a preset white list is judged according to a dubbo service calling request, and if yes, the corresponding dubbo service is called.
The contents of the dubbo service call result include whether the call was successful (is_success), error information (err_info), and returned response contents (ret_body).
A dubbo service calling system comprises a plurality of cloud platforms, wherein the cloud platforms are connected through a wide area network.
Fig. 1 is two ends of a call, namely two cloud platforms, and the structures of the two cloud platforms are completely consistent, and specifically include a c++ client, a service gateway, a dubbo service and a dubbo service registry.
Wherein, the liquid crystal display device comprises a liquid crystal display device,
c++ client side dubbo service consumers access the dubbo service through the service gateway; the c++ client functions as: sending a dubbo service call request to a service gateway; and receiving a dubbo service calling result fed back by the service gateway.
The dubbo service registry uses zookeeper and adopts a cluster deployment mode. The dubbo service is a service provider, and needs to be registered in a dubbo service registration center, and registered interfaces need to inherit a BaseWideService interface and realize a process_request method therein.
The BaseWideService interface is defined as follows:
public interface BaseWideService{
public String process_request(EndPointInfo peer_info, String body);
}
if the cloud platform is a dubbo service call request end, the service gateway sends a dubbo service call request to a corresponding opposite-end service gateway, and receives a dubbo service call result of the opposite-end service gateway; the specific basic functions are as follows:
1) Service gateway management and positioning functions: the local outlet gateway manages and records the states of different opposite-end service gateways, and can position corresponding opposite-end service gateway inlets according to dubbo service calling requests;
2) Cluster management function: the cluster consists of at least three nodes, and supports two modes of random and QPS; when a certain proxy node is abnormal, the cluster is automatically removed, and the client request is not accepted and the alarm is given.
3) Service result feedback function: the service gateway can forward the dubbo service invocation request to the peer service gateway according to the agreed-upon protocol.
If the cloud platform is a dubbo service calling result feedback end, the service gateway receives a dubbo service calling request sent by the opposite-end service gateway, calls corresponding dubbo service according to the dubbo service calling request, and feeds back a dubbo service calling result to the opposite-end service gateway; the specific basic functions are as follows:
1) Service management and positioning functions: the service gateway subscribes to the service information of the dubbo service registration center, and calls corresponding service according to the client request of the opposite terminal;
2) Cluster management function: the cluster consists of at least three nodes, and supports two modes of random and QPS; when a certain proxy node is abnormal, automatically picking out the cluster, and not receiving the request of the client and giving an alarm;
3) Service result feedback function: the service gateway can return the service result to the opposite-end service gateway according to the agreed protocol;
4) Service white list function: the service gateway sets a service white list, and only allows wide area services on the white list to be called by the opposite terminal.
All dubbo service call requests are uniformly forwarded by the wide area service proxy cluster, and nodes only need to be opened by the IP and the ports of the wide area service proxy nodes, so that the external exposure of the node internal network caused by the direct interaction of the service among the nodes at present is avoided.
The transport protocol from the client to the dubbo service is divided into three parts: and the transmission protocol between the local C++ client and the local service gateway, the transmission protocol between the local service gateway and the opposite terminal service gateway and the transmission protocol between the opposite terminal service gateway and the dubbo service.
1) Transmission protocol between local C++ client and local service gateway
The local c++ client transmits content to the local service gateway, including a service header (ServiceHead), endpoint information (EndPointInfo), and a Body (Body).
The service response contents returned to the local c++ client by the local service gateway include whether the call was successful (is_success), error information (err_info), and return response contents (ret_body).
2) Transmission protocol between local service gateway and opposite terminal service gateway
The service request information sent by the local service gateway to the opposite service gateway is the same as the first part of transmission content, and is a service header (ServiceHead), endpoint information (EndPointInfo) and a server Body (Body).
The data transmission protocol of the opposite end service gateway returned to the local service gateway is the same as the first part of service response content, namely whether the call is successful (is_success), error information (err_info) and returned response content (ret_body).
3) Transmission protocol between opposite terminal service gateway and service
The request information sent by the opposite-end service gateway to the service includes endpoint information and a service body, and the content defined by the endpoint information and the service body is the same as the first part. The response that the service returns to the peer service gateway is the actual response content (ret_body) of the service.
According to the method and the device for calling the dubbo service, the C++ client directly sends the dubbo service calling request, and the dubbo service calling is realized through the service gateways at the two ends, so that the problem that the C++ client cannot call the dubbo service is solved.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The foregoing is illustrative of the present application and is not to be construed as limiting thereof, but rather as providing for the use of additional embodiments and advantages of all such modifications, equivalents, improvements and similar to the present application are intended to be included within the scope of the present application as defined by the appended claims.

Claims (3)

1. A dubbo service calling method is characterized in that: the method comprises a method for dubbo service call request end service gateway and a method for dubbo service call result feedback end service gateway;
the method for the dubbo service to call the request end service gateway comprises the following steps:
receiving a dubbo service call request sent by a C++ client; the dubbo service call request comprises a service header, endpoint information and a service body, wherein the service header comprises a remote domain name, a full-path service name and standby information; the endpoint information comprises a C++ client process name, a node name where the C++ client is located and a domain name; the service body is dubbo service request content;
positioning the corresponding opposite-end service gateway according to different opposite-end service gateway states and dubbo service call requests, and sending the dubbo service call requests to the positioned opposite-end service gateway;
receiving a dubbo service calling result of the opposite-end service gateway;
feeding back the dubbo service calling result to the C++ client;
the method for the dubbo service to call the result feedback end service gateway comprises the following steps:
receiving a dubbo service call request sent by a service gateway of an opposite terminal;
subscribing service information of a dubbo service registration center, judging whether the dubbo service to be called is positioned on a preset white list according to a dubbo service calling request, if so, calling the corresponding dubbo service, and feeding back a dubbo service calling result to a service gateway at the opposite end; the content of the dubbo service call result comprises whether call is successful, error information and returned response content.
2. A dubbo service invocation system, characterized by: comprises a plurality of cloud platforms, wherein each cloud platform comprises a plurality of cloud platforms,
the cloud platform comprises a C++ client, a service gateway and a dubbo service;
c++ client: sending a dubbo service call request to a service gateway; receiving a dubbo service calling result fed back by the service gateway;
if the cloud platform is a dubbo service call request end:
service gateway: receiving a dubbo service call request sent by a C++ client, positioning a corresponding opposite-end service gateway according to different opposite-end service gateway states and the dubbo service call request, and sending the dubbo service call request to the positioned opposite-end service gateway; the dubbo service call request comprises a service header, endpoint information and a service body, wherein the service header comprises a remote domain name, a full-path service name and standby information; the endpoint information comprises a C++ client process name, a node name where the C++ client is located and a domain name; the service body is dubbo service request content;
receiving a dubbo service calling result of the opposite-end service gateway, and feeding back the dubbo service calling result to the C++ client;
if the cloud platform is the dubbo service calling result feedback end:
service gateway: receiving a dubbo service calling request sent by an opposite-end service gateway, subscribing service information of a dubbo service registration center, judging whether the to-be-called dubbo service is positioned on a preset white list according to the dubbo service calling request, if so, calling the corresponding dubbo service, and feeding back a dubbo service calling result to the opposite-end service gateway; the content of the dubbo service call result comprises whether call is successful, error information and returned response content.
3. The dubbo service invocation system of claim 2, wherein: the system also comprises a dubbo service registry, wherein the dubbo service is registered in the dubbo service registry.
CN201911345122.3A 2019-12-24 2019-12-24 Dubbo service calling method and system Active CN111212119B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911345122.3A CN111212119B (en) 2019-12-24 2019-12-24 Dubbo service calling method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911345122.3A CN111212119B (en) 2019-12-24 2019-12-24 Dubbo service calling method and system

Publications (2)

Publication Number Publication Date
CN111212119A CN111212119A (en) 2020-05-29
CN111212119B true CN111212119B (en) 2023-09-01

Family

ID=70788177

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911345122.3A Active CN111212119B (en) 2019-12-24 2019-12-24 Dubbo service calling method and system

Country Status (1)

Country Link
CN (1) CN111212119B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114629953A (en) * 2020-12-14 2022-06-14 电科云(北京)科技有限公司 Service cross-domain calling method and system based on proxy
CN114301908A (en) * 2021-11-23 2022-04-08 国家电网有限公司 Agent-based dubbo service wide area calling system and method

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105516308A (en) * 2015-12-09 2016-04-20 国网福建省电力有限公司 Wide-area service-oriented data interaction system and method based on service management center
CN107360249A (en) * 2017-08-02 2017-11-17 国电南瑞科技股份有限公司 A kind of wide-area distribution type service calling method suitable for modulation integral system
CN108255615A (en) * 2017-11-30 2018-07-06 平安科技(深圳)有限公司 Across language call method, server and storage medium
CN109151091A (en) * 2018-09-21 2019-01-04 福建南威软件有限公司 A kind of API gateway service for supporting dubbo agreement to call

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105516308A (en) * 2015-12-09 2016-04-20 国网福建省电力有限公司 Wide-area service-oriented data interaction system and method based on service management center
CN107360249A (en) * 2017-08-02 2017-11-17 国电南瑞科技股份有限公司 A kind of wide-area distribution type service calling method suitable for modulation integral system
CN108255615A (en) * 2017-11-30 2018-07-06 平安科技(深圳)有限公司 Across language call method, server and storage medium
CN109151091A (en) * 2018-09-21 2019-01-04 福建南威软件有限公司 A kind of API gateway service for supporting dubbo agreement to call

Also Published As

Publication number Publication date
CN111212119A (en) 2020-05-29

Similar Documents

Publication Publication Date Title
EP3672157B1 (en) Network device configuration using a message bus
CN102710554B (en) The service state detection method of distributed information system and distributed information system
EP3678027B1 (en) Interfaces to manage direct network peerings
WO2019228515A1 (en) Remote procedure call protocol self-adaptation method, related device, and server
WO2022179140A1 (en) Data processing method and system
US20070106800A1 (en) System and method for controlling access to legacy push protocols based upon a policy
US20030120764A1 (en) Real-time monitoring of services through aggregation view
CN111212119B (en) Dubbo service calling method and system
WO2022184094A1 (en) Network system for processing hash power, and service processing method and hash power network element node
EP2546745A1 (en) Indicating states in a telematic system
US20050193124A1 (en) Web services and session initiation protocol endpoint for converged communication over internet protocol networks
CN101729491A (en) Method, device and system for enhancing application reliability of script-based business
US20040225717A1 (en) Network architecture for message based policy distribution
US20040088186A1 (en) Distributed convergent service control platform
WO2011097837A1 (en) Method, device and system for implementing service access to access gateways
CN113826424A (en) Entity for providing external services to a network
US6738383B1 (en) Arrangement for distributing and dispatching traffic in a network, especially H.323 generated traffic
CN114978683A (en) Reverse proxy system based on MQTT protocol
CN108259605B (en) Data calling system and method based on multiple data centers
CN112448987A (en) Fusing degradation triggering method and system and storage medium
CN112019604B (en) Edge data transmission method and system
CN109067795A (en) Internet of Things network communication data interactive system and method
WO2012119340A1 (en) Method and apparatus for implementing north interface
WO2007022685A1 (en) Method for realizing the notification service, distributed web manage system and notification sending service device
CN102904739A (en) Method for realizing event transmission and common information model (CIM) server

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