Configuration file processing method, device, equipment and computer-readable storage medium
By reading and migrating the historical storage path of the configuration file when the BMC starts, the data loss problem caused by the change of the BMC configuration file storage path is solved, and the seamless migration and efficient loading of configuration data are achieved.
Patent Information
- Application Number
- CN202510933092.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-07
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2045-07-07
AI Technical Summary
When the storage path or name of the BMC configuration file changes, the configuration data may be lost.
By reading the historical storage path information of the configuration file stored in the target storage, migrating it to the new storage path, and updating the storage path information, the BMC can correctly read the configuration data when it starts.
This effectively solves the problem of configuration data loss caused by changes in the configuration file storage path or name, ensures that the system can still locate the configuration data after the BMC upgrade, and improves the configuration loading efficiency during the firmware upgrade process.
Smart Images

Figure CN120429007B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of firmware upgrade, and in particular to a configuration file processing method, apparatus, device, and computer-readable storage medium. Background Art
[0002] A Baseboard Management Controller (BMC) is a microcontroller integrated into a server motherboard. It operates independently of the server's CPU (Central Processing Unit), memory, hard drive, and other components. When the BMC configuration is modified, it typically saves these changes to a configuration file. Traditional solutions can cause configuration data loss if the storage path or name of the BMC configuration file changes, making it impossible to retain configuration updates. Therefore, addressing these technical limitations has become a pressing issue for those skilled in the art. Summary of the Invention
[0003] The present application provides a configuration file processing method, apparatus, device, and computer-readable storage medium to at least solve the problem in the related art of configuration data loss caused by changes in the storage path or name of a BMC configuration file.
[0004] This application provides a configuration file processing method, including:
[0005] Read the storage path information of the configuration file stored in the target storage to obtain the historical storage path;
[0006] Reading configuration data from the target memory according to the historical storage path;
[0007] Migrate the read configuration data to the new storage path;
[0008] The storage path information in the target memory is updated to the new storage path, so as to read the configuration data according to the new storage path.
[0009] The present application also provides a configuration file processing device, comprising:
[0010] A storage path information reading module is used to read the storage path information of the configuration file stored in the target storage to obtain the historical storage path;
[0011] A configuration data reading module, configured to read configuration data from the target memory according to the historical storage path;
[0012] Configuration data migration module, used to migrate the read configuration data to the new storage path;
[0013] The storage path information updating module is configured to update the storage path information in the target memory to the new storage path so as to read the configuration data according to the new storage path.
[0014] The present application also provides an electronic device, comprising: a memory for storing a computer program; and a processor for implementing the steps of any of the above-mentioned configuration file processing methods when executing the computer program.
[0015] The present application also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned configuration file processing methods are implemented.
[0016] The present application also provides a computer program product, including a computer program, which implements the steps of any of the above-mentioned configuration file processing methods when executed by a processor.
[0017] The beneficial effects of the present application are as follows: when the BMC in the present application starts, the historical storage path of the configuration file is read from the target memory first, the configuration data is read according to the historical storage path, and then the read configuration data is migrated to the new storage path, and the storage path information in the target memory is updated to the new storage path, so that the next time the BMC starts, the new storage path is read from the target memory, and the configuration data is read according to the new storage path. Since the BMC gives priority to reading the configuration data based on the historical storage path when starting, when the BMC is upgraded to a new version, even if the storage path structure changes, the system can still locate the configuration data through the historical storage path stored in the target memory, which effectively solves the problem of configuration data loss when the storage path or name of the BMC configuration file changes. In addition, the present application directly updates the storage path during the firmware upgrade process without the need to temporarily store it in RAM or a temporary area. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0019] Figure 1 A flowchart of a configuration file processing method provided in an embodiment of the present application;
[0020] Figure 2 A schematic diagram of a configuration file storage address range provided in an embodiment of the present application;
[0021] Figure 3A hardware connection diagram provided in an embodiment of the present application;
[0022] Figure 4 A schematic diagram of configuring the correspondence between new and old storage paths at the code level provided in an embodiment of the present application;
[0023] Figure 5 A schematic diagram of a specific process of processing a configuration file provided in an embodiment of the present application;
[0024] Figure 6 A schematic diagram of adding a CRC value when writing data at the code level provided in an embodiment of the present application;
[0025] Figure 7 A schematic diagram of a code-level CRC check provided in an embodiment of the present application;
[0026] Figure 8 A schematic diagram of a configuration file processing device provided in an embodiment of the present application;
[0027] Figure 9 A schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0028] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0029] It should be noted that, in the description of this application, the terms "comprises," "includes," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. The terms "first," "second," etc., in this application are used to distinguish similar objects, and are not used to describe a particular order or sequence.
[0030] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0031] The embodiments of the present application provide a configuration file processing method, which is described in detail in conjunction with the execution flow of the configuration file processing method.
[0032] refer to Figure 1 As shown, the configuration file processing method in this embodiment includes:
[0033] S101: Read the storage path information of the configuration file stored in the target memory to obtain the historical storage path;
[0034] S102: Reading configuration data from the target memory according to the historical storage path;
[0035] S103: Migrating the read configuration data to a new storage path;
[0036] S104: Update the storage path information in the target memory to the new storage path, so as to read the configuration data according to the new storage path.
[0037] This embodiment stores the storage path information of the configuration file persistently in the target memory, aiming to achieve seamless migration of configuration data during the BMC firmware upgrade process. When the system is first run, the storage path (absolute path) of the configuration file (such as the cooling configuration file, network configuration file, user permission configuration file, etc.) will be written to the specific address area of the target memory. For example, Figure 2 As shown in the figure, the address range of the firmware partition status is 0x0000~0x00FF, the address range of the configuration path mapping is 0x0100~0x01FF, the address range of the sensor calibration parameters is 0x0200~0x02FF, and the address range of the security key is 0x0300~0x03FF.
[0038] Each time the BMC boots, it prioritizes reading the configuration file's historical storage path from the target storage, rather than directly using the new storage path encoded in the code. Based on the historical storage path, it reads the configuration data from the target storage, migrates the configuration data to the new storage path, and updates the storage path information in the target storage with the new storage path. The next time the BMC boots, it reads the new storage path from the target storage, and reads the configuration data based on the new storage path. This way, even if the storage path structure changes after the BMC is upgraded to a new version, the system can still locate the configuration data using the historical storage path stored in the target storage, completing the automatic migration of the configuration data.
[0039] In some embodiments, the target memory is a ferroelectric random access memory.
[0040] In this embodiment, the target memory is FRAM (Ferroelectric Random Access Memory). FRAM is compatible with the BMC's hardware interface, enabling the BMC to read and write FRAM data. For example, the Cypress (Infineon) FM24Vxx FRAM is compatible with the I²C interface, and the FM25Vxx FRAM is compatible with the SPI interface. For example, the connection method between FRAM (FM24C16B) and BMC (ASPEED AST2600) can be referred to. Figure 3 shown.
[0041] Configuration files and storage paths are stored in FRAM. FRAM's fast read / write speeds and high endurance (up to 10^14 read / write cycles) perfectly meet the BMC's frequent configuration access needs. FRAM's byte-level addressing allows for efficient storage of large amounts of path information, while hardware-level data persistence prevents configuration loss due to power outages. Compared to traditional FLASH storage solutions, FRAM can be directly overwritten without an erase operation, significantly improving the efficiency of BMC configuration loading during boot. FRAM's write speed is comparable to SRAM (nanoseconds), and it can be directly overwritten without an erase operation. This makes it suitable for frequent configuration updates (such as dynamic IPMI parameter adjustments). FRAM can withstand 10^12 read / write cycles, far exceeding EEPROM (10^5-10^6 cycles). EEPROM can lose data due to wear and tear over long periods of use. FRAM, on the other hand, does not suffer from "write wear" issues and does not require wear-leveling algorithms, thus reducing software complexity. FRAM is instantly persistent after writing, eliminating the need for capacitor or battery backup (power outages during EEPROM writes can corrupt data), thus preventing upgrade interruptions and configuration loss. If power is lost during a BMC firmware upgrade, the FRAM configuration is saved in real time, allowing the upgrade to resume after recovery. FRAM writes consume extremely low power (in the μA range), making it ideal for low-power scenarios like blade servers and edge computing devices. Using FRAM, configuration paths can be updated directly in-place. FRAM is compatible with standard interfaces (I2C / SPI), making it a hardware alternative to EEPROM without requiring revisions.
[0042] It should be noted that, in addition to FRAM, it can also be a non-volatile random access memory such as MRAM (Magnetoresistive Random-Access Memory) with characteristics such as high-speed reading and writing, high durability, power-off security, low power consumption, and interface compatibility.
[0043] A storage path mapping relationship is established in the target storage, and an independent storage unit is allocated for each configuration file. The storage path change history of each configuration file is recorded. The historical storage path is mapped to the new storage path, and the new storage path can be found through the mapping relationship. For example, refer to Figure 4 As shown (the target memory is FRAM), Figure 4 The save_contig_to_fram function writes the configuration data and storage path to FRAM. The fram_write interface is used to write the configuration data and storage path to the specified address of FRAM, respectively, to achieve persistent storage of the storage path information. The migrate_config function migrates the configuration file from the old storage path, i.e., the historical storage path, to the new storage path, and updates the path mapping in FRAM. The execution process includes: reading the old path: reading the old storage path from FRAM through fram_read; reading the configuration: reading the configuration data according to the old storage path; writing the new path: writing the read configuration data to the configuration file of the new storage path; updating FRAM: updating the path record in FRAM to the new storage path to ensure that the new storage path is used at the next startup.
[0044] In some embodiments, the method further includes: if no configuration data is read from the target memory according to the historical storage path, using a default configuration and recording an error log.
[0045] Combine Figure 5 As shown in the figure (the target memory is FRAM), after the BMC starts up, it determines whether there is a historical storage path in FRAM. If there is a historical storage path, it reads the historical storage path from FRAM and attempts to read the configuration data based on the historical storage path. It then determines whether the read is successful. If so, the configuration data is migrated to the new storage path and the FRAM is updated. If the read is unsuccessful, the default configuration is used and an error log is recorded. If there is no historical storage path, the new storage path is used and the configuration is initialized using the new storage path.
[0046] In some embodiments, reading the configuration data from the target memory according to the historical storage path includes:
[0047] Reading the configuration data from the target memory according to the historical storage path, and calculating a first cyclic redundancy check value of the configuration data using a cyclic redundancy check engine;
[0048] comparing the first cyclic redundancy check value with a second cyclic redundancy check value of the configuration data, wherein the second cyclic redundancy check value is a cyclic redundancy check value calculated by the cyclic redundancy check engine when writing the configuration data into the target memory;
[0049] If the first cyclic redundancy check value is consistent with the second cyclic redundancy check value, the configuration data verification passes;
[0050] If the first cyclic redundancy check value is inconsistent with the second cyclic redundancy check value, configuration data is loaded from the baseboard management controller.
[0051] When the BMC uses configuration data stored in the target memory, it uses a verification mechanism to ensure data integrity, verifying whether the configuration data has been corrupted (for example, due to power outages, hardware failures, or long-term aging). BMCs, such as the ASPEED AST2600, support a CRC engine. This CRC engine is a hardware acceleration module specifically designed to efficiently calculate CRC (Cyclic Redundancy Check) values. Using the CRC engine to calculate CRC values offloads the computational burden from the CPU, improving data verification efficiency.
[0052] refer to Figure 6 As shown, when the configuration data is written into the target memory, the BMC generates a CRC value (referred to as the second cyclic redundancy check value in this application) through the CRC engine and appends it to the end of the configuration data.
[0053] refer to Figure 7 As shown, when reading the configuration data stored in the FRAM, the CRC engine automatically calculates the CRC value (referred to as the first cyclic redundancy check value in this application) and compares it with the stored CRC value, namely the second cyclic redundancy check value, to confirm the integrity of the data.
[0054] If the first cyclic redundancy check value and the second cyclic redundancy check value of the configuration data are consistent, the configuration data CRC check passes. If the first cyclic redundancy check value and the second cyclic redundancy check value of the configuration data are inconsistent, the configuration data CRC check fails. If the CRC check fails, the configuration data is loaded from the BMC code.
[0055] In some embodiments, further comprising:
[0056] Reading target configuration data in the first storage partition and the second storage partition in the target memory;
[0057] comparing a second cyclic redundancy check value of the target configuration data in the first storage partition with a second cyclic redundancy check value of the target configuration data in the second storage partition; the second cyclic redundancy check value of the target configuration data in the first storage partition is a cyclic redundancy check value calculated by a cyclic redundancy check engine when the target configuration data is written to the target memory; the second cyclic redundancy check value of the target configuration data in the second storage partition is a cyclic redundancy check value calculated by a cyclic redundancy check engine when the target configuration data is written to the target memory;
[0058] Calculating, by the cyclic redundancy check engine, a first cyclic redundancy check value of the target configuration data in the first storage partition;
[0059] Calculating, by the cyclic redundancy check engine, a first cyclic redundancy check value of the target configuration data in the second storage partition;
[0060] comparing a first cyclic redundancy check value of the target configuration data in the first storage partition with a second cyclic redundancy check value of the target configuration data in the first storage partition;
[0061] comparing a first cyclic redundancy check value of the target configuration data in the second storage partition with a second cyclic redundancy check value of the target configuration data in the second storage partition;
[0062] The target configuration data is selected according to a comparison result of the second cyclic redundancy check value of the target configuration data in the first storage partition and the second cyclic redundancy check value of the target configuration data in the second storage partition, a comparison result of the first cyclic redundancy check value of the target configuration data in the first storage partition and the second cyclic redundancy check value of the target configuration data in the first storage partition, and a comparison result of the first cyclic redundancy check value of the target configuration data in the second storage partition and the second cyclic redundancy check value of the target configuration data in the second storage partition.
[0063] The target configuration data includes key configuration data such as partition status, IPMI password, server username and password. This embodiment employs a dual backup storage mechanism for the target configuration data. Two copies of the target configuration data are stored in the target memory: one in the first storage partition and one in the second storage partition.
[0064] When storing the target configuration data, the CRC value of the target configuration data is calculated by the CRC engine, and the CRC value is appended to the end of the target configuration data and stored in the target memory.
[0065] When reading target configuration data, the target configuration data is read from the first storage partition and the second storage partition in the target memory. The second cyclic redundancy check value of the target configuration data in the first storage partition is compared with the second cyclic redundancy check value of the target configuration data in the second storage partition. The first cyclic redundancy check value of the target configuration data in the first storage partition is calculated by a cyclic redundancy check engine. The first cyclic redundancy check value of the target configuration data in the second storage partition is calculated by a cyclic redundancy check engine. The first cyclic redundancy check value of the target configuration data in the first storage partition is compared with the second cyclic redundancy check value of the target configuration data in the first storage partition; the first cyclic redundancy check value of the target configuration data in the second storage partition is compared with the second cyclic redundancy check value of the target configuration data in the second storage partition. Based on each comparison result, the target configuration data to be used is selected.
[0066] If the second cyclic redundancy check value of the target configuration data in the first storage partition is consistent with the second cyclic redundancy check value of the target configuration data in the second storage partition, and the first cyclic redundancy check value of the target configuration data in the first storage partition is consistent with the second cyclic redundancy check value of the target configuration data in the first storage partition, the target configuration data in the first storage partition can be used at this time.
[0067] If the second cyclic redundancy check value of the target configuration data in the first storage partition is inconsistent with the second cyclic redundancy check value of the target configuration data in the second storage partition, and the first cyclic redundancy check value of the target configuration data in the first storage partition is inconsistent with the second cyclic redundancy check value of the target configuration data in the first storage partition, and the first cyclic redundancy check value of the target configuration data in the second storage partition is consistent with the second cyclic redundancy check value of the target configuration data in the second storage partition, then the target configuration data in the second storage partition is used.
[0068] The target configuration data in the first storage partition serves as primary data, while the target configuration data in the second storage partition serves as backup data. The primary data is used first, but if the primary data fails the CRC check but the backup data passes, the backup data is used. Using dual data backup storage effectively improves data security.
[0069] In some embodiments, if the first cyclic redundancy check value of the target configuration data in the first storage partition is inconsistent with the second cyclic redundancy check value of the target configuration data in the first storage partition, and the first cyclic redundancy check value of the target configuration data in the second storage partition is consistent with the second cyclic redundancy check value of the target configuration data in the second storage partition, then the target configuration data in the first storage partition is replaced with the target configuration data in the second storage partition.
[0070] If the first cyclic redundancy check value of the target configuration data in the first storage partition is consistent with the second cyclic redundancy check value of the target configuration data in the first storage partition, and the first cyclic redundancy check value of the target configuration data in the second storage partition is inconsistent with the second cyclic redundancy check value of the target configuration data in the second storage partition, then the target configuration data in the second storage partition is replaced with the target configuration data in the first storage partition.
[0071] In some embodiments, further comprising:
[0072] After the configuration data is written into the target memory, the write protection pin of the target memory is set to a target level to prohibit writing operations to the target memory.
[0073] When the target memory is FRAM, the write protection pin is the FRAM's WP# pin. The WP# pin is controlled by the BMC's GPIO. After writing configuration data (such as sensitive data) to the target memory, pull the WP# pin high to disable write access. Hardware write protection effectively improves data security.
[0074] In some embodiments, further comprising:
[0075] Encrypt sensitive data with built-in encryption engine;
[0076] The encrypted data is written into the target memory.
[0077] For sensitive data, the BMC uses a built-in encryption engine (such as the AST2600's AES) to encrypt it and then store it in the target memory, which can improve the security of sensitive data.
[0078] In summary, in this application, when the BMC starts, it gives priority to reading the historical storage path of the configuration file from the target memory, reads the configuration data according to the historical storage path, and then migrates the read configuration data to the new storage path, and updates the storage path information in the target memory to the new storage path, so that the next time the BMC starts, it reads the new storage path from the target memory and reads the configuration data according to the new storage path. Since the BMC gives priority to reading the configuration data based on the historical storage path when it starts, when the BMC is upgraded to a new version, even if the storage path structure changes, the system can still locate the configuration data through the historical storage path stored in the target memory, which effectively solves the problem of configuration data loss when the storage path or name of the BMC configuration file changes. In addition, this application directly updates the storage path during the firmware upgrade process without the need to temporarily store it in RAM or a temporary area.
[0079] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method.
[0080] The embodiment of the present application also provides a configuration file processing device, referring to Figure 8 As shown, the device includes:
[0081] The storage path information reading module 10 is used to read the storage path information of the configuration file stored in the target memory to obtain the historical storage path;
[0082] a configuration data reading module 20, configured to read configuration data from the target memory according to the historical storage path;
[0083] A configuration data migration module 30 is used to migrate the read configuration data to a new storage path;
[0084] The storage path information updating module 40 is configured to update the storage path information in the target memory to the new storage path, so as to read the configuration data according to the new storage path.
[0085] Based on the above embodiment, as a specific implementation method, the configuration data reading module 20 includes:
[0086] a calculation unit, configured to read the configuration data from the target memory according to the historical storage path, and calculate a first cyclic redundancy check value of the configuration data using a cyclic redundancy check engine;
[0087] a comparing unit, configured to compare the first cyclic redundancy check value with a second cyclic redundancy check value of the configuration data; the second cyclic redundancy check value being a cyclic redundancy check value calculated by the cyclic redundancy check engine when writing the configuration data into the target memory;
[0088] a determination unit, configured to determine that verification of the configuration data passes if the first cyclic redundancy check value is consistent with the second cyclic redundancy check value;
[0089] The loading unit is configured to load configuration data from a baseboard management controller if the first cyclic redundancy check value is inconsistent with the second cyclic redundancy check value.
[0090] Based on the above embodiment, as a specific implementation method, the following is also included:
[0091] a target configuration data reading module, configured to read target configuration data in the first storage partition and the second storage partition in the target memory;
[0092] a first comparison module, configured to compare a second cyclic redundancy check value of the target configuration data in the first storage partition with a second cyclic redundancy check value of the target configuration data in the second storage partition; the second cyclic redundancy check value of the target configuration data in the first storage partition is a cyclic redundancy check value calculated by a cyclic redundancy check engine when the target configuration data is written to the target memory; the second cyclic redundancy check value of the target configuration data in the second storage partition is a cyclic redundancy check value calculated by a cyclic redundancy check engine when the target configuration data is written to the target memory;
[0093] a first calculation module, configured to calculate a first cyclic redundancy check value of the target configuration data in the first storage partition by using the cyclic redundancy check engine;
[0094] a second calculation module, configured to calculate a first cyclic redundancy check value of the target configuration data in the second storage partition by using the cyclic redundancy check engine;
[0095] a second comparison module, configured to compare a first cyclic redundancy check value of the target configuration data in the first storage partition with a second cyclic redundancy check value of the target configuration data in the first storage partition;
[0096] a third comparison module, configured to compare the first cyclic redundancy check value of the target configuration data in the second storage partition with the second cyclic redundancy check value of the target configuration data in the second storage partition;
[0097] a selection module, configured to select target configuration data based on a comparison result of the second cyclic redundancy check value of the target configuration data in the first storage partition and the second cyclic redundancy check value of the target configuration data in the second storage partition, a comparison result of the first cyclic redundancy check value of the target configuration data in the first storage partition and the second cyclic redundancy check value of the target configuration data in the first storage partition, and a comparison result of the first cyclic redundancy check value of the target configuration data in the second storage partition and the second cyclic redundancy check value of the target configuration data in the second storage partition.
[0098] Based on the above embodiment, as a specific implementation method, the following is also included:
[0099] The hardware protection module is used to set the write protection pin of the target memory to a target level after writing the configuration data into the target memory, so as to prohibit the write operation to the target memory.
[0100] Based on the above embodiment, as a specific implementation method, the following is also included:
[0101] A recording module is configured to use a default configuration and record an error log if no configuration data is read from the target memory according to the historical storage path.
[0102] Based on the above embodiment, as a specific implementation method, the following is also included:
[0103] Encryption module, used to encrypt sensitive data through a built-in encryption engine;
[0104] The writing module is used to write the encrypted data into the target memory.
[0105] Based on the above embodiment, as a specific implementation method, the target memory is a ferroelectric random access memory.
[0106] For the description of the features in the embodiment corresponding to the configuration file processing device, reference can be made to the relevant description of the embodiment corresponding to the configuration file processing method, which will not be repeated here.
[0107] The embodiment of the present application also provides an electronic device, referring to Figure 9 As shown, the electronic device includes a memory 1 and a processor 2. The memory 1 stores a computer program, and the processor 2 is configured to run the computer program to execute the steps in any of the above configuration file processing method embodiments.
[0108] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. The computer program is configured to execute the steps of any of the above configuration file processing method embodiments when running.
[0109] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.
[0110] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps of any of the above configuration file processing method embodiments are implemented.
[0111] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of any of the above-mentioned configuration file processing method embodiments are implemented.
[0112] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0113] The above describes in detail a configuration file processing method, apparatus, device, and computer-readable storage medium provided by the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only intended to help understand the method and core concept of the present application. It should be noted that, for those skilled in the art, without departing from the principles of the present application, several improvements and modifications may be made to the present application, and such improvements and modifications also fall within the scope of protection of the present application.
Claims
1. A configuration file processing method, characterized in that: include: Read the storage path information of the configuration file stored in the target storage to obtain the historical storage path; When the baseboard management controller starts, it first reads the historical storage path of the configuration file from the target memory instead of directly using the new storage path encoded in the code; Reading configuration data from the target memory according to the historical storage path; Migrate the read configuration data to the new storage path; Updating the storage path information in the target memory to the new storage path so as to read the configuration data according to the new storage path; Reading target configuration data in the first storage partition and the second storage partition in the target memory; comparing a second cyclic redundancy check value of the target configuration data in the first storage partition with a second cyclic redundancy check value of the target configuration data in the second storage partition; Calculating, by the cyclic redundancy check engine, a first cyclic redundancy check value of the target configuration data in the first storage partition; Calculating, by the cyclic redundancy check engine, a first cyclic redundancy check value of the target configuration data in the second storage partition; comparing a first cyclic redundancy check value of the target configuration data in the first storage partition with a second cyclic redundancy check value of the target configuration data in the first storage partition; comparing a first cyclic redundancy check value of the target configuration data in the second storage partition with a second cyclic redundancy check value of the target configuration data in the second storage partition; The target configuration data is selected according to a comparison result of the second cyclic redundancy check value of the target configuration data in the first storage partition and the second cyclic redundancy check value of the target configuration data in the second storage partition, a comparison result of the first cyclic redundancy check value of the target configuration data in the first storage partition and the second cyclic redundancy check value of the target configuration data in the first storage partition, and a comparison result of the first cyclic redundancy check value of the target configuration data in the second storage partition and the second cyclic redundancy check value of the target configuration data in the second storage partition.
2. The configuration file processing method according to claim 1, characterized in that: Reading configuration data from the target memory according to the historical storage path includes: Reading the configuration data from the target memory according to the historical storage path, and calculating a first cyclic redundancy check value of the configuration data using a cyclic redundancy check engine; comparing the first cyclic redundancy check value with a second cyclic redundancy check value of the configuration data, wherein the second cyclic redundancy check value is a cyclic redundancy check value calculated by the cyclic redundancy check engine when writing the configuration data into the target memory; If the first cyclic redundancy check value is consistent with the second cyclic redundancy check value, the configuration data verification passes; If the first cyclic redundancy check value is inconsistent with the second cyclic redundancy check value, configuration data is loaded from the baseboard management controller.
3. The configuration file processing method according to claim 1, wherein: Also includes: After the configuration data is written into the target memory, the write protection pin of the target memory is set to a target level to prohibit writing operations to the target memory.
4. The configuration file processing method according to claim 1, wherein: Also includes: If the configuration data is not read from the target memory according to the historical storage path, a default configuration is used and an error log is recorded.
5. The configuration file processing method according to claim 1, characterized in that: Also includes: Encrypt sensitive data with built-in encryption engine; The encrypted data is written into the target memory.
6. The configuration file processing method according to claim 1, characterized in that: The target memory is a ferroelectric random access memory.
7. A configuration file processing device, characterized in that: include: A storage path information reading module is used to read the storage path information of the configuration file stored in the target storage to obtain the historical storage path; When the baseboard management controller starts, it first reads the historical storage path of the configuration file from the target memory instead of directly using the new storage path encoded in the code; A configuration data reading module, configured to read configuration data from the target memory according to the historical storage path; Configuration data migration module, used to migrate the read configuration data to the new storage path; a storage path information updating module, configured to update the storage path information in the target memory to the new storage path, so as to read the configuration data according to the new storage path; a target configuration data reading module, configured to read target configuration data in the first storage partition and the second storage partition in the target memory; a first comparison module, configured to compare a second cyclic redundancy check value of the target configuration data in the first storage partition with a second cyclic redundancy check value of the target configuration data in the second storage partition; a first calculation module, configured to calculate a first cyclic redundancy check value of the target configuration data in the first storage partition by using the cyclic redundancy check engine; a second calculation module, configured to calculate a first cyclic redundancy check value of the target configuration data in the second storage partition by using the cyclic redundancy check engine; a second comparison module, configured to compare a first cyclic redundancy check value of the target configuration data in the first storage partition with a second cyclic redundancy check value of the target configuration data in the first storage partition; a third comparison module, configured to compare the first cyclic redundancy check value of the target configuration data in the second storage partition with the second cyclic redundancy check value of the target configuration data in the second storage partition; a selection module, configured to select target configuration data based on a comparison result of the second cyclic redundancy check value of the target configuration data in the first storage partition and the second cyclic redundancy check value of the target configuration data in the second storage partition, a comparison result of the first cyclic redundancy check value of the target configuration data in the first storage partition and the second cyclic redundancy check value of the target configuration data in the first storage partition, and a comparison result of the first cyclic redundancy check value of the target configuration data in the second storage partition and the second cyclic redundancy check value of the target configuration data in the second storage partition.
8. An electronic device, characterized in that: include: memory for storing computer programs; A processor, configured to implement the steps of the configuration file processing method according to any one of claims 1 to 6 when executing the computer program.
9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the steps of the configuration file processing method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
BMC configuration management method and device, electronic equipment and storage medium
CN114553859A