Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail with reference to the accompanying drawings. It should be understood that the described embodiments are only some embodiments of the invention, and not all embodiments. In addition, the embodiments and features of the embodiments in the present invention may be combined with each other without conflict.
In the description of the present application, it is to be understood that the terms "first," "second," "third," and the like are used solely to distinguish one from another and are not necessarily used to describe a particular order or sequence, nor are they to be construed as indicating or implying relative importance. The specific meaning of the above terms in the present application can be understood by those of ordinary skill in the art as appropriate.
Example one
Fig. 1 is a block diagram of a configuration management system according to an embodiment of the present invention, where the system is suitable for managing a configuration file associated with application software, and one of application scenarios in this embodiment may be described as: in the operation phase of any application software, for a developer of the application software, when a certain service requirement exists in a certain functional application of the application software, a configuration file required by the execution of the service needs to be set first. In the existing configuration file setting, mainly depending on programming setting, needs the participation of developers, has narrow operable range, and in addition, the existing method can not judge whether the set configuration file is correct or not. The configuration management system provided by the first embodiment of the invention can effectively solve the problems in the prior art.
As shown in fig. 1, the configuration management system includes: a configuration center layer and a configuration verification layer 11;
the configuration checking layer 11 comprises at least one configuration checking node 111, and the configuration center layer comprises at least one configuration management node;
each configuration check node 111 is configured to perform information check on configuration file editing information of a received target service according to a corresponding configuration check rule, and send the configuration file editing information to a connected configuration management node after the check is passed, where the configuration file editing information is edited and submitted in a configuration editing interface by a user connected to the operation platform front end 10;
each configuration management node 121 is configured to form a target configuration file of the target service based on the configuration file editing information sent by the connected configuration check node 111.
In this embodiment, the configuration management system may be specifically understood as a service support system deployed at the application background server. Generally, the background service end may be regarded as a distributed system architecture, and may implement global service deployment, and under the distributed system architecture, the distributed configuration management system in this embodiment may be formed by deploying background service nodes in different regions, where each background service node participating in deployment may serve as a configuration check node 111 to form a configuration check layer 11, and may also serve as a configuration management node 121 to form a configuration management layer 12.
It can be known that the configuration management system mainly implements effective management of configuration files associated with each functional service in application software, where the effective management of configuration files can be embodied in creating, editing, modifying, editing, or querying configuration files and the like of configuration files corresponding to the functional services.
It should be noted that, in the above-described application scenario, when there is a requirement for setting a configuration file of a certain functional service, the configuration management system provided in this embodiment may receive the configuration file editing information submitted by the operation platform front end 10, so as to verify the configuration file editing information by using the configuration verification rule to ensure the validity of the configuration file editing information, and finally form the configuration file of the functional service. Wherein, the configuration file editing information can be edited and formed by the user of the operation platform front end 10 on the presented configuration editing interface.
In this embodiment, both the configuration check layer 11 and the configuration management layer 12 may be understood as an abstraction mechanism for performing the configuration management service, and in this embodiment, the configuration check layer 11 and the configuration management layer 12 may be respectively idled as an execution mechanism of the configuration management service, and the two cooperate with each other to implement effective management of the configuration file.
Specifically, for the configuration check layer 11, it mainly includes configuration check nodes 111 capable of performing information interaction with the operation platform front end 10, and each configuration check node 111 may be a computer device serving as a background service node in a distributed system architecture. For convenience of understanding, each configuration check node 111 in the preferred configuration check layer 11 is a computing node which starts the configuration check service and can normally work, and each configuration check node 111 has an opportunity to establish a communication connection with the operation platform front end 10, so as to receive configuration file editing information submitted by the operation platform front end 10 with respect to a certain functional service.
With respect to the configuration verification node 111 in the configuration verification layer 11, the operation platform front end 10 may be understood as an operation platform client for an operator to operate, the operator is equivalent to a user of the operation platform front end 10, and an operation entry for the user (the operator) to operate a configuration file of a functional service may be integrated on the operation platform front end 10, and the user may enable the operation platform front end 10 to enter a configuration file editing mode based on the operation entry through a certain form of triggering (for example, triggering of a certain icon), so that configuration editing of the functional service is implemented through the provided configuration editing interface.
It can be noted that the configuration editing interface on the operation platform front end 10 is equivalent to an information editing page, which may include attribute items related to the configuration file, and an editing box, and the user may input configuration editing information desired by the user in the editing box corresponding to each attribute item. Compared with a configuration file programming interface provided for developers in the prior art, the configuration editing interface required by user configuration in the embodiment can be regarded as a visual interface of an application layer, and users participating in configuration file setting can simply and quickly edit each attribute item corresponding to the configuration file without depending on a programming technology.
In this embodiment, the editing of the configuration file by the user of the operation platform front end 10 mainly embodies that a new configuration file is created with respect to a function service, and may also be that the configuration file existing in the function service is modified. The edited configuration file editing information needs to be submitted to the configuration check node 111 through the operation platform front end 10, before that, the operation platform front end 10 needs to establish a communication connection with one configuration check node 111 in the configuration check layer 11, so that the configuration check node 111 to be connected needs to be selected first. For the selection of the configuration check node 111, the operation platform front end 10 may pull an information table containing each configuration check node 111 from the registration center layer 14 of the distributed system architecture, and select the configuration check node 111 according to a load balancing policy preferentially selected by nodes of the same machine room in the same region. For the configuration check node 111, the registration center layer 14 is equivalent to a basic layer of the configuration check layer 11 in a distributed architecture, that is, the configuration check node 111 may be installed on the registration center layer 14, and in addition, the operation platform front end 10 is equivalent to a front end device connected to the configuration check node 111, and the configuration check node 111 mainly receives configuration file editing information submitted by the operation platform front end 10 connected to the configuration check node 111.
In this embodiment, since the profile editing information is set in the operation platform front end 10 for a certain functional service, when receiving the profile editing information, the configuration verification node 111 corresponds to the functional service to which the profile editing information is known, and this functional service is preferably regarded as a target service in this embodiment. Meanwhile, the configuration check node 111 may obtain a configuration check rule matched with the target service, check the configuration file editing information according to the configuration check rule, and if the check is passed, the configuration file editing information may be further sent to the configuration management node 121 if it is determined that the configuration file editing information meets the configuration file editing requirement. The configuration verification rule may be specifically understood as a rule for detecting whether the configuration file editing information meets the configuration requirement, and may be recorded in the configuration verification node 111 in advance, or may be stored in a third-party database, and the configuration verification node 111 obtains the configuration file editing information from the third-party database.
It should be understood that, in the development of the application software project, the configuration file is often the basis of the whole application software project, and the normal operation of the application software project can be ensured only if the required configuration file is qualified and correct, so that the verification of the configuration file editing information edited by the user can be regarded as a key link of configuration management.
It can be known that, in the existing verification of the configuration file editing information, developers often verify the configuration file editing information through functions such as compiling and running during programming of the configuration file; the embodiment provides a configuration file editing way for an operator, but the operator cannot check whether the configuration file editing information is correct or not by himself, so the configuration management system of the embodiment adds the configuration checking layer 11, and the configuration checking node 111 in the configuration checking layer 11 can be combined with the configuration checking rule matched with the service to check the configuration file editing information. The configuration check rule of the functional service may be predefined, for example, the configuration check rule may preferably adopt a json-schema file format, specifically may define each field type in json, define whether an attribute needs to be configured, and may define a maximum value and a minimum value of configuration attribute items, so as to form a range or a rule that defines each attribute item of the configuration file.
Specifically, the configuration management node 121 mainly includes a configuration management node 121 capable of interacting with the configuration check node 111 of the configuration check layer 11, and each configuration management node 121 may also be a computer device serving as a background service node in the distributed system architecture. In this embodiment, it is also preferable that each configuration management node 121 in the configuration management layer 12 is a computing node capable of normal functions and starting the configuration management service, and each configuration management node 121 also has an opportunity to establish a communication connection with the configuration check node 111, so as to receive the configuration file editing information sent by the configuration check node 111.
In this embodiment, one of the management of the configuration files by the configuration management node 121 may be embodied in that the configuration file editing information sent by the configuration verification node 111 is collated, so as to form a configuration file corresponding to the target service, and the configuration file may be marked as a target configuration file of the target service. The formed target configuration file may be stored locally in configuration management node 121; in addition, to facilitate synchronization of the target profile under the distributed architecture, the target profile may also be stored in a third party database.
For example, after receiving the configuration file editing information, the configuration management node 121 may integrate the configuration file editing information according to a configuration file format, and finally form a configuration file that can be called by a client of the application software.
It should be noted that, the configuration management node 121 connected to the configuration check node 111 may also select, by the configuration check node 111, the configuration management node 121 meeting the load balancing by pulling the information table of the configuration management node 121 from the registration center layer 14 of the distributed system architecture, establish a communication connection, and perform information interaction subsequently.
Compared with the prior art that the configuration file can only be set by a developer through programming, the configuration management system provided by the first embodiment of the invention also provides a setting way for other non-developers except the developer, so that the application range of the configuration file setting is expanded, and meanwhile, the strong verification of the configuration file information edited by the non-developers is realized through the additionally arranged configuration verification layer 11, so that the error rate of the configuration file setting is effectively reduced. According to the technical scheme, the configuration check rules corresponding to each service definition in advance are adopted, the revenue loss risk caused by configuration errors is effectively avoided, the configuration creating and updating processes are greatly simplified, the cooperation efficiency of developers and other non-developers in the operation stage of application products is improved, and the high availability of the configuration management system is improved.
Further, the configuration check node 111 is further configured to receive configuration check rule information corresponding to the target service, and store the configuration check rule information in association with the target service through the configuration management node 121 connected thereto;
the configuration check rule information is created and submitted by a user connected to the operation platform front end 10 before the user edits a configuration file of the target service for the first time.
In this embodiment, a function of acquiring the configuration check rule by the configuration check node 111 is further added. Specifically, different functional services depend on different configuration files during operation, and accordingly, configuration and verification rules of the configuration files need to be set for the different functional services. The configuration and verification rule setting may be performed by a user (operator) at the operation platform front end 10, and the configuration and verification rule corresponding to one functional service needs to be performed before the configuration file is created, that is, the configuration and verification rule setting is performed before the configuration file of the functional service is edited for the first time.
For example, at the operation platform front end 10, a configuration editing mode may be performed by a configuration editing entry set by a user through triggering, and after a verification rule of a trigger function service is set, a setting interface for configuring a verification rule setting is presented. The configuration check rule can be formed in a json-schema format under the setting interface.
For configuring the verification rules, the schema customized by the user at the operation platform front end 10 may be a simple programming language, which may be described in text as: the method includes the steps that a configuration attribute item is subjected to type definition, if the whole configuration check rule can be of an object type, internal attributes of services such as users are subjected to array type definition, elements corresponding to the users can be defined as of the object type, the elements corresponding to the users can also contain user id attributes and user name attributes of the users, the id attributes can be defined as number types, length limitation can be carried out on the values, if the maximum value is limited to be 3, the minimum value is 1, and the length limitation can be optional attributes in the rule definition; the username attribute may be defined as a string type.
As described above, after completing the configuration verification rule definition in the above format, the user may submit the configuration verification rule definition to the connected configuration verification node 111. That is, the configuration check node 111 may receive the configuration check rule defined by the connected operation platform front end 10 with respect to the functional service (which may be the target service in this embodiment). It should be noted that, in this embodiment, the configuration check node 111 connected to the operation platform front end 10 may not be the above-mentioned node for receiving the configuration file editing information, and may be a node for the operation platform front end 10 to reselect and establish a connection according to the information table of the configuration check node 111.
In this embodiment, after receiving the configuration check rule of the target service, the configuration check node 111 needs to feed back the configuration check rule to the configuration management node 121, and further, the configuration check rule and the target service are stored in association through the configuration management node 121. It is to be noted that the configuration management node 121, to which the configuration check node 111 establishes a connection, may also no longer be the above-mentioned node participating in receiving the configuration file editing information, and may be a node to which the configuration check node 111 reselects and establishes a connection from the information table of the management node when there is a configuration check rule transmission requirement.
In the above embodiment, the configuration check node 111 checks the configuration file editing information of the target service and the configuration check rule, and is implemented by executing the check. The embodiment provides further optimization of the execution function of the configuration check node 111 based on the above.
Specifically, in this embodiment, the configuration verification node 111 may be further configured to, after performing information verification according to the corresponding configuration verification rule, determine that the editing information of the configuration file is not qualified in verification when the verification fails, and feed back the editing information of the configuration file that is not qualified in verification to the front end 10 of the connected operation platform.
In this embodiment, the configuration check node 111 may also check the configuration file editing information and the configuration check rule, and give a subsequent processing operation when the check fails, for example, the subsequent processing operation may find, by checking and matching, the editing information that does not meet the configuration check rule in the configuration file editing information, in this embodiment, such editing information is recorded as unqualified editing information, and then, the configuration check node 111 may feed back the unqualified editing information to the operation platform front end 10, where the operation platform front end 10 may be considered as a device that establishes a connection with the configuration check node 111 and sends the configuration file editing information to the configuration check node 111.
In this way, the user of the operation platform front end 10 can be simply and effectively informed of the failure information of the profile creation or modification, so that the user can edit the profile again.
Fig. 2 shows another structural block diagram of a configuration management system according to an embodiment of the present invention, and as shown in fig. 2, the configuration management system includes an application client interacting with a configuration management node 121.
Specifically, the configuration management node 121 establishes a long connection with the application client 20, and is further configured to feed back configuration file update information of the associated service to the application client 20 through the long connection.
In addition, the configuration management node 121 in the configuration management layer 12 of the configuration management system provided in this embodiment has a function of feeding back the update status of the configuration file to the application client 20, in addition to receiving the configuration file editing information or the configuration verification rule information sent by the configuration verification node 111. Generally, in the implementation of the existing configuration management, a short polling form is mainly adopted to establish a configuration management background and a service request of the application client 20, so that the application client 20 is informed of the update condition of the configuration file in this way.
The process of implementing notification of the update condition of the configuration file by means of short polling in the prior art may be described as follows: the service request is sent to the configuration management background by the application client 20, the duration of each request is controlled by the application client 20, and the configuration update is performed in the configuration management background and stored and configured in the configuration management background. For the requirement of time effectiveness for configuration management, real-time feedback of configuration update can be realized through the added features of the embodiment.
Illustratively, the notification method for the update of the configuration file provided by this embodiment is mainly implemented by using a long connection, that is, a long polling method. The logic for performing the profile update feedback in the long polling manner may be described as follows: the configuration management node 121 receives an http service request of the application client 20, the application client 20 controls a connection duration with the configuration management node 121, and within the connection duration, if the configuration management node 121 forms an updated configuration file, the configuration management node immediately feeds back the update of the configuration file to the application client 20, and pushes the latest configuration file to the application client 20; if the configuration management node 121 does not form an updated configuration file, the established long connection is maintained until the connection duration is reached, and if no configuration file has been updated, a notification of no configuration update is sent to the application client 20. And after receiving the feedback of no configuration update, the client ends the established current long connection and immediately sends a same service request to reestablish the long connection to inquire whether the configuration update exists.
Specifically, the present embodiment provides a further description of the configuration management node 121 implementing the profile update feedback. In this embodiment, the configuration management node 121 may include:
an information monitoring process, configured to monitor whether there is a configuration file update of a service associated with the application client 20 within the effective duration of the established long connection;
an update notification process, configured to send a configuration file update notification to the application client 20 when it is monitored that there is a configuration file update with respect to any associated service; otherwise, sending a no-configuration-file update notification to the application client 20 after the validity duration is reached;
and a configuration feedback process, configured to, when receiving a configuration update file acquisition request sent by the application client 20 with respect to the associated service, feed back the updated relevant configuration file to the application client 20.
In this embodiment, the specific implementation of the configuration management node 121 performing the configuration file update feedback to the application client 20 is optimized as the above three processes. The information monitoring process may acquire the service associated with the application client 20, and monitor whether the configuration file is updated or not for each associated service within the effective duration of the established long connection; the effective duration may be a connection duration set by the application client 20 to establish a long connection; the update notification process is mainly used for feedback of the configuration file update notification, and if it is monitored that the configuration file update exists in the associated service, the update notification process may send the configuration file update notification to the application client 20; or directly sending a notification of no-profile update to the application client 20 when the validity duration is reached and no profile update of all associated services is monitored; the configuration feedback process is mainly used for feeding back the updated configuration file to the application client 20 when the configuration file is updated, wherein the configuration feedback process feeds back the updated configuration file if a configuration update file acquisition request sent by the application client 20 is received.
Further, as shown in the configuration management system of fig. 2, the system further includes a data layer 13,
the data center 131 included in the data layer 13 is configured to receive a target configuration file submitted by the configuration management node 121, and store the target configuration file in a configuration file set 1311 corresponding to the target service;
wherein, the file version number is recorded in association with each corresponding configuration file in the configuration file set 1311;
the configuration file editing information is configuration file information which is firstly edited by a user of the operation platform front end 10 relative to the target service; or, the formed configuration file information is modified for the user of the operation platform front end 10 on the basis of the configuration file corresponding to the existing file version number.
In this embodiment, the configuration management node 121 needs to perform a storage operation on a target configuration file formed by a target service, in this embodiment, a third-party database may be used for storing the configuration file, and the third-party database may preferably be a distributed data layer 13, in this embodiment, the data layer 13 may also be abstracted into a data management mechanism, which specifically includes data centers 131 deployed in different regions, and the data centers 131 may be specifically integrated on any background service node under the distributed system architecture.
In this embodiment, the data center 131 may be configured to store a configuration file set 1311 corresponding to each functional service in the application software. The configuration file set 1311 of each functional service at least includes one configuration file, and the configuration files in the configuration file set 1311 have corresponding file version numbers, and when the configuration file set 1311 includes a plurality of configuration files, the configuration files may be sorted from low to high according to the corresponding file version numbers, and the file version numbers are also used to distinguish the plurality of configuration files of the functional service, which at least reflects the sequence of update time of the configuration files.
Meanwhile, it should be noted that the configuration file editing information received by the configuration verification node 111 may be configuration file information newly created by the user with respect to the functional service, or may be configuration file information modified on an existing configuration file. When a user of the operation platform front end 10 needs to update a configuration file, a dependent configuration file may be selected from the stored configuration file set 1311 and modified, where the dependent configuration file is equivalent to a base of the configuration file to be updated and may be identified by a file version number of the dependent configuration file.
When there are two requirements of new creation and modification of the profile editing information based on the functional service, there are different execution steps when the data center 131 stores the profile, and in this embodiment, the profile storing step implemented by the data center 131 according to different requirements for editing the profile is exemplarily given.
Illustratively, the data center 131 included in the data layer 13 may be specifically configured to perform:
a) existing file version numbers associated with the received target configuration files are extracted.
In this embodiment, it may be considered that the message sent by the operation platform front end 10 for the configuration file editing information also carries a file version number depended on by the configuration file editing information, and the depended file version number may be recorded as an associated existing file version number. When the configuration file editing information edited by the user is newly created information of the functional service, the version number of the associated existing file can be considered to be null; when the configuration file editing information is modification information of the functional service on the basis of the existing configuration file, the file version number of the dependent configuration file can be used as the associated existing file version number.
b) And when the existing file version number is null, determining that the target configuration file is a newly created configuration file, allocating an initial file version number to the target configuration file, and storing the initial file version number to the configuration file set 1311 corresponding to the target service in an associated manner.
This step corresponds to a newly created configuration file of the target service, and the data center 131 may assign an initial file version number to the target configuration file through this step.
c) When the existing file version number is not empty, if the existing file version number is the highest version number in a configuration file set 1311, determining a new file version number for the target configuration file based on the existing file version number, and storing the new file version number in the configuration file set 1311 in association with the target service; otherwise, step d) is executed.
This step corresponds to the modification of the configuration file of the target service, and it can be known that the modification of the configuration file is usually the modification based on the existing latest configuration file, therefore, if the version number of the existing file is not null, the version number of the existing file should be the highest version number in the configuration file set 1311 corresponding to the target service, otherwise, there is no practical meaning for modifying the configuration file. When the existing file version number is the highest version number, the data center 131 may increment the version number on the basis of the existing file version number, thereby forming a higher version of the file version number as the version number of the modified configuration file.
d) The target configuration file is discarded, and a configuration file update failure message is fed back to the user of the operation platform front end 10 through the configuration management node 121 and the configuration check node 111.
In this embodiment, in the process of storing the target configuration file, since the configuration management system provided in this embodiment is a distributed system and is oriented to users of multiple operation platform front ends 10 during service application, each user has a possibility of modifying the configuration file. Under the distributed architecture, multi-user parallel operation is allowed, and in the application scenario, the multiple users are allowed to modify the configuration files of the same version at the same time and submit the configuration files to the data center 131 through the configuration check node 111 and the configuration management node 121, so that the consistency of information stored in the data center 131 is ensured. The data center 131 may consider that there is a conflict between modifications of the profiles by multiple users when it is determined that the existing version number is not the highest version in the profile set 1311, and thus the received target profile needs to be ignored through this step, that is, the target profile is discarded, and then a profile update failure message is fed back to the user of the operation platform front end 10 through the configuration management node 121 and the configuration check node 111. If the user wants to update the configuration file, the configuration file corresponding to the highest version number in the data center 131 needs to be modified again.
The technical implementation provided by the embodiment better ensures the accuracy and timeliness of the configuration file modification.
In addition, the configuration management system provided in this embodiment further has a function of querying a configuration file, and for example, implementation of the querying operation may be described as: the configuration check node 111 receives a configuration file query request of a functional service sent by a user connected to the operation platform front end 10, and forwards the query request to the connected configuration management node 121, and the configuration management node 121 may first query whether a configuration file matching the query request exists in the cached configuration file information, and if so, directly feeds back the configuration file to the user connected to the operation platform front end 10 through the configuration check node 111; if not, the query request needs to be forwarded to the data center 131 again, the data center 131 queries and matches in the configuration file set 1311 corresponding to the functional service, and finally feeds back the found configuration file to the user of the operation platform front end 10 through the configuration management node 121 and the configuration check node 111.
Further, as shown in fig. 2, the configuration management system may further include: the registration-center layer 14 is a layer that,
a check node list and a management node list are recorded on the registration service node 141 included in the registration center layer 14;
the check node list includes first node attribute information of each configuration check node 111 that has started configuration check service;
the management node list includes second node attribute information of each configuration management node 121 that has started the configuration management service.
In this embodiment, the registry layer 14 is equivalent to a registration management mechanism in a distributed system architecture, and may be preferably a kong component, and the distributed kong component is integrated on different background service nodes of the distributed system, so as to form the registry layer 14. It should be noted that the configuration management layer 12 in this embodiment includes a plurality of configuration management nodes 121, which correspond to multi-instance deployment in the registration center layer 14, and may send node attribute information to the registration service node 141 in real time when the configuration management nodes 121 start the configuration management service, and register the configuration management nodes 121 in the registration center layer 14 in real time; similarly, the configuration verification layer 11 includes a plurality of configuration verification nodes 111, which are also equivalent to multi-instance deployment in the registration center layer 14, and also can send node attribute information to the registration service node 141 in real time when the configuration verification nodes 111 start the configuration verification service, and register the configuration verification nodes 111 in the registration center layer 14 in real time.
Further, the registration service node 141 is configured to, when receiving an information pulling request of the operation platform front end 10, feed back a check node list to the operation platform front end 10, so that the operation platform front end 10 selects the connected configuration check node 111 through the check node list;
and is further configured to, when receiving an information pull request of the configuration check node 111 and/or the application client 20, feed back a management node list to the configuration check node 111 and/or the application client 20, so that the configuration check node 111 and/or the application client 20 selects the connected configuration management node 121 through the management node list.
In this embodiment, for the registration center layer 14, after receiving the registration attribute information of the configuration management node 121 and the configuration check node 111, the registration service node 141 considers that the configuration management node 121 and the configuration check node 111 are computing nodes capable of operating normally, and records the computing nodes in the management node list and the check node list respectively. It should be noted that the registry layer 14 is further provided with an external service interface, through which interface services can be provided to the outside, so that both the external operation platform front end 10 and the application client 20 can select a computing node (such as the configuration check node 111 or the configuration management node 121) to be connected through the external service interface, where the external service interface is preferably a kong-feign interface.
In this embodiment, after the configuration management node 121 and the configuration check node 111 register the corresponding node attribute information to the registration service node 141, the service may also be provided to the outside, and the operation platform front end 10 or the application client 20 that may establish a communication connection may select a connected computing node by accessing the registration service node 141.
For example, from the perspective of the registration service node 141, it may receive an information pulling request of the operation platform front end 10, and then feed back a check node list to the operation platform front end 10, so that the operation platform front end 10 selects a connected configuration check node 111 from the check node list based on a set load balancing policy. The registration service node 141 may further feed back a management node list to the configuration check node 111 and/or the application client 20 when receiving the information pull request of the configuration check node 111 and/or the application client 20, so that both the configuration check node 111 and the application client 20 can select the configuration management node 121 to establish a communication connection.
It should be noted that when the operation platform front end 10, the configuration check node 111, the application client 20, and the like are associated with required computing nodes (the configuration check node 111 and the configuration management node 121), availability monitoring is performed on the connected computing nodes, and when the service of the connected computing nodes is turned off or down and unavailable, the connected computing nodes are actively moved, so as to perform health check on the nodes and eliminate the off-line or unhealthy computing nodes.
The configuration management system provided by the embodiment has the configuration file editing function of operators, the verification function of the configuration file, the effective storage function of the configuration file, and the high availability to the outside, so that the application range of configuration file setting is expanded, and meanwhile, the strong verification of the information of the configuration file edited by non-developers is realized through the additionally arranged configuration verification layer, so that the error rate of configuration file setting is effectively reduced; the risk of revenue loss caused by configuration errors is effectively avoided, meanwhile, the configuration creating and updating processes are greatly simplified, and the cooperation efficiency of developers and other non-developers in the operation stage of application products is improved.
Example two
Fig. 3 is a schematic flow chart of a configuration management method according to a second embodiment of the present invention, where the method is suitable for managing configuration files of application software, and may be specifically executed by execution nodes of each layer in a configuration management system according to the first embodiment of the present invention, where the execution nodes of each layer may preferably be a server, and different execution nodes collectively form a distributed configuration management system.
As shown in fig. 3, a configuration management method provided in the second embodiment of the present invention may specifically include the following steps:
s301, through configuration check nodes in a configuration check layer, information check is carried out on configuration file editing information of the received target service according to corresponding configuration check rules, and after the check is passed, the configuration file editing information is sent to a connected configuration management node.
And editing and submitting the configuration file editing information in a configuration editing interface by a user connected with the front end of the operation platform.
S302, forming a target configuration file of the target service based on configuration file editing information sent by the connected configuration check node through the configuration management node in the configuration management layer.
Compared with the existing method that only developers can set configuration files through programming, the configuration management method provided by the second embodiment of the invention realizes that setting ways are provided for other non-developers except the developers, thereby expanding the application range of configuration file setting, and meanwhile, the strong verification of the configuration file information edited by the non-developers is realized through the added configuration verification layer, thereby effectively reducing the error rate of configuration file setting. According to the technical scheme, the configuration check rules corresponding to each service definition in advance are adopted, the revenue loss risk caused by configuration errors is effectively avoided, the configuration creating and updating processes are greatly simplified, the cooperation efficiency of developers and other non-developers in the operation stage of application products is improved, and the high availability of the configuration management system is improved.
To better illustrate the effective management of the configuration file in the practical application scenario by the method provided by this embodiment, the implementation process of the management of the configuration file is exemplarily illustrated in terms of a configuration file associated with a service.
Fig. 4 is a diagram showing an example of an interaction implementation of implementing configuration management on a configuration file related to a target service according to an embodiment of the present invention.
As shown in fig. 4, this exemplary diagram includes a plurality of execution entities for shooting in the method implementation, which includes an operation platform front end 31 for creating or editing a configuration file of a target service, a configuration check node 321 in a configuration check layer 32 participating in configuration file check and establishing a communication connection with the operation platform front end, and a configuration management node 331 in a configuration management layer 33 participating in configuration file management and establishing a communication connection with the configuration check layer.
In addition, fig. 4 further includes a data layer 35 and a registration center layer 34 in the configuration management system, where one data center in the data layer stores a configuration file set corresponding to the target service; one registration service node in the registration center layer can be connected with the operation platform front end, the configuration check node and the configuration management node, and meanwhile, the registration service node can be considered to comprise a check node list and a management node list.
Specifically, as shown in fig. 4, the interaction implementation process for managing the configuration file of the target service may be described as follows:
and S1, the operation platform front end presents a configuration rule editing interface through the triggering of the user, so that the user can edit the configuration verification rule of the target service and obtain the edited configuration verification rule information.
S2, the operation platform front end pulls the check node list from the registration service node, and selects the configuration check node for establishing communication connection;
and S3, the operation platform front end submits the configuration check rule information to the configuration check node.
S4, the configuration check node receives the configuration check rule information.
S5, pulling the management node list from the registered service node, and selecting a configuration management node for establishing a communication connection.
S6, the configuration check node sends the configuration check rule information to the configuration management node.
S7, the configuration management node stores the configuration checking rule information on the data center of the data layer relative to the target service.
And S8, the operation platform front end presents a configuration file editing interface through the triggering of the user, so that the user can edit (create or modify) the configuration file of the target service, and the edited configuration file editing information is sent to the connected configuration check nodes.
It should be noted that, in this step, the configuration check node connected to the front end of the operation platform may be different from the configuration check node selected to be connected, and the configuration check node to be connected may be selected again by pulling the check node list from the registration service node.
S9, the configuration check node checks the configuration file editing information according to the configuration check rule of the target service.
For example, the configuration validation rules may be obtained from a set of configuration rules stored in the data center
And S10, when the configuration check node passes the check, sending the configuration file editing information to the connected configuration management node.
Similarly, the configuration management node to which the configuration check node is connected in this step may be a different node from the configuration management node selected to be connected, or may pull the management node list from the registration service node again and select the configuration management node to be connected again.
And S11, when the configuration check node fails to pass the check, determining unqualified check editing information in the configuration file editing information, and feeding back the unqualified check editing information to the front end of the connected operation platform.
S12, the configuration management node receives the configuration file editing information of the target service, forms a target configuration file of the target service and submits the target configuration file to the data center.
And S13, after the configuration management node establishes a long connection with the application client, feeding back the configuration file updating information of the target service to the application client through the long connection.
The configuration management node realizes the update of the configuration file to the application client through the following operations: monitoring whether configuration file updating of the service associated with the application client exists or not within the effective duration of the established long connection; when monitoring that the configuration file update exists relative to any associated service, sending a configuration file update notification to the application client; otherwise, sending a non-configuration file updating notice to the application client after the effective duration is reached; and when a configuration update file acquisition request sent by the application client relative to the associated service is received, feeding back the updated relevant configuration file to the application client.
S14, the data center extracts the existing file version number associated with the target configuration file, and determines whether the existing file version number is empty, if yes, S15 is executed; if not, S16 is executed.
S15, determining the target configuration file as a newly created configuration file, allocating an initial file version number to the target configuration file, and storing the initial file version number in the configuration file set in association with the target service.
S16, determining whether the existing file version number is the highest version number in the configuration file set, if so, executing S17; if not, go to S18.
S17, determining a new file version number for the target configuration file based on the existing file version number, and storing the new file version number in the configuration file set in association with the target service.
And S18, discarding the target configuration file, and feeding back a configuration file update failure message to the user at the front end of the operation platform through the configuration management node and the configuration check node.
EXAMPLE III
Fig. 5 is a schematic diagram of a hardware structure of a server according to a third embodiment of the present invention, and specifically, the server is configured to form execution nodes of each layer in the configuration management system according to the first embodiment, where the server specifically includes: a processor and a storage device. At least one instruction is stored in the storage device, and the instruction is executed by the processor, so that the server can perform the operation steps performed by each execution node in the configuration management method provided by the second embodiment.
Referring to fig. 5, the server may specifically include: a processor 40, a storage device 41, a display 42, an input device 43, an output device 44, and a communication device 45. The number of the processors 40 in the server may be one or more, and one processor 40 is taken as an example in fig. 5. The number of the storage devices 41 in the server may be one or more, and one storage device 41 is taken as an example in fig. 5. The processor 40, the storage device 41, the display 42, the input device 43, the output device 44, and the communication device 45 of the server may be connected by a bus or other means, and the bus connection is exemplified in fig. 5.
Specifically, in an embodiment, when the processor 40 executes one or more programs stored in the storage device 41, the following operations may be implemented: the method comprises the steps that information verification is carried out on configuration file editing information of a received target service according to a corresponding configuration verification rule through configuration verification nodes in a configuration verification layer, and the configuration file editing information is sent to a connected configuration management node after verification is passed, wherein the configuration file editing information is edited and submitted in a configuration editing interface by a user connected with the front end of an operation platform; and forming a target configuration file of the target service based on configuration file editing information sent by the connected configuration check node through the configuration management node in the configuration management layer.
An embodiment of the present invention further provides a computer-readable storage medium, where when a program in the storage medium is executed by a processor of a computer device, the computer device is enabled to execute the configuration management method according to the above embodiment. Illustratively, the configuration management method according to the foregoing embodiment includes: the method comprises the steps that information verification is carried out on configuration file editing information of a received target service according to a corresponding configuration verification rule through configuration verification nodes in a configuration verification layer, and the configuration file editing information is sent to a connected configuration management node after verification is passed, wherein the configuration file editing information is edited and submitted in a configuration editing interface by a user connected with the front end of an operation platform; and forming a target configuration file of the target service based on configuration file editing information sent by the connected configuration check node through the configuration management node in the configuration management layer.
It should be noted that, as for the embodiments of the apparatus, the computer device, and the storage medium, since they are basically similar to the embodiments of the method, the description is relatively simple, and in the relevant places, reference may be made to the partial description of the embodiments of the method.
From the above description of the embodiments, it is obvious for those skilled in the art that the present invention can be implemented by software and necessary general hardware, and certainly, can also be implemented by hardware, but the former is a better embodiment in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which may be stored in a computer-readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a FLASH Memory (FLASH), a hard disk or an optical disk of a computer, and includes several instructions for enabling a computer device (which may be a robot, a personal computer, a server, or a network device) to execute the configuration management method according to any embodiment of the present invention.
It should be noted that, in the configuration management system, each unit and each module included in the configuration management system are only divided according to functional logic, but are not limited to the above division as long as the corresponding functions can be implemented; in addition, the specific names of the functional units are only for the convenience of distinguishing from each other, and are not used for limiting the keep-alive range of the present invention.
It should be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by suitable instruction execution devices. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the spirit of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.