CN112910943B - Service providing method, device and system - Google Patents

Service providing method, device and system Download PDF

Info

Publication number
CN112910943B
CN112910943B CN202010470158.0A CN202010470158A CN112910943B CN 112910943 B CN112910943 B CN 112910943B CN 202010470158 A CN202010470158 A CN 202010470158A CN 112910943 B CN112910943 B CN 112910943B
Authority
CN
China
Prior art keywords
service
instance
registration
interface group
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010470158.0A
Other languages
Chinese (zh)
Other versions
CN112910943A (en
Inventor
姜宇
孙宏伟
张伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Cloud Computing Technologies Co Ltd
Original Assignee
Huawei Cloud Computing Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Cloud Computing Technologies Co Ltd filed Critical Huawei Cloud Computing Technologies Co Ltd
Priority to PCT/CN2020/122960 priority Critical patent/WO2021109747A1/en
Publication of CN112910943A publication Critical patent/CN112910943A/en
Application granted granted Critical
Publication of CN112910943B publication Critical patent/CN112910943B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/40Support for services or applications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • H04L67/63Routing a service request depending on the request content or context

Abstract

The embodiment of the application provides a service providing method, device and system, which realize the registration of a service interface group, avoid repeated registration of the same service interface group provided by different service providing examples and reduce the registration load of a registration example. The scheme comprises the following steps: the registration instance receives a first registration request sent by a first service providing instance, wherein the first registration request carries first information of a service interface group, and the first information of the service interface group is used for representing the plurality of service interfaces; the registration example determines whether the service interface group is registered according to the first information of the service interface group; in the case that the service interface group is not registered, the registration instance registers the service interface group and the first service providing instance according to the first information of the service interface group.

Description

Service providing method, device and system
The present application claims priority from the chinese patent application filed on 12 months 04 2019, filed with the national intellectual property agency, application number 201911229983.5, entitled "method and system for service registration", the entire contents of which are incorporated herein by reference.
Technical Field
The embodiments of the present application relate to the field of computers, and in particular, to a service providing method, device and system.
Background
With the rapid development of computer technology, service-oriented framework applications are emerging. Service-oriented frameworks have evolved from traditional vertical architectures to the current distributed service frameworks. A distributed service framework may generally contain the following roles: a service provider that provides a service, a service consumer that invokes a service, and a registry.
Currently, the workflow of the distributed service framework is: the service provider registers the service provided by the service provider with the registration center when starting; when the service consumer starts, the service consumer subscribes to the service required by the service consumer, the registry returns a service address list of the service providers which can provide the service required by the service consumer to the service consumer, and the service consumer selects a service provider corresponding to one service address from the service address list to carry out service call. From this flow, the registry is a service framework core module whose performance also affects the availability and stability of the entire service framework.
Currently, even if a plurality of service providers provide the same plurality of services, each service provider needs to register each service provided by itself with a registry. For example, suppose there are 500 service providers that offer the same 100 services, each service provider configuring 100 service interfaces to offer 100 services each. When the 500 service provider instances are started simultaneously, the respective 100 service interfaces are respectively registered with the registry, namely the registry needs to process the registration of 5 ten thousand service interfaces simultaneously.
Disclosure of Invention
The application provides a service providing method and device, which are used for realizing registration by taking a service interface group as granularity to reduce registration load of a registration center.
In order to achieve the above purpose, the embodiments of the present application adopt the following technical solutions:
in a first aspect, a service providing method is provided, applied to a registration instance in a service providing system, where the service providing system includes a registration instance and a plurality of service providing instances, each service providing instance having a same service interface group, and the service interface group includes a plurality of service interfaces. The method may include: the registration instance receives a first registration request sent by a first service providing instance, wherein the first registration request carries first information of a service interface group, and the first information of the service interface group is used for representing a plurality of service interfaces; the registration example determines whether the service interface group is registered according to the first information of the service interface group; in the case that the service interface group is not registered, the registration instance registers the service interface group and the first service providing instance according to the first information of the service interface group.
By the service providing method, when the registration instance receives the registration request sent by the first service providing instance, whether the service interface group of the first service providing instance is registered or not is judged, and the registration is carried out only under the condition that the service interface group is not registered, so that the registration of the service interface group is realized, the repeated registration of the same service interface group provided by different service providing instances is avoided, and the registration load of the registration instance is reduced. In the case of reduced registration load of the registration instance, the registration instance is no longer a bottleneck of the service framework, i.e. the impact of the performance of the registration instance on the availability and stability of the service framework is reduced.
The service interface group provided by the service providing instance may include service interfaces provided by the service providing instance, and the service providing instances providing the same service interfaces have the same service interface group. The first service providing instance is any one of the service providing instances included in the service providing system.
With reference to the first aspect, in another possible implementation manner, the service providing method provided by the application may further include: in the case that the service interface group is unregistered, the registration instance sends a request message to the first service providing instance; the registration instance receives second information of the service interface group sent by the first service providing instance according to the request message. Wherein the second information of the service interface group comprises an interface name and/or an interface version of each service interface. Wherein the request message is used to obtain second information of the service interface group from the first service providing instance. In the case that the service interface group of the first service providing instance is unregistered, the registering instance acquires second information of the service interface group through a request message, so as to register the service interface group.
With reference to the first aspect, in one possible implementation manner, the first information and the second information of the service interface group are the same, and are all interface information of the service interface group. The interface information of the service interface group may include an interface name and/or an interface version of each service interface. And taking the interface information of the service interface group as the first information, and under the condition that the service interface group of the first service providing instance is not registered, the interaction times of the registered instance and the first service providing instance can be reduced, and the system performance is improved.
With reference to the first aspect, in another possible implementation manner, the first information and the second information of the service interface group may be different, and the first information of the service interface group may be a result value obtained by interface information of the service interface group according to a preset algorithm; the second information of the service interface group may be interface information of the service interface group. The first information and the second information of the service interface group are configured to be different information, so that interaction content can be simplified, and resource occupation when the registration instance interacts with the first service providing instance is reduced.
With reference to the first aspect or any one of the foregoing possible implementation manners, in another possible implementation manner, the registering service interface group and the first service providing instance specifically may include: the registration instance establishes a first mapping relation, wherein the first mapping relation comprises the identification of the service interface group and the mapping relation of a plurality of service interfaces contained in the service interface group; the registration instance establishes a second mapping relationship comprising a mapping relationship of the identity of the service interface group and the first service providing instance comprising the service interface group. And the service interface group is associated with the service interfaces contained in the service interface group through a first mapping relation, the service interface group is associated with the related service providing examples through a second mapping relation, and corresponding contents can be acquired through the mapping relation in the subsequent service interface group registration process or service request process, so that the feasibility and convenience of the scheme are improved.
With reference to the first aspect or any one of the foregoing possible implementation manners, in another possible implementation manner, the first information of the service interface group may be a hash value or an association value calculated according to interface information of the service interface group. For example, the hash value or the association value is calculated according to the interface information of the plurality of service interfaces included in the service interface group. One possible implementation of the first information of the service interface group is provided, and feasibility of the scheme is improved.
With reference to the first aspect or any one of the foregoing possible implementation manners, in another possible implementation manner, the first registration request may further include service address information of the first service providing instance. The service providing method provided by the application can further comprise the following steps: the service address information of the first service providing instance is written into the storage device to correspond to the service interface group, and the association between the first service providing instance and the service interface group of the first service providing instance is recorded in the registration instance and is used for inquiring in the subsequent service request process.
With reference to the first aspect or any one of the foregoing possible implementation manners, in another possible implementation manner, the first registration request may further include service address information of the first service providing instance. The service providing method provided by the application can further comprise the following steps: and periodically writing the service address information of the first service providing instance into the storage device to correspond to the service interface group, thereby further reducing the access frequency of the registration instance to the storage device.
With reference to the first aspect or any one of the foregoing possible implementation manners, in another possible implementation manner, the service providing method provided by the application may further include: the registration instance sends the service address information of the registration instance to the configuration center, and the service address information of the registration instance is obtained in real time by the service providing instance, so that the service providing instance can conveniently select the registration instance to initiate registration.
With reference to the first aspect or any one of the foregoing possible implementation manners, in another possible implementation manner, the service may include an interface service.
With reference to the first aspect or any one of the foregoing possible implementation manners, in another possible implementation manner, the service providing method provided by the application may further include: the registration instance sends a registration success message to the first service providing instance.
With reference to the first aspect or any one of the foregoing possible implementation manners, in another possible implementation manner, the registration success message may include an identification of a service interface group that the first service providing instance has, and may be used to maintain a log or perform other operations for the first service providing instance.
In a second aspect, another service providing method is provided, applied to a registration instance in a service providing system, where the service providing system includes a registration instance and a plurality of service providing instances, each service providing instance having a same service interface group, and the service interface group includes a plurality of service interfaces. The method may include: the registration instance receives a first registration request sent by a first service providing instance, wherein the first registration request carries first information of a service interface group, and the first information of the service interface group is used for representing a plurality of service interfaces; the registration example determines whether the service interface group is registered according to the first information of the service interface group; in the case that the service interface group is registered, the registration instance sends a registration success message to the first service providing instance.
By the service providing method, when the registration instance receives the registration request sent by the first service providing instance, whether the service interface group of the first service providing instance is registered or not is judged, registration is not needed under the condition that the service interface group is registered, and a registration success message is directly fed back, so that repeated registration of the same service interface group provided by different service providing instances is avoided, and registration load of the registration instance is reduced. In the case of reduced registration load of the registration instance, the registration instance is no longer a bottleneck of the service framework, i.e. the impact of the performance of the registration instance on the availability and stability of the service framework is reduced.
Wherein the first service providing instance is any one of the service providing instances included in the service providing system.
With reference to the second aspect, in one possible implementation manner, before sending the registration success message, the service providing method provided by the application may further include: the registration instance adds the first service providing instance to the mapping relationship of the set of service interfaces already established. And the service interface group is associated with the related service providing instance through the mapping relation, and corresponding content can be acquired through the mapping relation in the subsequent service interface group registration process or service request process, so that the feasibility and convenience of the scheme are improved.
With reference to the second aspect or any one of the foregoing possible implementation manners, in another possible implementation manner, the first information of the service interface group may be a hash value or an association value calculated according to information of a plurality of service interfaces. For example, the hash value or the association value is calculated according to the interface information of the plurality of service interfaces included in the service interface group.
With reference to the second aspect or any one of the possible implementation manners of the foregoing, in another possible implementation manner, the first registration request may further include service address information of the first service providing instance. The service providing method provided by the application can further comprise the following steps: service address information of the first service providing instance is written into the storage device to correspond to the service interface group.
With reference to the second aspect or any one of the possible implementation manners of the foregoing, in another possible implementation manner, the first registration request may further include service address information of the first service providing instance. The service providing method provided by the application can further comprise the following steps: and periodically writing the service address information of the first service providing instance into the storage device to correspond to the service interface group, thereby further reducing the access frequency of the registration instance to the storage device.
With reference to the second aspect or any one of the foregoing possible implementation manners, in another possible implementation manner, the service providing method provided by the application may further include: the registration instance sends the service address information of the registration instance to the configuration center, and the service address information of the registration instance is obtained in real time by the service providing instance, so that the service providing instance can conveniently select the registration instance to initiate registration.
With reference to the second aspect or any one of the foregoing possible implementations, in another possible implementation, the service referred to herein may include an interface service.
With reference to the second aspect or any one of the possible implementation manners of the foregoing, in another possible implementation manner, the registration success message may include an identification of a service interface group that the first service providing instance has, and may be used to maintain a log or perform other operations for the first service providing instance.
In a third aspect, another service providing method is provided, applied to a first service providing instance in a service providing system, where the service providing system includes a registration instance and a plurality of service providing instances, each service providing instance having a same service interface group, and the service interface group includes a plurality of service interfaces. The method may include: the first service providing instance sends a first registration request to the registration instance, wherein the first registration request carries first information of a service interface group, and the first information of the service interface group is used for representing a plurality of service interfaces contained in the service interface group; the first service providing instance receives a registration success message sent by the registration instance, the registration success message indicating that the first service providing instance has a service interface group and that the first service providing instance has been successfully registered.
By the service providing method provided by the application, the first service providing instance carries the first information representing the plurality of service interfaces provided by the first service providing instance when the registration request is sent, and the registration can be completed. The registration request sent by the service providing examples providing the same service interface carries the same content, so that the registration example can judge whether the service interface group provided by the first service providing example is registered or not, the registration is performed only when the service interface group is not registered, and the registration is not required when the service interface group is registered, thereby avoiding repeated registration of the same service interface group provided by different service providing examples, reducing the writing quantity of the registration example to a storage system and reducing the registration load of the registration example. In the case of reduced registration load of the registration instance, the registration instance is no longer a bottleneck of the service framework, i.e. the impact of the performance of the registration instance on the availability and stability of the service framework is reduced.
With reference to the third aspect, in one possible implementation manner, the service providing method provided by the application may further include: the first service providing instance receives a request message for registering the instance; the first service providing instance sends second information of the service interface group which the first service providing instance has to the registration instance according to the request message, wherein the second information of the service interface group comprises an interface name and/or an interface version of each service interface which the first service providing instance provides.
With reference to the third aspect or any one of the foregoing possible implementation manners, in another possible implementation manner, the first information of the service interface group is a hash value or an association value calculated according to information of a plurality of service interfaces included in the first information. For example, the hash value or the association value is calculated according to the interface information of the plurality of service interfaces included in the service interface group.
With reference to the third aspect or any one of the foregoing possible implementations, in another possible implementation, the service providing system may include a plurality of registration instances; the service providing method provided by the application can further comprise the following steps: the first service providing instance selects a registration instance from the plurality of registration instances to send a first registration request based on information of a service interface group it has and the number of the plurality of registration instances. Different service providing examples select the registration examples based on the same mode, so that the service providing examples with the same service interface group can be ensured to select the same registration example to initiate a registration request as far as possible, and repeated registration of the same service interface group provided by different service providing examples is avoided.
With reference to the third aspect or any one of the foregoing possible implementation manners, in another possible implementation manner, the first service providing instance selects one registration instance from the multiple registration instances to send the first registration request based on information of a service interface group and the number of multiple registration instances, and specifically includes: modulo the number of a plurality of registration examples by the eigenvalues calculated by the information of the service interface group to obtain remainder; and selecting one registration instance from a plurality of registration instances according to the remainder and a preset rule to send a first registration request. Because the service interface groups of the service providing examples with the same service interface group have the same information, the service providing examples can be ensured to select the same registration example as far as possible for service registration.
With reference to the third aspect or any one of the foregoing possible implementation manners, in another possible implementation manner, the preset rule may include: if the registered instance with the sequence number of the remainder is available, selecting the registered instance with the sequence number of the remainder; if the number is not available, the remainder is stepped in sequence until an available registration instance is selected. The remainder may be configured according to actual requirements, which is not limited in this application.
With reference to the third aspect or any one of the foregoing possible implementation manners, in another possible implementation manner, the feature value calculated by information of the service interface group may include: and carrying out hash operation on the information of the service interface group.
With reference to the third aspect or any one of the foregoing possible implementation manners, in another possible implementation manner, the registration success message may be sent when it is determined, for a registration instance that receives the first registration message, that a service interface group that the first service providing instance has is registered.
The service providing method provided in the third aspect and the service providing method provided in the first aspect or the second aspect are descriptions of the same scheme in different angles, and specific implementations thereof may be referred to each other and are not described in detail.
In a fourth aspect, another service providing method is provided, which is applied to a service providing system, where the service providing system includes a registration instance and a plurality of service providing instances, each service providing instance having an identical service interface group, and the service interface group includes a plurality of service interfaces. The method may include:
the first service providing instance sends a first registration request to the registration instance, wherein the first registration request carries first information of a service interface group which is used for representing a plurality of service interfaces; the registration example receives a first registration request sent by a first service providing example, determines whether the service interface group is registered according to first information of the service interface group, and registers the service interface group and the first service providing example according to the first information of the service interface group under the condition that the service interface group is not registered, sends a registration success message to the first service providing example, and the first service providing example receives the registration success message sent by the registration example.
In a fifth aspect, another service providing method is provided, applied to a service providing system, where the service providing system includes a registration instance and a plurality of service providing instances, each service providing instance having an identical service interface group, and the service interface group includes a plurality of service interfaces. The method may include:
The first service providing instance sends a first registration request to the registration instance, wherein the first registration request carries first information of a service interface group which is used for representing a plurality of service interfaces contained in the first information of the service interface group; the registration example receives a first registration request sent by a first service providing example, determines whether the service interface group is registered according to first information of the service interface group, and sends a registration success message to the first service providing example under the condition that the service interface group is registered; the first service providing instance receives a registration success message sent by the registration instance.
The service providing method provided in the fourth aspect or the fifth aspect is described in terms of a system, and specific implementations thereof may be referred to each other, and are not described in detail.
In a sixth aspect, another service providing method is provided, applied to a registration instance in a service providing system, where the service providing system includes a registration instance and a plurality of service consumption instances, each service consumption instance requesting a same consumption interface group, and the consumption interface group includes a plurality of service interfaces. The method may include: the registration instance receives a first service request sent by a first service consumption instance, wherein the first service request carries third information of a consumption interface group, and the third information of the consumption interface group is used for representing a plurality of service interfaces; the registration instance determines whether the consumption interface group is requested according to the third information of the consumption interface group; under the condition that the consumption interface group is not requested, the registration instance acquires service address information of service providing instances of one or more service interface groups meeting the first service consumption instance request from the storage device according to third information of the consumption interface group; the registration instance transmits the acquired service address information of the service providing instance to the first service consumption instance.
By the service providing method, when the registration instance receives the service request sent by the first service consumption instance, whether the consumption interface group requested by the first service consumption instance is requested or not is judged, and the service address information of the service providing instance with the consumption interface group is acquired from the storage system only when the consumption interface group is not requested, so that the condition that different service consumption instances request the same consumption interface group to repeatedly access the storage system to acquire the service address information of the service providing instance with the consumption interface group is avoided, the access amount of the registration instance to the storage system is reduced, and the load of the registration instance is also reduced. In the case of reduced registration load of the registration instance, the registration instance is no longer a bottleneck of the service framework, i.e. the impact of the performance of the registration instance on the availability and stability of the service framework is reduced.
The service consumption instance has a consumption interface group which can contain service interfaces requested by the service consumption instance, and service consumption instances which request the same service interfaces have the same consumption interface group.
The service interfaces in the consumption interface group of the first service consumption instance request may be comprised in one or more service interface groups, e.g. one service interface in the consumption interface group belongs to one service interface group and another service interface in the consumption interface group belongs to another service interface group, which one or more service interface groups comprising the service interfaces in the consumption interface group of the first service consumption instance request will be referred to as one or more service interface groups of the first consumption instance request.
The first service consumption instance is any one of the service consumption instances included in the service providing system.
With reference to the sixth aspect, in one possible implementation manner, the service providing method provided by the application may further include: the registration instance stores the acquired service address information of the service providing instance.
With reference to the sixth aspect, in another possible implementation manner, the service providing method provided by the present application may further include: in the case that the consumption interface group is not requested, the registration instance sends a request message to the first service consumption instance; the registration instance receives fourth information of the consumption interface group sent by the first service consumption instance according to the request message. Wherein the fourth information of the consumption interface group comprises an interface name and/or an interface version of each service interface in the consumption interface group. Wherein the request message is used to obtain fourth information of the consumption interface group from the first service consumption instance. In the case that the consumption interface group of the first service consumption instance is not requested, the registration instance obtains fourth information of the consumption interface group through a request message so as to obtain service address information of the service providing instance of one or more service interface groups meeting the request of the first consumption instance from the storage device.
With reference to the sixth aspect, in one possible implementation manner, the third information and the fourth information of the service interface group are the same, and are all interface information of the consumption interface group. The interface information may include an interface name and/or an interface version of each service interface. And taking the interface information of the consumption interface group as the third information, and under the condition that the consumption interface group of the first service consumption instance is not requested, the interaction times of the registration instance and the first service consumption instance can be reduced, and the system performance is improved.
With reference to the sixth aspect, in another possible implementation manner, the third information and the fourth information of the consumption interface group may be different, and the third information of the consumption interface group may be a result value obtained by interface information of the consumption interface group according to a preset algorithm; the fourth information of the consumption interface group may be interface information of the consumption interface group. The third information and the fourth information of the consumption interface group are configured to be different information, so that the interaction content can be simplified, and the resource occupation when the registration instance interacts with the first service consumption instance is reduced.
With reference to the sixth aspect or any one of the foregoing possible implementation manners, in another possible implementation manner, the third information of the consumption interface group may be a hash value or an association value calculated according to information of a plurality of service interfaces included in the consumption interface group. For example, the hash value or the association value is calculated according to the interface information of the plurality of service interfaces included in the consumption interface group.
With reference to the sixth aspect or any one of the foregoing possible implementation manners, in another possible implementation manner, the service providing method provided by the present application may further include: the registration instance sends the service address information of the registration instance to the configuration center, and the service address information of the registration instance is used for the service consumption instance to acquire in real time, so that the service consumption instance can conveniently select the registration instance to initiate a service request.
With reference to the sixth aspect or any one of the foregoing possible implementation manners, in another possible implementation manner, the service may include an interface service.
With reference to the sixth aspect or any one of the foregoing possible implementation manners, in another possible implementation manner, the service providing method provided by the present application may further include: the registration instance sends the identification of the group of consumption interfaces to the first service consumption instance, which may be used for the first service consumption instance to maintain a log or perform other operations.
In a seventh aspect, another service providing method is provided, applied to a registration instance in a service providing system, where the service providing system includes a registration instance and a plurality of service consumption instances, each service consumption instance requesting a same consumption interface group, and the consumption interface group includes a plurality of service interfaces. The method may include: the registration instance receives a first service request sent by a first service consumption instance, wherein the first service request carries third information of a consumption interface group, and the third information of the consumption interface group is used for representing a plurality of service interfaces; the registration instance determines whether the consumption interface group is requested according to the third information of the consumption interface group; in the event that a consuming interface group has been requested, the registered instance sends service address information for the service providing instance with its requested one or more service interface groups to the first service consuming instance.
According to the service providing method, when the registration instance receives the service request sent by the first service consumption instance, whether the consumption interface group requested by the first service consumption instance is requested is judged, service address information of the service providing instance with the requested one or more service interface groups is not required to be acquired from the storage system under the condition that the consumption interface group is requested, the locally cached service address information of the service providing instance with the requested one or more service interface groups is fed back directly, the condition that different service consumption instances request the same consumption interface group to repeatedly access the storage system to acquire the service address information of the service providing instance with the requested one or more service interface groups is avoided, the access amount of the registration instance to the storage system is reduced, and the load of the registration instance is reduced. In the case of reduced registration load of the registration instance, the registration instance is no longer a bottleneck of the service framework, i.e. the impact of the performance of the registration instance on the availability and stability of the service framework is reduced.
Wherein the first service consumption instance is any one of the service consumption instances included in the service providing system.
With reference to the seventh aspect or any one of the foregoing possible implementation manners, in another possible implementation manner, the third information of the consumption interface group may be a hash value or an association value calculated according to information of a plurality of service interfaces. For example, the hash value or the association value is calculated according to the interface information of the plurality of service interfaces included in the consumption interface group.
With reference to the seventh aspect or any one of the foregoing possible implementation manners, in another possible implementation manner, the service providing method provided by the present application may further include: the registration instance sends the service address information of the registration instance to the configuration center, and the service address information of the registration instance is used for the service consumption instance to acquire in real time, so that the service consumption instance can conveniently select the registration instance to initiate registration.
With reference to the seventh aspect or any one of the foregoing possible implementations, in another possible implementation, the service referred to herein may include an interface service.
In an eighth aspect, another service providing method is provided, applied to a first service consumption instance in a service providing system, where the service providing system includes a registration instance and a plurality of service consumption instances, each service consumption instance requests to have a same consumption interface group, and the consumption interface group includes a plurality of service interfaces. The method may include: the first service consumption instance sends a first service request to the registration instance, wherein the first service request carries third information of a consumption interface group, and the third information of the consumption interface group is used for representing a plurality of service interfaces contained in the consumption interface group; the first service consumption instance receives service address information of a service providing instance with one or more service interface groups requested by the first service consumption instance, which is sent by the registration instance.
By the service providing method provided by the application, the first service consumption instance carries the third information representing the plurality of service interfaces requested by the first service consumption instance when the service request is sent, and the service address information of the service providing instance with one or more service interface groups requested by the first service consumption instance can be obtained. The service request sent by the service consumption instance requesting the same consumption interface group carries the same content, so that the registration instance can firstly judge whether the consumption interface group requested by the first service consumption instance is requested or not, the service address information of the service providing instance with the requested one or more service interface groups is required to be acquired from the storage system only when the consumption interface group requested by the first service consumption instance is not requested, the service address information of the service providing instance with the requested one or more service interface groups is required to be acquired from the local cache when the service request is requested, and repeated access to the storage system by different service consumption instances to acquire the service address information of the service providing instance with the requested one or more service interface groups is avoided, thereby reducing the access quantity of the registration instance to the storage system and the load of the registration instance. In the case of reduced registration load of the registration instance, the registration instance is no longer a bottleneck of the service framework, i.e. the impact of the performance of the registration instance on the availability and stability of the service framework is reduced.
With reference to the eighth aspect, in one possible implementation manner, the service providing method provided by the application may further include: the first service consumption instance receives a request message of a registration instance; the first service consumption instance sends fourth information of a consumption interface group which the first service consumption instance has to the registration instance according to the request message, wherein the fourth information of the consumption interface group comprises an interface name and/or an interface version of each service interface which the first service consumption instance requests.
With reference to the eighth aspect or any one of the foregoing possible implementations, in another possible implementation, the third information of the consumption interface group is a hash value or an association value calculated according to information of a plurality of service interfaces included in the consumption interface group. For example, the hash value or the association value is calculated according to the interface information of the plurality of service interfaces included in the consumption interface group.
With reference to the eighth aspect or any one of the foregoing possible implementation manners, in another possible implementation manner, the service providing system may include a plurality of registration instances; the service providing method provided by the application can further comprise the following steps: the first service consumption instance selects a registration instance from the plurality of registration instances to send the first service request based on information of the consumption interface group it has and the number of the plurality of registration instances.
With reference to the eighth aspect or any one of the foregoing possible implementation manners, in another possible implementation manner, the first service consumption instance selects one registration instance from the multiple registration instances to send the first service request based on information of a consumption interface group and the number of multiple registration instances, and specifically includes: modulo the number of a plurality of registration examples by the eigenvalues calculated by the information of the consumption interface group to obtain remainder; and selecting one registration instance from a plurality of registration instances according to the remainder and a preset rule to send a first service request. Because the information of the consumption interface groups of the service consumption instances with the same consumption interface group is the same, the service request can be ensured to be carried out by selecting the same registration instance as far as possible. Different service consumption examples select registration examples based on the same mode, so that the service consumption examples with the same consumption interface group can be guaranteed to select the same registration example to initiate a service request as far as possible, and the condition that the different service consumption examples request the same consumption interface group and all need to repeatedly access a storage system to acquire service address information of service providing examples with one or more service interface groups requested by the service consumption examples is avoided.
With reference to the eighth aspect or any one of the foregoing possible implementation manners, in another possible implementation manner, the preset rule may include: if the registered instance with the sequence number of the remainder is available, selecting the registered instance with the sequence number of the remainder; if the number is not available, the remainder is stepped in sequence until an available registration instance is selected. The remainder may be configured according to actual requirements, which is not limited in this application.
With reference to the eighth aspect or any one of the foregoing possible implementation manners, in another possible implementation manner, the feature value calculated by using information of the interface group may include: and (5) carrying out hash operation on the information of the consumption interface group.
With reference to the eighth aspect or any one of the foregoing possible implementation manners, in another possible implementation manner, the service address information of the service providing instance of the one or more service interface groups with the first service consumption instance request sent by the registration instance may be sent when it is determined, for the registration instance that receives the first service message, that the consumption interface group with the first service consumption instance has been requested.
The service providing method provided in the eighth aspect and the service providing method provided in the sixth aspect or the seventh aspect are descriptions of the same scheme at different angles, and specific implementations thereof may be referred to each other and are not described in detail.
In a ninth aspect, another service providing method is provided, applied to a service providing system, where the service providing system includes a registration instance and a plurality of service consumption instances, each service consumption instance having an identical consumption interface group, and the consumption interface group includes a plurality of service interfaces. The method may include:
the first service consumption instance sends a first service request to the registration instance, wherein the first service request carries third information of a consumption interface group which is used for representing a plurality of service interfaces; the registration instance receives a first service request sent by a first service consumption instance; the registration instance determines whether the consumption interface group is requested according to the third information of the consumption interface group; in the case that the consumption interface group is not requested, the registration instance obtains service address information of a service providing instance of one or more service interface groups requested by the first service consumption instance from the storage device according to third information of the consumption interface group; the registration instance sends the acquired service address information of the service providing instance to the first service consumption instance; the first service consumption instance receives service address information of a service providing instance sent by the registration instance.
In a tenth aspect, another service providing method is provided, applied to a service providing system, where the service providing system includes a registration instance and a plurality of service consumption instances, each service consumption instance having an identical consumption interface group, and the consumption interface group includes a plurality of service interfaces. The method may include:
the first service consumption instance sends a first service request to the registration instance, wherein the first service request carries third information of a consumption interface group which is used for representing a plurality of service interfaces contained in the first service request; the registration instance receives a first service request sent by a first service consumption instance, determines whether the consumption interface group is requested according to third information of the consumption interface group, and sends service address information of a service providing instance with one or more service interface groups requested by the registration instance to the first service consumption instance under the condition that the consumption interface group is requested; the first service consumption instance receives service address information of a service providing instance with one or more service interface groups requested by the first service consumption instance, which is sent by the registration instance.
The service providing method provided in the ninth aspect or the tenth aspect is described in terms of a system, and specific implementations thereof may be referred to each other and will not be described in detail.
In an eleventh aspect, a registration instance is provided, a service providing system includes the registration instance and a plurality of service providing instances, each service providing instance having a same service interface group, the service interface group comprising a plurality of service interfaces. The registration instance may include:
and the receiving unit is used for receiving a first registration request sent by the first service providing instance, the first registration request carries first information of a service interface group, and the first information of the service interface group is used for representing the plurality of service interfaces.
And the determining unit is used for determining whether the service interface group is registered according to the first information of the service interface group.
And the registration unit is used for registering the service interface group and the first service providing instance according to the first information of the service interface group under the condition that the service interface group is not registered.
With reference to the eleventh aspect, in a possible implementation manner, the registration instance further includes a sending unit, configured to send a request message to the first service providing instance in a case where the service interface group is unregistered. The receiving unit is further configured to receive second information of the service interface group sent by the first service providing instance according to the request message. Wherein the second information of the service interface group comprises an interface name and/or an interface version of each service interface.
With reference to the eleventh aspect or any one of the foregoing possible implementation manners, in another possible implementation manner, the registration unit is specifically configured to: establishing a first mapping relation, wherein the first mapping relation comprises the identification of the service interface group and the mapping relation of a plurality of service interfaces contained in the service interface group; and establishing a second mapping relation, wherein the second mapping relation comprises the mapping relation between the identification of the service interface group and the first service providing instance containing the service interface group.
With reference to the eleventh aspect or any one of the foregoing possible implementation manners, in another possible implementation manner, the first information of the service interface group is a hash value or an association value calculated according to information of a plurality of service interfaces.
The units of the eleventh aspect are specifically described in the same manner as the method of the first aspect, and are not repeated here.
In a twelfth aspect, another registration instance is provided, and a service providing system includes the registration instance and a plurality of service providing instances, each service providing instance having a same service interface group including a plurality of service interfaces. The registration instance may include:
and the receiving unit is used for receiving a first registration request sent by the first service providing instance, wherein the first registration request carries first information of a service interface group, and the first information of the service interface group is used for representing a plurality of service interfaces contained in the service interface group.
And the determining unit is used for determining whether the service interface group is registered according to the first information of the service interface group.
And the sending unit is used for sending a registration success message to the first service providing instance under the condition that the service interface group is registered.
With reference to the twelfth aspect, in a possible implementation manner, the registration instance further includes a processing unit, configured to add the first service providing instance to the mapping relationship of the service interface group that has been established before the sending unit sends the registration success message.
With reference to the twelfth aspect or any one of the foregoing possible implementation manners, in another possible implementation manner, the hash value or the association value is calculated according to the first information of the service interface group by using information of multiple service interfaces.
The units of the twelfth aspect are specifically described in the same manner as the method of the second aspect, and are not repeated here.
In a thirteenth aspect, a first service providing instance is provided, a service providing system comprising a registration instance and a plurality of service providing instances, each service providing instance having a same service interface group comprising a plurality of service interfaces. The first service providing instance is any one of a plurality of service providing instances. The first service providing instance may include:
And the sending unit is used for sending a first registration request to the registration instance, wherein the first registration request carries first information of a service interface group, and the first information of the service interface group is used for representing a plurality of service interfaces contained in the service interface group.
And the receiving unit is used for receiving a registration success message sent by the registration instance, wherein the registration success message indicates that the service interface group and the first service providing instance are successfully registered.
With reference to the thirteenth aspect, in a possible implementation manner, the receiving unit is further configured to receive a request message of a registration instance; the sending unit is further configured to send second information of the service interface group to the registration instance according to the request message. Wherein the second information of the service interface group comprises an interface name and/or an interface version of each service interface.
With reference to the thirteenth aspect or any one of the foregoing possible implementation manners, in another possible implementation manner, the first information of the service interface group is a hash value or an association value calculated according to information of a plurality of service interfaces.
With reference to the thirteenth aspect or any one of the foregoing possible implementation manners, in another possible implementation manner, the service providing system includes a plurality of registration instances; the first service providing instance further comprises a selection unit for: based on the information of the service interface group and the number of the plurality of registration instances, one registration instance is selected from the plurality of registration instances to send the first registration request.
The units of the thirteenth aspect are specifically described with the methods of the third aspect, and are not repeated here.
In a fourteenth aspect, a registration instance is provided, a service providing system comprising the registration instance and a plurality of service consumption instances, each service consumption instance having a same consumption interface group comprising a plurality of service interfaces. The registration instance may include:
the receiving unit is configured to receive a first service request sent by a first service consumption instance, where the first service request carries third information of a consumption interface group, and the third information of the consumption interface group is used to represent a plurality of service interfaces included in the consumption interface group.
And the determining unit is used for determining whether the consumption interface group is requested according to the third information of the consumption interface group.
And the acquisition unit is used for acquiring the service address information of the service providing instance of the one or more service interface groups requested by the first service consumption instance from the storage system according to the third information of the consumption interface groups under the condition that the consumption interface groups are not requested.
With reference to the fourteenth aspect, in one possible implementation manner, the registration instance further includes a storage unit, configured to store the service address information of the acquired service providing instance.
With reference to the fourteenth aspect, in another possible implementation manner, the consumption instance further includes a sending unit, configured to send a request message to the first service consumption instance in a case that the consumption interface group is not requested; the receiving unit is further configured to receive fourth information of the consumption interface group sent by the first service consumption instance according to the request message. Wherein the fourth information of the consumption interface group comprises an interface name and/or an interface version of each service interface in the consumption interface group. Wherein the request message is used to obtain fourth information of the consumption interface group from the first service consumption instance. In the case that the consumption interface group of the first service consumption instance is not requested, the registration instance obtains fourth information of the consumption interface group through a request message so as to obtain service address information of the service providing instance with one or more service interface groups requested by the first service consumption instance from the storage device.
With reference to the fourteenth aspect or any one of the foregoing possible implementation manners, in another possible implementation manner, the third information of the consumption interface group may be a hash value or an association value calculated according to information of a plurality of service interfaces included in the consumption interface group. For example, the hash value or the association value is calculated according to the interface information of the plurality of service interfaces included in the consumption interface group.
With reference to the fourteenth aspect or any one of the foregoing possible implementation manners, in another possible implementation manner, the sending unit is further configured to: and sending the service address information of the registration instance to a configuration center, wherein the service address information is used for the service consumption instance to acquire the service address information of the registration instance in real time, so that the service consumption instance can conveniently select the registration instance to initiate a service request.
With reference to the fourteenth aspect or any one of the foregoing possible implementations, in another possible implementation, the service referred to herein may include an interface service.
With reference to the fourteenth aspect or any one of the foregoing possible implementation manners, in another possible implementation manner, the sending unit is further configured to: the identification of the group of consumption interfaces is sent to the first service consumption instance and may be used for the first service consumption instance to maintain a log or perform other operations.
The units of the fourteenth aspect are specifically described in the same manner as the method of the sixth aspect, and are not repeated here.
In a fifteenth aspect, another registration instance is provided, a service providing system includes the registration instance and a plurality of service consumption instances, each service consumption instance having a same service interface group, the service interface group comprising a plurality of service interfaces. The registration instance may include:
The receiving unit is configured to receive a first service request sent by a first service consumption instance, where the first service request carries first information of a service interface group, and the first information of the service interface group is used to represent a plurality of service interfaces included in the service interface group.
And the determining unit is used for determining whether the service interface group is requested according to the first information of the service interface group.
And a transmitting unit for transmitting service address information of the service providing instance having one or more service interface groups requested by the service consuming instance to the first service consuming instance in case that the service interface group has been requested.
With reference to the fifteenth aspect or any one of the foregoing possible implementation manners, in another possible implementation manner, the third information of the consumption interface group may be a hash value or an association value calculated according to information of the plurality of service interfaces. For example, the hash value or the association value is calculated according to the interface information of the plurality of service interfaces included in the consumption interface group.
With reference to the fifteenth aspect or any one of the foregoing possible implementation manners, in another possible implementation manner, the sending unit is further configured to: and sending the service address information of the registration instance to a configuration center, wherein the service address information is used for the service consumption instance to acquire the service address information of the registration instance in real time, so that the service consumption instance can conveniently select the registration instance to initiate registration.
With reference to the fifteenth aspect or any one of the foregoing possible implementation manners, in another possible implementation manner, the service may include an interface service.
The units of the fifteenth aspect are specifically described in the method of the seventh aspect, and are not described herein.
In a sixteenth aspect, a first service consumption instance is provided, a service providing system comprising a registration instance and a plurality of service consumption instances, each service consumption instance having a same service interface group comprising a plurality of service interfaces. The first service consumption instance is any one of a plurality of service consumption instances. The first service consumption instance may include:
and the sending unit is used for sending a first service request to the registration instance, wherein the first service request carries first information of a service interface group, and the first information of the service interface group is used for representing a plurality of service interfaces contained in the service interface group.
And the receiving unit is used for receiving the service address information of the service providing instance of the one or more service interface groups with the first service consumption instance request sent by the registration instance.
With reference to the sixteenth aspect, in one possible implementation manner, the receiving unit is further configured to: receiving a request message of a registration instance; the transmitting unit is further configured to: and sending fourth information of the consumption interface group which the request message has to the registration instance according to the request message, wherein the fourth information of the consumption interface group comprises the interface name and/or the interface version of each service interface which the request message requests.
With reference to the sixteen aspects or any one of the possible implementations described above, in another possible implementation, the third information of the consumption interface group is a hash value or an associated value calculated according to information of a plurality of service interfaces included in the consumption interface group. For example, the hash value or the association value is calculated according to the interface information of the plurality of service interfaces included in the consumption interface group.
With reference to the sixteenth aspect or any one of the possible implementation manners of the foregoing, in another possible implementation manner, the service providing system may include a plurality of registration instances; the first service consumption instance provided by the application may further comprise a selection unit for selecting one registration instance from the plurality of registration instances to send the first service request based on the information of the consumption interface group it has and the number of the plurality of registration instances.
With reference to the sixteenth aspect or any one of the foregoing possible implementation manners, in another possible implementation manner, the selecting unit is specifically configured to: modulo the number of a plurality of registration examples by the eigenvalues calculated by the information of the consumption interface group to obtain remainder; and selecting one registration instance from a plurality of registration instances according to the remainder and a preset rule to send a first service request. Because the information of the consumption interface groups of the service consumption instances with the same consumption interface group is the same, the service request can be ensured to be carried out by selecting the same registration instance as far as possible. Different service consumption examples select registration examples based on the same mode, so that the service consumption examples with the same consumption interface group can be guaranteed to select the same registration example to initiate a service request as far as possible, and the condition that the different service consumption examples request the same consumption interface group and all need to repeatedly access a storage system to acquire service address information of service providing examples with one or more service interface groups requested by the service consumption examples is avoided.
With reference to the sixteenth aspect or any one of the foregoing possible implementation manners, in another possible implementation manner, the preset rule may include: if the registered instance with the sequence number of the remainder is available, selecting the registered instance with the sequence number of the remainder; if the number is not available, the remainder is stepped in sequence until an available registration instance is selected. The remainder may be configured according to actual requirements, which is not limited in this application.
With reference to the sixteenth aspect or any one of the foregoing possible implementation manners, in another possible implementation manner, the feature value calculated by using information of the interface group may include: and (5) carrying out hash operation on the information of the consumption interface group.
With reference to the sixteenth aspect or any one of the foregoing possible implementation manners, in another possible implementation manner, the service address information of the service providing instance of the one or more service interface groups with the first service consumption instance request sent by the registration instance may be sent when it is determined for the registration instance that receives the first service message that the consumption interface group with the first service consumption instance has been requested.
The units of the sixteenth aspect are specifically described in the method of the eighth aspect, and are not repeated here.
A seventeenth aspect provides another registration instance, where the registration instance may implement the functions of the registration instance in the method examples described in the first aspect or the second aspect or the sixth aspect or the seventh aspect, where the functions may be implemented by hardware, or may be implemented by executing corresponding software by hardware. The hardware or software comprises one or more modules corresponding to the functions. The registration instance may exist in the form of a product of the chip.
With reference to the seventeenth aspect, in a possible implementation manner, the structure of the registration instance includes a processor and a network interface, where the processor is configured to support the registration instance to perform the corresponding functions in the above method. The network interface is used to support communication between the registration instance and other devices. The registration instance may also include a memory for coupling with the processor that holds the program instructions and data necessary for the registration instance.
In an eighteenth aspect, a service providing instance is provided, where the service providing instance may implement the function of the first service providing instance in the method example described in the third aspect, where the function may be implemented by hardware, or may be implemented by executing corresponding software by hardware. The hardware or software comprises one or more modules corresponding to the functions. The service providing instance may exist in the form of a product of a chip.
With reference to the eighteenth aspect, in one possible implementation manner, the service providing instance includes a processor and a memory, where the processor executes instructions stored in the memory, so that the service providing instance implements the corresponding function of the first service providing instance in the above method.
The service providing instance includes a memory for coupling with the processor that holds the program instructions and data necessary for the service providing instance.
In a nineteenth aspect, a service consumption instance is provided, where the service consumption instance may implement the function of the first service consumption instance in the method example described in the eighth aspect, where the function may be implemented by hardware, or may be implemented by executing corresponding software by hardware. The hardware or software comprises one or more modules corresponding to the functions. The service consumption instance may exist in the form of a product of a chip.
With reference to the nineteenth aspect, in a possible implementation manner, the service consumption instance includes a processor and a memory, where the processor executes instructions stored in the memory, so that the service consumption instance implements the corresponding function in the above method.
The service consumption instance includes a memory for coupling with the processor that holds the program instructions and data necessary for the service consumption instance.
In a twentieth aspect, a service providing system is provided that may include a registration instance and a plurality of service providing instances, each service providing instance having a same service interface group comprising a plurality of service interfaces. Wherein:
the first service providing instance is configured to send a first registration request to the registration instance, where the first registration request carries first information of a service interface group, and the first information of the service interface group is used to represent a plurality of service interfaces.
The registration instance is used for receiving a first registration request sent by the first service providing instance, determining whether the service interface group is registered according to the first information of the service interface group, and sending a registration success message to the first service providing instance by the registration instance according to the first information of the service interface group when the service interface group is unregistered.
The first service provides an instance and is further configured to receive a registration success message sent by the registration instance.
In a twenty-first aspect, another service providing system is provided, which may include a registration instance and a plurality of service providing instances, each service providing instance having a same service interface group, the service interface group comprising a plurality of service interfaces. Wherein:
The first service providing instance is configured to send a first registration request to the registration instance, where the first registration request carries first information of a service interface group, and the first information of the service interface group is used to represent a plurality of service interfaces.
The registration instance is used for receiving a first registration request sent by the first service providing instance, determining whether the service interface group is registered according to the first information of the service interface group, and sending a registration success message to the first service providing instance by the registration instance under the condition that the service interface group is registered.
The first service provides an instance and is further configured to receive a registration success message sent by the registration instance.
A twenty-first aspect or a twenty-first aspect provides a service providing system, describing the service providing method provided in the first aspect or the second aspect or the third aspect from a system perspective, where the system includes a registration instance and a function of the service providing instance are consistent with those in the first aspect or the second aspect or the third aspect.
In a twenty-second aspect, there is provided another service providing system comprising a registration instance and a plurality of service consumption instances, each service consumption instance having a same consumption interface group comprising a plurality of service interfaces. Wherein:
The first service consumption instance is used for sending a first service request to the registration instance, wherein the first service request carries third information of a consumption interface group which is used for representing a plurality of service interfaces.
The registration instance is used for receiving a first service request sent by the first service consumption instance; determining whether the consumption interface group is requested according to third information of the consumption interface group; acquiring service address information of service providing examples of one or more service interface groups requested by a first service consumption example from a storage device according to third information of the consumption interface groups under the condition that the consumption interface groups are not requested; and sending the acquired service address information of the service providing instance to the first service consumption instance.
The first service consumption instance is further configured to receive service address information of a service providing instance sent by the registration instance.
In a twenty-third aspect, another service providing system is provided that includes a registration instance and a plurality of service consumption instances, each service consumption instance having a same consumption interface group that includes a plurality of service interfaces. Wherein:
the first service consumption instance is used for sending a first service request to the registration instance, wherein the first service request carries third information of a consumption interface group which is used for representing a plurality of service interfaces contained in the first service request.
The registration instance is used for receiving a first service request sent by the first service consumption instance, determining whether the consumption interface group is requested according to third information of the consumption interface group, and sending service address information of a service providing instance of one or more service interface groups with the first service consumption instance request to the first service consumption instance under the condition that the consumption interface group is requested.
The first service consumption instance is further configured to receive service address information of a service providing instance sent by the registration instance.
A twenty-second aspect or twenty-third aspect provides a service providing system, describing, from a system perspective, the service providing method provided in the sixth aspect or the seventh aspect or the eighth aspect, where the system includes a registration instance and a function of a service consumption instance, which are consistent with those in the sixth aspect or the seventh aspect or the eighth aspect.
In a twenty-fourth aspect, a non-volatile storage medium is provided, the non-volatile storage medium comprising instructions for implementing the registration instance described in any one of the above aspects or any one of the possible implementations, or the first service providing instance described in any one of the above aspects or any one of the possible implementations.
In a twenty-fifth aspect, a computer-readable storage medium is provided, comprising instructions that when run on a computer, cause the computer (in the role of registering an instance or service offering instance or service consuming instance) to perform the service offering method provided by any one of the above aspects or any one of the possible implementations.
In a twenty-sixth aspect, a computer program product is provided comprising instructions which, when run on a computer, cause the computer (in the role of registering an instance or service provision instance or service consumption instance) to perform the service provision method provided by any one of the above aspects or any one of the possible implementations.
In a twenty-seventh aspect, embodiments of the present application provide a chip system, where the chip system includes a processor and/or a memory, for implementing the corresponding functions in the above method. The chip system may be formed of a chip or may include a chip and other discrete devices.
The various possible implementations of any of the foregoing aspects may be combined without contradiction between schemes.
Drawings
FIG. 1 is a schematic diagram of a distributed service framework according to the prior art;
FIG. 2 is a schematic diagram of a service registration process provided in the prior art;
FIG. 3 is a schematic diagram of a service request flow provided in the prior art;
FIG. 4 is a schematic structural diagram of a distributed service framework provided in the present application;
FIG. 5 is a schematic diagram of a computing device provided herein;
fig. 6 is a schematic flow chart of a service providing method according to an embodiment of the present application;
FIG. 7 is a flowchart of another service providing method according to an embodiment of the present disclosure;
fig. 8 is a flow chart of a service providing method according to an embodiment of the present application;
FIG. 9 is a flowchart of another service providing method according to an embodiment of the present disclosure;
fig. 10 is a schematic structural diagram of a registration example provided in an embodiment of the present application;
FIG. 11 is a schematic diagram of another registration example provided in an embodiment of the present application;
fig. 12 is a schematic structural diagram of still another registration example provided in an embodiment of the present application;
FIG. 13 is a schematic diagram of a registration example according to an embodiment of the present disclosure;
fig. 14 is a schematic structural diagram of a service providing example according to an embodiment of the present application;
fig. 15 is a schematic structural diagram of another service providing example provided in the embodiment of the present application;
Fig. 16 is a schematic structural diagram of a service consumption example provided in an embodiment of the present application;
fig. 17 is a schematic structural diagram of another service consumption example provided in an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application. Wherein, in the description of the present application, "/" means that the related objects are in a "or" relationship, unless otherwise specified, for example, a/B may mean a or B; the term "and/or" in this application is merely an association relation describing an association object, and means that three kinds of relations may exist, for example, a and/or B may mean: there are three cases, a alone, a and B together, and B alone, wherein a, B may be singular or plural. Also, in the description of the present application, unless otherwise indicated, "a plurality" means two or more than two. "at least one of" or the like means any combination of these items, including any combination of single item(s) or plural items(s). For example, at least one (one) of a, b, or c may represent: a, b, c, a and b, a and c, b and c, or a, b and c, wherein a, b and c can be single or multiple. In addition, in order to clearly describe the technical solutions of the embodiments of the present application, in the embodiments of the present application, the words "first", "second", and the like may be used to distinguish identical items or similar items having substantially the same function and function, or may also be used to distinguish different items. It will be appreciated by those of skill in the art that the words "first," "second," and the like do not limit the amount and order of execution, and that the words "first," "second," and the like do not necessarily differ.
Before describing the embodiments of the present application, terms referred to herein will be described.
Service refers to a Service-oriented software module running on a network or device. The service has a service interface. The service provider provides a service through a service interface, the service provider registers the service interface of the service at a registry, and when a service consumer requests the service interface from the registry, the registry feeds back the service provider of the service interface to the service consumer so that the service consumer uses the service provided by the service provider through the service interface.
The distributed service framework may refer to the distributed deployment of the service framework according to roles. The distributed service framework is an important technology for building a distributed system, and its core is the invocation of services running on different processes of different hosts. A distributed service framework may generally contain the following roles: a service provider that provides a service, a service consumer that invokes a service, and a registry. Different roles in the distributed service framework may be deployed in different servers or chips or devices, or may be deployed in different servers or chips or devices, which is not limited in this application.
The registry is a role for registering and discovering services, and has basic functions such as registering services, off-line services, discovering services, notifying service changes, and the like. For example, common storage means for the registry may include ZooKeeper, etcd, eureka, consul, nacos, etc. A registry is a role that can be deployed in a server or other device, and the portion of the device that deploys the registry that implements the registry functionality can be referred to as a registry instance, or a registry device, or a registry, or other names, that can be interchanged as equivalent concepts. In this application, the registry may be implemented by a registration instance. The registry may also be referred to as a registration instance.
A service provider refers to a service provider that provides a service. The service provider registers the service it provides with a registry, such as a service interface for registering the service. A service provider is a role that can be deployed in a server or other device, and the portion of the device in which the service provider is deployed that implements the service provider's functionality can be referred to as a service providing instance, or a service providing apparatus, or a service provider server, or a service provider, or other names, as equivalent concepts can be interchanged. In this application, a service provider may be implemented by a service providing instance. The service provider may also be referred to as a service providing instance.
A service consumer refers to a service consumer who invokes a service. The service consumer requests a service at the registry, and obtains the service address of the service provider providing the service requested by the service consumer from the registry to select the service provider providing the service. For example, a service consumer requests a service address of a service provider providing a service interface from a registry through the service interface of the service, and the service consumer selects the service address to select the service provider providing the service. A service consumer is a role that can be deployed in a server or other device, and the portion of the device in which the service consumer is deployed that implements the service consumer's functionality can be referred to as a service consumption instance, or a service consumption device, or a service consumer server, or a service consumer, or other name, as equivalent concepts can be interchanged. In this application, a service consumer may be implemented by a service consumption instance. The service consumer may also be referred to as a service consumption instance.
The service interface refers to an interface providing a service. Optionally, each service interface provides one service. Alternatively, the service providing instance may provide different services through different interfaces. Optionally, multiple interface combinations in the service provider provide the service.
Interface information, which is information describing a service interface, the content of the interface information can be configured according to actual requirements. The interface information may include an interface name and an interface version, and accordingly, the interface information of the plurality of service interfaces includes the interface name and the interface version of each of the plurality of service interfaces. For example, when a service is provided through a service interface, the interface information may include an interface name of the service interface and one or more of the following: the interface group name of the service interface, the interface version number of the service interface, the interface related service governance rule of the service interface, and the like.
The service interface group refers to a plurality of service interfaces provided by the service providing instance. The service providing instance may be referred to as a service interface group to which a service interface provided by the service providing instance belongs. For example, service providing instances that provide the same service may have the same set of service interfaces. Alternatively, the service interface group may have no group concept, i.e., the service interface group is a plurality of service interfaces. Or alternatively, the service interface group may have the concept of a group, i.e. a service interface group is a group into which multiple service interfaces join.
The consumption interface group refers to a plurality of service interfaces for servicing consumption instance requests. For example, service consumption instances requesting the same service may have the same set of consumption interfaces. The plurality of service interfaces included in the consumption interface group may belong to one or more service interface groups, which may be referred to as one or more service interface groups serving the consumption instance request. Alternatively, the group of consuming interfaces may have no notion of a group, i.e. the group of consuming interfaces is a plurality of service interfaces. Or alternatively, the group of consuming interfaces may have the notion of a group, i.e. a group of consuming interfaces is a group to which multiple service interfaces join.
Fig. 1 illustrates the structure of a conventional distributed service framework. As shown in fig. 1, the distributed service framework includes a registration instance, a storage system of the registration instance, a service providing instance (a service providing instance a, a service providing instance B in fig. 1), and a service consuming instance.
In fig. 1, "service providing instance a" and "service providing instance B" refer to a plurality of peer service providing instances, respectively. The various network elements illustrated in fig. 1 may be servers or chips or other forms of products, and are not limited in this application.
In the distributed service framework illustrated in fig. 1, as shown in fig. 2, a service registration procedure of a service providing instance in a registration instance may include:
s201, the service providing instance randomly finds a registration instance to send a registration request when starting.
Wherein the registration request may include interface information of one service interface and a service address of the one service interface. The registration request is used for registering the service corresponding to the service interface and the service address with the registration instance.
S202, the registration example writes the interface information of the service interface and the service address of the service interface into the storage system.
S203, the registration instance sends a registration success message of the service interface to the service providing instance.
The registration success message is used for indicating that the service provided by the service interface completes registration in the registration instance.
For each service provided by each service providing instance, interaction of S201 to S203 with the registered instance is required.
In the distributed service framework illustrated in fig. 1, as shown in fig. 3, a service request flow of a service consumption instance in a registration instance may include:
s301, the service consumption instance randomly finds a registration instance to send a subscription request when being started.
Wherein the subscription request includes interface information of a service interface subscribed by the service consumption instance, and the subscription request is used for subscribing the service required by the registration instance (i.e. the service provided by the service interface).
S302, the registration instance queries a service address list of the service providing instance providing the service interface from a storage system, and the service address list records one or more service providing instances providing the service interface.
S303, the registered instance returns the queried service address list of the service providing instance to the service consumption instance.
S304, the service consumption instance selects a proper service providing instance from the service address list to initiate service call.
For each service requested by each service consumption instance, the interaction of S301 to S304 with the registration instance is required.
In the service registration and service request flow described above, even if a plurality of service providing instances provide the same plurality of services, each service providing instance needs to register each service provided by itself with the registration instance. For example, suppose there are 500 service providing instances that provide the same 100 services, each configuring 100 service interfaces to provide 100 services each. When the 500 service providing examples are started simultaneously, the respective 100 service interfaces are respectively registered with the registration examples, namely the registration examples need to process the registration of 5 ten thousand service interfaces simultaneously.
In addition, whether the registration instance is written into the storage system or inquired from the storage system, the storage system is subjected to a large number of access operations to the storage system, and the storage system can easily become a performance bottleneck of the whole system, so that the usability and stability of the system are affected. For example, assuming that 500 service providing instances provide the same 100 services, writing 5 ten thousand service interfaces that the registered instance needs to register into the storage system may cause that the service cannot be normally registered due to insufficient performance of the storage system, which may affect availability and stability of the whole system.
Based on this, the application provides a service providing method, which can avoid repeated registration of the same service interface group provided by different service providing examples, and can avoid that different service consumption examples request the same consumption interface group to repeatedly access the storage system to acquire service address information of the service providing example with the consumption interface group. In addition, for the service providing instance with the same service interface or the service consuming instance with the same consuming interface group, when the registering instance interacts with the service providing instance, whether the same service interface group is registered or the same consuming interface group is accessed is judged, and only one access is performed to the storage system, so that the access operation to the storage system is reduced, and the availability and the stability of the system are improved.
The service providing method provided by the application can be applied to the distributed service framework shown in fig. 1 or the distributed service framework shown in fig. 4. The distributed service framework illustrated in fig. 4 is based on fig. 1, and a configuration center is provided for storing service addresses of registration instances. The service providing instance or the service consuming instance may obtain a service address list of the registered instance from the configuration center in real time or periodically to select the registered instance.
The distributed service framework illustrated in fig. 1 or 4 is an example and is not intended to limit the size of the distributed service framework.
Embodiments of the present application are specifically described below with reference to the accompanying drawings.
In one aspect, embodiments of the present application provide a computing device (e.g., a server) for performing the service providing method provided herein, where the computing device may be deployed in a registration instance or a service providing instance or a service consumption instance in the distributed service framework shown in fig. 1 or fig. 4. Fig. 5 illustrates a computing device 50 associated with various embodiments of the present application. As shown in fig. 5, computing device 50 may include a processor 501, a memory 502, and a network interface 503.
The various constituent elements of computing device 50 are described in detail below in conjunction with FIG. 5:
wherein the memory 502 may be a volatile memory (RAM), such as a random-access memory (RAM); or a nonvolatile memory (non-volatile memory), such as a read-only memory (ROM), a flash memory (flash memory), a hard disk (HDD) or a Solid State Drive (SSD); or a combination of the above, for storing program code, configuration files, or other content that may be used to implement the methods of the present application.
Processor 501 is the control center of computing device 50. For example, processor 501 may be a central processing unit (central processing unit, CPU), may be an integrated circuit (application specific integrated circuit, ASIC), or may be one or more integrated circuits configured to implement embodiments of the present application, such as: one or more microprocessors (digital singnal processor, DSPs), or one or more field programmable gate arrays (field programmable gate array, FPGAs).
The network interface 503 is used to communicate with other devices. The network interface 503 may be a communication port or otherwise.
In a possible implementation, when the computing device 50 is a registered instance, the processor 501 performs the following functions by running or executing software programs and/or modules stored in the memory 502, and invoking data stored in the memory 502:
receiving, by the network interface 503, a first registration request sent by the first service providing instance, where the first registration request carries first information of a service interface group, where the first information of the service interface group is used to represent a plurality of service interfaces; determining whether the service interface group is registered according to the first information of the service interface group; in the case that the service interface group is not registered, the service interface group and the first service providing instance are registered according to the first information of the service interface group.
In another possible implementation, when computing device 50 is a registered instance, processor 501 performs the following functions by running or executing software programs and/or modules stored in memory 502, and invoking data stored in memory 502:
receiving, by the network interface 503, a first registration request sent by the first service providing instance, where the first registration request carries first information of a service interface group, where the first information of the service interface group is used to represent a plurality of service interfaces; determining whether the service interface group is registered according to the first information of the service interface group; in case the service interface group is registered, a registration success message is sent to the first service providing instance through the network interface 503.
In another possible implementation, when computing device 50 provides an instance for a service, processor 501 performs the following functions by running or executing software programs and/or modules stored in memory 502, and invoking data stored in memory 502:
sending a first registration request to a registration instance through the network interface 503, the first registration request carrying first information of a service interface group, the first information of the service interface group being used to represent a plurality of service interfaces included in the service interface group; a registration success message sent by the registration instance is received, the registration success message indicating that the first service providing instance has a service interface group and that the first service providing instance has been successfully registered.
In yet another possible implementation, when computing device 50 is a registered instance, processor 501 performs the following functions by running or executing software programs and/or modules stored in memory 502, and invoking data stored in memory 502:
receiving, through the network interface 503, a first service request sent by a first service consumption instance, where the first service request carries third information of a consumption interface group, where the third information of the consumption interface group is used to represent a plurality of service interfaces; determining whether the consumption interface group is requested according to third information of the consumption interface group; acquiring service address information of a service providing instance corresponding to the consumption interface group from the storage device according to third information of the service interface group under the condition that the consumption interface group is not requested; the service address information of the acquired service providing instance is sent to the first service consumption instance via the network interface 503.
In yet another possible implementation, when computing device 50 is a registered instance, processor 501 performs the following functions by running or executing software programs and/or modules stored in memory 502, and invoking data stored in memory 502:
receiving, through the network interface 503, a first service request sent by a first service consumption instance, where the first service request carries third information of a consumption interface group, where the third information of the consumption interface group is used to represent a plurality of service interfaces; determining whether the consumption interface group is requested according to third information of the consumption interface group; in case the consumption interface group has been requested, service address information of the service providing instance with the consumption interface group is sent to the first service consumption instance via the network interface 503.
In yet another possible implementation, when computing device 50 is a service consumption instance, processor 501 performs the following functions by running or executing software programs and/or modules stored in memory 502, and invoking data stored in memory 502:
sending a first service request to the registration instance through the network interface 503, the first service request carrying third information of a consumption interface group, the third information of the consumption interface group being used to represent a plurality of service interfaces included in the consumption interface group; service address information of the service providing instance having the consumption interface group, which is transmitted by the registration instance, is received through the network interface 503.
On the other hand, the embodiment of the application provides a service providing method, which is applied to a service providing system comprising a registration instance and a plurality of service providing instances. Each service providing instance in the service providing system has the same service interface group comprising a plurality of service interfaces. The service providing system may be part of a distributed service framework as illustrated in fig. 1 or fig. 4.
In the service providing system, the interaction process between the registration instance and each service providing instance is the same, and in the following embodiments of the present application, the interaction process between the registration instance and the first service providing instance is only taken as an example, and the method provided in the present application is described and will not be described in detail. The first service providing instance provides an instance for any one of the service providing systems.
As shown in fig. 6, the method may include:
s601, first information of a service interface group is generated by a first service providing instance.
The first information of the service interface group is used for representing a plurality of service interfaces contained in the service interface group. The first information of the service interface group is provided to a registration instance for the registration instance to determine whether the service interface group of the first service providing instance is registered. It should be appreciated that registering a service interface group may be registering a service interface contained by the service interface group.
Alternatively, the content of the first information of the service interface group may be determined according to actual requirements, which is not limited in the present application. The first information of the service providing instance generated service interface group having the same service interface group is the same.
In one possible implementation, the first information of the service interface group may include interface information of the service interface group.
In another possible implementation manner, the first information of the service interface group may include a feature value or an associated value calculated based on the interface information of the service interface group, and an algorithm used for calculation may be a hash calculation or other algorithm, which is not limited in this application. For example, hash operation is performed based on the interface information of the service interface group, and a hash value is calculated.
S602, the first service providing instance sends a first registration request to the registration instance.
Wherein the first registration request includes first information of the service interface group. The first registration request is used for requesting the registration instance to register the service interface group of the first service providing instance and the first service providing instance.
In a possible implementation manner, the first registration request may further include service address information of the first service providing instance, where the service address information is used to indicate a list or manifest of service addresses of services provided by the first service providing instance.
In a possible implementation, when the service providing system includes only one registration instance, a first registration request may be sent to the registration instance in S602.
In another possible implementation, when the service providing system includes only a plurality of registration instances, the first service providing instance needs to select one of the registration instances to send the first registration request in S602.
Illustratively, the process of selecting one registration instance by the first service providing instance in S602 may include the following steps a and B.
And step A, the first service providing instance acquires service address lists of a plurality of registered instances.
Wherein the service address list may include service address information of a plurality of registered instances. The service address information of a registration instance is used to indicate the address of the registration instance, according to which the first service providing instance can interact with the registration instance.
The service address information of the registration instance included in the service address list may be configured according to actual requirements, which is not limited in the present application. For example, the service address list may include service address information of all registered instances to which the first service providing instance may be connected. Alternatively, the service address list may include service address information of available registered instances to which the first service providing instance is connectable.
In a possible implementation, in step a, the first service providing instance may read the service address list from the configuration center in real time or periodically. The configuration center records service address information of the registered instance.
In another possible implementation, in step a, the first service providing instance may receive the list of service addresses issued by the configuration center in real time or periodically.
In yet another possible implementation, in step a, the first service providing instance may obtain the static list of service addresses configured inside it.
An example of an application scenario, a service providing instance may perform the operations of step a after a power-on initialization.
And B, selecting a registration instance by the first service providing instance.
Optionally, the manner of selecting the registration instance in step B may be configured according to actual requirements, so as to achieve that the registration instances selected by the service providing instances having the same service interface group are as identical as possible.
In a possible implementation manner, the first service providing instance in the step B may select the registration instance according to a random algorithm.
In another possible implementation manner, the first service providing instance in step B may select the registration instance according to the first information of the service interface group generated in S601.
For example, the first service providing instance in step B may select the registration instance according to the first information of the service interface group generated in S601, which may be specifically implemented as follows: the first service providing instance may modulo the number of registered instances (i.e., the number of service address information in the service address list) by a eigenvalue (i.e., a eigenvalue calculated based on the first information of the service interface group) to obtain a remainder; and then selecting a registration instance according to the remainder and the preset rule.
The preset rule may include: if the registered instance with the serial number of the remainder is available, selecting the registered instance with the serial number of the remainder; if the registered instance with the sequence number of the remainder is not available, sequentially stepping the remainder until the available instance is selected. The step value during specific step may be configured according to actual requirements, which is not limited in the embodiments of the present application.
For example, the preset rule may include: if the registered instance with the serial number of the remainder is available, selecting the registered instance with the serial number of the remainder; if the registration instance with the sequence number of the remainder is not available, the remainder is added by 1 step by step until the available registration instance is selected.
In the process of selecting the registration examples, if the serial number after a certain step is larger than the total number of the registration examples, the registration examples are selected again from the beginning.
For example, the first service providing instance in step B may select the registration instance according to the first information of the service interface group generated in S601, which may be specifically implemented as follows: the first service providing instance may perform a preset operation on the feature value (for example, the first information) calculated by the interface information of the service interface group, and then select the registration instance according to a preset rule according to the operation result. The preset operation may be a mathematical operation of a preset expression or other, which is not limited in the embodiments of the present application.
S603, the registration instance receives a first registration request sent by the first service providing instance.
The first registration request received by the registration instance in S603, that is, the first registration request sent by the first service providing instance in S602, is not described herein.
S604, the registration instance determines whether the service interface group is registered according to the first information of the service interface group.
Specifically, one implementation example of S604 is: the registration instance determines whether the first information of the service interface group hits the cache.
In a possible implementation manner, the registration instance may assign an Identifier (ID) to the registered service interface group, and store the ID in a cache corresponding to the first information of the service interface group, and the determining, by the registration instance in S604, whether the service interface group is registered according to the first information of the service interface group may include: the registration instance determines whether an ID of a service interface group corresponding to the first information exists. If the ID of the service interface group corresponding to the first information exists, the service interface group is determined to be registered, otherwise, the service interface group is not registered.
In another possible implementation manner, the registration instance may assign a first indication to the registered service interface group, where the first indication corresponds to first information of the service interface group, where the first indication is used to indicate that the corresponding service interface group is registered, and the determining, in S604, whether the service interface group is registered according to the first information of the service interface group by the registration instance may include: the registration instance determines whether there is a first indication corresponding to the first information. If a first indication corresponding to the first information exists, determining that the service interface group is registered, otherwise, not registering.
Optionally, the present application may further configure a marking manner of the registered service interface group by the registration instance according to an actual requirement, and in S604, the method may be judged according to the marking, which is not described in detail herein.
Alternatively, if the registration instance determines in S604 that the service interface group possessed by the first service providing instance is registered, S605 and S606 are performed.
When the service interface group is registered, the service address information of the first service providing instance is added to the service address list of the service interface group.
S605, the registration instance sends a registration success message to the first service providing instance.
The registration success message is used for indicating that the service interface group of the first service providing instance completes registration.
Optionally, the registration success message may include an ID of a service interface group that the first service providing instance has.
S606, the first service providing instance receives the registration success message sent by the registration instance.
The registration success message in S606 may be a registration success message sent by the registration instance in S605.
By the service providing method, when the registration instance receives the registration request sent by the first service providing instance, whether the service interface group of the first service providing instance is registered or not is judged, registration is not needed under the condition that the service interface group is registered, registration success information is directly fed back, repeated registration of the same service interface group provided by different service providing instances is avoided, and registration load of the registration instance is reduced. The method also avoids the increase of the writing quantity of the storage system caused by the fact that all the registration requests initiated by the service providing examples of the same service interface group are registered, thereby reducing the writing quantity of the registration examples to the storage system and the registration load of the registration examples. In the case of reduced registration load of the registration instance, the registration instance is no longer a bottleneck of the service framework, i.e. the impact of the performance of the registration instance on the availability and stability of the service framework is reduced.
In another possible implementation manner, if the registration instance determines in S604 that the service interface group of the first service providing instance is unregistered, that is, the first service providing instance is the service providing instance that the first request registers for the service interface group, as shown in fig. 7, the service providing method provided in the present application may further include S607.
S607, the registration instance registers the service interface group and the first service providing instance according to the first information of the service interface group.
In S607, the registration instance may first obtain the second information of the service interface group according to the first information of the service interface group, and then register the service interface group and the first service providing instance according to the second information of the service interface group.
The second information of the service interface group may be interface information of the service interface group. For example, the second information of the service interface group may include an interface name and/or an interface version of each service interface of the service interface group.
In one possible implementation manner, the first information and the second information of the service interface group may be the same, and are both interface information of the service interface group. In S607, the first information in the first registration request is obtained, and the service interface group and the first service providing instance are registered.
In another possible implementation, the first information and the second information of the service interface group may be different. The first information of the service interface group may be a result value obtained according to a preset algorithm based on the interface information of the service interface group. The second information of the service interface group may be interface information.
Accordingly, S607 may be specifically implemented as: in the case that the service interface group is unregistered, the registration instance sends a request message to the first service providing instance; the registration instance receives second information of the service interface group sent by the first service providing instance according to the request message. Wherein the second information of the service interface group comprises an interface name and/or an interface version of each service interface. Wherein the request message is used to obtain second information of the service interface group from the first service providing instance.
In a possible implementation manner, registering the service interface group and the first service providing instance in S607 may specifically include: the registration instance establishes a first mapping relation, wherein the first mapping relation comprises the identification of the service interface group and the mapping relation of a plurality of service interfaces contained in the service interface group; the registration instance establishes a second mapping relationship comprising a mapping relationship of the identity of the service interface group and the first service providing instance comprising the service interface group. And the service interface group is associated with the service interfaces contained in the service interface group through a first mapping relation, the service interface group is associated with the related service providing examples through a second mapping relation, and corresponding contents can be acquired through the mapping relation in the subsequent service interface group registration process or service request process, so that the feasibility and convenience of the scheme are improved.
In another possible implementation, the registration instance in S607 may write the first mapping relationship and the second mapping relationship to the storage device. The write operation may be performed in real time or periodically.
For example, in S607, the registration instance may periodically establish the second mapping relationship, or periodically write the second mapping relationship to the storage system, so as to further reduce the access frequency of the registration instance to the storage device, which is not limited in the embodiment of the present application.
Illustratively, the registration instance in S607 may insert the interface information into the service interface group table. The registration instance may store the interface information of each service interface included in the interface information of the service interface group into the service interface group table, respectively, and add the service address information of the first service providing instance into the service address list of the service interface group maintained in the memory.
Wherein the service address list of the service interface group includes service address information of a service providing instance having the service interface group. The service address information of a service providing instance is used for indicating the address of the service providing instance for providing the service, and other devices can interact with the service providing instance in a communication way through the address and call the service provided by the service providing instance through a service interface.
In one possible implementation, the registration instance in S607 may also generate an ID for the service interface group. For example, the registration instance may generate the ID of the service interface group according to a random algorithm or a numerical progressive manner, and store the ID of the service interface group and the first information of the service interface group in a cache in correspondence, so as to determine whether the service interface group is registered in S604 when other service providing instances interact with the registration instance.
In a possible implementation manner, in S607, the registration instance may further correspond the first information of the service interface group to the first indication, and determine whether the service interface group is registered in S604 when other service providing instances interact with the registration instance.
After S607, S605 and S606 may be performed, and the registration flow has been completed.
In a possible implementation manner, the service providing method provided by the embodiment of the application may further include: the registration instance sends the service address information of the registration instance to the configuration center, so that the configuration information records the latest service address information of the registration instance.
Specifically, when the registration instance is started, the service address information of the registration instance can be written into a configuration item of the configuration center, and the configuration item maintains an address list of the registration instance.
It should be noted that, the steps included in the service providing method provided in the embodiment of the present application may be configured in an execution sequence according to actual needs, which is not limited in this application, and only one possible execution sequence between steps is illustrated in fig. 6 or fig. 7, which is not limited in particular.
For example, assuming that one service providing instance configures 100 service interfaces, and 500 service providing instances provide the same service, the 500 service providing instances have the same service interface group including the 100 service interfaces. The 500 service providing examples are respectively registered with the registration examples for 100 service interfaces when being started, and according to the prior art, a server for registering the examples needs to perform 5 ten thousand writing operations on a storage system, and the service providing method provided by the application can reduce the 5 ten thousand writing operations into the following operations:
operation 1: an insert operation inserts 1 data (recording interface information of the service interface group) into the service interface group table into the storage system.
Operation 2: an interface insert inserts 100 data (record interface information of 100 service interfaces of the service interface group) into the interface table, and each service interface corresponds to an identifier of the service interface group.
Operation 3: several batch insert operations insert 500 rows of data (recording 500 service providing instances that provide the same service interface group) into a list of service addresses, each service address being associated with an ID of the service interface group. Specifically, the batch is divided into several batches, and depending on the batch insertion period and the starting time difference of each copy, assuming that 500 copies are started continuously in 1 second, the batch insertion period is 100 milliseconds, about 10 batch insets are completed.
According to the embodiment, the scheme of the application greatly reduces the registration interaction between the service providing instance and the registration instance, avoids repeated registration of the same service interface group provided by different service providing instances, greatly reduces the writing operation of the registration instance, improves the processing capacity of the registration instance to service registration by more than 100 times, and eliminates the performance bottleneck. In addition, for the service providing examples with the same service interface group, the same registration example can be selected to initiate registration, and when the first information of the service interface group is a hash value or an association value, the interface information of the service providing example does not need to be sent, so that the network flow is greatly reduced.
In yet another aspect, an embodiment of the present application provides a service providing method, which is applied to a service providing system including a registration instance and a plurality of service consumption instances. Each service consumption instance in the service providing system has the same consumption interface group, and the consumption interface group comprises a plurality of service interfaces. The service providing system may be part of a distributed service framework as illustrated in fig. 1 or fig. 4.
In the service providing system, the interaction process between the registration instance and each service consumption instance is the same, and in the embodiments described below, the interaction process between the registration instance and the first service consumption instance is only taken as an example, and the method provided in the present application is described and will not be described in detail. The first service providing instance provides an instance for any one of the service providing systems.
As shown in fig. 8, the method may include:
s801, the first service consumption instance generates third information of a consumption interface group.
The manner in which the first service consumption instance generates the third information of the consumption interface group it has in S801 may refer to the manner in which the first service providing instance generates the first information of the service interface group it has in S601.
S802, the first service consumption instance sends a first service request to the registration instance.
Wherein the first service request includes third information of a consumption interface group possessed by the first service consumption instance. The first service request is used for requesting a consumption interface group of the first service consumption instance, namely, requesting a service interface contained in the consumption interface group of the first service consumption instance.
In one possible implementation, when the service providing system includes only one registration instance, a first service request may be sent to the registration instance in S802.
In another possible implementation, when the service providing system includes only a plurality of registration instances, the first service consumption instance in S802 needs to select one registration instance to send the first service request.
The manner in which the first service consumption instance selects the registration instance in S802 may refer to the manner in which the first service providing instance selects the registration instance in S602, which is not described herein.
S803, the registration instance receives a first service request sent by the first service consumption instance.
The first service request received by the instance is registered in S803, i.e. the first service request sent by the first service consumption instance in S802.
S804, the registration instance determines whether the consumption interface group is requested according to the third information of the consumption interface group.
One implementation example of S804: the registration instance determines whether third information of the consuming interface group hits the cache.
In a possible implementation manner, the registering instance caches service address information of service providing instances (i.e. service providing instances providing service interfaces in the consumption interface group) of the consumption interface groups for the requested one or more consumption interface groups, and corresponds the consumption interface group to the third information of the consumption interface group or the identification of the consumption interface group, and the registering instance determines whether the consumption interface group is requested according to the third information of the consumption interface group in S804 may include: the registration instance determines whether service address information of a service providing instance having the consumption interface group corresponding to the third information of the consumption interface group is cached. If the service address information of the service providing instance with the consumption interface group corresponding to the third information of the consumption interface group exists, the consumption interface group is determined to be requested, otherwise, the consumption interface group is not requested.
In another possible implementation manner, the registering instance not only caches service address information of service providing instances with the consumption interface groups for the requested consumption interface groups, and corresponds the consumption interface groups to third information of the consumption interface groups or IDs of the consumption interface groups, but also assigns a second indication corresponding to the third information of the consumption interface groups, where the second indication is used to indicate that the consumption interface groups have been requested, and the determining, by the registering instance, whether the consumption interface groups are requested according to the third information of the consumption interface groups in S804 may include: the registration instance determines whether a second indication of third information for the group of consumer interfaces exists. If there is a second indication corresponding to the third information of the consumption interface group, it is determined that the consumption interface group requested by the first service request has been requested, otherwise it is not requested.
Optionally, the method of marking the requested consumption interface group by the registration instance may be configured according to the actual requirement, and in S804, the method may be judged according to the marking, which is not described in detail herein.
Alternatively, if the registration instance determines in S804 that the consumption interface group requested by the first service consumption instance has been requested, S805 is directly performed.
S805, the registration instance sends service address information of the service providing instance having the one or more service interface groups requested by the registration instance to the first service consumption instance.
The registration instance caches service address information of a service providing instance having a service interface group corresponding to the requested consumption interface group. In the case that the registration instance determines that the consumption interface group requested by the first service consumption instance has been requested, the registration instance in S805 obtains, from the cache, one or more service interface groups corresponding to the consumption interface group (i.e., one or more service interface groups requested by the first service consumption instance), obtains service address information of a service providing instance having the one or more service interface groups, and sends the service address information to the first service consumption instance.
S806, the first service consumption instance receives service address information of the service providing instance with the one or more service interface groups requested by the first service consumption instance sent by the registration instance.
In a possible implementation manner, the service address information of the service providing instance received in S806 is sent when it is determined for the registered instance that the consumption interface group requested by the first service consumption instance has been requested.
By the service providing method, when the registration instance receives the service request sent by the first service consumption instance, whether the consumption interface group requested by the first service consumption instance is requested is judged, service address information of the service providing instance with the requested one or more service interface groups is not required to be acquired from the storage system under the condition that the consumption interface group is requested, the locally cached service address information of the service providing instance with the requested one or more service interface groups is directly fed back, and the problem that the access amount of the storage system is increased due to the fact that service requests initiated by the service consumption instance requesting the same consumption interface group access the storage system is avoided, so that the access amount of the registration instance to the storage system is reduced, and the registration load of the registration instance is reduced. In the case of reduced registration load of the registration instance, the registration instance is no longer a bottleneck of the service framework, i.e. the impact of the performance of the registration instance on the availability and stability of the service framework is reduced.
Optionally, if the registration instance determines in S804 that the consumption interface group requested by the first service consumption instance is not requested, i.e. the first service consumption instance requests the consumption interface group at the registration instance, the registration instance needs to read service address information of the service providing instance having one or more service interface groups requested by the first service consumption instance from the storage system. Accordingly, as shown in fig. 9, the service providing method provided in the present application may further include S807.
S807, the registration instance obtains service address information of the service providing instance of the one or more service interface groups requested by the first service consumption instance from the storage device according to the third information of the consumption interface groups.
In S807, the registration instance may obtain the fourth information of the consumption interface group according to the third information of the consumption interface group, and then obtain the service address information of the service providing instance of each service interface group (including the service interface groups of the plurality of service interfaces indicated by the fourth information) requested by the first service consumption instance from the storage device according to the fourth information of the consumption interface group.
The fourth information of the consumption interface group obtained by the registration instance in S807 may refer to the manner of obtaining the second information of the service interface group by the registration instance in S607, which is not described herein.
Specifically, through the interaction of service registration between the service providing instance and the registration instance, service address information of the service providing instance can be recorded in the storage system through a mapping relation and corresponds to the service interface group identifier. The registration instance in S807 determines, according to the third information of the consumption interface group in the first service request, an identifier of each service interface group having any one of the service interfaces of the consumption interface group, and then reads, from the storage system, service address information of a service providing instance corresponding to the identifier of each service interface group, that is, service address information of a service providing instance of one or more service interface groups having the first service consumption instance request.
The registration instance in S807 implements a read operation to the storage system. The operation of S805 described above omits the operation of S807, and reduces the access amount to the storage system.
After S807, S805 and S806 may be performed to enable sending the service address information of the service providing instance having the one or more interface groups requested thereof to the first service consumption instance.
After S807, as shown in fig. 9, the method provided herein may further include S808 and S809.
S808, the registration instance caches the corresponding relation between the third information of the consumption interface group and the consumption interface group identification.
S809, the registered instance caches the service address information of the service providing instance of the service interface group with the first service consuming instance request.
Through the operations of S808 and S809, a determination is made in S804 as to whether the consumption interface group has been requested when other service consumption instances interact with the registered instance.
Further optionally, in executing S808 and S809, the registration instance may further correspond the third information of the consumption interface group to the second indication, and make a determination in S804 as to whether the consumption interface group has been requested when other service consumption instances interact with the registration instance.
Further optionally, the service providing method provided by the embodiment of the present application may further include: the registration instance sends the service address information of the registration instance to the configuration center, so that the configuration center records the latest service address information of the registration instance.
Specifically, when the registration instance is started, the service address information of the registration instance can be written into a configuration item of the configuration center, and the configuration item maintains an address list of the registration instance.
In the embodiment of the application, the service providing instance, the service consuming instance and the registration instance can be associated through the identification of the service interface group or the consumption interface group. For example, the following main information can be viewed by the identity of the service interface group: which services are provided by the service interface group, which service providing instances are provided by the service interface group, which service consuming instances are being consumed by the service interface group.
The above description describes the solution provided in the embodiments of the present application mainly from the point of view of the working principle of the interaction procedure between the registration instance and the service providing instance. It will be appreciated that the above-described registration instance, service provision instance, service consumption instance comprise corresponding hardware structures and/or software modules for performing the respective functions in order to achieve the above-described functions. Those of skill in the art will readily appreciate that the elements and algorithm steps of the examples described in connection with the embodiments disclosed herein may be implemented as hardware or combinations of hardware and computer software. Whether a function is implemented as hardware or computer software driven hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The embodiment of the application can divide the functional modules of the registration instance, the service providing instance and the service consumption instance according to the method example, for example, each functional module can be divided corresponding to each function, or two or more functions can be integrated in one processing module. The integrated modules may be implemented in hardware or in software functional modules. The division of the modules in the embodiment of the present application is schematic, which is merely a logic function division, and other division manners may be implemented in practice.
Fig. 10 shows a possible structural diagram of the registration example 100 involved in the above-described embodiment in the case where respective functional blocks are divided with corresponding respective functions. As shown in fig. 10, the registration instance 100 may include: a receiving unit 1001, a determining unit 1002, and a registering unit 1003. Wherein the receiving unit 1001 is configured to perform a process S603 in fig. 6 or fig. 7; the determining unit 1002 is configured to perform the process S604 in fig. 6 or fig. 7; the registration unit 1003 is for executing a process S607 in fig. 7. All relevant contents of each step related to the above method embodiment may be cited to the functional description of the corresponding functional module, which is not described herein.
Fig. 11 shows a possible structural diagram of the registration instance 110 involved in the above-described embodiment in the case where respective functional blocks are divided with corresponding respective functions. As shown in fig. 11, registration instance 110 may include: a receiving unit 1101, a determining unit 1102, and a transmitting unit 1103. Wherein the receiving unit 1001 is configured to perform a process S603 in fig. 6 or fig. 7; the determining unit 1002 is configured to perform the process S604 in fig. 6 or fig. 7; the transmission unit 1103 is configured to execute a process S605 in fig. 6 or 7. All relevant contents of each step related to the above method embodiment may be cited to the functional description of the corresponding functional module, which is not described herein.
Fig. 12 shows a possible structural diagram of the registration instance 120 involved in the above-described embodiment in the case where respective functional blocks are divided with corresponding respective functions. As shown in fig. 12, registration instance 120 may include: a receiving unit 1201, a determining unit 1202, and a transmitting unit 1203. Wherein the receiving unit 1201 is for performing the process S803 in fig. 8 or 9; the determination unit 1202 is configured to perform a process S804 in fig. 8 or 9; the transmitting unit 1203 is configured to execute a process S805 in fig. 8 or 9. All relevant contents of each step related to the above method embodiment may be cited to the functional description of the corresponding functional module, which is not described herein.
In the case of an integrated unit, fig. 13 shows a schematic diagram of one possible structure of the registration instance 130 involved in the above-described embodiment. The registration instance 130 may perform the function of registering an instance in the service registration procedure described above, or may perform the function of registering an instance in the service providing method described above. As shown in fig. 13, registration instance 130 may include: processing module 1301, communication module 1302. The processing module 1301 is configured to control and manage the actions of the registration instance 130, and the communication module 1302 is configured to communicate with other devices. For example, the processing module 1301 is configured to execute the process S604 in fig. 6 or 7, or the process S605 in fig. 7, or the process S607 in fig. 7, or the process S804 in fig. 8 or 9, or the process S807 in fig. 9, or the process S808 in fig. 9. The processing module 1301 may also be used to perform a process S603 in fig. 6 or 7, or a process S605 in fig. 6 or 7, or a process S803 in fig. 8 or 9, or a process S805 in fig. 8 or 9 through the communication module 1302. The registration instance 130 may also include a storage module 1303 for storing program code and data of the registration instance 130.
The processing module 1301 may be the processor 501 in the physical structure of the computing device 50 shown in fig. 5, and may be a processor or a controller. For example, it may be a CPU, general purpose processor, DSP, ASIC, FPGA or other programmable logic device, transistor logic device, hardware component, or any combination thereof. Which may implement or perform the various exemplary logic blocks, modules, and circuits described in connection with this disclosure. Processor 1301 may also be a combination that implements computing functionality, e.g., comprising one or more microprocessor combinations, a combination of a DSP and a microprocessor, and the like. The communication module 1302 may be the network interface 503 in the physical structure of the computing device 50 shown in fig. 5, and the communication module 1302 may be a communication port, or may be a network interface, transceiver circuit, or communication interface, etc. Alternatively, the communication interface may implement communication with other devices through the element having the transceiver function. The above-mentioned elements with transceiving functions may be realized by antennas and/or radio frequency devices. The storage module 1303 may be the memory 502 in the physical structure of the computing device 50 shown in fig. 5.
When the processing module 1301 is a processor, the communication module 1302 is a network interface, and the storage module 1303 is a memory, the registration instance 130 related to fig. 13 in the embodiment of the present application may be the computing device 50 shown in fig. 5.
As mentioned above, the service registration instance 100 or the service registration instance 120 or the registration instance 130 provided in the embodiments of the present application may be used to implement the corresponding functions in the methods implemented in the embodiments of the present application, and for convenience of explanation, only the portions relevant to the embodiments of the present application are shown, and specific technical details are not disclosed, which refer to the embodiments of the present application.
Fig. 14 shows a possible structural diagram of the service providing instance 140 involved in the above-described embodiment in the case where respective functional blocks are divided with corresponding respective functions. As shown in fig. 14, the service providing instance 140 may include: a transmitting unit 1401 and a receiving unit 1402. Wherein the transmission unit 1401 is for executing a process S602 in fig. 6 or 7; the receiving unit 1402 is configured to perform the process S606 in fig. 6 or fig. 7. All relevant contents of each step related to the above method embodiment may be cited to the functional description of the corresponding functional module, which is not described herein.
In the case of an integrated unit, fig. 15 shows a possible structural schematic diagram of the service providing example 150 involved in the above-described embodiment. As shown in fig. 15, the service providing instance 150 may include: processing module 1501, communication module 1502. The processing module 1501 is used for controlling and managing the actions of the service providing instance 15, and the communication module 1502 is used for communicating with other devices. For example, the processing module 1501 may also be used to perform the processes S602, S606 in fig. 6 or fig. 7 through the communication module 1502. The service providing instance 150 may also include a storage module 1503 for storing program code and data of the service providing instance 150.
The processing module 1501 may be the processor 501 in the physical structure of the computing device 50 shown in fig. 5, and may be a processor or a controller. For example, it may be a CPU, general purpose processor, DSP, ASIC, FPGA or other programmable logic device, transistor logic device, hardware component, or any combination thereof. Which may implement or perform the various exemplary logic blocks, modules, and circuits described in connection with this disclosure. The processor 1501 may also be a combination of computing functions, e.g., including one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc. The communication module 1502 may be the network interface 503 in the physical structure of the computing device 50 shown in fig. 5, and the communication module 1502 may be a communication port, or may be a network interface, transceiver circuit, or communication interface, etc. Alternatively, the communication interface may implement communication with other devices through the element having the transceiver function. The above-mentioned elements with transceiving functions may be realized by antennas and/or radio frequency devices. The memory module 1503 may be the memory 502 in the physical structure of the computing device 50 shown in fig. 5.
When the processing module 1501 is a processor, the communication module 1502 is a network interface, and the storage module 1503 is a memory, the service providing instance 150 according to fig. 15 of the embodiment of the present application may be the computing device 50 shown in fig. 5.
As mentioned above, the service providing instance 140 or the service providing instance 150 provided in the embodiments of the present application may be used to implement the corresponding functions in the methods implemented in the embodiments of the present application, and for convenience of explanation, only the portions relevant to the embodiments of the present application are shown, and specific technical details are not disclosed, which refer to the embodiments of the present application.
Fig. 16 shows a possible structural diagram of the service consumption instance 160 involved in the above-described embodiment in the case where respective functional blocks are divided with corresponding respective functions. As shown in fig. 16, the service consumption instance 160 may include: transmitting section 1601 and receiving section 1602. Wherein the transmitting unit 1601 is configured to perform a process S802 in fig. 8 or 9; the receiving unit 1602 is configured to perform the process S806 in fig. 8 or 9. All relevant contents of each step related to the above method embodiment may be cited to the functional description of the corresponding functional module, which is not described herein.
In the case of an integrated unit, fig. 17 shows a schematic diagram of one possible architecture of the service consumption instance 170 involved in the above-described embodiment. As shown in fig. 17, the service consumption instance 170 may include: a processing module 1701, a communication module 1702. The processing module 1701 is used for controlling and managing the actions of the service consumption instance 170, and the communication module 1702 is used for communicating with other devices. For example, the processing module 1701 may be configured to perform the processes S802, S806 of fig. 8 or 9 via the communication module 1702. The service consumption instance 170 may further comprise a storage module 1703 for storing program code and data of the service consumption instance 17.
The processing module 1701 may be the processor 501 in the physical structure of the computing device 50 shown in fig. 5, and may be a processor or a controller. For example, it may be a CPU, general purpose processor, DSP, ASIC, FPGA or other programmable logic device, transistor logic device, hardware component, or any combination thereof. Which may implement or perform the various exemplary logic blocks, modules, and circuits described in connection with this disclosure. The processor 1701 may also be a combination that performs computing functions, e.g., including one or more microprocessors, a combination of a DSP and a microprocessor, and the like. The communication module 1802 may be the network interface 503 in the physical structure of the computing device 50 shown in fig. 5, and the communication module 1702 may be a communication port, or may be a network interface, a transceiver circuit, or a communication interface, etc. Alternatively, the communication interface may implement communication with other devices through the element having the transceiver function. The above-mentioned elements with transceiving functions may be realized by antennas and/or radio frequency devices. The memory module 1703 may be the memory 502 in the physical structure of the computing device 50 shown in fig. 5.
When the processing module 1701 is a processor, the communication module 1702 is a network interface, and the storage module 1703 is a memory, the service consumption instance 170 according to fig. 17 of the embodiment of the present application may be the computing device 50 shown in fig. 5.
As mentioned above, the service consumption instance 160 or the service consumption instance 170 provided in the embodiments of the present application may be used to implement the corresponding functions in the methods implemented in the embodiments of the present application, and for convenience of explanation, only the portions relevant to the embodiments of the present application are shown, and specific technical details are not disclosed, please refer to the embodiments of the present application.
In yet another aspect, an embodiment of the present application provides a service providing system including a registration instance and a plurality of service providing instances.
In yet another aspect, an embodiment of the present application provides a service providing system including a registration instance and a plurality of service consumption instances.
As another form of the present embodiment, there is provided a computer-readable storage medium having stored thereon instructions that, when executed, perform the service providing method in the above-described method embodiment in the role of registering an instance or service providing instance or service consuming instance.
As another form of the present embodiment, there is provided a computer program product containing instructions that, when run on a computer, cause the computer (in the role of a registered instance or a service providing instance or a service consuming instance) to perform the service providing method in the above method embodiment.
The embodiment of the application further provides a chip system, which comprises a processor, wherein the processor is used for realizing the technical method of the embodiment of the invention in the roles of registering an instance or a service providing instance or a service consuming instance. In one possible design, the system on a chip also includes memory to hold the program instructions and/or data necessary for embodiments of the present invention. In one possible design, the system-on-chip further includes a memory for the processor to invoke application code stored in the memory. The chip system may be formed by one or more chips, or may include chips and other discrete devices, which are not specifically limited in this embodiment.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, which are not repeated herein.
Those of skill in the art will appreciate that in one or more of the examples described above, the functions described herein may be implemented in hardware, software, firmware, or any combination thereof. When implemented in software, these functions may be stored on or transmitted over as one or more instructions or code on a computer-readable medium. Computer-readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one place to another. A storage media may be any available media that can be accessed by a general purpose or special purpose computer. It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, which are not repeated herein.
In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods may be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, or may be in electrical or other forms.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may be physically included separately, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in hardware plus software functional units.
The integrated units implemented in the form of software functional units described above may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium, and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a read-only memory (ROM), a random access memory (random access memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present application, and are not limiting thereof; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the corresponding technical solutions.

Claims (24)

1. A service providing method, wherein a service providing system includes a registration instance and a plurality of service providing instances, each service providing instance having a same service interface group, the service interface group including a plurality of service interfaces; the method comprises the following steps:
the registration instance receives a first registration request sent by a first service providing instance, wherein the first registration request carries first information of the service interface group, and the first information of the service interface group is used for representing the plurality of service interfaces;
the registration instance determines whether the service interface group is registered according to the first information of the service interface group;
under the condition that the service interface group is not registered, the registration instance registers the service interface group and the first service providing instance according to the first information of the service interface group;
in the case that the service interface group is registered, the registration instance sends a registration success message to the first service providing instance.
2. The method according to claim 1, wherein the method further comprises:
in the case that the service interface group is not registered, the registration instance sends a request message to the first service providing instance;
The registration instance receives second information of the service interface group sent by the first service providing instance according to the request message, wherein the second information of the service interface group comprises an interface name and/or an interface version of each service interface.
3. The method according to claim 1 or 2, wherein said registering the set of service interfaces and the first service providing instance comprises:
the registration instance establishes a first mapping relation, wherein the first mapping relation comprises the identification of the service interface group and the mapping relation of a plurality of service interfaces contained in the service interface group;
the registration instance establishes a second mapping relationship, wherein the second mapping relationship comprises a mapping relationship between the identification of the service interface group and the first service providing instance containing the service interface group.
4. The method according to claim 1 or 2, wherein the first information of the service interface group is a hash value or an associated value calculated from the information of the plurality of service interfaces.
5. A service providing method, wherein a service providing system includes a registration instance and a plurality of service providing instances, each service providing instance having a same service interface group, the service interface group including a plurality of service interfaces; the method comprises the following steps:
The first service providing instance sends a first registration request to the registration instance, wherein the first registration request carries first information of the service interface group, and the first information of the service interface group is used for representing the plurality of service interfaces;
the first service providing instance receives a registration success message sent by the registration instance, wherein the registration success message indicates that the service interface group and the first service providing instance are successfully registered;
the registration success message is that the registration instance determines that the service interface group is not registered according to the first information of the service interface group, and the service interface group and the first service providing instance are registered according to the first information of the service interface group and then sent; or the registration success message is directly sent after the registration instance determines that the service interface group is registered according to the first information of the service interface group.
6. The method according to claim 5, characterized in that the method comprises:
the first service providing instance receives a request message of the registration instance;
the first service providing instance sends second information of the service interface group to the registration instance according to the request message, wherein the second information of the service interface group comprises an interface name and/or an interface version of each service interface.
7. The method according to claim 5 or 6, wherein the first information of the service interface group is a hash value or an associated value calculated from the information of the plurality of service interfaces.
8. The method according to claim 5 or 6, wherein the service providing system comprises a plurality of registration instances; the method comprises the following steps:
the first service providing instance selects a registration instance from the plurality of registration instances to send the first registration request based on the information of the service interface group and the number of the plurality of registration instances.
9. A service providing system comprising a registration instance and a plurality of service providing instances, each service providing instance having a same service interface group comprising a plurality of service interfaces; wherein,
a first service providing instance, configured to send a first registration request to the registration instance, where the first registration request carries first information of the service interface group, where the first information of the service interface group is used to represent the plurality of service interfaces;
the registration instance is configured to receive a first registration request sent by the first service providing instance, determine whether the service interface group is registered according to first information of the service interface group, and register the service interface group and the first service providing instance according to the first information of the service interface group when the service interface group is not registered, and send a registration success message to the first service providing instance; sending a registration success message to the first service providing instance in case the service interface group is registered;
The first service provides an instance and is further configured to receive a registration success message sent by the registration instance.
10. The system of claim 9, wherein the system further comprises a controller configured to control the controller,
the registration instance is configured to send a request message to the first service providing instance when the service interface group is unregistered, and receive second information of the service interface group sent by the first service providing instance according to the request message, where the second information of the service interface group includes an interface name and/or an interface version of each service interface;
the first service providing instance is configured to receive the request message, and send second information of the service interface group to the registration instance according to the request message.
11. The system according to claim 9 or 10, wherein,
the registration instance is configured to establish a first mapping relationship, where the first mapping relationship includes a mapping relationship between an identifier of the service interface group and a plurality of service interfaces included in the service interface group; or,
the registration instance is configured to establish a second mapping relationship, where the second mapping relationship includes a mapping relationship between an identifier of the service interface group and a first service providing instance including the service interface group.
12. The system according to claim 9 or 10, wherein the first information of the service interface group is a hash value or an associated value calculated from the information of the plurality of service interfaces.
13. A registration instance, wherein a service providing system comprises the registration instance and a plurality of service providing instances, each service providing instance having a same service interface group, the service interface group comprising a plurality of service interfaces; the registration instance includes:
the receiving unit is used for receiving a first registration request sent by a first service providing instance, wherein the first registration request carries first information of the service interface group, and the first information of the service interface group is used for representing the plurality of service interfaces;
a determining unit, configured to determine whether the service interface group is registered according to first information of the service interface group;
a registration unit, configured to register, when the service interface group is unregistered, the service interface group and the first service providing instance according to first information of the service interface group; and sending a registration success message to the first service providing instance under the condition that the service interface group is registered.
14. The registration instance according to claim 13, wherein,
the registration instance further comprises a sending unit, configured to send a request message to the first service providing instance when the service interface group is unregistered;
the receiving unit is further configured to receive second information of the service interface group sent by the first service providing instance according to the request message, where the second information of the service interface group includes an interface name and/or an interface version of each service interface.
15. Registration instance according to claim 13 or 14, characterized in that the registration unit is specifically configured to:
establishing a first mapping relation, wherein the first mapping relation comprises the identification of the service interface group and the mapping relation of a plurality of service interfaces contained in the service interface group;
and establishing a second mapping relation, wherein the second mapping relation comprises the mapping relation between the identification of the service interface group and the first service providing instance containing the service interface group.
16. The registration instance according to claim 13 or 14, wherein the first information of the service interface group is a hash value or an association value calculated from information of the plurality of service interfaces.
17. A first service providing instance, wherein the service providing system comprises a registration instance and a plurality of service providing instances, each service providing instance having a same service interface group, the service interface group comprising a plurality of service interfaces; the first service providing instance includes:
a sending unit, configured to send a first registration request to the registration instance, where the first registration request carries first information of the service interface group, where the first information of the service interface group is used to represent the plurality of service interfaces;
a receiving unit, configured to receive a registration success message sent by the registration instance, where the registration success message indicates that the service interface group and the first service providing instance have been successfully registered;
the registration success message is that the registration instance determines that the service interface group is not registered according to the first information of the service interface group, and the service interface group and the first service providing instance are registered according to the first information of the service interface group and then sent; or the registration success message is directly sent after the registration instance determines that the service interface group is registered according to the first information of the service interface group.
18. The first service providing instance of claim 17, wherein the first service providing instance comprises,
the receiving unit is further configured to receive a request message of the registration instance;
the sending unit is further configured to send second information of the service interface group to the registration instance according to the request message, where the second information of the service interface group includes an interface name and/or an interface version of each service interface.
19. The first service providing instance according to claim 17 or 18, wherein the first information of the service interface group is a hash value or an associated value calculated from information of the plurality of service interfaces.
20. The first service providing instance according to claim 17 or 18, wherein the service providing system comprises a plurality of registered instances; the first service providing instance further comprises a selection unit for:
based on the information of the service interface group and the number of the plurality of registration instances, one registration instance is selected from the plurality of registration instances to send the first registration request.
21. A non-volatile storage medium comprising instructions for implementing the registration instance of any one of claims 13 to 16.
22. A non-volatile storage medium comprising instructions for implementing the first service provision instance of any one of claims 17 to 20.
23. A computing device, the computing device comprising a processor and a memory; the processor executing the memory-stored instructions, causing the computing device to perform the method of any one of claims 1 to 4.
24. A computing device, the computing device comprising a processor and a memory; the processor executing the memory-stored instructions, causing the computing device to perform the method of any one of claims 5 to 8.
CN202010470158.0A 2019-12-04 2020-05-28 Service providing method, device and system Active CN112910943B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/122960 WO2021109747A1 (en) 2019-12-04 2020-10-22 Service providing method, device, and system

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN2019112299835 2019-12-04
CN201911229983 2019-12-04

Publications (2)

Publication Number Publication Date
CN112910943A CN112910943A (en) 2021-06-04
CN112910943B true CN112910943B (en) 2024-03-05

Family

ID=76111261

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010470158.0A Active CN112910943B (en) 2019-12-04 2020-05-28 Service providing method, device and system

Country Status (2)

Country Link
CN (1) CN112910943B (en)
WO (1) WO2021109747A1 (en)

Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101626310A (en) * 2008-07-10 2010-01-13 阿里巴巴集团控股有限公司 Method, device and system for transmitting service information in trunking environment
CN102427451A (en) * 2011-12-06 2012-04-25 宁波电业局 Method and system for acquiring service application
CN102571550A (en) * 2010-12-30 2012-07-11 北京亿阳信通软件研究院有限公司 General information interaction platform and method
CN103095479A (en) * 2011-11-04 2013-05-08 华为技术有限公司 Method and device of business configuration
CN103236935A (en) * 2013-05-21 2013-08-07 北京梅泰诺电子商务有限公司 Two-dimension code user registration certification system and method thereof
CN103309985A (en) * 2013-06-17 2013-09-18 广东电网公司电力科学研究院 Business service registration and publication method and system for service registration centers
CN103944902A (en) * 2010-08-13 2014-07-23 华为技术有限公司 Method, device and equipment for aggregating Mashup service for service
CN104936282A (en) * 2015-06-04 2015-09-23 青岛海信移动通信技术股份有限公司 Method and device for registering converged communication service
CN105827467A (en) * 2016-05-31 2016-08-03 华为技术有限公司 Registration center upgrade method, related equipment and system
CN107205020A (en) * 2017-05-05 2017-09-26 国网福建省电力有限公司 Service load balancing method and system under Service-Oriented Architecture Based
CN109547570A (en) * 2018-12-29 2019-03-29 深圳云天励飞技术有限公司 Service registration method, apparatus, registration center's management equipment and storage medium
CN109684820A (en) * 2018-12-28 2019-04-26 天津卓朗科技发展有限公司 Service Privileges acquisition methods, device and electronic equipment
CN110018962A (en) * 2019-04-11 2019-07-16 重庆猪八戒知识产权服务有限公司 Service adjustment method and system based on distributed service framework and registration center
CN110262902A (en) * 2019-05-16 2019-09-20 杭州朗和科技有限公司 Information processing method and system, medium and calculating equipment
CN110377431A (en) * 2019-07-29 2019-10-25 中国工商银行股份有限公司 Service calling method and device under more registration center's scenes

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100407154C (en) * 2004-04-29 2008-07-30 国际商业机器公司 A system and method for modeling and dynamically deploying services into a distributed networking architecture
CN100534047C (en) * 2006-04-28 2009-08-26 国际商业机器公司 Method and system for attribute based index and/or query of Web service resource
CN101170553B (en) * 2006-10-24 2011-07-20 华为技术有限公司 Method and device for realizing Internet protocol multi-media sub-system disaster tolerance
KR101618698B1 (en) * 2009-07-31 2016-05-10 삼성전자주식회사 A system for managing unregistered terminals with sharing authentication information and a method thereof
US20150310477A1 (en) * 2011-12-08 2015-10-29 Vpromos, Inc. Systems and methods for enrolling consumers in a program
US10050953B2 (en) * 2015-11-30 2018-08-14 Microsoft Technology Licensing, Llc Extending a federated graph with third-party data and metadata
WO2017214046A1 (en) * 2016-06-06 2017-12-14 Illumina, Inc. Tenant-aware distributed application authentication
CN106453288B (en) * 2016-09-29 2019-06-04 上海和付信息技术有限公司 A kind of distributed micro services frame system that supporting asynchronous mode and its implementation

Patent Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101626310A (en) * 2008-07-10 2010-01-13 阿里巴巴集团控股有限公司 Method, device and system for transmitting service information in trunking environment
CN103944902A (en) * 2010-08-13 2014-07-23 华为技术有限公司 Method, device and equipment for aggregating Mashup service for service
CN102571550A (en) * 2010-12-30 2012-07-11 北京亿阳信通软件研究院有限公司 General information interaction platform and method
CN103095479A (en) * 2011-11-04 2013-05-08 华为技术有限公司 Method and device of business configuration
CN102427451A (en) * 2011-12-06 2012-04-25 宁波电业局 Method and system for acquiring service application
CN103236935A (en) * 2013-05-21 2013-08-07 北京梅泰诺电子商务有限公司 Two-dimension code user registration certification system and method thereof
CN103309985A (en) * 2013-06-17 2013-09-18 广东电网公司电力科学研究院 Business service registration and publication method and system for service registration centers
CN104936282A (en) * 2015-06-04 2015-09-23 青岛海信移动通信技术股份有限公司 Method and device for registering converged communication service
CN105827467A (en) * 2016-05-31 2016-08-03 华为技术有限公司 Registration center upgrade method, related equipment and system
CN107205020A (en) * 2017-05-05 2017-09-26 国网福建省电力有限公司 Service load balancing method and system under Service-Oriented Architecture Based
CN109684820A (en) * 2018-12-28 2019-04-26 天津卓朗科技发展有限公司 Service Privileges acquisition methods, device and electronic equipment
CN109547570A (en) * 2018-12-29 2019-03-29 深圳云天励飞技术有限公司 Service registration method, apparatus, registration center's management equipment and storage medium
CN110018962A (en) * 2019-04-11 2019-07-16 重庆猪八戒知识产权服务有限公司 Service adjustment method and system based on distributed service framework and registration center
CN110262902A (en) * 2019-05-16 2019-09-20 杭州朗和科技有限公司 Information processing method and system, medium and calculating equipment
CN110377431A (en) * 2019-07-29 2019-10-25 中国工商银行股份有限公司 Service calling method and device under more registration center's scenes

Also Published As

Publication number Publication date
CN112910943A (en) 2021-06-04
WO2021109747A1 (en) 2021-06-10

Similar Documents

Publication Publication Date Title
US11568092B2 (en) Method of dynamically configuring FPGA and network security device
JP2020524869A (en) Virtual machine management
US20160036665A1 (en) Data verification based upgrades in time series system
CN109873839B (en) Data access method, server and distributed system
EP3629160B1 (en) Method and device for managing vnf instantiation
CN105791254A (en) Network request processing method, device and terminal
US20070220217A1 (en) Communication Between Virtual Machines
JP4495688B2 (en) Verification system
CN111163140A (en) Method, apparatus and computer readable storage medium for resource acquisition and allocation
CN112910943B (en) Service providing method, device and system
CN107045452B (en) Virtual machine scheduling method and device
CN113660121B (en) Information management method and device based on distributed system and computer storage medium
CN114679349B (en) Data communication method and device
CN115480934A (en) Distributed data processing method, device, equipment and storage medium
CN114185558A (en) Native application master selection method and device based on K8s and storage medium
CN107615872B (en) Method, device and system for releasing connection
CN110046040B (en) Distributed task processing method and system and storage medium
CN108132843B (en) Memory application method, device and equipment for information interaction under multi-core heterogeneous platform
US9270530B1 (en) Managing imaging of multiple computing devices
CN111857548A (en) Data reading method, device and system
US8412769B2 (en) Scalably imaging clients over a network
CN112748981B (en) Processing method and device for software mirror image of virtual network function
CN113703676B (en) Calling method, device, equipment and medium for double live volumes
US20090183172A1 (en) Middleware Bridge System And Method
CN112019645B (en) TOE-based network address management method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20220225

Address after: 550025 Huawei cloud data center, jiaoxinggong Road, Qianzhong Avenue, Gui'an New District, Guiyang City, Guizhou Province

Applicant after: Huawei Cloud Computing Technology Co.,Ltd.

Address before: 518129 Bantian HUAWEI headquarters office building, Longgang District, Guangdong, Shenzhen

Applicant before: HUAWEI TECHNOLOGIES Co.,Ltd.

SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant