A processing method and device for microservice management across data centers

By setting up a preset management center and gateway service interface in each data center to uniformly manage and call microservices, it solves the problem of difficult unified management of configurations in cross-data center microservice calls, reduces network and performance pressure, and improves robustness. Sexual and health availability.

CN118337644BActive Publication Date: 2024-08-27HANGZHOU YUXIN DIGITAL TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410772908.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-17
Publication Date
2024-08-27
Estimated Expiration
2044-06-17

AI Technical Summary

Technical Problem

In the cross-data center microservice invocation scenario, the configuration of microservices is difficult to manage and govern uniformly, resulting in increased network pressure and performance pressure, and it is difficult to summarize and synchronize the health status and routing information between components in real time.

Method used

By setting up a preset management center and gateway service interface in each data center, all microservices are registered in the preset management center, and the persistent service health check mechanism, preset development tool kit and load balancing agent are used to determine the health status of components. Real-time summary and synchronization of routing information, unified management and call of microservices.

Benefits of technology

It reduces the network and performance pressure on the data center, improves the robustness of cross-data center microservice management, realizes the health availability of components and real-time updates of routing information, and supports the unified management and governance of cross-data center microservices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118337644B
    Figure CN118337644B
Patent Text Reader

Abstract

The present invention provides a processing method and device for cross-data center microservice management, which belongs to the field of distributed computing. Any data center of the present invention includes at least one component, and any component includes a preset management center, a gateway service interface and more than one microservice. The preset management center is provided with a persistent service health check mechanism, which is used for cross-data center microservice calls through data center management components. The components manage all their microservices through a unified preset management center, and call microservices through a unified gateway service interface, thereby realizing hierarchical management and unified configuration of microservices in cross-data center deployment scenarios. Since each component has its own preset management center, the microservices it manages are all registered with the preset management center, thereby reducing the network pressure and performance pressure of the data center, improving the robustness of cross-data center microservice management, and realizing cross-data center microservice unified management.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of distributed computing technology, and in particular to a processing method and device for cross-data center microservice management. Background Art

[0002] Since its emergence in 2012, microservices have gradually attracted attention from all parties as a way to speed up the development of web and mobile applications. In 2015, more and more communities and Internet industry giants began to discuss and practice microservices, so 2015 is also called the "first year of microservices."

[0003] In the relevant technologies of microservice projects, one or more systems can be deployed in the same data center, and each system can include more than one microservice. Since the same data center is generally in the same local area network, there will be no cross-data center calls between microservices in the same system.

[0004] However, if cross-data center interaction occurs and the two interacting data centers are not in the same LAN, the microservices of the systems in the two data centers will be called across data centers. However, due to the unequal deployment of different data centers, the microservices across data centers are not interoperable, making it difficult to uniformly manage and govern the configuration of microservices. Summary of the invention

[0005] In view of this, an object of an embodiment of the present invention is to provide a processing method and device for cross-data center microservice management to solve the above-mentioned technical problems in the background technology.

[0006] To achieve the above objectives, in a first aspect, an embodiment of the present invention provides a method for processing microservice management across data centers, the method being applied to any one of the data centers, comprising:

[0007] In the case of adding a component in the data center, basic configuration information of the component to be added is obtained to obtain first configuration data of the data center, and the first configuration data is saved in the memory of the configuration center of the preset management center corresponding to the component to be added, wherein the first configuration data at least includes the basic configuration information of the component to be added, the basic configuration information of other components originally stored, and the public configuration data of the data center originally stored;

[0008] Based on the basic configuration information, determine the health status of the component to be added to determine the health status of the microservice in the component to be added;

[0009] When it is determined that the component to be added is healthy, obtaining routing information of the component to be added, where the routing information of the component to be added includes routing data of all microservices in the component to be added;

[0010] Add the routing information of the component to be added to the original component routing information of the data center to obtain a first component routing list;

[0011] Sending the first component routing list to the component to be added, so as to save it in the memory of the configuration center of the preset management center corresponding to the component to be added;

[0012] In the case where any data center initiates a health check to other data centers through the persistent service health check mechanism, obtain and store the second configuration data and the second component routing list of the other data centers, wherein the second configuration data at least includes the basic configuration information of all components managed by the other data centers and the public configuration data of the other data centers, and the second component routing list at least includes the routing information of all components managed by the other data centers;

[0013] When a microservice call is made in the data center, the target microservice is called based on the first configuration data and the first component routing list of the data center, the second configuration data and the second component routing list of other data centers to which the target microservice called by the data center belongs.

[0014] As an optional embodiment, when adding a component in the data center, obtaining basic configuration information of the component to be added, obtaining first configuration data of the data center, and saving it to the memory of the configuration center of the preset management center corresponding to the component to be added, includes:

[0015] When adding a component in the data center, basic configuration information of the component to be added is obtained by calling a component adding interface;

[0016] Obtaining first configuration data of the data center based on basic configuration information of the component to be added, basic configuration information of other components originally stored in the data center, and originally stored public configuration data of the data center;

[0017] The first configuration data is sent to the memory of the configuration center of the preset management center corresponding to the component to be added, so as to store the first configuration data.

[0018] As an optional embodiment, the method further includes:

[0019] After sending the first configuration data to the memory of the configuration center of the preset management center corresponding to the component to be added to store the first configuration data, updating the first update number of basic configuration information of the component to be added in the configuration center of the preset management center.

[0020] As an optional embodiment, determining the health status of the component to be added based on the basic configuration information includes:

[0021] Obtain a service instance list of the gateway service interface of the component to be added through the component registration center address and the gateway service interface name in the basic configuration information, wherein the component registration center address is the address of the registration center of the component to be added in its corresponding preset management center;

[0022] In a case where a service instance in the service instance list of the gateway service interface is identified as healthy, determining that the component to be added is healthy;

[0023] When the service instance identifier in the service instance list is unhealthy or the service instance list is empty, it is determined that the component to be added is unhealthy.

[0024] As an optional embodiment, the method further includes:

[0025] When any component is determined to be unhealthy, the unhealthy component information is deleted from the component routing list, and the component information in the configuration center of the preset management center corresponding to the component is updated.

[0026] As an optional embodiment, calling the target microservice based on the first configuration data and the first component routing list of the data center, the second configuration data and the second component routing list of other data centers to which the target microservice called by the data center belongs, includes:

[0027] When the data center makes a microservice call, obtaining second configuration data and a second component routing list of other data centers to which the target microservice called by the data center belongs;

[0028] Determine, according to the second configuration data and the first configuration data, whether the data center and other data centers to which the target microservice it calls belongs are the same data center;

[0029] When it is determined that they are not in the same data center, a persistent service instance is added that communicates with other data centers to which the target microservice called by the data center belongs, so as to add second configuration data and a second component routing list.

[0030] As an optional embodiment, the adding of a persistent service instance that communicates with other data centers to which the target microservice called by the data center belongs, so as to add second configuration data and a second component routing list, includes:

[0031] Add a first persistent service instance that communicates with other data centers to which the target microservice called by the data center belongs, so as to aggregate the second component routing list and the first component routing list into a third component routing list, and save the first hash value generated corresponding to the second component routing list;

[0032] Add a second persistent service instance that communicates with other data centers to which the target microservice called by the data center belongs, to obtain basic configuration data of other data centers to which the target microservice called by the data center belongs, and save a second update number corresponding to the basic configuration data of the data center;

[0033] Adding a third persistent service instance that communicates with other data centers to which the target microservice called by the data center belongs to obtain common configuration data and save a third update number of the common configuration data;

[0034] Among them, the second component routing list includes the routing information of all healthy components managed by other data centers to which the target microservice called by the data center belongs, and the third component routing list identifies the routing information of the healthy components of each data center; the basic configuration data of the data center includes the data center identifier, data center domain name and data center access address; the public configuration data includes the configuration center address, port and type of the preset management center of the component where the target microservice is located.

[0035] As an optional embodiment, the method further includes the following steps performed when the data center initiates a health check on other data centers to which the target microservice called by the data center belongs:

[0036] Calling the route summary information verification interface of other data centers to which the target microservice belongs to obtain the current second hash value of the second component route list of the data center;

[0037] When it is determined that the first hash value is different from the second hash value, obtain the current component routing list of other data centers to which the target microservice belongs to update the third component routing list, and store the second hash value;

[0038] Calling the basic configuration verification interface of other data centers to which the target microservice belongs, to obtain the fourth current update number of the basic configuration data of other data centers to which the target microservice belongs;

[0039] When it is determined that the fourth update number is less than the second update number, the originally stored basic configuration data of other data centers to which the target microservice belongs is sent to the data center, so that the data center updates its basic configuration data;

[0040] When it is determined that the fourth update number is greater than the second update number, obtaining current basic configuration data of other data centers to which the target microservice belongs;

[0041] Calling the public configuration data verification interface of other data centers to which the target microservice belongs to obtain the fifth current update number of the public configuration data of other data centers to which the target microservice belongs;

[0042] When it is determined that the fifth update number is less than the third update number, the public configuration data of other data centers to which the target microservice belongs that is originally stored is sent to the data center, so that the data center updates its public configuration data;

[0043] When it is determined that the fifth update number is greater than the third update number, current public configuration data of other data centers to which the target microservice belongs is obtained.

[0044] As an optional embodiment, the method further includes:

[0045] When it is determined that the first hash value is the same as the second hash value, determine that the second component routing list of the other data center to which the target microservice currently stored locally is the latest component routing list, and return a component routing not updated flag;

[0046] When it is determined that the fourth update number is equal to the second update number, determining that the basic configuration data of the other data center to which the target microservice currently stored locally is the latest basic configuration data, and returning a basic configuration not updated flag;

[0047] When it is determined that the fifth update number is equal to the third update number, it is determined that the public configuration data of other data centers to which the target microservice currently stored locally is the latest public configuration data, and a public configuration not updated flag is returned.

[0048] In a second aspect, an embodiment of the present invention provides a processing device for microservice management across data centers, the device being applied to any one of the data centers, including:

[0049] A first acquisition module is used to acquire basic configuration information of the component to be added when adding a component in the data center, and save it to the memory of the configuration center of the preset management center corresponding to the component to be added;

[0050] A determination module, used to determine the health status of the component to be added based on the basic configuration information, so as to determine the health status of the microservice in the component to be added;

[0051] A second acquisition module is used to acquire routing information of the component to be added and obtain first configuration data of the data center when it is determined that the component to be added is healthy, wherein the routing information of the component to be added includes routing data of all microservices in the component to be added, and the first configuration data includes at least basic configuration information of the component to be added, basic configuration information of other components originally stored, and public configuration data of the data center originally stored;

[0052] A routing adding module, used to add the routing information of the component to be added to the original component routing information of the data center to obtain a first component routing list;

[0053] A sending module, used for sending the first component routing list to the component to be added, so as to save it in the memory of the configuration center of the preset management center corresponding to the component to be added;

[0054] A third acquisition module is used to acquire and store the second configuration data and the second component routing list of the other data center when any data center initiates a health check to the other data center through the persistent service health check mechanism, wherein the second configuration data at least includes the basic configuration information of all components managed by the other data center and the public configuration data of the other data center, and the second component routing list at least includes the routing information of all components managed by the other data center;

[0055] The service calling module is used to call the target microservice based on the first configuration data and the first component routing list of the data center, the second configuration data and the second component routing list of other data centers to which the target microservice called by the data center belongs, when a microservice call is made in the data center.

[0056] In a third aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a processing method for cross-data center microservice management as described above.

[0057] In a fourth aspect, an embodiment of the present invention provides an electronic device, comprising:

[0058] one or more processors;

[0059] A storage device for storing one or more programs;

[0060] When the one or more programs are executed by the one or more processors, the one or more processors implement a processing method for cross-data center microservice management as described above.

[0061] The above technical scheme has the following beneficial effects: any data center in the embodiment of the present invention includes at least one component, and any component includes a preset management center, a gateway service interface and one or more microservices, wherein all microservices in the component are registered with the registration center of the preset management center, and the preset management center uniformly manages the component, and the preset management center is provided with a persistent service health check mechanism for microservice calls across data centers through the data center management component, so that the component manages all its microservices through a unified preset management center, and calls the microservices through a unified gateway service interface, thereby realizing hierarchical management and unified configuration of microservices in cross-data center deployment scenarios. In addition, since each component has its own preset management center, its All managed microservices are registered with the preset management center, rather than registering all microservices of all components with the data center, thereby reducing the network pressure and performance pressure of the data center and improving the robustness of cross-data center microservice management; when adding components in the data center, the health status of the components is determined to ensure that the components under the management of the data center are healthy and available components, and during the adding process, the component routing information is summarized in real time to form a unified component routing list, and sent to the configuration center of the preset management center of the component, providing support for cross-data center microservice management; in the cross-data center microservice call, the microservice call is realized through the configuration data and component routing list managed in multiple data centers, realizing unified management and governance of microservices across data centers. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0063] Figure 1 This is a schematic diagram of a cross-data center microservice hierarchical management and deployment architecture provided by an embodiment of the present invention;

[0064] Figure 2 This is one of the flow charts of a processing method for cross-data center microservice management provided by an embodiment of the present invention;

[0065] Figure 3 is a schematic diagram of the sub-step flow of step 201 provided in an embodiment of the present invention;

[0066] Figure 4 is a schematic diagram of the sub-step flow of step 202 provided in an embodiment of the present invention;

[0067] Figure 5 is a schematic diagram of the sub-step flow of step 207 provided in an embodiment of the present invention;

[0068] Figure 6 This is a second flow chart of a processing method for cross-data center microservice management provided by an embodiment of the present invention;

[0069] Figure 7 This is a third flow chart of a processing method for cross-data center microservice management provided by an embodiment of the present invention;

[0070] Figure 8 This is a fourth flow chart of a processing method for cross-data center microservice management provided by an embodiment of the present invention;

[0071] Fig. 9 It is a structural block diagram of a processing device for cross-data center microservice management provided by an embodiment of the present invention;

[0072] Fig.10 is a structural block diagram of a computer-readable storage medium provided by an embodiment of the present invention;

[0073] Fig.11 It is a structural block diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0074] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0075] Microservices (or microservice architecture) is a cloud-native architecture approach that includes many small, loosely coupled and independently deployable components or services in a single application. Microservices are characterized by easier code updates, and new features or functions can be added directly without having to update the entire application. In microservice projects, different technology stacks and different programming languages ​​can be used for different components. Components can be scaled independently of each other, reducing the waste and cost associated with having to scale the entire application. However, if there is cross-data center interaction, and the two interacting data centers are not in the same LAN, the microservices of the systems in the two data centers will be called across data centers. However, due to the unequal deployment of different data centers, the microservices across data centers are not interoperable, making it difficult to uniformly manage and govern the configuration of microservices.

[0076] Figure 1 Schematic diagram of a cross-data center microservice hierarchical management and deployment architecture provided by an embodiment of the present invention. Figure 1 As shown, in an embodiment of the present invention, for example, a data center A and a data center B are included, wherein the data center A includes a component C1 and a component C2, the component C1 includes a correspondingly deployed preset management center S1, the preset management center S1 has services a1, b1, and x1 registered therein, and the services a1, b1, and x1 are uniformly called by a unified gateway service interface R1, similarly, the component C2 includes a correspondingly deployed preset management center S2, the preset management center S2 has services a2, b2, and x2 registered therein, and the services a1, b1, and x1 are uniformly called by a unified gateway service interface R2 Use service a2, service b2 and service x2; data center B includes component C3 and component C4, component C3 includes the corresponding deployed preset management center S3, in which services a3, service b3 and service x3 are registered, and services a3, service b3 and service x3 are uniformly called by a unified gateway service interface R3. Similarly, component C4 includes the corresponding deployed preset management center S4, in which services a4, service b4 and service x4 are registered, and services a4, service b4 and service x4 are uniformly called by a unified gateway service interface R4.

[0077] Among them, each service (referring to microservices) under each component (component C1 to component C4) will be registered with its corresponding preset management center. The preset management center will obtain the routing data and configuration data of all services under each component, summarize them into component routing lists and configuration data information (for example, including basic configuration data of other data centers and public configuration data of other data centers), and store them. In addition, it will also synchronize its own stored component routing lists and configuration data information to other data centers, thereby providing support for cross-data center microservice management.

[0078] It should be noted that in order to implement the technical solution of the embodiment of the present invention, it is implemented in the embodiment of the present invention through a preset management center, a preset load balancing agent and a preset development toolkit. The following describes the respective roles of the three in implementing the embodiment of the present invention.

[0079] In some embodiments of the present invention, the preset management center may be, for example, Nacos (Naming and Configuration Service, a dynamic service discovery, configuration management and service management platform that is easier to build cloud native applications), Eureka (a service discovery framework developed by Netflix), Zookeeper (a distributed, open source distributed application coordination service, an open source implementation of Google's Chubby, and an important component of Hadoop and Hbase). Optionally, the present invention preferably uses Nacos as the preset management center. It can be understood by those skilled in the art that Nacos is a word composed of the first letters of the name service (Naming Service, i.e., registration center) and the configuration service (Config Service, i.e., configuration center) (wherein the name service corresponds to the registration center in the embodiment of the present invention, and the configuration service corresponds to the configuration center in the embodiment of the present invention), which means that Nacos has two types of services: the name service and the configuration service.

[0080] In the embodiment of the present invention, Nacos is optimized to make full use of its persistent service health check mechanism (Nacos's persistent service mode adopts CP mode, which will be persistently stored in the disk. The health check adopts an active detection mechanism. When registering a permanent service, the Nacos responsible node starts a detection timer task, and the period is, for example, a random number within 2000 to 5000 milliseconds). The components are registered to its registration center. However, the registration center of Nacos itself is not sufficient to realize the aggregation of the routing information of the components. Therefore, in the embodiment of the invention, the routing information of the components is stored in the configuration center, and the pre-configured configuration center is deployed. A development toolkit is provided for obtaining routing information of components from a configuration center and implementing routing, so that the configuration center can provide dynamic publishing, querying, monitoring and other functions of component configuration data (for example, including basic configuration data and public configuration data, etc.). In an embodiment of the present invention, the configuration center function of Nacos is utilized, the persistent service health check mechanism of Nacos is fully utilized, the health check type of the registered instance is expanded according to the business logic, the health check detection protocol of the detection instance and the business logic of the health check are customized, and the basic configuration information across data centers, the public configuration information across data centers and the summarized component routing list are managed.

[0081] More specifically, the persistent service health check mechanism of the preset management center (for example, Nacos) is optimized so that it can manage the basic configuration information across data centers, the public configuration information across data centers, and the aggregated component routing list. On the one hand, the preset development toolkit is deployed in the configuration center (for example, the Java SDK (Java is an object-oriented programming language, and the full name of SDK is Software Development Kit) can be introduced on the basis of Nacos to realize the registration function of the microservices in the registration center of the preset management center, the microservice heartbeat maintenance, and the microservice call in the component, and finally realize the aggregation function of the routing information of the microservices in the component. For example, all its microservice calls can adopt the Http (Hypertext Transfer Protocol) 1.1 protocol and configure the keepalive (a mechanism in TCP that can detect dead connections) attribute; microservice registration and microservice heartbeat are performed by calling the Restful API (an architectural style of the application program interface (API) that uses HTTP requests to access or use data) of the preset management center (for example, Nacos).

[0082] Furthermore, in order to implement component routing and call microservices, load balancing is also required. In an embodiment of the present invention, a preset load balancing proxy (e.g., OpenResty proxy) is deployed in the data center. For example, by calling the local OpenResty proxy of the preset management center (a scalable Web platform implemented by extending NGINX with Lua), dynamic load balancing can be implemented through Lua scripts on NGINX, that is, microservice call requests can be load balanced through Lua scripts on NGINX, and the microservice call requests are sent to the called microservices based on routing, thereby finally implementing the call of the microservices.

[0083] The following is a brief description of the Java SDK (preset development kit) and OpenResty proxy (preset load balancing proxy) in the embodiment of the present invention. In the local (localhost) process deployed in the Java application (for example, the component managed by the preset management center), three specific contexts are created by calling the local OpenResty proxy of the preset management center to achieve:

[0084] (1) Receive the component routing list pushed by the unified registration center, which is processed by the Lua (a small scripting language) script. After parsing the received component routing list, it is stored in the form of key-value pairs in the shared dictionary of Nginx (a high-performance HTTP and reverse proxy web server that also provides IMAP / POP3 / SMTP services) to achieve synchronization of the component routing lists in the data center.

[0085] (2) The proxy microservice call uses Lua script to rewrite the proxy target and perform related service governance mechanisms:

[0086] 2-1. Parse the microservice address list from the component routing list in the Nginx shared dictionary;

[0087] 2-2. Select a single microservice address based on the load balancing algorithm;

[0088] 2-3. Record the information of this call in the Nginx shared dictionary (such as update statistics, source microservice name, target microservice name, call count, etc.);

[0089] 2-4. The log records the current call link information (such as the source microservice name, target microservice name, link ID (Identity document, identity identifier), etc.);

[0090] 2-5. Concatenate the request URL (uniform resource locator) according to the microservice address and execute the proxy.

[0091] (3) Metrics collection, implemented by Lua script, takes the information in 2-3 from the shared dictionary and presents it in string form (response information). By collecting OpenResty logs, link tracking and topology analysis can be achieved.

[0092] As an example, the data center in the embodiment of the present invention is, for example, a computer room, and the components are, for example, a payment system, a customer information system, a points system, a financial management system, and a marketing system deployed in the computer room. Microservice design can be adopted under each component, for example, there can be an account book service, a payment transaction service, a merchant management service, etc. in the payment system. A data center can deploy multiple systems, but for example, the payment system and the marketing system can be deployed in each data center (for example, deployed in data center B), while the points system is only deployed in data center A. If data center A and data center B both use container cloud, they are deployed in units of data centers. At this time, the IPs of data center A and data center B are both internal IPs of the container cloud, and they are not interoperable with each other. If the marketing system of data center B wants to call the points system of data center A, it needs to call across data centers, and it needs to perform address conversion on the marketing system of data center B through the gateway service interface of data center A, so as to realize the unified configuration and management of data center A and data center B, and then realize microservice management across data centers.

[0093] Under the deployment architecture of the aforementioned data center, preset management center, preset development toolkit and preset load balancing agent in the embodiment of the present invention, a processing method for cross-data center microservice management in the embodiment of the present invention will be introduced in detail in combination with specific drawings.

[0094] Figure 2 This is one of the flow charts of a processing method for cross-data center microservice management provided by an embodiment of the present invention.

[0095] Among them, the cross-data center includes more than two data centers, any data center includes at least one component, and any component includes a preset management center, a gateway service interface and more than one microservice, wherein the preset management center at least includes a registration center and a configuration center, all microservices in the component are registered with the registration center of the preset management center, and a preset development toolkit and a preset load balancing agent are set in the configuration center of the preset management center. The preset development toolkit is used to process the routing information of the components of any data center, and the preset load balancing agent is used for the data center to make cross-data center microservice calls, and the preset management center uniformly manages the components. The preset management center is provided with a persistent service health check mechanism for cross-data center microservice calls, and more than one microservice in the component is called through the gateway service interface.

[0096] like Figure 2 As shown, a method for processing microservice management across data centers may include the following steps:

[0097] Step 201, when adding a component to a data center, obtain basic configuration information of the component to be added, obtain first configuration data of the data center, and save it to the memory of the configuration center of the preset management center corresponding to the component to be added.

[0098] In the embodiment of the present invention, the first configuration data of the data center can be obtained based on the basic configuration information of the component to be added, the basic configuration information of other components originally stored in the data center, and the public configuration data of the data center originally stored, that is, the first configuration data at least includes the basic configuration information of the component to be added, the basic configuration information of other components originally stored, and the public configuration data of the data center originally stored. Then, the first configuration data is stored to store the basic configuration information of the component to be added.

[0099] Specifically, step 201 can call the component adding interface of the data center to obtain the basic configuration information of the component to be added, and then send the basic configuration information to the memory of the configuration center of the preset management center corresponding to the component to be added to store the basic configuration information. The basic configuration information can be, for example, component configuration information, specifically including component identification, component registration center address (registration center address where the component is registered) and user name and password, component gateway service interface name, etc.

[0100] In other embodiments, after sending the basic configuration information to the memory of the configuration center of the preset management center corresponding to the component to be added to store the basic configuration information, the first update number of the basic configuration information of the component to be added of the configuration center of the preset management center is updated, such as the first epoch.

[0101] In order to make the embodiments of the present invention clearer, Figure 3 The component adding process is explained through an example. When adding a new component in data center A, it can be completed through the following steps:

[0102] First, call the component adding interface of data center A to obtain the basic configuration information of the component;

[0103] Second, the basic configuration information of the component is stored in the configuration center of the preset management center;

[0104] Third, add a persistent service instance to access the component, so that you can use the persistent service instance to monitor the component regularly and obtain relevant data of the component in a timely manner (for example, changes in basic configuration information, component routing list, etc.);

[0105] Fourth, determine whether the first update number of the basic configuration information is empty, for example, whether the first epoch number is empty. If it is empty, proceed to step 5. If it is not empty, proceed to step 6.

[0106] Fifth, the first update number (e.g., the first epoch number) is set to 1;

[0107] Sixth, add 1 to the first update number (eg, the first epoch).

[0108] As another optional embodiment, after the first configuration data is stored, the update times of the first configuration data may be updated to identify the update status of the first configuration data.

[0109] Step 202: Determine the health status of the component to be added based on the basic configuration information to determine the health status of the microservice in the component to be added.

[0110] The basic configuration information includes the component identifier, the component registration center address (the registration center address where the component is registered), the user name and password, the component's gateway service interface name, etc. The component registration center address and the gateway service interface name in the basic configuration information can be used to access the component's registration center and the gateway service interface, and then obtain the service instance list from the gateway service interface. The service instance list includes the health status of the service instance, so that the health status of the component can be determined, thereby ensuring that all components in the data center are healthy components, providing support for microservice management. Specifically, if the service instance in the service instance list of the gateway service interface is identified as healthy, the component to be added is determined to be healthy. If the service instance in the service instance list is identified as unhealthy or the service instance list is empty, the component to be added is determined to be unhealthy.

[0111] As an optional embodiment of the present invention, based on the persistent service health check mechanism of the preset management center, the health status of the components managed by the data center can be queried regularly. When any component is determined to be unhealthy, the unhealthy component information (for example, the basic configuration information of the component, routing information, etc.) is deleted from the component routing list, and the component information in the configuration center of the preset management center corresponding to the component is updated. Adding stages and maintenance nodes both increase component health checks to provide protection for healthy components in the data center.

[0112] by Figure 4 Taking the health check of components as an example, it can be achieved through the following steps:

[0113] First, call the registration center of the preset management center to which the component belongs to query the service instance list of the gateway service interface;

[0114] Second, determine whether a healthy instance is included according to the service health status identifier in the service instance list;

[0115] Third, if a healthy instance is included and the component is determined to be in a healthy state, then proceed to step 203;

[0116] Fourth, if there is no healthy instance or the service instance list is empty, the component is determined to be in an unhealthy state, and the component routing information of the configuration center of the preset management center is deleted.

[0117] As an optional embodiment, the determination of the component health status in the embodiment of the present invention can also be implemented through Zookeeper and Eureka, and the component health status can also be determined by the health status of the entire service, rather than being limited to the service instance of the gateway service.

[0118] Step 203: When it is determined that the component to be added is healthy, the routing information of the component to be added is obtained. The routing information of the component to be added includes the routing data of all microservices in the component to be added.

[0119] In this step, if the component is determined to be healthy, the current component can be added to the healthy component routing list of the current data center and written to the configuration center of the preset management center to achieve unified management of the components.

[0120] Step 204, adding the routing information of the component to be added to the original component routing information of the data center to obtain a first component routing list.

[0121] In the embodiment of the present invention, the processing of routing information by the data center may include two parts:

[0122] First, it processes the routing information of the components it manages. Specifically:

[0123] For any data center, it can query the configuration center to obtain the routing information of its self-managed components, and summarize the routing information of all components into a component routing list, which can include the routing information of all components under the data center, and the summarized routing information list can identify the routing information of healthy components. In some embodiments, after completing the aggregation of the routing information of its self-managed components, a hash value representing the number of times the routing information is updated can be generated synchronously, such as an MD5 (Message Digest Algorithm MD5) value. When all component service instances in a data center are abnormal, the abnormal component will be deleted from the routing information list, and a new routing information list and MD5 value of the content will be generated.

[0124] Secondly, it is the processing of routing information of components in other data centers. Specifically:

[0125] In order to enable cross-data center microservice calls between multiple data centers, the routing information of components between multiple data centers can be synchronized regularly based on the persistent service health check mechanism of the preset configuration management center and summarized into a component routing list, such as the first component routing list, which can include the routing information of all components in any data center and other data centers managed by it. At the same time, the MD5 value of the first component routing list is also generated to determine the update status of the first component routing list.

[0126] In an embodiment of the present invention, when a new component is added, a routing information list of the component self-managed by the data center is first generated, and then the routing information list is aggregated with the original first component routing list managed by it to obtain a new first component routing list, which adds the routing information of the newly added component.

[0127] Step 205: Send the first component routing list to the component to be added, so as to be stored in the memory of the configuration center of the preset management center corresponding to the component to be added.

[0128] The aggregated first component routing list is stored in the configuration center. In some embodiments, the data center can query the stored first component routing list in the configuration center to determine whether the Md5 value of the first component routing list content is consistent with the Md5 value of the first component routing list content that was last sent to the configuration center where the component is located. If they are consistent, it means that the latest first component routing list of the component has been sent, and this round of tasks is ended; if they are inconsistent, it means that the first component routing list has changed, and the configuration publishing interface of the configuration center where the component is located is called to publish the latest first component routing list to the configuration center where the component is located. After the configuration publishing interface responds to the successful release, the Md5 value of the latest first component routing list content is recorded in the metadata of the current component instance, which is used for the next round of tasks to determine whether the latest first component routing list of the component has been sent. However, if the configuration publishing interface fails to respond to the release, it means that the configuration center to which the component belongs is currently abnormal or the network fluctuates, and no additional processing is required, waiting for the next round of tasks to be processed again.

[0129] For example, Data Center A updates the MD5 value of the first component routing list and its content (assuming it is called the first MD5) due to the addition of a new component. When Data Center A sends the updated first component routing list to each component, it first obtains the MD5 value of the previous first component routing list content (assuming it is called the second MD5) from the configuration center of the component's preset management center, and determines whether the first MD5 and the second MD5 are the same. If they are not the same, the configuration publishing interface of the configuration center where the component is located is called to publish the latest first component routing list to the configuration center where the component is located.

[0130] Step 206, when any data center initiates a health check to other data centers through the persistent service health check mechanism, the second configuration data and the second component routing list of other data centers are obtained and stored.

[0131] Among them, the second configuration data at least includes the basic configuration information of all components managed by other data centers and the public configuration data of other data centers, and the second component routing list at least includes the routing information of all components managed by other data centers. It is understandable that other data centers will also initiate a health check to any data center based on the persistent service health check mechanism, so as to obtain the configuration data and component routing list of the data center. And the configuration data and component routing list of other data centers obtained can be stored in the configuration center of the preset management center corresponding to the component that initiates the health check in the data center. In this way, the synchronization and sharing of configuration data and component routing lists between data centers are realized.

[0132] Step 207, when a microservice is called in the data center, the target microservice is called based on the first configuration data and the first component routing list of the data center, the second configuration data and the second component routing list of other data centers to which the target microservice called by the data center belongs.

[0133] As mentioned above, in addition to managing its own self-managed components, any data center also needs to maintain and manage other data centers. In this step, if the data center makes a microservice call (for example, the payment system in data center A calls the merchant management service in data center B, or the payment system in data center A calls its internal merchant management service), in addition to combining the configuration data of its own self-managed components, it may also need to combine the configuration data of other data centers it maintains and manages.

[0134] Specifically, it can be implemented as follows: when a microservice call is made in the data center, the second configuration data and the second component routing list of other data centers to which the target microservice called by the data center belongs are obtained, and based on the second configuration data and the first configuration data, it is determined whether the data center and the other data center to which the target microservice called by the data center belongs are the same data center; when it is determined that they are not the same data center, a persistent service instance that communicates with the other data center to which the target microservice called by the data center belongs is added to add the second configuration data and the second component routing list.

[0135] Further, add a persistent service instance that communicates with other data centers to which the target microservice called by the data center belongs, so as to add the second configuration data and the second component routing list, which is specifically implemented as follows: add a first persistent service instance that communicates with other data centers to which the target microservice called by the data center belongs, so as to aggregate the second component routing list and the first component routing list into a third component routing list, and save the first hash value generated corresponding to the second component routing list, add a second persistent service instance that communicates with other data centers to which the target microservice called by the data center belongs, so as to obtain the basic configuration data of other data centers to which the target microservice called by the data center belongs, and save the second update number corresponding to the basic configuration data of the data center, add a third persistent service instance that communicates with other data centers to which the target microservice called by the data center belongs, so as to obtain the public configuration data, and save the third update number of the public configuration data. Among them, the second component routing list includes the routing information of all healthy components managed by other data centers to which the target microservice called by the data center belongs, and the third component routing list identifies the routing information of the healthy components of each data center; the basic configuration data of the data center includes the data center identifier, the data center domain name and the data center access address; the public configuration data includes the configuration center address, port and type of the preset management center of the component where the target microservice is located.

[0136] For example, Figure 5 As shown in the figure, data center A accesses the services of data center B through the following steps:

[0137] First, add the component routing lists, basic configuration data, and public configuration data of data centers A and B to data center A.

[0138] Second, the new data center interface of data center A can be called to pass in the basic configuration data such as the access address and data center identifier of data center A and data center B. Data center A will save the basic configuration data of data center A and data center B to the configuration center of the corresponding component (for example, if component C1 in data center A accesses service a1 in data center B, the basic configuration data will be saved to the configuration center of the preset management center of the corresponding component C1);

[0139] Third, based on the data center identifier of the basic configuration data, determine whether it is the basic configuration data of data center A; if it is not data center A, execute steps 4 to 6; if it is data center A, execute step 7.

[0140] Fourth, if it is not the basic configuration data of the current data center A, but the basic configuration data of data center B, then add three persistent service instances for communication with data center B;

[0141] Fifth, based on the persistent service health check mechanism of the persistent service instance, it is expanded to synchronize the basic configuration data backup task of data center B, synchronize the second component routing list of data center B, and synchronize the public configuration data of data center B (such as global component public configuration data);

[0142] Sixth, update the corresponding update times of the basic configuration data of data center B, the second component routing list of data center B, and the public configuration data of data center B (such as global component public configuration data) in the configuration center of data center A;

[0143] After completing the basic configuration data backup, the addition of the second component routing list, and the synchronization of the public configuration data of data center B, the update number of data center A is updated. For example, after completing the addition of the second component routing list, the first hash value of its content (for example, the MD5 value of its content) is updated. After completing the basic configuration data backup of data center B, the second update number (for example, the epoch) is updated. If the second update number already exists, the second update number is increased by 1. If it does not exist, the second update number is set to 1 and saved to the configuration center of the preset management center of data center A. Similarly, after completing the synchronization of the public configuration data of data center B, the third update number (for example, the epoch) is updated. If the third update number already exists, the second update number is increased by 1. If it does not exist, the third update number is set to 1 and saved to the configuration center of the preset management center of data center A.

[0144] Seventh, if it is determined that it is the basic configuration data of the current data center A, a persistent service instance needs to be added. According to the persistent service health check mechanism, it is expanded to a task of periodically aggregating routing information of components in multiple data centers to periodically aggregate routing information of components in data center A.

[0145] In order to ensure that each data center can store the latest basic configuration data, component routing lists, and public configuration data of multiple data centers, according to the persistent service health check mechanism configured by the preset management center, any data center will periodically initiate health checks on other data centers. Figures 6 to 8 The embodiments shown are, by way of example:

[0146] In one embodiment of the present invention, the basic configuration data of each data center may include, for example, basic configuration data (such as data center identification, data center domain name, data center access address, etc.) and its self-managed component configuration information (such as component identification, registration center address and user name and password for component registration, component gateway service interface name, etc.), and the basic configuration data has its corresponding update number (epoch number). When the basic information or component configuration information in the basic configuration data of the data center changes, the update number (epoch number) will increase. Based on this, each data center can be used to manage the basic configuration data of itself and other data centers. Specifically, Figure 6 As shown, in the case where a data center initiates a health check on other data centers, the management of basic configuration data of other data centers by any data center may include the following steps:

[0147] First, call the basic configuration verification interface of other data centers to which the target microservice belongs (or the basic configuration verification interface of other data centers that the data center wants to manage) to obtain the fourth current update number of the basic configuration data of the data center;

[0148] Second, when it is determined that the fourth update number is less than the second update number, the originally stored basic configuration data of the data center is sent to the data center, so that the data center updates its basic configuration data;

[0149] Third, when it is determined that the fourth update number is greater than the second update number, the current basic configuration data of the data center is obtained.

[0150] The second update number is the update number of the basic configuration data originally stored in the data center, and the fourth update number is the current update number of the basic configuration data of the managed data center.

[0151] For example, when data center A performs a health check on the data center B it manages, data center A obtains the update count (second update count) of the basic configuration data of data center B stored locally as a parameter, and calls the basic configuration verification interface of data center B to compare it with the current update count (fourth update count) of data center B: if the second update count and the fourth update count are the same, it is determined that the basic configuration data of data center B backed up by data center A is the latest, and a configuration unchanged flag is directly returned; if the second update count is less than the fourth update count, it is determined that the basic configuration data of data center B has changed, and data center B compiles a copy of the latest basic configuration data and its update count and returns it to data center A. Data center A saves the latest basic configuration data of data center B received to the local configuration center; if the second update count is greater than the fourth update count, after determining that the configuration of data center B may be lost due to disk abnormalities, data center A sends its backed-up basic configuration data of data center B to data center B, so that data center B performs configuration recovery based on the basic configuration data of data center B backed up by data center A. In some embodiments, data center A can call the configuration backup recovery interface of data center B to restore the basic configuration data of data center B.

[0152] In one embodiment of the present invention, each data center will summarize the routing information of the healthy components of the current data center (including component names, component access addresses, etc.) to form a component routing list. When all component service instances in the data center are abnormal, the component routing list will delete the current component and generate a new component routing list and the MD5 value of the content. Based on this, each data center can be used to manage its own and other data center component routing lists, supporting cross-data center microservice management. Specifically, Figure 7 As shown, in the case where a data center initiates a health check on other data centers, the management of the component routing list of other data centers by any data center may include the following steps:

[0153] First, call the route summary information verification interface of other data centers to which the target microservice belongs (or the route summary information verification interface of other data centers that the data center wants to manage) to obtain the current second hash value of the second component route list of the data center;

[0154] Second, when it is determined that the first hash value is different from the second hash value, obtain the current component routing list of other data centers to which the target microservice belongs (or the current component routing list of other data centers that the data center wants to manage) to update the third component routing list and store the second hash value.

[0155] For example, assuming that the current data center A performs a health check on the data center B it manages, it will obtain the MD5 value of the component routing list of data center B stored locally as a parameter, call the routing summary information verification interface of data center B, and obtain the current MD5 value of the component routing list of data center B. If the current MD5 value of the component routing list of data center B is the same as the MD5 value of the component routing list of data center B stored in data center A, it is determined that the component routing list of data center B backed up by data center A is the latest, and the component routing list unchanged flag is directly returned; if the current MD5 value of the component routing list of data center B is different from the MD5 value of the component routing list of data center B stored in data center A, it is determined that the component routing list of data center B has changed, and the latest component routing list of data center B is returned to data center A. Data center A updates its locally stored component routing list and MD5 value of data center B based on the component routing list returned by data center B.

[0156] In one embodiment of the present invention, each data center stores common configuration data (eg, global component common configuration), and when a change occurs, the corresponding update times will also increase. Figure 8 FIG. 4 is a flowchart of a processing method for cross-data center microservice management provided by an embodiment of the present invention. Figure 8 As shown, any data center can manage the public configuration data of other data centers by referring to the following steps:

[0157] First, call the public configuration data verification interface of other data centers to which the target microservice belongs (or the public configuration data verification interface of other data centers that the data center wants to manage) to obtain the current fifth update number of the public configuration data of the data center;

[0158] Second, when it is determined that the fifth update number is less than the third update number, the originally stored public configuration data of the data center is sent to the data center, so that the data center updates its public configuration data;

[0159] Third, when it is determined that the fifth update number is greater than the third update number, the current public configuration data of the data center is obtained.

[0160] For example, when data center A performs a health check on data center B, which it manages, data center A will obtain the number of updates of the public configuration data of data center B stored locally as a parameter, and call the public configuration data verification interface of data center B to obtain the current number of updates of the public configuration data of data center B, and compare the number of updates of the public configuration data of data center B stored locally with the current number of updates of the public configuration data of data center B. If the number of updates of the public configuration data of data center B stored locally is less than the current number of updates of the public configuration data of data center B, it is determined that the public configuration data of data center B is the latest public configuration data, and the latest public configuration data of data center B and its corresponding update number are returned to data center A. Data center A updates the latest public configuration data and its corresponding update number to the local configuration center.

[0161] In summary, any data center in the embodiment of the present invention includes at least one component, and any component includes a preset management center, a gateway service interface and one or more microservices, wherein all microservices in the component are registered with the registration center of the preset management center, and the preset management center uniformly manages the component, and the preset management center is provided with a persistent service health check mechanism for microservices across data centers to call the management component through the data center. In this way, the component manages all its microservices through a unified preset management center, and calls the microservices through a unified gateway service interface, thereby realizing hierarchical management and unified configuration of microservices in cross-data center deployment scenarios. In addition, since each component has its own preset management center, the microservices it manages are All microservices of all components are registered with the preset management center instead of registering all microservices of all components with the data center, thereby reducing the network pressure and performance pressure of the data center and improving the robustness of cross-data center microservice management. When adding components in the data center, the health status of the components is determined to ensure that all components under the management of the data center are healthy and available. During the adding process, the component routing information is summarized in real time to form a unified component routing list, which is sent to the configuration center of the preset management center of the component, providing support for cross-data center microservice management. In the cross-data center microservice call, the microservice call is realized through the configuration data and component routing list managed in multiple data centers, realizing unified management and governance of microservices across data centers.

[0162] Correspondingly, an embodiment of the present invention further provides a processing device for cross-data center microservice management. The following is an introduction to a processing device for cross-data center microservice management according to an embodiment of the present invention with reference to the accompanying drawings.

[0163] Fig. 9It is a structural block diagram of a processing device for cross-data center microservice management provided by an embodiment of the present invention. Among them, the cross-data center includes more than two data centers, any data center includes at least one component, and any component includes a preset management center, a gateway service interface and more than one microservice, wherein the preset management center at least includes a registration center and a configuration center, and all microservices in the component are registered with the registration center of the preset management center, and a preset development toolkit and a preset load balancing agent are set in the configuration center of the preset management center. The preset development toolkit is used to process the routing information of the component of any data center, and the preset load balancing agent is used for the data center to make cross-data center microservice calls, and the preset management center uniformly manages the components, and the preset management center is provided with a persistent service health check mechanism for cross-data center microservice calls, and more than one microservice in the component is called through the gateway service interface.

[0164] like Fig. 9 As shown, a processing device 900 for cross-data center microservice management may include:

[0165] A first acquisition module 901 is used to acquire basic configuration information of the component to be added, obtain first configuration data of the data center, and save it to the memory of the configuration center of the preset management center corresponding to the component to be added, when adding a component in the data center, wherein the first configuration data at least includes the basic configuration information of the component to be added, the basic configuration information of other components originally stored, and the public configuration data of the data center originally stored;

[0166] A determination module 902 is used to determine the health status of the component to be added based on the basic configuration information, so as to determine the health status of the microservice in the component to be added;

[0167] The second acquisition module 903 is used to acquire routing information of the component to be added when it is determined that the component to be added is healthy, wherein the routing information of the component to be added includes routing data of all microservices in the component to be added;

[0168] A routing adding module 904, configured to add the routing information of the component to be added to the original routing information of the component in the data center to obtain a first component routing list;

[0169] A sending module 905, configured to send the first component routing list to the component to be added, so as to save the list in the memory of the configuration center of the preset management center corresponding to the component to be added;

[0170] A third acquisition module 906 is used to acquire and store the second configuration data and the second component routing list of the other data center when any data center initiates a health check to the other data center through the persistent service health check mechanism, wherein the second configuration data at least includes the basic configuration information of all components managed by the other data center and the public configuration data of the other data center, and the second component routing list at least includes the routing information of all components managed by the other data center;

[0171] The service calling module 907 is used to call the target microservice based on the first configuration data and the first component routing list of the data center, the second configuration data and the second component routing list of other data centers to which the target microservice called by the data center belongs, when a microservice call is made in the data center.

[0172] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0173] In summary, any data center in the embodiment of the present invention includes at least one component, and any component includes a preset management center, a gateway service interface and one or more microservices, wherein all microservices in the component are registered with the registration center of the preset management center, and the preset management center uniformly manages the component, and the preset management center is provided with a persistent service health check mechanism for microservices across data centers to call the management component through the data center. In this way, the component manages all its microservices through a unified preset management center, and calls the microservices through a unified gateway service interface, thereby realizing hierarchical management and unified configuration of microservices in cross-data center deployment scenarios. In addition, since each component has its own preset management center, the microservices it manages are All microservices of all components are registered with the preset management center instead of registering all microservices of all components with the data center, thereby reducing the network pressure and performance pressure of the data center and improving the robustness of cross-data center microservice management. When adding components in the data center, the health status of the components is determined to ensure that all components under the management of the data center are healthy and available. During the adding process, the component routing information is summarized in real time to form a unified component routing list, which is sent to the configuration center of the preset management center of the component, providing support for cross-data center microservice management. In the cross-data center microservice call, the microservice call is realized through the configuration data and component routing list managed in multiple data centers, realizing unified management and governance of microservices across data centers.

[0174] The embodiment of the present invention further provides a computer readable storage medium 1000, such as Fig.10 As shown, a computer program is stored in the computer-readable storage medium 1000, i.e., a program code 1001 for executing each step in the method embodiment of the present invention. When the computer program is executed by the processor, each step of the processing method for cross-data center microservice management is implemented. For example, when the computer program is executed by the processor, the following steps are implemented:

[0175] In the case of adding a component in the data center, basic configuration information of the component to be added is obtained to obtain first configuration data of the data center, and the first configuration data is saved in the memory of the configuration center of the preset management center corresponding to the component to be added, wherein the first configuration data at least includes the basic configuration information of the component to be added, the basic configuration information of other components originally stored, and the public configuration data of the data center originally stored;

[0176] Based on the basic configuration information, determine the health status of the component to be added to determine the health status of the microservice in the component to be added;

[0177] When it is determined that the component to be added is healthy, obtaining routing information of the component to be added, where the routing information of the component to be added includes routing data of all microservices in the component to be added;

[0178] Add the routing information of the component to be added to the original component routing information of the data center to obtain a first component routing list;

[0179] Sending the first component routing list to the component to be added, so as to save it in the memory of the configuration center of the preset management center corresponding to the component to be added;

[0180] In the case where any data center initiates a health check to other data centers through the persistent service health check mechanism, obtain and store the second configuration data and the second component routing list of the other data centers, wherein the second configuration data at least includes the basic configuration information of all components managed by the other data centers and the public configuration data of the other data centers, and the second component routing list at least includes the routing information of all components managed by the other data centers;

[0181] When a microservice call is made in the data center, the target microservice is called based on the first configuration data and the first component routing list of the data center, the second configuration data and the second component routing list of other data centers to which the target microservice called by the data center belongs.

[0182] In some embodiments, the storage medium is further configured to store program code 1001 for performing the following steps:

[0183] In the case of adding a component in the data center, basic configuration information of the component to be added is obtained to obtain first configuration data of the data center, and the first configuration data is saved in the memory of the configuration center of the preset management center corresponding to the component to be added, wherein the first configuration data at least includes the basic configuration information of the component to be added, the basic configuration information of other components originally stored, and the public configuration data of the data center originally stored;

[0184] Based on the basic configuration information, determine the health status of the component to be added to determine the health status of the microservice in the component to be added;

[0185] When it is determined that the component to be added is healthy, obtaining routing information of the component to be added, where the routing information of the component to be added includes routing data of all microservices in the component to be added;

[0186] Add the routing information of the component to be added to the original component routing information of the data center to obtain a first component routing list;

[0187] Sending the first component routing list to the component to be added, so as to save it in the memory of the configuration center of the preset management center corresponding to the component to be added;

[0188] In the case where any data center initiates a health check to other data centers through the persistent service health check mechanism, obtain and store the second configuration data and the second component routing list of the other data centers, wherein the second configuration data at least includes the basic configuration information of all components managed by the other data centers and the public configuration data of the other data centers, and the second component routing list at least includes the routing information of all components managed by the other data centers;

[0189] When a microservice call is made in the data center, the target microservice is called based on the first configuration data and the first component routing list of the data center, the second configuration data and the second component routing list of other data centers to which the target microservice called by the data center belongs.

[0190] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. Of course, there are other forms of readable storage media, such as quantum memory, graphene memory, etc. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media does not include electrical carrier signals and telecommunication signals.

[0191] The embodiment of the present invention further provides an electronic device 1100, such as Fig.11As shown, it includes one or more processors 1101 , a communication interface 1102 , a memory 1103 and a communication bus 1104 , wherein the processor 1101 , the communication interface 1102 , and the memory 1103 communicate with each other via the communication bus 1104 .

[0192] Memory 1103, used for storing computer programs;

[0193] The processor 1101 is used to implement the steps of the above-mentioned processing method for cross-data center microservice management when executing the program stored in the memory 1103. For example, the processor 1101 implements the following steps when executing the program stored in the memory 1103:

[0194] In the case of adding a component in the data center, basic configuration information of the component to be added is obtained to obtain first configuration data of the data center, and the first configuration data is saved in the memory of the configuration center of the preset management center corresponding to the component to be added, wherein the first configuration data at least includes the basic configuration information of the component to be added, the basic configuration information of other components originally stored, and the public configuration data of the data center originally stored;

[0195] Based on the basic configuration information, determine the health status of the component to be added to determine the health status of the microservice in the component to be added;

[0196] When it is determined that the component to be added is healthy, obtaining routing information of the component to be added, where the routing information of the component to be added includes routing data of all microservices in the component to be added;

[0197] Add the routing information of the component to be added to the original component routing information of the data center to obtain a first component routing list;

[0198] Sending the first component routing list to the component to be added, so as to save it in the memory of the configuration center of the preset management center corresponding to the component to be added;

[0199] In the case where any data center initiates a health check to other data centers through the persistent service health check mechanism, obtain and store the second configuration data and the second component routing list of the other data centers, wherein the second configuration data at least includes the basic configuration information of all components managed by the other data centers and the public configuration data of the other data centers, and the second component routing list at least includes the routing information of all components managed by the other data centers;

[0200] In the case of a microservice call in the data center, based on the first configuration data and the first component routing list of the data center, the second configuration data and the second component routing list of other data centers to which the target microservice called by the data center belongs, the target microservice is called on other data centers.

[0201] Processor 1101 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0202] The memory 1103 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 303 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. Where appropriate, the memory 1103 may include a removable or non-removable (or fixed) medium. In a particular embodiment, the memory 1103 is a non-volatile solid-state memory. In a particular embodiment, the memory 1103 includes a read-only memory (ROM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically rewritable ROM (EAROM) or a flash memory or a combination of two or more of these.

[0203] Communication bus 1104 includes hardware, software or both, for coupling the above-mentioned components to each other. For example, the bus may include accelerated graphics port (AGP) or other graphics bus, enhanced industry standard architecture (EISA) bus, front side bus (FSB), hypertransport (HT) interconnection, industry standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, the bus may include one or more buses. Although the embodiment of the present invention describes and shows a specific bus, the present invention considers any suitable bus or interconnection.

[0204] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0205] Although the present application provides method operation steps such as embodiments or flow charts, more or fewer operation steps may be included based on conventional or non-creative labor. The order of steps listed in the embodiments is only one way of executing the order of many steps and does not represent the only execution order. When the actual device or client product is executed, it can be executed in the order of the method shown in the embodiments or the drawings or in parallel (for example, in a parallel processor or multi-threaded processing environment).

[0206] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks 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.

[0207] 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.

[0208] 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.

[0209] The present invention uses specific embodiments to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A processing method for microservice management across data centers, characterized in that: The method is applied to any one of the data centers, comprising: In the case of adding a component in the data center, basic configuration information of the component to be added is obtained to obtain first configuration data of the data center, and the first configuration data is saved in the memory of the configuration center of the preset management center corresponding to the component to be added, wherein the first configuration data at least includes the basic configuration information of the component to be added, the basic configuration information of other components originally stored, and the public configuration data of the data center originally stored; Based on the basic configuration information, determine the health status of the component to be added to determine the health status of the microservice in the component to be added; When it is determined that the component to be added is healthy, obtaining routing information of the component to be added, where the routing information of the component to be added includes routing data of all microservices in the component to be added; Add the routing information of the component to be added to the original component routing information of the data center to obtain a first component routing list; Sending the first component routing list to the component to be added, so as to save it in the memory of the configuration center of the preset management center corresponding to the component to be added; When it is determined, based on the data center identifier of the basic configuration data in any one of the data centers, that the basic configuration data is not the basic configuration data of any one of the data centers, but is the basic configuration data of any other data center, the any one of the data centers is used to initiate a health check to the any other data center through a persistent service health check mechanism, and obtain and store the second configuration data and the second component routing list of the any other data center, wherein the second configuration data at least includes the basic configuration information of all components managed by the any one of the other data centers and the public configuration data of the any one of the other data centers, and the second component routing list at least includes the routing information of all components managed by the any one of the other data centers; When a microservice call is made in the data center, the target microservice is called based on the first configuration data and the first component routing list of the data center, the second configuration data and the second component routing list of other data centers to which the target microservice called by the data center belongs.

2. The method according to claim 1, characterized in that In the case of adding a component in the data center, obtaining basic configuration information of the component to be added, obtaining first configuration data of the data center, and saving it to the memory of the configuration center of the preset management center corresponding to the component to be added, including: When adding a component in the data center, basic configuration information of the component to be added is obtained by calling a component adding interface; Obtaining first configuration data of the data center based on basic configuration information of the component to be added, basic configuration information of other components originally stored in the data center, and originally stored public configuration data of the data center; The first configuration data is sent to the memory of the configuration center of the preset management center corresponding to the component to be added, so as to store the first configuration data.

3. The method according to claim 2, characterized in that The method further comprises: After sending the first configuration data to the memory of the configuration center of the preset management center corresponding to the component to be added to store the first configuration data, updating the first update number of basic configuration information of the component to be added in the configuration center of the preset management center.

4. The method according to claim 1, characterized in that The determining, based on the basic configuration information, the health status of the component to be added includes: Obtain a service instance list of the gateway service interface of the component to be added through the component registration center address and the gateway service interface name in the basic configuration information, wherein the component registration center address is the address of the registration center of the component to be added in its corresponding preset management center; In a case where a service instance in the service instance list of the gateway service interface is identified as healthy, determining that the component to be added is healthy; When the service instance identifier in the service instance list is unhealthy or the service instance list is empty, it is determined that the component to be added is unhealthy.

5. The method according to claim 1 or 3, characterized in that: The method further comprises: When any component is determined to be unhealthy, the unhealthy component information is deleted from the component routing list, and the component information in the configuration center of the preset management center corresponding to the component is updated.

6. The method according to claim 1, characterized in that The calling of the target microservice based on the first configuration data and the first component routing list of the data center, the second configuration data and the second component routing list of other data centers to which the target microservice called by the data center belongs, comprises: When the data center makes a microservice call, obtaining second configuration data and a second component routing list of other data centers to which the target microservice called by the data center belongs; Determine, according to the second configuration data and the first configuration data, whether the data center and other data centers to which the target microservice it calls belongs are the same data center; When it is determined that they are not in the same data center, a persistent service instance is added that communicates with other data centers to which the target microservice called by the data center belongs, so as to add second configuration data and a second component routing list.

7. The method according to claim 6, characterized in that The adding of a persistent service instance that communicates with other data centers to which the target microservice called by the data center belongs, so as to add second configuration data and a second component routing list, includes: Add a first persistent service instance that communicates with other data centers to which the target microservice called by the data center belongs, so as to aggregate the second component routing list and the first component routing list into a third component routing list, and save the first hash value generated corresponding to the second component routing list; Add a second persistent service instance that communicates with other data centers to which the target microservice called by the data center belongs, to obtain basic configuration data of other data centers to which the target microservice called by the data center belongs, and save a second update number corresponding to the basic configuration data of the data center; Adding a third persistent service instance that communicates with other data centers to which the target microservice called by the data center belongs to obtain common configuration data and save a third update number of the common configuration data; Among them, the second component routing list includes the routing information of all healthy components managed by other data centers to which the target microservice called by the data center belongs, and the third component routing list identifies the routing information of the healthy components of each data center; the basic configuration data of the data center includes the data center identifier, data center domain name and data center access address; the public configuration data includes the configuration center address, port and type of the preset management center of the component where the target microservice is located.

8. The method according to claim 7, characterized in that The method further includes the following steps performed when the data center initiates a health check on other data centers to which the target microservice called by the data center belongs: Calling the route summary information verification interface of other data centers to which the target microservice belongs to obtain the current second hash value of the second component route list of the data center; When it is determined that the first hash value is different from the second hash value, obtain the current component routing list of other data centers to which the target microservice belongs to update the third component routing list, and store the second hash value; Calling the basic configuration verification interface of other data centers to which the target microservice belongs, to obtain the fourth current update number of the basic configuration data of other data centers to which the target microservice belongs; When it is determined that the fourth update number is less than the second update number, the originally stored basic configuration data of other data centers to which the target microservice belongs is sent to the data center, so that the data center updates its basic configuration data; When it is determined that the fourth update number is greater than the second update number, obtaining current basic configuration data of other data centers to which the target microservice belongs; Calling the public configuration data verification interface of other data centers to which the target microservice belongs to obtain the fifth current update number of the public configuration data of other data centers to which the target microservice belongs; When it is determined that the fifth update number is less than the third update number, the public configuration data of other data centers to which the target microservice belongs that is originally stored is sent to the data center, so that the data center updates its public configuration data; When it is determined that the fifth update number is greater than the third update number, current public configuration data of other data centers to which the target microservice belongs is obtained.

9. The method according to claim 8, characterized in that The method further comprises: When it is determined that the first hash value is the same as the second hash value, determine that the second component routing list of the other data center to which the target microservice currently stored locally is the latest component routing list, and return a component routing not updated flag; When it is determined that the fourth update number is equal to the second update number, determining that the basic configuration data of the other data center to which the target microservice currently stored locally is the latest basic configuration data, and returning a basic configuration not updated flag; When it is determined that the fifth update number is equal to the third update number, it is determined that the public configuration data of other data centers to which the target microservice currently stored locally is the latest public configuration data, and a public configuration not updated flag is returned.

10. A processing device for microservice management across data centers, characterized in that: The device is applied to any one of the data centers, including: A first acquisition module is used to acquire basic configuration information of the component to be added when adding a component in the data center, obtain first configuration data of the data center, and save it to the memory of the configuration center of the preset management center corresponding to the component to be added, wherein the first configuration data at least includes the basic configuration information of the component to be added, the basic configuration information of other components originally stored, and the public configuration data of the data center originally stored; A determination module, used to determine the health status of the component to be added based on the basic configuration information, so as to determine the health status of the microservice in the component to be added; A second acquisition module is used to acquire routing information of the component to be added when it is determined that the component to be added is healthy, wherein the routing information of the component to be added includes routing data of all microservices in the component to be added; A routing adding module, used to add the routing information of the component to be added to the original component routing information of the data center to obtain a first component routing list; A sending module, used for sending the first component routing list to the component to be added, so as to save it in the memory of the configuration center of the preset management center corresponding to the component to be added; A third acquisition module is used for, when it is determined according to the data center identifier of the basic configuration data in the any data center that the basic configuration data is not the basic configuration data of the any data center, but is the basic configuration data of any other data center, to initiate a health check to the any other data center through a persistent service health check mechanism by using the any data center, to obtain and store the second configuration data and the second component routing list of the any other data center, wherein the second configuration data at least includes the basic configuration information of all components managed by the any other data center and the public configuration data of the any other data center, and the second component routing list at least includes the routing information of all components managed by the any other data center; The service calling module is used to call the target microservice based on the first configuration data and the first component routing list of the data center, the second configuration data and the second component routing list of other data centers to which the target microservice called by the data center belongs, when a microservice call is made in the data center.