CN114398151A - Configuration management method, device, equipment and storage medium - Google Patents

Configuration management method, device, equipment and storage medium Download PDF

Info

Publication number
CN114398151A
CN114398151A CN202210028021.9A CN202210028021A CN114398151A CN 114398151 A CN114398151 A CN 114398151A CN 202210028021 A CN202210028021 A CN 202210028021A CN 114398151 A CN114398151 A CN 114398151A
Authority
CN
China
Prior art keywords
configuration information
namespace
configuration
target
information corresponding
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210028021.9A
Other languages
Chinese (zh)
Inventor
李�瑞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Kingsoft Cloud Network Technology Co Ltd
Original Assignee
Beijing Kingsoft Cloud Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Kingsoft Cloud Network Technology Co Ltd filed Critical Beijing Kingsoft Cloud Network Technology Co Ltd
Priority to CN202210028021.9A priority Critical patent/CN114398151A/en
Publication of CN114398151A publication Critical patent/CN114398151A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Abstract

The present disclosure relates to a configuration management method, apparatus, device, and storage medium, the method comprising: reading first configuration information corresponding to each namespace; determining a hierarchical relationship among the namespaces and a target namespace; and merging the first configuration information corresponding to each namespace based on the hierarchical relationship to obtain the target configuration information corresponding to the target namespace. According to the embodiment of the disclosure, the configuration information of the namespaces is merged according to the hierarchical relationship among the namespaces to obtain the configuration information of the target namespace, so that configuration management of tenants, projects and resource groups at even more levels is realized.

Description

Configuration management method, device, equipment and storage medium
Technical Field
The present disclosure relates to the field of data processing technologies, and in particular, to a configuration management method, apparatus, device, and storage medium.
Background
In recent years, kubernets containerization service has become popular with the development of containerization technology, which is an open source application for managing containerization on multiple hosts in a cloud platform.
The application program instances in kubernets are no longer limited to multi-tenant scenarios, and even a certain resource group or a certain project of a tenant can independently deploy a set of application program instances. The existing configuration management model can not support configuration management of tenants, projects, resource groups and even more levels.
Disclosure of Invention
In order to solve the technical problems or at least partially solve the technical problems, the present disclosure provides a configuration management method, apparatus, device and storage medium, which implement configuration management of tenants, projects and resource groups at even more levels.
In a first aspect, an embodiment of the present disclosure provides a configuration management method, where the method includes:
reading first configuration information corresponding to each namespace;
determining a hierarchical relationship among the namespaces and a target namespace;
and merging the first configuration information corresponding to each namespace based on the hierarchical relationship to obtain the target configuration information corresponding to the target namespace.
In a second aspect, an embodiment of the present disclosure provides a configuration management apparatus, including:
the first configuration information reading module is used for reading the first configuration information corresponding to each namespace;
the hierarchical relation determining module is used for determining the hierarchical relation among the namespaces and the target namespace;
and the target configuration information determining module is used for merging the first configuration information corresponding to each namespace based on the hierarchical relationship to obtain the target configuration information corresponding to the target namespace.
In a third aspect, an embodiment of the present disclosure provides an electronic device, including:
a memory;
a processor; and
a computer program;
wherein the computer program is stored in the memory and configured to be executed by the processor to implement the configuration management method as described in the first aspect above.
In a fourth aspect, the disclosed embodiments provide a computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, implements the configuration management method as described in the first aspect above.
The configuration management method, device, equipment and storage medium provided by the embodiment of the disclosure include: reading first configuration information corresponding to each namespace; determining a hierarchical relationship among the namespaces and a target namespace; and merging the first configuration information corresponding to each namespace based on the hierarchical relationship to obtain the target configuration information corresponding to the target namespace. According to the embodiment of the disclosure, the configuration information of the namespaces is merged according to the hierarchical relationship among the namespaces to obtain the configuration information of the target namespace, so that configuration management of tenants, projects and resource groups at even more levels is realized.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
In order to more clearly illustrate the embodiments or technical solutions in the prior art of the present disclosure, the drawings used in the description of the embodiments or prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive exercise.
Fig. 1 is a flowchart of a configuration management method according to an embodiment of the present disclosure;
fig. 2 is a flow chart of configuration acquisition provided by an embodiment of the present disclosure;
fig. 3 is a schematic structural diagram of a configuration management apparatus according to an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of a configuration management device according to an embodiment of the present disclosure.
Detailed Description
In order that the above objects, features and advantages of the present disclosure may be more clearly understood, aspects of the present disclosure will be further described below. It should be noted that the embodiments and features of the embodiments of the present disclosure may be combined with each other without conflict.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present disclosure, but the present disclosure may be practiced in other ways than those described herein; it is to be understood that the embodiments disclosed in the specification are only a few embodiments of the present disclosure, and not all embodiments.
A common configuration manager has a Nacos management model, an Apollo management model, and a configuration management tool for storing the configuration of applications.
The Nacos management model is an open-source platform easy to use and is specially designed for dynamic service discovery, configuration and service management. Cloud native applications and micro-service platforms may be constructed. The Nacos supports essentially all types of services today, for example, the kubernets service.
The Apollo management model is an open source configuration management center developed by a portable framework department, can be used for centrally managing the configuration of different environments and different clusters, can be pushed to an application end in real time after configuration modification, and has the characteristics of standard authority, flow control and the like.
In the face of a complex deployment scenario, Apollo and Nacos both have different management models.
The Apollo management model mainly comprises: application (Application), Environment (Environment), Cluster (Cluster), and Namespace (Namespace).
The Application (Application) is managed by taking the Application as a main dimension in the Apollo configuration center, can manage configuration information applied to different environments and different clusters, and can be divided into different namespaces for management.
Environment (Environment) a general usage scenario refers to a development Environment, a test Environment, a production Environment, and the like.
Cluster (Cluster) refers to a grouping of different instances of an application, for example, in a production environment, the application instances of shanghai computer rooms are divided into a Cluster, and the application instances of beijing computer rooms are divided into a Cluster.
Namespace (Namespace) refers to a packet that applies different configurations, which can be analogized to a configuration file.
The Nacos management model mainly comprises: namespace (Namespace), configuration Group (Group), configuration set (dataId).
The Namespace (Namespace) in the Nacos management model is completely different from the Namespace concept in the Apollo management model, and the Namespace is a relatively general concept and can refer to different tenants, different environments and the like.
A configuration Group (Group) is generally a collection of configuration sets with certain relationships. For example: a product may be a configuration group and a module (application) may also be a configuration group.
Configuration set (dataId): typically a configuration file is a configuration set.
From the Apollo management model and the Nacos management model, it can be seen that the Apollo management model and the Nacos management model can both support configuration management of different environments and different instances, and the Nacos management model can be applied to a multi-tenant scene due to the simple and open model. However, kubernets containerization service is gradually popularized, application program instances are not limited to multi-tenant scenarios, and even a certain resource group or a certain project of a tenant can independently deploy a set of application program instances. This requires that the configuration management tool be able to support even more levels of configuration management for tenants, projects, resource groups. Because the tenant, the project and the resource group have an inclusion relationship, each level of configuration can set unique configuration information and also inherit the configuration information of the previous level. In these scenarios, neither the existing Apollo management model nor the Nacos management model can be satisfied.
To solve the problem, the embodiments of the present disclosure provide a configuration management method, which combines configuration information of namespaces step by step according to parent-child relationships between the namespaces to obtain configuration information of a child-level namespace, thereby implementing configuration management of tenants, projects, resource groups and even more levels. The method is described below with reference to specific examples.
In the present disclosure, a new configuration management model is constructed, which mainly includes: namespace (Namespace), configuration Group (Group), and configuration item (Config).
In the newly-built configuration management model, the namespace is a relatively general concept, for example: the namespaces may refer to different tenants, may also refer to different environments, may also refer to one cluster, and the like.
A configuration Group (Group) is generally a collection of configuration sets with certain relationships. For example: a product may be a configuration group and a module (application) may also be a configuration group.
The configuration item consists of a configuration name (key), a configuration content (value) and a configuration format (form), and can be one configuration item or one configuration file. The key may be a name of the configuration item or a name of the configuration file. The configuration content is configuration content saved based on a configuration format. The configuration format may be a common configuration format such as xml, yaml, json, properties, etc., and in this embodiment, only the configuration format is described, but not limited.
It should be noted that the namespaces described below in this disclosure all refer to namespaces in the new configuration management model; the configuration groups described below in this disclosure all refer to configuration groups in a new configuration management model; the configuration items described below in this disclosure all refer to configuration items in the new configuration management model.
It should be noted that the configuration management method provided by the present disclosure is implemented by the configuration management model provided above. The specific introduction is as follows:
fig. 1 is a flowchart of a configuration management method according to an embodiment of the present disclosure; as shown in fig. 1, the configuration management method provided in the embodiment of the present disclosure mainly includes the following steps:
and S11, reading the first configuration information corresponding to each namespace.
In this embodiment, the namespace may include a namespace representing any one of a Cluster (Cluster), a tenant (tenant), a project (project), and a resource group (resourcegroup) in the kubernets containerization service. The Cluster (Cluster), tenant (tenant), project (project) and resource group have a containment relationship, that is, one Cluster includes one or more tenants, one tenant includes one or more projects, and one project includes one or more resource groups.
When the service is used, different levels of configuration are distinguished by different name prefixes, for example, cluster-k8s1 represents a k8s1 cluster, and cluster-k8s2 represents a k8s2 cluster. Group may represent an application instance name, such as standard-query representing a standard data query application. config can be a configuration file, such as application. yaml, then value is the configuration file content, and form is yaml.
The configuration information may be the configuration packet or the configuration item. The first configuration information refers to namespace-independent configuration information. The first configuration information refers to a namespace independent deployment set of application program instances or configuration information.
Specifically, the existing kubernets containerization service can independently deploy a set of configuration information for a cluster, a tenant, a project and a resource group. Namely, a set of configuration information can be independently deployed for the cluster, a set of configuration information can be independently deployed for the tenant, a set of configuration information can be independently deployed for the project, and a set of configuration information can be deployed for the resource assembly.
In this embodiment, the configuration management model reads the independent configuration information of each namespace through the reading interface.
And S12, determining the hierarchical relation among the namespaces and the target namespace.
Wherein, the hierarchical relationship between the namespaces can be understood as the relationship of the hierarchy level between the namespaces. Specifically, the cluster comprises tenants, and the hierarchy of the cluster is higher than that of the tenants; the tenant comprises an item, and the hierarchy level of the tenant is higher than that of the item; the items include resource groups, with the level of the items being higher than the resource groups. Wherein, the hierarchical relationship is determined by a Kubernets containerization service platform. In this embodiment, the target namespace is the namespace currently read. Optionally, the target namespace is the lowest hierarchical namespace, i.e., a resource group.
In one possible embodiment, a method of determining a namespace hierarchy is provided. The hierarchical information thereof may be carried in parameters of the respective namespaces. Further, the hierarchy of the namespace may be represented by a predetermined parameter. For example: and setting parameters of the cluster, the tenant, the project and the resource group to be 0, 1, 2 and 3 respectively. 0 means the cluster is the highest level namespace; 1 means that the tenant is lower in hierarchy than the cluster and higher in hierarchy than the project; 2, the item is higher than the resource group and lower than the tenant; and 3 denotes that a resource group is the lowest hierarchical namespace.
In one possible embodiment, another method of determining a namespace hierarchy is provided. The hierarchical relationship among the namespaces is stored in the configuration management model in advance, namely the hierarchical relationship among the namespaces is a cluster, a tenant, a project and a resource group from high to low in sequence. And if the configuration management model reads the first configuration information of the tenant and the first configuration information of the cluster, determining that the cluster is a parent-level namespace of the item according to the pre-stored parent-child relationship.
In one possible embodiment, another method of determining a namespace hierarchy is provided. And determining the hierarchical relation of each namespace according to the sequence of reading each namespace. For example: the first namespace level read is highest, the following successively read namespaces have lower levels in turn, and the last namespace level read is lowest.
It should be noted that the above-mentioned method for determining the hierarchical relationship of the namespaces is only exemplary, but not limited, and the hierarchical relationship between the namespaces of each level may be determined in a suitable manner according to the actual application condition of the configuration management model.
And S13, merging the first configuration information corresponding to each namespace based on the hierarchical relationship to obtain the target configuration information corresponding to the target namespace.
The first configuration information corresponding to each namespace is merged, which can be understood as that the first configuration information corresponding to all namespaces is integrated together to be used as the target configuration information corresponding to the target namespace.
Specifically, the first configuration information corresponding to the cluster, the first configuration information corresponding to the tenant, the first configuration information corresponding to the project, and the first configuration information corresponding to the resource group are all integrated into one entity, and the integrated entity is used as a target namespace, that is, target configuration information of the resource group.
Merging the first configuration information corresponding to each namespace based on the hierarchical relationship may include: and merging the first configuration information corresponding to each namespace from high to low according to the hierarchical relationship. For example: merging the first configuration information corresponding to the cluster and the first configuration information corresponding to the tenant, merging the merged first configuration information corresponding to the project and finally merging the merged first configuration information corresponding to the resource group to obtain a target namespace, namely the target configuration information of the resource group.
Merging the first configuration information corresponding to each namespace based on the hierarchical relationship, and obtaining the target configuration information corresponding to the target namespace comprises: and combining the first configuration information corresponding to each namespace in sequence from low to high according to the hierarchical relationship to obtain the target configuration information corresponding to the target namespace.
For example: merging the first configuration information corresponding to the resource group and the first configuration information corresponding to the project, merging the merged first configuration information with the first configuration information corresponding to the tenant, and finally merging the merged first configuration information with the first configuration information corresponding to the cluster to obtain a target namespace, namely the target configuration information of the resource group.
Specifically, when the standard data query application in a resource group reads the configuration of application.yaml, it needs to read the namespaces of a cluster, a tenant, a project, a resource group, and the like, and the standard-query application (standard-query) and the application.yaml corresponding to each of them, and sequentially merge the configuration contents in the application.yaml that are read, so as to obtain the configuration file content of the resource group.
In one possible embodiment, the first configuration information includes a configuration name, configuration content; merging the first configuration information corresponding to each namespace according to the hierarchical relationship from low to high in sequence to obtain the target configuration information corresponding to the target namespace, wherein the merging step comprises the following steps: in the merging process of the first configuration information, if the first configuration information with the same configuration name and different configuration contents exists, determining the first configuration information corresponding to the low-level namespace as the target configuration information corresponding to the target namespace.
It should be noted that each namespace may correspond to one or more pieces of first configuration information, and the number of the first configuration information corresponding to each namespace is not limited in this embodiment. Further, the configuration information may also be referred to as a configuration packet or a configuration item.
Further, the first configuration information includes a configuration name and configuration content. In the merging process of the first configuration information corresponding to the resource group and the first configuration information corresponding to the project, if the first configuration information with the same configuration name and different configuration contents exists, the first configuration information corresponding to the resource group is determined as the target configuration information corresponding to the resource group, and the first configuration information corresponding to the project is directly ignored without any processing.
And if the configuration information with the same configuration name and different configuration contents exists in the merging process, directly ignoring the first configuration information without any processing.
And merging the first configuration information corresponding to the resource group with the first configuration information corresponding to the project, merging the merged first configuration information with the first configuration information corresponding to the tenant to obtain target configuration information, and finally merging the merged target configuration information with the first configuration information corresponding to the cluster.
In the embodiment of the disclosure, a service side (client) maintains the hierarchical relationship of the namespaces, and target configuration information is determined according to the input sequence of the namespaces. Similarly, a high-level namespace can be set on the namespace, and when configuration information is read, all high-level namespaces are automatically and recursively inquired to determine target configuration information.
The configuration management method provided by the embodiment of the disclosure can independently manage configuration information of different levels; meanwhile, when the configuration information is read, the configuration information corresponding to the high-level naming space can be inherited, so that the configuration information of the high-level naming space can be shared, and the low-level naming space and the high-level naming space can independently set the information.
The present disclosure relates to a configuration management method, comprising: reading first configuration information corresponding to each namespace; determining a hierarchical relationship among the namespaces and a target namespace; and merging the first configuration information corresponding to each namespace based on the hierarchical relationship to obtain the target configuration information corresponding to the target namespace. According to the embodiment of the disclosure, the configuration information of the namespaces is merged according to the hierarchical relationship among the namespaces to obtain the configuration information of the target namespace, so that configuration management of tenants, projects and resource groups at even more levels is realized.
In one possible embodiment, determining the hierarchical relationship between the namespaces and the target namespace includes: determining the hierarchical relationship among the namespaces according to the sequence of reading the namespaces, wherein the namespaces with the reading time in the front are higher than the namespaces with the reading time in the back in the hierarchy; and determining the last read namespace as the target namespace.
In this embodiment, the precedence order of the read namespaces may be the precedence order of the read namespaces.
In one embodiment, the namespace that is read time first is hierarchically higher than the namespace that is read time later. For example: the first namespace read is higher in level than the second namespace read, the second namespace read is higher in level than the third namespace read, and the third namespace read is higher in level than the fourth namespace read.
Because the hierarchical relationship between the namespaces is determined by the Kubernets containerization service platform, the configuration management model does not know the hierarchical relationship between the namespaces, and therefore the hierarchical relationship of the configuration management model can be determined according to the setting of the Kubernets containerization service platform.
Preferably, the Kubernetes containerization service platform outputs the data in sequence according to the sequence of the cluster, the tenant, the project and the resource group, and then the namespace with the reading time before the configuration management model is higher than the namespace with the reading time after the configuration management model.
In one possible embodiment, the first configuration information further includes a configuration format; before merging the first configuration information corresponding to each namespace based on the hierarchical relationship, the method further includes: converting the first configuration information corresponding to each namespace into a Map format; after obtaining the target configuration information corresponding to the target namespace, the method further includes: and converting the target configuration information from a Map format into a configuration format included in the first configuration information.
In this embodiment, the configuration model is processed using a Map format, and therefore, before the first configuration information is merged, the first configuration information needs to be format-converted into the Map format. After the first configuration information is merged and processed, the target configuration information is obtained and then converted into the configuration format included in the first configuration information, so that the configuration information can be conveniently used by a subsequent program.
In an application implementation, as shown in fig. 2, the management flow of the configuration information mainly includes: and receiving input namespaces of all levels and corresponding distribution groups and configuration names. The final configuration content result (target configuration information) of the child level namespace is noted as resultConfigMap. Traversing the namespace and recording as ns, inquiring corresponding configuration content and configuration format from the first configuration information according to the ns, recording as ConfigForm and ConfigValue, analyzing the configuration content into Map format according to the configuration content and the configuration format, and recording as ConfigMap. The ConfigMap content is merged into the resultConfigMap, and the configuration content in the resultConfigMap is retained by the configuration name of the same name. And after the traversal is finished, converting the resultConfigMap into a corresponding configuration format, and using the resultConfigMap as final configuration information of the sub-level name space.
For example: the input cluster, tenant, project, resource group and independent configuration grouping and configuration name are received. The final configuration information for the resource group is recorded as resultConfigMap. Modifying the independent configuration information of the resource group into a Map format for storage, and combining the independent configuration information of the resource group into a resultConfigMap; then, according to the items, the configuration groups and the configuration names, corresponding configuration contents and configuration formats are inquired and are marked as ConfigForm1 and ConfigValue1, the configuration contents are analyzed into Map format storage according to the configuration contents and the configuration formats and are marked as ConfigMap1, the ConfigMap1 contents are merged into the resultConfigMap, and the configuration contents in the resultConfigMap are reserved by the configuration names with the same names. Then, according to the tenant, the configuration group and the configuration name, the corresponding configuration content and configuration format are inquired and are marked as ConfigForm2 and ConfigValue2, the configuration content is analyzed into Map format storage according to the configuration content and the configuration format and is marked as ConfigMap2, the ConfigMap2 content is merged into the resultConfigMap, and the configuration content in the resultConfigMap is reserved by the configuration name with the same name. Then, according to the cluster, the configuration group and the configuration name, corresponding configuration content and configuration format are inquired and are marked as ConfigForm3 and ConfigValue3, the configuration content is analyzed into Map format storage according to the configuration content and the configuration format and is marked as ConfigMap3, the ConfigMap3 content is merged into the resultConfigMap, and the configuration content in the resultConfigMap is reserved by the configuration name with the same name. And finally, converting the resultConfigMap into a configuration format corresponding to the resource group, and using the configuration format as final configuration information of the resource group.
Fig. 3 is a schematic structural diagram of a configuration management apparatus according to an embodiment of the present disclosure. The configuration management apparatus provided in the embodiment of the present disclosure may execute the processing procedure provided in the embodiment of the configuration management method, and as shown in fig. 3, the configuration management apparatus 30 provided in the embodiment of the present disclosure includes: a first configuration information reading module 31, a hierarchical relationship determining module 32, and a target configuration information determining module 33.
The first configuration information reading module 31 is configured to read first configuration information corresponding to each namespace;
a hierarchical relation determining module 32, configured to determine a hierarchical relation between the namespaces and a target namespace;
and the target configuration information determining module 33 is configured to merge the first configuration information corresponding to each namespace based on the hierarchical relationship, so as to obtain the target configuration information corresponding to the target namespace.
In one possible embodiment, the hierarchical relationship determination module includes: the hierarchical relation determining unit is used for determining the hierarchical relation among the namespaces according to the sequence of the read namespaces, wherein the namespaces read firstly are higher than the namespaces read later in hierarchy; and the target namespace determining unit is used for determining the last read namespace as the target namespace.
In a possible embodiment, the target configuration information determining module is specifically configured to merge the first configuration information corresponding to each namespace in sequence from low to high according to the hierarchical relationship, so as to obtain the target configuration information corresponding to the target namespace.
In one possible embodiment, the first configuration information includes a configuration name, configuration content; and the target configuration information determining module is specifically configured to determine, in the merging process of the first configuration information, if there is first configuration information with the same configuration name and different configuration contents, the first configuration information corresponding to the low-level namespace as the target configuration information corresponding to the target namespace.
In one possible embodiment, the first configuration information further includes a configuration format;
the device further comprises: the format conversion module is used for converting the first configuration information corresponding to each namespace into a Map format before merging the first configuration information corresponding to each namespace based on the hierarchical relationship; the format conversion module is further configured to convert the target configuration information from a Map format to a configuration format included in the first configuration information after obtaining the target configuration information corresponding to the target namespace.
The configuration management apparatus in the embodiment shown in fig. 3 may be configured to execute the technical solution of the above-mentioned configuration management method embodiment, and the implementation principle and the technical effect are similar, which are not described herein again.
Fig. 4 is a schematic structural diagram of an electronic device provided in an embodiment of the present disclosure. The electronic device may specifically be a client as described above, or a component in the client. The electronic device provided by the embodiment of the present disclosure may execute the processing procedure provided by the above configuration management method embodiment.
As shown in fig. 4, the electronic apparatus 40 includes: memory 41, processor 42, computer programs and communication interface 43; wherein the computer program is stored in the memory 41 and is configured to be executed by the processor 42 in a configuration management method as described above.
In addition, the embodiment of the present disclosure also provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to implement the configuration management method described in the above embodiment.
It is noted that, in this document, relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The foregoing are merely exemplary embodiments of the present disclosure, which enable those skilled in the art to understand or practice the present disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the disclosure. Thus, the present disclosure is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Further, while operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limitations on the scope of the disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims.

Claims (12)

1. A method for configuration management, the method comprising:
reading first configuration information corresponding to each namespace;
determining a hierarchical relationship among the namespaces and a target namespace;
and merging the first configuration information corresponding to each namespace based on the hierarchical relationship to obtain the target configuration information corresponding to the target namespace.
2. The method of claim 1, wherein determining the hierarchical relationship between the namespaces and the target namespace comprises:
determining the hierarchical relationship among the namespaces according to the sequence of reading the namespaces, wherein the namespaces read firstly are higher than the namespaces read later in hierarchy;
and determining the last read namespace as the target namespace.
3. The method according to claim 1, wherein merging the first configuration information corresponding to each namespace based on the hierarchical relationship to obtain the target configuration information corresponding to the target namespace comprises:
and combining the first configuration information corresponding to each namespace in sequence from low to high according to the hierarchical relationship to obtain the target configuration information corresponding to the target namespace.
4. The method of claim 3, wherein the first configuration information comprises a configuration name, configuration content;
merging the first configuration information corresponding to each namespace according to the hierarchical relationship from low to high in sequence to obtain the target configuration information corresponding to the target namespace, wherein the merging step comprises the following steps:
in the merging process of the first configuration information, if the first configuration information with the same configuration name and different configuration contents exists, determining the first configuration information corresponding to the low-level namespace as the target configuration information corresponding to the target namespace.
5. The method of claim 4, wherein the first configuration information further comprises a configuration format;
before merging the first configuration information corresponding to each namespace based on the hierarchical relationship, the method further includes:
converting the first configuration information corresponding to each namespace into a Map format;
after obtaining the target configuration information corresponding to the target namespace, the method further includes:
and converting the target configuration information from a Map format into a configuration format included in the first configuration information.
6. A configuration management apparatus, characterized in that the apparatus comprises:
the first configuration information reading module is used for reading first configuration information corresponding to each name space;
the hierarchical relation determining module is used for determining the hierarchical relation among the namespaces and the target namespace;
and the target configuration information determining module is used for merging the first configuration information corresponding to each namespace based on the hierarchical relationship to obtain the target configuration information corresponding to the target namespace.
7. The apparatus of claim 6, wherein the hierarchical relationship determination module comprises:
the hierarchical relation determining unit is used for determining the hierarchical relation among the namespaces according to the sequence of the read namespaces, wherein the namespaces read firstly are higher than the namespaces read later in hierarchy;
and the target namespace determining unit is used for determining the last read namespace as the target namespace.
8. The apparatus according to claim 6, wherein the target configuration information determining module is specifically configured to merge the first configuration information corresponding to each namespace in sequence from low to high according to the hierarchical relationship, so as to obtain the target configuration information corresponding to the target namespace.
9. The apparatus of claim 8, wherein the first configuration information comprises a configuration name, configuration content;
and the target configuration information determining module is specifically configured to determine, in the merging process of the first configuration information, if there is first configuration information with the same configuration name and different configuration contents, the first configuration information corresponding to the low-level namespace as the target configuration information corresponding to the target namespace.
10. The apparatus of claim 9, wherein the first configuration information further comprises a configuration format;
the device further comprises: the format conversion module is used for converting the first configuration information corresponding to each namespace into a Map format before merging the first configuration information corresponding to each namespace based on the hierarchical relationship;
the format conversion module is further configured to convert the target configuration information from a Map format to a configuration format included in the first configuration information after obtaining the target configuration information corresponding to the target namespace.
11. An electronic device, comprising:
a memory;
a processor; and
a computer program;
wherein the computer program is stored in the memory and configured to be executed by the processor to implement the method of any one of claims 1-5.
12. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-5.
CN202210028021.9A 2022-01-11 2022-01-11 Configuration management method, device, equipment and storage medium Pending CN114398151A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210028021.9A CN114398151A (en) 2022-01-11 2022-01-11 Configuration management method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210028021.9A CN114398151A (en) 2022-01-11 2022-01-11 Configuration management method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114398151A true CN114398151A (en) 2022-04-26

Family

ID=81231035

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210028021.9A Pending CN114398151A (en) 2022-01-11 2022-01-11 Configuration management method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114398151A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117251173A (en) * 2023-11-15 2023-12-19 深圳万物安全科技有限公司 Method for configuring micro-service items, device and medium for configuring micro-service items

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117251173A (en) * 2023-11-15 2023-12-19 深圳万物安全科技有限公司 Method for configuring micro-service items, device and medium for configuring micro-service items
CN117251173B (en) * 2023-11-15 2024-03-08 深圳万物安全科技有限公司 Micro-service item configuration method, micro-service item configuration device and medium

Similar Documents

Publication Publication Date Title
CN109951315B (en) Method and system for mapping YANG model to internal model
CN108964968A (en) Service access management method and system under a kind of container cloud environment
CN110019081A (en) Data persistence processing method, device, system and readable storage medium storing program for executing
CN109213519B (en) Heterogeneous API adaptation processing method and system
US9823991B2 (en) Concurrent workload simulation for application performance testing
CN104035754A (en) XML (Extensible Markup Language)-based custom code generation method and generator
CN109104317B (en) Big data cluster automatic configuration method and device based on Docker container
CN102236544B (en) Method and device for designing skins
CN108540351A (en) The automated testing method of distributed big data service
CN108763323B (en) Meteorological grid point file application method based on resource set and big data technology
CN107092502B (en) Automatic application configuration method and device based on cloud operating system
CN114398151A (en) Configuration management method, device, equipment and storage medium
CN110825395B (en) Multi-plug-in layered deployment system, device and medium
CN113079198A (en) Method and device for converting cloud platform interface protocol
CN114546563A (en) Multi-tenant page access control method and system
CN113778961A (en) Production management method, device and system for CIM model data
US9063959B2 (en) Decomposing XML schema documents into subsets
CN117112510A (en) Report template configuration method, device, equipment and storage medium
CN106951399B (en) Method and device for quickly generating ONIX standard file
CN112711419A (en) Data comparison method and device
CN112363700A (en) Cooperative creation method and device of intelligent contract, computer equipment and storage medium
US10469319B2 (en) Certification tool gap analyzer
CN111737784A (en) Board card type selection configuration method and device based on digital three-dimensional ZXMP S385 subframe
CN110688387A (en) Data processing method and device
CN113282276B (en) Model mapping method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination