Microservice-based configuration data processing method and device, equipment and storage medium

Through the console, the synchronization of the rules and configuration data of microservices is managed uniformly, the resource consumption problem caused by the push of traffic governance rules in the microservice architecture is solved, and efficient traffic governance rules synchronization and resource maintenance savings are achieved.

CN120342830APending Publication Date: 2025-07-18ANHUI YILU WEIHANG TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510774837.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-11
Publication Date
2025-07-18

AI Technical Summary

Technical Problem

In the microservice architecture, the existing technology pushes traffic governance rules to each microservice deployment traffic governance client through the configuration center, resulting in a large amount of maintenance resources.

Method used

Manage multiple microservices through the console, determine the target rule configuration data applicable to the target microservice, and synchronize the target rule configuration data according to the interface information of the traffic governance client, reducing the independent deployment and maintenance of each microservice.

Benefits of technology

The synchronization of unified rules and configuration data for multiple microservices is realized, reducing maintenance resource consumption and improving synchronization efficiency and stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120342830A_ABST
    Figure CN120342830A_ABST
Patent Text Reader

Abstract

The invention relates to a micro-service-based configuration data processing method and device, equipment and a storage medium. The method comprises the steps of determining target rule configuration data applicable to a target micro-service in response to the achievement of a synchronous triggering condition of the target micro-service in a plurality of micro-services managed by a console; determining interface information corresponding to a plurality of traffic management clients registered in a console by the target micro-service; the target micro-service is deployed with a plurality of service instances, and each traffic management client is integrated in one of the plurality of service instances; according to the interface information corresponding to the plurality of traffic management clients, calling data synchronization interfaces corresponding to the plurality of traffic management clients, so as to synchronize target rule configuration data to the plurality of traffic management clients; and each traffic management client is used for performing traffic management on the service instance according to the traffic management rule represented by the target rule configuration data. By adopting the method, the maintenance resource consumption can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of microservices, and in particular, to a method, apparatus, device, and storage medium for processing configuration data based on microservices. Background Art

[0002] With the development of computer technology, a microservices architecture has emerged. The microservices architecture is an architecture that splits a monolithic application into several small services to collaboratively complete system functions. In the microservices architecture, multiple microservices are loosely coupled and can be independently autonomous. Compared with traditional monolithic applications, the flexibility of project development is improved. However, since different microservices in the microservices architecture communicate through network calls to collaboratively complete system functions, the microservices architecture is prone to service unavailability due to traffic problems. Therefore, it is necessary to set up a traffic governance client in the microservices to perform traffic governance through the traffic governance client. Traffic governance can be achieved by executing traffic governance rules. Currently, in order to synchronize traffic governance rules to the traffic governance client, a configuration center is deployed in each microservice, and the configuration center pushes traffic governance rules to the traffic governance client set in the microservice where it is located.

[0003] However, the method of pushing traffic governance rules from the configuration center to the traffic governance client deployed in the microservice where it is located consumes a lot of maintenance resources. Summary of the Invention

[0004] Based on this, it is necessary to provide a method, apparatus, device, and storage medium for processing configuration data based on microservices that can reduce the consumption of maintenance resources for the above technical problems.

[0005] In a first aspect, the present application provides a method for processing configuration data based on microservices, including:

[0006] In response to the achievement of the synchronization trigger condition of the target microservice among the multiple microservices managed by the console, determining the target rule configuration data applicable to the target microservice;

[0007] Determining the interface information corresponding to each of the multiple traffic governance clients registered by the target microservice in the console; multiple service instances are deployed for the target microservice, and each traffic governance client is integrated into one of the multiple service instances;

[0008] According to the interface information corresponding to each of the multiple traffic governance clients, calling the data synchronization interfaces corresponding to each of the multiple traffic governance clients to synchronize the target rule configuration data to the multiple traffic governance clients; each traffic governance client is used to perform traffic governance on the service instance where it is located according to the traffic governance rule represented by the target rule configuration data.

[0009] In a second aspect, the present application further provides a device for processing configuration data of microservices, including:

[0010] A data management module, configured to determine target rule configuration data applicable to the target microservice in response to the achievement of the synchronization trigger condition of the target microservice among multiple microservices managed by the console; determine interface information corresponding to each of the multiple traffic governance clients registered for the target microservice in the console; the target microservice is deployed with multiple service instances, and each of the traffic governance clients is integrated into one of the multiple service instances;

[0011] A data synchronization module, configured to call the data synchronization interfaces corresponding to the multiple traffic governance clients respectively according to the interface information corresponding to the multiple traffic governance clients, so as to synchronize the target rule configuration data to the multiple traffic governance clients; each traffic governance client is configured to perform traffic governance on the service instance where it is located according to the traffic governance rules represented by the target rule configuration data.

[0012] In a third aspect, the present application further provides a computer device, including a memory and a processor, where the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0013] In response to the achievement of the synchronization trigger condition of the target microservice among multiple microservices managed by the console, determine the target rule configuration data applicable to the target microservice;

[0014] Determine interface information corresponding to each of the multiple traffic governance clients registered for the target microservice in the console; the target microservice is deployed with multiple service instances, and each of the traffic governance clients is integrated into one of the multiple service instances;

[0015] Call the data synchronization interfaces corresponding to the multiple traffic governance clients respectively according to the interface information corresponding to the multiple traffic governance clients, so as to synchronize the target rule configuration data to the multiple traffic governance clients; each traffic governance client is configured to perform traffic governance on the service instance where it is located according to the traffic governance rules represented by the target rule configuration data.

[0016] In a fourth aspect, the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0017] In response to the achievement of the synchronization trigger condition of the target microservice among multiple microservices managed by the console, determine the target rule configuration data applicable to the target microservice;

[0018] Determine the interface information corresponding to each of the multiple traffic governance clients registered for the target microservice in the console; the target microservice is deployed with multiple service instances, and each of the traffic governance clients is integrated into one of the multiple service instances;

[0019] According to the interface information corresponding to each of the multiple traffic governance clients, call the data synchronization interfaces corresponding to each of the multiple traffic governance clients to synchronize the target rule configuration data to the multiple traffic governance clients; each traffic governance client is used to perform traffic governance on the service instance where it is located according to the traffic governance rules represented by the target rule configuration data.

[0020] In a fifth aspect, the present application also provides a computer program product, including a computer program, which when executed by a processor implements the following steps:

[0021] In response to the synchronization trigger condition of the target microservice among the multiple microservices managed by the console being met, determine the target rule configuration data applicable to the target microservice;

[0022] Determine the interface information corresponding to each of the multiple traffic governance clients registered for the target microservice in the console; the target microservice is deployed with multiple service instances, and each of the traffic governance clients is integrated into one of the multiple service instances;

[0023] According to the interface information corresponding to each of the multiple traffic governance clients, call the data synchronization interfaces corresponding to each of the multiple traffic governance clients to synchronize the target rule configuration data to the multiple traffic governance clients; each traffic governance client is used to perform traffic governance on the service instance where it is located according to the traffic governance rules represented by the target rule configuration data.

[0024] The above-described microservice-based configuration data processing method, apparatus, device, and storage medium determine the target rule configuration data applicable to the target microservice when the synchronization trigger condition of the target microservice in multiple microservices is met, and then call the data synchronization interfaces corresponding to the multiple traffic governance clients registered in the console for the target microservice according to the interface information corresponding to each of the multiple traffic governance clients, so as to synchronize the target rule configuration data. In this way, it is possible to synchronize the target rule configuration data to the multiple traffic governance clients integrated in the multiple service instances deployed by the target microservice in a timely manner. The traffic governance client can perform traffic governance on the service instance where it is located by using the traffic governance rules represented by the target rule configuration data. Moreover, since the console can manage multiple microservices, when any microservice in the multiple microservices meets the synchronization trigger condition, the console can synchronize the rule configuration data to the multiple traffic governance clients registered for the microservice, that is, the console uniformly manages the synchronization of the rule configuration data of multiple microservices, eliminating the need to separately deploy a configuration center for each microservice and separately maintain each configuration center, reducing the consumption of maintenance resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following will briefly introduce the drawings required for use in the description of the embodiments of the present application or related technologies. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other related drawings can be obtained based on these drawings without creative efforts.

[0026] Figure 1 It is an application environment diagram of the microservice-based configuration data processing method in one embodiment;

[0027] Figure 2 It is a flowchart of the microservice-based configuration data processing method in one embodiment;

[0028] Figure 3 It is a flowchart of a rule configuration data synchronization process in one embodiment;

[0029] Figure 4 It is a flowchart of another rule configuration data synchronization process in one embodiment;

[0030] Figure 5 It is a flowchart of a traffic governance example process in one embodiment;

[0031] Figure 6 It is a block diagram of the structure of the microservice-based configuration data processing apparatus in one embodiment;

[0032] Figure 7 It is an internal structure diagram of a computer device in one embodiment. Specific Embodiments

[0033] To make the objectives, technical solutions and advantages of the present application more clear and understandable, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0034] It should be noted that the terms "first", "second", etc. used in the present application can be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "including" and "having" used in the present application and any variations thereof are intended to cover non-exclusive inclusion. The term "plurality" used in the present application refers to two or more.

[0035] The method for processing configuration data based on microservices provided by an embodiment of the present application can be applied to an application environment as Figure 1 shown. Among them, the console can run on the management server 102, and each of the multiple microservices can run on the business server 104. The business servers 104 where different microservices are located can be the same server or different servers. Multiple service instances can be deployed for each microservice, and each service instance can be integrated with a traffic governance client, and the traffic governance client can communicate with the console through the network. The management server 102 can be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. The business server 104 can be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.

[0036] Based on the application environment diagram as Figure 1 shown, the console running on the management server 102 can, in response to the achievement of the synchronization trigger condition of the target microservice among the multiple microservices managed by the console, determine the target rule configuration data applicable to the target microservice, determine the interface information corresponding to each of the multiple traffic governance clients registered in the console for the target microservice, and call the data synchronization interfaces corresponding to each of the multiple traffic governance clients according to the interface information corresponding to each of the multiple traffic governance clients, so as to synchronize the target rule configuration data to the multiple traffic governance clients running on the business server 104.

[0037] In an exemplary embodiment, as Figure 2 shown, a method for processing configuration data based on microservices is provided. Taking the method applied to the management server 102 in Figure 1 as an example, it includes the following steps 202 to 206. Among them:

[0038] Step 202: In response to the achievement of the synchronization trigger condition of the target microservice among multiple microservices managed by the console, determine the target rule configuration data applicable to the target microservice.

[0039] Among them, the console is used to manage multiple microservices. The console can provide functions related to traffic governance for microservices. Specifically, the console can configure and manage traffic governance rules for microservices, monitor key metrics related to traffic governance, and manage traffic governance clients integrated with service instances of microservices. Key metrics related to traffic governance include, for example, the number of requests per second, response time, concurrent thread count, system load, or others. The console can manage service instances where traffic governance clients are located through interactions with traffic governance clients.

[0040] Traffic governance is the process of controlling service traffic to ensure system stability and service availability. Traffic governance can specifically include traffic control, circuit breaker degradation, system protection, or others. Traffic control can prevent services from being overloaded by controlling the request processing volume per unit time. Circuit breaker degradation can dynamically break the service call chain based on real-time fault conditions to prevent cascading failures. System protection can actively discard traffic when system resources are on the verge of exhaustion through the dynamic feedback of the operating system, ensuring that the host does not crash. The operating system can dynamically feedback monitoring metrics such as CPU (Central Processing Unit) usage rate and service instance thread pool occupancy rate to judge the usage of system resources.

[0041] Multiple service instances can be deployed for a microservice. A service instance is an independent execution unit of a microservice during runtime. A service instance can include the complete code of the microservice and the dependent execution environment. Each service instance can provide the functions of the microservice and can independently process requests. Thus, by deploying multiple service instances, the single-point failure problem can be solved and load balancing can be achieved. The execution environment of a service instance can be, for example, a container or a virtual machine. A program process of the service instance can run in the execution environment, and a traffic governance client can be integrated within the program process of the service instance. For example, if the service instance is a Java program and the virtual machine is a JVM (Java Virtual Machine, an abstract computer for running Java programs), then the traffic governance client can be integrated within the program process of the service instance running in the JVM.

[0042] The traffic governance client is used to perform traffic governance on the service instance where it is located. The traffic governance client can be, for example, a Sentinel (a set of components for distributed service architectures open-sourced by Alibaba) client, a Hystrix (a component for distributed service architectures developed by Netflix) client, or others. The console can be, for example, a Sentinel console, a Hystrix console, or others. The console and the traffic governance client can be corresponding. For example, if the traffic governance client uses a Sentinel client, the console uses a Sentinel console.

[0043] The target microservice is the microservice among multiple microservices that meets the synchronous trigger condition. When the synchronous trigger condition is met, it can trigger the synchronization of rule configuration data to multiple traffic governance clients registered by the microservice in the console. When the synchronous time interval corresponding to the target microservice reaches the first preset duration, it can be determined that the synchronous trigger condition of the target microservice is met. The synchronous time interval corresponding to the target microservice is the time interval between the most recent synchronization time corresponding to the target microservice and the current time. The most recent synchronization time is the time of the most recent synchronization of rule configuration data to the traffic governance client registered by the target microservice in the console. The first preset duration can be, for example, 10 minutes, 20 minutes, or others. When a rule configuration trigger operation is performed on the target microservice, it can also be determined that the synchronous trigger condition of the target microservice is met. The rule configuration trigger operation is an operation that triggers the generation of rule configuration data.

[0044] The target rule configuration data is the rule configuration data applicable to the target microservice. The target rule configuration data can be the rule configuration data configured for the target microservice before the synchronous trigger condition is met. The rule configuration data includes various structured information. The rule configuration data can represent the logic of the traffic governance rule through the various structured information it includes. The rule configuration data can be represented in a data exchange format, such as JSON (JavaScript Object Notation), XML (eXtensible Markup Language), or others. The traffic governance client performs traffic governance on the service instance where it is located through the traffic governance rule represented by the rule configuration data. The traffic governance rule can include a traffic control rule, a circuit breaker and degradation rule, a system protection rule, or others.

[0045] When representing different types of traffic governance rules, the rule configuration data has different structured information. For the rule configuration data representing traffic control rules, the structured information may include resource name, threshold type, threshold, flow control mode, flow control effect, or others. The resource name is the identifier of the resource to which the rule applies. The threshold type may include QPS (Query Per Second, which can represent the number of requests allowed to pass through per second), the number of concurrent threads (which can represent the number of threads allowed to be processed simultaneously), or others. The threshold is the specific value of the threshold type. For example, QPS = 100 means that 100 requests are allowed to pass through per second. The flow control mode may include direct mode, association mode, link mode, or others. The flow control effect may include rapid failure, queuing and waiting, or others.

[0046] For the rule configuration data representing circuit breaker and degradation rules, the structured information may include resource name, circuit breaker strategy, threshold, circuit breaker duration, or others. The circuit breaker strategy may be slow call ratio, exception ratio, number of exceptions, or others. The threshold is the specific value adopted in the circuit breaker strategy. For the rule configuration data representing system protection rules, the structured information may include system rule type, trigger threshold, effect, or others. The system rule type such as system load, number of threads, CPU usage rate, or others. The trigger threshold corresponds to the system rule type. When the trigger threshold is reached, the system protection is triggered according to the configured effect. The effect is the behavior adopted when the system protection rule is triggered. For example, the system rule type can be CPU usage rate, the trigger threshold can be 0.9, and the effect can be that all requests fail rapidly. Then the system protection rule represented by this rule configuration data can be that when the CPU usage rate reaches 0.9, all newly incoming requests are rejected.

[0047] Exemplarily, the console running on the management server can obtain the target rule configuration data applicable to the target microservice from the pre-configured storage space of the console in response to the achievement of the synchronization trigger condition of the target microservice among the multiple microservices managed by the console.

[0048] Among them, the pre-configured storage space can be the memory of the running environment where the console is located, or a persistent storage service. The persistent storage service such as Redis (Remote Dictionary Server, an open-source key-value database written in ANSI C language, supporting networks, and can be based on memory or persistent, log-based), MySQL (a relational database that stores, retrieves, and manages data through Structured Query Language), MongoDB (a database based on distributed file storage), or others.

[0049] Step 204: Determine the interface information corresponding to each of the multiple traffic governance clients registered for the target microservice in the console; multiple service instances are deployed for the target microservice, and each traffic governance client is integrated into one of the multiple service instances.

[0050] Among them, the console can record the traffic governance clients registered for each of the multiple microservices in the console through a client list. After the service instance of the microservice is enabled, the traffic governance client integrated in the service instance can send a heartbeat request to the console at a preset time interval. The console can determine the activity status of the traffic governance client through the heartbeat request.

[0051] The preset time interval can be, for example, 1 second, 2 seconds, 10 seconds, or others. The heartbeat request can be sent in the form of a heartbeat packet. The heartbeat request can carry the IP address (Internet Protocol Address) of the service instance where the traffic governance client is located, the port number of the traffic governance client, and can also include the interface address. After receiving the heartbeat request, the console can determine whether the traffic governance client that sent the heartbeat request exists in the client list. If not, the traffic governance client can be added to the client list so that the traffic governance client is registered in the console.

[0052] The client list can include the interface information corresponding to each traffic governance client. The interface information is used to determine the data synchronization interface corresponding to the traffic governance client. The interface information can include the IP address of the traffic governance client, the port number of the traffic governance client, and the interface address. The interface address is a specific path for the function, such as the URL (Uniform Resource Locator) path for the function of receiving data.

[0053] Exemplarily, the console can obtain the client list, determine the multiple traffic governance clients registered for the target microservice in the console from the client list, and obtain the interface information corresponding to each of the determined multiple traffic governance clients.

[0054] Step 206: Call the data synchronization interfaces corresponding to each of the multiple traffic governance clients according to the interface information corresponding to each of the multiple traffic governance clients, so as to synchronize the target rule configuration data to the multiple traffic governance clients; each traffic governance client is used to perform traffic governance on the service instance where it is located according to the traffic governance rules represented by the target rule configuration data.

[0055] Among them, the data synchronization interface is an interface for transmitting rule configuration data. An interface is a protocol for communication and interaction between programs or systems.

[0056] Exemplarily, the console may call the data synchronization interfaces corresponding to multiple traffic governance clients respectively according to the interface information corresponding to each of the multiple traffic governance clients, and send the target rule configuration data to the corresponding traffic governance client through each data synchronization interface, so as to synchronize the target rule configuration data to the multiple traffic governance clients.

[0057] In one embodiment, each traffic governance client may receive the target rule configuration data, and store it in the memory of the service instance where it is located after parsing the target rule configuration data.

[0058] In the above configuration data processing method based on microservices, when the synchronization trigger condition of the target microservice in multiple microservices is met, the target rule configuration data applicable to the target microservice is determined, and then the data synchronization interfaces corresponding to multiple traffic governance clients registered by the target microservice in the console are called according to the interface information corresponding to each of them, so as to synchronize the target rule configuration data. In this way, it is possible to synchronize the target rule configuration data to multiple traffic governance clients integrated in multiple service instances deployed by the target microservice in a timely manner. The traffic governance client can perform traffic governance on the service instance where it is located by using the traffic governance rules represented by the target rule configuration data. Moreover, since the console can manage multiple microservices, when any microservice in multiple microservices meets the synchronization trigger condition, the console can synchronize the rule configuration data to multiple traffic governance clients registered by the microservice, that is, the console uniformly manages the synchronization of rule configuration data of multiple microservices, without separately deploying a configuration center for each microservice and without separately maintaining each configuration center, reducing the consumption of maintenance resources.

[0059] In an exemplary embodiment, the console stores the rule configuration data applicable to multiple microservices through a persistent storage service. Step 202 may include: in response to the synchronization time interval corresponding to the target microservice among the multiple microservices managed by the console reaching a first preset duration, determining that the synchronization trigger condition of the target microservice is met; the synchronization time interval is the time interval between the most recent synchronization time corresponding to the target microservice and the current time; the most recent synchronization time is the time when the rule configuration data was last synchronized to the traffic governance clients registered by the target microservice in the console; obtaining the target rule configuration data applicable to the target microservice from the persistent storage service.

[0060] Among them, this embodiment can be executed through the console. The user can configure rules for the microservices through the background management page corresponding to the console to form rule configuration data, and the console can transmit the rule configuration data to the persistent storage service for storage. In the persistent storage service, the corresponding relationship between each microservice and the rule configuration data applicable to the microservice can be stored. The most recent synchronization time can be the time when the console last called the data synchronization interface of the traffic governance client registered by the target microservice in the console. The first preset duration can be, for example, 10 minutes, 20 minutes, or others.

[0061] In this embodiment, since whenever the synchronization time interval corresponding to the target microservice among the multiple microservices managed by the console reaches the first preset duration, the target rule configuration data applicable to the target microservice is obtained from the persistent storage service, and then the target rule configuration data is synchronized to the traffic governance client registered by the target microservice in the console. Thus, for each microservice, every time the first preset duration elapses, the corresponding target rule configuration data in the persistent storage service is synchronized to the traffic governance client registered by the microservice in the console, and the rule configuration data synchronized to the traffic governance client can be accurately and stably obtained. When a synchronization failure occurs due to accidental problems such as network problems or duplicate interface information during a synchronization, it can be remedied in time.

[0062] In an exemplary embodiment, step 202 may further include: in response to a rule configuration trigger operation for the target microservice among the multiple microservices managed by the console, determining that the target microservice meets the synchronization trigger condition; determining the rule configuration data configured by the rule configuration trigger operation as the target rule configuration data applicable to the target microservice; the above method for processing configuration data based on microservices may further include: in response to a rule configuration trigger operation for the target microservice among the multiple microservices managed by the console, updating the rule configuration data configured by the rule configuration trigger operation to the persistent storage service corresponding to the target microservice.

[0063] Among them, this embodiment can be executed through the console. The rule configuration trigger operation is an operation that triggers the generation of rule configuration data. The rule configuration trigger operation can be an operation of submitting the configured rules in the background management page corresponding to the console. The user can perform rule configuration operations on any one of the multiple microservices through the background management page, and then, through the submission function key in the background management page, submit the rule configuration data generated by the rule configuration operation. Then, the rule configuration trigger operation can be a trigger operation on the submission function key. The rule configuration operation can be used to add, edit, or delete rule configuration data. When the rule configuration trigger operation is generated, the console can store the rule configuration data configured by the rule configuration trigger operation in the memory of the running environment and then synchronize it to the traffic governance client.

[0064] The rule configuration data configured by the rule configuration trigger operation can be understood as all the latest rule configuration data configured for the microservice through the background management page after the rule configuration trigger operation is triggered. The console can replace the rule configuration data historically stored for the target microservice in the persistent storage service with the rule configuration data configured by the rule configuration trigger operation to achieve an update. It can be understood that when a rule configuration trigger operation occurs, the step of determining that the target microservice meets the synchronization trigger condition and the step of updating the rule configuration data configured by the rule configuration trigger operation to the persistent storage service corresponding to the target microservice can be performed in parallel.

[0065] In this embodiment, when triggering a rule configuration trigger operation for a target microservice among multiple microservices managed by the console, the rule configuration data configured by the rule configuration trigger operation can be determined as the target rule configuration data applicable to the target microservice. Combining with subsequent steps, the configured rule configuration data can be synchronized to the corresponding traffic governance client in real time, and moreover, it can be updated to the persistent storage service in a timely manner to avoid requests for data loss due to console restart. Subsequently, when the synchronization time interval corresponding to the target microservice reaches the first preset duration, when synchronizing based on the rule configuration data stored in the persistent storage service, the synchronized data is also the latest rule configuration data, improving the accuracy of information transmission.

[0066] In one embodiment, refer to Figure 3 As shown in a schematic diagram of a rule configuration data synchronization process, the console can be a Sentinel console, the traffic governance client can be a Sentinel client, and the persistent storage service can be Redis. In this embodiment, the Sentinel console can respond to a rule configuration trigger operation for the target microservice, determine the rule configuration data configured by the rule configuration trigger operation as the target rule configuration data applicable to the target microservice, determine the interface information corresponding to each of the multiple Sentinel clients registered for the target microservice in the Sentinel console, and call the data synchronization interfaces corresponding to each of the multiple Sentinel clients according to the interface information corresponding to each of the multiple Sentinel clients to synchronize the target rule configuration data to the multiple Sentinel clients. Each Sentinel client stores the target rule configuration data locally after parsing it; the Sentinel console can update the rule configuration data configured by the rule configuration trigger operation to Redis corresponding to the target microservice.

[0067] In an exemplary embodiment, the console records multiple traffic governance clients registered for the target microservice in the client list, and the console stores the rule configuration data applicable to each of the multiple microservices through the persistent storage service. The method for processing configuration data based on microservices further includes the following steps: In response to a heartbeat request sent by a target traffic governance client integrated in each of the multiple service instances deployed for the target microservice, search for the target traffic governance client in the client list; when the target traffic governance client is not found in the client list, add the target traffic governance client to the client list; obtain the target rule configuration data applicable to the target microservice from the persistent storage service; call the data synchronization interface corresponding to the target traffic governance client to synchronize the target rule configuration data obtained from the persistent storage service to the target traffic governance client.

[0068] Among them, this embodiment can be executed through the console. The client list can record the identifiers of the registered traffic governance clients, and the representation can include the IP address of the service instance where the traffic governance client is located and the port number of the traffic governance client. The traffic governance client integrated in the service instance can send a heartbeat request to the console at a preset time interval after the service instance is enabled, and the console can return a heartbeat response to the traffic governance client. The heartbeat request can carry information including the IP address of the service instance where the traffic governance client is located and the port number of the traffic governance client. The preset time interval can be, for example, 1 second, 2 seconds, 10 seconds, or others. It can be understood that the enabling of the service instance can be the first enabling of the service instance or the re - enabling after disconnection.

[0069] When the target traffic governance client is not found in the client list, it can be caused by several reasons: 1. The target traffic governance client is enabled for the first time; or, 2. The target traffic governance client was once in the client list, was removed from the client list after disconnection, and the target traffic governance client is restarted; or, 3. The console is restarted, resulting in the client list being cleared; or there can be other reasons. Among them, since the target traffic governance client is integrated in the service instance, when the service instance is enabled for the first time, the target traffic governance client integrated in the service instance is also enabled for the first time. When the service instance is disconnected, the target traffic governance client is also disconnected. When the service instance is re - enabled, the target traffic governance client can also be re - enabled. In this way, in the case of the first enabling of the service instance, the re - enabling of the service instance after disconnection, or the restart of the console, it can trigger obtaining the target rule configuration data applicable to the target microservice from the persistent storage service and synchronizing the target rule configuration data to the target traffic governance client, ensuring that the traffic governance client can synchronize the corresponding rule configuration data in various situations.

[0070] In this embodiment, by receiving a heartbeat request sent by a target traffic governance client, the target traffic governance client is searched for in the client list. When the target traffic governance client is not found, it indicates that there may be local data loss in the target traffic governance client. At this time, the target traffic governance client is added to the client list, so that when the subsequent synchronization trigger condition is met, the rule configuration data can be sent. And the target rule configuration data applicable to the target microservice is obtained from the persistent storage service, and the obtained target rule configuration data is synchronized to the target traffic governance client, which can timely make up for the local data that the target traffic governance client may have lost and improve stability.

[0071] In one embodiment, refer to another schematic diagram of the rule configuration data synchronization process as shown in Figure 4 . The console can be the Sentinel console, the traffic governance client can be the Sentinel client, and the persistent storage service can be Redis. After the service instance integrated in the target microservice is started, the Sentinel client integrated in the service instance is started. The Sentinel client can send a heartbeat request to the Sentinel console regularly (every preset time interval). In response to the heartbeat request, the Sentinel console searches for the Sentinel client in the client list to determine whether the Sentinel client is a new client. When the Sentinel client is not found in the client list, it indicates that the Sentinel client is a new client. The Sentinel client is added to the client list, the target rule configuration data applicable to the target microservice is obtained from Redis, and the corresponding data synchronization interface of the Sentinel client is called to synchronize the target rule configuration data obtained from Redis to the Sentinel client.

[0072] In an exemplary embodiment, the method for processing configuration data based on microservices further includes the following steps: when the target traffic governance client is found in the client list, update the most recent active time of the target traffic governance client; in the case where the time since the most recent active time of the target traffic governance client exceeds a second preset duration from the current time, remove the target traffic governance client from the client list.

[0073] Among them, this embodiment can be executed by the console. The most recent active time can be the reception time when the console receives the heartbeat request, or the timestamp carried in the heartbeat request received by the console. The second preset duration can be greater than the preset time interval. The second preset duration can be, for example, 5 seconds, 10 seconds, 30 seconds, or others.

[0074] In this embodiment, after receiving a heartbeat request, when it is determined that the target traffic governance client is found in the client list, the most recent active time is updated. If the time since the most recent active time exceeds the second preset duration, it indicates that the target traffic governance client is in a disconnected state. At this time, the target traffic governance client is removed from the client list, which can avoid sending data to the disconnected target traffic governance client subsequently, avoid wasting resources, and improve resource utilization.

[0075] In an exemplary example, the number of target rule configuration data is at least one; each traffic governance client is used to perform rule reloading on the service instance where it is located according to the target rule object set obtained by reloading the rules based on the target rule configuration data; rule reloading includes: parsing each of the target rule configuration data into a target rule object representing a traffic governance rule to obtain at least one target rule object; based on the at least one target rule object, constructing a target rule object set; and replacing the rule object set historically stored in the memory of the service instance where it is located with the target rule object set.

[0076] Among them, the number of target rule configuration data can be one or multiple. The target rule configuration data can be represented in a data exchange format. The data exchange format can be, for example, JSON format, XML format, or others. The target rule configuration data can be serialized data, and the traffic governance client can deserialize each target rule configuration data into a target rule object.

[0077] A target rule object is a rule object parsed from a target rule configuration data. A rule object is an object that represents a traffic governance rule in memory. This object can be recognized and operated on by the memory of the service instance where the traffic governance client is located. For example, if the running environment of the service instance is JVM, then the object can be a JAVA object.

[0078] In this embodiment, by parsing the target rule configuration data into a target rule object representing a traffic governance rule, the memory of the service instance where the traffic governance client is located can recognize and operate on it. Furthermore, by constructing the at least one target rule object obtained by parsing into a target rule object set and replacing the rule object set historically stored in the memory of the service instance where it is located with the target rule object set, rule update can be achieved without restarting the service instance.

[0079] In one embodiment, refer to Figure 5A schematic diagram of an example process for traffic governance is shown. The console can be a Sentinel console, the traffic governance client can be a Sentinel client, and the persistent storage service can be Redis. When an Http request calls the Http interface of a service instance in a microservice, the Sentinel client integrated with the service instance can read the set of rule objects stored in local memory. Each rule object in the set of rule objects represents a traffic governance rule, and based on the traffic governance rules represented by the rule objects, analysis is performed to make corresponding processing. The corresponding processing can be rapid failure, queuing for waiting, or others.

[0080] In one embodiment, the console can respond to a status monitoring request sent by the status management service, send a client list to the status management service, to indicate to the status management service to determine, based on the client list, the faulty clients among the traffic governance clients integrated with each of the multiple service instances deployed for the target microservice, and recover the faulty clients based on the interaction information with the service instance where the faulty client is located.

[0081] Among them, the status management service can be a service running in a status management server for managing the health status of microservices. The interaction information can be information indicating the health status of a service instance. The interaction information can be an indication information indicating no response. It can be understood that the status management service can send a status confirmation request to the service instance. If no response feedback is received within a specified duration, interaction information indicating no response can be generated. The interaction information can also be machine parameters, such as memory usage rate, network packet loss rate, CPU usage rate, number of threads, disk usage rate. If the interaction information indicates that the service instance is unresponsive, an alarm prompt can be issued to indicate to the operation and maintenance personnel to maintain the service instance to re-enable the service instance, and the faulty client can be recovered after the service instance is enabled. If the interaction information is machine parameters and the parameter value of the machine parameters reaches a threshold, the status management service can take over the service instance, recover the service instance, and then attempt to run the faulty client to recover the faulty client. The parameter value of the machine parameters reaching the threshold can be, for example, the network packet loss rate is greater than 30%. At this time, the service instance can be migrated to a healthy node (a business server can be divided into multiple nodes, and each node is used to run one or more service instances) to recover the service instance.

[0082] It should be understood that although the steps in the flowcharts involved in the above-described embodiments are sequentially shown according to the indications of the arrows, these steps are not necessarily executed sequentially in the order indicated by the arrows. Unless there is a clear indication in this article, there is no strict order limit for the execution of these steps, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-described embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily executed at the same moment, but can be executed at different moments. The execution order of these steps or stages is not necessarily sequential, but can be executed alternately or in turn with at least a part of other steps or steps or stages in other steps. It can be understood that the steps in different embodiments can be freely combined as needed, and various non-contradictory solutions formed by the combination fall within the scope of protection of this application.

[0083] Based on the same inventive concept, an embodiment of the present application further provides a microservice-based configuration data processing device for implementing the above-mentioned microservice-based configuration data processing method. The solution provided by this device to solve the problem is similar to the solution described in the above method. Therefore, the specific limitations in one or more embodiments of the microservice-based configuration data processing device provided below can refer to the limitations on the microservice-based configuration data processing method in the above text, and will not be repeated here.

[0084] In an exemplary embodiment, as Figure 6 shown, a microservice-based configuration data processing device 600 is provided, including: a data management module 610 and a data synchronization module 620, where:

[0085] The data management module 610 is configured to, in response to the achievement of the synchronization trigger condition of the target microservice among the multiple microservices managed by the console, determine the target rule configuration data applicable to the target microservice; determine the interface information corresponding to each of the multiple traffic governance clients registered by the target microservice in the console; multiple service instances are deployed for the target microservice, and each traffic governance client is integrated into one of the multiple service instances.

[0086] The data synchronization module 620 is configured to call the data synchronization interfaces corresponding to the multiple traffic governance clients according to the interface information corresponding to the multiple traffic governance clients, so as to synchronize the target rule configuration data to the multiple traffic governance clients; each traffic governance client is configured to perform traffic governance on the service instance where it is located according to the traffic governance rules represented by the target rule configuration data.

[0087] In an exemplary embodiment, the console stores the rule configuration data applicable to each of the multiple microservices through a persistent storage service. The data management module 610 is further configured to determine that the target microservice meets the synchronization trigger condition in response to the synchronization time interval corresponding to the target microservice among the multiple microservices managed by the console reaching a first preset duration. The synchronization time interval is the time interval between the most recent synchronization time corresponding to the target microservice and the current time. The most recent synchronization time is the time of the most recent synchronization of the rule configuration data to the traffic governance client registered by the target microservice in the console. The target rule configuration data applicable to the target microservice is obtained from the persistent storage service.

[0088] In an exemplary embodiment, the data management module 610 is further configured to determine that the target microservice meets the synchronization trigger condition in response to a rule configuration trigger operation for the target microservice among the multiple microservices managed by the console. The rule configuration data configured by the rule configuration trigger operation is determined as the target rule configuration data applicable to the target microservice. The rule configuration data configured by the rule configuration trigger operation is updated to the persistent storage service corresponding to the target microservice.

[0089] In an exemplary embodiment, the console records multiple traffic governance clients registered by the target microservice in the console through a client list. The console stores the rule configuration data applicable to each of the multiple microservices through a persistent storage service. The data management module 610 is further configured to search for the target traffic governance client in the client list in response to a heartbeat request sent by the target traffic governance client integrated in each of the multiple service instances deployed by the target microservice. When the target traffic governance client is not found in the client list, the target traffic governance client is added to the client list. The target rule configuration data applicable to the target microservice is obtained from the persistent storage service. The data synchronization module 620 is further configured to call the data synchronization interface corresponding to the target traffic governance client to synchronize the target rule configuration data obtained from the persistent storage service to the target traffic governance client.

[0090] In an exemplary embodiment, the data management module 610 is further configured to update the most recent active time of the target traffic governance client when the target traffic governance client is found in the client list. In the case where the time interval between the most recent active time of the target traffic governance client and the current time exceeds a second preset duration, the target traffic governance client is removed from the client list.

[0091] In an exemplary embodiment, the number of target rule configuration data is at least one; each traffic governance client is configured to perform traffic governance on the service instance where it is located according to a set of target rule objects obtained by reloading rules based on the target rule configuration data; the traffic governance client is configured to separately parse the target rule configuration data into target rule objects representing traffic governance rules, obtaining at least one target rule object; construct a set of target rule objects based on the at least one target rule object; and replace the set of rule objects historically stored in the memory of the service instance where it is located with the set of target rule objects.

[0092] Each module in the above-mentioned microservice-based configuration data processing device can be implemented in whole or in part by software, hardware, and their combination. The above-mentioned modules can be embedded in the processor of the computer device in hardware form or be independent of it, or can be stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to the above-mentioned modules.

[0093] In an exemplary embodiment, a computer device is provided. The computer device can be a server, and its internal structure diagram can be as Figure 7 shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O), and a communication interface. Among them, the processor, the memory, and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is configured to store data required for executing a microservice-based configuration data processing. The input / output interface of the computer device is configured to exchange information between the processor and external devices. The communication interface of the computer device is configured to communicate with external terminals through a network connection. When the computer program is executed by the processor, it implements a microservice-based configuration data processing method.

[0094] Those skilled in the art can understand that Figure 7 the structure shown in

[0095] In one embodiment, a computer device is further provided, including a memory and a processor. A computer program is stored in the memory, and when the processor executes the computer program, the steps in the foregoing method embodiments are implemented.

[0096] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the foregoing method embodiments are implemented.

[0097] In one embodiment, a computer program product is provided, including a computer program. When the computer program is executed by a processor, the steps in the foregoing method embodiments are implemented.

[0098] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, database, or other medium used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the embodiments provided in this application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., without limitation. The processors involved in the embodiments provided in this application can be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, data processing logics based on quantum computing, artificial intelligence (AI) processors, etc., without limitation.

[0099] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope recorded in this application.

[0100] The above-described embodiments merely represent several implementation manners of the present application. The description thereof is relatively specific and detailed, but it should not be construed as a limitation on the patent scope of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all fall within the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the appended claims.

Claims

1. A method for processing configuration data based on microservices, characterized in that, The method includes: In response to the achievement of the synchronization trigger condition of a target microservice among multiple microservices managed by a console, determining target rule configuration data applicable to the target microservice; Determining interface information corresponding to each of multiple traffic governance clients registered for the target microservice in the console; multiple service instances are deployed for the target microservice, and each of the traffic governance clients is integrated into one of the multiple service instances; According to the interface information corresponding to each of the multiple traffic governance clients, invoking the data synchronization interfaces corresponding to the multiple traffic governance clients respectively to synchronize the target rule configuration data to the multiple traffic governance clients; each traffic governance client is used to perform traffic governance on the service instance where it is located according to the traffic governance rules represented by the target rule configuration data.

2. The method according to claim 1, wherein The console stores the rule configuration data applicable to each of the multiple microservices through a persistent storage service. The step of, in response to the achievement of the synchronization trigger condition of a target microservice among multiple microservices managed by a console, determining target rule configuration data applicable to the target microservice includes: In response to the synchronization time interval corresponding to a target microservice among multiple microservices managed by the console reaching a first preset duration, determining that the target microservice has achieved the synchronization trigger condition; the synchronization time interval is the time interval between the time of the most recent synchronization of the target microservice and the current time; the time of the most recent synchronization is the time of the most recent synchronization of the rule configuration data to the traffic governance client registered for the target microservice in the console; Obtaining the target rule configuration data applicable to the target microservice from the persistent storage service.

3. The method according to claim 2, wherein The step of, in response to the achievement of the synchronization trigger condition of a target microservice among multiple microservices managed by a console, determining target rule configuration data applicable to the target microservice further includes: In response to a rule configuration trigger operation for a target microservice among multiple microservices managed by the console, determining that the target microservice has achieved the synchronization trigger condition; Determining the rule configuration data configured by the rule configuration trigger operation as the target rule configuration data applicable to the target microservice; The method further includes: Updating the rule configuration data configured by the rule configuration trigger operation corresponding to the target microservice to the persistent storage service.

4. The method according to claim 1, wherein The console records multiple traffic governance clients registered for the target microservice in a client list, and the console stores the rule configuration data applicable to each of the multiple microservices through a persistent storage service. The method further includes: In response to a heartbeat request sent by a target traffic governance client among the traffic governance clients integrated into multiple service instances deployed for the target microservice, searching for the target traffic governance client in the client list; When the target traffic governance client is not found in the client list, adding the target traffic governance client to the client list; Obtaining the target rule configuration data applicable to the target microservice from the persistent storage service; Invoke the data synchronization interface corresponding to the target traffic governance client to synchronize the target rule configuration data obtained from the persistent storage service to the target traffic governance client.

5. The method according to claim 4, wherein The method further includes: When the target traffic governance client is found in the client list, update the most recent active time of the target traffic governance client; In the case where the most recent active time of the target traffic governance client exceeds a second preset duration from the current time, remove the target traffic governance client from the client list.

6. The method according to any one of claims 1-5, characterized in that, The number of the target rule configuration data is at least one; each traffic governance client is used to perform traffic governance on the service instance where it is located according to the target rule object set obtained by reloading the rules based on the target rule configuration data; the rule reloading includes: Parse the target rule configuration data into target rule objects representing traffic governance rules respectively to obtain at least one target rule object; Based on the at least one target rule object, construct a target rule object set; Replace the rule object set historically stored in the memory of the service instance where it is located with the target rule object set.

7. A configuration data processing device based on microservices, characterized in that, The apparatus includes: A data management module, configured to determine the target rule configuration data applicable to the target microservice in response to the achievement of the synchronization trigger condition of the target microservice among the multiple microservices managed by the console; determine the interface information corresponding to each of the multiple traffic governance clients registered for the target microservice in the console; the target microservice is deployed with multiple service instances, and each of the traffic governance clients is integrated in one of the multiple service instances; A data synchronization module, configured to call the data synchronization interfaces corresponding to the multiple traffic governance clients respectively according to the interface information corresponding to each of the multiple traffic governance clients to synchronize the target rule configuration data to the multiple traffic governance clients; each traffic governance client is used to perform traffic governance on the service instance where it is located according to the traffic governance rules represented by the target rule configuration data.

8. A computer device, comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the method according to any one of claims 1 to 6.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the method according to any one of claims 1 to 6.