Method and device for processing configuration information, computer equipment and storage medium
By periodically collecting and comparing server configuration information, automatically determining and processing configuration items are solved, and the problem of inefficient manual configuration information is achieved, and efficient and automated configuration management is achieved.
Patent Information
- Application Number
- CN202411789169.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-06
- Publication Date
- 2025-04-11
AI Technical Summary
Manually processing server configuration information is inefficient, especially in large-scale server and data center environments.
The configuration information, device log information and software log information of the server configuration items are collected periodically, and the configuration information of the two cycles is determined to change the configuration items, and the processing operations are automatically performed according to the operation type.
It realizes the operation of automated processing of configuration information, improves efficiency, and reduces the probability of manual errors, and is suitable for large-scale servers and data center environments.
Smart Images

Figure CN119806902A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of servers, and in particular to a method, device, computer equipment and storage medium for processing configuration information. Background Art
[0002] With the widespread application of information technology in various industries, servers, as one of the important infrastructures, are increasingly used in enterprises and organizations. In order to better monitor the health status of servers and automatically restore configurations, it is usually necessary to back up the server configuration information and restore it when a problem occurs.
[0003] Generally, technicians back up and restore server configuration information manually. However, in large-scale servers and data centers, if the configuration information of each server is manually processed, the efficiency is low. Summary of the invention
[0004] In view of this, the present invention provides a method, apparatus, computer device, storage medium and program product for processing configuration information to solve the problem of low efficiency in manually processing configuration information.
[0005] In a first aspect, the present invention provides a method for processing configuration information, the method comprising:
[0006] In the processing of the current cycle, extracting identification information corresponding to the configuration item of the configuration information to be obtained from the pre-acquired configuration information collection policy corresponding to the server, wherein the number of the configuration items of the configuration information to be obtained includes at least one;
[0007] According to the identification information corresponding to each of the configuration items, collecting, in the server, the configuration information of each of the configuration items in the current period;
[0008] Acquire configuration information of each of the configuration items in a previous cycle corresponding to the current cycle, as well as software log information and device log information generated in the current cycle;
[0009] Determine at least one changed configuration item, and identification information corresponding to the changed configuration item and configuration information in the current cycle according to the device log information, and configuration information of each configuration item in the current cycle and configuration information in the previous cycle;
[0010] Determine the operation type corresponding to each of the changed configuration items according to the software log information, the identification information corresponding to each of the changed configuration items, and the configuration information in the current cycle;
[0011] According to the operation type corresponding to each of the changed configuration items, a process corresponding to the operation type is performed on the configuration information of each of the changed configuration items in the current cycle.
[0012] The method for processing configuration information provided by the present invention has the following advantages:
[0013] This solution can periodically collect configuration information, device log information, and software log information of each configuration item of the server, and obtain the configuration information of each configuration item collected in the previous cycle. Furthermore, through the configuration information of the configuration items of two cycles and the device log information, the changed configuration items, as well as the identification information corresponding to each configuration item and the configuration information in the current cycle are determined. Then, based on the software configuration information, the identification information of the changed configuration items and the configuration information in the current cycle, the operation type of each changed configuration item is determined, and finally, the corresponding processing is performed according to the operation type. In this way, the operation of processing the configuration information can be performed automatically without the need for manual execution by technical personnel, which is more efficient and has a lower probability of errors.
[0014] In an optional implementation, determining the operation type corresponding to each of the changed configuration items according to the software log information, the identification information corresponding to each of the changed configuration items, and the configuration information in the current cycle includes:
[0015] Determining whether the software log information includes modification operation information corresponding to the target changed configuration item according to identification information corresponding to the target changed configuration item and configuration information of the target changed configuration item in the current cycle, wherein the target changed configuration item is any one of the at least one changed configuration item;
[0016] When it is determined that the software log information includes the modification operation information corresponding to the target changed configuration item, it is determined that the operation type corresponding to the target changed configuration item is a backup operation type.
[0017] Specifically, since the software log information records the modification operation information that is a safe modification, it is possible to determine whether the modification of the target configuration item in the current cycle is safe through the identification information of the target configuration item and the configuration information in the current cycle. When the modification of the target configuration item in the current cycle is safe, the backup operation is directly performed, so that when recovery is needed later, safe configuration information can be obtained for recovery to ensure the normal operation of the server.
[0018] In an optional implementation, when it is determined that the software log information does not include modification operation information corresponding to the target changed configuration item, the method further includes:
[0019] Acquire a target blacklist, wherein the target blacklist includes identification information of configuration items that affect the operation of the server;
[0020] Determine whether the identification information corresponding to the target changed configuration item is any one of the identification information of the configuration items that affect the operation of the server;
[0021] When it is determined that the identification information corresponding to the target changed configuration item is not any of the identification information of the configuration items affecting the operation of the server, it is determined that the operation type corresponding to the target changed configuration item is the backup operation type.
[0022] Specifically, when it is determined that the software log information does not include the modification operation information corresponding to the target configuration item, it means that the modification operation on the target configuration item in the current cycle may be unsafe, so further determination is required. This solution first determines whether the target configuration item is an important configuration item that affects the operation of the server. If not, it is determined that the configuration information of the target configuration item in the current cycle can be backed up for subsequent use. In this way, through further judgment, the operation type of the target configuration item can be more accurately determined.
[0023] In an optional implementation, when it is determined that the identification information corresponding to the target changed configuration item is any one of the identification information corresponding to the configuration item affecting the operation of the server, the method further includes:
[0024] Acquire the baseline configuration information corresponding to the target changed configuration item according to the identification information corresponding to the target changed configuration item;
[0025] Determining whether the configuration information of the target changed configuration item in the current cycle conforms to the baseline configuration information corresponding to the target changed configuration item;
[0026] When it is determined that the configuration information of the target changed configuration item in the current period conforms to the baseline configuration information corresponding to the target changed configuration item, determining that the operation type corresponding to the target changed configuration item is the backup operation type;
[0027] or,
[0028] When it is determined that the configuration information of the target changed configuration item in the current period does not conform to the baseline configuration information corresponding to the target changed configuration item, it is determined that the operation type corresponding to the target changed configuration item is a recovery operation type.
[0029] Specifically, when it is determined that the target configuration item to be changed is an important configuration item that affects the operation of the server, this solution compares its configuration information in the current cycle with its baseline configuration information. Since the baseline configuration information is the configuration information that can ensure the normal operation of the server, when the configuration information of the target configuration item to be changed in the current cycle meets the baseline configuration information, it can be considered that the modification operation of the target configuration item to be changed in the current cycle is safe, and the configuration information can be backed up. When the configuration information of the target configuration item to be changed in the current cycle does not meet the baseline configuration information, it can be determined that a recovery operation is to be performed on the target configuration item to be changed. In this way, unsafe modification operations are rejected, and the safe operation of the server can be guaranteed.
[0030] In an optional implementation, determining at least one changed configuration item, and identification information corresponding to the changed configuration item and configuration information in the current cycle according to the device log information, and configuration information of each configuration item in the current cycle and configuration information in the previous cycle, includes:
[0031] Determining whether the target configuration item is changed in the current cycle according to the configuration information of the target configuration item in the current cycle and the configuration information of the target configuration item in the previous cycle, wherein the target configuration item is any one of the at least one configuration item;
[0032] When it is determined that the target configuration item has not been changed in the current cycle, determining the target configuration item as a candidate configuration item;
[0033] After determining whether all configuration items in at least one of the configuration items are changed, obtaining a first category of candidate configuration items;
[0034] Parse the device log information according to a preset log parsing rule to determine at least one candidate configuration item, and identification information and configuration information in the current cycle respectively corresponding to at least one candidate configuration item, wherein the at least one candidate configuration item obtained by parsing the device log information constitutes a second category of candidate configuration items;
[0035] A union of the first category candidate configuration items and the second category candidate configuration items is taken to obtain at least one of the changed configuration items, wherein each of the changed configuration items has corresponding identification information and configuration information in the current cycle.
[0036] Specifically, since the configuration information of some configuration items cannot be obtained, but the modification operation information of these configuration information can be recorded by the device log, the changed configuration items can be determined more comprehensively by parsing the device log information, making the changed configuration items processed later more comprehensive and accurate.
[0037] In an optional implementation, performing processing corresponding to the operation type on the configuration information of each of the changed configuration items in the current period according to the operation type corresponding to each of the changed configuration items includes:
[0038] When it is determined that the operation type is at least one backup change configuration item of the backup operation type, the configuration information of each backup change configuration item in the current cycle is backed up to the target database.
[0039] Specifically, backing up the configuration information of the backup change configuration item of the backup operation type in the current cycle to the target database can facilitate subsequent recovery operations.
[0040] In an optional implementation, performing processing corresponding to the operation type according to the operation type corresponding to each of the changed configuration items includes:
[0041] When it is determined that the operation type is at least one restored configuration item of the restore operation type, the configuration information of each restored configuration item in the current period is restored to the baseline configuration information corresponding to the restored configuration item.
[0042] Specifically, for a configuration item whose operation type is a recovery operation type, in order to prevent the modification of the configuration item in the current cycle from affecting the operation of the server, the recovery operation is performed in a timely manner to ensure the safe operation of the server.
[0043] In a second aspect, the present invention provides a device for processing configuration information, the device comprising:
[0044] an extraction module, configured to extract identification information corresponding to a configuration item of the configuration information to be obtained from a pre-acquired configuration information collection policy corresponding to the server in the processing of the current cycle, wherein the number of the configuration items of the configuration information to be obtained includes at least one;
[0045] A collection module, configured to collect configuration information of each of the configuration items in the current period in the server according to identification information corresponding to each of the configuration items;
[0046] An acquisition module, used to acquire configuration information of each of the configuration items in a previous cycle corresponding to the current cycle, and software log information and device log information generated in the current cycle;
[0047] a determination module, configured to determine at least one changed configuration item, and identification information corresponding to the changed configuration item and configuration information in the current cycle according to the device log information, and configuration information of each of the configuration items in the current cycle and configuration information in the previous cycle; and to determine an operation type corresponding to each of the changed configuration items according to the software log information, and identification information corresponding to each of the changed configuration items and configuration information in the current cycle;
[0048] The execution module is used to perform processing corresponding to the operation type on the configuration information of each of the changed configuration items in the current cycle according to the operation type corresponding to each of the changed configuration items.
[0049] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the method for processing configuration information of the first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0050] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the method for processing configuration information of the first aspect or any corresponding embodiment thereof.
[0051] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions for causing a computer to execute the method for processing configuration information of the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the related technologies, the drawings required for use in the specific embodiments or the related technical descriptions will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0053] Figure 1 is a schematic diagram of a system architecture according to an embodiment of the present invention;
[0054] Figure 2 is a flowchart of a method for processing configuration information according to an embodiment of the present invention;
[0055] Figure 3 is a schematic diagram of a process for determining a configuration item to be changed according to an embodiment of the present invention;
[0056] Figure 4is a schematic diagram of a flow chart of determining an operation type corresponding to a configuration item change according to an embodiment of the present invention;
[0057] Figure 5 is a structural block diagram of an apparatus for processing configuration information according to an embodiment of the present invention;
[0058] Figure 6 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0059] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0060] The method for processing configuration information provided by the present invention can be performed as follows: Figure 1 The system implementation shown may include a processing device, at least one server and a storage device. The processing device may be a server or a terminal, on which target software may be installed, that is, the processing device executes a method for processing configuration information using the target software. The terminal is used as an example for explanation. The storage device may be a server, including a target database for storing configuration information backed up from the server.
[0061] The embodiment of the present invention provides a method for processing configuration information. By automatically processing the configuration information, manual operation by a technician is not required, thereby improving the efficiency of processing the configuration information.
[0062] According to an embodiment of the present invention, a method embodiment for processing configuration information is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0063] In this embodiment, a method for processing configuration information is provided, which can be executed by the above-mentioned processing device. Figure 2 is a flowchart of a method for processing configuration information according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:
[0064] Step S201: In the processing of the current cycle, identification information corresponding to the configuration item of the configuration information to be obtained is extracted from the pre-acquired configuration information collection policy corresponding to the server.
[0065] The number of configuration items of the configuration information to be obtained includes at least one. The configuration item may be Simple Network Management Protocol (SNMP) configuration, Network Time Protocol (NTP) configuration, network configuration, user configuration, email transmission configuration, etc.
[0066] Specifically, before the processing device processes the configuration information of the server, the user can input the Internet Protocol (IP) address, user name, password, and protocol information of the baseboard management controller (BMC) of the server in the processing device. The processing device can log in to the corresponding server through the user name, password, IP address, and protocol information, and scan the server to obtain information such as the manufacturer and model of the server. Further, the processing device can obtain the corresponding configuration information collection strategy based on the manufacturer and model of the server, and store it. At this point, the management operation of the server is completed. Among them, the protocol information includes the protocol type of the server. The configuration information collection strategy may include the identification information of the configuration items to be obtained, the backup method of the configuration information, and the recovery method. For example, the backup method may include the interface information of the backup interface and the interface information of the recovery interface.
[0067] For any server managed by the processing device, the processing device may periodically extract identification information corresponding to the configuration item of the configuration information to be obtained from the configuration information collection policy corresponding to the server.
[0068] Step S202: According to the identification information corresponding to each configuration item, the configuration information of each configuration item in the current cycle is collected in the server.
[0069] Specifically, the processing device may send the identification information of the configuration item to the server, and the server collects the configuration information in the current cycle from itself according to the identification information of the configuration information, and sends it to the processing device. In this way, the processing device can collect the configuration information of the configuration item in the current cycle.
[0070] Step S203, obtaining configuration information of each configuration item in a previous cycle corresponding to the current cycle, and software log information and device log information generated in the current cycle.
[0071] The software log information may be the software log information of the target software, which records the modification operation information of the configuration information of the server through the target software. The device log information may be the log information of the server, which records the modification operation information of all operation objects modifying the configuration information of the server, and the operation objects include the target software. For example, the device log information may include the system event log (System Event Log, SEL) of the BMC of the server, audit (referring to recording the access attempts to the system and the operations performed by the user on the system), one-key log (usually automatically packages a series of important system files and logs, such as system configuration, error logs, performance data, etc.), etc.
[0072] Step S204, determining at least one changed configuration item, and identification information corresponding to the changed configuration item and configuration information in the current cycle according to the device log information, and configuration information of each configuration item in the current cycle and configuration information in the previous cycle.
[0073] Specifically, the processing device may first determine which configuration items of the server have been modified and which configuration items have not been modified, that is, the processing device determines to change the configuration items. For the modified configuration items, the processing device needs to further process them. For the unmodified configuration items, the processing device does not need to pay attention to them in the current cycle.
[0074] The processing equipment can be based on Figure 3 The specific steps shown determine the changed configuration items:
[0075] Step 1: Determine whether the target configuration item is changed in the current cycle according to the configuration information of the target configuration item in the current cycle and the configuration information of the target configuration item in the previous cycle.
[0076] The target configuration item is any one of the at least one configuration item.
[0077] Step 2: When it is determined that the target configuration item has not been changed in the current cycle, the target configuration item is determined as a candidate configuration item.
[0078] Step three: after determining whether all configuration items in at least one configuration item are changed, a first category of candidate configuration items is obtained.
[0079] Step 4: parse the device log information according to the preset log parsing rules to determine at least one candidate configuration item, and identification information and configuration information in the current period corresponding to the at least one candidate configuration item.
[0080] Among them, at least one candidate configuration item obtained by parsing the device log information constitutes a second type of candidate configuration item.
[0081] Step 5: Take the union of the first category of candidate configuration items and the second category of candidate configuration items to obtain at least one changed configuration item.
[0082] Each changed configuration item has corresponding identification information and configuration information in the current cycle.
[0083] Specifically, first, taking the target configuration item as an example, the processing device can compare the configuration information of the target configuration item in the previous cycle and in the current cycle to determine whether the configuration information of the target configuration item has changed. If so, the target configuration item can be determined as a candidate configuration item. Then, for some configuration items, the target software cannot obtain their configuration information, but the relevant modification operations are recorded in the device log information. Therefore, this solution further collects the device log information of the server, and parses the device log information according to the preset log parsing rules to obtain the configuration type, identification information and configuration information corresponding to at least one candidate configuration item.
[0084] For the first category of candidate configuration items obtained by corresponding to the configuration information and the second category of candidate configuration items obtained by parsing the device log information, the processing device can perform a screening operation based on the identification information and configuration information of the candidate configuration items, and filter out the duplicate information, that is, take the union of the first category of candidate configuration items and the second category of candidate configuration items to obtain the final changed configuration items. And determine the corresponding identification information of the changed configuration items and the configuration information in the current cycle. The identification information of the changed configuration items and the configuration information in the current cycle can be directly obtained through step S202, or can be determined based on the parsing of the device log information.
[0085] Step S205 : determining the operation type corresponding to each changed configuration item according to the software log information, the identification information corresponding to each changed configuration item, and the configuration information in the current cycle.
[0086] Specifically, since the configuration information modified by the target software has passed the relevant verification operation of the target software, that is, the modification operation information recorded in the software log of the target software is safe, accordingly, the processing device Figure 4 The steps shown determine the type of operation that changes a configuration item:
[0087] Step 1: Determine whether the software log information includes modification operation information corresponding to the target changed configuration item based on the identification information corresponding to the target changed configuration item and the configuration information of the target changed configuration item in the current cycle.
[0088] The target changed configuration item is any one of the at least one changed configuration item.
[0089] Step 2: When it is determined that the software log information includes modification operation information corresponding to the target changed configuration item, it is determined that the operation type corresponding to the target changed configuration item is a backup operation type.
[0090] Step 3: Get the target blacklist.
[0091] The target blacklist includes identification information of configuration items that affect server operation.
[0092] Step 4: determine whether the identification information corresponding to the target configuration item to be changed is any of the identification information of the configuration items that affect the operation of the server.
[0093] Step 5: When it is determined that the identification information corresponding to the target changed configuration item is not any of the identification information of the configuration items that affect the operation of the server, it is determined that the operation type corresponding to the target changed configuration item is a backup operation type.
[0094] Step six: acquiring the baseline configuration information corresponding to the target changed configuration item according to the identification information corresponding to the target changed configuration item.
[0095] Step 7: Determine whether the configuration information of the target changed configuration item in the current cycle is consistent with the baseline configuration information corresponding to the target changed configuration item.
[0096] Step eight: when it is determined that the configuration information of the target configuration item to be changed in the current period is consistent with the baseline configuration information corresponding to the target configuration item to be changed, determining that the operation type corresponding to the target configuration item to be changed is a backup operation type.
[0097] or,
[0098] Step nine: when it is determined that the configuration information of the target changed configuration item in the current period does not conform to the baseline configuration information corresponding to the target changed configuration item, determine that the operation type corresponding to the target changed configuration item is a recovery operation type.
[0099] Specifically, the processing device can determine whether the corresponding modification operation information is recorded in the software log information according to the identification information corresponding to the target configuration item to be changed and the configuration information of the target configuration item to be changed in the current cycle. If yes, it is determined that the modification operation is safe and the configuration information needs to be backed up. At this time, the operation type corresponding to the target configuration item to be changed can be marked as a backup operation type. If no, it is necessary to determine whether the target configuration item to be changed is a configuration item that affects the operation of the server, that is, the processing device can first obtain the target blacklist and determine whether the identification information corresponding to the target configuration item to be changed is any identification information in the target blacklist. If no, it is determined that the modification operation is safe and the configuration information needs to be backed up. At this time, the operation type corresponding to the target configuration item to be changed can be marked as a backup operation type. If yes, the baseline configuration information corresponding to the target configuration item to be changed can be further obtained. And it is determined whether the configuration information of the target configuration item to be changed in the current cycle is consistent with the baseline configuration information corresponding to the target configuration item to be changed. If yes, it is determined that the modification operation is safe and the configuration information needs to be backed up. At this time, the operation type corresponding to the target configuration item to be changed can be marked as a backup operation type. If not, it is determined that there is a problem with the modification operation and a recovery operation needs to be performed on the configuration information. At this time, the operation type corresponding to the target modified configuration item can be marked as a recovery operation type.
[0100] For example, the preset log parsing rules may include identification information of key fields, identify the configuration type, identification information of the configuration item, and configuration information. For example, the configuration type may be NTP configuration, and the identification information of the configuration item is used to indicate the synchronization mode of NTP. The configuration information includes the synchronization mode and related information corresponding to the synchronization mode. For example, the synchronization mode may be manual synchronization or automatic synchronization, and the related information corresponding to the synchronization mode may include address information.
[0101] In some optional implementations, the target changed configuration item may not be configured with baseline configuration information. Accordingly, the baseline configuration information corresponding to the target changed configuration item may not be obtained in step six. At this time, the operation type corresponding to the target changed configuration item may be determined as a recovery operation type.
[0102] Step S206: According to the operation type corresponding to each modified configuration item, a process corresponding to the operation type is performed on the configuration information of each modified configuration item in the current cycle.
[0103] The operation type may be a backup operation type, a restore operation type, or the like.
[0104] Specifically, the processing device may perform processing corresponding to the operation type on the configuration information in the following two ways.
[0105] Method 1: When at least one backup change configuration item of the backup operation type is determined, the configuration information of each backup change configuration item in the current cycle is backed up to the target database. When at least one restore change configuration item of the restore operation type is determined, the configuration information of each restore change configuration item in the current cycle is restored to the baseline configuration information corresponding to the restore change configuration item.
[0106] Specifically, each time the processing device determines an operation type of a configuration change item, the processing device may perform corresponding processing on the configuration information of the configuration change item in the current cycle according to the operation type of the configuration change item.
[0107] Method 2: After determining the operation types of all the configuration change items, the processing device can first count the target number of configuration change items of each operation type. Taking the target operation type (any operation type) as an example, the processing device can determine whether the configuration change items of the target operation type include preset configuration items, wherein the preset configuration items can be the configuration change items of the above-mentioned unconfigured baseline configuration information, for example, configuration items related to password information. When it is determined that the target number is greater than the preset number threshold, or it is determined that the configuration change items of the target operation type include preset configuration items, the target file corresponding to the target operation type is obtained, and the processing corresponding to the target operation type is performed on the target file. When it is determined that the target number is less than or equal to the preset number threshold, and it is determined that the configuration change items of the target operation type do not include preset configuration items, the configuration information of the configuration change items of the target operation type is respectively processed in accordance with the target operation type.
[0108] When the target operation type is a backup operation type, the target file includes configuration information of all configuration items of the server corresponding to the current cycle. Alternatively, when the target operation type is a restore operation type, the target file includes configuration information of all configuration items of the server corresponding to the previous cycle.
[0109] Specifically, when the target operation type is a backup operation type, the processing device may back up the target file to the target database. Alternatively, when the target operation type is a restore operation type, the processing device may perform a restore operation of the configuration information on the server according to the target file. When it is determined that the target quantity is less than or equal to the preset quantity threshold, and it is determined that the changed configuration items of the target operation type do not include the preset configuration items, the processing may be performed according to the first method.
[0110] In this way, when the number of configuration items of the target operation type is small and all configuration items of the target operation type can be operated individually, the data transmission can be reduced and network resources can be saved by restoring the configuration information one by one. When the number of configuration items of the target operation type is large, the number of calls to the corresponding interface can be reduced through the overall target file, which can save computing resources. For configuration items that cannot be restored or backed up through a single configuration information, they can also be restored through the overall target file.
[0111] It should be noted that, under the processing of method 1, the user has already configured the baseline configuration information of the preset configuration items in advance, and can back up or configure it separately.
[0112] In some optional implementations, after completing the backup operation, the processing device may also modify the baseline configuration information of the target changed configuration item to the configuration information of the target changed configuration item in the current period.
[0113] After completing the above operations, obtain the actual operation information and baseline operation information corresponding to the first configuration item of the server in the current cycle, wherein the first configuration item is any one of the at least one configuration item. Determine whether the actual operation information corresponding to the first configuration item is consistent with the baseline operation information. When it is determined that the actual operation information corresponding to the first configuration item is inconsistent with the baseline operation information, obtain the configuration information of the first configuration item in the previous cycle. Restore the configuration information of the first configuration item in the current cycle to the configuration information of the first configuration item in the previous cycle.
[0114] For example, when the configuration item is SNMP Trap, the baseline operation information may be that the server can obtain alarm information. If the server does not receive the alarm information within the preset time period, it can be determined that there may be a problem with the configuration information of the configuration item, and the configuration information of the previous cycle can be restored.
[0115] In some optional implementations, the processing device may monitor the operating status of the server. When a problem is detected in the operating status of the server, the processing device may obtain configuration information corresponding to all configuration items in the previous cycle and perform recovery and restart operations on the server.
[0116] In some optional implementations, the user can select a manual processing mode on the processing device to process the configuration information manually (i.e., manually back up and restore the configuration information). For example, the configuration information of all configuration items of the server is restored to the configuration information corresponding to the Nth cycle.
[0117] The method for processing configuration information provided in this embodiment can periodically collect configuration information, device log information, and software log information of each configuration item of the server, and obtain the configuration information of each configuration item collected in the previous cycle. Further, through the configuration information of the configuration items of two cycles and the device log information, the configuration items to be changed, as well as the identification information corresponding to each configuration item and the configuration information in the current cycle are determined. Then, based on the software configuration information, the identification information of the changed configuration items and the configuration information in the current cycle, the operation type of each changed configuration item is determined, and finally, the corresponding processing is performed according to the operation type. In this way, the operation of processing the configuration information can be performed automatically without the need for manual execution by technical personnel, which is more efficient and has a lower probability of error.
[0118] In the present embodiment, a device for processing configuration information is also provided, and the device is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made are not repeated here. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0119] This embodiment provides a device for processing configuration information, such as Figure 5 As shown, including:
[0120] An extraction module 501 is used to extract identification information corresponding to the configuration items of the configuration information to be obtained from the pre-acquired configuration information collection policy corresponding to the server in the processing of the current cycle, wherein the number of the configuration items of the configuration information to be obtained includes at least one;
[0121] The collection module 502 is used to collect configuration information of each configuration item in the current cycle in the server according to the identification information corresponding to each configuration item;
[0122] The acquisition module 503 is used to acquire the configuration information of each configuration item in the previous cycle corresponding to the current cycle, as well as the software log information and device log information generated in the current cycle;
[0123] The determination module 504 is used to determine at least one changed configuration item, and identification information corresponding to the changed configuration and configuration information in the current cycle according to the device log information, and configuration information of each configuration item in the current cycle and configuration information in the previous cycle; determine the operation type corresponding to each changed configuration item according to the software log information, and identification information corresponding to each changed configuration item and configuration information in the current cycle;
[0124] The execution module 505 is used to perform processing corresponding to the operation type on the configuration information of each changed configuration item in the current cycle according to the operation type corresponding to each changed configuration item.
[0125] In an optional implementation, the determination module 504 is specifically configured to:
[0126] Determining whether the software log information includes modification operation information corresponding to the target changed configuration item according to identification information corresponding to the target changed configuration item and configuration information of the target changed configuration item in the current cycle, wherein the target changed configuration item is any one of the at least one changed configuration item;
[0127] When it is determined that the software log information includes the modification operation information corresponding to the target changed configuration item, it is determined that the operation type corresponding to the target changed configuration item is a backup operation type.
[0128] In an optional implementation, the determination module 504 is further configured to:
[0129] When it is determined that the software log information does not include modification operation information corresponding to the target changed configuration item, obtaining a target blacklist, wherein the target blacklist includes identification information of configuration items that affect the operation of the server;
[0130] Determine whether the identification information corresponding to the target changed configuration item is any of the identification information of the configuration items that affect the operation of the server;
[0131] When it is determined that the identification information corresponding to the target changed configuration item is not any of the identification information of the configuration items that affect the operation of the server, it is determined that the operation type corresponding to the target changed configuration item is a backup operation type.
[0132] In an optional implementation, the determination module 504 is further configured to:
[0133] When it is determined that the identification information corresponding to the target changed configuration item is any one of the identification information corresponding to the configuration items that affect the operation of the server, obtaining the baseline configuration information corresponding to the target changed configuration item according to the identification information corresponding to the target changed configuration item;
[0134] Determine whether the configuration information of the target changed configuration item in the current cycle conforms to the baseline configuration information corresponding to the target changed configuration item;
[0135] When it is determined that the configuration information of the target changed configuration item in the current period meets the baseline configuration information corresponding to the target changed configuration item, determining that the operation type corresponding to the target changed configuration item is a backup operation type;
[0136] or,
[0137] When it is determined that the configuration information of the target changed configuration item in the current period does not conform to the baseline configuration information corresponding to the target changed configuration item, it is determined that the operation type corresponding to the target changed configuration item is a recovery operation type.
[0138] In an optional implementation, the determination module 504 is specifically configured to:
[0139] Determining whether the target configuration item is changed in the current cycle according to the configuration information of the target configuration item in the current cycle and the configuration information of the target configuration item in the previous cycle, wherein the target configuration item is any one of the at least one configuration item;
[0140] When it is determined that the target configuration item has not been changed in the current cycle, the target configuration item is determined as a candidate configuration item;
[0141] After determining whether all configuration items in at least one configuration item are changed, a first category of candidate configuration items is obtained;
[0142] Parse the device log information according to the preset log parsing rule to determine at least one candidate configuration item, and identification information and configuration information in the current cycle respectively corresponding to the at least one candidate configuration item, wherein the at least one candidate configuration item obtained by parsing the device log information constitutes a second category of candidate configuration items;
[0143] A union of the first category candidate configuration items and the second category candidate configuration items is taken to obtain at least one changed configuration item, wherein each changed configuration item has corresponding identification information and configuration information in the current cycle.
[0144] In an optional implementation, the execution module 505 is specifically configured to:
[0145] When it is determined that at least one backup change configuration item whose operation type is a backup operation type is found, configuration information of each backup change configuration item in the current cycle is backed up to the target database.
[0146] In an optional implementation, the execution module 505 is specifically configured to:
[0147] When at least one restored configuration item whose operation type is a restore operation type is determined, the configuration information of each restored configuration item in the current period is restored to the baseline configuration information corresponding to the restored configuration item.
[0148] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0149] The device for processing configuration information in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0150] The embodiment of the present invention also provides a computer device having the above Figure 5 The device for processing configuration information is shown.
[0151] See also Figure 6 , Figure 6 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 6 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 6 A processor 10 is taken as an example.
[0152] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware integrated circuit. The hardware integrated circuit may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable logic gate array, a general purpose array logic or any combination thereof.
[0153] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0154] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0155] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0156] The computer device also includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means. Figure 6 The example of connecting through bus is taken in the following.
[0157] The input device 30 can receive input digital or character information, and generate key signal input related to the user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device can be a touch screen.
[0158] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0159] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.
[0160] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A method for processing configuration information, characterized in that: The method comprises: In the processing of the current cycle, extracting identification information corresponding to the configuration item of the configuration information to be obtained from the pre-acquired configuration information collection policy corresponding to the server, wherein the number of the configuration items of the configuration information to be obtained includes at least one; According to the identification information corresponding to each of the configuration items, collecting, in the server, the configuration information of each of the configuration items in the current period; Acquire configuration information of each of the configuration items in a previous cycle corresponding to the current cycle, as well as software log information and device log information generated in the current cycle; Determine at least one changed configuration item, and identification information corresponding to the changed configuration item and configuration information in the current cycle according to the device log information, and configuration information of each configuration item in the current cycle and configuration information in the previous cycle; Determine the operation type corresponding to each of the changed configuration items according to the software log information, the identification information corresponding to each of the changed configuration items, and the configuration information in the current cycle; According to the operation type corresponding to each of the changed configuration items, a process corresponding to the operation type is performed on the configuration information of each of the changed configuration items in the current cycle.
2. The method according to claim 1, characterized in that Determining the operation type corresponding to each of the changed configuration items according to the software log information, the identification information corresponding to each of the changed configuration items, and the configuration information in the current cycle includes: Determining whether the software log information includes modification operation information corresponding to the target changed configuration item according to identification information corresponding to the target changed configuration item and configuration information of the target changed configuration item in the current cycle, wherein the target changed configuration item is any one of the at least one changed configuration item; When it is determined that the software log information includes the modification operation information corresponding to the target changed configuration item, it is determined that the operation type corresponding to the target changed configuration item is a backup operation type.
3. The method according to claim 2, characterized in that When it is determined that the software log information does not include modification operation information corresponding to the target changed configuration item, the method further includes: Acquire a target blacklist, wherein the target blacklist includes identification information of configuration items that affect the operation of the server; Determine whether the identification information corresponding to the target changed configuration item is any one of the identification information of the configuration items that affect the operation of the server; When it is determined that the identification information corresponding to the target changed configuration item is not any of the identification information of the configuration items affecting the operation of the server, it is determined that the operation type corresponding to the target changed configuration item is the backup operation type.
4. The method according to claim 3, characterized in that When it is determined that the identification information corresponding to the target changed configuration item is any one of the identification information corresponding to the configuration item affecting the operation of the server, the method further includes: Acquire the baseline configuration information corresponding to the target changed configuration item according to the identification information corresponding to the target changed configuration item; Determining whether the configuration information of the target changed configuration item in the current cycle conforms to the baseline configuration information corresponding to the target changed configuration item; When it is determined that the configuration information of the target changed configuration item in the current period conforms to the baseline configuration information corresponding to the target changed configuration item, determining that the operation type corresponding to the target changed configuration item is the backup operation type; or, When it is determined that the configuration information of the target changed configuration item in the current period does not conform to the baseline configuration information corresponding to the target changed configuration item, it is determined that the operation type corresponding to the target changed configuration item is a recovery operation type.
5. The method according to any one of claims 1 to 4, characterized in that: The determining, according to the device log information, and the configuration information of each of the configuration items in the current cycle and the configuration information in the previous cycle, at least one changed configuration item, and the identification information corresponding to the changed configuration item and the configuration information in the current cycle, includes: Determining whether the target configuration item is changed in the current cycle according to the configuration information of the target configuration item in the current cycle and the configuration information of the target configuration item in the previous cycle, wherein the target configuration item is any one of the at least one configuration item; When it is determined that the target configuration item has not been changed in the current cycle, determining the target configuration item as a candidate configuration item; After determining whether all configuration items in at least one of the configuration items are changed, obtaining a first category of candidate configuration items; Parse the device log information according to a preset log parsing rule to determine at least one candidate configuration item, and identification information and configuration information in the current cycle respectively corresponding to at least one candidate configuration item, wherein the at least one candidate configuration item obtained by parsing the device log information constitutes a second category of candidate configuration items; A union of the first category candidate configuration items and the second category candidate configuration items is taken to obtain at least one of the changed configuration items, wherein each of the changed configuration items has corresponding identification information and configuration information in the current cycle.
6. The method according to any one of claims 2 to 4, characterized in that: The performing, according to the operation type corresponding to each of the changed configuration items, processing corresponding to the operation type on the configuration information of each of the changed configuration items in the current cycle includes: When it is determined that the operation type is at least one backup change configuration item of the backup operation type, the configuration information of each backup change configuration item in the current cycle is backed up to the target database.
7. The method according to claim 4, characterized in that The performing, according to the operation type corresponding to each of the changed configuration items, processing corresponding to the operation type on the configuration information of each of the changed configuration items in the current cycle includes: When it is determined that the operation type is at least one restored configuration item of the restore operation type, the configuration information of each restored configuration item in the current period is restored to the baseline configuration information corresponding to the restored configuration item.
8. A device for backing up configuration information, characterized in that: The device comprises: an extraction module, configured to extract identification information corresponding to a configuration item of the configuration information to be obtained from a pre-acquired configuration information collection policy corresponding to the server in the processing of the current cycle, wherein the number of the configuration items of the configuration information to be obtained includes at least one; A collection module, configured to collect configuration information of each of the configuration items in the current period in the server according to identification information corresponding to each of the configuration items; An acquisition module, used to acquire configuration information of each of the configuration items in a previous cycle corresponding to the current cycle, and software log information and device log information generated in the current cycle; A determination module, configured to determine at least one changed configuration item, and identification information corresponding to the changed configuration item and configuration information in the current cycle according to the device log information, and configuration information of each of the configuration items in the current cycle and configuration information in the previous cycle, wherein each of the changed configurations has corresponding identification information and configuration information in the current cycle; and determine an operation type corresponding to each of the changed configuration items according to the software log information, and identification information corresponding to each of the changed configuration items and configuration information in the current cycle; The execution module is used to perform processing corresponding to the operation type on the configuration information of each of the changed configuration items in the current cycle according to the operation type corresponding to each of the changed configuration items.
9. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method for processing configuration information according to any one of claims 1 to 7 by executing the computer instructions.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the method for processing configuration information according to any one of claims 1 to 7.