WO2019228515A1 - Remote procedure call protocol self-adaptation method, related device, and server - Google Patents

Remote procedure call protocol self-adaptation method, related device, and server Download PDF

Info

Publication number
WO2019228515A1
WO2019228515A1 PCT/CN2019/089607 CN2019089607W WO2019228515A1 WO 2019228515 A1 WO2019228515 A1 WO 2019228515A1 CN 2019089607 W CN2019089607 W CN 2019089607W WO 2019228515 A1 WO2019228515 A1 WO 2019228515A1
Authority
WO
WIPO (PCT)
Prior art keywords
server
communication
client
communication protocol
supported
Prior art date
Application number
PCT/CN2019/089607
Other languages
French (fr)
Chinese (zh)
Inventor
李书旭
魏哲
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2019228515A1 publication Critical patent/WO2019228515A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/40Network security protocols
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/18Multiprotocol handlers, e.g. single devices capable of handling multiple protocols

Definitions

  • the present application relates to the field of computer technology, and in particular, to a remote procedure call protocol adaptive method, a related device, and a server.
  • FIG. 1 is a schematic diagram of an RPC scenario in the prior art.
  • the scenario includes a service consumer, a service provider, a service operation container, a registry, and a monitor. ),
  • the RPC process includes:
  • the service running container starts, loads, and runs the service provider
  • the service provider After the service provider starts up, it can register its available services with the registration center.
  • the registered information includes, but is not limited to, the Internet Protocol Address (IP) and port information exposed to the outside world;
  • IP Internet Protocol Address
  • the target service After the service consumer starts, he subscribes the services he needs to the registration center, which can be called the target service.
  • the registration center sends the registration information of the service provider providing the target service to the service consumer. In addition, if the target service information is changed, the registration center will also send the changed information to the service consumer.
  • the service consumer selects one service provider to call the target service from the service providers fed back by the registration center based on the load balancing algorithm, and if the call fails, selects another service provider to call the target service.
  • Service consumers and service providers accumulate the number of calls and call times for each service in memory, and send the statistical data to the monitoring center according to a preset time period, in order to control the call of each service.
  • service consumers need to communicate based on communication protocols when calling services from service providers.
  • the current practice is to configure at least one communication protocol for each service on the service consumer in advance.
  • a communication protocol supported by a service provider When there is an update (for example, an upgrade), the service consumer cannot perceive it, which may cause the service consumer to fail to use the updated communication protocol to normally call the service provided by the certain service. That is to say, the configuration of the communication protocol in the prior art may cause the service consumer to fail to call the service from the service provider normally.
  • the embodiment of the present application discloses a remote procedure call protocol adaptive method, a related device and a server, which can adaptively select a suitable communication protocol for calling between services.
  • an embodiment of the present application provides a remote procedure call protocol adaptation method, which includes:
  • the client sends a first request message to the registration center, where the registration center stores the communication address of the server where each of the multiple services is located and the supported communication protocol; the first request message is used to request the multiple services The communication address of the first server where the first service in the server is located and the communication protocol supported by the first server;
  • the client selects a first communication supported by the client and the first server from a communication protocol supported by the client and a communication protocol supported by the first server according to a preset selection policy. protocol;
  • the client invokes the first service according to the first communication protocol and a communication address of the first server.
  • the client sends a first request message to the registration center, and the registration center sends the communication address of the first server and the supported communication protocol to the client according to the first request message, and then the client filters out according to a preset selection policy A first communication protocol supported by both the client and the first server, and then the client invokes the first service according to the first communication protocol and a communication address of the first server.
  • the client can adaptively select an appropriate communication protocol to communicate with the first server according to the selection strategy, and the selection scheme of the communication protocol is optimized.
  • the method includes: the client updates the selection policy, and different selection rules specify different filtering rules. In this way, when that type of protocol is needed, the corresponding selection strategy can be selected first, and then the required communication protocol is selected through the selection strategy.
  • the method further includes: the client receives the registration center The change information of the first server that is sent, where the change information includes a communication address and / or a supported communication protocol. In this way, even if the related information of the first service is changed, the client can still call the first service smoothly.
  • an embodiment of the present application provides a remote procedure call protocol adaptation method, which includes:
  • the client sends a first request message to the registration center, where the registration center stores the communication address of the server where each of the multiple services is located and the supported communication protocol; the first request message is used to request the multiple services The communication address of the first server where the first service in the server is located, and the first request message carries a communication protocol supported by the client;
  • the client Receiving, by the client, a first communication protocol and a communication address of the first server sent by the registration center, where the first communication protocol is a communication protocol supported by both the client and the first server;
  • the client invokes the first service according to the first communication protocol and a communication address of the first server.
  • the client sends a first request message to the registration center, and the registration center determines the first communication protocol supported by the client and the first server according to the first request message and the information registered by each server to the registration center. And then sending the first communication protocol and the communication address of the first server to the client, and then the client invokes the first service according to the first communication protocol and the communication address of the first server.
  • the registration center can adaptively select an appropriate communication protocol for the client to communicate with the first server according to the selection strategy, and the selection scheme of the communication protocol is optimized.
  • the method further includes: the client receives the registration center The change information of the first server that is sent, where the change information includes a communication address and / or a supported communication protocol. In this way, even if the related information of the first service is changed, the client can still call the first service smoothly.
  • an embodiment of the present application provides a remote procedure call protocol adaptation method, which includes:
  • the registration center receives a first request message sent by a client, and the registration center stores a communication address and a supported communication protocol of a server where each of the multiple services is located; the first request message is used to request the multiple The communication address of the first server where the first service in the service is located and the communication protocol supported by the first server;
  • the communication protocol supported by the first server is used to determine a first communication protocol
  • the first communication protocol is A communication protocol supported by both the client and the first server
  • the first communication protocol and the communication address of the first server are used by the client to call the first from the first server service.
  • the client sends a first request message to the registration center, and the registration center sends the communication address of the first server and the supported communication protocol to the client according to the first request message, and then the client filters out according to a preset selection policy A first communication protocol supported by both the client and the first server, and then the client invokes the first service according to the first communication protocol and a communication address of the first server.
  • the client can adaptively select an appropriate communication protocol to communicate with the first server according to the selection strategy, and the selection scheme of the communication protocol is optimized.
  • the method before the registration center receives the first request message sent by the client, the method further includes: receiving, by the registration center, the communication address and Supported communication protocols; the registration center stores the communication address of the first server and the supported communication protocols. It can be understood that the first server registers the related information of the first service to the registration center, so that the registration center can provide the information of the first service to other services, so that other services can call the first service smoothly.
  • the method further includes: receiving, by the registration center, the first server The change information of the first server, wherein the change information includes a communication address and / or a supported communication protocol; and the registration center sends the change information of the first server to the client. In this way, even if the related information of the first service is changed, the client can still call the first service smoothly.
  • an embodiment of the present application provides a remote procedure call protocol adaptation method, which includes:
  • the registration center receives a first request message sent by a client, and the registration center stores a communication address and a supported communication protocol of a server where each of the multiple services is located; the first request message is used to request the multiple A communication address of a first server where a first service in the service is located, and the first request message carries a communication protocol supported by the client;
  • the registration center determines a communication protocol supported by the communication address of the first server, and selects the communication protocol supported by the first server and the communication protocol supported by the client according to a preset selection policy.
  • the registration center sends the first communication protocol and the communication address of the first server to the client, and the first communication protocol and the communication address of the first server are used by the client
  • the first server invokes the first service.
  • the client sends a first request message to the registration center, and the registration center determines the first communication protocol supported by the client and the first server according to the first request message and the information registered by each server to the registration center. And then sending the first communication protocol and the communication address of the first server to the client, and then the client invokes the first service according to the first communication protocol and the communication address of the first server.
  • the registration center can adaptively select a suitable communication protocol for the client to communicate with the first server according to the selection strategy, and optimize the selection scheme of the communication protocol.
  • the method includes: the registry updates the selection policy, and different selection policies specify different filtering rules. That is to say, the registration center maintains the selection strategy centrally, so that when the selection protocol standard needs to be changed, it can be implemented by directly modifying the selection strategy in the registration center. No matter which service requests the communication protocol supported by the first service , You can get from the registry to meet the latest standards of communication protocols. That is, the selection strategy is centrally maintained in the registry, which greatly reduces maintenance costs.
  • the method before the registration center receives the first request message sent by the client, the method further includes: receiving, by the registration center, the communication address and Supported communication protocols; the registration center stores the communication address of the first server and the supported communication protocols. It can be understood that the first server registers the related information of the first service to the registration center, so that the registration center can provide the information of the first service to other services, so that other services can call the first service smoothly.
  • the method further includes: receiving, by the registration center, the first server The change information of the first server, wherein the change information includes a communication address and / or a supported communication protocol; and the registration center sends the change information of the first server to the client. In this way, even if the related information of the first service is changed, the client can still call the first service smoothly.
  • an embodiment of the present application provides a client, and the client includes:
  • a communication unit configured to send a first request message to a registration center, where the registration center stores a communication address of a server where each service of a plurality of services is located and a supported communication protocol; the first request message is used to request the A communication address of a first server where a first service of a plurality of services is located and a communication protocol supported by the first server;
  • the communication unit is further configured to receive a communication address of the first server and a supported communication protocol sent by the registration center;
  • a processing unit configured to select a first protocol supported by the client and the first server from the communication protocols supported by the client and the first server supported according to a preset selection policy letter of agreement;
  • the processing unit is further configured to call the first service according to the first communication protocol and a communication address of the first server.
  • the client sends a first request message to the registration center, and the registration center sends the communication address of the first server and the supported communication protocol to the client according to the first request message, and then the client filters out the message according to a preset selection policy.
  • a first communication protocol supported by both the client and the first server, and then the client invokes the first service according to the first communication protocol and the communication address of the first server.
  • the client can adaptively select an appropriate communication protocol to communicate with the first server according to the selection strategy, and the selection scheme of the communication protocol is optimized.
  • the processing unit is further configured to update the selection strategy, and different selection rules specified by the selection strategy are different. In this way, when that type of protocol is needed, the corresponding selection strategy can be selected first, and then the required communication protocol is selected through the selection strategy.
  • the communication unit is further configured to receive the first service after the processing unit invokes the first service according to the first communication protocol and the communication address of the first server.
  • the change information of the first server sent by the registration center where the change information includes a communication address and / or a supported communication protocol. In this way, even if the related information of the first service is changed, the client can still call the first service smoothly.
  • an embodiment of the present application provides a client, and the client includes:
  • a communication unit configured to send a first request message to a registration center, where the registration center stores a communication address of a server where each service of a plurality of services is located and a supported communication protocol; the first request message is used to request the A communication address of a first server where a first service of a plurality of services is located, and the first request message carries a communication protocol supported by the client;
  • the communication unit is further configured to receive a first communication protocol and a communication address of the first server sent by the registration center, where the first communication protocol is supported by both the client and the first server. letter of agreement;
  • a processing unit configured to invoke the first service according to the first communication protocol and a communication address of the first server.
  • the client sends a first request message to the registration center, and the registration center determines the first communication protocol supported by the client and the first server according to the first request message and the information registered by each server to the registration center.
  • the first communication protocol and the communication address of the first server are then sent to the client, and then the client invokes the first service according to the first communication protocol and the communication address of the first server.
  • the registration center can adaptively select an appropriate communication protocol for the client to communicate with the first server according to the selection strategy, and the selection scheme of the communication protocol is optimized.
  • the communication unit is further configured to receive the first service after the processing unit invokes the first service according to the first communication protocol and the communication address of the first server.
  • the change information of the first server sent by the registration center where the change information includes a communication address and / or a supported communication protocol. In this way, even if the related information of the first service is changed, the client can still call the first service smoothly.
  • an embodiment of the present application provides a registration center, where the registration center includes:
  • a communication unit configured to receive a first request message sent by a client, the registration center stores a communication address of a server where each service of a plurality of services is located and a supported communication protocol; the first request message is used to request The communication address of the first server where the first service of the plurality of services is located and the communication protocol supported by the first server;
  • the communication unit is further configured to send the communication address of the first server and a supported communication protocol to the client; the communication protocol supported by the first server is used to determine a first communication protocol, and the first The communication protocol is a communication protocol supported by both the client and the first server; the first communication protocol and the communication address of the first server are used by the client to call from the first server The first service.
  • the client sends a first request message to the registration center, and the registration center sends the communication address of the first server and the supported communication protocol to the client according to the first request message, and then the client filters out the message according to a preset selection policy.
  • the first communication protocol supported by both the client and the first server, and then the client invokes the first service according to the first communication protocol and the communication address of the first server.
  • the client can adaptively select an appropriate communication protocol to communicate with the first server according to the selection strategy, and the selection scheme of the communication protocol is optimized.
  • the communication unit before the communication unit receives the first request message sent by the client: the communication unit is further configured to receive the communication address of the first server sent by the first server And a supported communication protocol; the processing unit is configured to store a communication address of the first server and a supported communication protocol.
  • the first server registers the related information of the first service to the registration center, so that the registration center can provide the information of the first service to other services, so that other services can call the first service smoothly.
  • the communication unit after the communication unit sends the communication address of the first server and the supported communication protocol to the client, the communication unit is further configured to: receive the first server Change information of the first server, the change information including a communication address and / or a supported communication protocol; and sending the change information of the first server to the client. In this way, even if the related information of the first service is changed, the client can still call the first service smoothly.
  • an embodiment of the present application provides a registration center.
  • the registration center includes:
  • a communication unit configured to receive a first request message sent by a client, the registration center stores a communication address of a server where each service of a plurality of services is located and a supported communication protocol; the first request message is used to request The communication address of the first server where the first service of the plurality of services is located, and the first request message carries a communication protocol supported by the client;
  • the processing unit is configured to determine a communication protocol supported by the communication address of the first server, and select a communication protocol supported by the first server and the communication protocol supported by the client according to a preset selection policy.
  • the communication unit is further configured to send the first communication protocol and the communication address of the first server to the client, and the first communication protocol and the communication address of the first server are used for the client.
  • the terminal calls the first service from the first server.
  • the client sends a first request message to the registration center, and the registration center determines the first communication protocol supported by the client and the first server according to the first request message and the information registered by each server to the registration center.
  • the first communication protocol and the communication address of the first server are then sent to the client, and then the client invokes the first service according to the first communication protocol and the communication address of the first server.
  • the registration center can adaptively select an appropriate communication protocol for the client to communicate with the first server according to the selection strategy, and the selection scheme of the communication protocol is optimized.
  • the processing unit is further configured to update the selection strategy, and different selection rules specified by the selection strategy are different. That is to say, the registration center maintains the selection strategy centrally, so that when the selection protocol standard needs to be changed, it can be implemented by directly modifying the selection strategy in the registration center. No matter which service requests the communication protocol supported by the first service , You can get from the registry to meet the latest standards of communication protocols. That is, the selection strategy is centrally maintained in the registry, which greatly reduces maintenance costs.
  • the communication unit before the communication unit receives the first request message sent by the client: the communication unit is further configured to receive the communication address of the first server sent by the first server And a supported communication protocol; the processing unit is further configured to store a communication address of the first server and a supported communication protocol.
  • the first server registers the related information of the first service to the registration center, so that the registration center can provide the information of the first service to other services, so that other services can call the first service smoothly.
  • the communication unit after the communication unit sends the communication address of the first server and the supported communication protocol to the client, the communication unit is further configured to: receive the first server Change information of the first server, the change information including a communication address and / or a supported communication protocol; and sending the change information of the first server to the client. In this way, even if the related information of the first service is changed, the client can still call the first service smoothly.
  • an embodiment of the present application provides a server configured to run the fifth aspect, or any possible implementation manner of the fifth aspect, or the sixth aspect, or any possible implementation of the sixth aspect. Way described by the client.
  • an embodiment of the present application provides a server configured to run the seventh aspect, or any possible implementation manner of the seventh aspect, or the eighth aspect, or any possible implementation of the eighth aspect. Registry described by the way.
  • the client sends a first request message to the registration center, and the registration center sends the communication address of the first server and the supported communication protocol to the client according to the first request message, and then the client according to a preset selection policy
  • the first communication protocol supported by the client and the first server is screened out, and then the client invokes the first service according to the first communication protocol and the communication address of the first server.
  • the client can adaptively select an appropriate communication protocol to communicate with the first server according to the selection strategy, and the selection scheme of the communication protocol is optimized.
  • FIG. 1 is a schematic diagram of an RPC scenario in the prior art
  • FIG. 2 is a schematic diagram of an RPC distributed software architecture according to an embodiment of the present application.
  • FIG. 3 is a schematic flowchart of a remote procedure call protocol adaptation method according to an embodiment of the present application.
  • FIG. 4 is a schematic diagram of a microservice in a cloud-native scene provided by an embodiment of the present application.
  • FIG. 5 is a schematic diagram of a communication protocol supported between services provided by an embodiment of the present application.
  • FIG. 6 is a schematic flowchart of a remote procedure call protocol adaptation method according to an embodiment of the present application.
  • FIG. 7 is a schematic structural diagram of a client according to an embodiment of the present application.
  • FIG. 8 is a schematic structural diagram of a client according to an embodiment of the present application.
  • FIG. 9 is a schematic structural diagram of a server according to an embodiment of the present application.
  • FIG. 10 is a schematic structural diagram of a registration center according to an embodiment of the present application.
  • FIG. 11 is a schematic structural diagram of a registration center according to an embodiment of the present application.
  • FIG. 12 is a schematic structural diagram of a server according to an embodiment of the present application.
  • FIG. 2 is a schematic diagram of a distributed software architecture of a PRC provided by an embodiment of the present application.
  • the software architecture includes a service management framework 201 and multiple application terminals. In FIG. 2, only three application terminals are used as an example. Schematically, these three application ends are shown as an application end 202, an application end 203, and an application end 204 in this order.
  • the service governance framework 201 includes a registration center for receiving and maintaining registration information registered by each application end.
  • the registration information may include an application end IP, a port, a supported communication protocol, a name of a service that can be provided, and / Or logos.
  • the registration center is also used to send information to the application side that needs the IP address, port, and supported communication protocol of the application side where the corresponding service is located.
  • the registration center may include a protocol adaptation module for determining a communication protocol for two applications that need to communicate.
  • each application can include service 2001, programming framework 2002, and distributed communication layer 2003.
  • the programming framework 2002 in that application can control The service 2001 calls the service 2001 in the other server.
  • the calling process is supported by the distributed communication layer 2003 in the one application side and the distributed communication layer 2003 in the other application side.
  • a connection is established between the distributed communication layers of each application side, and a connection is established with the registration center.
  • Each programming framework 2002 may include a serialization / deserialization module and a protocol adaptation module (optional).
  • the communication protocol used in the communication between the one application side and the other application side may be determined by the Or the protocol adaptation module in the registry.
  • the above distributed software framework can be deployed on a server or a distributed server cluster.
  • the application that calls the service can be called the client, and the application that provides the service can be called the server.
  • An application can be a client of one service or a service of another service. end.
  • service 1 can be provided on application 202
  • service 2 can be provided on application 203
  • service 3 can be provided on application 204
  • application 202 can call service 2 from application 203
  • application 203 can be provided from application Service 3 is called on 204.
  • application 203 is the server
  • application 203 is the client.
  • FIG. 3 is a remote procedure call protocol adaptive method provided by an embodiment of the present application.
  • the method may be implemented based on the distributed software architecture shown in FIG. 2.
  • the method includes but is not limited to the following steps:
  • Step S300 each server registers the service information provided by itself with the registration center.
  • each server includes server A
  • the following description uses server A as an example.
  • the server A uses the name and / or identification of the service that it can provide, the IP of the server A, the port, Information such as supported communication protocols is registered with the registration center. After each server registers the available services in the registry, the registry knows which services each server can provide, the communication addresses of each client, and the supported communication protocols, that is, the registry stores multiple services. The communication address of the server where each service is located and the supported communication protocols. In the embodiment of the present application, two different servers may provide the same service; in addition, one server may support one or more communication protocols.
  • each microservice can be defined in an interface description language (Interface Description Language, IDL) as a contract, and a compiler tool is provided to generate interface code corresponding to the C, JAVA, or GO language according to the IDL file.
  • IDL Interface Description Language
  • an instance of a service with a service name of HelloService can be defined as follows:
  • the HelloService service becomes a microservice based on the C service development and operation framework.
  • microservices based on Java service development and operation framework microservices based on C service development and operation framework
  • microservices based on GO service development and operation framework can be obtained.
  • the microservices based on the C service development and operation framework support the transmission of the ProtoBuf serialized high-performance private protocol A based on Transmission Control Protocol (TCP); each microservice based on the JAVA service development and operation framework supports Netty transfers a high-performance private protocol B based on ProtoBuf serialization; each microservice based on the GO service development and operation framework supports a TCP-based private protocol C; all the services listed above support a target interworking protocol (for example, HTTP) Protocol), the target interworking protocol can be expressed as InterWay, then the characteristics of various types of services are summarized as shown in the table, and the communication protocol schemes that can be used for communication between various types of services are shown in Figure 5, from the figure 5 can be seen:
  • TCP Transmission Control Protocol
  • each microservice based on the JAVA service development and operation framework supports Netty transfers a high-performance private protocol B based on ProtoBuf serialization
  • each microservice based on the GO service development and operation framework supports a TCP-based private protocol C
  • C language-based services can communicate with each other using a private protocol A.
  • Java language-based services can communicate with each other using a private protocol B.
  • GO language-based services can use the private protocol C to communicate with each other.
  • C-based services, Java-based services, and GO-based services can communicate with each other using the target interworking protocol.
  • Microservices 8 GO Language Services Private agreement C
  • target interworking agreement Microservices 9 GO Language Services Private agreement C
  • target interworking agreement
  • the registered service ID is 65537
  • the registered service name is HelloService.
  • the server A can support the private protocol A. When the private protocol A is used for communication, the communication address of the server A includes the IP address 156.103.2.144 and port 22225. The server A also supports the target interworking protocol. When using the target interworking protocol for communication At this time, the communication address of server A includes the IP address 156.103.2.144 and port 22226.
  • Step S301 The client sends a first request message to the registration center.
  • the first request message is used to request a communication address of a first server where a first service of the multiple services is located and a communication protocol supported by the first server.
  • the first service is a service that the client needs to call.
  • Step S302 The registration center receives a first request message sent by a client.
  • the first request message may include a service name and / or identification (ID) of the first service, so that after the registration center parses the first request message, the first request message may be first determined according to the service name and / or identification. One service. Then, the registration center determines the server capable of providing the first service according to the information that has been registered in itself. In the embodiment of the present application, the server capable of providing the first service may be referred to as the first server. After the first server is determined, the communication address of the first server may be further determined, for example, information such as IP and port, and a communication protocol supported by the first server.
  • ID identification
  • the registration center may determine from the stored information that the identifier of the first service requested by the first request message is "65537”, and may Determine the information of the first server (endpoints) that provides the first service as ["A: //156.103.2.144: 22225", “Inter: //156.103.2.144: 22226"], that is, determine that the first service supports the private protocol A and the target interworking protocol Inter.
  • the IP address of the first server is 156.103.2.144 and the port is 22225; when the target interworking protocol is used to communicate with the first server, the first The IP address of the server is 156.103.2.144, and the port is 22226.
  • Step S303 The registration center sends the communication address of the first server and the supported communication protocol to the client.
  • Step S304 The client receives the communication address of the first server and the supported communication protocol sent by the registration center.
  • the client may receive one or more communication addresses of the first server and the supported communication protocols.
  • the client is directed to the one
  • the first server executes step S305; when receiving the communication addresses and supported communication protocols of multiple first servers, the client only targets one of the first servers (the selection rules of the first server are here (No limitation) Step S305 is performed.
  • Step S305 The client selects, from the communication protocols supported by the client and the communication protocol supported by the first server, a communication protocol supported by the client and the first server according to a preset selection policy. First communication protocol.
  • the client knows which communication protocols it supports, and according to the feedback from the registration center, it also knows the communication protocols supported by the first server. Therefore, the client can first determine the communication supported by both the client and the first server. Protocol, and then select a first communication protocol from the determined communication protocols according to a preset selection policy. It can be understood that there may be more than one communication protocol supported by the client and the first server, so the client needs to select a communication protocol for communication according to a selection policy.
  • the selection policy specifies the rules for selecting a communication protocol, for example, specifying a communication protocol with higher security; for example, specifying a communication protocol with the highest transmission efficiency; and so on.
  • the communication protocols supported by the client and the first server include the private protocol A and the The target interworking protocol.
  • a communication protocol needs to be selected from the private protocol A and the target interworking protocol as the first communication protocol according to the selection strategy. Which one of the communication protocols is ultimately selected is determined by the selection strategy. For example, if the The communication protocol specifies the selection of a communication protocol with a higher security level, and the selected communication protocol is the private protocol A. If the communication protocol specifies the selection of a communication protocol with better compatibility (for example, capable of supporting more types of object communication), then The selected communication protocol is the target interworking protocol.
  • the communication protocol used is determined, a more detailed address can be matched according to the determined communication protocol. For example, if the communication protocol A is used, the communication address that can be matched to the first server includes the IP address 156.103.2.144 And port 22225. If the target interworking protocol is used, the communication addresses that can be matched to the first server include: IP address 156.103.2.144 and port 22226.
  • the client may update the selection policy as required, and different selection policies provide different filtering rules. It is understandable that the choices actually required during operation may change over time. For example, sometimes a more secure communication protocol is needed, sometimes a communication protocol with higher transmission efficiency is needed, and sometimes a stronger interoperability is required. Communication protocol. By changing the selection strategy, developers can ensure that the communication protocols that meet the corresponding characteristics are screened.
  • Step S306 The client invokes the first service according to the first communication protocol and the communication address of the first server.
  • the client can establish a communication connection with the first server according to the communication address of the first server. After the communication connection is established, the client calls the first service from the first server.
  • the client sends a HelloRequest message to the first server, and accordingly, the first server sends the HelloRequest message to the first server.
  • the client sends a HelloReply message to implement the client's call to the first server.
  • the first line (line 1) is used to define the service to be called as the HelloService service
  • the second line (line 2) is used to specify the HelloRequest message to send the request for calling the HelloService
  • the third line (line 3) It is used to fill the required parameters of the HelloRequest message.
  • the fourth line (line 4) is used to send the HelloRequest message using the sayHello method.
  • the first server listens to the address "156.103.2.144:22225" to obtain the message sent by the client, and judges using the communication protocol "A" according to the address, and deserializes the message according to the communication protocol "A", and Make a call to the first service.
  • the first server when the information of the first server changes (for example, the type or version of the supported communication protocol, the communication address, etc. changes), the first server sends the changed information to the registration center.
  • the client can subscribe to the change information of the first server from the registration center.
  • the registration center sends the change information to the client, so that the client can know the first service in a timely manner.
  • the latest information is beneficial for the client to call the first service.
  • the related information of the first service includes a type or version of a communication protocol supported by the first server where the first service is located, a communication address, and the like.
  • the client sends a first request message to the registration center, and the registration center sends the communication address of the first server and the supported communication protocol to the client according to the first request message, and then the client according to a preset
  • the selection strategy filters out the first communication protocol supported by the client and the first server, and then the client invokes the first service according to the first communication protocol and the communication address of the first server.
  • the client can adaptively select an appropriate communication protocol to communicate with the first server according to the selection strategy, and the selection scheme of the communication protocol is optimized.
  • FIG. 6 is a remote procedure call protocol adaptive method provided by an embodiment of the present application.
  • the method may be implemented based on the distributed software architecture shown in FIG. 2.
  • the method includes, but is not limited to, the following steps:
  • Step S600 each server registers the service information provided by itself with the registration center.
  • step S600 may refer to step S300, and details are not described herein again.
  • Step S601 The client sends a first request message to the registration center.
  • step S601 may refer to step S301, and details are not described herein again.
  • Step S602 The registration center receives a first request message sent by a client.
  • step S602 may refer to step S302.
  • the first request message also carries information about a communication protocol supported by the client.
  • Step S603 the registration center determines a communication protocol supported by the communication address of the first server, and selects from a communication protocol supported by the first server and a communication protocol supported by the client according to a preset selection policy, Selecting a first communication protocol supported by both the first server and the client.
  • the registration center can determine the communication protocol supported by the client and the communication protocol supported by the first server according to the information registered by each server in the registration center and the information carried in the first request message. Therefore, the registration center can First, the communication protocols supported by the client and the first server are determined, and then the first communication protocol is filtered from the determined communication protocols according to a preset selection policy. It can be understood that there may be more than one communication protocol supported by the client and the first server, so the registration center needs to select a communication protocol for communication according to the selection strategy.
  • the selection policy specifies the rules for selecting a communication protocol, for example, specifying a communication protocol with higher security; for example, specifying a communication protocol with the highest transmission efficiency; and so on.
  • the communication protocols supported by the client and the first server include the private protocol A and the The target interworking protocol.
  • a communication protocol needs to be selected from the private protocol A and the target interworking protocol as the first communication protocol according to the selection strategy. Which one of the communication protocols is ultimately selected is determined by the selection strategy. For example, if the The communication protocol specifies the selection of a communication protocol with a higher security level, and the selected communication protocol is the private protocol A. If the communication protocol specifies the selection of a communication protocol with better compatibility (for example, it can support more types of object communication), then The selected communication protocol is the target interworking protocol.
  • the communication protocol used is determined, a more detailed address can be matched according to the determined communication protocol. For example, if the communication protocol A is used, the communication address that can be matched to the first server includes the IP address 156.103.2.144 And port 22225. If the target interworking protocol is used, the communication addresses that can be matched to the first server include: IP address 156.103.2.144 and port 22226.
  • the registration center may update the selection policy according to needs, and different selection policies provide different filtering rules. It is understandable that developers may have different ideas about the choice of communication protocols over time. For example, sometimes a communication protocol with higher security is required, sometimes a communication protocol with higher transmission efficiency is required, and sometimes interworking is required. A stronger communication protocol. By changing the selection strategy, developers can ensure that the communication protocols that meet the corresponding characteristics are screened. In addition, because the selection strategy is deployed on the registry, when developers want to change the selection strategy, making changes directly on the registry can ensure that all subsequent service invocation processes use the new selection strategy and maintenance costs low.
  • Step S604 The registration center sends the first communication protocol and the communication address of the first server to the client.
  • Step S605 The client receives the first communication protocol and the communication address of the first server sent by the registration center.
  • Step S606 The client invokes the first service according to the first communication protocol and the communication address of the first server.
  • step S606 reference may be made to step S306, and details are not described herein again.
  • the client sends a first request message to the registration center, and the registration center determines, based on the first request message and the information registered by each server to the registration center, that both the client and the first server support.
  • the first communication protocol and then sends the first communication protocol and the communication address of the first server to the client, and then the client invokes the first service according to the first communication protocol and the communication address of the first server.
  • the registration center can adaptively select an appropriate communication protocol for the client to communicate with the first server according to the selection strategy, and the selection scheme of the communication protocol is optimized.
  • the selection strategy is deployed on the registry, with low maintenance costs.
  • FIG. 7 is a schematic structural diagram of a client 70 provided by an embodiment of the present application.
  • the client may include a communication unit 701 and a processing unit 702. If corresponding to FIG. 2, the communication unit 701 is configured to perform operations required by the distributed communication layer 2003 in FIG. 2, and the processing unit 702 is configured to perform services required by the service 2001 and the programming framework 2002 in FIG. 2. operating.
  • the detailed description of the communication unit 701 and the processing unit 702 is as follows.
  • the communication unit 701 is configured to send a first request message to a registration center, where the registration center stores a communication address of a server where each service is located in a plurality of services and a supported communication protocol; the first request message is used to request the A communication address of a first server where a first service of a plurality of services is located and a communication protocol supported by the first server;
  • the communication unit 701 is further configured to receive a communication address of the first server and a supported communication protocol sent by the registration center;
  • the processing unit 702 is configured to select, from a communication protocol supported by the client and a communication protocol supported by the first server, a first protocol supported by the client and the first server according to a preset selection policy. letter of agreement;
  • the processing unit 701 is further configured to invoke the first service according to the first communication protocol and a communication address of the first server.
  • processing unit 702 is further configured to update the selection strategy, and different selection rules specified by the selection strategy are different.
  • the communication unit 701 is further configured to receive after the processing unit 702 invokes the first service according to the first communication protocol and the communication address of the first server.
  • each unit may also correspond to the corresponding description of the method embodiment shown in FIG. 3.
  • FIG. 8 is a schematic structural diagram of a client 80 provided by an embodiment of the present application.
  • the client may include a communication unit 801 and a processing unit 802. If corresponding to FIG. 2, the communication unit 801 is configured to perform operations required by the distributed communication layer 2003 in FIG. 2, and the processing unit 802 is configured to perform services required by the service 2001 and the programming framework 2002 in FIG. 2. operating.
  • the detailed description of the communication unit 801 and the processing unit 802 is as follows.
  • the communication unit 801 is configured to send a first request message to a registration center, where the registration center stores a communication address of a server where each service is located in a plurality of services and a supported communication protocol; the first request message is used to request the A communication address of a first server where a first service of a plurality of services is located, and the first request message carries a communication protocol supported by the client;
  • the communication unit 801 is further configured to receive a first communication protocol and a communication address of the first server sent by the registration center, where the first communication protocol is supported by both the client and the first server. letter of agreement;
  • the processing unit 802 is configured to call the first service according to the first communication protocol and a communication address of the first server.
  • the communication unit is further configured to receive the first service after the processing unit invokes the first service according to the first communication protocol and the communication address of the first server.
  • processing unit 802 is further configured to update the selection strategy, and different selection rules specified by the selection strategy are different.
  • the communication unit 801 is further configured to: after the processing unit invokes the first service according to the first communication protocol and the communication address of the first server, receive The change information of the first server sent by the registration center, where the change information includes a communication address and / or a supported communication protocol.
  • each unit may also correspond to the corresponding description of the method embodiment shown in FIG. 6.
  • FIG. 9 is a server 90 provided in an embodiment of the present application.
  • the server 90 includes a processor 901, a memory 902, and a communication interface 903.
  • the processor 901, the memory 902, and the communication interface 903 are connected to each other through a bus .
  • the memory 902 includes, but is not limited to, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), or A portable read-only memory (CD-ROM).
  • RAM random access memory
  • ROM read-only memory
  • EPROM erasable programmable read-only memory
  • CD-ROM portable read-only memory
  • the processor 901 may be one or more central processing units (CPUs). When the processor 901 is one CPU, the CPU may be a single-core CPU or a multi-core CPU.
  • CPUs central processing units
  • the processor 901 is configured to read instructions stored in the memory 902 to perform operations performed by the processing unit in the example shown in FIG. 7 or FIG. 8, and the communication interface 903 is configured to execute the embodiment shown in FIG. 7 or FIG. 8. Operation performed by the communication unit of the device. That is, the server is used for the client in FIG. 7 or FIG. 8.
  • FIG. 10 is a schematic structural diagram of a registration center 100 according to an embodiment of the present application.
  • the registration center may include a communication unit 1001 and a processing unit 1002.
  • the detailed description of the communication unit 1001 and the processing unit 1002 is as follows.
  • the communication unit 1001 is configured to receive a first request message sent by a client.
  • the registration center stores a communication address and a supported communication protocol of a server where each of the multiple services is located.
  • the first request message is used to request all The communication address of the first server where the first service of the plurality of services is located and the communication protocol supported by the first server;
  • the communication unit 1001 is further configured to send the communication address of the first server and a supported communication protocol to the client; the communication protocol supported by the first server is used to determine a first communication protocol, and the first The communication protocol is a communication protocol supported by both the client and the first server; the first communication protocol and the communication address of the first server are used by the client to call from the first server The first service.
  • the communication unit 1001 is further configured to receive a communication address of the first server and a supported communication protocol sent by the first server;
  • the processing unit 1002 is configured to store a communication address of the first server and a supported communication protocol.
  • the communication unit 1001 after the communication unit 1001 sends the communication address of the first server and the supported communication protocol to the client, the communication unit 1001 is further configured to:
  • each unit may also correspond to the corresponding description of the method embodiment shown in FIG. 3.
  • FIG. 11 is a schematic structural diagram of a registration center 110 according to an embodiment of the present application.
  • the registration center may include a communication unit 1101 and a processing unit 1102.
  • the detailed description of the communication unit 1101 and the processing unit 1102 is as follows.
  • the communication unit 1101 is configured to receive a first request message sent by a client.
  • the registration center stores a communication address and a supported communication protocol of a server where each of the multiple services is located.
  • the first request message is used to request all The communication address of the first server where the first service of the plurality of services is located, and the first request message carries a communication protocol supported by the client;
  • the processing unit 1102 is configured to determine a communication protocol supported by the communication address of the first server, and select a communication protocol supported by the first server and the communication protocol supported by the client according to a preset selection policy.
  • the communication unit 1101 is further configured to send the first communication protocol and the communication address of the first server to the client, and the first communication protocol and the communication address of the first server are used for the client.
  • the terminal calls the first service from the first server.
  • processing unit 1102 is further configured to update the selection policy, and different selection policies provide different filtering rules.
  • the communication unit 1101 is further configured to receive a communication address of the first server and a supported communication protocol sent by the first server;
  • the processing unit 1102 is further configured to store a communication address of the first server and a supported communication protocol.
  • the communication unit 1101 after the communication unit 1101 sends the communication address of the first server and the supported communication protocol to the client, the communication unit 1101 is further configured to:
  • each unit may also correspond to the corresponding description of the method embodiment shown in FIG. 6.
  • FIG. 12 is a server 120 according to an embodiment of the present application.
  • the server 120 includes a processor 1201, a memory 1202, and a communication interface 1203.
  • the processor 1201, the memory 1202, and the communication interface 1203 are connected to each other through a bus .
  • the memory 1202 includes, but is not limited to, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), or A portable read-only memory (CD-ROM).
  • RAM random access memory
  • ROM read-only memory
  • EPROM erasable programmable read-only memory
  • CD-ROM portable read-only memory
  • the processor 1201 may be one or more central processing units (CPUs).
  • CPUs central processing units
  • the CPU may be a single-core CPU or a multi-core CPU.
  • the processor 1201 is configured to read instructions stored in the memory 1202 to perform operations performed by the processing unit in the example shown in FIG. 10 or FIG. 11, and the communication interface 1203 is configured to execute the embodiment shown in FIG. 10 or FIG. 11. Operation performed by the communication unit of the device. That is, the server is used for the registration center in FIG. 10 or FIG. 11.
  • server 90 may be a single server or a server cluster
  • server 120 may be a single server, a server cluster, or a server cluster.
  • server 90 and the server 120 may be two different servers (or server clusters), or may be the same server (or server cluster).
  • the client sends a first request message to the registration center, and the registration center determines the first communication protocol supported by the client and the first server according to the first request message and the information registered by each server to the registration center. And then sending the first communication protocol and the communication address of the first server to the client, and then the client invokes the first service according to the first communication protocol and the communication address of the first server.
  • the registration center can adaptively select an appropriate communication protocol for the client to communicate with the first server according to the selection strategy, and the selection scheme of the communication protocol is optimized.
  • the selection strategy is deployed on the registry, with low maintenance costs.
  • the processes may be completed by a computer program instructing related hardware.
  • the program may be stored in a computer-readable storage medium. When the program is executed, It may include the processes of the method embodiments described above.
  • the foregoing storage media include: ROM or random storage memory RAM, magnetic disks, or optical discs, which can store various program code media.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Communication Control (AREA)

Abstract

Embodiments of the present application provide a remote procedure call protocol self-adaptation method, a related device, and a server. The method comprises: a client sends a first request message to a registry center, the registry center storing, for each service among a plurality of services, the communication address of and the communication protocols supported by the service end where the service is located; the client receives the communication address of and the communication protocol supported by a first service end sent by the registry center; according to a preset selection strategy, the client selects, from among the communication protocols supported by the client and from among the communication protocols supported by the first service end, a first communication protocol supported by both the client and the first service end; the client calls a first service according to the first communication protocol and the communication address of the first service end. By means of the embodiments of the present application, a suitable communication protocol can be self-adaptively selected for calling between services.

Description

一种远程过程调用协议自适应方法、相关装置及服务器Remote procedure call protocol adaptive method, related device and server 技术领域Technical field
本申请涉及计算机技术领域,尤其涉及一种远程过程调用协议自适应方法、相关装置及服务器。The present application relates to the field of computer technology, and in particular, to a remote procedure call protocol adaptive method, a related device, and a server.
背景技术Background technique
远程过程调用(Remote Procedure Call,RPC)是一种常见的分布式系统的通信机制和开发方法,它允许开发人员像调用本地服务一样调用远程服务,调用者对网络通信、参数编码等细节透明,甚至不用感知远程服务的部署位置。RPC在提供了强大的远程调用能力的同时不失本地调用的语义简洁性,从而在分布式计算领域特别是服务化架构中得到大量应用。分布式系统中的各个服务一般通过命名服务来互相发现。图1为现有技术中的一种RPC的场景示意图,该场景中包括服务消费者(consumer)、服务提供者(provider)、服务运行容器(container)、注册中心(registry)和监控中心(monitor),RPC的流程包括:Remote procedure call (RPC) is a common distributed system communication mechanism and development method. It allows developers to call remote services like local services. The caller is transparent about network communication, parameter encoding, and other details. You don't even need to be aware of where the remote service is deployed. RPC provides powerful remote calling capabilities without losing the semantic conciseness of local calls, and thus has been widely used in the field of distributed computing, especially in service-oriented architectures. The services in a distributed system usually discover each other through naming services. FIG. 1 is a schematic diagram of an RPC scenario in the prior art. The scenario includes a service consumer, a service provider, a service operation container, a registry, and a monitor. ), The RPC process includes:
1、服务运行容器启动、加载、运行服务提供者;1. The service running container starts, loads, and runs the service provider;
2、服务提供者启动后向注册中心注册自己可提供的服务,注册的信息包括但不限于:对外暴露的互联网协议地址(Internet Protocol Address,IP)、端口等信息;2. After the service provider starts up, it can register its available services with the registration center. The registered information includes, but is not limited to, the Internet Protocol Address (IP) and port information exposed to the outside world;
3、服务消费者在启动后向注册中心订阅自己所需的服务,可称为目标服务。3. After the service consumer starts, he subscribes the services he needs to the registration center, which can be called the target service.
4、注册中心将提供目标服务的服务提供者的注册信息发送给该服务消费者,另外,如果目标服务的信息有变更,则注册中心也会将变更的信息发送给服务消费者。4. The registration center sends the registration information of the service provider providing the target service to the service consumer. In addition, if the target service information is changed, the registration center will also send the changed information to the service consumer.
5.服务消费者基于负载均衡算法从注册中心反馈的服务提供者中选择一个服务提供者来调用该目标服务,如果调用失败,则选择另外一个服务提供者来调用该目标服务。5. The service consumer selects one service provider to call the target service from the service providers fed back by the registration center based on the load balancing algorithm, and if the call fails, selects another service provider to call the target service.
6.服务消费者和服务提供者在内存中累计对各个服务的调用次数和调用时间,并按照预设时间周期将统计的数据发送到监控中心,以便掌控各个服务的调用情况。6. Service consumers and service providers accumulate the number of calls and call times for each service in memory, and send the statistical data to the monitoring center according to a preset time period, in order to control the call of each service.
目前服务消费者从服务提供者调用服务时需要基于通信协议进行通信,目前的做法是预先在服务消费者上针对每个服务各配置至少一个通信协议,当某个服务提供者所支持的通信协议有更新(例如,升级)时服务消费者是无法感知到的,这可能导致服务消费者后续无法采用更新后的通信协议正常调用该某个服务提供上的服务。也即是说,现有技术中的通信协议的配置方式可能导致服务消费者无法正常从服务提供者上调用服务。At present, service consumers need to communicate based on communication protocols when calling services from service providers. The current practice is to configure at least one communication protocol for each service on the service consumer in advance. When a communication protocol supported by a service provider When there is an update (for example, an upgrade), the service consumer cannot perceive it, which may cause the service consumer to fail to use the updated communication protocol to normally call the service provided by the certain service. That is to say, the configuration of the communication protocol in the prior art may cause the service consumer to fail to call the service from the service provider normally.
发明内容Summary of the Invention
本申请实施例公开了一种远程过程调用协议自适应方法、相关装置及服务器,能够自适应地选择合适的通信协议来用于服务之间的调用。The embodiment of the present application discloses a remote procedure call protocol adaptive method, a related device and a server, which can adaptively select a suitable communication protocol for calling between services.
第一方面,本申请实施例提供一种远程过程调用协议自适应方法,该方法包括:In a first aspect, an embodiment of the present application provides a remote procedure call protocol adaptation method, which includes:
客户端向注册中心发送第一请求消息,所述注册中心存储了多个服务中每个服务所在的服务端的通信地址和支持的通信协议;所述第一请求消息用于请求所述多个服务中的第 一服务所在的第一服务端的通信地址和所述第一服务端支持的通信协议;The client sends a first request message to the registration center, where the registration center stores the communication address of the server where each of the multiple services is located and the supported communication protocol; the first request message is used to request the multiple services The communication address of the first server where the first service in the server is located and the communication protocol supported by the first server;
所述客户端接收所述注册中心发送的所述第一服务端的通信地址和支持的通信协议;Receiving, by the client, the communication address of the first server and a supported communication protocol sent by the registration center;
所述客户端根据预设的选择策略从所述客户端支持的通信协议和所述第一服务端支持的通信协议中,选择所述客户端和所述第一服务端均支持的第一通信协议;The client selects a first communication supported by the client and the first server from a communication protocol supported by the client and a communication protocol supported by the first server according to a preset selection policy. protocol;
所述客户端根据所述第一通信协议和所述第一服务端的通信地址调用所述第一服务。The client invokes the first service according to the first communication protocol and a communication address of the first server.
通过执行上述方法,客户端向注册中心发送第一请求消息,注册中心根据第一请求消息向客户端发送第一服务端的通信地址和支持的通信协议,然后客户端根据预设的选择策略筛选出该客户端和该第一服务端均支持的第一通信协议,之后客户端根据该第一通信协议和该第一服务端的通信地址调用所述第一服务。在这个过程中,该客户端可以根据选择策略自适应地选择合适的通信协议来与第一服务端进行通信,优化了通信协议的选择方案。By executing the above method, the client sends a first request message to the registration center, and the registration center sends the communication address of the first server and the supported communication protocol to the client according to the first request message, and then the client filters out according to a preset selection policy A first communication protocol supported by both the client and the first server, and then the client invokes the first service according to the first communication protocol and a communication address of the first server. In this process, the client can adaptively select an appropriate communication protocol to communicate with the first server according to the selection strategy, and the selection scheme of the communication protocol is optimized.
在又一种可选的方案中,所述方法包括:所述客户端更新所述选择策略,不同的所述选择策略规定的筛选规则不同。这样一来,当需要那种类型的协议的时候就可以先选择相应地选择策略,然后通过该选择策略选择出所需的通信协议。In yet another optional solution, the method includes: the client updates the selection policy, and different selection rules specify different filtering rules. In this way, when that type of protocol is needed, the corresponding selection strategy can be selected first, and then the required communication protocol is selected through the selection strategy.
在又一种可选的方案中,所述客户端根据所述第一通信协议和所述第一服务端的通信地址调用所述第一服务之后,还包括:所述客户端接收所述注册中心发送的所述第一服务端的变更信息,所述变更信息包括通信地址和/或支持的通信协议。这样一来,即便是第一服务的相关信息发生了变更,该客户端依旧可以顺利地对第一服务进行调用。In another optional solution, after the client invokes the first service according to the first communication protocol and the communication address of the first server, the method further includes: the client receives the registration center The change information of the first server that is sent, where the change information includes a communication address and / or a supported communication protocol. In this way, even if the related information of the first service is changed, the client can still call the first service smoothly.
第二方面,本申请实施例提供一种远程过程调用协议自适应方法,该方法包括:In a second aspect, an embodiment of the present application provides a remote procedure call protocol adaptation method, which includes:
客户端向注册中心发送第一请求消息,所述注册中心存储了多个服务中每个服务所在的服务端的通信地址和支持的通信协议;所述第一请求消息用于请求所述多个服务中的第一服务所在的第一服务端的通信地址,所述第一请求消息携带所述客户端支持的通信协议;The client sends a first request message to the registration center, where the registration center stores the communication address of the server where each of the multiple services is located and the supported communication protocol; the first request message is used to request the multiple services The communication address of the first server where the first service in the server is located, and the first request message carries a communication protocol supported by the client;
所述客户端接收所述注册中心发送的第一通信协议和所述第一服务端的通信地址,所述第一通信协议为所述客户端和所述第一服务端均支持的通信协议;Receiving, by the client, a first communication protocol and a communication address of the first server sent by the registration center, where the first communication protocol is a communication protocol supported by both the client and the first server;
所述客户端根据所述第一通信协议和所述第一服务端的通信地址调用所述第一服务。The client invokes the first service according to the first communication protocol and a communication address of the first server.
通过执行上述方法,客户端向注册中心发送第一请求消息,注册中心根据第一请求消息以及各个服务端注册到注册中心的信息确定该客户端和该第一服务端均支持的第一通信协议,然后将第一通信协议和第一服务端的通信地址发送给客户端,之后客户端根据第一通信协议和该第一服务端的通信地址调用所述第一服务。在这个过程中,注册中心可以根据选择策略自适应地选择合适的通信协议供客户端与第一服务端进行通信,优化了通信协议的选择方案。By executing the above method, the client sends a first request message to the registration center, and the registration center determines the first communication protocol supported by the client and the first server according to the first request message and the information registered by each server to the registration center. And then sending the first communication protocol and the communication address of the first server to the client, and then the client invokes the first service according to the first communication protocol and the communication address of the first server. In this process, the registration center can adaptively select an appropriate communication protocol for the client to communicate with the first server according to the selection strategy, and the selection scheme of the communication protocol is optimized.
在又一种可选的方案中,所述客户端根据所述第一通信协议和所述第一服务端的通信地址调用所述第一服务之后,还包括:所述客户端接收所述注册中心发送的所述第一服务端的变更信息,所述变更信息包括通信地址和/或支持的通信协议。这样一来,即便是第一服务的相关信息发生了变更,该客户端依旧可以顺利地对第一服务进行调用。In another optional solution, after the client invokes the first service according to the first communication protocol and the communication address of the first server, the method further includes: the client receives the registration center The change information of the first server that is sent, where the change information includes a communication address and / or a supported communication protocol. In this way, even if the related information of the first service is changed, the client can still call the first service smoothly.
第三方面,本申请实施例提供一种远程过程调用协议自适应方法,该方法包括:In a third aspect, an embodiment of the present application provides a remote procedure call protocol adaptation method, which includes:
注册中心接收客户端发送的第一请求消息,所述注册中心存储了多个服务中每个服务 所在的服务端的通信地址和支持的通信协议;所述第一请求消息用于请求所述多个服务中的第一服务所在的第一服务端的通信地址和所述第一服务端支持的通信协议;The registration center receives a first request message sent by a client, and the registration center stores a communication address and a supported communication protocol of a server where each of the multiple services is located; the first request message is used to request the multiple The communication address of the first server where the first service in the service is located and the communication protocol supported by the first server;
所述注册中心向所述客户端发送所述第一服务端的通信地址和支持的通信协议;所述第一服务端支持的通信协议用于确定第一通信协议,所述第一通信协议为所述客户端和所述第一服务端均支持的通信协议;所述第一通信协议和所述第一服务端的通信地址用于所述客户端从所述第一服务端上调用所述第一服务。Sending, by the registration center, the communication address of the first server and a supported communication protocol to the client; the communication protocol supported by the first server is used to determine a first communication protocol, and the first communication protocol is A communication protocol supported by both the client and the first server; the first communication protocol and the communication address of the first server are used by the client to call the first from the first server service.
通过执行上述方法,客户端向注册中心发送第一请求消息,注册中心根据第一请求消息向客户端发送第一服务端的通信地址和支持的通信协议,然后客户端根据预设的选择策略筛选出该客户端和该第一服务端均支持的第一通信协议,之后客户端根据该第一通信协议和该第一服务端的通信地址调用所述第一服务。在这个过程中,该客户端可以根据选择策略自适应地选择合适的通信协议来与第一服务端进行通信,优化了通信协议的选择方案。By executing the above method, the client sends a first request message to the registration center, and the registration center sends the communication address of the first server and the supported communication protocol to the client according to the first request message, and then the client filters out according to a preset selection policy A first communication protocol supported by both the client and the first server, and then the client invokes the first service according to the first communication protocol and a communication address of the first server. In this process, the client can adaptively select an appropriate communication protocol to communicate with the first server according to the selection strategy, and the selection scheme of the communication protocol is optimized.
在又一种可选的方案中,所述注册中心接收客户端发送的第一请求消息之前,还包括:所述注册中心接收所述第一服务端发送的所述第一服务端的通信地址和支持的通信协议;所述注册中心存储所述第一服务端的通信地址和支持的通信协议。可以理解的是,第一服务端将第一服务的相关信息注册到注册中心,这样注册中心就可以向其他服务提供该第一服务的信息,以便其他服务可以顺利对该第一服务进行调用。In another optional solution, before the registration center receives the first request message sent by the client, the method further includes: receiving, by the registration center, the communication address and Supported communication protocols; the registration center stores the communication address of the first server and the supported communication protocols. It can be understood that the first server registers the related information of the first service to the registration center, so that the registration center can provide the information of the first service to other services, so that other services can call the first service smoothly.
在又一种可选的方案中,所述注册中心向所述客户端发送所述第一服务端的通信地址和支持的通信协议之后,还包括:所述注册中心接收所述第一服务端发送的所述第一服务端的变更信息,所述变更信息包括通信地址和/或支持的通信协议;所述注册中心向所述客户端发送所述第一服务端的变更信息。这样一来,即便是第一服务的相关信息发生了变更,该客户端依旧可以顺利地对第一服务进行调用。In another optional solution, after the registration center sends the communication address of the first server and the supported communication protocol to the client, the method further includes: receiving, by the registration center, the first server The change information of the first server, wherein the change information includes a communication address and / or a supported communication protocol; and the registration center sends the change information of the first server to the client. In this way, even if the related information of the first service is changed, the client can still call the first service smoothly.
第四方面,本申请实施例提供一种远程过程调用协议自适应方法,该方法包括:In a fourth aspect, an embodiment of the present application provides a remote procedure call protocol adaptation method, which includes:
注册中心接收客户端发送的第一请求消息,所述注册中心存储了多个服务中每个服务所在的服务端的通信地址和支持的通信协议;所述第一请求消息用于请求所述多个服务中的第一服务所在的第一服务端的通信地址,所述第一请求消息携带所述客户端支持的通信协议;The registration center receives a first request message sent by a client, and the registration center stores a communication address and a supported communication protocol of a server where each of the multiple services is located; the first request message is used to request the multiple A communication address of a first server where a first service in the service is located, and the first request message carries a communication protocol supported by the client;
所述注册中心确定所述第一服务端的通信地址支持的通信协议,并根据预设的选择策略从所述第一服务端支持的通信协议和所述客户端支持的通信协议中,选择所述第一服务端和所述客户端均支持的第一通信协议;The registration center determines a communication protocol supported by the communication address of the first server, and selects the communication protocol supported by the first server and the communication protocol supported by the client according to a preset selection policy. A first communication protocol supported by both the first server and the client;
所述注册中心向所述客户端发送所述第一通信协议和所述第一服务端的通信地址,所述第一通信协议和所述第一服务端的通信地址用于所述客户端从所述第一服务端上调用所述第一服务。The registration center sends the first communication protocol and the communication address of the first server to the client, and the first communication protocol and the communication address of the first server are used by the client The first server invokes the first service.
通过执行上述方法,客户端向注册中心发送第一请求消息,注册中心根据第一请求消息以及各个服务端注册到注册中心的信息确定该客户端和该第一服务端均支持的第一通信协议,然后将第一通信协议和第一服务端的通信地址发送给客户端,之后客户端根据第一通信协议和该第一服务端的通信地址调用所述第一服务。在这个过程中,注册中心可以根据选择策略自适应地选择合适的通信协议供客户端与第一服务端进行通信,优化了通信协 议的选择方案。By executing the above method, the client sends a first request message to the registration center, and the registration center determines the first communication protocol supported by the client and the first server according to the first request message and the information registered by each server to the registration center. And then sending the first communication protocol and the communication address of the first server to the client, and then the client invokes the first service according to the first communication protocol and the communication address of the first server. In this process, the registration center can adaptively select a suitable communication protocol for the client to communicate with the first server according to the selection strategy, and optimize the selection scheme of the communication protocol.
在又一种可选的方案中,所述方法包括:所述注册中心更新所述选择策略,不同的所述选择策略规定的筛选规则不同。也即是说,由该注册中心对选择策略进行集中维护,这样当选择协议的标准需要进行变换时直接在注册中心修改选择策略就可以实现,之后无论哪个服务请求第一服务的支持的通信协议,都可以从注册中心获得满足最新标准的通信协议。即选择策略在注册中心进行了集中维护,大大降低了维护成本。In yet another optional solution, the method includes: the registry updates the selection policy, and different selection policies specify different filtering rules. That is to say, the registration center maintains the selection strategy centrally, so that when the selection protocol standard needs to be changed, it can be implemented by directly modifying the selection strategy in the registration center. No matter which service requests the communication protocol supported by the first service , You can get from the registry to meet the latest standards of communication protocols. That is, the selection strategy is centrally maintained in the registry, which greatly reduces maintenance costs.
在又一种可选的方案中,所述注册中心接收客户端发送的第一请求消息之前,还包括:所述注册中心接收所述第一服务端发送的所述第一服务端的通信地址和支持的通信协议;所述注册中心存储所述第一服务端的通信地址和支持的通信协议。可以理解的是,第一服务端将第一服务的相关信息注册到注册中心,这样注册中心就可以向其他服务提供该第一服务的信息,以便其他服务可以顺利对该第一服务进行调用。In another optional solution, before the registration center receives the first request message sent by the client, the method further includes: receiving, by the registration center, the communication address and Supported communication protocols; the registration center stores the communication address of the first server and the supported communication protocols. It can be understood that the first server registers the related information of the first service to the registration center, so that the registration center can provide the information of the first service to other services, so that other services can call the first service smoothly.
在又一种可选的方案中,所述注册中心向所述客户端发送所述第一服务端的通信地址和支持的通信协议之后,还包括:所述注册中心接收所述第一服务端发送的所述第一服务端的变更信息,所述变更信息包括通信地址和/或支持的通信协议;所述注册中心向所述客户端发送所述第一服务端的变更信息。这样一来,即便是第一服务的相关信息发生了变更,该客户端依旧可以顺利地对第一服务进行调用。In another optional solution, after the registration center sends the communication address of the first server and the supported communication protocol to the client, the method further includes: receiving, by the registration center, the first server The change information of the first server, wherein the change information includes a communication address and / or a supported communication protocol; and the registration center sends the change information of the first server to the client. In this way, even if the related information of the first service is changed, the client can still call the first service smoothly.
第五方面,本申请实施例提供一种客户端,该客户端包括:In a fifth aspect, an embodiment of the present application provides a client, and the client includes:
通信单元,用于向注册中心发送第一请求消息,所述注册中心存储了多个服务中每个服务所在的服务端的通信地址和支持的通信协议;所述第一请求消息用于请求所述多个服务中的第一服务所在的第一服务端的通信地址和所述第一服务端支持的通信协议;A communication unit, configured to send a first request message to a registration center, where the registration center stores a communication address of a server where each service of a plurality of services is located and a supported communication protocol; the first request message is used to request the A communication address of a first server where a first service of a plurality of services is located and a communication protocol supported by the first server;
所述通信单元,还用于接收所述注册中心发送的所述第一服务端的通信地址和支持的通信协议;The communication unit is further configured to receive a communication address of the first server and a supported communication protocol sent by the registration center;
处理单元,用于根据预设的选择策略从所述客户端支持的通信协议和所述第一服务端支持的通信协议中,选择所述客户端和所述第一服务端均支持的第一通信协议;A processing unit, configured to select a first protocol supported by the client and the first server from the communication protocols supported by the client and the first server supported according to a preset selection policy letter of agreement;
所述处理单元,还用于根据所述第一通信协议和所述第一服务端的通信地址调用所述第一服务。The processing unit is further configured to call the first service according to the first communication protocol and a communication address of the first server.
可以看出,客户端向注册中心发送第一请求消息,注册中心根据第一请求消息向客户端发送第一服务端的通信地址和支持的通信协议,然后客户端根据预设的选择策略筛选出该客户端和该第一服务端均支持的第一通信协议,之后客户端根据该第一通信协议和该第一服务端的通信地址调用所述第一服务。在这个过程中,该客户端可以根据选择策略自适应地选择合适的通信协议来与第一服务端进行通信,优化了通信协议的选择方案。It can be seen that the client sends a first request message to the registration center, and the registration center sends the communication address of the first server and the supported communication protocol to the client according to the first request message, and then the client filters out the message according to a preset selection policy. A first communication protocol supported by both the client and the first server, and then the client invokes the first service according to the first communication protocol and the communication address of the first server. In this process, the client can adaptively select an appropriate communication protocol to communicate with the first server according to the selection strategy, and the selection scheme of the communication protocol is optimized.
在又一种可选的方案中,所述处理单元,还用于更新所述选择策略,不同的所述选择策略规定的筛选规则不同。这样一来,当需要那种类型的协议的时候就可以先选择相应地选择策略,然后通过该选择策略选择出所需的通信协议。In yet another optional solution, the processing unit is further configured to update the selection strategy, and different selection rules specified by the selection strategy are different. In this way, when that type of protocol is needed, the corresponding selection strategy can be selected first, and then the required communication protocol is selected through the selection strategy.
在又一种可选的方案中,所述通信单元还用于,在所述处理单元根据所述第一通信协议和所述第一服务端的通信地址调用所述第一服务之后,接收所述注册中心发送的所述第一服务端的变更信息,所述变更信息包括通信地址和/或支持的通信协议。这样一来,即便 是第一服务的相关信息发生了变更,该客户端依旧可以顺利地对第一服务进行调用。In still another optional solution, the communication unit is further configured to receive the first service after the processing unit invokes the first service according to the first communication protocol and the communication address of the first server. The change information of the first server sent by the registration center, where the change information includes a communication address and / or a supported communication protocol. In this way, even if the related information of the first service is changed, the client can still call the first service smoothly.
第六方面,本申请实施例提供一种客户端,该客户端包括:In a sixth aspect, an embodiment of the present application provides a client, and the client includes:
通信单元,用于向注册中心发送第一请求消息,所述注册中心存储了多个服务中每个服务所在的服务端的通信地址和支持的通信协议;所述第一请求消息用于请求所述多个服务中的第一服务所在的第一服务端的通信地址,所述第一请求消息携带所述客户端支持的通信协议;A communication unit, configured to send a first request message to a registration center, where the registration center stores a communication address of a server where each service of a plurality of services is located and a supported communication protocol; the first request message is used to request the A communication address of a first server where a first service of a plurality of services is located, and the first request message carries a communication protocol supported by the client;
所述通信单元,还用于接收所述注册中心发送的第一通信协议和所述第一服务端的通信地址,所述第一通信协议为所述客户端和所述第一服务端均支持的通信协议;The communication unit is further configured to receive a first communication protocol and a communication address of the first server sent by the registration center, where the first communication protocol is supported by both the client and the first server. letter of agreement;
处理单元,用于根据所述第一通信协议和所述第一服务端的通信地址调用所述第一服务。A processing unit, configured to invoke the first service according to the first communication protocol and a communication address of the first server.
可以看出,客户端向注册中心发送第一请求消息,注册中心根据第一请求消息以及各个服务端注册到注册中心的信息确定该客户端和该第一服务端均支持的第一通信协议,然后将第一通信协议和第一服务端的通信地址发送给客户端,之后客户端根据第一通信协议和该第一服务端的通信地址调用所述第一服务。在这个过程中,注册中心可以根据选择策略自适应地选择合适的通信协议供客户端与第一服务端进行通信,优化了通信协议的选择方案。It can be seen that the client sends a first request message to the registration center, and the registration center determines the first communication protocol supported by the client and the first server according to the first request message and the information registered by each server to the registration center. The first communication protocol and the communication address of the first server are then sent to the client, and then the client invokes the first service according to the first communication protocol and the communication address of the first server. In this process, the registration center can adaptively select an appropriate communication protocol for the client to communicate with the first server according to the selection strategy, and the selection scheme of the communication protocol is optimized.
在又一种可选的方案中,所述通信单元还用于,在所述处理单元根据所述第一通信协议和所述第一服务端的通信地址调用所述第一服务之后,接收所述注册中心发送的所述第一服务端的变更信息,所述变更信息包括通信地址和/或支持的通信协议。这样一来,即便是第一服务的相关信息发生了变更,该客户端依旧可以顺利地对第一服务进行调用。In still another optional solution, the communication unit is further configured to receive the first service after the processing unit invokes the first service according to the first communication protocol and the communication address of the first server. The change information of the first server sent by the registration center, where the change information includes a communication address and / or a supported communication protocol. In this way, even if the related information of the first service is changed, the client can still call the first service smoothly.
第七方面,本申请实施例提供一种注册中心,该注册中心包括:In a seventh aspect, an embodiment of the present application provides a registration center, where the registration center includes:
通信单元,用于接收客户端发送的第一请求消息,所述注册中心存储了多个服务中每个服务所在的服务端的通信地址和支持的通信协议;所述第一请求消息用于请求所述多个服务中的第一服务所在的第一服务端的通信地址和所述第一服务端支持的通信协议;A communication unit, configured to receive a first request message sent by a client, the registration center stores a communication address of a server where each service of a plurality of services is located and a supported communication protocol; the first request message is used to request The communication address of the first server where the first service of the plurality of services is located and the communication protocol supported by the first server;
所述通信单元,还用于向所述客户端发送所述第一服务端的通信地址和支持的通信协议;所述第一服务端支持的通信协议用于确定第一通信协议,所述第一通信协议为所述客户端和所述第一服务端均支持的通信协议;所述第一通信协议和所述第一服务端的通信地址用于所述客户端从所述第一服务端上调用所述第一服务。The communication unit is further configured to send the communication address of the first server and a supported communication protocol to the client; the communication protocol supported by the first server is used to determine a first communication protocol, and the first The communication protocol is a communication protocol supported by both the client and the first server; the first communication protocol and the communication address of the first server are used by the client to call from the first server The first service.
可以看出,客户端向注册中心发送第一请求消息,注册中心根据第一请求消息向客户端发送第一服务端的通信地址和支持的通信协议,然后客户端根据预设的选择策略筛选出该客户端和该第一服务端均支持的第一通信协议,之后客户端根据该第一通信协议和该第一服务端的通信地址调用所述第一服务。在这个过程中,该客户端可以根据选择策略自适应地选择合适的通信协议来与第一服务端进行通信,优化了通信协议的选择方案。It can be seen that the client sends a first request message to the registration center, and the registration center sends the communication address of the first server and the supported communication protocol to the client according to the first request message, and then the client filters out the message according to a preset selection policy. The first communication protocol supported by both the client and the first server, and then the client invokes the first service according to the first communication protocol and the communication address of the first server. In this process, the client can adaptively select an appropriate communication protocol to communicate with the first server according to the selection strategy, and the selection scheme of the communication protocol is optimized.
在又一种可选的方案中,所述通信单元接收客户端发送的第一请求消息之前:所述通信单元,还用于接收所述第一服务端发送的所述第一服务端的通信地址和支持的通信协议;所述处理单元,用于存储所述第一服务端的通信地址和支持的通信协议。可以理解的是, 第一服务端将第一服务的相关信息注册到注册中心,这样注册中心就可以向其他服务提供该第一服务的信息,以便其他服务可以顺利对该第一服务进行调用。In another optional solution, before the communication unit receives the first request message sent by the client: the communication unit is further configured to receive the communication address of the first server sent by the first server And a supported communication protocol; the processing unit is configured to store a communication address of the first server and a supported communication protocol. It can be understood that the first server registers the related information of the first service to the registration center, so that the registration center can provide the information of the first service to other services, so that other services can call the first service smoothly.
在又一种可选的方案中,所述通信单元向所述客户端发送所述第一服务端的通信地址和支持的通信协议之后,还用于:接收所述第一服务端发送的所述第一服务端的变更信息,所述变更信息包括通信地址和/或支持的通信协议;向所述客户端发送所述第一服务端的变更信息。这样一来,即便是第一服务的相关信息发生了变更,该客户端依旧可以顺利地对第一服务进行调用。In another optional solution, after the communication unit sends the communication address of the first server and the supported communication protocol to the client, the communication unit is further configured to: receive the first server Change information of the first server, the change information including a communication address and / or a supported communication protocol; and sending the change information of the first server to the client. In this way, even if the related information of the first service is changed, the client can still call the first service smoothly.
第八方面,本申请实施例提供了一种注册中心,该注册中心包括:In an eighth aspect, an embodiment of the present application provides a registration center. The registration center includes:
通信单元,用于接收客户端发送的第一请求消息,所述注册中心存储了多个服务中每个服务所在的服务端的通信地址和支持的通信协议;所述第一请求消息用于请求所述多个服务中的第一服务所在的第一服务端的通信地址,所述第一请求消息携带所述客户端支持的通信协议;A communication unit, configured to receive a first request message sent by a client, the registration center stores a communication address of a server where each service of a plurality of services is located and a supported communication protocol; the first request message is used to request The communication address of the first server where the first service of the plurality of services is located, and the first request message carries a communication protocol supported by the client;
处理单元,用于确定所述第一服务端的通信地址支持的通信协议,并根据预设的选择策略从所述第一服务端支持的通信协议和所述客户端支持的通信协议中,选择所述第一服务端和所述客户端均支持的第一通信协议;The processing unit is configured to determine a communication protocol supported by the communication address of the first server, and select a communication protocol supported by the first server and the communication protocol supported by the client according to a preset selection policy. The first communication protocol supported by the first server and the client;
所述通信单元,还用于向所述客户端发送所述第一通信协议和所述第一服务端的通信地址,所述第一通信协议和所述第一服务端的通信地址用于所述客户端从所述第一服务端上调用所述第一服务。The communication unit is further configured to send the first communication protocol and the communication address of the first server to the client, and the first communication protocol and the communication address of the first server are used for the client. The terminal calls the first service from the first server.
可以看出,客户端向注册中心发送第一请求消息,注册中心根据第一请求消息以及各个服务端注册到注册中心的信息确定该客户端和该第一服务端均支持的第一通信协议,然后将第一通信协议和第一服务端的通信地址发送给客户端,之后客户端根据第一通信协议和该第一服务端的通信地址调用所述第一服务。在这个过程中,注册中心可以根据选择策略自适应地选择合适的通信协议供客户端与第一服务端进行通信,优化了通信协议的选择方案。It can be seen that the client sends a first request message to the registration center, and the registration center determines the first communication protocol supported by the client and the first server according to the first request message and the information registered by each server to the registration center. The first communication protocol and the communication address of the first server are then sent to the client, and then the client invokes the first service according to the first communication protocol and the communication address of the first server. In this process, the registration center can adaptively select an appropriate communication protocol for the client to communicate with the first server according to the selection strategy, and the selection scheme of the communication protocol is optimized.
在又一种可选的方案中,所述处理单元,还用于更新所述选择策略,不同的所述选择策略规定的筛选规则不同。也即是说,由该注册中心对选择策略进行集中维护,这样当选择协议的标准需要进行变换时直接在注册中心修改选择策略就可以实现,之后无论哪个服务请求第一服务的支持的通信协议,都可以从注册中心获得满足最新标准的通信协议。即选择策略在注册中心进行了集中维护,大大降低了维护成本。In yet another optional solution, the processing unit is further configured to update the selection strategy, and different selection rules specified by the selection strategy are different. That is to say, the registration center maintains the selection strategy centrally, so that when the selection protocol standard needs to be changed, it can be implemented by directly modifying the selection strategy in the registration center. No matter which service requests the communication protocol supported by the first service , You can get from the registry to meet the latest standards of communication protocols. That is, the selection strategy is centrally maintained in the registry, which greatly reduces maintenance costs.
在又一种可选的方案中,所述通信单元接收客户端发送的第一请求消息之前:所述通信单元,还用于接收所述第一服务端发送的所述第一服务端的通信地址和支持的通信协议;所述处理单元,还用于存储所述第一服务端的通信地址和支持的通信协议。可以理解的是,第一服务端将第一服务的相关信息注册到注册中心,这样注册中心就可以向其他服务提供该第一服务的信息,以便其他服务可以顺利对该第一服务进行调用。In another optional solution, before the communication unit receives the first request message sent by the client: the communication unit is further configured to receive the communication address of the first server sent by the first server And a supported communication protocol; the processing unit is further configured to store a communication address of the first server and a supported communication protocol. It can be understood that the first server registers the related information of the first service to the registration center, so that the registration center can provide the information of the first service to other services, so that other services can call the first service smoothly.
在又一种可选的方案中,所述通信单元向所述客户端发送所述第一服务端的通信地址和支持的通信协议之后,还用于:接收所述第一服务端发送的所述第一服务端的变更信息,所述变更信息包括通信地址和/或支持的通信协议;向所述客户端发送所述第一服务端的变 更信息。这样一来,即便是第一服务的相关信息发生了变更,该客户端依旧可以顺利地对第一服务进行调用。In another optional solution, after the communication unit sends the communication address of the first server and the supported communication protocol to the client, the communication unit is further configured to: receive the first server Change information of the first server, the change information including a communication address and / or a supported communication protocol; and sending the change information of the first server to the client. In this way, even if the related information of the first service is changed, the client can still call the first service smoothly.
第九方面,本申请实施例提供一种服务器,所述服务器用于运行第五方面,或者第五方面的任一可能的实现方式,或者第六方面,或者第六方面任一种可能的实现方式所描述的客户端。In a ninth aspect, an embodiment of the present application provides a server configured to run the fifth aspect, or any possible implementation manner of the fifth aspect, or the sixth aspect, or any possible implementation of the sixth aspect. Way described by the client.
第十方面,本申请实施例提供一种服务器,所述服务器用于运行第七方面,或者第七方面的任一可能的实现方式,或者第八方面,或者第八方面任一种可能的实现方式所描述的注册中心。In a tenth aspect, an embodiment of the present application provides a server configured to run the seventh aspect, or any possible implementation manner of the seventh aspect, or the eighth aspect, or any possible implementation of the eighth aspect. Registry described by the way.
通过实施本申请实施例,客户端向注册中心发送第一请求消息,注册中心根据第一请求消息向客户端发送第一服务端的通信地址和支持的通信协议,然后客户端根据预设的选择策略筛选出该客户端和该第一服务端均支持的第一通信协议,之后客户端根据该第一通信协议和该第一服务端的通信地址调用所述第一服务。在这个过程中,该客户端可以根据选择策略自适应地选择合适的通信协议来与第一服务端进行通信,优化了通信协议的选择方案。By implementing the embodiment of the present application, the client sends a first request message to the registration center, and the registration center sends the communication address of the first server and the supported communication protocol to the client according to the first request message, and then the client according to a preset selection policy The first communication protocol supported by the client and the first server is screened out, and then the client invokes the first service according to the first communication protocol and the communication address of the first server. In this process, the client can adaptively select an appropriate communication protocol to communicate with the first server according to the selection strategy, and the selection scheme of the communication protocol is optimized.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
以下对本申请实施例用到的附图进行介绍。The drawings used in the embodiments of the present application are described below.
图1是现有技术中的一种RPC的场景示意图;FIG. 1 is a schematic diagram of an RPC scenario in the prior art;
图2是本申请实施例提供的一种RPC的分布式软件架构示意图;2 is a schematic diagram of an RPC distributed software architecture according to an embodiment of the present application;
图3是本申请实施例提供的一种远程过程调用协议自适应方法的流程示意图;3 is a schematic flowchart of a remote procedure call protocol adaptation method according to an embodiment of the present application;
图4是本申请实施例提供的一种云原生场景中的微服务的场景示意图;4 is a schematic diagram of a microservice in a cloud-native scene provided by an embodiment of the present application;
图5是本申请实施例提供的一种服务之间支持的通信协议的场景示意图;5 is a schematic diagram of a communication protocol supported between services provided by an embodiment of the present application;
图6是本申请实施例提供的一种远程过程调用协议自适应方法的流程示意图;6 is a schematic flowchart of a remote procedure call protocol adaptation method according to an embodiment of the present application;
图7是本申请实施例提供的一种客户端的结构示意图;7 is a schematic structural diagram of a client according to an embodiment of the present application;
图8是本申请实施例提供的一种客户端的结构示意图;8 is a schematic structural diagram of a client according to an embodiment of the present application;
图9是本申请实施例提供的一种服务器的结构示意图;FIG. 9 is a schematic structural diagram of a server according to an embodiment of the present application; FIG.
图10是本申请实施例提供的一种注册中心的结构示意图;10 is a schematic structural diagram of a registration center according to an embodiment of the present application;
图11是本申请实施例提供的一种注册中心的结构示意图;11 is a schematic structural diagram of a registration center according to an embodiment of the present application;
图12是本申请实施例提供的一种服务器的结构示意图。FIG. 12 is a schematic structural diagram of a server according to an embodiment of the present application.
具体实施方式Detailed ways
下面结合本申请实施例中的附图对本申请实施例进行描述。The following describes the embodiments of the present application with reference to the drawings in the embodiments of the present application.
请参见图2,图2是本申请实施例提供的一种PRC的分布式软件架构示意图,该软件架构包括服务治理框架201和多个应用端,图2中仅以3个应用端为例进行示意,这3个应用端依次表示为应用端202、应用端203和应用端204。其中,该服务治理框架201包括注册中心,用于接收并维护各个应用端所注册的注册信息,例如,注册信息可以包括应用端的IP、端口、支持的通信协议、可提供的服务的名称和/或标识等信息。该注册中心还 用于向有需求的应用端发送相应服务所在的应用端的IP、端口、支持的通信协议等信息。可选的,该注册中心可以包括协议适配模块,用于为两个需要进行通信的应用端确定通信协议。Please refer to FIG. 2. FIG. 2 is a schematic diagram of a distributed software architecture of a PRC provided by an embodiment of the present application. The software architecture includes a service management framework 201 and multiple application terminals. In FIG. 2, only three application terminals are used as an example. Schematically, these three application ends are shown as an application end 202, an application end 203, and an application end 204 in this order. The service governance framework 201 includes a registration center for receiving and maintaining registration information registered by each application end. For example, the registration information may include an application end IP, a port, a supported communication protocol, a name of a service that can be provided, and / Or logos. The registration center is also used to send information to the application side that needs the IP address, port, and supported communication protocol of the application side where the corresponding service is located. Optionally, the registration center may include a protocol adaptation module for determining a communication protocol for two applications that need to communicate.
另外,每个应用端可以包括服务2001、编程框架2002和分布式通信层2003,一个应用端获得了另外一个应用端的注册信息之后,该一个应用端中的编程框架2002可以控制该一个应用端中的服务2001调用该另一个服务端中的服务2001。调用过程由该一个应用端中的分布式通信层2003和该另一个应用端中的分布式通信层2003作为通信支撑。在图2中,各个应用端的分布式通信层之间建立连接,且均与该注册中心建立了连接。每个编程框架2002可以包括序列化/反序列化模块和协议适配模块(可选),该一个应用端与该另一个应用端之间通信时使用的通信协议可以由该一个应用端中的或者该注册中心中的协议适配模块来确定。In addition, each application can include service 2001, programming framework 2002, and distributed communication layer 2003. After an application obtains registration information of another application, the programming framework 2002 in that application can control The service 2001 calls the service 2001 in the other server. The calling process is supported by the distributed communication layer 2003 in the one application side and the distributed communication layer 2003 in the other application side. In FIG. 2, a connection is established between the distributed communication layers of each application side, and a connection is established with the registration center. Each programming framework 2002 may include a serialization / deserialization module and a protocol adaptation module (optional). The communication protocol used in the communication between the one application side and the other application side may be determined by the Or the protocol adaptation module in the registry.
以上分布式软件框架可以部署在一个服务器上或者一个分布式的服务器集群上。另外,在以上分布式软件框架中,调用服务的应用端可以称为客户端,提供服务的应用端可以称为服务端,一个应用端可能作为一个服务的客户端也可能作为另一个服务的服务端。例如,应用端202上可以提供服务1,应用端203上可以提供服务2,应用端204上可以提供服务3,假若应用端202可以从应用端203上调用服务2,应用端203可以从应用端204上调用服务3,那么,针对服务2而言,应用端203为服务端,针对服务3而言,应用端203为客户端。The above distributed software framework can be deployed on a server or a distributed server cluster. In addition, in the above distributed software framework, the application that calls the service can be called the client, and the application that provides the service can be called the server. An application can be a client of one service or a service of another service. end. For example, service 1 can be provided on application 202, service 2 can be provided on application 203, service 3 can be provided on application 204, and if application 202 can call service 2 from application 203, application 203 can be provided from application Service 3 is called on 204. Then, for service 2, application 203 is the server, and for service 3, application 203 is the client.
请参见图3,图3是本申请实施例提供的一种远程过程调用协议自适应方法,该方法可以基于图2所示的分布式软件架构来实现,该方法包括但不限于如下步骤:Please refer to FIG. 3. FIG. 3 is a remote procedure call protocol adaptive method provided by an embodiment of the present application. The method may be implemented based on the distributed software architecture shown in FIG. 2. The method includes but is not limited to the following steps:
步骤S300:各个服务端向注册中心注册自身所提供的服务的信息。Step S300: each server registers the service information provided by itself with the registration center.
具体地,假设该各个服务端中包括服务端A,下面以服务端A为例进行说明,该服务端A将自己可提供的服务的名称和/或标识、该服务端A的IP、端口、支持的通信协议等信息注册到该注册中心。各个服务端将可提供的服务在注册中心注册后,注册中心就知道了各个服务端能够提供哪些服务,以及各个客户端的通信地址以及可支持的通信协议,即该注册中心存储了多个服务中每个服务所在的服务端的通信地址和支持的通信协议。在本申请实施例中,两个不同的服务端可能会提供相同的服务;另外,一个服务端可能支持一种或多种通信协议。Specifically, assuming that each server includes server A, the following description uses server A as an example. The server A uses the name and / or identification of the service that it can provide, the IP of the server A, the port, Information such as supported communication protocols is registered with the registration center. After each server registers the available services in the registry, the registry knows which services each server can provide, the communication addresses of each client, and the supported communication protocols, that is, the registry stores multiple services. The communication address of the server where each service is located and the supported communication protocols. In the embodiment of the present application, two different servers may provide the same service; in addition, one server may support one or more communication protocols.
下面结合云原生(Cloud native)场景对服务的特点进行举例说明。如图4所示,该场景示意了基于Java服务开发运行框架的微服务、基于C服务开发运行框架的微服务、基于GO服务开发运行框架的微服务,这些微服务均属于以上描述的服务。在本申请实施例中,可以以接口描述语言(Interface Description language,IDL)为契约定义各个微服务,并提供编译工具根据IDL文件生成对应C或JAVA或GO语言的接口代码。举例来说,定义服务名称为HelloService的服务的实例可以如下:In the following, the characteristics of the service are described in combination with a cloud native scenario. As shown in FIG. 4, this scenario illustrates microservices based on Java service development and operation framework, microservices based on C service development and operation framework, and microservices based on GO service development and operation framework. These microservices belong to the services described above. In the embodiment of the present application, each microservice can be defined in an interface description language (Interface Description Language, IDL) as a contract, and a compiler tool is provided to generate interface code corresponding to the C, JAVA, or GO language according to the IDL file. For example, an instance of a service with a service name of HelloService can be defined as follows:
Figure PCTCN2019089607-appb-000001
Figure PCTCN2019089607-appb-000001
Figure PCTCN2019089607-appb-000002
Figure PCTCN2019089607-appb-000002
执行上述实例之后,该HelloService服务就成了一个基于C服务开发运行框架的微服务。基于相同原理就可以得到基于Java服务开发运行框架的微服务、基于C服务开发运行框架的微服务、基于GO服务开发运行框架的微服务,等等。其中,假若基于C服务开发运行框架的各个微服务间支持基于传输控制协议(Transmission Control Protocol,TCP)传输ProtoBuf序列化的高性能私有协议A;基于JAVA服务开发运行框架的各个微服务间支持基于Netty传输基于ProtoBuf序列化的高性能私有协议B;基于GO服务开发运行框架的各个微服务间支持基于TCP传输私有协议C;以上列出的所有服务间为了互通都支持目标互通协议(例如,HTTP协议),该目标互通协议可以表示为InterWay,那么各种类型的服务的特点归纳如表以所示,各种类型的服务之间通信时可采用的通信协议方案如图5所示,从图5可看出:After executing the above example, the HelloService service becomes a microservice based on the C service development and operation framework. Based on the same principle, microservices based on Java service development and operation framework, microservices based on C service development and operation framework, microservices based on GO service development and operation framework, and so on can be obtained. Among them, if the microservices based on the C service development and operation framework support the transmission of the ProtoBuf serialized high-performance private protocol A based on Transmission Control Protocol (TCP); each microservice based on the JAVA service development and operation framework supports Netty transfers a high-performance private protocol B based on ProtoBuf serialization; each microservice based on the GO service development and operation framework supports a TCP-based private protocol C; all the services listed above support a target interworking protocol (for example, HTTP) Protocol), the target interworking protocol can be expressed as InterWay, then the characteristics of various types of services are summarized as shown in the table, and the communication protocol schemes that can be used for communication between various types of services are shown in Figure 5, from the figure 5 can be seen:
1.基于C语言的服务于基于C语言的服务之间可以使用私有协议A互通。1. C language-based services C-based services can communicate with each other using a private protocol A.
2.基于Java语言的服务于基于Java语言的服务之间可以使用私有协议B互通。2. Java language-based services Java-based services can communicate with each other using a private protocol B.
3.基于GO语言的服务于基于GO语言的服务之间可以使用私有协议C互通。3. GO language-based services. GO language-based services can use the private protocol C to communicate with each other.
4.基于C语言的服务于、基于Java语言的服务、基于GO语言的服务中任两相之间可以使用目标互通协议互通。4. C-based services, Java-based services, and GO-based services can communicate with each other using the target interworking protocol.
表1Table 1
服务名称service name 服务类型Service type 支持的互通协议Supported interworking protocols
微服务1Microservice 1 C语言服务C language service 私有协议A、目标互通协议Private agreement A, target interworking agreement
微服务2Microservice 2 C语言服务C language service 私有协议A、目标互通协议Private agreement A, target interworking agreement
微服务3Microservices 3 C语言服务C language service 私有协议A、目标互通协议Private agreement A, target interworking agreement
微服务4Microservices 4 Java语言服务Java Language Services 私有协议B、目标互通协议Private agreement B, target interworking agreement
微服务5Microservices 5 Java语言服务Java Language Services 私有协议B、目标互通协议Private agreement B, target interworking agreement
微服务6Microservices 6 Java语言服务Java Language Services 私有协议B、目标互通协议Private agreement B, target interworking agreement
微服务7Microservices 7 GO语言服务GO Language Services 私有协议C、目标互通协议Private agreement C, target interworking agreement
微服务8Microservices 8 GO语言服务GO Language Services 私有协议C、目标互通协议Private agreement C, target interworking agreement
微服务9Microservices 9 GO语言服务GO Language Services 私有协议C、目标互通协议Private agreement C, target interworking agreement
以上对各个服务的特点进行了介绍,下面例举服务端A向注册中心注册的实例:The characteristics of each service have been described above. The following is an example of server A registering with the registry:
Figure PCTCN2019089607-appb-000003
Figure PCTCN2019089607-appb-000003
根据以上实例可知,该注册的服务的标识为65537,注册的服务的名称为HelloService。该服务端A可支持私有协议A,当采用私有协议A通信时,该服务端A的通信地址包括IP地址156.103.2.144和端口22225;服务端A还支持目标互通协议,当采用目标互通协议通信时,服务端A的通信地址包括IP地址156.103.2.144和端口22226。According to the above example, the registered service ID is 65537, and the registered service name is HelloService. The server A can support the private protocol A. When the private protocol A is used for communication, the communication address of the server A includes the IP address 156.103.2.144 and port 22225. The server A also supports the target interworking protocol. When using the target interworking protocol for communication At this time, the communication address of server A includes the IP address 156.103.2.144 and port 22226.
步骤S301:客户端向注册中心发送第一请求消息。Step S301: The client sends a first request message to the registration center.
具体地,所述第一请求消息用于请求所述多个服务中的第一服务所在的第一服务端的通信地址和所述第一服务端支持的通信协议。该第一服务为该客户端需要调用的一个服务。Specifically, the first request message is used to request a communication address of a first server where a first service of the multiple services is located and a communication protocol supported by the first server. The first service is a service that the client needs to call.
步骤S302:该注册中心接收客户端发送的第一请求消息。Step S302: The registration center receives a first request message sent by a client.
具体地,该第一请求消息可以包括该第一服务的服务名称和/或标识(ID),这样该注册中心对第一请求消息解析后就可以首先根据该服务名称和/或标识确定该第一服务。然后注册中心根据已经注册到自身的信息中确定能够提供该第一服务的服务端,本申请实施例可以称能够提供该第一服务的服务端为第一服务端。确定出第一服务端之后可以进一步确定该第一服务端的通信地址,例如,IP、端口等信息,还有该第一服务端支持的通信协议。Specifically, the first request message may include a service name and / or identification (ID) of the first service, so that after the registration center parses the first request message, the first request message may be first determined according to the service name and / or identification. One service. Then, the registration center determines the server capable of providing the first service according to the information that has been registered in itself. In the embodiment of the present application, the server capable of providing the first service may be referred to as the first server. After the first server is determined, the communication address of the first server may be further determined, for example, information such as IP and port, and a communication protocol supported by the first server.
例如,第一请求消息中携带的服务名称为HelloService,则HelloService为第一服务,因此该注册中心可以从存储的信息中确定第一请求消息请求的第一服务的标识为"65537",并且可以确定提供第一服务的第一服务端(endpoints)信息为["A://156.103.2.144:22225","Inter://156.103.2.144:22226"],即确定出第一服务支持私有协议A和目标互通协议Inter,当采用私有协议A与第一服务端通信时,第一服务端的IP地址为156.103.2.144,端口为22225;当采用目标互通协议与第一服务端通信时,第一服务端的IP地址为156.103.2.144,端口为22226。For example, if the service name carried in the first request message is HelloService, then HelloService is the first service, so the registration center may determine from the stored information that the identifier of the first service requested by the first request message is "65537", and may Determine the information of the first server (endpoints) that provides the first service as ["A: //156.103.2.144: 22225", "Inter: //156.103.2.144: 22226"], that is, determine that the first service supports the private protocol A and the target interworking protocol Inter. When the private protocol A is used to communicate with the first server, the IP address of the first server is 156.103.2.144 and the port is 22225; when the target interworking protocol is used to communicate with the first server, the first The IP address of the server is 156.103.2.144, and the port is 22226.
步骤S303:该注册中心向所述客户端发送所述第一服务端的通信地址和支持的通信协议。Step S303: The registration center sends the communication address of the first server and the supported communication protocol to the client.
步骤S304:该客户端接收该注册中心发送的该第一服务端的通信地址和支持的通信协议。Step S304: The client receives the communication address of the first server and the supported communication protocol sent by the registration center.
具体地,该客户端可能接收到了一个或者多个第一服务端的通信地址和支持的通信协议,当接收到的是一个第一服务端的通信地址和支持的通信协议时,该客户端针对该一个第一服务端执行步骤S305;当接收到的是多个第一服务端的通信地址和支持的通信协议时, 该客户端仅针对其中一个第一服务端(该一个第一服务端的选择规则此处不作限定)执行步骤S305。Specifically, the client may receive one or more communication addresses of the first server and the supported communication protocols. When the communication address of the first server and the supported communication protocols is received, the client is directed to the one The first server executes step S305; when receiving the communication addresses and supported communication protocols of multiple first servers, the client only targets one of the first servers (the selection rules of the first server are here (No limitation) Step S305 is performed.
步骤S305:所述客户端根据预设的选择策略从所述客户端支持的通信协议和所述第一服务端支持的通信协议中,选择所述客户端和所述第一服务端均支持的第一通信协议。Step S305: The client selects, from the communication protocols supported by the client and the communication protocol supported by the first server, a communication protocol supported by the client and the first server according to a preset selection policy. First communication protocol.
具体地,该客户端知道自身支持的通信协议有哪些,根据该注册中心的反馈也知道第一服务端支持的通信协议,因此该客户端可以首先确定客户端和第一服务端均支持的通信协议,然后根据预设的选择策略从确定出的通信协议中筛选出第一通信协议。可以理解的是,该客户端和第一服务端均支持的通信协议可能不止一个,因此该客户端需要根据选择策略选择一个通信协议来进行通信。其中,该选择策略规定了按照什么规则来选择通信协议,例如,规定选择安全性更高的通信协议;再如,规定选择传输效率最高的通信协议;等等。Specifically, the client knows which communication protocols it supports, and according to the feedback from the registration center, it also knows the communication protocols supported by the first server. Therefore, the client can first determine the communication supported by both the client and the first server. Protocol, and then select a first communication protocol from the determined communication protocols according to a preset selection policy. It can be understood that there may be more than one communication protocol supported by the client and the first server, so the client needs to select a communication protocol for communication according to a selection policy. Among them, the selection policy specifies the rules for selecting a communication protocol, for example, specifying a communication protocol with higher security; for example, specifying a communication protocol with the highest transmission efficiency; and so on.
举例来说,假若客户端支持私有协议A和目标互通协议,第一服务端也支持私有协议A和目标互通协议,那么该客户端和该第一服务端均支持的通信协议包括私有协议A和目标互通协议,此时需要按照选择策略从私有协议A和目标互通协议中选择一个通信协议作为第一通信协议,最终选择出的通信协议为其中哪个具体由该选择策略来决定,例如,若该通信协议规定选择安全级别更高的通信协议,则选择出的通信协议为私有协议A;若该通信协议规定选择兼容性更好(例如,能够支持更多类型的对象通信)的通信协议,则选择出的通信协议为目标互通协议。另外,确定出采用的通信协议后,又可以根据确定的通信协议匹配更详细的地址,例如,若采用的是通信协议A,则可以匹配到第一服务端的通信地址包括:IP地址156.103.2.144和端口22225。若采用的是目标互通协议,则可以匹配到第一服务端的通信地址包括:IP地址156.103.2.144和端口22226。For example, if the client supports the private protocol A and the target interworking protocol, and the first server also supports the private protocol A and the target interworking protocol, then the communication protocols supported by the client and the first server include the private protocol A and the The target interworking protocol. At this time, a communication protocol needs to be selected from the private protocol A and the target interworking protocol as the first communication protocol according to the selection strategy. Which one of the communication protocols is ultimately selected is determined by the selection strategy. For example, if the The communication protocol specifies the selection of a communication protocol with a higher security level, and the selected communication protocol is the private protocol A. If the communication protocol specifies the selection of a communication protocol with better compatibility (for example, capable of supporting more types of object communication), then The selected communication protocol is the target interworking protocol. In addition, after the communication protocol used is determined, a more detailed address can be matched according to the determined communication protocol. For example, if the communication protocol A is used, the communication address that can be matched to the first server includes the IP address 156.103.2.144 And port 22225. If the target interworking protocol is used, the communication addresses that can be matched to the first server include: IP address 156.103.2.144 and port 22226.
可选的,该客户端可以根据需要更新该选择策略,不同的所述选择策略规定的筛选规则不同。可以理解的是,随着时间的改变运行时实际需要的选择可能不同,例如,有时候需要安全性更高的通信协议,有时候需要传输效率更高的通信协议,有时候需要互通性能更强的通信协议。开发者通过改变选择策略即可保证筛选出满足相应特点通信协议。Optionally, the client may update the selection policy as required, and different selection policies provide different filtering rules. It is understandable that the choices actually required during operation may change over time. For example, sometimes a more secure communication protocol is needed, sometimes a communication protocol with higher transmission efficiency is needed, and sometimes a stronger interoperability is required. Communication protocol. By changing the selection strategy, developers can ensure that the communication protocols that meet the corresponding characteristics are screened.
步骤S306:该客户端根据该第一通信协议和该第一服务端的通信地址调用所述第一服务。Step S306: The client invokes the first service according to the first communication protocol and the communication address of the first server.
具体地,该客户端根据该第一服务端的通信地址可以与该第一服务端建立通信连接,建立通信连接之后该客户端即从该第一服务端调用该第一服务。可选的,当客户端与第一服务端基于该第一通信协议建立通信,之后该客户端向该第一服务端发送HelloRequest消息,相应地,该第一服务端接收到该HelloRequest消息之后向该客户端发送HelloReply消息,从而实现该客户端对该第一服务端的调用。下面对HelloRequest消息做简单介绍:假若第一服务为HelloService服务,那么客户端会预先执行如下程序代码:Specifically, the client can establish a communication connection with the first server according to the communication address of the first server. After the communication connection is established, the client calls the first service from the first server. Optionally, when the client establishes communication with the first server based on the first communication protocol, the client sends a HelloRequest message to the first server, and accordingly, the first server sends the HelloRequest message to the first server. The client sends a HelloReply message to implement the client's call to the first server. The following briefly introduces the HelloRequest message: If the first service is the HelloService service, the client will execute the following program code in advance:
Figure PCTCN2019089607-appb-000004
Figure PCTCN2019089607-appb-000004
Figure PCTCN2019089607-appb-000005
Figure PCTCN2019089607-appb-000005
以上代码中,第一行(line 1)用于定义需要调用的服务为HelloService服务,第二行(line 2)用于指定HelloRequest消息来发送用于调用HelloService的请求,第三行(line 3)用于对HelloRequest消息填充所需的相关参数,第四行(line 4)用于采用sayHello方法发送HelloRequest消息。In the above code, the first line (line 1) is used to define the service to be called as the HelloService service, the second line (line 2) is used to specify the HelloRequest message to send the request for calling the HelloService, and the third line (line 3) It is used to fill the required parameters of the HelloRequest message. The fourth line (line 4) is used to send the HelloRequest message using the sayHello method.
下面对第一通信协议做举例说明,例如,当确定第一通信协议为私有协议A,且第一服务端的通信地址为“156.103.2.144:22225”时,客户端尝试与通信地址“156.103.2.144:22225”建立套接子(socket)连接,并根据私有协议A格式对HelloRequest消息中的msg_hello消息进行序列化,进行消息发送。相应地,第一服务端监听地址“156.103.2.144:22225”获取客户端发送的消息,并根据该地址判断使用通信协议“A”,并根据通信协议“A”对消息进行反序列化,然后对第一服务进行调用。The following describes the first communication protocol as an example. For example, when it is determined that the first communication protocol is the private protocol A and the communication address of the first server is "156.103.2.144:22225", the client attempts to communicate with the communication address "156.103. 2.144: 22225 "establishes a socket connection, and serializes the msg_hello message in the HelloRequest message according to the private protocol A format, and sends the message. Correspondingly, the first server listens to the address "156.103.2.144:22225" to obtain the message sent by the client, and judges using the communication protocol "A" according to the address, and deserializes the message according to the communication protocol "A", and Make a call to the first service.
在本申请实施例中,第一服务端的信息发生变更时(例如,支持的通信协议的类型或者版本,通信地址等发生变更),该第一服务端会将变更信息发送给注册中心。该客户端可以向注册中心订阅第一服务端的变更信息,相应地,注册中心在确定第一服务的相关信息发生变更之后,将变更信息发送给客户端,这样客户端就可以及时获知第一服务的最新信息,有利于客户端对第一服务进行调用。其中,第一服务的相关信息包括第一服务所在的第一服务端支持的通信协议的类型或者版本,通信地址,等等。In the embodiment of the present application, when the information of the first server changes (for example, the type or version of the supported communication protocol, the communication address, etc. changes), the first server sends the changed information to the registration center. The client can subscribe to the change information of the first server from the registration center. Correspondingly, after determining that the related information of the first service has changed, the registration center sends the change information to the client, so that the client can know the first service in a timely manner. The latest information is beneficial for the client to call the first service. The related information of the first service includes a type or version of a communication protocol supported by the first server where the first service is located, a communication address, and the like.
在图3所描述的方法中,客户端向注册中心发送第一请求消息,注册中心根据第一请求消息向客户端发送第一服务端的通信地址和支持的通信协议,然后客户端根据预设的选择策略筛选出该客户端和该第一服务端均支持的第一通信协议,之后客户端根据该第一通信协议和该第一服务端的通信地址调用所述第一服务。在这个过程中,该客户端可以根据选择策略自适应地选择合适的通信协议来与第一服务端进行通信,优化了通信协议的选择方案。In the method described in FIG. 3, the client sends a first request message to the registration center, and the registration center sends the communication address of the first server and the supported communication protocol to the client according to the first request message, and then the client according to a preset The selection strategy filters out the first communication protocol supported by the client and the first server, and then the client invokes the first service according to the first communication protocol and the communication address of the first server. In this process, the client can adaptively select an appropriate communication protocol to communicate with the first server according to the selection strategy, and the selection scheme of the communication protocol is optimized.
请参见图6,图6是本申请实施例提供的一种远程过程调用协议自适应方法,该方法可以基于图2所示的分布式软件架构来实现,该方法包括但不限于如下步骤:Please refer to FIG. 6, which is a remote procedure call protocol adaptive method provided by an embodiment of the present application. The method may be implemented based on the distributed software architecture shown in FIG. 2. The method includes, but is not limited to, the following steps:
步骤S600:各个服务端向注册中心注册自身所提供的服务的信息。Step S600: each server registers the service information provided by itself with the registration center.
具体地,步骤S600可以参照步骤S300,此处不再赘述。Specifically, step S600 may refer to step S300, and details are not described herein again.
步骤S601:客户端向注册中心发送第一请求消息。Step S601: The client sends a first request message to the registration center.
具体地,步骤S601可以参照步骤S301,此处不再赘述。Specifically, step S601 may refer to step S301, and details are not described herein again.
步骤S602:该注册中心接收客户端发送的第一请求消息。Step S602: The registration center receives a first request message sent by a client.
具体地,步骤S602可以参照步骤S302,另外,第一请求消息中还携带了该客户端支持的通信协议的信息,例如,携带的形式可以为http://xxx?protocol="A,Interway",根据携带的信息就可以知道该客户端支持私有协议A和目标互通协议Interway。Specifically, step S602 may refer to step S302. In addition, the first request message also carries information about a communication protocol supported by the client. For example, the form may be http: // xxx? protocol = "A, Interway", according to the information carried, it can be known that the client supports the private protocol A and the target interworking protocol Interway.
步骤S603:所述注册中心确定所述第一服务端的通信地址支持的通信协议,并根据预设的选择策略从所述第一服务端支持的通信协议和所述客户端支持的通信协议中,选择所 述第一服务端和所述客户端均支持的第一通信协议。Step S603: the registration center determines a communication protocol supported by the communication address of the first server, and selects from a communication protocol supported by the first server and a communication protocol supported by the client according to a preset selection policy, Selecting a first communication protocol supported by both the first server and the client.
具体地,注册中心根据各个服务端在注册中心注册的信息和第一请求消息中携带的信息,就可以确定客户端支持的通信协议,以及第一服务端支持的通信协议,因此该注册中心可以首先确定客户端和第一服务端均支持的通信协议,然后根据预设的选择策略从确定出的通信协议中筛选出第一通信协议。可以理解的是,该客户端和第一服务端均支持的通信协议可能不止一个,因此该注册中心需要根据选择策略选择一个通信协议来进行通信。其中,该选择策略规定了按照什么规则来选择通信协议,例如,规定选择安全性更高的通信协议;再如,规定选择传输效率最高的通信协议;等等。Specifically, the registration center can determine the communication protocol supported by the client and the communication protocol supported by the first server according to the information registered by each server in the registration center and the information carried in the first request message. Therefore, the registration center can First, the communication protocols supported by the client and the first server are determined, and then the first communication protocol is filtered from the determined communication protocols according to a preset selection policy. It can be understood that there may be more than one communication protocol supported by the client and the first server, so the registration center needs to select a communication protocol for communication according to the selection strategy. Among them, the selection policy specifies the rules for selecting a communication protocol, for example, specifying a communication protocol with higher security; for example, specifying a communication protocol with the highest transmission efficiency; and so on.
举例来说,假若客户端支持私有协议A和目标互通协议,第一服务端也支持私有协议A和目标互通协议,那么该客户端和该第一服务端均支持的通信协议包括私有协议A和目标互通协议,此时需要按照选择策略从私有协议A和目标互通协议中选择一个通信协议作为第一通信协议,最终选择出的通信协议为其中哪个具体由该选择策略来决定,例如,若该通信协议规定选择安全级别更高的通信协议,则选择出的通信协议为私有协议A;若该通信协议规定选择兼容性更好(例如,可以支持更多类型的对象通信)的通信协议,则选择出的通信协议为目标互通协议。另外,确定出采用的通信协议后,又可以根据确定的通信协议匹配更详细的地址,例如,若采用的是通信协议A,则可以匹配到第一服务端的通信地址包括:IP地址156.103.2.144和端口22225。若采用的是目标互通协议,则可以匹配到第一服务端的通信地址包括:IP地址156.103.2.144和端口22226。For example, if the client supports the private protocol A and the target interworking protocol, and the first server also supports the private protocol A and the target interworking protocol, then the communication protocols supported by the client and the first server include the private protocol A and the The target interworking protocol. At this time, a communication protocol needs to be selected from the private protocol A and the target interworking protocol as the first communication protocol according to the selection strategy. Which one of the communication protocols is ultimately selected is determined by the selection strategy. For example, if the The communication protocol specifies the selection of a communication protocol with a higher security level, and the selected communication protocol is the private protocol A. If the communication protocol specifies the selection of a communication protocol with better compatibility (for example, it can support more types of object communication), then The selected communication protocol is the target interworking protocol. In addition, after the communication protocol used is determined, a more detailed address can be matched according to the determined communication protocol. For example, if the communication protocol A is used, the communication address that can be matched to the first server includes the IP address 156.103.2.144 And port 22225. If the target interworking protocol is used, the communication addresses that can be matched to the first server include: IP address 156.103.2.144 and port 22226.
可选的,该注册中心可以根据需要更新该选择策略,不同的所述选择策略规定的筛选规则不同。可以理解的是,随着时间的改变开发人员对通信协议的选择可能有不同想法,例如,有时候需要安全性更高的通信协议,有时候需要传输效率更高的通信协议,有时候需要互通性能更强的通信协议。开发者通过改变选择策略即可保证筛选出满足相应特点通信协议。另外,由于选择策略部署在注册中心上,因此当开发人员想要对选择策略进行变更时,直接在注册中心上进行变更即可保证后续所有服务的调用过程均使用到新的选择策略,维护成本低。Optionally, the registration center may update the selection policy according to needs, and different selection policies provide different filtering rules. It is understandable that developers may have different ideas about the choice of communication protocols over time. For example, sometimes a communication protocol with higher security is required, sometimes a communication protocol with higher transmission efficiency is required, and sometimes interworking is required. A stronger communication protocol. By changing the selection strategy, developers can ensure that the communication protocols that meet the corresponding characteristics are screened. In addition, because the selection strategy is deployed on the registry, when developers want to change the selection strategy, making changes directly on the registry can ensure that all subsequent service invocation processes use the new selection strategy and maintenance costs low.
步骤S604:注册中心向所述客户端发送所述第一通信协议和所述第一服务端的通信地址。Step S604: The registration center sends the first communication protocol and the communication address of the first server to the client.
步骤S605:客户端接收注册中心发送的第一通信协议和所述第一服务端的通信地址。Step S605: The client receives the first communication protocol and the communication address of the first server sent by the registration center.
步骤S606:该客户端根据该第一通信协议和第一服务端的通信地址调用所述第一服务。Step S606: The client invokes the first service according to the first communication protocol and the communication address of the first server.
具体地,步骤S606的可以参照步骤S306,此处不再赘述。Specifically, for step S606, reference may be made to step S306, and details are not described herein again.
在图6所描述的方法中,客户端向注册中心发送第一请求消息,注册中心根据第一请求消息以及各个服务端注册到注册中心的信息确定该客户端和该第一服务端均支持的第一通信协议,然后将第一通信协议和第一服务端的通信地址发送给客户端,之后客户端根据第一通信协议和该第一服务端的通信地址调用所述第一服务。在这个过程中,注册中心可以根据选择策略自适应地选择合适的通信协议供客户端与第一服务端进行通信,优化了通信协议的选择方案。另外,选择策略部署在注册中心上,维护成本低。In the method described in FIG. 6, the client sends a first request message to the registration center, and the registration center determines, based on the first request message and the information registered by each server to the registration center, that both the client and the first server support. The first communication protocol, and then sends the first communication protocol and the communication address of the first server to the client, and then the client invokes the first service according to the first communication protocol and the communication address of the first server. In this process, the registration center can adaptively select an appropriate communication protocol for the client to communicate with the first server according to the selection strategy, and the selection scheme of the communication protocol is optimized. In addition, the selection strategy is deployed on the registry, with low maintenance costs.
上述详细阐述了本申请实施例的方法,下面提供了本申请实施例的装置。The method described in the embodiment of the present application has been described in detail above, and the device in the embodiment of the present application is provided below.
请参见图7,图7是本申请实施例提供的一种客户端70的结构示意图,该客户端可以包括通信单元701和处理单元702。若对应到图2中,该通信单元701用于执行图2中的分布式通信层2003所需执行的操作,该处理单元702用于执行图2中的服务2001和编程框架2002所需执行的操作。该通信单元701和处理单元702的详细描述如下。Please refer to FIG. 7, which is a schematic structural diagram of a client 70 provided by an embodiment of the present application. The client may include a communication unit 701 and a processing unit 702. If corresponding to FIG. 2, the communication unit 701 is configured to perform operations required by the distributed communication layer 2003 in FIG. 2, and the processing unit 702 is configured to perform services required by the service 2001 and the programming framework 2002 in FIG. 2. operating. The detailed description of the communication unit 701 and the processing unit 702 is as follows.
通信单元701用于向注册中心发送第一请求消息,所述注册中心存储了多个服务中每个服务所在的服务端的通信地址和支持的通信协议;所述第一请求消息用于请求所述多个服务中的第一服务所在的第一服务端的通信地址和所述第一服务端支持的通信协议;The communication unit 701 is configured to send a first request message to a registration center, where the registration center stores a communication address of a server where each service is located in a plurality of services and a supported communication protocol; the first request message is used to request the A communication address of a first server where a first service of a plurality of services is located and a communication protocol supported by the first server;
所述通信单元701还用于接收所述注册中心发送的所述第一服务端的通信地址和支持的通信协议;The communication unit 701 is further configured to receive a communication address of the first server and a supported communication protocol sent by the registration center;
处理单元702用于根据预设的选择策略从所述客户端支持的通信协议和所述第一服务端支持的通信协议中,选择所述客户端和所述第一服务端均支持的第一通信协议;The processing unit 702 is configured to select, from a communication protocol supported by the client and a communication protocol supported by the first server, a first protocol supported by the client and the first server according to a preset selection policy. letter of agreement;
所述处理单元701还用于根据所述第一通信协议和所述第一服务端的通信地址调用所述第一服务。The processing unit 701 is further configured to invoke the first service according to the first communication protocol and a communication address of the first server.
在又一种可选的方案中,所述处理单元702还用于更新所述选择策略,不同的所述选择策略规定的筛选规则不同。In yet another optional solution, the processing unit 702 is further configured to update the selection strategy, and different selection rules specified by the selection strategy are different.
在又一种可选的方案中,所述通信单元701还用于,在所述处理单元702根据所述第一通信协议和所述第一服务端的通信地址调用所述第一服务之后,接收所述注册中心发送的所述第一服务端的变更信息,所述变更信息包括通信地址和/或支持的通信协议。In another optional solution, the communication unit 701 is further configured to receive after the processing unit 702 invokes the first service according to the first communication protocol and the communication address of the first server. The change information of the first server sent by the registration center, where the change information includes a communication address and / or a supported communication protocol.
需要说明的是,各个单元的实现还可以对应参照图3所示的方法实施例的相应描述。It should be noted that the implementation of each unit may also correspond to the corresponding description of the method embodiment shown in FIG. 3.
请参见图8,图8是本申请实施例提供的一种客户端80的结构示意图,该客户端可以包括通信单元801和处理单元802。若对应到图2中,该通信单元801用于执行图2中的分布式通信层2003所需执行的操作,该处理单元802用于执行图2中的服务2001和编程框架2002所需执行的操作。该通信单元801和处理单元802的详细描述如下。Please refer to FIG. 8, which is a schematic structural diagram of a client 80 provided by an embodiment of the present application. The client may include a communication unit 801 and a processing unit 802. If corresponding to FIG. 2, the communication unit 801 is configured to perform operations required by the distributed communication layer 2003 in FIG. 2, and the processing unit 802 is configured to perform services required by the service 2001 and the programming framework 2002 in FIG. 2. operating. The detailed description of the communication unit 801 and the processing unit 802 is as follows.
通信单元801用于向注册中心发送第一请求消息,所述注册中心存储了多个服务中每个服务所在的服务端的通信地址和支持的通信协议;所述第一请求消息用于请求所述多个服务中的第一服务所在的第一服务端的通信地址,所述第一请求消息携带所述客户端支持的通信协议;The communication unit 801 is configured to send a first request message to a registration center, where the registration center stores a communication address of a server where each service is located in a plurality of services and a supported communication protocol; the first request message is used to request the A communication address of a first server where a first service of a plurality of services is located, and the first request message carries a communication protocol supported by the client;
所述通信单元801还用于接收所述注册中心发送的第一通信协议和所述第一服务端的通信地址,所述第一通信协议为所述客户端和所述第一服务端均支持的通信协议;The communication unit 801 is further configured to receive a first communication protocol and a communication address of the first server sent by the registration center, where the first communication protocol is supported by both the client and the first server. letter of agreement;
所述处理单元802用于根据所述第一通信协议和所述第一服务端的通信地址调用所述第一服务。The processing unit 802 is configured to call the first service according to the first communication protocol and a communication address of the first server.
在又一种可选的方案中,所述通信单元还用于,在所述处理单元根据所述第一通信协议和所述第一服务端的通信地址调用所述第一服务之后,接收所述注册中心发送的所述第一服务端的变更信息,所述变更信息包括通信地址和/或支持的通信协议。In still another optional solution, the communication unit is further configured to receive the first service after the processing unit invokes the first service according to the first communication protocol and the communication address of the first server. The change information of the first server sent by the registration center, where the change information includes a communication address and / or a supported communication protocol.
在又一种可选的方案中,所述处理单元802还用于更新所述选择策略,不同的所述选择策略规定的筛选规则不同。In yet another optional solution, the processing unit 802 is further configured to update the selection strategy, and different selection rules specified by the selection strategy are different.
在又一种可选的方案中,所述通信单元801还用于,在所述处理单元根据所述第一通信协议和所述第一服务端的通信地址调用所述第一服务之后,接收所述注册中心发送的所 述第一服务端的变更信息,所述变更信息包括通信地址和/或支持的通信协议。In another optional solution, the communication unit 801 is further configured to: after the processing unit invokes the first service according to the first communication protocol and the communication address of the first server, receive The change information of the first server sent by the registration center, where the change information includes a communication address and / or a supported communication protocol.
需要说明的是,各个单元的实现还可以对应参照图6所示的方法实施例的相应描述。It should be noted that the implementation of each unit may also correspond to the corresponding description of the method embodiment shown in FIG. 6.
请参见图9,图9是本申请实施例提供的一种服务器90,该服务器90包括处理器901、存储器902和通信接口903,所述处理器901、存储器902和通信接口903通过总线相互连接。Please refer to FIG. 9, which is a server 90 provided in an embodiment of the present application. The server 90 includes a processor 901, a memory 902, and a communication interface 903. The processor 901, the memory 902, and the communication interface 903 are connected to each other through a bus .
存储器902包括但不限于是随机存储记忆体(random access memory,RAM)、只读存储器(read-only memory,ROM)、可擦除可编程只读存储器(erasable programmable read only memory,EPROM)、或便携式只读存储器(compact disc read-only memory,CD-ROM),该存储器902用于相关指令及数据。The memory 902 includes, but is not limited to, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), or A portable read-only memory (CD-ROM). The memory 902 is used for related instructions and data.
处理器901可以是一个或多个中央处理器(central processing unit,CPU),在处理器901是一个CPU的情况下,该CPU可以是单核CPU,也可以是多核CPU。The processor 901 may be one or more central processing units (CPUs). When the processor 901 is one CPU, the CPU may be a single-core CPU or a multi-core CPU.
处理器901用于读取所述存储器902中存储的指令,来执行图7或图8所示实例中处理单元所执行的操作,通信接口903用于执行图7或图8所示实施例中的通信单元所执行的操作。也即是说,该服务器用于图7或者图8中的客户端。The processor 901 is configured to read instructions stored in the memory 902 to perform operations performed by the processing unit in the example shown in FIG. 7 or FIG. 8, and the communication interface 903 is configured to execute the embodiment shown in FIG. 7 or FIG. 8. Operation performed by the communication unit of the device. That is, the server is used for the client in FIG. 7 or FIG. 8.
请参见图10,图10是本申请实施例提供的一种注册中心100的结构示意图,注册中心可包括通信单元1001和处理单元1002。该通信单元1001和处理单元1002的详细描述如下。Please refer to FIG. 10, which is a schematic structural diagram of a registration center 100 according to an embodiment of the present application. The registration center may include a communication unit 1001 and a processing unit 1002. The detailed description of the communication unit 1001 and the processing unit 1002 is as follows.
通信单元1001用于接收客户端发送的第一请求消息,所述注册中心存储了多个服务中每个服务所在的服务端的通信地址和支持的通信协议;所述第一请求消息用于请求所述多个服务中的第一服务所在的第一服务端的通信地址和所述第一服务端支持的通信协议;The communication unit 1001 is configured to receive a first request message sent by a client. The registration center stores a communication address and a supported communication protocol of a server where each of the multiple services is located. The first request message is used to request all The communication address of the first server where the first service of the plurality of services is located and the communication protocol supported by the first server;
所述通信单元1001还用于向所述客户端发送所述第一服务端的通信地址和支持的通信协议;所述第一服务端支持的通信协议用于确定第一通信协议,所述第一通信协议为所述客户端和所述第一服务端均支持的通信协议;所述第一通信协议和所述第一服务端的通信地址用于所述客户端从所述第一服务端上调用所述第一服务。The communication unit 1001 is further configured to send the communication address of the first server and a supported communication protocol to the client; the communication protocol supported by the first server is used to determine a first communication protocol, and the first The communication protocol is a communication protocol supported by both the client and the first server; the first communication protocol and the communication address of the first server are used by the client to call from the first server The first service.
在又一种可选的方案中,所述通信单元1001接收客户端发送的第一请求消息之前:In another optional solution, before the communication unit 1001 receives the first request message sent by the client:
所述通信单元1001还用于接收所述第一服务端发送的所述第一服务端的通信地址和支持的通信协议;The communication unit 1001 is further configured to receive a communication address of the first server and a supported communication protocol sent by the first server;
所述处理单元1002用于存储所述第一服务端的通信地址和支持的通信协议。The processing unit 1002 is configured to store a communication address of the first server and a supported communication protocol.
在又一种可选的方案中,所述通信单元1001向所述客户端发送所述第一服务端的通信地址和支持的通信协议之后,还用于:In another optional solution, after the communication unit 1001 sends the communication address of the first server and the supported communication protocol to the client, the communication unit 1001 is further configured to:
接收所述第一服务端发送的所述第一服务端的变更信息,所述变更信息包括通信地址和/或支持的通信协议;Receiving the change information of the first server sent by the first server, where the change information includes a communication address and / or a supported communication protocol;
向所述客户端发送所述第一服务端的变更信息。Sending the change information of the first server to the client.
需要说明的是,各个单元的实现还可以对应参照图3所示的方法实施例的相应描述。It should be noted that the implementation of each unit may also correspond to the corresponding description of the method embodiment shown in FIG. 3.
请参见图11,图11是本申请实施例提供的一种注册中心110的结构示意图,注册中心可包括通信单元1101和处理单元1102。该通信单元1101和处理单元1102的详细描述如下。Please refer to FIG. 11, which is a schematic structural diagram of a registration center 110 according to an embodiment of the present application. The registration center may include a communication unit 1101 and a processing unit 1102. The detailed description of the communication unit 1101 and the processing unit 1102 is as follows.
通信单元1101用于接收客户端发送的第一请求消息,所述注册中心存储了多个服务中 每个服务所在的服务端的通信地址和支持的通信协议;所述第一请求消息用于请求所述多个服务中的第一服务所在的第一服务端的通信地址,所述第一请求消息携带所述客户端支持的通信协议;The communication unit 1101 is configured to receive a first request message sent by a client. The registration center stores a communication address and a supported communication protocol of a server where each of the multiple services is located. The first request message is used to request all The communication address of the first server where the first service of the plurality of services is located, and the first request message carries a communication protocol supported by the client;
处理单元1102用于确定所述第一服务端的通信地址支持的通信协议,并根据预设的选择策略从所述第一服务端支持的通信协议和所述客户端支持的通信协议中,选择所述第一服务端和所述客户端均支持的第一通信协议;The processing unit 1102 is configured to determine a communication protocol supported by the communication address of the first server, and select a communication protocol supported by the first server and the communication protocol supported by the client according to a preset selection policy. The first communication protocol supported by the first server and the client;
所述通信单元1101还用于向所述客户端发送所述第一通信协议和所述第一服务端的通信地址,所述第一通信协议和所述第一服务端的通信地址用于所述客户端从所述第一服务端上调用所述第一服务。The communication unit 1101 is further configured to send the first communication protocol and the communication address of the first server to the client, and the first communication protocol and the communication address of the first server are used for the client. The terminal calls the first service from the first server.
在又一种可选的方案中,所述处理单元1102还用于更新所述选择策略,不同的所述选择策略规定的筛选规则不同。In yet another optional solution, the processing unit 1102 is further configured to update the selection policy, and different selection policies provide different filtering rules.
在又一种可选的方案中,所述通信单元1101接收客户端发送的第一请求消息之前:In another optional solution, before the communication unit 1101 receives the first request message sent by the client:
所述通信单元1101还用于接收所述第一服务端发送的所述第一服务端的通信地址和支持的通信协议;The communication unit 1101 is further configured to receive a communication address of the first server and a supported communication protocol sent by the first server;
所述处理单元1102还用于存储所述第一服务端的通信地址和支持的通信协议。The processing unit 1102 is further configured to store a communication address of the first server and a supported communication protocol.
在又一种可选的方案中,所述通信单元1101向所述客户端发送所述第一服务端的通信地址和支持的通信协议之后,还用于:In another optional solution, after the communication unit 1101 sends the communication address of the first server and the supported communication protocol to the client, the communication unit 1101 is further configured to:
接收所述第一服务端发送的所述第一服务端的变更信息,所述变更信息包括通信地址和/或支持的通信协议;Receiving the change information of the first server sent by the first server, where the change information includes a communication address and / or a supported communication protocol;
向所述客户端发送所述第一服务端的变更信息。Sending the change information of the first server to the client.
需要说明的是,各个单元的实现还可以对应参照图6所示的方法实施例的相应描述。It should be noted that the implementation of each unit may also correspond to the corresponding description of the method embodiment shown in FIG. 6.
请参见图12,图12是本申请实施例提供的一种服务器120,该服务器120包括处理器1201、存储器1202和通信接口1203,所述处理器1201、存储器1202和通信接口1203通过总线相互连接。Please refer to FIG. 12, which is a server 120 according to an embodiment of the present application. The server 120 includes a processor 1201, a memory 1202, and a communication interface 1203. The processor 1201, the memory 1202, and the communication interface 1203 are connected to each other through a bus .
存储器1202包括但不限于是随机存储记忆体(random access memory,RAM)、只读存储器(read-only memory,ROM)、可擦除可编程只读存储器(erasable programmable read only memory,EPROM)、或便携式只读存储器(compact disc read-only memory,CD-ROM),该存储器1202用于相关指令及数据。The memory 1202 includes, but is not limited to, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), or A portable read-only memory (CD-ROM). The memory 1202 is used for related instructions and data.
处理器1201可以是一个或多个中央处理器(central processing unit,CPU),在处理器1201是一个CPU的情况下,该CPU可以是单核CPU,也可以是多核CPU。The processor 1201 may be one or more central processing units (CPUs). When the processor 1201 is a CPU, the CPU may be a single-core CPU or a multi-core CPU.
处理器1201用于读取所述存储器1202中存储的指令,来执行图10或图11所示实例中处理单元所执行的操作,通信接口1203用于执行图10或图11所示实施例中的通信单元所执行的操作。也即是说,该服务器用于图10或者图11中的注册中心。The processor 1201 is configured to read instructions stored in the memory 1202 to perform operations performed by the processing unit in the example shown in FIG. 10 or FIG. 11, and the communication interface 1203 is configured to execute the embodiment shown in FIG. 10 or FIG. 11. Operation performed by the communication unit of the device. That is, the server is used for the registration center in FIG. 10 or FIG. 11.
需要说明的是,以上服务器90可以是单个服务器也可以是一个服务器集群,服务器120可以是单个服务器也可以是一个服务器集群还可以是一个服务器集群。另外,服务器90和服务器120可以为两个不同的服务器(或服务器集群),也可以为同一个服务器(或服务器集群)。It should be noted that the above server 90 may be a single server or a server cluster, and the server 120 may be a single server, a server cluster, or a server cluster. In addition, the server 90 and the server 120 may be two different servers (or server clusters), or may be the same server (or server cluster).
综上所述,客户端向注册中心发送第一请求消息,注册中心根据第一请求消息以及各 个服务端注册到注册中心的信息确定该客户端和该第一服务端均支持的第一通信协议,然后将第一通信协议和第一服务端的通信地址发送给客户端,之后客户端根据第一通信协议和该第一服务端的通信地址调用所述第一服务。在这个过程中,注册中心可以根据选择策略自适应地选择合适的通信协议供客户端与第一服务端进行通信,优化了通信协议的选择方案。另外,选择策略部署在注册中心上,维护成本低。In summary, the client sends a first request message to the registration center, and the registration center determines the first communication protocol supported by the client and the first server according to the first request message and the information registered by each server to the registration center. And then sending the first communication protocol and the communication address of the first server to the client, and then the client invokes the first service according to the first communication protocol and the communication address of the first server. In this process, the registration center can adaptively select an appropriate communication protocol for the client to communicate with the first server according to the selection strategy, and the selection scheme of the communication protocol is optimized. In addition, the selection strategy is deployed on the registry, with low maintenance costs.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,该流程可以由计算机程序来指令相关的硬件完成,该程序可存储于计算机可读取存储介质中,该程序在执行时,可包括如上述各方法实施例的流程。而前述的存储介质包括:ROM或随机存储记忆体RAM、磁碟或者光盘等各种可存储程序代码的介质。A person of ordinary skill in the art may understand that all or part of the processes in the method of the foregoing embodiments are implemented. The processes may be completed by a computer program instructing related hardware. The program may be stored in a computer-readable storage medium. When the program is executed, It may include the processes of the method embodiments described above. The foregoing storage media include: ROM or random storage memory RAM, magnetic disks, or optical discs, which can store various program code media.

Claims (26)

  1. 一种远程过程调用协议自适应方法,其特征在于,包括:A remote procedure call protocol adaptive method, which is characterized by:
    客户端向注册中心发送第一请求消息,所述注册中心存储了多个服务中每个服务所在的服务端的通信地址和支持的通信协议;所述第一请求消息用于请求所述多个服务中的第一服务所在的第一服务端的通信地址和所述第一服务端支持的通信协议;The client sends a first request message to the registration center, where the registration center stores the communication address of the server where each of the multiple services is located and the supported communication protocol; the first request message is used to request the multiple services The communication address of the first server where the first service in the server is located and the communication protocol supported by the first server;
    所述客户端接收所述注册中心发送的所述第一服务端的通信地址和支持的通信协议;Receiving, by the client, the communication address of the first server and a supported communication protocol sent by the registration center;
    所述客户端根据预设的选择策略从所述客户端支持的通信协议和所述第一服务端支持的通信协议中,选择所述客户端和所述第一服务端均支持的第一通信协议;The client selects a first communication supported by the client and the first server from a communication protocol supported by the client and a communication protocol supported by the first server according to a preset selection policy. protocol;
    所述客户端根据所述第一通信协议和所述第一服务端的通信地址调用所述第一服务。The client invokes the first service according to the first communication protocol and a communication address of the first server.
  2. 根据权利要求1所述的方法,其特征在于,所述方法包括:The method according to claim 1, wherein the method comprises:
    所述客户端更新所述选择策略,不同的所述选择策略规定的筛选规则不同。The client updates the selection policy, and different selection rules specify different filtering rules.
  3. 根据权利要求1或2所述的方法,其特征在于,所述客户端根据所述第一通信协议和所述第一服务端的通信地址调用所述第一服务之后,还包括:The method according to claim 1 or 2, wherein after the client invokes the first service according to the first communication protocol and a communication address of the first server, the method further comprises:
    所述客户端接收所述注册中心发送的所述第一服务端的变更信息,所述变更信息包括通信地址和/或支持的通信协议。The client receives the change information of the first server sent by the registration center, where the change information includes a communication address and / or a supported communication protocol.
  4. 一种远程过程调用协议自适应方法,其特征在于,包括:A remote procedure call protocol adaptive method, which is characterized by:
    客户端向注册中心发送第一请求消息,所述注册中心存储了多个服务中每个服务所在的服务端的通信地址和支持的通信协议;所述第一请求消息用于请求所述多个服务中的第一服务所在的第一服务端的通信地址,所述第一请求消息携带所述客户端支持的通信协议;The client sends a first request message to the registration center, where the registration center stores the communication address of the server where each of the multiple services is located and the supported communication protocol; the first request message is used to request the multiple services The communication address of the first server where the first service in the server is located, and the first request message carries a communication protocol supported by the client;
    所述客户端接收所述注册中心发送的第一通信协议和所述第一服务端的通信地址,所述第一通信协议为所述客户端和所述第一服务端均支持的通信协议;Receiving, by the client, a first communication protocol and a communication address of the first server sent by the registration center, where the first communication protocol is a communication protocol supported by both the client and the first server;
    所述客户端根据所述第一通信协议和所述第一服务端的通信地址调用所述第一服务。The client invokes the first service according to the first communication protocol and a communication address of the first server.
  5. 根据权利要求4所述的方法,其特征在于,所述客户端根据所述第一通信协议和所述第一服务端的通信地址调用所述第一服务之后,还包括:The method according to claim 4, wherein after the client invokes the first service according to the first communication protocol and a communication address of the first server, the method further comprises:
    所述客户端接收所述注册中心发送的所述第一服务端的变更信息,所述变更信息包括通信地址和/或支持的通信协议。The client receives the change information of the first server sent by the registration center, where the change information includes a communication address and / or a supported communication protocol.
  6. 一种远程过程调用协议自适应方法,其特征在于,包括:A remote procedure call protocol adaptive method, which is characterized by:
    注册中心接收客户端发送的第一请求消息,所述注册中心存储了多个服务中每个服务所在的服务端的通信地址和支持的通信协议;所述第一请求消息用于请求所述多个服务中的第一服务所在的第一服务端的通信地址和所述第一服务端支持的通信协议;The registration center receives a first request message sent by a client, and the registration center stores a communication address and a supported communication protocol of a server where each of the multiple services is located; the first request message is used to request the multiple The communication address of the first server where the first service in the service is located and the communication protocol supported by the first server;
    所述注册中心向所述客户端发送所述第一服务端的通信地址和支持的通信协议;所述第一服务端支持的通信协议用于确定第一通信协议,所述第一通信协议为所述客户端和所 述第一服务端均支持的通信协议;所述第一通信协议和所述第一服务端的通信地址用于所述客户端从所述第一服务端上调用所述第一服务。Sending, by the registration center, the communication address of the first server and a supported communication protocol to the client; the communication protocol supported by the first server is used to determine a first communication protocol, and the first communication protocol is A communication protocol supported by both the client and the first server; the first communication protocol and the communication address of the first server are used by the client to call the first from the first server service.
  7. 根据权利要求6所述的方法,其特征在于,所述注册中心接收客户端发送的第一请求消息之前,还包括:The method according to claim 6, wherein before receiving the first request message sent by the client, the registration center further comprises:
    所述注册中心接收所述第一服务端发送的所述第一服务端的通信地址和支持的通信协议;Receiving, by the registration center, the communication address of the first server and a supported communication protocol sent by the first server;
    所述注册中心存储所述第一服务端的通信地址和支持的通信协议。The registration center stores a communication address of the first server and a supported communication protocol.
  8. 根据权利要求6或7所述的方法,其特征在于,所述注册中心向所述客户端发送所述APEX MOTORSPORTS第一服务端的通信地址和支持的通信协议之后,还包括:The method according to claim 6 or 7, wherein after the registering center sends the communication address of the APEX MOTORSPORTS first server and the supported communication protocol to the client, the method further comprises:
    所述注册中心接收所述第一服务端发送的所述第一服务端的变更信息,所述变更信息包括通信地址和/或支持的通信协议;Receiving, by the registration center, the change information of the first server sent by the first server, where the change information includes a communication address and / or a supported communication protocol;
    所述注册中心向所述客户端发送所述第一服务端的变更信息。Sending, by the registration center, the change information of the first server to the client.
  9. 一种远程过程调用协议自适应方法,其特征在于,包括:A remote procedure call protocol adaptive method, which is characterized by:
    注册中心接收客户端发送的第一请求消息,所述注册中心存储了多个服务中每个服务所在的服务端的通信地址和支持的通信协议;所述第一请求消息用于请求所述多个服务中的第一服务所在的第一服务端的通信地址,所述第一请求消息携带所述客户端支持的通信协议;The registration center receives a first request message sent by a client, and the registration center stores a communication address and a supported communication protocol of a server where each of the multiple services is located; the first request message is used to request the multiple A communication address of a first server where a first service in the service is located, and the first request message carries a communication protocol supported by the client;
    所述注册中心确定所述第一服务端的通信地址支持的通信协议,并根据预设的选择策略从所述第一服务端支持的通信协议和所述客户端支持的通信协议中,选择所述第一服务端和所述客户端均支持的第一通信协议;The registration center determines a communication protocol supported by the communication address of the first server, and selects the communication protocol supported by the first server and the communication protocol supported by the client according to a preset selection policy. A first communication protocol supported by both the first server and the client;
    所述注册中心向所述客户端发送所述第一通信协议和所述第一服务端的通信地址,所述第一通信协议和所述第一服务端的通信地址用于所述客户端从所述第一服务端上调用所述第一服务。The registration center sends the first communication protocol and the communication address of the first server to the client, and the first communication protocol and the communication address of the first server are used by the client The first server invokes the first service.
  10. 根据权利要求9所述的方法,其特征在于,所述方法包括:The method according to claim 9, wherein the method comprises:
    所述注册中心更新所述选择策略,不同的所述选择策略规定的筛选规则不同。The registration center updates the selection policy, and different selection policies specify different filtering rules.
  11. 根据权利要求9或10所述的方法,其特征在于,所述注册中心接收客户端发送的第一请求消息之前,还包括:The method according to claim 9 or 10, wherein before receiving the first request message sent by the client, the registration center further comprises:
    所述注册中心接收所述第一服务端发送的所述第一服务端的通信地址和支持的通信协议;Receiving, by the registration center, the communication address of the first server and a supported communication protocol sent by the first server;
    所述注册中心存储所述第一服务端的通信地址和支持的通信协议。The registration center stores a communication address of the first server and a supported communication protocol.
  12. 根据权利要求9-11任一项所述的方法,其特征在于,所述注册中心向所述客户端发送所述第一服务端的通信地址和支持的通信协议之后,还包括:The method according to any one of claims 9-11, wherein after the registering center sends the communication address of the first server and the supported communication protocol to the client, the method further comprises:
    所述注册中心接收所述第一服务端发送的所述第一服务端的变更信息,所述变更信息包括通信地址和/或支持的通信协议;Receiving, by the registration center, the change information of the first server sent by the first server, where the change information includes a communication address and / or a supported communication protocol;
    所述注册中心向所述客户端发送所述第一服务端的变更信息。Sending, by the registration center, the change information of the first server to the client.
  13. 一种客户端,其特征在于,包括:A client characterized by comprising:
    通信单元,用于向注册中心发送第一请求消息,所述注册中心存储了多个服务中每个服务所在的服务端的通信地址和支持的通信协议;所述第一请求消息用于请求所述多个服务中的第一服务所在的第一服务端的通信地址和所述第一服务端支持的通信协议;A communication unit, configured to send a first request message to a registration center, where the registration center stores a communication address of a server where each service of a plurality of services is located and a supported communication protocol; the first request message is used to request the A communication address of a first server where a first service of a plurality of services is located and a communication protocol supported by the first server;
    所述通信单元,还用于接收所述注册中心发送的所述第一服务端的通信地址和支持的通信协议;The communication unit is further configured to receive a communication address of the first server and a supported communication protocol sent by the registration center;
    处理单元,用于根据预设的选择策略从所述客户端支持的通信协议和所述第一服务端支持的通信协议中,选择所述客户端和所述第一服务端均支持的第一通信协议;A processing unit, configured to select a first protocol supported by the client and the first server from the communication protocols supported by the client and the first server supported according to a preset selection policy letter of agreement;
    所述处理单元,还用于根据所述第一通信协议和所述第一服务端的通信地址调用所述第一服务。The processing unit is further configured to call the first service according to the first communication protocol and a communication address of the first server.
  14. 根据权利要求13所述的客户端,其特征在于:The client according to claim 13, wherein:
    所述处理单元,还用于更新所述选择策略,不同的所述选择策略规定的筛选规则不同。The processing unit is further configured to update the selection strategy, and different selection rules specified by the selection strategy are different.
  15. 根据权利要求13或14所述的客户端,其特征在于,所述通信单元还用于,在所述处理单元根据所述第一通信协议和所述第一服务端的通信地址调用所述第一服务之后,接收所述注册中心发送的所述第一服务端的变更信息,所述变更信息包括通信地址和/或支持的通信协议。The client according to claim 13 or 14, wherein the communication unit is further configured to call the first in the processing unit according to the first communication protocol and a communication address of the first server. After the service, the change information of the first server sent by the registration center is received, and the change information includes a communication address and / or a supported communication protocol.
  16. 一种客户端,其特征在于,包括:A client characterized by comprising:
    通信单元,用于向注册中心发送第一请求消息,所述注册中心存储了多个服务中每个服务所在的服务端的通信地址和支持的通信协议;所述第一请求消息用于请求所述多个服务中的第一服务所在的第一服务端的通信地址,所述第一请求消息携带所述客户端支持的通信协议;A communication unit, configured to send a first request message to a registration center, where the registration center stores a communication address of a server where each service of a plurality of services is located and a supported communication protocol; the first request message is used to request the A communication address of a first server where a first service of a plurality of services is located, and the first request message carries a communication protocol supported by the client;
    所述通信单元,还用于接收所述注册中心发送的第一通信协议和所述第一服务端的通信地址,所述第一通信协议为所述客户端和所述第一服务端均支持的通信协议;The communication unit is further configured to receive a first communication protocol and a communication address of the first server sent by the registration center, where the first communication protocol is supported by both the client and the first server. letter of agreement;
    处理单元,用于根据所述第一通信协议和所述第一服务端的通信地址调用所述第一服务。A processing unit, configured to invoke the first service according to the first communication protocol and a communication address of the first server.
  17. 根据权利要求16所述的客户端,其特征在于,所述通信单元还用于,在所述处理单元根据所述第一通信协议和所述第一服务端的通信地址调用所述第一服务之后,接收所述注册中心发送的所述第一服务端的变更信息,所述变更信息包括通信地址和/或支持的通信协议。The client according to claim 16, wherein the communication unit is further configured to, after the processing unit invokes the first service according to the first communication protocol and a communication address of the first server Receiving the change information of the first server sent by the registration center, where the change information includes a communication address and / or a supported communication protocol.
  18. 一种注册中心,其特征在于,包括:A registration center, comprising:
    通信单元,用于接收客户端发送的第一请求消息,所述注册中心存储了多个服务中每个服务所在的服务端的通信地址和支持的通信协议;所述第一请求消息用于请求所述多个服务中的第一服务所在的第一服务端的通信地址和所述第一服务端支持的通信协议;A communication unit, configured to receive a first request message sent by a client, the registration center stores a communication address of a server where each service of a plurality of services is located and a supported communication protocol; the first request message is used to request The communication address of the first server where the first service of the plurality of services is located and the communication protocol supported by the first server;
    所述通信单元,还用于向所述客户端发送所述第一服务端的通信地址和支持的通信协议;所述第一服务端支持的通信协议用于确定第一通信协议,所述第一通信协议为所述客户端和所述第一服务端均支持的通信协议;所述第一通信协议和所述第一服务端的通信地址用于所述客户端从所述第一服务端上调用所述第一服务。The communication unit is further configured to send the communication address of the first server and a supported communication protocol to the client; the communication protocol supported by the first server is used to determine a first communication protocol, and the first The communication protocol is a communication protocol supported by both the client and the first server; the first communication protocol and the communication address of the first server are used by the client to call from the first server The first service.
  19. 根据权利要求18所述的注册中心,其特征在于,所述通信单元接收客户端发送的第一请求消息之前:The registration center according to claim 18, wherein before the communication unit receives the first request message sent by the client:
    所述通信单元,还用于接收所述第一服务端发送的所述第一服务端的通信地址和支持的通信协议;The communication unit is further configured to receive a communication address of the first server and a supported communication protocol sent by the first server;
    所述处理单元,用于存储所述第一服务端的通信地址和支持的通信协议。The processing unit is configured to store a communication address of the first server and a supported communication protocol.
  20. 根据权利要求18或19所述的注册中心,其特征在于,所述通信单元向所述客户端发送所述第一服务端的通信地址和支持的通信协议之后,还用于:The registration center according to claim 18 or 19, wherein after the communication unit sends the communication address of the first server and the supported communication protocol to the client, the communication unit is further configured to:
    接收所述第一服务端发送的所述第一服务端的变更信息,所述变更信息包括通信地址和/或支持的通信协议;Receiving the change information of the first server sent by the first server, where the change information includes a communication address and / or a supported communication protocol;
    向所述客户端发送所述第一服务端的变更信息。Sending the change information of the first server to the client.
  21. 一种注册中心,其特征在于,包括:A registration center, comprising:
    通信单元,用于接收客户端发送的第一请求消息,所述注册中心存储了多个服务中每个服务所在的服务端的通信地址和支持的通信协议;所述第一请求消息用于请求所述多个服务中的第一服务所在的第一服务端的通信地址,所述第一请求消息携带所述客户端支持的通信协议;A communication unit, configured to receive a first request message sent by a client, the registration center stores a communication address of a server where each service of a plurality of services is located and a supported communication protocol; the first request message is used to request The communication address of the first server where the first service of the plurality of services is located, and the first request message carries a communication protocol supported by the client;
    处理单元,用于确定所述第一服务端的通信地址支持的通信协议,并根据预设的选择策略从所述第一服务端支持的通信协议和所述客户端支持的通信协议中,选择所述第一服务端和所述客户端均支持的第一通信协议;The processing unit is configured to determine a communication protocol supported by the communication address of the first server, and select a communication protocol supported by the first server and the communication protocol supported by the client according to a preset selection policy. The first communication protocol supported by the first server and the client;
    所述通信单元,还用于向所述客户端发送所述第一通信协议和所述第一服务端的通信地址,所述第一通信协议和所述第一服务端的通信地址用于所述客户端从所述第一服务端上调用所述第一服务。The communication unit is further configured to send the first communication protocol and the communication address of the first server to the client, and the first communication protocol and the communication address of the first server are used for the client. The terminal calls the first service from the first server.
  22. 根据权利要求21所述的注册中心,其特征在于:The registration center according to claim 21, wherein:
    所述处理单元,还用于更新所述选择策略,不同的所述选择策略规定的筛选规则不同。The processing unit is further configured to update the selection strategy, and different selection rules specified by the selection strategy are different.
  23. 根据权利要求21或22所述的注册中心,其特征在于,所述通信单元接收客户端发送的第一请求消息之前:The registration center according to claim 21 or 22, wherein before the communication unit receives the first request message sent by the client:
    所述通信单元,还用于接收所述第一服务端发送的所述第一服务端的通信地址和支持的通信协议;The communication unit is further configured to receive a communication address of the first server and a supported communication protocol sent by the first server;
    所述处理单元,还用于存储所述第一服务端的通信地址和支持的通信协议。The processing unit is further configured to store a communication address of the first server and a supported communication protocol.
  24. 根据权利要求21-23任一项所述的注册中心,其特征在于,所述通信单元向所述客户端发送所述第一服务端的通信地址和支持的通信协议之后,还用于:The registration center according to any one of claims 21 to 23, wherein after the communication unit sends the communication address of the first server and the supported communication protocol to the client, the communication unit is further configured to:
    接收所述第一服务端发送的所述第一服务端的变更信息,所述变更信息包括通信地址和/或支持的通信协议;Receiving the change information of the first server sent by the first server, where the change information includes a communication address and / or a supported communication protocol;
    向所述客户端发送所述第一服务端的变更信息。Sending the change information of the first server to the client.
  25. 一种服务器,其特征在于,所述服务器用于运行权利要求13-17任一项所述的客户端。A server, wherein the server is configured to run the client according to any one of claims 13-17.
  26. 一种服务器,其特征在于,所述服务器用于运行权利要求18-24任一项所述的注册中心。A server, characterized in that the server is used to run the registration center according to any one of claims 18-24.
PCT/CN2019/089607 2018-05-31 2019-05-31 Remote procedure call protocol self-adaptation method, related device, and server WO2019228515A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810554879.2A CN110557357B (en) 2018-05-31 2018-05-31 Remote procedure call protocol self-adaption method, related device and server
CN201810554879.2 2018-05-31

Publications (1)

Publication Number Publication Date
WO2019228515A1 true WO2019228515A1 (en) 2019-12-05

Family

ID=68697843

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/089607 WO2019228515A1 (en) 2018-05-31 2019-05-31 Remote procedure call protocol self-adaptation method, related device, and server

Country Status (2)

Country Link
CN (2) CN110557357B (en)
WO (1) WO2019228515A1 (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112769945A (en) * 2021-01-19 2021-05-07 中国工商银行股份有限公司 Distributed service calling method and device
CN112783049A (en) * 2020-12-31 2021-05-11 西安邮电大学 Lamp networking remote control system based on little service
US20210329100A1 (en) * 2020-04-10 2021-10-21 Oracle International Corporation System and method for use of remote procedure call with a microservices environment
CN113742100A (en) * 2021-08-27 2021-12-03 欧电云信息科技(江苏)有限公司 Service calling method, system, equipment and medium based on micro-service architecture
CN113852939A (en) * 2021-07-29 2021-12-28 浪潮软件科技有限公司 Cloud-native-oriented user plane function micro-service system
CN114172946A (en) * 2021-12-06 2022-03-11 京东科技信息技术有限公司 Request result sending method and device, electronic equipment and computer readable medium
CN114697305A (en) * 2020-12-14 2022-07-01 北京神州泰岳软件股份有限公司 Business processing method, device and system based on micro-service architecture
CN113742100B (en) * 2021-08-27 2024-05-31 欧电云信息科技(江苏)有限公司 Service calling method, system, equipment and medium based on micro-service architecture

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111787048B (en) * 2020-04-28 2023-08-04 北京沃东天骏信息技术有限公司 Connection method of terminal equipment, scheduling server and Internet of things system
CN112055091B (en) * 2020-09-11 2022-09-30 华人运通(上海)云计算科技有限公司 Vehicle-mounted micro-service architecture, and communication method and device of vehicle-mounted module
CN113556392B (en) * 2021-07-19 2023-11-14 广州市百果园网络科技有限公司 Communication system, method, apparatus and storage medium
CN114640610B (en) * 2022-02-25 2023-10-20 北京水滴科技集团有限公司 Cloud-protogenesis-based service management method and device and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101005488A (en) * 2006-01-18 2007-07-25 华为技术有限公司 Method and system for consulting and determining use of IP protocol version
CN103117983A (en) * 2011-11-16 2013-05-22 中国移动通信集团公司 Data service request response method and data service protocol stack
CN105141707A (en) * 2014-06-09 2015-12-09 阿里巴巴集团控股有限公司 Address information transmission method and device
CN107295114A (en) * 2016-04-05 2017-10-24 北京京东尚科信息技术有限公司 Distributed Services addressing method and system

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8515020B1 (en) * 2012-09-14 2013-08-20 GreatCall, Inc. Adaptive system with call center and trusted network
CN105357233A (en) * 2014-08-18 2016-02-24 阿里巴巴集团控股有限公司 Remote call method and device
CN106453288B (en) * 2016-09-29 2019-06-04 上海和付信息技术有限公司 A kind of distributed micro services frame system that supporting asynchronous mode and its implementation
CN106506509B (en) * 2016-11-15 2019-11-08 深圳市彬讯科技有限公司 It can carry out the lightweight RPC framework implementation method of service improvement and language call
CN106411933B (en) * 2016-11-15 2019-09-10 深圳市彬讯科技有限公司 A kind of lightweight RPC system for carrying out service and administering with language call

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101005488A (en) * 2006-01-18 2007-07-25 华为技术有限公司 Method and system for consulting and determining use of IP protocol version
CN103117983A (en) * 2011-11-16 2013-05-22 中国移动通信集团公司 Data service request response method and data service protocol stack
CN105141707A (en) * 2014-06-09 2015-12-09 阿里巴巴集团控股有限公司 Address information transmission method and device
CN107295114A (en) * 2016-04-05 2017-10-24 北京京东尚科信息技术有限公司 Distributed Services addressing method and system

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20210329100A1 (en) * 2020-04-10 2021-10-21 Oracle International Corporation System and method for use of remote procedure call with a microservices environment
CN114697305A (en) * 2020-12-14 2022-07-01 北京神州泰岳软件股份有限公司 Business processing method, device and system based on micro-service architecture
CN112783049A (en) * 2020-12-31 2021-05-11 西安邮电大学 Lamp networking remote control system based on little service
CN112769945A (en) * 2021-01-19 2021-05-07 中国工商银行股份有限公司 Distributed service calling method and device
CN112769945B (en) * 2021-01-19 2023-02-03 中国工商银行股份有限公司 Distributed service calling method and device
CN113852939A (en) * 2021-07-29 2021-12-28 浪潮软件科技有限公司 Cloud-native-oriented user plane function micro-service system
CN113852939B (en) * 2021-07-29 2024-04-30 浪潮通信技术有限公司 Cloud-protogenesis-oriented user plane function micro-service system
CN113742100A (en) * 2021-08-27 2021-12-03 欧电云信息科技(江苏)有限公司 Service calling method, system, equipment and medium based on micro-service architecture
CN113742100B (en) * 2021-08-27 2024-05-31 欧电云信息科技(江苏)有限公司 Service calling method, system, equipment and medium based on micro-service architecture
CN114172946A (en) * 2021-12-06 2022-03-11 京东科技信息技术有限公司 Request result sending method and device, electronic equipment and computer readable medium

Also Published As

Publication number Publication date
CN110557357B (en) 2022-07-29
CN110557357A (en) 2019-12-10
CN115426391A (en) 2022-12-02

Similar Documents

Publication Publication Date Title
WO2019228515A1 (en) Remote procedure call protocol self-adaptation method, related device, and server
JP7074774B2 (en) Service discovery method, registration center, and device
CN110191007B (en) Node management method, system and computer readable storage medium
WO2020147466A1 (en) Method for invoking server and proxy server
EP3726811A1 (en) Proxy routing based on path headers
US9246844B2 (en) Method for activating and deactivating client-side services from a remote server
WO2022033121A1 (en) Method and system for resource exposure in kubernetes, and device and medium
US20080270411A1 (en) Distributed behavior controlled execution of modeled applications
US9723069B1 (en) Redistributing a connection
WO2016184175A1 (en) Database processing method and apparatus
JP2020537449A (en) Service registration in communication network
US20210410057A1 (en) Service Discovery Extension in a 5G Mobile Communication Network
CN106210049B (en) Cluster communication method and system based on message queue
US11422865B2 (en) Dynamic workload migration to edge stations
KR20110050569A (en) Method and apparatus regarding use of a service convergence fabric
US7933291B2 (en) Protocol neutral channel-based application communication
CN111212119B (en) Dubbo service calling method and system
US7805733B2 (en) Software implementation of hardware platform interface
CN116896750A (en) Enhanced interconnection between cellular communication networks
CN114338763B (en) Micro-service calling method, micro-service calling device, server and computer readable storage medium
CN107395766A (en) Decentralization communication system and implementation method based on HazelCast
WO2020169175A1 (en) Entities for providing an external service to a network
US8788630B2 (en) System and method for proxy address neutrality
US20230208938A1 (en) Orchestrating execution of a complex computational operation
CN116508350A (en) Network node for providing backup network functions and method therein

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19811025

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19811025

Country of ref document: EP

Kind code of ref document: A1