Configuration file reply method

By determining the verification code consistency of the configuration file in the substrate management controller and using a backup configuration file instead of the abnormal configuration file, the initialization failure problem caused by the power outage of the BMC is solved, ensuring the normal operation of the system and avoiding the inconvenience of users to reset the parameters.

CN120371598APending Publication Date: 2025-07-25MITAC COMP (SHUN DE) LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410111161.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-01-25
Publication Date
2025-07-25

AI Technical Summary

Technical Problem

The existing technology has abnormal or damaged configuration files due to unexpected power outages in the substrate management controller (BMC), resulting in system initialization failure. The existing reply method requires the configuration files to be returned to the factory settings, which affects the user's convenience.

Method used

By executing the configuration file reply method in the substrate management controller, the verification code consistency between the current configuration file and the backup configuration file is determined. In case of abnormalities, the backup configuration file is used to replace it to ensure smooth initialization, and the verification code is updated using the md5sum hash algorithm to maintain the normal state of the configuration file.

Benefits of technology

It realizes that while the system initialization is smooth, it avoids the inconvenience of users to reset system parameters and ensures the normality of configuration files and user convenience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120371598A_ABST
    Figure CN120371598A_ABST
Patent Text Reader

Abstract

In the configuration file reply method, a substrate management controller executes the following steps of: judging whether a current configuration file, a check code to be compared and a backup configuration file are stored in a storage module or not; when it is judged that the current configuration file, the check code to be compared and the backup configuration file are stored, a current check code corresponding to the current configuration file is obtained, and whether the current check code is consistent with the check code to be compared or not is judged; when it is judged that the current check code is not consistent with the check code to be compared, taking the backup configuration file as the current configuration file; obtaining a to-be-updated check code corresponding to the current configuration file, and taking the to-be-updated check code as the to-be-compared check code; and copying the current configuration file to obtain a copied configuration file, and taking the copied configuration file as the backup configuration file.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a recovery method, in particular to a configuration file recovery method. Background Art

[0002] During the system initialization process when the computer is powered on, the Baseboard Management Controller (hereinafter referred to as BMC) accesses relevant parameters as a configuration file and updates the configuration file at any time during the system operation. If the BMC encounters an unexpected power failure when writing the configuration file to the memory, it may cause the configuration file to be abnormal or damaged due to incomplete writing of the configuration file data, resulting in failure of initialization when the computer is powered on next time, and further causing the system to malfunction (for example, unexpected behaviors such as repeated power-on occur). The existing methods for handling abnormal configuration files mostly restore the abnormal configuration file to the factory settings to make the configuration file return to the normal state so that the system can be initialized smoothly. However, since the configuration file is restored to the factory settings, users need to reset the system parameters during subsequent use, causing inconvenience to users.

[0003] Therefore, how to keep the configuration file normal and enable the system to be initialized smoothly while minimizing the impact on the user's convenience has become one of the issues to be solved in the related technical fields. Summary of the Invention

[0004] Therefore, an object of the present invention is to provide a configuration file recovery method that can overcome at least one drawback of the prior art.

[0005] Thus, a configuration file recovery method provided by the present invention is executed by using a baseboard management controller during a power-on initialization program of the baseboard management controller, and includes the following steps: (A) determining whether a storage module connected to the baseboard management controller stores a current configuration file, a comparison check code to be compared, and a backup configuration file; (B) when it is determined that the storage module stores the current configuration file, the comparison check code to be compared, and the backup configuration file, obtaining a current check code corresponding to the current configuration file, and determining whether the current check code is consistent with the comparison check code to be compared; (C) when it is determined that the current check code is not consistent with the comparison check code to be compared, using the backup configuration file as the current configuration file; (D) obtaining a check code to be updated corresponding to the current configuration file, and using the check code to be updated as the comparison check code to be compared; and (E) copying the current configuration file to obtain a copied configuration file, and using the copied configuration file as the backup configuration file.

[0006] Specifically, after step (B), the following steps are further included: (F) when it is determined that the current check code is consistent with the comparison check code to be compared, performing step (D).

[0007] Specifically, after step (A), the following steps are further included: (G) When at least one of the current configuration file, the check code to be compared, and the backup configuration file is not stored in the storage module, continue to execute the power-on initialization program to obtain an initial configuration file as the current configuration file.

[0008] Specifically, after step (E), the following steps are further included: (H) Determine whether the current configuration file is updated; and (I) When it is determined that the current configuration file is updated, the process returns to step (D).

[0009] Specifically, in step (H), it is determined whether the current configuration file is updated by determining whether an update notification indicating that the current configuration file has been updated is received from an operating system; and in step (I), when it is determined that the update notification is received, the process returns to step (D).

[0010] Specifically, after step (H), the following steps are further included: (J) When it is determined that the update notification is not received, the process returns to step (H).

[0011] Specifically, in step (B), the current check code is generated by the baseboard management controller according to the content in the current configuration file using an md5sum hash algorithm.

[0012] Specifically, in step (D), the check code to be updated is generated by the baseboard management controller according to the content in the current configuration file using an md5sum hash algorithm.

[0013] Specifically, steps (D), (E), and (F) together serve as a configuration file monitoring program, and the configuration file monitoring program runs in parallel with the power-on initialization program.

[0014] Compared with the prior art, in the configuration file recovery method of the present invention, it is determined whether the current configuration file is abnormal by determining whether the current check code of the current configuration file at this power-on is consistent with the check code to be compared at the previous power-on, and when an abnormality occurs, the backup configuration file at the previous power-on replaces the abnormal current configuration file, thereby ensuring the normality of the current configuration file and enabling the initialization of the system to proceed smoothly. In addition, since the configuration file generated at the most recent power-on before this power-on is used as the backup configuration file for recovery, after initializing with the backup configuration file, the user does not need to reset the system parameters, thereby avoiding the inconvenience brought to the user by restoring the current configuration file to the factory settings. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Other features and effects of the present invention will be clearly presented in the embodiments with reference to the drawings, wherein:

[0016] Figure 1 is a block diagram, exemplarily illustrating a baseboard management controller and a storage module used in a configuration file recovery method according to an embodiment of the present invention; and

[0017] Figure 2 is a flowchart, exemplarily illustrating how the baseboard management controller of this embodiment executes the configuration file recovery method. Detailed implementation manners

[0018] Before the present invention is described in detail, it should be noted that in the following description, similar elements are denoted by the same reference numerals.

[0019] Refer to Figure 1 and Figure 2 , a configuration file recovery method according to an embodiment of the present invention is executed by a baseboard management controller 1 electrically connected to a storage module 2. In this embodiment, the storage module 2 can be implemented as a flash memory, for example. When a computer device provided with the baseboard management controller 1 is powered on, the baseboard management controller 1 performs a power-on initialization program and simultaneously executes the configuration file recovery method. The configuration file recovery method includes the following steps S21 to S27.

[0020] In step S21, the baseboard management controller 1 determines whether a current configuration file, a comparison check code to be compared, and a backup configuration file are stored in the storage module 2. This step S21 is used to determine whether the computer device is powered on for the first time. When at least one of the current configuration file, the comparison check code to be compared, and the backup configuration file is not stored in the storage module 2, the computer device is powered on for the first time, and the process proceeds to step S22 to obtain the current configuration file; when the baseboard management controller 1 determines that the current configuration file, the comparison check code to be compared, and the backup configuration file are stored in the storage module 2, the computer device is not powered on for the first time, and the process proceeds to step S23 to determine whether the current configuration file is normal.

[0021] In step S22, the baseboard management controller 1 continues to execute the power-on initialization program to obtain an initial configuration file as the current configuration file. Since the baseboard management controller 1 is powered on for the first time and there is no corresponding current configuration file, it is necessary to wait for the power-on initialization program to execute to generate the initial configuration file, so as to obtain the required current configuration file. In this embodiment, the baseboard management controller 1 uses an inotify module in a Linux operating system to monitor whether the initial configuration file is created. When the initial configuration file is created, the inotify module issues a creation notice indicating that the initial configuration file has been created. When the baseboard management controller 1 receives the creation notice, the baseboard management controller 1 takes the initial configuration file as the current configuration file. Thereafter, the process proceeds to step S25 to enable a configuration file monitoring program.

[0022] In step S23, the baseboard management controller 1 obtains a current checksum corresponding to the current configuration file and determines whether the current checksum is the same as the checksum to be compared, so as to determine whether the current configuration file is normal. In this embodiment, the current checksum is generated by the baseboard management controller 1 according to the content in the current configuration file using an md5sum hash algorithm. When the baseboard management controller 1 determines that the current checksum is different from the checksum to be compared, the current configuration file is abnormal, and the process proceeds to step S24; when the baseboard management controller 1 determines that the current checksum is the same as the checksum to be compared, the current configuration file is normal, and the process proceeds to step S25 to enable the configuration file monitoring program.

[0023] In step S24, the baseboard management controller 1 takes the backup configuration file as the current configuration file. The configuration file used during the previous normal power-on (i.e., the backup configuration file) is used to replace the abnormal current configuration file, so that the power-on initialization program and the configuration file monitoring program can continue to execute smoothly.

[0024] After ensuring that the current configuration file exists (powered on for the first time) or the current configuration file is normal (not powered on for the first time), the baseboard management controller 1 executes the configuration file monitoring program. The configuration file monitoring program is implemented as the following steps S25 to S27 in the configuration file recovery method.

[0025] In step S25, the baseboard management controller 1 obtains a checksum to be updated corresponding to the current configuration file and takes the checksum to be updated as the checksum to be compared. In this embodiment, the checksum to be updated is generated by the baseboard management controller 1 according to the content in the current configuration file using the md5sum hash algorithm.

[0026] In step S26, the baseboard management controller 1 copies the current configuration file to obtain a copied configuration file, and uses the copied configuration file as the backup configuration file. Through this step, it is ensured that the backup configuration file used for recovery during the next startup is always the latest configuration file generated during the last normal startup.

[0027] In step S27, the baseboard management controller 1 determines whether the current configuration file has been updated. In this embodiment, the baseboard management controller 1 uses the inotify module to monitor whether the current configuration file has been updated. When the current configuration file is updated, the inotify module issues an update notification indicating that the current configuration file has been updated (i.e., the current configuration file has been closed from the write mode). Therefore, the baseboard management controller 1 determines whether the current configuration file has been updated by determining whether the update notification has been received. When it is determined that the update notification has been received, the process returns to step S25; otherwise, the process proceeds to step S27 again.

[0028] The baseboard management controller 1 repeats the configuration file monitoring program by repeatedly executing steps S25 to S27 to achieve the purpose of continuously monitoring and updating the backup configuration file while the computer device is running, so that the backup configuration file is always in the latest state.

[0029] It should be noted that when the computer device is powered on for the first time, the process will only sequentially proceed to steps S21, S22, and S25 to S27; while when the computer device is not powered on for the first time, the process will sequentially proceed to steps S21, S23, S24 (not executed when the current configuration file is normal), and steps S25 to S27.

[0030] In summary, by determining whether the current checksum of the current configuration file during this startup is consistent with the checksum to be compared during the previous startup, it is determined whether the current configuration file is abnormal, and when it is abnormal, the backup configuration file during the previous startup is used to replace the abnormal current configuration file, thereby ensuring the normality of the current configuration file and enabling the system initialization to proceed smoothly. In addition, since the configuration file generated during the last startup before this startup is used as the backup configuration file for recovery, users do not need to reset the system parameters after initializing with the backup configuration file, thus avoiding the inconvenience brought to users by restoring the current configuration file to the factory settings. Therefore, the object of the present invention can indeed be achieved.

[0031] The above is only the specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present invention can easily think of changes or substitutions, which should all be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the claims.

Claims

1. A configuration file recovery method, which is executed by a baseboard management controller during a power-on initialization program of the baseboard management controller, and is characterized in that, And includes the following steps: (A) Determine whether a current configuration file, a verification code to be compared, and a backup configuration file are stored in a storage module connected to the baseboard management controller; (B) When it is determined that the current configuration file, the verification code to be compared, and the backup configuration file are stored in the storage module, obtain a current verification code corresponding to the current configuration file, and determine whether the current verification code is consistent with the verification code to be compared; (C) When it is determined that the current verification code is not consistent with the verification code to be compared, use the backup configuration file as the current configuration file; (D) Obtain a verification code to be updated corresponding to the current configuration file, and use the verification code to be updated as the verification code to be compared; And (E) Copy the current configuration file to obtain a copied configuration file, and use the copied configuration file as the backup configuration file.

2. The configuration file reply method according to claim 1, characterized in that, After step (B), the following steps are further included: (F) When it is determined that the current verification code is consistent with the verification code to be compared, perform step (D).

3. The configuration file reply method according to claim 2, wherein After step (A), the following steps are further included: (G) When at least one of the current configuration file, the verification code to be compared, and the backup configuration file is not stored in the storage module, continue to execute the power-on initialization program to obtain an initial configuration file as the current configuration file.

4. The configuration file reply method according to claim 3, wherein After step (E), the following steps are further included: (H) Determine whether the current configuration file is updated; and (I) When it is determined that the current configuration file is updated, the process returns to step (D).

5. The configuration file reply method according to claim 4, wherein In step (H), it is determined whether the current configuration file is updated by determining whether an update notification indicating that the current configuration file has been updated is received from an operating system; And In step (I), when it is determined that the update notification is received, the process returns to step (D).

6. The configuration file reply method according to claim 5, wherein After step (H), the following steps are further included: (J) When it is determined that the update notification is not received, the process returns to step (H).

7. The configuration file reply method according to claim 1, wherein In step (B), the current verification code is generated by the baseboard management controller according to the content in the current configuration file using an md5sum hash algorithm.

8. The configuration file reply method according to claim 1, characterized in that, In step (D), the verification code to be updated is generated by the baseboard management controller according to the content in the current configuration file using an md5sum hash algorithm.

9. The configuration file reply method according to claim 2, wherein Steps (D), (E), and (F) together form a configuration file monitoring program, and the configuration file monitoring program runs in parallel with the power-on initialization program.