Multi-registration center adaptation method, device, electronic device and storage medium
By generating a management registry model and deploying a cluster registry model in the target cluster, the adaptation access of multiple registry centers and the service instances are achieved, and the adaptation efficiency problem caused by inconsistent registry API is solved. Reduces development workload and operation and maintenance costs, and supports architecture upgrades and service governance of old applications.
Patent Information
- Application Number
- CN202310140342.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-13
- Publication Date
- 2024-12-10
- Estimated Expiration
- 2043-02-13
AI Technical Summary
The APIs of the registry centers in the existing microservice architecture are not unified, resulting in low adaptation efficiency of different registry centers, increasing development workload and operation and maintenance costs.
By receiving user metadata information, a management registry model is generated, and when monitoring model updates, a cluster registry model is deployed in the target cluster, connecting to the target registry center, achieving two-way synchronization of service instances, and reducing the adaptability of different registry centers Compatible with workload.
The adaptation access of multiple registry centers and service instances are realized, which reduces the adaptation workload of different registry centers, solves the compatibility problems of old applications in architecture upgrades, and provides basic support for service governance.
Smart Images

Figure CN116155978B_ABST
Abstract
Description
Background Art
[0002] The registry is one of the most important components in the microservice architecture. It is responsible for the registration and discovery of services and records the mapping relationship between services and service addresses. There is no unified specification for various types of registry centers, and the APIs (Application Programming Interface) provided are different. This results in that no matter which microservice RPC (Remote Procedure Call) framework uses a certain type of registry center, it needs to be specially adapted, and different frameworks need to make different adaptations. When the same type of framework uses different languages, it also needs to make different adaptations according to different languages, which greatly increases the development workload and increases the operation and maintenance costs after production.
[0003] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0004] The present disclosure provides a multi-registration center adaptation method, device, electronic device and computer-readable storage medium, which at least to a certain extent overcome the problem of low efficiency of microservice framework adaptation to different registration centers in the related art.
[0005] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.
[0006] According to one aspect of the present disclosure, a multi-registry adaptation method is provided, which is applied to a storage node, including: receiving metadata information of a user and generating a management registration center model; when an update of the management registration center model is monitored, deploying the cluster registration center model in one or more target clusters according to the metadata information of the management registration center model; connecting with the corresponding target registration center according to the metadata information of the cluster registration center model; synchronizing the cluster service instance in the target cluster with the registration service instance of the target registration center.
[0007] In one embodiment of the present disclosure, synchronizing the service instance in the target cluster with the registered service instance of the target registration center includes: querying the cluster service instance that needs to be synchronized in the target cluster according to the metadata information of the cluster registration center model; and synchronizing the cluster service instance to the corresponding target registration center.
[0008] In one embodiment of the present disclosure, synchronizing the service instance in the target cluster with the registered service instance of the target registration center includes: obtaining the registered service instance of the target registration center; and creating a corresponding service instance model and service model in the target cluster according to the registered service instance.
[0009] In one embodiment of the present disclosure, when the management registry center model update is monitored, the cluster registry center model is deployed in one or more target clusters according to the metadata information of the management registry center model, including: when the management registry center model update is monitored, the registry center adapter synchronizer is deployed to the target cluster according to the metadata information of the management registry center model, and deployment information is generated; according to the deployment information, the cluster registry center model corresponding to the registry center adapter synchronizer is created.
[0010] In one embodiment of the present disclosure, it further includes: the registration center adapter synchronizer monitors the service instance change information of the target registration center; and updates the cluster service instance of the target cluster according to the service instance change information.
[0011] In one embodiment of the present disclosure, querying the cluster service instance that needs to be synchronized in the target cluster based on the metadata information of the cluster registration center model includes: locating the service instance list information that needs to be synchronized through a label filtering mechanism; and determining the cluster service instance based on the service instance list information.
[0012] In one embodiment of the present disclosure, the metadata information includes: service name, cluster access rights, or basic data of a service instance.
[0013] In one embodiment of the present disclosure, the target registration center includes: Eureka, Zookeeper, Consul or Nacos.
[0014] According to another aspect of the present disclosure, a multi-registration center adaptation device is also provided, including:
[0015] The registration center generation module receives the user's metadata information and generates a management registration center model;
[0016] A cluster center deployment module, when monitoring the update of the management registry center model, deploys the cluster registry center model in one or more target clusters according to the metadata information of the management registry center model;
[0017] A registration center connection module, which connects with the corresponding target registration center according to the metadata information of the cluster registration center model;
[0018] The service instance synchronization module synchronizes the cluster service instance in the target cluster with the registration service instance in the target registration center.
[0019] According to another aspect of the present disclosure, an electronic device is also provided, including: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute any one of the above-mentioned multi-registration center adaptation methods by executing the executable instructions.
[0020] According to another aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the multi-registration center adaptation method described in any one of the above is implemented.
[0021] The multi-registration center adaptation method, device, electronic device and computer-readable storage medium provided by the embodiments of the present disclosure receive metadata information of the user, generate a management registration center model, and when monitoring the update of the management registration center model, deploy the cluster registration center model in one or more target clusters according to the metadata information of the management registration center model, connect with the corresponding target registration center according to the metadata information of the cluster registration center model, query the cluster service instance that needs to be synchronized in the target cluster according to the metadata information of the cluster registration center model, and synchronize the cluster service instance to the corresponding target registration center; obtain the registration service instance of the target registration center, and create a corresponding service instance model and service model in the target cluster according to the registration service instance, so as to realize the adaptation access of multiple registration centers and the two-way synchronization of the service instances therein, and reduce the adaptation workload of different registration centers.
[0022] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.
[0024] Figure 1 A flow chart of a multi-registry center adaptation method in an embodiment of the present disclosure is shown;
[0025] Figure 2 A flow chart of a method for synchronizing a cluster service instance to a corresponding target registration center in an embodiment of the present disclosure is shown;
[0026] Figure 3A flow chart of a method for synchronizing a registration service instance to a corresponding cluster in an embodiment of the present disclosure is shown;
[0027] Figure 4 A schematic diagram of a multi-registration center adaptation device in an embodiment of the present disclosure is shown;
[0028] Figure 5 A schematic diagram of a multi-registration center adaptation system in an embodiment of the present disclosure is shown;
[0029] Figure 6 A structural block diagram of an electronic device in an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0030] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that the disclosure will be more comprehensive and complete and to fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0031] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.
[0032] The present exemplary implementation is described in detail below with reference to the accompanying drawings and embodiments.
[0033] First, a multi-registration center adaptation method is provided in an embodiment of the present disclosure, and the method can be executed by any electronic device with computing and processing capabilities.
[0034] Figure 1 A flow chart of a multi-registry center adaptation method in an embodiment of the present disclosure is shown as follows: Figure 1 As shown, the multi-registry center adaptation method provided in the embodiment of the present disclosure is applied to a storage node, and includes the following steps:
[0035] S102, receiving metadata information of the user and generating a management registration center model;
[0036] In one embodiment of the present disclosure, metadata information includes but is not limited to: service name, cluster access rights, service tags, service version numbers, service instance weights, routing rules or basic data of service instances, which can provide data for microservice modeling and combine the cloud native service mesh concept with the registration center service instance synchronization logic based on the model definition.
[0037] In one embodiment, the user's metadata information is submitted through the Admin Rest API to create a management registry model.
[0038] The Admin Rest API (Admin Representational State Transfer Application Programming Interface) provides a simple, flexible, and extensible interface for making distributed applications that can communicate over the Internet.
[0039] The management registry model describes the specific information of the registry service instance connected to the microservice grid, so that the registry adapter synchronizer can read the connection information and create a connection with the registry for subsequent related service registration and discovery operations.
[0040] The management registration center model includes but is not limited to: application interface version apiversion, component kind required by the cluster, metadata metadata, etc.; metadata includes but is not limited to: class name name, type type, address address, user name username, synchronization configuration syncconfig, service name servicenames, etc.
[0041] For example, the type of the registration center is nacos, which represents that CRD (Custom Resource Definition) describes the relevant metadata information of a nacos registration center; under the synchronization configuration syncconfig, the service-related information that needs to be synchronized to the grid or to the registration center is described.
[0042] S104, when monitoring the management registry center model update, deploying the cluster registry center model in one or more target clusters according to the metadata information of the management registry center model;
[0043] The target cluster is a cluster where the cluster registration center model is deployed, which may be, but is not limited to, a K8S (Kubernetes) cluster. The embodiment of the present disclosure is introduced using a K8S cluster as an example.
[0044] In one embodiment, when an update of the management registry center model is monitored, the registry center adapter synchronizer is deployed to the target cluster according to the metadata information of the management registry center model, and deployment information is generated; based on the deployment information, a cluster registry center model corresponding to the registry center adapter synchronizer is created, and the data is fully synchronized to achieve synchronization of service instances of multiple registry centers.
[0045] The deployment information is the metadata deployed to the target cluster, including but not limited to: address, user name, service name, related management registry model, etc.
[0046] In one embodiment, based on the Operator mechanism of K8s, the creation, update, deletion and other dynamics of the management registration center model are monitored, and the registration center adapter synchronizer is automatically deployed to multiple target clusters under the grid according to the description information in the CRD, and the deployment information is generated. The deployment information is converted to create a cluster registration center model corresponding to the registration center adapter synchronizer. CRD serves as the central storage node of the registration center, synchronizes the data in full, and realizes the synchronization of service instances of multiple registration centers.
[0047] S106, connecting with the corresponding target registry according to the metadata information of the cluster registry model;
[0048] For the cluster registry model, see the management registry model. The cluster registry model only includes metadata related to the cluster registration. According to the metadata information of the cluster registry model, it is connected to the corresponding target registry.
[0049] The target registry is the registry for adaptation access. The target registry includes but is not limited to: Eureka, Zookeeper, Consul or Nacos. It can access one or more target registry centers to complete the adaptation access of multiple registry centers and the two-way synchronization of service instances therein; the target registry is one of the most important components in the microservice architecture. It is responsible for the registration and discovery of services. It is the core component for service-oriented management. It is similar to the role of directory services. It is mainly used to store service information, such as routing information, and records the mapping relationship between services and service addresses.
[0050] S108, synchronizing the cluster service instance in the target cluster with the registration service instance in the target registration center.
[0051] The cluster service instance is the native cluster service instance of the target cluster, and the registration service instance is the service instance of the old application in the registration center.
[0052] In one embodiment, the native cluster service instance information in the K8s cluster is registered with the corresponding registration center, so that the old application can discover the service instance in the K8s cluster through the traditional registration center service discovery mode.
[0053] In one embodiment, the service instances of the old applications in the registration center are synchronized to the K8s cluster. The specific operation is to create corresponding service models and service instance models, so that the applications of the new architecture can access the services and service instances of the old applications without any modification.
[0054] In the related technology, different registration centers have the same or similar functions, but because there is no unified specification in this field, the APIs provided are different. Currently, they all come from the adaptation of different RPC frameworks themselves to different registration center products; if users use different RPCs (m) and different languages (n), the traditional SDK (Software Development Kit) adaptation registration center needs to adapt to a certain registration center at most (m*n) times, which greatly increases the development workload and increases the operation and maintenance costs after production. In the environment of reducing costs and increasing efficiency, such a scenario is unacceptable; for traditional applications deployed using virtual machines and registered with existing registration centers, if the service architecture within the enterprise is upgraded to a cloud-native system, the disclosed embodiment can replace the existing registration center or use the microservice grid mode, that is, no longer use the registration center and use K8s' own service discovery mode. The traditional SDK adaptation registration center cannot solve the compatibility problem of old applications when migrating to the cloud-native architecture and canceling the registration center.
[0055] In the above embodiment, microservice modeling is performed by means of a cloud native service grid, various model entities in microservices are abstracted, such as service models, management registration center models, service instance models, etc., and various model definitions of different registration centers are unified. On the basis of this model definition, the cloud native service grid idea is combined with the registration center service instance synchronization logic to complete the adaptation access of multiple registration centers and the two-way synchronization of the service instances therein. A cluster-based service registration and discovery mechanism can also be provided to reduce the adaptation workload of different registration centers and solve the compatibility issues of old applications in architecture upgrades, providing basic support for high-end service governance functions such as unitization and multi-site active-active in service governance.
[0056] Figure 2 A flow chart of a method for synchronizing a cluster service instance to a corresponding target registration center in an embodiment of the present disclosure is shown. Figure 2 As shown, the method for synchronizing a cluster service instance to a corresponding target registration center provided in an embodiment of the present disclosure includes the following steps:
[0057] S202, locating service instance list information that needs to be synchronized through a tag filtering mechanism;
[0058] A label is a key-value pair that can be attached to various resources. An object resource can define any number of labels, and a label can be added to any number of resource objects. The label can be determined when the resource object is defined, or it can be dynamically added and deleted after the object is created. A label is a label for a resource object, and then the label selector Label Secletor uses a sticky note filtering mechanism to query and filter resource objects with certain labels. In this way, k8s implements a simple and general object query mechanism similar to SQL (Structured Query Language). The label filtering mechanism can efficiently query the service instance list information that needs to be synchronized, thereby determining the cluster service instance.
[0059] In one embodiment, a label is set for each service, and the label includes but is not limited to: service name, etc. The service instance list information corresponding to the service to be synchronized is obtained according to the service name included in the label through the query mechanism and label filtering mechanism of the cluster.
[0060] S204, determining the cluster service instance according to the service instance list information;
[0061] In one embodiment, the service instance list information is a list of service instances that need to be synchronized, and the cluster service instances that need to be synchronized can be efficiently determined according to the service instance list information.
[0062] S206, synchronizing the cluster service instance to the corresponding target registration center.
[0063] In one embodiment, the target registration center receives a registration request sent by the cluster, wherein the registration request includes: a cluster service instance that needs to be synchronized; the target registration center registers the cluster service instance that needs to be synchronized according to the registration request.
[0064] In the above embodiment, during the enterprise architecture upgrade process, the old application can be compatible with the cluster cloud native service mesh mode, and the cluster service instances can be synchronized to the corresponding target registration center, so that the target registration center can obtain all available service instances, which can satisfy the service discovery needs of the old application without making any modifications to the old application and meet the service discovery needs of the new application.
[0065] Figure 3 A flowchart of a method for synchronizing a registration service instance to a corresponding cluster in an embodiment of the present disclosure is shown. Figure 3 As shown, the registration service instance synchronization method provided in the embodiment of the present disclosure to the corresponding cluster includes the following steps:
[0066] S302, obtaining a registration service instance of a target registration center;
[0067] In one embodiment, the service instance list information that needs to be synchronized is located through a tag filtering mechanism, and the registered service instance is determined according to the service instance list information. The specific steps can be found in the previous embodiment and will not be described in detail.
[0068] S304: Create a corresponding service instance model and service model in the target cluster according to the registered service instance.
[0069] In one embodiment, the service model describes the metadata related to a basic service. The service model includes but is not limited to: service name service id, system file host, etc., and provides basic data for subsequent requests when the service instance performs service discovery.
[0070] In one embodiment, the service instance model describes a service instance corresponding to a basic service, corresponding to a POD (Plain Old Documentation) or an application process in a virtual machine scenario. The service instance model includes but is not limited to: the address address and ports of the service instance. The address and port in the description can be provided to the client to request the service, completing the overall response process.
[0071] S306, the registration center adapter synchronizer monitors the service instance change information of the target registration center; and updates the cluster service instance of the target cluster according to the service instance change information.
[0072] In one embodiment, service instance change information includes but is not limited to: new service instances, service instance deletions, or service instance changes, etc. When the registration center adapter synchronizer listens to the service instance change information of the target registration center, it updates the cluster service instance of the target cluster according to the service instance change information. The registration center adapter synchronizer adapts to different registration centers and selectively synchronizes all service instances under specific services to one or more target registration centers through the synchronization interface according to user configuration, so that the service instance synchronization is more controllable. The synchronization interface is the interface of different target registration centers.
[0073] In one embodiment, multiple registry adapter synchronizers can monitor service instance change information of the target registry in real time to ensure the timeliness of service instance synchronization.
[0074] In one embodiment, multiple registration center adapter synchronizers may monitor the service instance change information of the target registration center in turn. When one registration center adapter synchronizer monitors the service instance change information of the target registration center, multiple registration center adapter synchronizers may be started to monitor the service instance change information of the target registration center, thereby saving resources.
[0075] In the above embodiment, during the enterprise architecture upgrade process, the old application can be compatible with the cluster cloud native service grid mode, and the registered service instance can be synchronized to the corresponding cluster, which not only satisfies the old application without any modification, but also meets the service discovery needs of the old application and the new application; through the model abstraction of the service model and the service instance, we can unify the concept in the demand scenario of multi-registration center adaptation, and expand and adapt different registration centers based on a unified model to make its project architecture clear and convenient to implement, and we can also extract the core logic on the basis of a unified model, abstract the specific methods of adaptation of different registration centers according to the template pattern in the design pattern, and adapt different registration centers in a plug-in manner.
[0076] Based on the same inventive concept, the disclosed embodiment also provides a multi-registration center adaptation device, such as the following embodiment. Since the principle of solving the problem in the device embodiment is similar to that in the above method embodiment, the implementation of the device embodiment can refer to the implementation of the above method embodiment, and the repeated parts will not be repeated.
[0077] Figure 4 A schematic diagram of a multi-registration center adaptation device in an embodiment of the present disclosure is shown. Figure 4 As shown, the multi-registration center adaptation device 4 includes: a registration center generation module 401, a cluster center deployment module 402, a registration center connection module 403 and a service instance synchronization module 404;
[0078] The registration center generation module 401 receives the user's metadata information and generates a management registration center model;
[0079] The cluster center deployment module 402 deploys the cluster registry center model in one or more target clusters according to the metadata information of the management registry center model when monitoring the management registry center model update;
[0080] The registry center connection module 403 connects with the corresponding target registry center according to the metadata information of the cluster registry center model;
[0081] The service instance synchronization module 404 synchronizes the cluster service instance in the target cluster with the registration service instance in the target registration center.
[0082] In the above embodiment, the adaptation complexity of different RPC frameworks is reduced. When different RPC frameworks use different registration centers, different frameworks only need to implement cluster-based service registration discovery based on a unified model, which can simultaneously meet the service discovery capabilities both within and outside the cluster, and solve the compatibility issues between old applications and cluster cloud-native service grid mode during enterprise architecture upgrades. The target registration center and the service instances in the cluster can be synchronized in both directions, which can satisfy the service discovery needs of old applications without any modifications and meet the service discovery needs of new applications and old applications.
[0083] Based on the same inventive concept, the disclosed embodiment also provides a multi-registration center adaptation system, such as the following embodiment. Since the principle of solving the problem in the system embodiment is similar to that in the above method embodiment, the implementation of the system embodiment can refer to the implementation of the above method embodiment, and the repeated parts will not be repeated.
[0084] Figure 5 A schematic diagram of a multi-registration center adaptation system in an embodiment of the present disclosure is shown, and four two-grids, each grid including two target clusters, and the target registration center 55 including two registration centers are used as an example for introduction.
[0085] like Figure 5 As shown, the multi-registry center adaptation system 5 includes: a management cluster 50, a first cluster 51, a second cluster 52, a third cluster 53 and a fourth cluster 54, wherein the first cluster 51 and the second cluster 52 are in a first grid, and the third cluster 53 and the fourth cluster 54 are in a second grid.
[0086] The management cluster 50 includes: a metadata receiving interface 501, a management registration center model 502, and a registration controller 503;
[0087] The management cluster 50 also includes a grid operation management module, a grid operation CRD module, a grid operation interface, etc., which are used to manage the target cluster in the grid.
[0088] The first cluster 51 includes: a first service model 511, a first service instance model 512, a first registration center adapter synchronizer 513, a first cluster registration center model 514, and a first synchronization service instance 515;
[0089] The second cluster 52 includes: a second service model 521, a second service instance model 522, a second registration center adapter synchronizer 523, a second cluster registration center model 524, and a second synchronization service instance 525;
[0090] The third cluster 53 includes: a third service model 531, a third service instance model 532, a third registration center adapter synchronizer 533, a third cluster registration center model 534, and a third synchronization service instance 535;
[0091] The fourth cluster 54 includes: a fourth service model 541, a fourth service instance model 542, a fourth registration center adapter synchronizer 543, a fourth cluster registration center model 544, and a fourth synchronization service instance 545;
[0092] The target registration center 55 includes: a first registration center 551 and a second registration center 552;
[0093] The console provides the function of adding a registry center for synchronization adaptation. The user submits the metadata information related to the registry center through the metadata receiving interface 501Admin Rest API to create and generate the management registry center model 502;
[0094] Based on the Operator mechanism of K8s, the registration controller 503 monitors the creation, update, deletion and other dynamics of the management registration center model 502, and automatically deploys four registration center adapter synchronizers, namely the first registration center adapter synchronizer 513, the second registration center adapter synchronizer 523, the third registration center adapter synchronizer 533 and the fourth registration center adapter synchronizer 543 to the specified first grid and different K8s clusters under the second grid, namely the first cluster 51, the second cluster 52, the third cluster 53 and the fourth cluster 54, according to the description information in the CRD of the management registration center model 502. At the same time, the deployment information is converted into the first cluster registration center model 514, the second cluster registration center model 524, the third cluster registration center model 534 and the fourth cluster registration center model 544 and created in the same cluster as the registration center adapter synchronizer.
[0095] Taking the first cluster 51 as an example, the first registration center adapter synchronizer 513 is connected to the first cluster registration center model 514, the first registration center adapter synchronizer 513 monitors the dynamics of the first cluster registration center model 514, and the registration controller 503 can add, read, query, update or delete the first cluster registration center model 514; the first registration center adapter synchronizer 513 automatically establishes a connection with the corresponding target registration center 55 according to the relevant description information in the first cluster registration center model 514, that is, the first registration center adapter synchronizer 513 establishes a connection with the first registration center 551 and the second registration center 552;
[0096] The steps of the second cluster 52 , the third cluster 53 and the fourth cluster 54 may refer to the steps of the first cluster 51 , and will not be described in detail herein.
[0097] According to the service name information described in the first cluster registration center model 514, the second cluster registration center model 524, the third cluster registration center model 534, and the fourth cluster registration center model 544, the service instance list information that needs to be synchronized is located through the K8s own Client query and Label filtering mechanism. Each service starts a thread or coroutine and selects the following operations according to the configuration information:
[0098] Register the native service instance information in the K8s cluster, i.e., the first synchronization service instance 515, the second synchronization service instance 525, the third synchronization service instance 535 or the fourth synchronization service instance 545, to the corresponding target registration center 55, so that the old application can discover the service instance in the K8s cluster through the traditional registration center service discovery mode.
[0099] Synchronize the service instance of the old application in the target registration center 55 to the K8s cluster. The specific operation is to create the corresponding service instance model and service model. Take the first cluster 51 as an example. The first cluster 51 obtains the registered service instance of the target registration center 55, and creates the first service model 511 and the first service instance model 512 according to the target registered service instance.
[0100] The steps for creating corresponding service models and service instance models of the second cluster 52, the third cluster 53 and the fourth cluster 54 can refer to the first cluster 51, which will not be repeated here, so as to achieve the purpose of allowing applications of the new architecture to access the service instances of the old applications without any modification.
[0101] The first registration center adapter synchronizer 513, the second registration center adapter synchronizer 523, the third registration center adapter synchronizer 533 and the fourth registration center adapter synchronizer 543 will also monitor the service instance change information of the target registration center 55; when receiving the addition or deletion of a service instance, they will also operate the service instance model data in this cluster to add or delete the corresponding service instance model.
[0102] The target registration center 55 connects the client and the server. The client can be various electronic devices, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, etc.; the server can be a server that provides various services, and the background management server can analyze and process the received requests and other data.
[0103] In the above embodiment, by relying on the meta-native deployment mode, a unified abstract microservice model is implemented, which includes a service model, a service instance model, etc. The model is stored in the form of CRD in the cloud native K8s, and is synchronized to the target registration center 55 through the K8s listening mechanism, thereby realizing the multi-adaptation center adaptation and service instance synchronization of a logical self-closed loop. The microservice system under the cloud native service grid architecture no longer needs to adapt to different registration centers to achieve the purpose of service discovery. Different frameworks only need to adapt to the K8s service discovery mechanism. K8s is used as the registration center to reduce the problems of many adaptation types and heavy workload. When the network is unobstructed, microservices using the new architecture can still discover and access service instances of old applications from K8s.
[0104] Those skilled in the art will appreciate that various aspects of the present disclosure may be implemented as systems, methods or program products. Therefore, various aspects of the present disclosure may be specifically implemented in the following forms, namely: complete hardware implementation, complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as "circuits", "modules" or "systems".
[0105] Refer to the following Figure 6 The electronic device 600 according to this embodiment of the present disclosure is described. Figure 6 The electronic device 600 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0106] like Figure 6 As shown, the electronic device 600 is in the form of a general computing device. The components of the electronic device 600 may include but are not limited to: at least one processing unit 610, at least one storage unit 620, and a bus 630 connecting different system components (including the storage unit 620 and the processing unit 610).
[0107] The storage unit stores program codes, which can be executed by the processing unit 610, so that the processing unit 610 executes the steps described in the above “Exemplary Method” section of this specification according to various exemplary embodiments of the present disclosure.
[0108] For example, the processing unit 610 can execute the following steps of the above method embodiment: receiving the user's metadata information and generating a management registration center model; when monitoring the update of the management registration center model, deploying the cluster registration center model in one or more target clusters according to the metadata information of the management registration center model; connecting with the corresponding target registration center according to the metadata information of the cluster registration center model; synchronizing the cluster service instance in the target cluster with the registration service instance of the target registration center.
[0109] For example, the processing unit 610 can execute the following steps of the above-mentioned method embodiment: locate the service instance list information that needs to be synchronized through the label filtering mechanism; determine the cluster service instance based on the service instance list information; synchronize the cluster service instance to the corresponding target registration center; obtain the registered service instance of the target registration center; based on the registered service instance, create a corresponding service instance model and service model in the target cluster; the registration center adapter synchronizer listens to the service instance change information of the target registration center; and updates the cluster service instance of the target cluster based on the service instance change information.
[0110] The storage unit 620 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 6201 and / or a cache memory unit 6202 , and may further include a read-only memory unit (ROM) 6203 .
[0111] The storage unit 620 may also include a program / utility 6204 having a set (at least one) of program modules 6205, such program modules 6205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0112] Bus 630 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0113] The electronic device 600 may also communicate with one or more external devices 640 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), one or more devices that enable a user to interact with the electronic device 600, and / or any device that enables the electronic device 600 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed through an input / output (I / O) interface 650.
[0114] Furthermore, the electronic device 600 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN) and / or public network, such as the Internet) through a network adapter 660. As shown, the network adapter 660 communicates with other modules of the electronic device 600 through a bus 630. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with the electronic device 600, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.
[0115] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation of the present disclosure.
[0116] In an exemplary embodiment of the present disclosure, a computer-readable storage medium is also provided, which may be a readable signal medium or a readable storage medium. A program product capable of implementing the above method of the present disclosure is stored thereon. In some possible implementations, various aspects of the present disclosure may also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to cause the terminal device to execute the steps according to various exemplary implementations of the present disclosure described in the above “Exemplary Method” section of this specification.
[0117] For example, when the program product in the embodiment of the present disclosure is executed by a processor, the method implements the following steps: receiving the user's metadata information and generating a management registration center model; when monitoring the update of the management registration center model, deploying the cluster registration center model in one or more target clusters according to the metadata information of the management registration center model; connecting with the corresponding target registration center according to the metadata information of the cluster registration center model; synchronizing the cluster service instance in the target cluster with the registration service instance of the target registration center.
[0118] For example, when the program product in the embodiment of the present disclosure is executed by a processor, the method implements the following steps: obtaining a registered service instance of the target registration center; creating a corresponding service instance model and service model in the target cluster based on the registered service instance; the registration center adapter synchronizer monitors the service instance change information of the target registration center; and updating the cluster service instance of the target cluster based on the service instance change information.
[0119] More specific examples of computer-readable storage media in the present disclosure may include, but are not limited to, an electrical connection having one or more conductors, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0120] In the present disclosure, a computer readable storage medium may include a data signal propagated in baseband or as part of a carrier wave, wherein a readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A readable signal medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0121] Alternatively, the program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.
[0122] In a specific implementation, the program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., using an Internet service provider to connect through the Internet).
[0123] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.
[0124] In addition, although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.
[0125] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the implementation of the present disclosure.
[0126] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure, which follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the appended claims.
Claims
1. A multi-registry center adaptation method, characterized in that: Applicable to storage nodes, including: Receive user metadata information and generate a management registration center model; When an update of the management registry center model is monitored, deploying the cluster registry center model in one or more target clusters according to metadata information of the management registry center model; Connecting to a corresponding target registry according to the metadata information of the cluster registry model; The cluster service instance in the target cluster is synchronized with the registration service instance in the target registration center.
2. The multi-registry center adaptation method according to claim 1, characterized in that: The synchronizing the service instance in the target cluster with the registered service instance in the target registration center includes: According to the metadata information of the cluster registration center model, query the cluster service instance that needs to be synchronized in the target cluster; Synchronize the cluster service instance to the corresponding target registration center.
3. The multi-registry center adaptation method according to claim 1, characterized in that: The synchronizing the service instance in the target cluster with the registered service instance in the target registration center includes: Obtain a registration service instance of the target registration center; According to the registered service instance, a corresponding service instance model and service model are created in the target cluster.
4. The multi-registry center adaptation method according to claim 1, characterized in that: When the management registry model is updated, the step of deploying the cluster registry model in one or more target clusters according to the metadata information of the management registry model includes: When the management registry model is updated, the registry adapter synchronizer is deployed to the target cluster according to the metadata information of the management registry model, and deployment information is generated; According to the deployment information, the cluster registry model corresponding to the registry adapter synchronizer is created.
5. The multi-registry center adaptation method according to claim 4, characterized in that: Also includes: The registration center adapter synchronizer monitors the service instance change information of the target registration center; The cluster service instance of the target cluster is updated according to the service instance change information.
6. The multi-registry center adaptation method according to claim 2, characterized in that: The querying the cluster service instance that needs to be synchronized in the target cluster according to the metadata information of the cluster registration center model includes: Use the tag filtering mechanism to locate the service instance list information that needs to be synchronized. The cluster service instance is determined according to the service instance list information.
7. The multi-registry center adaptation method according to claim 1, characterized in that: The metadata information includes: service name, cluster access rights or basic data of service instances.
8. The multi-registry center adaptation method according to claim 1, characterized in that: The target registration center includes: Eureka, Zookeeper, Consul or Nacos.
9. A multi-registration center adaptation device, characterized in that: include: The registration center generation module receives the user's metadata information and generates a management registration center model; A cluster center deployment module, when monitoring the update of the management registry center model, deploys the cluster registry center model in one or more target clusters according to the metadata information of the management registry center model; A registration center connection module, which connects with the corresponding target registration center according to the metadata information of the cluster registration center model; The service instance synchronization module synchronizes the cluster service instance in the target cluster with the registration service instance in the target registration center.
10. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to execute the multi-registry adaptation method of any one of claims 1 to 8 by executing the executable instructions.
11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the multi-registry center adaptation method described in any one of claims 1 to 8 is implemented.
