Configuration management method for configuration management tool
Through the hierarchical configuration management structure and permission isolation strategy, the problem of insufficient key management in the existing configuration management tools is solved, and the unified management of keys and configuration data is realized, the complexity of system integration is reduced, and configuration management efficiency and security is improved.
Patent Information
- Application Number
- CN202510460497.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-14
- Publication Date
- 2025-08-22
- Estimated Expiration
- 2045-04-14
AI Technical Summary
The lack of key management of existing configuration management tools leads to complex system integration, increasing the complexity and integration difficulty of the system, and the sensitive data management process is fragmented and has low security.
Adopt a hierarchical configuration management structure to uniformly manage configuration data and keys. Through multi-level nested parsing and permission isolation policies, unified management of keys and configuration data is achieved, reducing system integration complexity and improving security.
It realizes unified management of keys and configuration data, reduces system integration complexity, improves configuration management efficiency and security, and supports application requirements for complex business scenarios.
Smart Images

Figure CN119987902B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of configuration management tools, and in particular to a configuration management method for a configuration management tool. Background Art
[0002] Currently, common distributed configuration management tools on the market can provide basic functions such as configuration storage and dynamic loading, providing configuration tool support for application objects. Although existing configuration management tools have improved configuration management efficiency to a certain extent, they lack native support for keys. This means that sensitive data requires the configuration management tools to be managed in conjunction with additional tools, which increases system complexity and integration difficulties, and fragments the system configuration management process. Summary of the Invention
[0003] The technical problem to be solved by the present invention is: a configuration management method for a configuration management tool, so as to solve the problem that the existing configuration management tools lack key management, resulting in complex system integration.
[0004] In order to solve the above technical problems, the present invention adopts a technical solution: a configuration management method of a configuration management tool, wherein the configuration management tool is used to manage configuration data and keys, comprising the following steps:
[0005] S1. Dividing the configuration data according to a plurality of predefined management levels to form a hierarchical configuration management structure;
[0006] S2. The variables of the configuration data and / or the key support referencing other keys and / or other variables; performing nested parsing on the other keys and / or other variables referenced by the configuration data or the key according to a preset priority order of the hierarchical configuration management structure;
[0007] S3. Within the same management level, the configuration data and the key adopt a unified management mechanism; and the plurality of management levels are respectively provided with permission isolation policies to limit the access rights of the management levels.
[0008] The beneficial effects of the present invention are as follows: the configuration management method provided by the present invention manages keys and configuration data in a unified manner, avoids the system from using multiple management tools, reduces the complexity of system integration, and avoids the exposure of keys due to multiple system calls during development or operation and maintenance. The configuration management method not only improves the efficiency of configuration management, but also improves the security of the system; in addition, the configuration management method divides the configuration data and keys into fine hierarchical levels, so that the configuration management method can meet the application requirements of complex business scenarios; in addition, the different management levels of the configuration management method adopt a permission isolation strategy for permission isolation to ensure the security of configuration data and keys. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] Figure 1 This is a flowchart of the configuration management method of the configuration management tool described in the present invention. DETAILED DESCRIPTION
[0010] To illustrate the technical content, achieved objectives and effects of the present invention in detail, the following description is given in conjunction with the embodiments and accompanying drawings.
[0011] Please refer to Figure 1 The present invention provides a configuration management method for a configuration management tool, wherein the configuration management tool is used to manage configuration data and keys, comprising the following steps:
[0012] S1. Dividing the configuration data according to a plurality of predefined management levels to form a hierarchical configuration management structure;
[0013] S2. The variables of the configuration data and / or the key support referencing other keys and / or other variables; performing nested parsing on the other keys and / or other variables referenced by the configuration data or the key according to a preset priority order of the hierarchical configuration management structure;
[0014] S3. Within the same management level, the configuration data and the key adopt a unified management mechanism; and the plurality of management levels are respectively provided with permission isolation policies to limit the access rights of the management levels.
[0015] From the above description, it can be seen that the beneficial effects of the present invention are: the configuration management method provided by the present invention uniformly manages keys and configuration data, avoids the system using multiple sets of management tools, reduces the complexity of system integration, and avoids the exposure of keys due to the call of multiple sets of tools during development or operation and maintenance. This configuration management method not only improves the efficiency of configuration management, but also improves the security of the system; in addition, the configuration management method performs a refined hierarchical division of configuration data and keys, so that the configuration management method can meet the application requirements of complex business scenarios; in addition, the different management levels of the configuration management method adopt a permission isolation strategy for permission isolation to ensure the security of configuration data and keys.
[0016] Furthermore, the multiple management levels include: namespace global configuration, cluster global configuration, environment global configuration and application private configuration.
[0017] From the above description, it can be seen that configuration data and keys can be divided into four management levels. Each management level has independent management configuration, and the variables of the configuration data of one management level can reference the variables of the configuration data in the other three management levels to achieve multi-level nesting and flexible combination of configuration data, forming a hierarchical configuration management structure, improving the flexibility of configuration management, and meeting the configuration management needs of different management levels.
[0018] Furthermore, in step S2, the variables of the configuration data and / or the keys support referencing other keys and / or other variables, including:
[0019] The variables of the configuration data and / or the key reference the other variables through a first tag format; the variables of the configuration data and / or the key reference the other keys through a second tag format; the other variables and the other keys are both tag variables of the configuration data.
[0020] As can be seen from the above description, the configuration management method enables variables or keys of configuration data to reference other variables or keys by presetting a tag format, and distinguishes the types of the tag variables referenced by the tag format.
[0021] Furthermore, in step S2, nested parsing is performed on the configuration data or the other keys and / or the other variables referenced by the key according to a preset priority order of the hierarchical configuration management structure, including the following steps:
[0022] S21. Match the tag variable in the configuration data using a regular expression, and identify the tag variable as the other key or the other variable;
[0023] S22: If the tag variable is matched, searching for a variable value or a key value corresponding to the tag variable according to a preset priority order of the hierarchical configuration management structure;
[0024] S23. Replace the mark variable in the configuration data with the variable value or the key value;
[0025] S24. Recursively search whether the configuration data contains other tag variables; if the configuration data contains other tag variables, repeat steps S21 to S23 until all tag variables of the configuration data are parsed and the regular expression cannot match any new tag variables.
[0026] From the above description, it can be seen that the variables or keys of the configuration data of this configuration management method can reference other variables or other keys, and a multi-level dynamic parsing mechanism is adopted when parsing the configuration data or keys. The order of nested parsing is based on the preset priority order of the hierarchical configuration management structure. This configuration management method can ensure that its configuration data or key parsing logic is clear and does not conflict.
[0027] Furthermore, in step S3, within the same management level, the key and the configuration data adopt a unified management mechanism including: encrypting and storing the value of the key.
[0028] From the above description, it can be seen that the configuration management method can ensure the security of the key.
[0029] Further, the configuration data references a key of the secret key;
[0030] When the variable of the configuration data references the key of the secret key and the configuration data is acquired by the application object, the secret key is decrypted to acquire the value of the secret key.
[0031] As can be seen from the above description, the content of the key is parsed only when the configuration data is obtained by the application object.
[0032] Furthermore, when a variable of the configuration data references other variables or other keys, and the other variables or the other keys are changed, the configuration data is modified according to the changed other variables or other keys.
[0033] As can be seen from the above description, this configuration management method can realize that configuration data supports dynamic variable references and can realize configuration parsing and dynamic changes in complex scenarios.
[0034] Furthermore, the management mechanism includes at least one or more of a default value of the management level, a priority of the management level, and an overlay logic of the management level.
[0035] As can be seen from the above description, each management level can set independent default values, priorities, and override logic to enable the configuration management method to adapt to complex business scenarios.
[0036] Furthermore, the method further includes the following steps: performing a similarity comparison on all configuration data, and defining a configuration template according to the similarity comparison result;
[0037] The same or similar configuration data is stored based on the configuration template.
[0038] As can be seen from the above description, the configuration management method can abstract repeated or similar configuration data into reusable configuration templates, and apply the configuration templates to multiple environments or applications to reduce configuration redundancy and improve maintenance efficiency.
[0039] Furthermore, the method further includes the following steps: monitoring configuration change events, and when the configuration change event occurs, pushing the corresponding configuration data to the target application object.
[0040] From the above description, it can be seen that this configuration management method supports dynamic loading and change notification. After a configuration change event occurs in the configuration data, the system automatically pushes the configuration data of the change event to the relevant applications without manual restart or redeployment. This configuration management method has high configuration management efficiency.
[0041] Example 1
[0042] Please refer to Figure 1 A first embodiment of the present invention provides a configuration management method for a configuration management tool, wherein the configuration management tool is used to manage configuration data and keys, comprising the following steps:
[0043] S1. Dividing the configuration data according to a plurality of predefined management levels to form a hierarchical configuration management structure;
[0044] S2. The variables of the configuration data and / or the key support referencing other keys and / or other variables; performing nested parsing on the other keys and / or other variables referenced by the configuration data or the key according to a preset priority order of the hierarchical configuration management structure;
[0045] S3. Within the same management level, the configuration data and the key adopt a unified management mechanism; and the plurality of management levels are respectively provided with permission isolation policies to limit the access rights of the management levels.
[0046] Existing configuration management tools (such as Spring Cloud Config, Consul, etcd, etc.) lack native support for secrets. The management of sensitive data (such as API keys and passwords) often requires additional tools (such as Vault or Key Management Service), resulting in a lack of unified management of secrets and configuration data. This can easily lead to confusion in management and usage during development and operations. The invocation of multiple tools can easily expose secrets, resulting in poor system integration and security. Furthermore, existing configuration management tools only support single-layer parsing and cannot implement multi-level nested references to environment variables. This limits the flexibility of configuration data expression and makes it impossible to dynamically generate complete configuration information by nesting references to other variables or secrets in complex configuration scenarios.
[0047] Different from existing configuration management tools, the configuration management method provided in this embodiment can provide native support for keys and uniformly manage keys and configuration data. The configuration management tool that applies this method supports multi-level nested references of variables. The multi-level nested references of variables and the multi-level nested parsing mechanism of variables improve the parsing capability of the configuration management tool and solve the problem of separation of key and configuration data management.
[0048] Specifically, the variables or keys of the configuration management tool in this embodiment support referencing other variables or other keys, so that keys and environment variables can be embedded in the configuration data through multi-level references, so that the environment variables and keys can be obtained and parsed when the configuration data is called and parsed, and the parsing of the configuration data or keys is strictly carried out in accordance with the preset priority order of the hierarchical configuration management structure to ensure that the parsing logic is clear and there is no conflict.
[0049] In addition, the configuration management method provided in this embodiment can divide configuration data and / or keys according to multiple predefined management levels; on the one hand, each management level sets up an independent management mechanism according to management needs, which can improve the flexibility of configuration management; on the other hand, users are allowed to flexibly combine the various management levels according to business needs to form a hierarchical configuration management structure.
[0050] It is easy to understand that since the variables or keys of the configuration management tool of the configuration management method of this embodiment support the application of other variables or keys, the configuration data or keys in one management level can use the configuration data in other management levels as other variables, and / or use the keys in other management levels as other keys, thereby realizing flexible combination and multi-level nested reference between configuration data and / or keys belonging to different management levels.
[0051] In step S2 of this embodiment, the variables of the configuration data and / or the key support referencing other keys and / or other variables, including:
[0052] The variables of the configuration data and / or the key reference the other variables through a first tag format; the variables of the configuration data and / or the key reference the other keys through a second tag format; the other variables and the other keys are both tag variables of the configuration data.
[0053] Accordingly, in step S2 of this embodiment, nested parsing is performed on the configuration data or the other keys and / or the other variables referenced by the key according to the preset priority order of the hierarchical configuration management structure, including the following steps:
[0054] S21. Match the tag variable in the configuration data using a regular expression, and identify the tag variable as the other key or the other variable;
[0055] S22: If the tag variable is matched, searching for a variable value or a key value corresponding to the tag variable according to a preset priority order of the hierarchical configuration management structure;
[0056] S23. Replace the mark variable in the configuration data with the variable value or the key value;
[0057] S24. Recursively search whether the configuration data contains other tag variables; if the configuration data contains other tag variables, repeat steps S21 to S23 until all tag variables of the configuration data are parsed and the regular expression cannot match any new tag variables.
[0058] In this embodiment, when a variable of the configuration data references other variables or other keys, and the other variables or the other keys are changed, the configuration data is modified according to the changed other variables or other keys.
[0059] As an example: configuration data and / or keys reference other variables using a first tag format ${tag}, and configuration data and / or keys reference other keys using a second tag format *{tag}; a configuration data variable db_connection is set to the value of: server=${mysql_host};user_id=root;database=db1;password=*{mysql_pwd}; the variable db_connection references the other variable mysql_host using the first tag format and the other key mysql_pwd using the second tag format. This method of implementing multi-level variable references using different tag formats facilitates unified management and facilitates distinguishing tagged variables as variables or keys based on the tag format. According to the configuration management method provided in this embodiment, when the variable mysql_host changes, as long as the variable mysql_host is modified, all other variables that reference mysql_host will be modified accordingly. For example, the variable db_connection will change its subvariable server=${mysql_host}, while the other subvariables of the variable db_connection remain unchanged, thereby achieving dynamic changes in configuration data.
[0060] The configuration management method provided in this embodiment can support nested parsing, significantly improving the dynamic parsing capability and configuration expression capability of the configuration management tool.
[0061] In order to ensure the security of the key, in step S3 of this embodiment, within the same management level, the key and the configuration data adopt a unified management mechanism including: encrypting and storing the value of the key.
[0062] In detail, the configuration data references the key of the key; when the variable of the configuration data references the key of the key and the configuration data is obtained by the application object, the key is decrypted to obtain the value of the key.
[0063] In this embodiment, when the configuration data is applied to the key, only the key of the key is saved in the configuration data. Only when the configuration data is obtained by the application object, the value of the key is parsed.
[0064] For example, the key *{mysql_pwd} is referenced in the configuration data variable. The configuration data variable only contains the key value. The configuration data variable is parsed in the application object, and the referenced key *{mysql_pwd} is securely decrypted and the true value of the key is returned. The security verification is passed through the true value of the key.
[0065] A system that applies the configuration management method provided in this embodiment does not need to use multiple sets of tools to manage configuration data and keys separately. Instead, configuration data and keys are managed uniformly through configuration management tools. This can reduce the complexity of system integration, reduce the risk of exposing keys during development or operation and maintenance, and improve the management efficiency and security of the system that applies the configuration management method.
[0066] Specifically, in this embodiment, the multiple management levels include: namespace global configuration, cluster global configuration, environment global configuration and application private configuration.
[0067] In detail, this embodiment sets four predefined management levels for the configuration management tool according to the role of the configuration and the application object; among them, the namespace global configuration is the common configuration shared within the same namespace; the cluster global configuration is the configuration that is effective for all nodes under the same cluster; the environment global configuration is the environment-level configuration for development, testing, and production environments; and the application private configuration is the configuration specific to a single application object.
[0068] In this embodiment, within the same management level, the configuration data and the key adopt a unified management mechanism; wherein the management mechanism includes at least one or more of the default value of the management level, the priority of the management level, and the coverage logic of the management level.
[0069] To further enhance the security of this configuration management method, the method also implements permission isolation policies for each of the multiple management levels to restrict their access rights. By limiting the access rights of each management level, access to and management of configuration data is strictly restricted, ensuring the security of configuration data and keys.
[0070] In this embodiment, the preset priority order of the hierarchical configuration management structure is from low to high: namespace global configuration, cluster global configuration, environment global configuration and application private configuration.
[0071] For example, three configuration data are divided into namespace global configuration, cluster global configuration 1, and cluster global configuration 2. In the namespace global configuration, a variable named db_user=root is defined. Cluster global configuration 1 and cluster global configuration 1 define variables named db_user=user1 and db_user=user2, respectively. Because the cluster global configuration takes precedence over the namespace global configuration, cluster global configuration 1 and cluster global configuration 2 use user1 and user2 as the variable values, respectively, during parsing. For other configuration data in the cluster global configuration that does not match the variable named db_user in the cluster global configuration, the default value root provided by the variable named db_user in the namespace global configuration is used.
[0072] Because the configuration management method provided in this embodiment manages keys and configuration data in a unified manner and divides configuration data according to multiple predefined management levels, this may result in duplicate configuration data within the configuration management tool. To reduce the likelihood of duplicate configuration data within the configuration management tool, the configuration management method further includes the following steps: performing a similarity comparison on all configuration data, defining a configuration template based on the similarity comparison results; and storing identical or similar configuration data based on the configuration template.
[0073] The configuration management method provided in this embodiment can store repeated or similar configuration data as a reusable configuration template, and the configuration template supports parameterized configuration references.
[0074] As an example, the database connection configuration can configure its connection string or service endpoint to form the following database connection configuration template:
[0075] "DbProvider": {
[0076] "DefaultConnection": "Mysql"
[0077] },
[0078] "ConnectionStrings": {
[0079] "DefaultConnection": "${mysql_conn}",
[0080] "LocalizationConnection": "${i18n_conn}"
[0081] }
[0082] When connecting to the database through the above connection configuration template in different application objects or environments, you only need to specify the variable values for the connection configuration template.
[0083] The configuration management method provided in this embodiment can significantly reduce duplicate configuration data, improve the reusability of configuration data, reduce configuration data redundancy, and improve the maintenance efficiency of configuration management tools.
[0084] In this embodiment, the configuration management method further includes the steps of monitoring configuration change events and, when such a configuration change event occurs, pushing the corresponding configuration data to the target application object. The configuration management tool supports dynamic loading and real-time change notifications. After a user modifies a configuration, the system automatically pushes the changes to the relevant application objects, eliminating the need for manual restart or redeployment. This configuration management tool offers high real-time performance, improving system agility and availability.
[0085] In summary, the configuration management method provided by the present invention manages keys and configuration data in a unified manner, avoids the system from using multiple sets of management tools, reduces the complexity of system integration, and avoids the exposure of keys due to the call of multiple sets of tools during development or operation and maintenance. This configuration management method not only improves the efficiency of configuration management, but also improves the security of the system; in addition, this configuration management method divides the configuration data and keys into fine hierarchical levels, so that the configuration management method can meet the application requirements of complex business scenarios; in addition, different management levels of this configuration management method adopt a permission isolation strategy for permission isolation to ensure the security of configuration data and keys.
[0086] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent transformations made using the contents of the present invention's description and drawings, or directly or indirectly applied in related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A configuration management method for a configuration management tool, characterized in that: The configuration management tool is used to manage configuration data and keys, including the following steps: S1. Dividing the configuration data according to a plurality of predefined management levels to form a hierarchical configuration management structure; S2. The variables of the configuration data and the key support references to other keys and / or other variables; performing nested parsing on the variables of the configuration data or the other keys and / or other variables referenced by the key according to a preset priority order of the hierarchical configuration management structure; S3. Within the same management level, the configuration data and the key adopt a unified management mechanism; and permission isolation policies are set for each of the multiple management levels to limit the access rights of the management levels; In step S2, nested parsing is performed on the variables of the configuration data or the other keys and / or the other variables referenced by the key according to the preset priority order of the hierarchical configuration management structure, including the following steps: S21. Match the tag variable in the configuration data using a regular expression, and identify the tag variable as the other key or the other variable; S22: If the tag variable is matched, searching for a variable value or a key value corresponding to the tag variable according to a preset priority order of the hierarchical configuration management structure; S23. Replace the mark variable in the configuration data with the variable value or the key value; S24, recursively searching whether the configuration data contains other tag variables; if the configuration data contains other tag variables, repeating steps S21 to S23 until all tag variables in the configuration data are parsed and the regular expression cannot match any new tag variables; The multiple management levels include: namespace global configuration, cluster global configuration, environment global configuration and application private configuration; In the step S3, within the same management level, the key and the configuration data adopt a unified management mechanism including: encrypting and storing the value of the key.
2. The configuration management method according to claim 1, wherein: In step S2, the variables of the configuration data and the key support referencing other keys and / or other variables, including: The variables of the configuration data and / or the key reference the other variables through a first tag format; the variables of the configuration data and / or the key reference the other keys through a second tag format; the other variables and the other keys are both tag variables of the configuration data.
3. The configuration management method according to claim 1, wherein: The configuration data references a key of the secret key; When the variable of the configuration data references the key of the secret key and the configuration data is acquired by the application object, the secret key is decrypted to acquire the value of the secret key.
4. The configuration management method according to claim 1, wherein: When a variable of the configuration data references other variables or other keys, and the other variables or the other keys are changed, the variable of the configuration data is modified according to the changed other variables or other keys.
5. The configuration management method according to claim 1, wherein: The management mechanism includes at least one or more of a default value of the management level, a priority of the management level, and an overriding logic of the management level.
6. The configuration management method according to claim 1, characterized in that: The following steps are also included: Perform similarity comparison on all configuration data and define configuration templates based on the similarity comparison results; The same or similar configuration data is stored based on the configuration template.
7. The configuration management method according to claim 1, characterized in that: The following steps are also included: Monitor configuration change events, and when the configuration change event occurs, push the corresponding configuration data to the target application object.
Citation Information
Patent Citations
Multi-layer key configuration method and device
CN115766086A