A service registration method, device and storage medium

By deploying network proxy components in the service grid to monitor and convert registration requests, it solves the problem of non-JAVA services being unable to dual-register, realizes barrier-free registration and communication between services, and adapts to registration center migration and language incompatibility. scene.

CN113938520BActive Publication Date: 2024-10-08ALIBABA (CHINA) CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111016168.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-31
Publication Date
2024-10-08
Estimated Expiration
2041-08-31

AI Technical Summary

Technical Problem

Under the microservice architecture, services in non-JAVA languages ​​cannot achieve dual registration, causing communication between services to be blocked, especially when the registration center is migrated or the language is not suitable.

Method used

By deploying the network proxy component in the service grid, monitoring the service registration request of the target service, obtaining the registration information, and based on this information, launching a registration request that meets the language requirements of the registration center to the registration center to achieve barrier-free registration of services.

Benefits of technology

It breaks through language restrictions, realizes barrier-free registration of services under the service grid, supports dual registration of services and migration in dual registration scenarios, and ensures smooth communication between services.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113938520B_ABST
    Figure CN113938520B_ABST
Patent Text Reader

Abstract

The embodiments of the present application provide a service registration method, device and storage medium. In the embodiments of the present application, an extended function can be configured for a network proxy component under a service grid. When a target service needs to be registered with a first registration center and the language between the target service and the first registration center is not compatible, the network proxy component associated with the target service can be used to obtain registration information from a service registration request initiated by the target service, and based on the registration information, a proxy registration request that meets the language requirements of the first registration center is initiated to the first registration center to register the target service with the first registration center. In this way, based on the non-intrusive relationship between the network proxy component and the target service and the language adaptation function provided by the network proxy component for various registration centers, the barrier-free proxy registration capability of the network proxy component can be guaranteed, thereby achieving barrier-free registration of services under a service grid and breaking through language limitations.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of cloud computing technology, and in particular to a service registration method, device and storage medium. Background Art

[0002] Microservice architecture is a way of developing a single application as a suite of many small services, where each service has its own process and uses lightweight mechanisms to communicate. There are many services in the microservice architecture, and service mesh can be used to achieve inter-service communication. Services can register and discover services through the registry center, and then exchange data.

[0003] In order to prevent the instability of a single registration center or when the registration center needs to be migrated, the dual registration problem of microservices will be involved. However, currently only microservices in common languages ​​such as JAVA can provide dual registration capabilities, while other microservices cannot achieve dual registration, which hinders communication between services. Summary of the invention

[0004] Multiple aspects of the present application provide a service registration method, device and storage medium for implementing barrier-free registration of services under a service grid.

[0005] The present application embodiment provides a service registration method, including:

[0006] Using a network proxy component to monitor a service registration request initiated by a target service, wherein the service registration request includes registration information of the target service, wherein the network proxy component and the target service run in different containers under a service grid;

[0007] In the case where the target service needs to be registered with the first registration center and the languages ​​of the target service and the first registration center are not compatible, using the network proxy component to obtain the registration information from the service registration request;

[0008] Using the network proxy component to initiate a proxy registration request that meets the language requirements of the first registration center to the first registration center based on the registration information, so as to register the target service to the first registration center

[0009] The embodiment of the present application also provides a communication terminal, including a memory, a processor and a network proxy component, wherein a plurality of containers are deployed on the communication terminal, and the network proxy component and the target service run in different containers under the service grid;

[0010] The memory is used to store one or more computer instructions;

[0011] The processor is coupled to the memory and the network proxy component and is configured to execute the one or more computer instructions for:

[0012] Using a network proxy component to monitor a service registration request initiated by a target service, wherein the service registration request includes registration information of the target service;

[0013] In the case where the target service needs to be registered with the first registration center and the languages ​​of the target service and the first registration center are not compatible, using the network proxy component to obtain the registration information from the service registration request;

[0014] The network proxy component is used to initiate a proxy registration request that meets the language requirement of the first registration center to the first registration center based on the registration information, so as to register the target service to the first registration center.

[0015] An embodiment of the present application also provides a computer-readable storage medium storing computer instructions. When the computer instructions are executed by one or more processors, the one or more processors are caused to execute the aforementioned service registration method.

[0016] In the embodiment of the present application, an extended function can be configured for the network proxy component under the service grid. When the target service needs to be registered with the first registration center and the language between the target service and the first registration center is not compatible, the network proxy component associated with the target service can be used to obtain registration information from the service registration request initiated by the target service, and based on the registration information, a proxy registration request that meets the language requirements of the first registration center is initiated to the first registration center to register the target service with the first registration center. In this way, based on the non-intrusive relationship between the network proxy component and the target service and the language adaptation function provided by the network proxy component for various registration centers, the barrier-free proxy registration capability of the network proxy component can be guaranteed, thereby realizing barrier-free registration of services under the service grid and breaking through language limitations. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0018] Figure 1 A flowchart of a service registration method provided for an exemplary embodiment of the present application;

[0019] Figure 2 A logical diagram of a service registration scheme in a single registration scenario provided for an exemplary embodiment of the present application;

[0020] Figure 3A logical diagram of a service registration scheme in a dual registration scenario provided for an exemplary embodiment of the present application;

[0021] Figure 4 A structural diagram of a communication terminal provided for another exemplary embodiment of the present application. DETAILED DESCRIPTION

[0022] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.

[0023] At present, the registration of microservices is subject to language restrictions, which hinders communication between services. To this end, in some embodiments of the present application: under the service grid, an extended function can be configured for the network proxy component. When the target service needs to be registered with the first registration center and the language between the target service and the first registration center is not compatible, the network proxy component associated with the target service can be used to obtain registration information from the service registration request initiated by the target service, and based on the registration information, a proxy registration request that meets the language requirements of the first registration center is initiated to the first registration center to register the target service with the first registration center. In this way, based on the non-intrusive relationship between the network proxy component and the target service and the language adaptation function provided by the network proxy component for various registration centers, the barrier-free proxy registration capability of the network proxy component can be guaranteed, thereby achieving barrier-free registration of services under the service grid and breaking through language restrictions.

[0024] The technical solutions provided by various embodiments of the present application are described in detail below in conjunction with the accompanying drawings.

[0025] Figure 1 A flowchart of a service registration method provided by an exemplary embodiment of the present application. Figure 1 , the method comprising:

[0026] Step 100: Use the network proxy component to monitor a service registration request initiated by a target service, where the service registration request includes registration information of the target service, wherein the network proxy component and the target service run in different containers under the service grid;

[0027] Step 101: When a target service needs to be registered with a first registration center and the languages ​​of the target service and the first registration center are not compatible, a network proxy component is used to obtain registration information from a service registration request;

[0028] Step 102: Using the network proxy component to initiate a proxy registration request that meets the language requirements of the first registration center to the first registration center based on the registration information, so as to register the target service to the first registration center.

[0029] The service registration method provided in this embodiment can be applied to service communication scenarios and supports barrier-free registration of services.

[0030] In order to more clearly explain the service registration solution provided by this embodiment, several technical concepts involved in this embodiment are briefly described below:

[0031] Microservices architecture: Microservices architecture is an approach to developing a single application as a suite of small services, each of which has its own process and uses lightweight mechanisms to communicate.

[0032] Service mesh: a non-intrusive service-oriented framework and a dedicated infrastructure layer for handling inter-service communication. It is responsible for reliably delivering requests through complex service topologies that include modern cloud-native applications. In practice, service meshes are usually implemented through a set of lightweight network proxies that are deployed with the application code without being aware of the application itself. Under the service mesh, each service cluster can support the operation of multiple services. For a service, there may be one or more container group PODs to support it. Different container group PODs may be distributed on different nodes, and for a container group POD, it may contain one or more containers.

[0033] The network proxy component is a high-performance traffic proxy component in the service grid. In this embodiment, the network proxy component can be deployed in each container group POD, and the network proxy component and the services loaded in the container group POD run in different containers, that is, the container where the network proxy component is located is independent of the containers where the services in the POD are located, and the network proxy component can be used to manage the traffic of each service in the POD. In this embodiment, the network proxy component can use the Envoy component under the service grid.

[0034] Registration center: Under the service grid, service providers can register themselves with the registration center so that service callers can easily find themselves. The registration center can be used to provide registration functions and maintain service registration information.

[0035] Based on this, the service registration solution provided in this embodiment can support single registration and / or dual registration of services. Single registration can be understood as registering with a single registration center, and dual registration can be understood as registering with two or more registration centers. Among them, dual registration may occur in the case of preventing the instability of single registration. In this case, the service can be registered in more registration centers based on the original registration center; dual registration may also occur in the case of registration center migration. In this case, it may be necessary to migrate the service from the original registration center to the new registration center, but the migration is not a cluster, but it is necessary to support the migration transition state of the service. In the migration transition state, the service needs to be registered in the original registration center and the new registration center at the same time. In this way, in the process of registering the service in the new registration center, there may be a problem of language incompatibility between the service and the registration center.

[0036] Here, language mismatch may refer to the inconsistency between the development language of the service and the language supported by the SDK that undertakes the registration function in the registration center. In actual applications, from the language dimension, common services may include but are not limited to services of various language types such as Dubbo, SpringCloud, NodeJs, .net, Golang, C++, Python, etc. Among them, some languages ​​have a fixed and unified framework, such as JAVA-like languages, so they are more versatile, while other languages ​​may be less versatile; and the registration center is also diverse. Common registration centers may include but are not limited to nacos, eureka, consul, zookeeper, etcd, etc. The languages ​​supported by the SDK that undertakes the registration function in different registration centers may be different, and the registration center can only process the registration traffic that meets its language requirements. In this way, the diversity of the development language of the service and the diversity of the languages ​​supported by the registration center may lead to language mismatch problems between the service and the registration center, especially in the aforementioned double registration case, that is, when the service needs to be registered in the new registration center, it is likely to encounter language mismatch problems, resulting in failure to register.

[0037] For this purpose, refer to Figure 1In step 100, for the network proxy component, the service registration request initiated by the target service can be monitored. Under the service grid, the network proxy component can be used to monitor the traffic generated by the service. For example, traffic hijacking and other methods can be used to monitor the traffic. Of course, this is only exemplary. In this embodiment, any existing or future traffic monitoring scheme proposed for the network proxy component can be used to monitor the traffic initiated by the target service. In the traffic initiated by the target service, the network proxy component can identify the service registration request and only execute the service registration scheme provided by this embodiment for the service registration request. In actual applications, the network proxy component can determine that the traffic initiated by the target service is a service registration request when the traffic initiated by the target service contains a registration center address or other methods that can identify the traffic type as service registration traffic.

[0038] In this embodiment, it can be determined whether the service registration request initiated by the target service needs to be registered on behalf of the target service. The judgment operation can be performed by the network proxy component, and of course, it can also be performed by the processor in the communication terminal (for example, node, etc.) where the target service is located. An exemplary judgment scheme can be: when the target service needs to be registered with the first registration center and the language between the target service and the first registration center is not compatible, it is determined that the target service needs to be registered on behalf of the target service. Among them, the target service can point to the first registration center in the service registration request, for example, carrying relevant information (address information, etc.) of the first registration center to indicate that it needs to be registered with the first registration center; of course, it can also be pre-specified in the network proxy component to specify that the target service needs to be registered with the first registration center. This embodiment does not limit the implementation method of how to indicate that the target service needs to be registered with the first registration center. In addition, in this embodiment, the network proxy component or the processor in the communication terminal where the target service is located can determine the development language of the target service (for example, carrying the identification of the development language in the service registration request) and the language supported by the SDK that undertakes the registration function in the first registration center to determine whether the language between the two parties is compatible. This embodiment does not limit the implementation method of determining whether the language is compatible.

[0039] Figure 2 A logical diagram of a service registration solution in a single registration scenario provided for an exemplary embodiment of the present application. Figure 3 A logical diagram of a service registration scheme in a dual registration scenario provided by an exemplary embodiment of the present application. Figure 3 For the aforementioned single registration scenario, the first registration center can be the registration center that the target service needs to register with; for the aforementioned dual registration scenario, the first registration center can be any new registration center other than the original registration center of the target service.

[0040] In step 101, when it is determined that the target service needs to be registered, the network proxy component can obtain registration information from the service registration request. The registration information may include but is not limited to information that needs to be registered to the registration center, such as the service name, service address or destination address, which are not exhaustive here.

[0041] Based on this, in step 102, the network proxy component can initiate a proxy registration request that meets the language requirements of the first registration center to the first registration center based on the registration information, so as to register the target service to the first registration center. Here, the network proxy component can encapsulate the registration information of the target service, and the encapsulation operation can be performed according to the language requirements of the first registration center. In this way, the proxy registration request obtained after encapsulation can carry the registration information of the target service, and the proxy registration request meets the language requirements of the first registration center. Therefore, through the proxy registration request, the target service can be successfully registered to the first registration center in the case of language mismatch between the target service and the first registration center, which breaks through the language barrier between the target service and the first registration center.

[0042] Optionally, in this embodiment, the network proxy component can be used to encapsulate the registration information into a proxy registration request according to the language requirements of the SDK that performs the registration function in the first registration center; and the proxy registration request is initiated to the first registration center by calling the SDK API interface; or the network proxy component can be used to encapsulate the registration information into a proxy registration request according to the language requirements of the SDK that performs the registration function in the first registration center; and the proxy registration request is initiated to the first registration center in HTTP. Of course, this is only exemplary, and the communication method between the network proxy component and the first registration center in this embodiment is not limited to this. In addition, the language adaptation method between the two is also not limited to this.

[0043] refer to Figure 2 and Figure 3, for the single registration scenario mentioned above, in this embodiment, the target service can be registered to any type of registration center according to the above-mentioned proxy registration scheme, and is no longer limited by language. For the dual registration scenario mentioned above, in this embodiment, if the target service needs to register with other registration centers (taking the second registration center as an example) other than the first registration center, then for the network proxy component, if the second registration center is valid, the service registration request can be forwarded to the second registration center to register the target service with the second registration center, wherein the language between the second registration center and the target service is adapted, for example, the second registration center can be the original registration center of the target service. In addition, in this embodiment, the target service can point to the first registration center and the second registration center in the service registration request to indicate that it needs to be registered in the first registration center and the second registration center. Of course, the relevant information of the registration center that needs to be registered can also be specified in advance in the network proxy component for the target service, and the network proxy component determines the registration center that the target service needs to register. In the case where the second registration center is invalid, the network proxy component can intercept the service registration request initiated by the target service to prohibit the target service from registering in the second registration center. Here, the validity of the second registration center relative to the target service can be determined by judging whether the target service needs to be registered in the second registration center. For example, in the scenario of registration center migration, the target service may no longer need to be registered in the original registration center, but only needs to be registered in the new registration center, but the target service may not be aware of this situation due to the problem of message delay, but the network proxy component has been aware of this situation in time, then the network proxy component can determine that the original registration center is invalid relative to the target service, and can prohibit the target service from registering with the original registration center by interception. In this way, for the registration center that is language-compatible with the target service, in this embodiment, the network proxy component can continue to use the original processing flow and undertake the forwarding work to support the target service to register with such a registration center, and can also intercept the registration traffic initiated by the target service to such a registration center as needed to avoid invalid registration of the target service. For the registration center that is language-incompatible with the target service, the network proxy component can register for the target service according to the aforementioned proxy registration scheme. Thus, in the dual registration scenario, the proxy registration solution provided by this embodiment does not affect the execution of the original registration process, but can add a function of performing service registration with any other registration center in addition to the original registration process.

[0044] In this embodiment, after completing the registration of the target service, a heartbeat request can also be sent to the registration center to indicate that the registration center retains the registration information of the target service. In the single registration scenario, in this embodiment, the target service or the network proxy component can send a heartbeat request to the registration center; in the dual registration scenario, in this embodiment, for the network proxy component, when it is detected that the target service sends a heartbeat request to the second registration center, the network proxy component can be used to replace the target service to send a heartbeat request to the first registration center, and the way to generate a heartbeat to the second registration center can follow the original scheme. In this way, it is possible to initiate a heartbeat request to the first registration center and the second registration center to indicate that the first registration center and the second registration center both retain the registration information of the target service. Among them, the heartbeat request can be used to characterize the operating status of the target service. For the registration center, if the heartbeat request of the target service is received within the specified time, the registration information of the target service can continue to be retained, and if the heartbeat request of the target service is not received within the specified time, the registration information of the target service can be discarded.

[0045] Accordingly, in this embodiment, an extended function can be configured for the network proxy component under the service grid. When the target service needs to be registered with the first registration center and the language between the target service and the first registration center is not compatible, the network proxy component associated with the target service can be used to obtain registration information from the service registration request initiated by the target service, and based on the registration information, a proxy registration request that meets the language requirements of the first registration center is initiated to the first registration center to register the target service with the first registration center. In this way, based on the non-intrusive relationship between the network proxy component and the target service and the language adaptation function provided by the network proxy component for various registration centers, the barrier-free proxy registration capability of the network proxy component can be guaranteed, thereby achieving barrier-free registration of services under the service grid and breaking through language restrictions.

[0046] In the above or below embodiments, when the languages ​​of the target service and the first registration center are not compatible, the network proxy component may be used to perform service discovery for the first registration center.

[0047] In this embodiment, the network proxy component can be used to respond to the service discovery request initiated by the target service to obtain the registration information of the specified service from the first registration center; the network proxy component is used to adjust the registration information of the specified service to a data format that meets the language requirements of the target service and then provide it to the target service.

[0048] In the aforementioned single registration scenario, the network proxy component can respond to the service discovery request initiated by the target service, obtain the registration information of the designated service from the first registration center, and convert the registration information of the designated service into a data format according to the language requirements of the target service before providing it to the target service. In this way, the target service can unimpededly parse the registration information of the designated service, thereby smoothly communicating with the designated service. In this process, the network proxy component undertakes the work of discovery, helping the target service to discover the designated service from the first registration center.

[0049] In the aforementioned dual registration scenario, for the network proxy component, in response to the service discovery request initiated by the target service, the first registration information and the second registration information of the designated service can be obtained from the first registration center and the second registration center respectively; the service discovery information corresponding to the designated service can be determined according to the first registration information and the second registration information; and the service discovery information can be provided to the target service according to the language requirements of the target service. Among them, the target service can initiate a service discovery request according to the original service discovery traffic between the target service and the second registration center, so that the service discovery request is adapted to the language requirements of the second registration center, but not to the language of the first registration center. For this reason, the network proxy component can be extended with the function of language adaptation with the first registration center, so that the network proxy component can replace the target service to perform service discovery facing the first registration center. Based on this, the network proxy component can merge the registration information of the designated service in different registration centers, and use the fusion result as the service discovery information of the designated service, and can encapsulate the service discovery information according to the data format required by the target service, and provide the encapsulated information to the target service. In this way, the target service can unimpededly parse the service discovery information (that is, registration information) of the designated service, so as to smoothly communicate with the designated service. In this process, the network proxy component is responsible for the discovery work for the first registration center, the forwarding work for the second registration center, and the integration and packaging of registration information, helping the target service to discover the specified service from multiple registration centers.

[0050] In addition, in a dual registration scenario, there may be a problem that the registration information of the designated service in the first registration center and the second registration center is inconsistent. For example, in a migration scenario, the designated service may no longer be registered in the original registration center, so the registration information obtained from the original registration center may not be accurate. For this reason, in this embodiment, if the first registration center is the destination registration center for the migration work, then if the first registration information is valid, the first registration information is used as the service discovery information corresponding to the designated service. For the network proxy component, if the first registration center is the destination registration center for the migration work, then if the first registration information is valid (that is, the target service has been successfully registered with the first registration center), the first registration information obtained from the first registration center can be converted into a data format according to the data format of the second registration information obtained from the second registration center, and the converted first registration information is used as the service discovery information of the designated service and provided to the target service, while the second registration information is discarded, thereby ensuring the accuracy of the service discovery information of the designated service.

[0051] Based on this, in this embodiment, during the service discovery phase, a network proxy component can be used to implement language adaptation between the service and the registration center. Moreover, in a dual registration scenario, the network proxy component can be used to fuse the registration information of a specified service in multiple registration centers to more accurately determine the registration information of the specified service, thereby supporting smooth communication between the target service and the specified service.

[0052] In addition, in the above embodiments, WebAssembly technology can be used to implement the extended functions involved in the network proxy component, such as obtaining the registration information of the target service, initiating a proxy registration request, and language adaptation in the service discovery process mentioned in the above embodiments. In this way, based on the support of WebAssembly technology, the running speed of the network proxy component can be effectively guaranteed, and the network proxy component can only provide proxy registration and proxy discovery functions for services in the same container group POD, which can effectively guarantee the processing performance of the network proxy component.

[0053] It should be noted that the execution subject of each step of the method provided in the above embodiment can be the same device, or the method can be executed by different devices. For example, the execution subject of steps 100 to 102 can be device A; for another example, the execution subject of steps 100 and 101 can be device A, and the execution subject of step 102 can be device B; and so on.

[0054] In addition, in some of the processes described in the above embodiments and the accompanying drawings, multiple operations that appear in a specific order are included, but it should be clearly understood that these operations may not be executed in the order in which they appear in this article or may be executed in parallel. The serial numbers of the operations, such as 101, 102, etc., are only used to distinguish between different operations, and the serial numbers themselves do not represent any execution order. In addition, these processes may include more or fewer operations, and these operations may be executed in sequence or in parallel. It should be noted that the descriptions of "first", "second", etc. in this article are used to distinguish different registration centers, registration information, etc., and do not represent the order of precedence, nor do they limit the "first" and "second" to be different types.

[0055] Figure 4 FIG. 1 is a schematic diagram of a communication terminal structure provided by another exemplary embodiment of the present application. Figure 4 As shown, the communication terminal may include: a memory 40, a processor 41 and a network proxy component 42. Figure 4 , multiple containers can be deployed on the communication end, and the network proxy component and the target service run in different containers under the service grid.

[0056] Among them, the memory 40 can be used to store one or more computer instructions. And it can be configured to store various other data to support operations on the computing platform. Examples of these data include instructions for any application or method operating on the computing platform, contact data, phone book data, messages, pictures, videos, etc. The memory can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0057] The processor 41 is coupled to the memory 40 and the network proxy component 42 for executing one or more computer instructions for:

[0058] Using a network proxy component to monitor a service registration request initiated by a target service, the service registration request includes registration information of the target service;

[0059] In the case where the target service needs to be registered with the first registration center and the languages ​​of the target service and the first registration center are not compatible, obtaining registration information from the service registration request using the network proxy component;

[0060] A network proxy component is used to initiate a proxy registration request that meets the language requirements of the first registration center to the first registration center based on the registration information, so as to register the target service to the first registration center.

[0061] The communication terminal provided in this embodiment can be a node, a virtual machine, a cloud server, etc. in a cloud network. This embodiment does not limit the physical implementation form of the communication terminal. In an exemplary deployment scheme, multiple container group PODs can be deployed in the communication terminal, and a network proxy component can be deployed for each container group POD. The network proxy component can be in the form of a sidecar to non-invasively process the traffic of each service in the corresponding container group POD. In actual applications, the network proxy component can be an Envoy component under the service grid, where the network proxy component and the service run in different containers in the container group POD, which ensures that the function of the network proxy component is independent of the development language of the service, which is completely different from the traditional JAVAagent and other intrusive service registration schemes.

[0062] In this embodiment, WebAssembly technology can be used to expand the functionality of the network proxy component, which not only ensures the running speed of the extended functions of the network proxy component, but also supports the extended functions of the network proxy component to adapt to multiple types of registration centers. That is, through functional expansion, the network proxy component can have the ability to adapt to multiple languages ​​at the same time.

[0063] In addition, in this embodiment, the extended functions of the network proxy component can be configured in its filter to ensure that the extended functions of the network proxy component are in the same processing link as the service registration request and the service discovery request. In this way, in this embodiment, the processor 41 can perform extended functions such as service registration request monitoring operations and proxy registration operations through the filter included in the network proxy component.

[0064] Based on this, in an optional embodiment, the processor 41 may also be used to:

[0065] If the service registration request points to the first registration center, it is determined that the target service needs to be registered with the first registration center.

[0066] In an optional embodiment, if the service registration request is directed to the second registration center and the first registration center, the processor 41 may also be configured to:

[0067] When the second registration center is valid, forwarding the service registration request to the second registration center by using the network proxy component to register the target service with the second registration center;

[0068] Among them, the language between the second registration center and the target service is adapted.

[0069] In an optional embodiment, the processor 41 may also be configured to:

[0070] When the second registration center is invalid, the service registration request is intercepted to prohibit the target service from registering with the second registration center.

[0071] In an optional embodiment, the processor 41 may also be configured to:

[0072] In the case of monitoring that the target service sends a heartbeat request to the second registration center, using the network proxy component to send a heartbeat request to the first registration center instead of the target service;

[0073] Among them, the heartbeat request is used to represent the running status of the target service.

[0074] In an optional embodiment, the processor 41 may also be configured to:

[0075] Responding to the service discovery request initiated by the target service by using the network proxy component, the first registration information and the second registration information of the specified service are obtained from the first registration center and the second registration center respectively;

[0076] Determine service discovery information corresponding to the specified service according to the first registration information and the second registration information;

[0077] The network proxy component is used to provide service discovery information to the target service according to the language requirements of the target service.

[0078] In an optional embodiment, in the process of determining the service discovery information corresponding to the specified service according to the first registration information and the second registration information, the processor 41 may be used to:

[0079] If the first registration center is the destination registration center of the migration work, then if the first registration information is valid, the first registration information is used as the service discovery information corresponding to the designated service.

[0080] In an optional embodiment, the processor 41, in the process of using the network proxy component to initiate a proxy registration request that meets the language requirement of the first registration center to the first registration center based on the registration information, can be used to:

[0081] Using the network proxy component to encapsulate the registration information into a proxy registration request according to the language requirements of the SDK that performs the registration function in the first registration center; and initiating the proxy registration request to the first registration center by calling the API interface of the SDK; or

[0082] The registration information is encapsulated into a proxy registration request by using a network proxy component according to the language requirements of the SDK that undertakes the registration function in the first registration center; and the proxy registration request is initiated to the first registration center by HTTP.

[0083] It is worth noting that the technical details of the above-mentioned embodiments of the communication terminal can refer to the relevant descriptions in the above-mentioned method embodiments. In order to save space, they will not be repeated here, but this should not cause loss of the protection scope of this application. In addition, Figure 4Only some components are shown schematically, which does not mean that the communication end only includes Figure 4 Components shown

[0084] Accordingly, an embodiment of the present application further provides a computer-readable storage medium storing a computer program, which, when executed, can implement each step that can be executed by the communication terminal in the above method embodiment.

[0085] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0086] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0087] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0088] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0089] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0090] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0091] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0092] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0093] The above is only the embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims

1. A service registration method, comprising: Using a network proxy component to monitor a service registration request initiated by a target service, the service registration request includes registration information of the target service, wherein the network proxy component and the target service run in different containers under a service grid, and the service registration request meets a language requirement of the target service; In the case where the target service needs to be registered with the first registration center and the languages ​​of the target service and the first registration center are not compatible, using the network proxy component to obtain the registration information from the service registration request; The registration information of the target service is encapsulated by the network proxy component according to the language requirement of the first registration center, and the encapsulated proxy registration request is sent to the first registration center to register the target service with the first registration center.

2. The method according to claim 1, further comprising: If the service registration request points to the first registration center, it is determined that the target service needs to be registered with the first registration center.

3. The method according to claim 1, if the service registration request points to the second registration center and the first registration center, the method further comprises: When the second registration center is valid, forwarding the service registration request to the second registration center by using the network proxy component to register the target service with the second registration center; Wherein, the language between the second registration center and the target service is adapted.

4. The method according to claim 3, further comprising: In the case that the second registration center is invalid, the service registration request is intercepted to prohibit the target service from registering with the second registration center.

5. The method according to claim 3, further comprising: In the case where it is monitored that the target service sends a heartbeat request to the second registration center, using the network proxy component to send a heartbeat request to the first registration center instead of the target service; The heartbeat request is used to represent the running status of the target service.

6. The method according to claim 3, further comprising: Responding to the service discovery request initiated by the target service by using the network proxy component, respectively acquiring first registration information and second registration information of the specified service from the first registration center and the second registration center; Determining service discovery information corresponding to the specified service according to the first registration information and the second registration information; The network proxy component is used to provide the service discovery information to the target service according to the language requirement of the target service.

7. The method according to claim 6, wherein determining the service discovery information corresponding to the specified service according to the first registration information and the second registration information comprises: If the first registration center is the destination registration center of the migration work, then when the first registration information is valid, the first registration information is used as the service discovery information corresponding to the designated service.

8. The method according to claim 1, wherein the step of encapsulating the registration information of the target service according to the language requirement of the first registration center by using the network proxy component and sending the encapsulated proxy registration request to the first registration center comprises: Using the network proxy component to encapsulate the registration information into the proxy registration request according to the language requirement of the SDK that undertakes the registration function in the first registration center; And by calling the API interface of the SDK, the proxy registration request is initiated to the first registration center; or The registration information is encapsulated into the proxy registration request by using the network proxy component according to the language requirement of the SDK that undertakes the registration function in the first registration center; and the proxy registration request is initiated to the first registration center in HTTP.

9. According to the method of claim 1, under the service mesh, the network proxy component adopts the Envoy component.

10. A communication terminal, comprising a memory, a processor and a network proxy component, wherein a plurality of containers are deployed on the communication terminal, and the network proxy component and the target service run in different containers under a service grid; The memory is used to store one or more computer instructions; The processor is coupled to the memory and the network proxy component and is configured to execute the one or more computer instructions for: Using a network proxy component to monitor a service registration request initiated by a target service, wherein the service registration request includes registration information of the target service and the service registration request complies with a language requirement of the target service; In the case where the target service needs to be registered with the first registration center and the languages ​​of the target service and the first registration center are not compatible, using the network proxy component to obtain the registration information from the service registration request; The registration information of the target service is encapsulated by the network proxy component according to the language requirement of the first registration center, and the encapsulated proxy registration request is sent to the first registration center to register the target service with the first registration center.

11. The communication terminal according to claim 10, wherein the network proxy component comprises a filter, and the processor is specifically configured to: The service registration request monitoring operation and the proxy registration operation are performed through the filter included in the network proxy component.

12. A computer-readable storage medium storing computer instructions, which, when executed by one or more processors, causes the one or more processors to execute the service registration method according to any one of claims 1 to 9.