CN112099879A - Configuration information management method and device, computer equipment and storage medium - Google Patents

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

Info

Publication number
CN112099879A
CN112099879A CN202011316780.2A CN202011316780A CN112099879A CN 112099879 A CN112099879 A CN 112099879A CN 202011316780 A CN202011316780 A CN 202011316780A CN 112099879 A CN112099879 A CN 112099879A
Authority
CN
China
Prior art keywords
configuration
template
item
preset
determining
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.)
Granted
Application number
CN202011316780.2A
Other languages
Chinese (zh)
Other versions
CN112099879B (en
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.)
Chengdu New Hope Finance Information Co Ltd
Original Assignee
Chengdu New Hope Finance Information 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 Chengdu New Hope Finance Information Co Ltd filed Critical Chengdu New Hope Finance Information Co Ltd
Priority to CN202011316780.2A priority Critical patent/CN112099879B/en
Publication of CN112099879A publication Critical patent/CN112099879A/en
Application granted granted Critical
Publication of CN112099879B publication Critical patent/CN112099879B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files

Abstract

The invention relates to the technical field of configuration management, and provides a configuration information management method, a device, computer equipment and a storage medium, which are applied to the computer equipment, wherein the computer equipment is stored with a plurality of preset configuration items in advance, and the same preset configuration item corresponds to different configuration values aiming at different operating environments, and the method comprises the following steps: receiving a first generation request for generating first configuration information, wherein the first generation request is used for determining a first operating environment and determining a first configuration template from at least one configuration template; determining a first configuration value corresponding to the preset configuration item of the first configuration template aiming at the first operating environment according to a pre-stored mapping relation between the configuration value used for representing each preset configuration item and the corresponding operating environment; and generating first configuration information adapted to the first operating environment according to the first configuration value. The invention can reduce the management workload of the configuration information and improve the management efficiency of the configuration information.

Description

Configuration information management method and device, computer equipment and storage medium
Technical Field
The present invention relates to the field of configuration management technologies, and in particular, to a method and an apparatus for managing configuration information, a computer device, and a storage medium.
Background
With the rapid development of the internet technology, services provided by the internet are more and more, the configuration of the services is more and more complex, each service corresponds to different configuration information, the configuration information of the same service in different operating environments is also different, and the complexity and difficulty of configuration management are greatly increased.
Disclosure of Invention
The invention aims to provide a configuration information management method, a configuration information management device, a computer device and a storage medium, which can efficiently manage configuration information.
In order to achieve the purpose, the technical scheme adopted by the invention is as follows:
in a first aspect, the present invention provides a configuration information management method applied to a computer device, where the computer device prestores at least one configuration template, each configuration template is suitable for a same service running in different running environments, the computer device prestores a plurality of preset configuration items, a same preset configuration item corresponds to different configuration values for different running environments, and each configuration template includes at least one preset configuration item in the plurality of preset configuration items, and the method includes: receiving a first generation request for generating first configuration information, wherein the first generation request is used for determining a first operating environment and determining a first configuration template from the at least one configuration template; determining a first configuration value corresponding to the preset configuration item of the first configuration template aiming at the first operating environment according to a pre-stored mapping relation between the preset configuration item and the configuration value of the corresponding operating environment; and generating the first configuration information adapted to the first operating environment according to the first configuration value.
In a second aspect, the present invention provides a configuration information management apparatus, applied to a computer device, where the computer device stores at least one configuration template in advance, each configuration template is suitable for a same service running in different running environments, the computer device stores a plurality of preset configuration items in advance, a same preset configuration item corresponds to different configuration values for different running environments, and each configuration template includes at least one preset configuration item in the plurality of preset configuration items, and the apparatus includes: the device comprises a receiving module, a first configuration module and a second configuration module, wherein the receiving module is used for receiving a first generation request for generating first configuration information, and the first generation request is used for determining a first operating environment and a first configuration template from the at least one configuration template; the determining module is used for determining a first configuration value corresponding to the preset configuration item of the first configuration template aiming at the first operating environment according to a mapping relation which is stored in advance and used for representing each preset configuration item and the configuration value of the corresponding operating environment; and the generating module is used for generating the first configuration information adapted to the first operating environment according to the first configuration value.
In a third aspect, the present invention provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the configuration information management method when executing the computer program.
In a fourth aspect, the present invention provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the configuration information management method described above.
Compared with the prior art, the method and the device can set the same configuration template in different operation environments for the same service, obtain the first configuration value corresponding to the preset configuration item of the first configuration template in the target operation environment by representing the mapping relation between each preset configuration item and the configuration value of the corresponding operation environment when the configuration information of the first configuration template in the target operation environment needs to be generated, and finally generate the configuration information adaptive to the target operation environment according to the first configuration value, so that the same service only needs to manage one configuration template in different operation environments, the condition that the same service needs to manage one configuration information in different operation environments is avoided, the management workload of the configuration information is reduced, and the management efficiency of the configuration information is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.
Fig. 1 shows a flowchart of a configuration information management method according to an embodiment of the present invention.
Fig. 2 is a flowchart illustrating another configuration information management method according to an embodiment of the present invention.
Fig. 3 is a flowchart illustrating a target configuration attribute determining method according to an embodiment of the present invention.
Fig. 4 is a flowchart illustrating a configuration template updating method according to an embodiment of the present invention.
Fig. 5 is a flowchart illustrating a configuration information updating method of a distributed storage system according to an embodiment of the present invention.
Fig. 6 is a block diagram illustrating a configuration information management apparatus according to an embodiment of the present invention.
Fig. 7 shows a block schematic diagram of a computer device provided by an embodiment of the present invention.
Icon: 10-a computer device; 11-a processor; 12-a memory; 13-a bus; 14-a communication interface; 100-configuration information management means; 110-a receiving module; 120-a determination module; 130-a generating module; 140-update module.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. The components of embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
In the description of the present invention, it should be noted that if the terms "upper", "lower", "inside", "outside", etc. indicate an orientation or a positional relationship based on that shown in the drawings or that the product of the present invention is used as it is, this is only for convenience of description and simplification of the description, and it does not indicate or imply that the device or the element referred to must have a specific orientation, be constructed in a specific orientation, and be operated, and thus should not be construed as limiting the present invention.
Furthermore, the appearances of the terms "first," "second," and the like, if any, are used solely to distinguish one from another and are not to be construed as indicating or implying relative importance.
It should be noted that the features of the embodiments of the present invention may be combined with each other without conflict.
Today's internet technology has stepped into the distributed, microservice era. A distributed system can be composed of hundreds or thousands of micro-services, each service can be different in development language, but bears a small part of functions of the system, and a plurality of services cooperate to complete normal operation of the system. In the background of micro-services, the application service has higher and higher requirements on timeliness, safety and stability of configuration, and the configuration change of one service can directly influence the calling of upstream and downstream services, thereby directly influencing the system stability.
Furthermore, since application service development languages are different, application service configurations become diversified and complicated, and management configurations of traditional mode configuration information or data management configurations and the like cannot meet configuration requirements of a distributed system, for example, a service often corresponds to multiple environments in a development process, is developed in a development environment at the initial stage of development, is deployed in a test environment for testing after a functional requirement is completed, is finally deployed in a production environment after a functional test is completed, and has different configurations corresponding to different environments, so that one service corresponds to multiple configuration information, and when a same configuration in the multiple configuration information changes, all configuration information needs to be updated correspondingly, therefore, a large amount of redundant workload exists when the multiple configuration information is managed, and the management efficiency of the configuration information is low.
In view of the foregoing problems, embodiments of the present invention provide a method and an apparatus for managing configuration information, a computer device, and a storage medium, which can solve the problems that a large amount of redundant workload exists when a plurality of pieces of configuration information are managed, and the management efficiency of the configuration information is low. Which will be described in detail below.
It should be noted that the configuration information management method, apparatus, computer device, and storage medium provided in the embodiments of the present invention are not limited to be used in a distributed storage system, but are also applicable to other application scenarios that require management of configuration information, for example, a non-distributed storage system or a cluster system.
Referring to fig. 1, fig. 1 is a flowchart illustrating a method for managing configuration information according to an embodiment of the present invention, where the method includes the following steps:
step S100, receiving a first generation request for generating first configuration information, where the first generation request is used to determine a first operating environment and a first configuration template from at least one configuration template.
In this embodiment, a service refers to a relatively independent and specific business function, for example, user management, user role, and social media login correspond to a service respectively. In this embodiment, the same service may be run in different running environments, for example, a development environment, a test environment, a production environment, and the like, and each running environment may correspond to different configuration information.
In this embodiment, some configuration items in the configuration information of different services may be the same or different, for example, service 1 includes configuration items a, b, c, and d, and service 2 includes configuration items b, c, d, and e. For the same service, the same configuration item takes different values for different operating environments, for example, the configuration item a of the service 1 takes a value of 111 in a development environment, a value of 222 in a test environment, and a value of 333 in a production environment.
In this embodiment, in order to facilitate management of the configuration information and reduce maintenance items of the configuration information, the present embodiment sets configuration items of the configuration information of a plurality of services as preset configuration items, forms all the preset configuration items into a preset configuration item pool, and stores the preset configuration item pool in the computer device 10. For any one service, one or more preset configuration items required by the service are selected from a preset configuration item pool, a configuration template of the service is generated according to the one or more preset configuration items of the service, and in the configuration template, the preset configuration items in the configuration template can take different configuration values for different operating environments of the service, so that configuration information suitable for the different operating environments can be automatically generated for the service according to the configuration template.
In this embodiment, the first generation request is a request for generating first configuration information, and the first configuration information is configuration information of the first configuration template applicable to the first operating environment. As a specific embodiment, an identifier may be set for each configuration template in the computer device 10, the first generation request may include an identifier of the first configuration template, an environment identifier may be set for each operating environment, and the first generation request may include an identifier of the first operating environment.
In this embodiment, the first generation request for generating the first configuration information may be initiated on a web page or in the form of an external httpparent command, and the embodiment of the present invention does not specifically limit the form of initiating the first generation request.
Step S110, determining a first configuration value corresponding to the preset configuration item of the first configuration template for the first operating environment according to a pre-stored mapping relationship between the preset configuration item and the configuration value representing the corresponding operating environment.
In this embodiment, the computer device 10 stores in advance a mapping relationship between each preset configuration item and the configuration value of the corresponding operating environment, and may determine the first configuration value of the first operating environment corresponding to the preset configuration item of the first configuration template according to the mapping relationship, for example, the mapping relationship is as shown in table 1:
TABLE 1
Preset configuration item Operating environment Configuration value
a Development environment 111
a Test environment 222
b Development environment 333
c Test environment 444
If the first preset configuration item is a and the first operating environment is a test environment, the first configuration value is 222.
Step S120, generating first configuration information adapted to the first operating environment according to the first configuration value.
In this embodiment, the configuration template may adopt different formats, for example, a JSON format, or a YAML or XML format, and the configuration template of different formats generates the configuration information of a corresponding format, for example, a JSON format first configuration template, and finally generates the JSON format first configuration information.
It should be noted that the specific organization form of the configuration information may be a file or a preset structure, and the specific organization form of the configuration information is not limited in the embodiment of the present invention.
The method provided by the embodiment of the invention realizes that only one configuration template needs to be managed in different operation environments by the same service, and the corresponding configuration information can be automatically generated according to the configuration template and the operation environments, thereby avoiding that the same service needs to manage one configuration information in different operation environments, reducing the management workload of the configuration information and improving the management efficiency of the configuration information.
In the embodiment of the present invention, in order to make the division of the configuration items in the generated configuration template more detailed and facilitate more detailed configuration management, so as to meet the requirements of different application scenarios, an embodiment of the present invention further provides a specific implementation manner of generating the configuration template, please refer to fig. 2, and fig. 2 shows a flowchart of another configuration information management method provided by the embodiment of the present invention, where the method includes the following steps:
step S200, receiving a second generation request for generating the configuration template.
In this embodiment, in order to configure the preset configuration items in more detail, one preset configuration item may include one or more configuration attributes, for example, the database configuration may include a user name, a password, a database address, and the like. When generating the configuration template, the user may select all the configuration attributes included in one preset configuration item, or may select one or more configuration attributes.
Step S210, determining a second configuration item indicated by the second generation request from the plurality of preset configuration items.
In this embodiment, the computer device 10 may display each preset configuration item on a web page, and the user may select a second configuration item through web page interaction, where the second configuration item is a preset configuration item required by the second generation request.
Step S220, determining a target configuration attribute indicated by the second generation request from the at least one configuration attribute of the second configuration item.
In this embodiment, after the second configuration item is selected, all configuration attributes of the second configuration item may also be displayed through the web page, and the user may continue to select the target configuration attribute from all configuration attributes of the second configuration item through web page interaction, where the target configuration attribute is the configuration attribute of the second configuration item required by the second generation request.
Step S230, generating a configuration template according to the target configuration attribute.
In this embodiment, the format of the configuration template may be set in advance, or a default configuration template format may be used to generate the configuration template according to the target configuration attribute and the configuration template format.
It should be noted that the preset configuration item may also have no configuration attribute, and at this time, after the preset configuration item is selected, the configuration template may be generated according to the selected preset configuration item and the format of the configuration template.
It should be further noted that, in the embodiment of the present invention, a configuration item unrelated to the operating environment may also be used as a fixed configuration item, and all fixed configuration items required by all services are managed in a unified manner, so that when a user creates a configuration template, the user may simultaneously select a required preset configuration item and a required fixed configuration item, and generate the configuration template according to the selected preset configuration item and the selected fixed configuration item.
According to the method provided by the embodiment of the invention, the preset configuration items are refined and divided into at least one configuration attribute, so that a user can select one or more of the preset configuration items and also select one or more configuration attributes of any one preset configuration item, and the configuration template meeting the requirements of different scenes is generated.
On the basis of fig. 2, an embodiment of the present invention further provides a specific implementation manner for determining a target configuration attribute, please refer to fig. 3, where fig. 3 shows a flowchart of a target configuration attribute determining method provided in the embodiment of the present invention, and step S210 further includes the following sub-steps:
in sub-step S2101, a preliminary configuration item indicated by the second generation request is determined from at least one preset configuration item.
In this embodiment, in order to enhance security management on key configuration items in a configuration template, the preset configuration items include key configuration items that need to be configured with authority control, for example, a database account password, a certificate key, a secret key, and the like, and the key configuration items need to be applied for permission of an administrator before being used in the template. Each key configuration item corresponds to a configuration permission level, the second generation request includes an operation permission level, and the operation permission level may be a user level, a general administrator level, a high-level administrator level, and the like.
In this embodiment, only the administrator with the corresponding level has an update permission for updating the configuration value of the key configuration item, and the ordinary user only has a use permission for performing configuration by using the key configuration item after authorization, so that the configuration value of the key configuration item can be shielded from the ordinary user, and the security and reliability of the key configuration item are improved. For example, for a database configuration item, a user may see configuration attributes such as a user name, a password, an address, etc. of the database configuration item, and the user may use these configuration attributes to generate a configuration template, but the user cannot see and does not need to care about specific configuration values of the user name, the password, and the address, and only an administrator at a corresponding level may add configuration attributes, reduce configuration attributes, or modify configuration values of these configuration attributes for the database configuration item.
And a substep S2102, if the initially selected configuration item is the key configuration item, verifying the operation authority level according to the configuration authority level of the initially selected configuration item.
In this embodiment, the configuration permission level is a permission level that allows configuration of the preset configuration item.
In sub-step S2103, if the operation permission level passes the verification, the initially selected configuration item is determined as the second configuration item indicated by the second generation request.
In this embodiment, if the operation permission level is the same as or higher than the configuration permission level, the operation permission level passes the verification, otherwise, the operation permission level does not pass the verification, and if the operation permission level does not pass the verification, an operator is required to apply to the administrator for an operation of generating the configuration template that can be performed later after the permission that can be configured is applied.
It should be noted that, in order to provide greater flexibility for configuration for a user and meet highly customizable requirements, the embodiment of the present invention may also allow the user to define a required custom configuration item for any service, where the custom configuration item may only be used by the corresponding service, and any service may not use the custom configuration items of other services, and meanwhile, secure management of the custom configuration item is ensured.
It should be further noted that, in addition to checking the authority, since the configuration template may be in different formats, syntax checking may be performed on the preset configuration item according to the format of the configuration template when generating the configuration template, so as to correctly generate the configuration template, for example, the configuration template is in the JSON format, the preset configuration item needs to follow the syntax of the JSON format, and if the preset configuration item does not follow the syntax of the JSON format, the generation of the configuration template fails.
According to the method provided by the embodiment of the invention, through authority control on the key configuration items, the user can only use the preset configuration items with authority to generate the configuration template, so that the security of the configuration template is improved, and the security of configuration information management is further improved.
In the embodiment of the present invention, when a configuration template needs to be updated, in order to enable the configuration template to be returned to a state before update failure when update of the configuration template fails, an embodiment of the present invention further provides a specific implementation manner of updating the configuration template, please refer to fig. 4, where fig. 4 shows a flowchart of a configuration template updating method provided by the embodiment of the present invention, and the method includes the following steps:
step S300, receiving a first update request for updating a third configuration template in at least one configuration template, where the first update request includes a configuration item to be updated.
In this embodiment, each configuration template corresponds to a version number, and when the configuration template is updated, the configuration template is also updated according to the version number.
In this embodiment, the third configuration template indicates, for the first update request, a configuration template that needs to be updated, and the update of the third configuration template may be to add or delete a preset configuration item therein.
Step S310, the third configuration template and the corresponding version number are backed up.
In this embodiment, in order to enable the third configuration template to be returned to a state corresponding to any version number when necessary, before the third configuration template and the corresponding version number are updated, the current third configuration template and the corresponding version number are backed up first.
Step S320, update the third configuration template according to the configuration item to be updated, and update the version number of the third configuration template.
In the method provided by the embodiment of the invention, the configuration template and the version number before updating are backed up firstly when the configuration template is updated by setting the version number for the configuration template, then the configuration template is updated, and the version number is updated simultaneously, so that the configuration template can be returned to the state before updating failure or the state of the configuration template with the specified version number when updating failure occurs.
In the embodiment of the present invention, for a distributed storage system, because the number of storage nodes is large and the number of services running on the storage nodes is large, updating of configuration information of the distributed storage system is more complex, and the advantage of the configuration information management method provided in the embodiment of the present invention in the distributed storage system is more obvious, a specific implementation manner for updating configuration information in the distributed storage system is provided below, please refer to fig. 5, where fig. 5 shows a flowchart of a configuration information updating method of the distributed storage system provided in the embodiment of the present invention, where the method includes the following steps:
step S400, receiving a second update request for updating second configuration information of a target service in the plurality of services, where the second update request is used to generate a fourth configuration template, a target version number, and a second operating environment of the second configuration information.
In this embodiment, the computer device 10 communicates with a distributed storage system, the distributed storage system providing a plurality of services, the distributed storage system including a plurality of storage nodes, a plurality of services being run on the plurality of storage nodes, that is, one service may be run on the plurality of storage nodes, and a plurality of services may be run on each storage node at the same time.
Step S410, generating second configuration information according to the fourth configuration template, the target version number, the second operating environment and the mapping relationship.
In this embodiment, as a specific implementation manner, first, a target configuration template that needs to generate the second configuration information may be determined according to the fourth configuration template and the target version number, and then, the second configuration information is generated according to the target configuration template, the second operating environment, and the mapping relationship. The step of generating the second configuration information according to the target configuration template, the second operating environment and the mapping relationship is similar to the steps S100 to S120, and is not described herein again.
Step S420, obtain an identifier of a target storage node running the target service from the plurality of storage nodes.
In this embodiment, each storage node has an identifier for uniquely characterizing the storage node, where the identifier may be a name, a number, and the like of the storage node. The target storage node may be one or more of a plurality of storage nodes in a distributed storage system.
Step S430, sending the second configuration information and the identifier of the target storage node to the distributed storage system, so that the distributed storage system updates the second configuration information to the target storage node in the distributed storage system.
In this embodiment, as a specific implementation manner, the distributed storage system may adopt mechanisms such as Zookeeper and Etcd, when a service is started, the configuration data of a specific storage node is acquired through an operation interface provided by the distributed storage system, then a change of the data of the storage node is monitored, when a change configuration request is received, corresponding configuration information is generated based on the change configuration request, and then the configuration information is sent to a corresponding target storage node, and a client in the distributed storage system monitors that the data of the specific storage node changes, and automatically acquires the latest configuration and stores the latest configuration in a local memory, thereby completing updating of the configuration information of the service.
It should be noted that, when the second configuration information is generated, in an application scenario with a high requirement on security, syntax verification may be performed on the fourth configuration template again, and permission verification may be performed on the preset configuration items in the fourth configuration template, so as to ensure security and reliability of the finally generated configuration information.
The method provided by the embodiment of the invention can conveniently and quickly update the configuration information in the distributed storage system, and simplifies the update operation of the configuration information of the distributed storage system.
In order to perform the corresponding steps in the above-described embodiments and various possible implementations, an implementation of the configuration information management apparatus 100 is given below. Referring to fig. 6, fig. 6 is a block diagram illustrating a configuration information management apparatus 100 according to an embodiment of the present invention. It should be noted that the basic principle and the technical effect of the configuration information management apparatus 100 provided in the present embodiment are the same as those of the above embodiments, and for the sake of brief description, no reference is made to this embodiment.
The configuration information management apparatus 100 includes a receiving module 110, a determining module 120, a generating module 130, and an updating module 140.
The receiving module 110 is configured to receive a first generation request for generating first configuration information, where the first generation request is used to determine a first operating environment and determine a first configuration template from at least one configuration template.
As a specific embodiment, each preset configuration item includes at least one configuration attribute, and the receiving module 110 is further configured to: a second generation request to generate a second configuration template is received.
As a specific embodiment, the receiving module 110 is further configured to: a first update request for updating a third configuration template in the at least one configuration template is received, wherein the first update request includes a configuration item to be updated.
As a specific embodiment, the computer device is in communication with a distributed storage system, the distributed storage system includes a plurality of storage nodes, a plurality of services are run on the plurality of storage nodes, and the receiving module 110 is further configured to: and receiving a second updating request for updating second configuration information of a target service in the plurality of services, wherein the second updating request is used for generating a fourth configuration template, a target version number and a second operating environment of the second configuration information.
The determining module 120 is configured to determine, according to a mapping relationship, which is stored in advance and used for characterizing each preset configuration item and a configuration value of a corresponding operating environment, a first configuration value, corresponding to the first operating environment, of the preset configuration item of the first configuration template.
As a specific embodiment, the determining module 120 is further configured to: determining a second configuration item indicated by a second generation request from a plurality of preset configuration items; and determining the target configuration attribute indicated by the second generation request from the at least one configuration attribute of the second configuration item.
As a specific implementation manner, the plurality of preset configuration items include key configuration items that need to be configured with permission control, each key configuration item corresponds to a configuration permission level, the second generation request includes an operation permission level, and the determining module 120 is specifically configured to: determining an initial configuration item indicated by a second generation request from at least one preset configuration item; if the primary selection configuration item is the key configuration item, verifying the operation authority level according to the configuration authority level of the primary selection configuration item; and if the operation permission level passes the verification, determining the primarily selected configuration item as a second configuration item indicated by the second generation request.
The generating module 130 is configured to generate first configuration information adapted to the first operating environment according to the first configuration value.
As a specific embodiment, the generating module 130 is further configured to: and generating a second configuration template according to the target configuration attribute.
Each configuration template corresponds to a version number, and the updating module 140 is configured to backup the third configuration template and the corresponding version number; and updating the third configuration template according to the configuration items to be updated and updating the version number of the third configuration template.
As a specific embodiment, the computer device is in communication with a distributed storage system, the distributed storage system comprising a plurality of storage nodes, the plurality of storage nodes running a plurality of services thereon, the update module 140 is further configured to: generating second configuration information according to the fourth configuration template, the target version number, the second operation environment and the mapping relation; acquiring an identifier of a target storage node running a target service from a plurality of storage nodes; and sending the second configuration information and the identification of the target storage node to the distributed storage system so that the distributed storage system updates the second configuration information to the target storage node in the distributed storage system.
Referring to fig. 7, fig. 7 shows a block diagram of a computer device provided in an embodiment of the present invention, where the computer device 10 may be an entity host or a virtual machine capable of implementing the same function as the entity host.
Computer device 10 includes a processor 11, a memory 12, a bus 13, and a communication interface 14. The processor 11 and the memory 12 are connected by a bus 13, and the processor 11 communicates with the distributed storage system via a communication interface 14.
The processor 11 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware or instructions in the form of software in the processor 11. The Processor 11 may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; but may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components.
The memory 12 is used for storing a program, such as the configuration information management apparatus 100, the configuration information management apparatus 100 includes at least one software functional module which can be stored in the memory 12 in a form of software or firmware (firmware), and the processor 11 executes the program after receiving an execution instruction to implement the configuration information management method disclosed in the above embodiment.
The Memory 12 may include a high-speed Random Access Memory (RAM) and may also include a non-volatile Memory (non-volatile Memory). Alternatively, the memory 12 may be a storage device built in the processor 11, or may be a storage device independent of the processor 11.
The bus 13 may be an ISA bus, a PCI bus, an EISA bus, or the like. Fig. 7 is indicated by only one double-headed arrow, but does not indicate only one bus or one type of bus.
An embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, and the computer program, when executed by a processor, implements the above-mentioned configuration information management method.
To sum up, embodiments of the present invention provide a method and an apparatus for managing configuration information, a computer device and a storage medium, which are applied to a computer device, where the computer device prestores at least one configuration template, each configuration template is suitable for a same service running in different running environments, the computer device prestores a plurality of preset configuration items, a same preset configuration item corresponds to different configuration values for the different running environments, and each configuration template includes at least one preset configuration item of the plurality of preset configuration items, and the method includes: receiving a first generation request for generating first configuration information, wherein the first generation request is used for determining a first operating environment and determining a first configuration template from at least one configuration template; determining a first configuration value corresponding to the preset configuration item of the first configuration template aiming at the first operating environment according to a pre-stored mapping relation between the configuration value used for representing each preset configuration item and the corresponding operating environment; and generating first configuration information adapted to the first operating environment according to the first configuration value. Compared with the prior art, the method and the device can set the same configuration template in different operation environments for the same service, obtain the first configuration value corresponding to the preset configuration item of the first configuration template in the target operation environment by representing the mapping relation between each preset configuration item and the configuration value of the corresponding operation environment when the configuration information of the first configuration template in the target operation environment needs to be generated, and finally generate the configuration information adaptive to the target operation environment according to the first configuration value, so that the same service only needs to manage one configuration template in different operation environments, the condition that the same service needs to manage one configuration information in different operation environments is avoided, the management workload of the configuration information is reduced, and the management efficiency of the configuration information is improved.
The above description is only for the specific embodiment of the present invention, but the scope of the present invention is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present invention are included in the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the appended claims.

Claims (10)

1. A configuration information management method is applied to a computer device, the computer device prestores at least one configuration template, each configuration template is suitable for a same service running in different running environments, the computer device prestores a plurality of preset configuration items, the same preset configuration item corresponds to different configuration values for different running environments, each configuration template comprises at least one preset configuration item in the plurality of preset configuration items, and the method comprises the following steps:
receiving a first generation request for generating first configuration information, wherein the first generation request is used for determining a first operating environment and determining a first configuration template from the at least one configuration template;
determining a first configuration value corresponding to the preset configuration item of the first configuration template aiming at the first operating environment according to a pre-stored mapping relation between the preset configuration item and the configuration value of the corresponding operating environment;
and generating the first configuration information adapted to the first operating environment according to the first configuration value.
2. The method of configuration information management according to claim 1, wherein each of the preset configuration items includes at least one configuration attribute, the method further comprising:
receiving a second generation request for generating a second configuration template;
determining a second configuration item indicated by the second generation request from the plurality of preset configuration items;
determining a target configuration attribute indicated by the second generation request from the at least one configuration attribute of the second configuration item;
and generating the second configuration template according to the target configuration attribute.
3. The method according to claim 2, wherein the preset configuration items include key configuration items that need to be configured with authority control, each key configuration item corresponds to a configuration authority level, the second generation request includes an operation authority level, and the step of determining the target configuration attribute indicated by the second generation request from the at least one configuration attribute of the second configuration item includes:
determining an initial configuration item indicated by the second generation request from the at least one preset configuration item;
if the initial selection configuration item is the key configuration item, verifying the operation authority level according to the configuration authority level of the initial selection configuration item;
and if the operation permission level passes the verification, determining the initially selected configuration item as a second configuration item indicated by the second generation request.
4. The method of configuration information management according to claim 1, wherein each of the configuration templates corresponds to a version number, the method further comprising:
receiving a first update request for updating a third configuration template in the at least one configuration template, wherein the first update request comprises a configuration item to be updated;
backing up the third configuration template and the corresponding version number;
and updating the third configuration template according to the configuration item to be updated and updating the version number of the third configuration template.
5. The configuration information management method of claim 4, wherein the computer device is in communication with a distributed storage system, the distributed storage system comprising a plurality of storage nodes on which a plurality of services are running, the method further comprising:
receiving a second update request for updating second configuration information of a target service in the plurality of services, wherein the second update request is used for generating a fourth configuration template, a target version number and a second operating environment of the second configuration information;
generating the second configuration information according to the fourth configuration template, the target version number, the second operating environment and the mapping relation;
acquiring an identifier of a target storage node running the target service in the plurality of storage nodes;
and sending the second configuration information and the identification of the target storage node to the distributed storage system, so that the distributed storage system updates the second configuration information to the target storage node in the distributed storage system.
6. A configuration information management device is applied to a computer device, the computer device prestores at least one configuration template, each configuration template is suitable for a same service running in different running environments, the computer device prestores a plurality of preset configuration items, the same preset configuration item corresponds to different configuration values for different running environments, each configuration template comprises at least one preset configuration item in the plurality of preset configuration items, and the device comprises:
the device comprises a receiving module, a first configuration module and a second configuration module, wherein the receiving module is used for receiving a first generation request for generating first configuration information, and the first generation request is used for determining a first operating environment and a first configuration template from the at least one configuration template;
the determining module is used for determining a first configuration value corresponding to the preset configuration item of the first configuration template aiming at the first operating environment according to a mapping relation which is stored in advance and used for representing each preset configuration item and the configuration value of the corresponding operating environment;
and the generating module is used for generating the first configuration information adapted to the first operating environment according to the first configuration value.
7. The configuration information management apparatus according to claim 6, wherein each of the preset configuration items includes at least one configuration attribute:
the receiving module is further configured to receive a second generation request for generating a configuration template;
the determining module is further configured to: determining a second configuration item indicated by the second generation request from the plurality of preset configuration items, and determining a target configuration attribute indicated by the second generation request from the at least one configuration attribute of the second configuration item;
the generating module is further configured to generate the configuration template according to the target configuration attribute.
8. The apparatus according to claim 7, wherein each of the preset configuration items includes a key configuration item that needs to be configured with permission control, each of the key configuration items corresponds to a configuration permission level, the second generation request includes an operation permission level, and the determining module is specifically configured to:
determining an initial configuration item indicated by the second generation request from the at least one preset configuration item;
if the initial selection configuration item is the key configuration item, verifying the operation authority level according to the configuration authority level of the initial selection configuration item;
and if the operation permission level passes the verification, determining the initially selected configuration item as a second configuration item indicated by the second generation request.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program and the processor implements the configuration information management method according to any one of claims 1 to 5 when executing the computer program.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the configuration information management method according to any one of claims 1 to 5.
CN202011316780.2A 2020-11-23 2020-11-23 Configuration information management method and device, computer equipment and storage medium Active CN112099879B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011316780.2A CN112099879B (en) 2020-11-23 2020-11-23 Configuration information management method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011316780.2A CN112099879B (en) 2020-11-23 2020-11-23 Configuration information management method and device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112099879A true CN112099879A (en) 2020-12-18
CN112099879B CN112099879B (en) 2021-03-12

Family

ID=73785747

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011316780.2A Active CN112099879B (en) 2020-11-23 2020-11-23 Configuration information management method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112099879B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113138809A (en) * 2021-04-30 2021-07-20 广东天波信息技术股份有限公司 Method and system for safely switching working modes of terminal

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101414926A (en) * 2007-10-16 2009-04-22 鸿富锦精密工业(深圳)有限公司 Pro/Engineer standard design environmental management system and method
US8856155B2 (en) * 2010-10-25 2014-10-07 International Business Machines Corporation Management of configuration data structures in multi-layer data models
CN106469068A (en) * 2015-08-14 2017-03-01 中国移动通信集团安徽有限公司 The dispositions method of application program and system
CN109445762A (en) * 2018-10-22 2019-03-08 中国平安人寿保险股份有限公司 Insurance products are insured page configuration method, apparatus, medium and computer equipment
CN109460527A (en) * 2018-09-25 2019-03-12 中国平安人寿保险股份有限公司 Product data configuration method, device, computer equipment and storage medium
CN110244987A (en) * 2019-06-18 2019-09-17 腾讯科技(深圳)有限公司 Configuration data processing method, device, readable storage medium storing program for executing and computer equipment
CN110286974A (en) * 2019-05-21 2019-09-27 深圳壹账通智能科技有限公司 Application configuration method, apparatus, equipment and storage medium based on the H5 page
US10534695B2 (en) * 2018-03-30 2020-01-14 Atlassian Pty Ltd Systems and methods for initializing test environments
CN111193782A (en) * 2019-12-18 2020-05-22 北京航天智造科技发展有限公司 PAAS cloud cluster construction method and device, electronic equipment and storage medium
CN111580884A (en) * 2020-04-30 2020-08-25 北京金山云网络技术有限公司 Configuration updating method and device, server and electronic equipment

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101414926A (en) * 2007-10-16 2009-04-22 鸿富锦精密工业(深圳)有限公司 Pro/Engineer standard design environmental management system and method
US8856155B2 (en) * 2010-10-25 2014-10-07 International Business Machines Corporation Management of configuration data structures in multi-layer data models
CN106469068A (en) * 2015-08-14 2017-03-01 中国移动通信集团安徽有限公司 The dispositions method of application program and system
US10534695B2 (en) * 2018-03-30 2020-01-14 Atlassian Pty Ltd Systems and methods for initializing test environments
CN109460527A (en) * 2018-09-25 2019-03-12 中国平安人寿保险股份有限公司 Product data configuration method, device, computer equipment and storage medium
CN109445762A (en) * 2018-10-22 2019-03-08 中国平安人寿保险股份有限公司 Insurance products are insured page configuration method, apparatus, medium and computer equipment
CN110286974A (en) * 2019-05-21 2019-09-27 深圳壹账通智能科技有限公司 Application configuration method, apparatus, equipment and storage medium based on the H5 page
CN110244987A (en) * 2019-06-18 2019-09-17 腾讯科技(深圳)有限公司 Configuration data processing method, device, readable storage medium storing program for executing and computer equipment
CN111193782A (en) * 2019-12-18 2020-05-22 北京航天智造科技发展有限公司 PAAS cloud cluster construction method and device, electronic equipment and storage medium
CN111580884A (en) * 2020-04-30 2020-08-25 北京金山云网络技术有限公司 Configuration updating method and device, server and electronic equipment

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113138809A (en) * 2021-04-30 2021-07-20 广东天波信息技术股份有限公司 Method and system for safely switching working modes of terminal

Also Published As

Publication number Publication date
CN112099879B (en) 2021-03-12

Similar Documents

Publication Publication Date Title
EP4071610A1 (en) Transaction processing method, apparatus, and device, and computer storage medium
CN108153670B (en) Interface testing method and device and electronic equipment
US20180101371A1 (en) Deployment manager
US8910138B2 (en) Hot pluggable extensions for access management system
US8683488B2 (en) System and method for automatically generating computer code for message flows
CN111064626B (en) Configuration updating method, device, server and readable storage medium
CN108279882B (en) Framework generation method, device, equipment and computer readable medium
WO2021258951A1 (en) Method and apparatus for generating mirror image file, and computer-readable storage medium
US11544245B2 (en) Transaction processing method, apparatus, and device and computer storage medium
CN111930290B (en) Resource deployment method and device
JP2023511114A (en) Techniques for Utilizing Directed Acyclic Graphs for Deployment Instructions
CN112099879B (en) Configuration information management method and device, computer equipment and storage medium
CN112181599A (en) Model training method, device and storage medium
US8161520B1 (en) Methods and systems for securing a system in an adaptive computer environment
CN112418796B (en) Sub-process task node activation method and device, electronic equipment and storage medium
CN114048194A (en) Data management method and device and electronic equipment
CN109117152B (en) Service generation system and method
CN109861960B (en) Method and device for providing verification data for verifying business logic
CN113179332A (en) Method, electronic device and storage medium for acquiring configuration information
CN113971191A (en) Data import method and device and computer readable storage medium
CN114785673B (en) Method and device for acquiring abnormal information during active-standby switching
CN112055057B (en) Method, system and equipment for dynamic expansion of Web system
US20230251909A1 (en) Region seed establishment
US20230128296A1 (en) Conditional save of draft enabled business objects
CN114217843A (en) Operation and maintenance method and device of system and server

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
GR01 Patent grant
GR01 Patent grant