Configuration management method and device and computer equipment

By providing configuration management methods in the microservice architecture, the unified configuration items of the microservice gateway are separated and the separate configuration files of each microservice are generated, which solves the difficulty of the microservice gateway processing configuration information and realizes refined management of each microservice configuration.

CN119996182AActive Publication Date: 2025-05-13CHINA SOUTHERN POWER GRID COMPANY
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510137728.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-07
Publication Date
2025-05-13
Estimated Expiration
2045-02-07

AI Technical Summary

Technical Problem

In the microservice architecture, the microservice gateway needs to process a large number of complicated configuration information and needs to be adjusted in time as the microservice changes, which makes manual processing extremely difficult.

Method used

Provides a configuration management method, by obtaining the configuration update requirements of the target user for the target microservice, separate processing of unified configuration items, generate separate configuration files for each microservice, and sending the updated configuration files to the microservice gateway.

Benefits of technology

It realizes personalized configuration management of each microservice, improves the refined configuration management capabilities, and reduces the difficulty and time of manual processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119996182A_ABST
    Figure CN119996182A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of micro-services, in particular to a configuration management method and device and computer equipment. The method comprises the following steps: when a configuration update demand initiated by a target user for a target micro-service is obtained and an update configuration item carried in the configuration update demand is determined to be a unified configuration item of the target micro-service in a micro-service gateway, performing separation processing on the unified configuration item according to the configuration update demand, and sending the unified configuration item to the target micro-service gateway; obtaining an independent configuration file of each micro-service to which the unified configuration item belongs; each micro-service to which the unified configuration item belongs comprises a target micro-service; according to update configuration information in the update configuration item, updating the independent configuration file of the target micro-service; and sending the updated independent configuration file corresponding to the target micro-service to the micro-service gateway to indicate the micro-service gateway to apply the updated independent configuration file.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of microservice technology, and in particular to a configuration management method, apparatus, and computer equipment. Background Art

[0002] The microservice architecture splits a large application into multiple small, independently deployed microservices. This architectural model is currently very popular. The microservice gateway is located at the external boundary of the entire microservice system. Various external requests first contact it, so it is indispensable and bears the key responsibility of connecting the external and internal microservices.

[0003] As the business of an enterprise develops, the number of microservices will continue to increase, and individual microservices will also be upgraded iteratively. In order to adapt to their own unique business logic, performance requirements, and security rules, different microservices have exclusive configuration parameters, such as authentication rules, current limiting thresholds, and service discovery settings.

[0004] However, if the microservice gateway wants to connect with many microservices, it has to take all these different configurations into consideration. It is extremely difficult to manually handle massive and complex configurations and make timely adjustments based on changes in microservices. Summary of the invention

[0005] Based on this, it is necessary to provide a configuration management method, device and computer equipment that can improve the personalized configuration management of each microservice in response to the above technical problems.

[0006] In a first aspect, the present application provides a configuration management method, the method comprising:

[0007] When a configuration update requirement initiated by a target user for a target microservice is obtained and it is determined that the update configuration item carried in the configuration update requirement is a unified configuration item of the target microservice in the microservice gateway, the unified configuration item is separated and processed according to the configuration update requirement to obtain separate configuration files for each microservice to which the unified configuration item belongs; each microservice to which the unified configuration item belongs includes the target microservice;

[0008] Update the separate configuration file of the target microservice according to the updated configuration information in the updated configuration item;

[0009] The updated separate configuration file corresponding to the target microservice is sent to the microservice gateway to instruct the microservice gateway to apply the updated separate configuration file.

[0010] In one embodiment, determining that the updated configuration item carried in the configuration update requirement is a unified configuration item of the target microservice in the microservice gateway includes:

[0011] Match the updated configuration items carried in the configuration update requirements with the unified configuration items of the target microservice in the microservice gateway;

[0012] If the match is successful, it is determined that the updated configuration item carried in the configuration update requirement is a unified configuration item of the target microservice in the microservice gateway.

[0013] In one embodiment, according to the configuration update requirements, the unified configuration items are separated to obtain separate configuration files of each microservice to which the unified configuration items belong, including:

[0014] Create the initial configuration files for each microservice to which the unified configuration items belong based on configuration update requirements;

[0015] In each initial configuration file, add a unified configuration item to obtain a separate configuration file for each microservice to which the unified configuration item belongs.

[0016] In one embodiment, the unified configuration items of the target microservice in the microservice gateway are constructed in the following manner:

[0017] Get the microservice configuration items of the target microservice;

[0018] When it is determined that the microservice configuration items of the target microservice are consistent or similar to the microservice configuration items of other microservices, the consistent or similar microservice configuration items are used as unified configuration items of the target microservice in the microservice gateway.

[0019] In one embodiment, according to the configuration update requirements, the unified configuration items are separated to obtain separate configuration files of each microservice to which the unified configuration items belong, including:

[0020] If the number of target users is at least two, selecting the current user from each target user according to the priority of each target user;

[0021] According to the configuration update requirements initiated by the current user for the target microservice, the unified configuration items are separated and processed to obtain separate configuration files for each microservice to which the unified configuration items belong.

[0022] In one of the embodiments, the update configuration items include at least a gateway routing rule configuration item and a microservice function configuration item; the microservice function configuration item includes at least an authentication function configuration item and a log storage function configuration item.

[0023] In a second aspect, the present application also provides a configuration management device, including:

[0024] The configuration separation module is used to obtain the configuration update demand initiated by the target user for the target microservice, and when it is determined that the updated configuration item carried in the configuration update demand is a unified configuration item of the target microservice in the microservice gateway, separate the unified configuration item according to the configuration update demand to obtain separate configuration files of each microservice to which the unified configuration item belongs. Each microservice to which the unified configuration item belongs includes the target microservice.

[0025] The configuration update module is used to update the separate configuration file of the target microservice according to the update configuration information in the update configuration item;

[0026] The configuration application module is used to send the updated separate configuration file corresponding to the target microservice to the microservice gateway to instruct the microservice gateway to apply the updated separate configuration file.

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

[0028] When a configuration update requirement initiated by a target user for a target microservice is obtained and it is determined that the update configuration item carried in the configuration update requirement is a unified configuration item of the target microservice in the microservice gateway, the unified configuration item is separated and processed according to the configuration update requirement to obtain separate configuration files for each microservice to which the unified configuration item belongs; each microservice to which the unified configuration item belongs includes the target microservice;

[0029] Update the separate configuration file of the target microservice according to the updated configuration information in the updated configuration item;

[0030] The updated separate configuration file corresponding to the target microservice is sent to the microservice gateway to instruct the microservice gateway to apply the updated separate configuration file.

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

[0032] When a configuration update requirement initiated by a target user for a target microservice is obtained and it is determined that the update configuration item carried in the configuration update requirement is a unified configuration item of the target microservice in the microservice gateway, the unified configuration item is separated and processed according to the configuration update requirement to obtain separate configuration files for each microservice to which the unified configuration item belongs; each microservice to which the unified configuration item belongs includes the target microservice;

[0033] Update the separate configuration file of the target microservice according to the updated configuration information in the updated configuration item;

[0034] The updated separate configuration file corresponding to the target microservice is sent to the microservice gateway to instruct the microservice gateway to apply the updated separate configuration file.

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

[0036] When a configuration update requirement initiated by a target user for a target microservice is obtained and it is determined that the update configuration item carried in the configuration update requirement is a unified configuration item of the target microservice in the microservice gateway, the unified configuration item is separated and processed according to the configuration update requirement to obtain separate configuration files for each microservice to which the unified configuration item belongs; each microservice to which the unified configuration item belongs includes the target microservice;

[0037] Update the separate configuration file of the target microservice according to the updated configuration information in the updated configuration item;

[0038] The updated separate configuration file corresponding to the target microservice is sent to the microservice gateway to instruct the microservice gateway to apply the updated separate configuration file.

[0039] The above configuration management method, device and computer equipment, the present application uses configuration separation technology to disassemble the configuration information of the microservice gateway according to different configuration requirements, thereby generating a separate configuration file or database corresponding to each microservice. The advantage of this is that it can flexibly respond to the unique configuration requirements of different microservices and realize the refined management of each microservice configuration, which is the so-called granular control. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0041] Figure 1 An application environment diagram of a configuration management method in an embodiment;

[0042] Figure 2 A flowchart of a configuration management method in an embodiment;

[0043] Figure 3 A flowchart of a step of determining the updated configuration items carried in the configuration update requirement as unified configuration items for the target microservice in the microservice gateway in one embodiment;

[0044] Figure 4 A flowchart of the steps of obtaining separate configuration files for each microservice to which a unified configuration item belongs in one embodiment;

[0045] Figure 5 It is a flowchart of the steps of separating the unified configuration items in one embodiment;

[0046] Figure 6 is a structural block diagram of a configuration management device in an embodiment;

[0047] Figure 7 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0048] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with 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.

[0049] In an exemplary embodiment, Figure 1 As shown, a schematic diagram of an application environment of a configuration management method is provided, and the schematic diagram of the application environment includes a computer device, in which a configuration management module, a microservice gateway module, and microservices are configured.

[0050] In an exemplary embodiment, Figure 2 As shown, a configuration management method is provided, which is described by taking the method applied to a configuration management module in a computer device as an example, including:

[0051] S201, when a configuration update requirement initiated by a target user for a target microservice is obtained and it is determined that the update configuration item carried in the configuration update requirement is a unified configuration item of the target microservice in the microservice gateway, the unified configuration item is separated according to the configuration update requirement to obtain separate configuration files for each microservice to which the unified configuration item belongs.

[0052] Among them, the configuration update requirements initiated by the target user for the target microservice may come from business changes of the microservice, performance optimization requirements or other factors.

[0053] Then, query the configuration management database or storage structure of the microservice gateway to obtain all unified configuration items of the target microservice. Compare the received updated configuration items with these unified configuration items. You can use string matching, hash table search and other methods to quickly determine whether there is a match. If the match is successful, the subsequent separation processing flow is triggered. If it does not match, it can be processed according to the preset error handling mechanism, such as sending an error prompt message to the administrator.

[0054] Among them, each microservice to which the unified configuration item belongs includes a target microservice.

[0055] It is understandable that each microservice to which a unified configuration item belongs refers to the microservice individuals that share specific configuration elements in the microservice architecture. These microservices have some common configuration contents due to commonalities in business requirements, technical architecture or operating environment, and these common configuration contents are unified configuration items.

[0056] For example, unified configuration items may be some basic configuration elements shared by multiple microservices, such as common network connection parameters (such as timeout, connection pool size, etc.), public security policy configuration (such as encryption algorithm, authentication method, etc.) or some global settings at the system level (such as log level, system default encoding, etc.). These configuration items are consistent or similar in multiple microservices, and will be treated and maintained as a whole during the configuration management process. When they need to be updated, they may affect the operating status of multiple microservices. Therefore, they need to be separated and updated according to specific processes to ensure the stability and normal operation of the entire microservice system.

[0057] Among them, the separation processing flow refers to the use of configuration separation technology to disassemble the configuration information of the microservice gateway according to different configuration requirements, thereby generating a separate configuration file or database corresponding to each microservice.

[0058] Optionally, the specific implementation process of the separation process is: create a dedicated configuration file or configuration group for each microservice to which the unified configuration item belongs. In actual operation, these configuration resources may be distinguished and created based on factors such as the name of the microservice, functional module, etc. When merging configurations, factors such as version information and environment variables will be referenced to determine whether to load a specific configuration. For example, in a development environment, some configuration items for debugging may be loaded. In a production environment, configurations that focus more on performance and stability will be selected.

[0059] S202: Update a separate configuration file of the target microservice according to the update configuration information in the update configuration item.

[0060] It is understandable that the update configuration item carries the update configuration information, which specifies what changes to make to the target microservice.

[0061] Optionally, find the target configuration location corresponding to the updated configuration item in the configuration file. After finding the location of the target configuration, replace the old value with the new value in the updated configuration information. During this process, pay special attention to maintaining the syntax and format of the configuration file. After the update is complete, this configuration file will allow the target microservice to operate according to new rules and parameters, and keep pace with changes in business requirements. For example, after replacing the old value of the number of concurrent requests, the next time the microservice processes a request, it can run according to the new concurrency limit, improving response efficiency.

[0062] S203: Send the updated separate configuration file corresponding to the target microservice to the microservice gateway to instruct the microservice gateway to apply the updated separate configuration file.

[0063] It is understandable that after completing the update operation of the target microservice's individual configuration file, the modified configuration file must be transferred from the location of the configuration management module to a location where the microservice gateway can obtain it. This transmission process may be carried out in different ways depending on the system architecture, such as pushing files through network protocols (such as HTTP, FTP, etc.) or using a distributed file system sharing method to allow the microservice gateway to access the updated configuration file.

[0064] Optionally, notify and drive the microservice gateway to enable the new configuration. During this process, the microservice gateway can update the configuration of the microservice without re-configuration.

[0065] During operation, the microservice gateway originally relied on old configuration files to handle various tasks such as routing forwarding and security verification. After receiving the updated configuration file, it will read and parse it according to the established procedures, and integrate the new configuration parameters into its own operation logic. For example, the updated configuration file adjusts the routing rules for a certain type of request. After the microservice gateway reads and applies the file, when it encounters such requests in the future, it will accurately distribute the requests to the corresponding microservice instances according to the new routing rules, so as to ensure that the system operation is in line with the latest business needs or operation and maintenance adjustments.

[0066] In the above configuration management method, the present application utilizes configuration separation technology to disassemble the configuration information of the microservice gateway according to different configuration requirements, thereby generating separate configuration files or databases corresponding to each microservice. The advantage of this is that it can flexibly respond to the unique configuration requirements of different microservices and achieve refined management of each microservice configuration, which is the so-called granular control.

[0067] In an exemplary embodiment, Figure 3 As shown, it is determined that the updated configuration items carried in the configuration update requirement are unified configuration items of the target microservice in the microservice gateway, including:

[0068] S301, matching the updated configuration items carried in the configuration update requirement with the unified configuration items of the target microservice in the microservice gateway.

[0069] Optionally, compare the updated configuration items carried in the configuration update requirements with the existing unified configuration items of the target microservice in the microservice gateway. For example, for the updated configuration items, clarify the configuration category (such as network configuration, security configuration, etc.), parameter name (such as connection timeout, encryption algorithm, etc.), parameter type (such as integer, string, Boolean value, etc.) and parameter value. For the unified configuration items, the feature description is also performed in the same way. Use the parameter name and type for preliminary matching. Filter the possible matching unified configuration items by comparing whether the parameter names in the updated configuration items and the unified configuration items are the same and whether the parameter types are consistent. For example, in the above example, the "connection timeout" in the updated configuration item and the "connection timeout" in the unified configuration item have the same name, and both are integer types (seconds), so it is determined that they may match.

[0070] It is understandable that unified configuration items are obtained through a specific build process. First, all microservice configuration items of the target microservice are collected, and then they are compared with the configuration items of other microservices one by one. If some configuration items are found to be the same or very similar in content, format, purpose, etc., these configuration items will be picked out and integrated to form unified configuration items of the target microservice in the microservice gateway. For example, if multiple microservices need to connect to the same database, then the configuration related to the database connection, such as parameters such as database address, port number, and user name, will most likely be identified as consistent microservice configuration items, and then become unified configuration items.

[0071] Optionally, the unified configuration items of the target microservice in the microservice gateway are constructed in the following manner: obtain the microservice configuration items of the target microservice; when it is determined that the microservice configuration items of the target microservice are consistent or similar to the microservice configuration items of other microservices, use the consistent or similar microservice configuration items as the unified configuration items of the target microservice in the microservice gateway.

[0072] S302: If the match is successful, it is determined that the updated configuration item carried in the configuration update requirement is a unified configuration item of the target microservice in the microservice gateway.

[0073] Optionally, once a match is confirmed, the updated configuration items that have been matched successfully and the detailed information of the unified configuration items of the corresponding target microservices in the microservice gateway need to be recorded. This includes the name, type, current value (the value in the unified configuration item) and updated value (the value in the updated configuration item) of the configuration item. This information can be stored in a data structure such as a dictionary (in Python) or an object (in languages ​​such as Java).

[0074] In order for the subsequent processes to clearly know that this updated configuration item is related to the unified configuration item, it needs to be marked. In the update task queue or update record of the configuration management system, a specific label or status can be set to indicate that this updated configuration item belongs to the unified configuration item related update of the target microservice in the microservice gateway.

[0075] In an exemplary embodiment, Figure 4 As shown, according to the configuration update requirements, the unified configuration items are separated to obtain separate configuration files for each microservice to which the unified configuration items belong, including:

[0076] S401, creating an initial configuration file for each microservice to which the unified configuration item belongs according to the configuration update requirement.

[0077] It is understandable that after receiving the configuration update request, the first task is to build the initial configuration file framework for each microservice to which the unified configuration item belongs. This initial configuration file provides the basis for adding precise configuration content later. For example, if there are three microservices A, B, and C that share some unified configuration items, then corresponding initial configuration files will be created for these three microservices respectively. These initial files are empty at this time, or only contain some of the most basic and common file header information.

[0078] S401, adding a unified configuration item to each initial configuration file, and obtaining a separate configuration file for each microservice to which the unified configuration item belongs.

[0079] Optionally, after having the initial configuration files for each microservice, the next step is to add the unified configuration items one by one to make them into separate configuration files with complete content. For example, the unified configuration items contain common configurations for database connections, such as database address, port number, user name, etc. This information will be written into the initial configuration files corresponding to microservices A, B, and C, respectively, to form their own separate configuration files. In this way, each microservice has complete configuration content that adapts to itself, and it can be flexibly adjusted based on the actual situation in the future, which is also convenient for accurate modification when updating configuration items.

[0080] Among them, the update configuration items at least include gateway routing rule configuration items and microservice function configuration items. The microservice function configuration items at least include authentication function configuration items and log storage function configuration items.

[0081] Among them, the gateway routing rule configuration item is related to the flow of microservice requests. For example, different routing rules are formulated based on factors such as client type, request source region, or request priority to accurately forward requests to the corresponding microservice instances. When updating such configuration items, it is necessary to adjust the routing rule description in the initial configuration file to change the communication path between microservices.

[0082] For example, using labels, version numbers, etc. to separate routing rules can help improve the routing efficiency and accuracy of the gateway. In a system with multiple microservice versions, different versions of microservices may have different interfaces or functions. By setting corresponding labels or version numbers for routing rules, you can ensure that requests can be accurately routed to the correct version of the microservice. For example, an API gateway needs to route requests from different clients to different versions of the product information microservice. By setting labels according to the client type, accurate routing allocation can be achieved, improving the overall performance of the system and user experience.

[0083] Among them, microservice function configuration items: Authentication function configuration item: determines how the microservice identifies the legitimacy of the request source. For example, whether to use username-password authentication, token authentication, or multi-factor authentication, updating this item can improve system security and match new security policies. Log storage function configuration item: responsible for managing how the logs generated by microservices are saved, whether they are stored on local disks, cloud storage, or distributed file systems, as well as the length of time they are saved, the size limit of log files, etc. Adjusting this configuration item can optimize the efficiency of operation and maintenance troubleshooting and meet the needs of log management at different stages.

[0084] For example, separation of configurations for specific functional requirements of different microservices, such as separate authentication and logging configurations, is key to meeting diverse business needs. Some microservices may require more stringent authentication methods, such as two-factor authentication or integration with a third-party certification authority, while other microservices may only require simple username / password authentication. By providing independent configuration mechanisms for these specific functions, each microservice can be ensured to achieve optimal security and functional implementation. Similarly, for logging configuration, different microservices may need to record different levels of log information or send logs to different storage locations. This separation based on specific functions can meet these differentiated needs.

[0085] In an exemplary embodiment, Figure 5As shown, according to the configuration update requirements, the unified configuration items are separated to obtain separate configuration files for each microservice to which the unified configuration items belong, including:

[0086] S501: If the number of target users is at least two, select a current user from each target user according to the priority of each target user.

[0087] It is understandable that in scenarios where there are at least two target users initiating configuration update requirements, user priority becomes a key screening factor. The system pre-sets priorities for different target users, and these priorities may be based on many factors such as user role, business importance, and payment level. For example, in an enterprise-level microservice system, the super administrator has a higher priority than ordinary operation and maintenance personnel, and the person in charge of the core business department has a higher priority than employees in the marginal business department. By comparing the priorities of each target user, the system selects the one with the highest priority and identifies it as the current user. This is done to ensure that the most important and urgent needs can be processed first in the complex situation where multiple users compete for configuration updates.

[0088] S502: According to the configuration update demand initiated by the current user for the target microservice, the unified configuration item is separated to obtain a separate configuration file for each microservice to which the unified configuration item belongs.

[0089] Optionally, after locking the current user, the unified configuration items are processed by focusing on the configuration update requirements initiated by the current user for the target microservice. It will disassemble the unified configuration items and integrate them into the separate configuration files corresponding to each microservice according to the established separation process. Assuming that the current user submits an update requirement to adjust the database connection configuration shared by several microservices (belonging to the unified configuration item), the system will accurately modify the configuration file of each microservice involved in the unified configuration item based on this requirement, ensuring that the updated configuration is used in the subsequent microservices when they are running, while maintaining the independence and adaptability of each microservice configuration. This method makes the configuration update process more orderly and adaptable to complex business scenarios with multiple users.

[0090] In this embodiment, a lock mechanism or a conflict detection algorithm is used to solve the conflict problem that may be caused by multiple people modifying the configuration information at the same time.

[0091] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0092] Based on the same inventive concept, the embodiment of the present application also provides a configuration management device for implementing the configuration management method involved above. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above method, so the specific limitations in one or more configuration management device embodiments provided below can refer to the limitations on the configuration management method above, and will not be repeated here.

[0093] In an exemplary embodiment, Figure 6 As shown, a configuration management device is provided, comprising:

[0094] The configuration separation module 11 is used to obtain the configuration update demand initiated by the target user for the target microservice, and when it is determined that the update configuration item carried in the configuration update demand is a unified configuration item of the target microservice in the microservice gateway, separate the unified configuration item according to the configuration update demand to obtain separate configuration files of each microservice to which the unified configuration item belongs. Each microservice to which the unified configuration item belongs includes the target microservice.

[0095] A configuration update module 12, used to update a separate configuration file of a target microservice according to the update configuration information in the update configuration item;

[0096] The configuration application module 13 is used to send the updated separate configuration file corresponding to the target microservice to the microservice gateway to instruct the microservice gateway to apply the updated separate configuration file.

[0097] In one of the embodiments, the configuration separation module 11 is used to match the updated configuration items carried in the configuration update requirement with the unified configuration items of the target microservice in the microservice gateway.

[0098] If the match is successful, it is determined that the updated configuration item carried in the configuration update requirement is a unified configuration item of the target microservice in the microservice gateway.

[0099] In one of the embodiments, the configuration separation module 11 is used to create an initial configuration file for each microservice to which the unified configuration item belongs according to the configuration update requirement.

[0100] In each initial configuration file, add a unified configuration item to obtain a separate configuration file for each microservice to which the unified configuration item belongs.

[0101] In one embodiment, the apparatus further comprises a unified building module for:

[0102] Get the microservice configuration items of the target microservice;

[0103] When it is determined that the microservice configuration items of the target microservice are consistent or similar to the microservice configuration items of other microservices, the consistent or similar microservice configuration items are used as unified configuration items of the target microservice in the microservice gateway.

[0104] In one embodiment, a separation module 11 is configured to select the current user from each target user according to the priority of each target user if the number of target users is at least two;

[0105] According to the configuration update requirements initiated by the current user for the target microservice, the unified configuration items are separated and processed to obtain separate configuration files for each microservice to which the unified configuration items belong.

[0106] In one of the embodiments, the update configuration items include at least a gateway routing rule configuration item and a microservice function configuration item; the microservice function configuration item includes at least an authentication function configuration item and a log storage function configuration item.

[0107] Each module in the above configuration management device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.

[0108] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 7As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. 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. The processor of the computer device is used 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 used to store data of the configuration management method. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a configuration management method is implemented.

[0109] Those skilled in the art will understand that Figure 7 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0110] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:

[0111] When a configuration update requirement initiated by a target user for a target microservice is obtained and it is determined that the update configuration item carried in the configuration update requirement is a unified configuration item of the target microservice in the microservice gateway, the unified configuration item is separated and processed according to the configuration update requirement to obtain separate configuration files for each microservice to which the unified configuration item belongs; each microservice to which the unified configuration item belongs includes the target microservice;

[0112] Update the separate configuration file of the target microservice according to the updated configuration information in the updated configuration item;

[0113] The updated separate configuration file corresponding to the target microservice is sent to the microservice gateway to instruct the microservice gateway to apply the updated separate configuration file.

[0114] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0115] When a configuration update requirement initiated by a target user for a target microservice is obtained and it is determined that the update configuration item carried in the configuration update requirement is a unified configuration item of the target microservice in the microservice gateway, the unified configuration item is separated and processed according to the configuration update requirement to obtain separate configuration files for each microservice to which the unified configuration item belongs; each microservice to which the unified configuration item belongs includes the target microservice;

[0116] Update the separate configuration file of the target microservice according to the updated configuration information in the updated configuration item;

[0117] The updated separate configuration file corresponding to the target microservice is sent to the microservice gateway to instruct the microservice gateway to apply the updated separate configuration file.

[0118] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:

[0119] When a configuration update requirement initiated by a target user for a target microservice is obtained and it is determined that the update configuration item carried in the configuration update requirement is a unified configuration item of the target microservice in the microservice gateway, the unified configuration item is separated and processed according to the configuration update requirement to obtain separate configuration files for each microservice to which the unified configuration item belongs; each microservice to which the unified configuration item belongs includes the target microservice;

[0120] Update the separate configuration file of the target microservice according to the updated configuration information in the updated configuration item;

[0121] The updated separate configuration file corresponding to the target microservice is sent to the microservice gateway to instruct the microservice gateway to apply the updated separate configuration file.

[0122] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0123] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and 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-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present 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), magnetic 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. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.

[0124] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, 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, they should be considered to be within the scope of this application.

[0125] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A configuration management method, characterized in that: The method comprises: When a configuration update requirement initiated by a target user for a target microservice is obtained and it is determined that the update configuration item carried in the configuration update requirement is a unified configuration item of the target microservice in the microservice gateway, the unified configuration item is separated according to the configuration update requirement to obtain separate configuration files for each microservice to which the unified configuration item belongs; each microservice to which the unified configuration item belongs includes the target microservice; According to the update configuration information in the update configuration item, update the separate configuration file of the target microservice; The updated separate configuration file corresponding to the target microservice is sent to the microservice gateway to instruct the microservice gateway to apply the updated separate configuration file.

2. The method according to claim 1, characterized in that The step of determining that the updated configuration item carried in the configuration update requirement is a unified configuration item of the target microservice in the microservice gateway includes: Matching the updated configuration items carried in the configuration update requirement with the unified configuration items of the target microservice in the microservice gateway; If the match is successful, it is determined that the updated configuration item carried in the configuration update requirement is a unified configuration item of the target microservice in the microservice gateway.

3. The method according to claim 1, characterized in that The separating process of the unified configuration item according to the configuration update requirement to obtain a separate configuration file of each microservice to which the unified configuration item belongs includes: According to the configuration update requirements, create an initial configuration file for each microservice to which the unified configuration item belongs; In each initial configuration file, the unified configuration item is added to obtain a separate configuration file for each microservice to which the unified configuration item belongs.

4. The method according to claim 1, characterized in that The unified configuration items of the target microservice in the microservice gateway are constructed in the following way: Obtain microservice configuration items of the target microservice; When it is determined that the microservice configuration items of the target microservice are consistent or similar to the microservice configuration items of other microservices, the consistent or similar microservice configuration items are used as unified configuration items of the target microservice in the microservice gateway.

5. The method according to claim 1, characterized in that The separating process of the unified configuration item according to the configuration update requirement to obtain a separate configuration file of each microservice to which the unified configuration item belongs includes: If the number of the target users is at least two, selecting the current user from each target user according to the priority of each target user; According to the configuration update demand initiated by the current user for the target microservice, the unified configuration item is separated and processed to obtain separate configuration files of each microservice to which the unified configuration item belongs.

6. The method according to any one of claims 1 to 5, characterized in that The update configuration items include at least a gateway routing rule configuration item and a microservice function configuration item; the microservice function configuration items include at least an authentication function configuration item and a log storage function configuration item.

7. A configuration management device, characterized in that: The device comprises: A configuration separation module is used to obtain a configuration update requirement initiated by a target user for a target microservice, and when it is determined that the update configuration item carried in the configuration update requirement is a unified configuration item of the target microservice in the microservice gateway, separate the unified configuration item according to the configuration update requirement to obtain separate configuration files for each microservice to which the unified configuration item belongs; each microservice to which the unified configuration item belongs includes the target microservice; A configuration update module, used to update a separate configuration file of the target microservice according to the update configuration information in the update configuration item; The configuration application module is used to send the updated separate configuration file corresponding to the target microservice to the microservice gateway to instruct the microservice gateway to apply the updated separate configuration file.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

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

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

Citation Information

Patent Citations

  • Service management method and device, storage medium and electronic equipment

    CN110032392A

  • Microservice item configuration method, microservice item configuration device and medium

    CN117251173A

  • Micro-service updating method and device, electronic equipment and storage medium

    CN117331581A

  • Distributed micro-service updating method and device, electronic equipment and storage medium

    CN118158086A

  • Managing a distributed microservice architecture as a monolithic distribution

    US20210075877A1