CN114040020A - Cross-cluster service calling method and system - Google Patents

Cross-cluster service calling method and system Download PDF

Info

Publication number
CN114040020A
CN114040020A CN202111172651.5A CN202111172651A CN114040020A CN 114040020 A CN114040020 A CN 114040020A CN 202111172651 A CN202111172651 A CN 202111172651A CN 114040020 A CN114040020 A CN 114040020A
Authority
CN
China
Prior art keywords
cluster
service
synchronization
component
target gateway
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
CN202111172651.5A
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.)
Hangzhou Longbu Technology Co ltd
Original Assignee
Hangzhou Longbu Technology 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 Hangzhou Longbu Technology Co ltd filed Critical Hangzhou Longbu Technology Co ltd
Priority to CN202111172651.5A priority Critical patent/CN114040020A/en
Publication of CN114040020A publication Critical patent/CN114040020A/en
Pending legal-status Critical Current

Links

Images

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/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)

Abstract

The application discloses a method and a system for cross-cluster service calling, relates to the field of communication, and aims to solve the problem that cross-cluster communication cannot be performed between micro-services in the prior art. The method comprises the following steps: the first service end obtains the address of the target gateway from the first registration center; the first server side sends a service calling request to the target gateway according to the target gateway address; the first service end receives a service calling result returned by the target gateway according to the service calling request; the first server and the first registration center are located in a first cluster, the target gateway is located in a second cluster, the first registration center stores service information of the second cluster in advance, and the service information comprises an address of the target gateway.

Description

Cross-cluster service calling method and system
Technical Field
The present application relates to the field of communications, and in particular, to a method and system for cross-cluster service invocation.
Background
With the rapid development of network technology, the system of internet company is usually composed of a large number of subsystems adopting micro-service architecture.
Micro-services refer to the development of multiple, independent, small, but fully functional services, each with its own processing and communication mechanisms, that can be deployed on a single or multiple servers.
At present, a large number of micro services exist in a micro service architecture, and complex calling relations exist among the micro services. However, there is no way to communicate between these microservices across the cluster.
Disclosure of Invention
The embodiment of the application provides a method and a system for cross-cluster service calling, which are used for solving the problem that cross-cluster communication cannot be carried out between micro-services in the prior art.
In order to solve the technical problem, the embodiment of the application adopts the following technical scheme:
in a first aspect, the present application provides a method for cross-cluster service invocation, the method comprising:
the first service end obtains the address of the target gateway from the first registration center;
the first server side sends a service calling request to the target gateway according to the target gateway address;
the first service end receives a service calling result returned by the target gateway according to the service calling request;
the first server and the first registration center are located in a first cluster, the target gateway is located in a second cluster, the first registration center stores service information of the second cluster in advance, and the service information comprises an address of the target gateway.
In a second aspect, the present application provides a system for cross-cluster service invocation, the system comprising: a first service end and a target gateway;
the first server is used for acquiring the address of the target gateway from the first registration center; sending a service calling request to the target gateway according to the target gateway address; receiving a service calling result returned by the target gateway according to the service calling request;
the first server and the first registration center are located in a first cluster, the target gateway is located in a second cluster, the first registration center stores service information of the second cluster in advance, and the service information comprises an address of the target gateway.
The embodiment of the application adopts at least one technical scheme which can achieve the following beneficial effects:
in an embodiment of the present application, the cross-cluster service invoking method includes: the first service end obtains the address of the target gateway from the first registration center; the first server side sends a service calling request to the target gateway according to the target gateway address; the first service end receives a service calling result returned by the target gateway according to the service calling request; the first server and the first registration center are located in a first cluster, the target gateway is located in a second cluster, the first registration center stores service information of the second cluster in advance, and the service information comprises an address of the target gateway. Therefore, the problem that communication between micro-services in the prior art cannot be carried out across clusters is solved by storing the service information of the second cluster in the first registration center of the first cluster in advance, then the first server of the first cluster acquires the target gateway address of the second cluster from the first registration center, then sends the service calling request to the target gateway, and receives the service calling result aiming at the service calling request, so that the services of other clusters are called as local services.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
fig. 1 is a flowchart of a cross-cluster service invocation method according to an embodiment of the present application;
fig. 2 is a flowchart of service invocation in a cross-cluster service invocation method according to an embodiment of the present application;
fig. 3 is a flowchart of service synchronization in a cross-cluster service invocation method according to an embodiment of the present application;
fig. 4 is a flowchart illustrating service synchronization in a cross-cluster service invocation method according to an embodiment of the present application;
fig. 5 is a block diagram illustrating a cross-cluster service calling system according to an embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of a cross-cluster service invocation system according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the technical solutions of the present application will be described in detail and completely with reference to the following specific embodiments of the present application and the accompanying drawings. It should be apparent that the described embodiments are only some of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The terms first, second and the like in the description and in the claims of the present application are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that embodiments of the application may be practiced in sequences other than those illustrated or described herein, and that the terms "first," "second," and the like are generally used herein in a generic sense and do not limit the number of terms, e.g., the first term can be one or more than one. In addition, "and/or" in the specification and claims means at least one of connected objects, a character "/" generally means that a preceding and succeeding related objects are in an "or" relationship.
The technical solutions provided by the embodiments of the present application are described in detail below with reference to the accompanying drawings.
Fig. 1 is a flowchart of a cross-cluster service invocation method provided in an embodiment of the present application, and referring to fig. 1, the cross-cluster service invocation method provided in the embodiment of the present application may include:
step 110, a first service end obtains an address of a target gateway from a first registration center;
the first server and the first registration center are located in a first cluster, the target gateway is located in a second cluster, and the first cluster and the second cluster can be different clusters; the first registration center stores service information of the second cluster in advance, and the service information comprises an address of the target gateway.
It is to be understood that, the obtaining the address of the target gateway may be that the first service end sends an address obtaining request to the first registry, and then the first registry sends the address of the target gateway to the first service end after receiving the address obtaining request. In addition, the first registry may be a database in the first cluster, and the first registry may be configured to store different data independently, for example, the first registry may store service information of the first cluster and service information of the second cluster.
Step 120, the first server sends a service calling request to the target gateway according to the target gateway address;
in the embodiment of the application, according to the address of the target gateway, a connection can be established with the target gateway first, and then the service calling request is sent to the target gateway through the connection; the service invocation request may be for invoking a service in the second cluster.
It should be understood that, if the target gateways of the first cluster and the second cluster are pre-connected, the service invocation request can be directly sent; if the connection between the target gateways of the first cluster and the second cluster is not established in advance, the service call request can be sent to the target gateways after the connection is established according to the target gateway addresses.
Step 130, the first service end receives a service calling result returned by the target gateway according to the service calling request.
According to the method for cross-cluster service calling, a first service end obtains an address of a target gateway from a first registration center; the first server side sends a service calling request to the target gateway according to the target gateway address; the first service end receives a service calling result returned by the target gateway according to the service calling request; the first server and the first registration center are located in a first cluster, the target gateway is located in a second cluster, the first registration center stores service information of the second cluster in advance, and the service information comprises an address of the target gateway. Therefore, the problem that communication between micro-services in the prior art cannot be carried out across clusters is solved by storing the service information of the second cluster in the first registration center of the first cluster in advance, then the first server of the first cluster acquires the target gateway address of the second cluster from the first registration center, then sends the service calling request to the target gateway, and receives the service calling result aiming at the service calling request, so that the services of other clusters are called as local services.
Optionally, in an embodiment of the present application, the service information may further include an identifier of a server in the second cluster; that is, the first registry not only stores the address of the target gateway of the second cluster in advance, but also stores the identifier of the server in the second cluster in advance. The identifier of the server may be used for the target gateway to find a corresponding server in the second cluster.
It should be understood that the service information may include the identities of all the servers in the second cluster, or may include the identities of some of the servers in the second cluster. In either case, the service information may include an identification of a target server in the second cluster, such that the target gateway finds the target server in the second cluster.
As shown in fig. 2, the method for cross-cluster service invocation provided in the embodiment of the present application may further include: the first service end obtains the identification of a target service end from the first registration center; correspondingly, the service call request sent to the target gateway carries the identifier of the target server. After step 120, the method for cross-cluster service invocation provided by the embodiment of the present application may further include: the target gateway sends the service calling request to the target server according to the identification of the target server; the target server side obtains a service calling result according to the service calling request and returns the service calling result to the target gateway; and after receiving the service calling result, the target gateway sends the service calling result to the first service terminal.
Wherein the target Gateway (Gateway) may transparently forward the service invocation request to the target server according to the identifier of the target server; the target server side can process the service calling request to obtain a corresponding response; and the service calling result is a response obtained by processing the service calling request by the target service terminal.
For ease of understanding, the following are exemplified here:
as shown in fig. 2, a first server of a first cluster prepares to call a target server of a second cluster, may first obtain an address of a target gateway from a first registry of the first cluster, and the first registry may return the address of the target gateway of the second cluster to the first server; then the first server side can initiate calling of the target server side to a target gateway of the second cluster, and after receiving the service calling request, the target gateway can perform transparent proxy on the target server side; the target server side can process the service calling request, return a service calling result to the target gateway, and finally return the service calling result corresponding to the service calling request to the first server side by the target gateway.
Therefore, the connection with the target gateway of the second cluster can be established through the target gateway address, and then the target gateway finds the target server according to the identification of the target server, so that the aim of calling the services of other clusters like calling the local service is realized.
The cross-cluster service calling method provided by the embodiment of the present application is further described in detail below with reference to an actual application scenario. Referring to fig. 2, the cross-cluster service invoking method provided in the embodiment of the present application may specifically include the following steps:
step 210, the first service end obtains the address of the target gateway and the identification of the target service end from the first registration center;
step 220, the first server sends a service calling request to the target gateway according to the target gateway address, wherein the service calling request carries an identifier of the target server;
step 230, the target gateway sends the service call request to the target server according to the identifier of the target server;
step 240, the target server obtains a service calling result according to the service calling request, and returns the service calling result to the target gateway;
step 250, after receiving the service calling result, the target gateway sends the service calling result to the first service end.
According to the cross-cluster service calling method provided by the embodiment of the application, the target gateway address of the second cluster and the identification of the service end in the second cluster are stored in the first registration center of the first cluster in advance, then the first service end obtains the target gateway address of the second cluster from the first registration center, then the first service end establishes connection with the target gateway of the second cluster, then the service calling request is sent to the target gateway through the connection, and the service calling result aiming at the service calling request is received, so that the local service is called to call the services of other clusters, and the problem that cross-cluster communication cannot be carried out between micro-services in the prior art is solved.
Optionally, in an embodiment of the present application, before step 110, the method for invoking a cross-cluster service provided in the embodiment of the present application may further include: the first synchronization component (pilot component) sends a first synchronization request to the second agent component (agent component); the second agent component sends first synchronization information to the first synchronization component according to the first synchronization request, wherein the first synchronization information comprises service information of the second cluster; and the first synchronization component receives the first synchronization information sent by the second agent component and sends the first synchronization information to the first registration center.
Wherein the first synchronization component may be located in the first cluster and the second proxy component may be located in the second cluster. The first synchronization component may be configured to synchronize service information of the second cluster to the first registry of the first cluster; the second proxy component may be configured to be responsible for collecting service information of the second cluster, and provide convenience of service synchronization to the first synchronization component of the first cluster.
In this manner, the service information of the second cluster may be synchronized in real-time to the first registry of the first cluster by the first synchronization component and the second proxy component.
In the following, in combination with an actual application scenario, service synchronization and stepping in the cross-cluster service calling method provided by the embodiment of the present application are further described in detail. Referring to fig. 3, the service synchronization in the cross-cluster service invocation method provided in the embodiment of the present application may specifically include the following steps:
step 310, the second agent component obtains the service information of the second cluster from a second registry of the second cluster;
the second registry may be a database in the second cluster, and the second registry may store service information of the second cluster in advance, where the service information may include an address of a target gateway of the second cluster and an identifier of a server in the second cluster.
It is to be understood that the second registry and the first registry may be two different databases.
Step 320, the first synchronization component sending a first synchronization request to a second proxy component;
it is to be appreciated that the first synchronization component can establish a synchronization flow with the second proxy component to synchronize service information of the second cluster in an instance in which the second proxy component grants the first synchronization request. The synchronous stream (stream) can continuously push data, and is suitable for transmitting some large data or for long-time data interaction such as a server and a client. For example, a client may subscribe to a server for data, and the server may continuously push data to the client using a synchronous stream.
Step 330, the second agent sends first synchronization information to the first synchronization component according to the first synchronization request, wherein the first synchronization information includes service information of the second cluster;
in an embodiment of the application, the second proxy component may send the first synchronization information to the first synchronization component via the synchronization stream.
Step 340, the first synchronization component receives the first synchronization information sent by the second agent component, and sends the first synchronization information to the first registry.
It is to be understood that the sending of the first synchronization information by the first synchronization component to the first registry may correspond to storing the service information of the second cluster in the local database of the first cluster in advance, so that the first server may call the service of the second cluster as a local service subsequently.
According to the cross-cluster service calling method provided by the embodiment of the application, the service information of the second cluster can be synchronized to the first registration center of the first cluster in real time through the first synchronization component and the second proxy component, so that the follow-up first service end can call the service end of the second cluster as the service end of the first cluster is called.
Optionally, in an embodiment of the present application, the first registry further stores service information of the first cluster; the method for calling the cross-cluster service provided by the embodiment of the application can further comprise the following steps: the second synchronization component (pilot component) sends a second synchronization request to the first agent component (agent component); and the first proxy component sends second synchronization information to the second synchronization component according to the second synchronization request, wherein the second synchronization information comprises service information of the first cluster.
Wherein the second synchronization component can be located in the second cluster and the first proxy component can be located in the first cluster. The second synchronization component may be configured to synchronize service information of the first cluster to the second registry of the second cluster; the first proxy component may be configured to be responsible for collecting service information of the first cluster and provide service synchronization convenience for the second synchronization component of the second cluster.
In this way, the service information of the first cluster can be synchronized in real time to the second registry of the second cluster by the second synchronization component and the first proxy component.
In the following, in combination with an actual application scenario, service synchronization and stepping in the cross-cluster service calling method provided by the embodiment of the present application are further described in detail. Referring to fig. 4, the service synchronization in the cross-cluster service invocation method provided in the embodiment of the present application may further specifically include the following steps:
step 410, the first agent component obtains service information of the first cluster from a first registry of the first cluster;
the first registry may further store service information of the first cluster in advance, where the service information may include an address of a target gateway of the first cluster and an identifier of a server in the first cluster.
Step 420, the second synchronization component sends a second synchronization request to the first proxy component;
it is to be appreciated that the second synchronization component can establish a synchronization flow with the first proxy component to synchronize the service information of the first cluster in an instance in which the first proxy component grants the second synchronization request.
Step 430, the first proxy component sends second synchronization information to the second synchronization component according to the second synchronization request, where the second synchronization information includes service information of the first cluster;
in an embodiment of the application, the first proxy component may send the second synchronization information to the second synchronization component through the synchronization stream.
Step 440, the second synchronization component receives the second synchronization information sent by the first agent component, and sends the second synchronization information to the second registry.
According to the method for cross-cluster service calling, the service information of the first cluster can be synchronized to the second registration center of the second cluster in real time through the second synchronization component and the first proxy component, and therefore the purpose that a target server side of the second cluster subsequently calls the service of the first cluster like calling the local service of the second cluster is achieved.
Fig. 5 is a block diagram illustrating a structure of a cross-cluster service call system according to an embodiment of the present disclosure, and fig. 6 is a schematic diagram illustrating a structure of a cross-cluster service call system according to an embodiment of the present disclosure.
Referring to fig. 5, a cross-cluster service invocation system 500 provided in an embodiment of the present application may include: a first server 510 and a target gateway 520.
The first server 510 is configured to obtain an address of a target gateway 520 from a first registry; sending a service calling request to the target gateway 520 according to the target gateway address; receiving a service calling result returned by the target gateway 520 according to the service calling request; the first server 520 and the first registry are located in a first cluster, the target gateway 520 is located in a second cluster, the first registry stores service information of the second cluster in advance, and the service information includes an address of the target gateway 520.
According to the system for cross-cluster service calling, a first service end obtains an address of a target gateway from a first registration center; the first server side sends a service calling request to the target gateway according to the target gateway address; the first service end receives a service calling result returned by the target gateway according to the service calling request; the first server and the first registration center are located in a first cluster, the target gateway is located in a second cluster, the first registration center stores service information of the second cluster in advance, and the service information comprises an address of the target gateway. Therefore, the problem that communication between micro-services in the prior art cannot be carried out across clusters is solved by storing the service information of the second cluster in the first registration center of the first cluster in advance, then the first server of the first cluster acquires the target gateway address of the second cluster from the first registration center, then sends the service calling request to the target gateway, and receives the service calling result aiming at the service calling request, so that the services of other clusters are called as local services.
Optionally, in an embodiment, as shown in fig. 6, the cross-cluster service invocation system 500 provided in the embodiment of the present application may further include: a target server 530; the service information may further include an identification of a server in the second cluster; the first server 510 may further be configured to: acquiring the identifier of the target server 530 from the first registry; correspondingly, the service invocation request sent to the target gateway 520 may carry an identifier of the target server 530; the target gateway 520 may be configured to send the service invocation request to the target server 530 according to the identifier of the target server 530; the target server 530 may be configured to obtain a service invocation result according to the service invocation request, and return the service invocation result to the target gateway 520; the target gateway 520 may also be configured to: after receiving the service calling result, the service calling result is sent to the first service end 510.
Optionally, in an embodiment, as shown in fig. 6, the cross-cluster service invocation system 500 provided in the embodiment of the present application may further include: a first synchronization component 540 and a second proxy component 550; the first synchronization component 540, which may be configured to send a first synchronization request to the second proxy component 550; the second proxy component 550 may be configured to send first synchronization information to the first synchronization component 540 according to the first synchronization request, where the first synchronization information may include service information of the second cluster; the first synchronization component 540 may also be configured to: receiving the first synchronization information sent by the second agent 550 and sending the first synchronization information to the first registry; wherein the first synchronization component 540 can be located in the first cluster and the second proxy component 550 can be located in the second cluster.
Optionally, in one embodiment, the second proxy component 550 may also be configured to: acquiring service information of the second cluster from a second registration center of the second cluster; the second registry may store the service information of the second cluster in advance.
Optionally, in an embodiment, the first registry may further store service information of the first cluster; as shown in fig. 6, the cross-cluster service invocation system 500 provided in the embodiment of the present application may further include: a second synchronization component 560 and a first proxy component 570; the second synchronization component 560 may be configured to send a second synchronization request to the first proxy component 570; the first proxy component 570 may be configured to send second synchronization information to the second synchronization component 560 according to the second synchronization request, where the second synchronization information may include service information of the first cluster; wherein the second synchronization component 560 can be located in the second cluster and the first agent component 570 can be located in the first cluster.
It should be noted that the system for cross-cluster service invocation provided by the embodiment of the present application corresponds to the above-mentioned method for cross-cluster service invocation. The related content may refer to the above description of the method for cross-cluster service invocation, and is not described herein again.
In addition, an embodiment of the present application further provides a server, where the server includes: memory, a processor and a computer program stored on the memory and executable on the processor, the computer program, when executed by the processor, implementing the steps of the method as claimed in any one of the preceding claims. For example, the computer program when executed by the processor implements the process of: the first service end obtains the address of the target gateway from the first registration center; the first server side sends a service calling request to the target gateway according to the target gateway address; the first service end receives a service calling result returned by the target gateway according to the service calling request; the first server and the first registration center are located in a first cluster, the target gateway is located in a second cluster, the first registration center stores service information of the second cluster in advance, and the service information comprises an address of the target gateway. Therefore, the problem that communication between micro-services in the prior art cannot be carried out across clusters is solved by storing the service information of the second cluster in the first registration center of the first cluster in advance, then the first server of the first cluster acquires the target gateway address of the second cluster from the first registration center, then sends the service calling request to the target gateway, and receives the service calling result aiming at the service calling request, so that the services of other clusters are called as local services.
Embodiments of the present application also provide a computer-readable storage medium, on which a computer program is stored, which, when executed by the processor, implements the steps of the method as described in any one of the above. For example, the computer program when executed by the processor implements the process of: the first service end obtains the address of the target gateway from the first registration center; the first server side sends a service calling request to the target gateway according to the target gateway address; the first service end receives a service calling result returned by the target gateway according to the service calling request; the first server and the first registration center are located in a first cluster, the target gateway is located in a second cluster, the first registration center stores service information of the second cluster in advance, and the service information comprises an address of the target gateway. Therefore, the problem that communication between micro-services in the prior art cannot be carried out across clusters is solved by storing the service information of the second cluster in the first registration center of the first cluster in advance, then the first server of the first cluster acquires the target gateway address of the second cluster from the first registration center, then sends the service calling request to the target gateway, and receives the service calling result aiming at the service calling request, so that the services of other clusters are called as local services.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention 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 invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams 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.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, 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 above description is only an example of the present application and is not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (10)

1. A method of cross-cluster service invocation, the method comprising:
the first service end obtains the address of the target gateway from the first registration center;
the first server side sends a service calling request to the target gateway according to the target gateway address;
the first service end receives a service calling result returned by the target gateway according to the service calling request;
the first server and the first registration center are located in a first cluster, the target gateway is located in a second cluster, the first registration center stores service information of the second cluster in advance, and the service information comprises an address of the target gateway.
2. The method of claim 1, wherein the service information further comprises an identification of a server in the second cluster; the method further comprises the following steps: the first service end obtains the identification of a target service end from the first registration center; correspondingly, the service call request sent to the target gateway carries the identifier of the target server;
after the sending of the service invocation request to the target gateway, the method further comprises:
the target gateway sends the service calling request to the target server according to the identification of the target server;
the target server side obtains a service calling result according to the service calling request and returns the service calling result to the target gateway;
and after receiving the service calling result, the target gateway sends the service calling result to the first service terminal.
3. The method of claim 1, wherein before the first service obtains the address of the target gateway from the first registry, the method further comprises:
the first synchronization component sends a first synchronization request to the second proxy component;
the second agent component sends first synchronization information to the first synchronization component according to the first synchronization request, wherein the first synchronization information comprises service information of the second cluster;
the first synchronization component receives the first synchronization information sent by the second agent component and sends the first synchronization information to the first registration center;
wherein the first synchronization component is located in the first cluster and the second proxy component is located in the second cluster.
4. The method of cross-cluster service invocation according to claim 3, wherein prior to said first synchronization component sending a first synchronization request to a second proxy component, said method further comprises:
the second agent component obtains service information of the second cluster from a second registry of the second cluster;
and the second registration center stores the service information of the second cluster in advance.
5. The method of claim 1, wherein the first registry further stores service information for the first cluster; the method further comprises the following steps:
the second synchronization component sends a second synchronization request to the first proxy component;
the first proxy component sends second synchronization information to the second synchronization component according to the second synchronization request, wherein the second synchronization information comprises service information of the first cluster;
wherein the second synchronization component is located in the second cluster and the first proxy component is located in the first cluster.
6. A system for cross-cluster service invocation, the system comprising: a first service end and a target gateway;
the first server is used for acquiring the address of the target gateway from the first registration center; sending a service calling request to the target gateway according to the target gateway address; receiving a service calling result returned by the target gateway according to the service calling request;
the first server and the first registration center are located in a first cluster, the target gateway is located in a second cluster, the first registration center stores service information of the second cluster in advance, and the service information comprises an address of the target gateway.
7. The system of cross-cluster service invocation according to claim 6, further comprising: a target server; the service information further comprises an identification of a server in the second cluster; the first server is further configured to: acquiring the identification of the target server from the first registration center; correspondingly, the service call request sent to the target gateway carries the identifier of the target server;
the target gateway is used for sending the service calling request to the target server according to the identifier of the target server;
the target server is used for acquiring a service calling result according to the service calling request and returning the service calling result to the target gateway;
the target gateway is further configured to: and after receiving the service calling result, sending the service calling result to the first service end.
8. The system of cross-cluster service invocation according to claim 6, further comprising: a first synchronization component and a second proxy component;
the first synchronization component to send a first synchronization request to the second proxy component;
the second proxy component is configured to send first synchronization information to the first synchronization component according to the first synchronization request, where the first synchronization information includes service information of the second cluster;
the first synchronization component is further configured to: receiving the first synchronization information sent by the second agent component, and sending the first synchronization information to the first registration center;
wherein the first synchronization component is located in the first cluster and the second proxy component is located in the second cluster.
9. The system of cross-cluster service invocation according to claim 8,
the second proxy component is further to: acquiring service information of the second cluster from a second registration center of the second cluster;
and the second registration center stores the service information of the second cluster in advance.
10. The system of cross-cluster service invocation according to claim 6, wherein said first registry further stores service information for said first cluster; the system further comprises: a second synchronization component and a first proxy component;
the second synchronization component to send a second synchronization request to the first proxy component;
the first proxy component is configured to send second synchronization information to the second synchronization component according to the second synchronization request, where the second synchronization information includes service information of the first cluster;
wherein the second synchronization component is located in the second cluster and the first proxy component is located in the first cluster.
CN202111172651.5A 2021-10-08 2021-10-08 Cross-cluster service calling method and system Pending CN114040020A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111172651.5A CN114040020A (en) 2021-10-08 2021-10-08 Cross-cluster service calling method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111172651.5A CN114040020A (en) 2021-10-08 2021-10-08 Cross-cluster service calling method and system

Publications (1)

Publication Number Publication Date
CN114040020A true CN114040020A (en) 2022-02-11

Family

ID=80134767

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111172651.5A Pending CN114040020A (en) 2021-10-08 2021-10-08 Cross-cluster service calling method and system

Country Status (1)

Country Link
CN (1) CN114040020A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114640556A (en) * 2022-03-02 2022-06-17 京东科技信息技术有限公司 Cross-cluster network communication system and method
CN115134373A (en) * 2022-06-28 2022-09-30 中国工商银行股份有限公司 Data synchronization method and device, storage medium and electronic equipment
CN115174657A (en) * 2022-06-13 2022-10-11 青岛中科曙光科技服务有限公司 Micro-service application calling method and device, computer equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200137185A1 (en) * 2018-10-24 2020-04-30 Hewlett Packard Enterprise Development Lp Remote service access in a container management system
CN111147588A (en) * 2019-12-27 2020-05-12 上海浦东发展银行股份有限公司 Method and system for realizing cross-domain and cross-center communication in enterprise-level micro service platform
CN111885123A (en) * 2020-07-06 2020-11-03 苏州浪潮智能科技有限公司 Construction method and device of cross-K8 s target service access channel
WO2020233120A1 (en) * 2019-05-20 2020-11-26 华为技术有限公司 Scheduling method and apparatus, and related device
CN112087333A (en) * 2020-09-07 2020-12-15 上海浦东发展银行股份有限公司 Micro-service registration center cluster and information processing method thereof
CN112925647A (en) * 2021-03-24 2021-06-08 北京金山云网络技术有限公司 Cloud edge coordination system, and control method and device of cluster resources

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200137185A1 (en) * 2018-10-24 2020-04-30 Hewlett Packard Enterprise Development Lp Remote service access in a container management system
WO2020233120A1 (en) * 2019-05-20 2020-11-26 华为技术有限公司 Scheduling method and apparatus, and related device
CN111147588A (en) * 2019-12-27 2020-05-12 上海浦东发展银行股份有限公司 Method and system for realizing cross-domain and cross-center communication in enterprise-level micro service platform
CN111885123A (en) * 2020-07-06 2020-11-03 苏州浪潮智能科技有限公司 Construction method and device of cross-K8 s target service access channel
CN112087333A (en) * 2020-09-07 2020-12-15 上海浦东发展银行股份有限公司 Micro-service registration center cluster and information processing method thereof
CN112925647A (en) * 2021-03-24 2021-06-08 北京金山云网络技术有限公司 Cloud edge coordination system, and control method and device of cluster resources

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114640556A (en) * 2022-03-02 2022-06-17 京东科技信息技术有限公司 Cross-cluster network communication system and method
CN115174657A (en) * 2022-06-13 2022-10-11 青岛中科曙光科技服务有限公司 Micro-service application calling method and device, computer equipment and storage medium
CN115174657B (en) * 2022-06-13 2024-08-13 青岛中科曙光科技服务有限公司 Micro-service application calling method and device, computer equipment and storage medium
CN115134373A (en) * 2022-06-28 2022-09-30 中国工商银行股份有限公司 Data synchronization method and device, storage medium and electronic equipment

Similar Documents

Publication Publication Date Title
CN114040020A (en) Cross-cluster service calling method and system
WO2018219178A1 (en) Data synchronization method and apparatus, server, and storage medium
CN111970315A (en) Method, device and system for pushing message
CN108512821B (en) Data transmission method, device and system, network gate and transaction data storage method
CN109660578B (en) CDN back-to-source processing method, device and system
CN109451014B (en) WebService agent system and transparent agent method thereof
CN111786984B (en) Pod communication connection method and device, electronic equipment and storage medium
CN111124589B (en) Service discovery system, method, device and equipment
CN111277481B (en) Method, device, equipment and storage medium for establishing VPN tunnel
CN110515605B (en) Attribute information synchronization method and device, storage medium and processor
CN114448686B (en) Cross-network communication device and method based on micro-service
CN111314221A (en) Service processing method, device, equipment and computer readable storage medium
CN112737921B (en) Message interaction method, client and communication system
US10863347B2 (en) Policy enhancement for mixed capability devices
CN111581576B (en) Development processing method and device based on micro-service and storage medium
CN113254227B (en) Method and system for remote method call across data centers
CN112579877B (en) Control method, device, storage medium and equipment of information source system
CN110413427B (en) Subscription data pulling method, device, equipment and storage medium
CN110809051B (en) Service data processing method and system
CN116302602A (en) Message transmission method and device for mixed development of router protogenesis
CN115277816A (en) Service adaptation method, device, system and computer readable medium
CN108090152B (en) Data synchronization method and system
CN105871972A (en) Video resource distributed cathe method, device and system
CN114139093A (en) Data communication method, equipment and medium
CN115134373A (en) Data synchronization method and device, storage medium and electronic equipment

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: 20220211