CN117472291B - Data block verification method and device, storage medium and electronic equipment - Google Patents

Data block verification method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN117472291B
CN117472291B CN202311820665.2A CN202311820665A CN117472291B CN 117472291 B CN117472291 B CN 117472291B CN 202311820665 A CN202311820665 A CN 202311820665A CN 117472291 B CN117472291 B CN 117472291B
Authority
CN
China
Prior art keywords
partition
target file
management controller
file
board management
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202311820665.2A
Other languages
Chinese (zh)
Other versions
CN117472291A (en
Inventor
张中云
朱绍霞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Metabrain Intelligent Technology Co Ltd
Original Assignee
Suzhou Metabrain Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Metabrain Intelligent Technology Co Ltd filed Critical Suzhou Metabrain Intelligent Technology Co Ltd
Priority to CN202311820665.2A priority Critical patent/CN117472291B/en
Publication of CN117472291A publication Critical patent/CN117472291A/en
Application granted granted Critical
Publication of CN117472291B publication Critical patent/CN117472291B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/064Management of blocks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0604Improving or facilitating administration, e.g. storage management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/0643Management of files
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the application provides a data block verification method and device, a storage medium and electronic equipment, wherein the method comprises the following steps: under the condition that the single board management controller loads the target file corresponding to the configuration partition, determining space division information corresponding to the flash memory space associated with the single board management controller; determining a first partition for storing the target file in the flash memory space according to the space division information; the data blocks in the first partition are checked by using the file system format of the target file to obtain a first check result, namely, the bad block condition of the partition is determined in advance by checking the corresponding storage partition before writing the target file, so that the detection efficiency of Flash particle damage caused by excessive use of a certain partition due to software BUG is improved, and the problems of slow abnormal processing and low processing efficiency of the configuration partition in the case of hard failure of Flash particles during each upgrade or BMC restarting in the related art can be solved.

Description

Data block verification method and device, storage medium and electronic equipment
Technical Field
The embodiment of the application relates to the field of communication, in particular to a data block verification method and device, a storage medium and electronic equipment.
Background
In a storage or server software stack, a BMC (Baseboard Management Controller, abbreviated as BMC) is mainly responsible for hardware state management of a board card in a storage frame and acquisition of auxiliary X86 positioning information, and along with more and more different client differentiated configurations, the BMC needs to provide a client configuration item interface so as to facilitate different clients to configure different parameters. The BMC itself may also have some basic configuration that requires the OS to issue. Therefore, during BMC design, a configuration partition (Conf partition) is specially divided from a Flash memory space Flash for storing the BMC single board management controller image and is used for BMC self and client differentiated configuration. The Conf partition is also mounted in a file system manner and supports real-time modification. In the practical application of the project, the code BUG triggers excessive use of the Flash of the Conf partition, and even exceeds the erasing times, so that the probability of Flash bad blocks of the Conf partition is greatly increased.
In the related art, in order to solve the above-mentioned problem, it is proposed that the BMC only checks files in the Conf partition when the Conf partition file system (JFFS 2) is mounted, and if the checking fails, erases the entire Conf partition Flash, and then updates the default configuration to the Conf partition. And finally, manually adding the customer configuration. However, as the fault model of Flash itself, there is a soft failure model of Flash which "can solve Flash bit errors by erasure and then can continue to be used normally". Therefore, the scheme can solve the problem of failure mode of Flash due to soft failure in the particle. However, the above solution still requires the client to manually add the configuration again, and when the above solution encounters a hard failure of the Flash granule, which occurs at each upgrade or at the time of restarting the BMC, the above solution cannot effectively process, resulting in slow exception handling for the configuration and low processing efficiency.
Aiming at the problems of slow exception handling and low processing efficiency of a configuration partition in the related art when Flash particles are hard to fail during each upgrade or BMC restarting.
Disclosure of Invention
The embodiment of the application provides a data block verification method and device, a storage medium and electronic equipment, which are used for at least solving the problems of slow exception handling and low processing efficiency of a configuration partition when Flash particles fail hard during each upgrade or BMC restarting in the related technology.
According to one embodiment of the present application, there is provided a method for checking a data block, including: under the condition that a single board management controller loads a target file corresponding to a configuration partition, determining space division information corresponding to a flash memory space associated with the single board management controller; determining a first partition for storing the target file in the flash memory space according to the space division information; and checking the data blocks in the first partition by using the file system format of the target file to obtain a first checking result.
In an exemplary embodiment, after verifying the data block in the first partition using the file system format of the target file to obtain a first verification result, the method further includes: determining to continuously load the target file into the first partition under the condition that a first check result indicates that the data block in the first partition passes the check; and adding a first mark for prohibiting loading of the target file to the first partition under the condition that the first check result indicates that the data block in the first partition fails to pass the check.
In an exemplary embodiment, after adding a first flag to the first partition that prohibits loading the target file in a case where the first check result indicates that the data block in the first partition fails the check, the method further includes: reading a mapping configuration file corresponding to the first partition and used for indicating the partition address; determining partition numbers of a plurality of partitions currently started in the flash memory space according to the mapping configuration file; and configuring the next partition adjacent to the first partition as a second partition for loading the target file according to the partition number, wherein the second partition has the same number of data blocks as the first partition.
In an exemplary embodiment, before reading the mapping configuration file corresponding to the first partition and used for indicating the partition address, the method further includes: determining a read-only memory associated with the single board management controller; acquiring a preset mapping configuration file corresponding to a flash memory space associated with the single board management controller; and storing the preset mapping configuration file on the read-only memory.
In an exemplary embodiment, after configuring a next partition adjacent to the first partition according to the partition number as a second partition for loading the target file, the method further includes: adding a second marker to the second partition; and under the condition that the second mark addition is determined to be completed, sending a reset instruction to the single board management controller, wherein the reset instruction is used for indicating the single board management controller to restart loading of the target file.
In an exemplary embodiment, in a case where a first check result indicates that a data block in the first partition passes the check, determining to continuously load the target file into the first partition includes: acquiring a first type configuration file in a random access memory contained in the single board management controller; and determining the first type of configuration file as a target file to be loaded into the first partition.
In an exemplary embodiment, before obtaining the first type of configuration file in the random access memory included in the board management controller, the method further includes: under the condition that no configuration file exists in the random access memory, acquiring an image file corresponding to the single board management controller; and determining the initial configuration file corresponding to the image file as a target file to be loaded into the first partition.
In an exemplary embodiment, before the board management controller loads the target file corresponding to the configuration partition, the method further includes: acquiring modification information sent by a target object to the single board management controller; determining modification content corresponding to the target file according to the modification information; writing the modified content into a storage space corresponding to a random access memory contained in the single board management controller, and updating a file of a first type of configuration file existing in the storage space to obtain a second type of configuration file; and executing a loading operation on the second type of configuration file, wherein the loading operation is used for indicating the loading of the second configuration file in the random access memory into a flash memory space.
In an exemplary embodiment, configuring a next partition adjacent to the first partition as a second partition for loading the target file according to the partition number includes: updating the second partition to a storage partition corresponding to the target file to be loaded of the first partition; and under the condition that the updating is completed, generating a target log for replacing the second partition with the first partition.
In an exemplary embodiment, after configuring a next partition adjacent to the first partition according to the partition number as a second partition for loading the target file, the method further includes: identifying whether the second partition is the last partition in the flash space; and under the condition that the second partition is determined to be the last partition, generating an early warning log of the flash memory space, wherein the early warning log is used for indicating that the partition in the flash memory space cannot be replaced.
In an exemplary embodiment, after determining that the second partition is the last partition, the method further includes: checking the data blocks in the second partition by using the file system format of the target file to obtain a second checking result; and determining whether to skip loading of the target file in the starting process of the single board management controller according to the second checking result.
In an exemplary embodiment, determining whether to skip loading of the target file during the startup of the board management controller according to the second check result includes: determining to continue loading the target file into the second partition if the second check result indicates that the data block in the second partition passes the check; and under the condition that the second check result indicates that the data block in the second partition does not pass the check, the single board management controller is indicated to skip the loading of the target file in the starting process.
In an exemplary embodiment, after instructing the on-board management controller to skip loading the target file in the starting process, the method further includes: acquiring starting information of the single board management controller; and under the condition that the single board management controller is determined to finish starting according to the starting information, determining to generate a fault log of hardware faults in a flash memory space associated with the single board management controller.
In an exemplary embodiment, the above method further comprises: identifying all logs generated by the single board management controller in the whole starting process; and under the condition that the early warning log and the fault log exist in all logs at the same time, sending fault prompt information to a management object of the single board management controller, wherein the fault prompt information is used for indicating the management object to physically replace a flash memory space corresponding to the single board management controller.
According to another embodiment of the present application, there is provided a data block verification apparatus, including: the first determining module is used for determining space division information corresponding to a flash memory space associated with the single board management controller under the condition that the single board management controller loads a target file corresponding to a configuration partition; the second determining module is used for determining a first partition for storing the target file in the flash memory space according to the space division information; and the verification module is used for verifying the data blocks in the first partition by using the file system format of the target file to obtain a first verification result.
In an exemplary embodiment, the apparatus further includes an instruction module, configured to verify a data block in the first partition using a file system format of the target file, and determine to continuously load the target file into the first partition after obtaining a first verification result, where the first verification result indicates that the data block in the first partition passes the verification; and adding a first mark for prohibiting loading of the target file to the first partition under the condition that the first check result indicates that the data block in the first partition fails to pass the check.
In an exemplary embodiment, the indicating module further includes: the configuration unit is used for reading a mapping configuration file corresponding to the first partition and used for indicating a partition address after adding a first mark for prohibiting loading of the target file to the first partition under the condition that the first check result indicates that the data block in the first partition does not pass the check; determining partition numbers of a plurality of partitions currently started in the flash memory space according to the mapping configuration file; and configuring the next partition adjacent to the first partition as a second partition for loading the target file according to the partition number, wherein the second partition has the same number of data blocks as the first partition.
In an exemplary embodiment, the indicating module further includes: a first obtaining unit, configured to determine a read-only memory associated with the board management controller before reading a mapping configuration file corresponding to the first partition and used for indicating a partition address; acquiring a preset mapping configuration file corresponding to a flash memory space associated with the single board management controller; and storing the preset mapping configuration file on the read-only memory.
In an exemplary embodiment, the indicating module further includes: a reset unit, configured to add a second flag to a second partition adjacent to the first partition after configuring the next partition as the second partition for loading the target file according to the partition number; and under the condition that the second mark addition is determined to be completed, sending a reset instruction to the single board management controller, wherein the reset instruction is used for indicating the single board management controller to restart loading of the target file.
In an exemplary embodiment, the above indication module is further configured to obtain a first type of configuration file in a random access memory included in the board management controller; and determining the first type of configuration file as a target file to be loaded into the first partition.
In an exemplary embodiment, the indicating module further includes: a second obtaining unit, configured to obtain an image file corresponding to the board management controller under the condition that it is determined that no configuration file exists in the random access memory before obtaining a first type of configuration file in the random access memory included in the board management controller; and determining the initial configuration file corresponding to the image file as a target file to be loaded into the first partition.
In an exemplary embodiment, the above apparatus further includes: the modification module is used for acquiring modification information sent by the target object to the single board management controller before the single board management controller loads the target file corresponding to the configuration partition; determining modification content corresponding to the target file according to the modification information; writing the modified content into a storage space corresponding to a random access memory contained in the single board management controller, and updating a file of a first type of configuration file existing in the storage space to obtain a second type of configuration file; and executing a loading operation on the second type of configuration file, wherein the loading operation is used for indicating the loading of the second configuration file in the random access memory into a flash memory space.
In an exemplary embodiment, the configuration unit is further configured to update the second partition to a storage partition corresponding to a target file to be loaded by the first partition; and under the condition that the updating is completed, generating a target log for replacing the second partition with the first partition.
In an exemplary embodiment, the indicating module further includes: the early warning unit is used for identifying whether the second partition is the last partition in the flash memory space after configuring the next partition adjacent to the first partition as the second partition for loading the target file according to the partition number; and under the condition that the second partition is determined to be the last partition, generating an early warning log of the flash memory space, wherein the early warning log is used for indicating that the partition in the flash memory space cannot be replaced.
In an exemplary embodiment, the early warning unit further includes: a checking subunit, configured to check, after determining that the second partition is the last partition, a data block in the second partition by using a file system format of the target file, to obtain a second check result; and determining whether to skip loading of the target file in the starting process of the single board management controller according to the second checking result.
In an exemplary embodiment, the above-mentioned checking subunit is further configured to determine to continuously load the target file into the second partition if the second check result indicates that the data block in the second partition passes the check; and under the condition that the second check result indicates that the data block in the second partition does not pass the check, the single board management controller is indicated to skip the loading of the target file in the starting process.
In an exemplary embodiment, the early warning unit further includes: the fault unit is used for indicating that the starting information of the single board management controller is obtained after the loading of the target file is skipped in the starting process of the single board management controller; and under the condition that the single board management controller is determined to finish starting according to the starting information, determining to generate a fault log of hardware faults in a flash memory space associated with the single board management controller.
In an exemplary embodiment, the above apparatus further includes: the prompt module is used for identifying all logs generated by the single board management controller in the whole starting process; and under the condition that the early warning log and the fault log exist in all logs at the same time, sending fault prompt information to a management object of the single board management controller, wherein the fault prompt information is used for indicating the management object to physically replace a flash memory space corresponding to the single board management controller.
According to a further embodiment of the present application, there is also provided a computer readable storage medium having stored therein a computer program, wherein the computer program is arranged to perform the steps of any of the method embodiments described above when run.
According to a further embodiment of the present application, there is also provided an electronic device comprising a memory having stored therein a computer program and a processor arranged to run the computer program to perform the steps of any of the method embodiments described above.
According to the method and the device, under the condition that the single board management controller loads the target file corresponding to the configuration partition, space division information corresponding to the flash memory space associated with the single board management controller is determined; determining a first partition for storing the target file in the flash memory space according to the space division information; the method comprises the steps of checking a data block in a first partition by using a file system format of a target file to obtain a first checking result, checking the file system format of the target file used by different partitions in a Flash memory space before loading the target file corresponding to a configuration partition by using a single board management controller, and checking a storage partition corresponding to the target file before writing the target file, thereby determining bad block conditions of the partitions in advance, improving detection efficiency of Flash particle damage caused by excessive use of a certain partition, and solving the problems of slow abnormal processing and low processing efficiency of the configuration partition when Flash particle hard failure occurs during each upgrade or BMC restart in the related art, so as to save maintenance cost of the single board management controller and avoid return board caused by hardware problems triggered by the software BUG.
Drawings
Fig. 1 is a hardware block diagram of a computer terminal of a data block verification method according to an embodiment of the present application;
FIG. 2 is a flow chart of a method of verifying a data block according to an embodiment of the present application;
FIG. 3 is a schematic diagram of the partitioning of an alternative flash space Flsah according to an embodiment of the present application;
FIG. 4 is an alternative Conf partition bad block replacement schematic diagram according to an embodiment of the present application;
FIG. 5 is a schematic diagram of an alternative BMCConf partition bad block detection and auto-replacement software flow according to an embodiment of the present application;
FIG. 6 is a flow diagram of an alternative BMCConf file writing software according to an embodiment of the present application;
FIG. 7 is a block diagram of a data block verification device according to an embodiment of the present application;
fig. 8 is a block diagram of the architecture of a computer system of an alternative electronic device according to an embodiment of the present application.
Detailed Description
In order to make the present application solution better understood by those skilled in the art, the following description will be made in detail and with reference to the accompanying drawings in the embodiments of the present application, it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, shall fall within the scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that embodiments of the present application described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
The method embodiments provided by the embodiments of the present application may be performed in a computer terminal or similar computing system. Taking the example of running on a computer terminal, fig. 1 is a block diagram of a hardware structure of a computer terminal of a data block verification method according to an embodiment of the present application. As shown in fig. 1, the computer terminal may include one or more (only one is shown in fig. 1) processors 102 (the processor 102 may include, but is not limited to, a processing system such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, and in one exemplary embodiment, may also include a transmission device 106 for communication functions and an input-output device 108. It will be appreciated by those skilled in the art that the configuration shown in fig. 1 is merely illustrative and is not intended to limit the configuration of the computer terminal described above. For example, a computer terminal may also include more or fewer components than shown in FIG. 1, or have a different configuration than the equivalent functions shown in FIG. 1 or more than the functions shown in FIG. 1.
The memory 104 may be used to store a computer program, for example, a software program of application software and a module, such as a computer program corresponding to a verification method of a data block in the embodiment of the present application, and the processor 102 executes the computer program stored in the memory 104, thereby performing various functional applications and data processing, that is, implementing the method described above. Memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage systems, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory remotely located relative to the processor 102, which may be connected to the computer terminal via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 106 is used to receive or transmit data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of a computer terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, simply referred to as NIC) that can connect to other network devices through a base station to communicate with the internet.
In this embodiment, a method for checking a data block is provided and applied to the computer terminal, and fig. 2 is a flowchart of an optional method for checking a data block according to an embodiment of the present application, where the flowchart includes the following steps:
step S202, under the condition that a single board management controller loads a target file corresponding to a configuration partition, determining space division information corresponding to a flash memory space associated with the single board management controller;
it should be noted that, in order to ensure the effectiveness of the division of the Flash memory space corresponding to the board management controller, when the BMC design is performed, partition planning needs to be performed on the Flash memory space Flsah corresponding to the board management controller, and fig. 3 is a schematic diagram of the division of the Flash memory space Flsah according to an embodiment of the present application, where the BMC-Flash uses the remaining space Flash address B to the Flash end address a' as the partition for replacing Conf. And according to the residual space size of ' Flash addresses B-A ', ' Conf partition size ', ' Conf replacement frequency is N at most.
In addition, for better understanding, the roles of the resources in the single board management controller BMC are described, as shown in fig. 3, the BMC-FLASH is used for storing code images, configuration files, logs and the like of the BMC; DDR is used for running code of BMC; the on-chip RAM of the BMC is used as the mirror image of the BMC-Conf partition file.
Secondly, the RAM in the board management controller BMC is used for storing the Conf partition content of the BMC in real time, including the basic configuration and the client configuration of the BMC, and in practical application, in order to support that RAM data is not lost when power is lost, therefore, the RAM power supply is changed into button battery power supply.
Step S204, determining a first partition for storing the target file in the flash memory space according to the space division information;
it should be noted that, the first partition refers to a partition corresponding to a partition size required by data corresponding to the target file, and in practical application, the first partition may be formed by a plurality of partition sub-partitions corresponding to flash memory space Flsah.
Step S206, checking the data blocks in the first partition by using the file system format of the target file to obtain a first checking result.
In a simple way, in the Linux system, the Flash physical area and the file system are accepted through the MTD device layer, and when the MTD device is loaded, the physical address of the Flash partition needs to be configured to complete the dynamic replacement of the Conf partition.
Optionally, fig. 4 is an optional schematic diagram of replacement of bad blocks of a Conf partition according to an embodiment of the present application, specifically, when the file system of the Conf partition JFF is mounted, during loading of the MTD device, an address range storing the partition to be replaced may be determined according to a Conf partition address configuration file, that is, during loading of the MTD device, dynamic replacement of a physical Flash space of the Conf partition may be completed by means of the configuration file.
The data structure attributes of the Conf-ConfN configuration files at least include the following contents, such as Table 1 (the addresses are example addresses).
Table 1: a Conf partition address mapping configuration file;
as an alternative embodiment, the BMC-initiated Conf partition starts with Conf 0. Before the BMC loads the Conf0 partition JFF2 file system, checking Flash of the Conf partition according to JFF file system format, if the check is passed, continuing loading, if the check is failed, reading a Conf partition address mapping configuration file, finding out the current started Conf partition number, and setting a damage mark of the Conf partition to TRUE. Then the next adjacent Conf partition starting mark is set as Enable, the BMC is reset, and the loading process is restarted.
Through the steps, under the condition that the single board management controller loads the target file corresponding to the configuration partition, space division information corresponding to the flash memory space associated with the single board management controller is determined; determining a first partition for storing the target file in the flash memory space according to the space division information; the method comprises the steps of checking a data block in a first partition by using a file system format of a target file to obtain a first checking result, checking the file system format of the target file used by different partitions in a Flash memory space before loading the target file corresponding to a configuration partition by using a single board management controller, and checking a storage partition corresponding to the target file before writing the target file, thereby determining bad block conditions of the partitions in advance, improving detection efficiency of Flash particle damage caused by excessive use of a certain partition, and solving the problems of slow abnormal processing and low processing efficiency of the configuration partition when Flash particle hard failure occurs during each upgrade or BMC restart in the related art, so as to save maintenance cost of the single board management controller and avoid return board caused by hardware problems triggered by the software BUG.
In an exemplary embodiment, after verifying the data block in the first partition using the file system format of the target file to obtain a first verification result, the method further includes: determining to continuously load the target file into the first partition under the condition that a first check result indicates that the data block in the first partition passes the check; and adding a first mark for prohibiting loading of the target file to the first partition under the condition that the first check result indicates that the data block in the first partition fails to pass the check.
It can be understood that after the partition of the target file to be stored is checked through the file system format, when the check fails, it is indicated that there is an abnormality in the partition at this time, and when the check succeeds, it is indicated that the current partition can normally load the target file, optionally, the target file may be a code image, a configuration file, a log, or the like corresponding to the board management controller, and when the partition is found to be abnormal through the check, partition replacement may be performed, and when the partition that does not pass the check passes the addition of a flag, so that loading of the target file to the partition having the abnormality may be avoided when loading of the target file is performed subsequently.
In summary, according to the above embodiment, whether the current partition writing process of the target file is normal is determined through the verification result, so as to identify the abnormal situation and perform partition adjustment.
In an exemplary embodiment, after adding a first flag to the first partition that prohibits loading the target file in a case where the first check result indicates that the data block in the first partition fails the check, the method further includes: reading a mapping configuration file corresponding to the first partition and used for indicating the partition address; determining partition numbers of a plurality of partitions currently started in the flash memory space according to the mapping configuration file; and configuring the next partition adjacent to the first partition as a second partition for loading the target file according to the partition number, wherein the second partition has the same number of data blocks as the first partition.
It can be understood that when Flash memory space Flash corresponding to the single board management controller is selected, flash with large capacity can be selected by hardware because Flash is cheaper. And the residual Flash space is 30% -50%. When the BMC mounts the Conf partition file system, if the Conf partition is found to be damaged, a block of area is automatically divided from the spare Flash to be used as the Conf partition until the Flash free space is used up. Furthermore, to ensure that the target file can be loaded in the new partition, the newly partitioned second partition requires a data block that has the same amount of data as the second partition.
In summary, through the above embodiment, when the partition is damaged or abnormal, the partition with the same size is repartitioned from the free space in the flash memory space, so that the write-in procedure of the target file is not affected by replacing the partition when the hardware with the particle failure in the flash memory space fails, and the loading stability of the target file is improved.
In an exemplary embodiment, before reading the mapping configuration file corresponding to the first partition and used for indicating the partition address, the method further includes: determining a read-only memory associated with the single board management controller; acquiring a preset mapping configuration file corresponding to a flash memory space associated with the single board management controller; and storing the preset mapping configuration file on the read-only memory.
For example, in practical application, in order to facilitate the BMC to conveniently read the "Conf partition address mapping configuration file" when loading the MTD device or JFF2 scan, the "Conf partition address mapping configuration file" may be saved in the on-board E2PROM. When the method is applied, the Conf partition address mapping configuration text of the current BMC can be quickly loaded, data reference is provided for subsequent partition replacement, and the situation of repeated replacement is avoided.
In summary, through the above embodiment, the preset mapping configuration file corresponding to the flash memory space is effectively stored, so that the influence of other data is avoided, and the accuracy of using the preset mapping configuration file as the reference file for partition replacement is improved.
In an exemplary embodiment, after configuring a next partition adjacent to the first partition according to the partition number as a second partition for loading the target file, the method further includes: adding a second marker to the second partition; and under the condition that the second mark addition is determined to be completed, sending a reset instruction to the single board management controller, wherein the reset instruction is used for indicating the single board management controller to restart loading of the target file.
For example, the BMC initial Conf partition starts with Conf 0. Before the BMC loads the Conf0 partition JFF2 file system, checking Flash of the Conf partition according to JFF file system format, if the check is passed, continuing loading, if the check is failed, reading a Conf partition address mapping configuration file, finding out the current started Conf partition number, and setting a damage mark of the Conf partition to TRUE. Then the next adjacent Conf partition starting mark is set as Enable, the BMC is reset, and the loading process is restarted. When loading again, the new Conf partition is found to be good, and then the Conf file of the on-chip RAM (power failure is not lost) is written into the new Conf partition. After the BMC is started, in the running process, if the client modifies the content of the Conf file, the Conf file is written into a RAM (Random Access Memory, a random access memory, for short, RAM) firstly, and then written into Flash.
It should be noted that, in order to ensure continuous storage of the Conf file by the RAM, an independent power supply is set in the current board management controller for the RAM to supply power, and optionally, the independent power supply may be a button cell.
In summary, according to the above embodiment, after the replacement of the partition is completed, in order to ensure the writing of the target file, the on-board management controller needs to be reset, to instruct the on-board management controller to perform the loading verification process of the target file from the new start, and because the first partition that fails to pass the verification is replaced by the second partition that passes the verification, the target file can be effectively loaded into the flash memory space.
In an exemplary embodiment, in a case where a first check result indicates that a data block in the first partition passes the check, determining to continuously load the target file into the first partition includes: acquiring a first type configuration file in a random access memory contained in the single board management controller; and determining the first type of configuration file as a target file to be loaded into the first partition.
In an exemplary embodiment, before obtaining the first type of configuration file in the random access memory included in the board management controller, the method further includes: under the condition that no configuration file exists in the random access memory, acquiring an image file corresponding to the single board management controller; and determining the initial configuration file corresponding to the image file as a target file to be loaded into the first partition.
As an alternative implementation manner, before loading the Conf partition file system, checking the Conf partition, if the checking is successful, loading the Conf partition file system, and if the checking is failed, judging whether the partition is used or not: if not, writing the Conf file in the on-chip RAM into a new Conf partition, and setting the table entry "use mark" of the corresponding Conf partition in the "Conf partition address mapping configuration file" as "True". If there is no Conf file in the on-chip RAM, the new Conf partition is written using the initial Conf file in the BMC-Image. If so, the entry "damage flag" of the corresponding Conf partition in the "Conf partition address mapping configuration file" is updated to "True". And sets the "Enable flag" of the next partition to "Enable".
In summary, in order to ensure that the data is loaded into the flash memory space through the random access memory, the configuration efficiency of the Conf file of the BMC is improved according to the writing of the configuration file under the condition that the check result remembered is different.
In an exemplary embodiment, before the board management controller loads the target file corresponding to the configuration partition, the method further includes: acquiring modification information sent by a target object to the single board management controller; determining modification content corresponding to the target file according to the modification information; writing the modified content into a storage space corresponding to a random access memory contained in the single board management controller, and updating a file of a first type of configuration file existing in the storage space to obtain a second type of configuration file; and executing a loading operation on the second type of configuration file, wherein the loading operation is used for indicating the loading of the second configuration file in the random access memory into a flash memory space.
In an exemplary embodiment, configuring a next partition adjacent to the first partition as a second partition for loading the target file according to the partition number includes: updating the second partition to a storage partition corresponding to the target file to be loaded of the first partition; and under the condition that the updating is completed, generating a target log for replacing the second partition with the first partition.
In an exemplary embodiment, after configuring a next partition adjacent to the first partition according to the partition number as a second partition for loading the target file, the method further includes: identifying whether the second partition is the last partition in the flash space; and under the condition that the second partition is determined to be the last partition, generating an early warning log of the flash memory space, wherein the early warning log is used for indicating that the partition in the flash memory space cannot be replaced.
Briefly, the partition replacement log is recorded before the next Conf partition is started. And judging whether the partition is the last Conf partition, and if so, recording Flash fault early warning. And resetting the BMC so as to restart execution, searching a Conf partition address mapping configuration file in the loading stage of the MTD equipment started by the BMC, judging an enabling mark, a damage mark and a use mark, finding an available partition when the partition is enabled and is not damaged, and loading a Flash address corresponding to the partition to Flash starting address and ending address members in a data structure of the MTD equipment. And starting the system until the Conf partition file system is loaded, checking the Conf partition first, if the checking is successful, loading the Conf partition file system, and if the checking is failed, judging whether the partition is used or not.
In summary, according to the above embodiment, the partition replacement performed in the flash space may be recorded by recording the replacement log, and in addition, by determining whether there is any partition that may be used for replacement in the flash space, the validity of the current flash space is determined, and in the case that the flash space does not meet the replacement requirement, hard replacement is performed on the flash space.
In an exemplary embodiment, after determining that the second partition is the last partition, the method further includes: checking the data blocks in the second partition by using the file system format of the target file to obtain a second checking result; and determining whether to skip loading of the target file in the starting process of the single board management controller according to the second checking result.
As an alternative implementation, if no available Conf partition is found, the Conf partition Flash fault is recorded, the Conf partition is skipped to be loaded, and the BMC is started continuously.
In an exemplary embodiment, determining whether to skip loading of the target file during the startup of the board management controller according to the second check result includes: determining to continue loading the target file into the second partition if the second check result indicates that the data block in the second partition passes the check; and under the condition that the second check result indicates that the data block in the second partition does not pass the check, the single board management controller is indicated to skip the loading of the target file in the starting process.
In an exemplary embodiment, after instructing the on-board management controller to skip loading the target file in the starting process, the method further includes: acquiring starting information of the single board management controller; and under the condition that the single board management controller is determined to finish starting according to the starting information, determining to generate a fault log of hardware faults in a flash memory space associated with the single board management controller.
In an exemplary embodiment, the above method further comprises: identifying all logs generated by the single board management controller in the whole starting process; and under the condition that the early warning log and the fault log exist in all logs at the same time, sending fault prompt information to a management object of the single board management controller, wherein the fault prompt information is used for indicating the management object to physically replace a flash memory space corresponding to the single board management controller.
In short, when there is a failure of the Conf partition, a new Conf partition is performed to replace an old Conf partition, a log of each Conf partition replacement is recorded, and when the old Conf partition is replaced to the last Conf partition, a Flash failure early warning log is recorded. And when the last block also fails, loading the file system of the Conf partition is skipped when the BMC is started, and after the BMC is started, reporting a Flash failure alarm of the Conf partition. Specifically, whether the Flash fault early warning and the Flash fault are set or not is checked, and if the Flash fault early warning is set, the Flash fault early warning is reported. And if the two are set, reporting a Flash fault alarm.
In other words, in the process of partition replacement, when there is a last replaceable partition, a Flash fault early warning is sent first, which indicates that after the last replaceable partition is used for partition replacement, verification of loading of the target file is executed again, if the verification still fails, the current Flash may have a hard failure problem, that is, the current Flash is suspected to have an abnormality that the replacement cannot be normally loaded for many times, in addition, when it is determined that the last replaceable partition is complete and the verification is abnormal, it is determined that the current Flash has a hard failure fault, at this time, flash fault warning is allowed to be directly reported, when the management object finds that the Flash fault warning of the current single board management controller indicates that Flash cannot be used normally after the Flash fault warning is solved by erasure, and when the Flash particle hard failure problem is encountered, the management object needs to replace and repair the Flash space corresponding to the current single board management controller, that new Flash storage particles with the same Flash storage particle model are used for replacing and repairing the single board management controller, thereby maintaining the whole operation of the single board management controller normally.
It will be apparent that the embodiments described above are only some, but not all, of the embodiments of the present application. In order to better understand the above-mentioned verification method of the data block, the following description will explain the above-mentioned process with reference to the embodiments, but is not used to limit the technical solution of the embodiments of the present application, specifically:
an alternative embodiment of the present application provides writing software for BMC configuration partition bad block detection, automatic replacement and Flash failure alarm, and fig. 5 is a schematic flow diagram of an alternative BMCConf partition bad block detection and automatic replacement software according to an embodiment of the present application, specifically including the following flows:
it should be noted that, in practical application, according to the actual situation of a specific item, the information content as shown in table 1 is calculated, and the Conf partition address mapping configuration file corresponding to table 1 is written into the main board E2PROM in the single board production and processing stage.
Step S504: in the loading stage of the MTD equipment started by the BMC, searching a Conf partition address mapping configuration file, judging an enabling mark, a damage mark and a use mark, when the partition is enabled and is not damaged, finding an available partition, and then loading a Flash address corresponding to the partition to Flash starting address and end address members in a data structure of the MTD equipment.
Step S506: starting is continued until the Conf partition file system is loaded, the Conf partition is checked first, if the check is successful, the Conf partition file system is loaded, and if the check is failed, whether the partition is used is judged: if not, writing the Conf file in the on-chip RAM into a new Conf partition, and setting the table entry "use mark" of the corresponding Conf partition in the "Conf partition address mapping configuration file" as "True". If there is no Conf file in the on-chip RAM, the new Conf partition is written using the initial Conf file in the BMC-Image. If so, the entry "damage flag" of the corresponding Conf partition in the "Conf partition address mapping configuration file" is updated to "True". And sets the "Enable flag" of the next partition to "Enable".
Step S508: partition replacement logs are recorded before the next Conf partition is started. And judging whether the partition is the last Conf partition, and if so, recording Flash fault early warning. The BMC is then reset and walks again S504.
Step S510: if the available Conf partition is not found, the Flash fault of the Conf partition is recorded, the Conf partition is skipped to be loaded, and the BMC is continuously started.
After the BMC is started, checking whether Flash fault early warning and Flash fault are set or not, and if the Flash fault early warning is set, reporting the Flash fault early warning. And if the two are set, reporting a Flash fault alarm.
Step S512: after the BMC is started, in the running process, if a client modifies the configuration of the Conf partition, the modification is written into the on-chip RAM first, and then the Conf partition is written. As shown in fig. 6, fig. 6 is a schematic flow diagram of an alternative BMCConf file writing software according to an embodiment of the present application.
It should be noted that, the RAM in the BMC chip adopts an external button battery to supply power, and is independently powered, and is not affected by the power supply of the whole machine. Through the flow, under the condition of bad blocks of the Conf partition, the next new partition can be detected and searched, and abnormal use reminding can be carried out in advance by carrying out early warning and fault warning on the Flash faults of the Conf partition.
In summary, through the above optional implementation manner, the configuration of the client is always online, and is not lost due to the damage of part of Flash particles. And the problem that a client modifies the Conf partition of the Flash area for many times, so that the Flash particle failure of the Conf partition causes board returning is avoided, and the product maintenance cost is saved. In addition, if the software BUG is used, flash particles are damaged due to overuse of a certain Conf partition, and by using the embodiment, the problem can be found through the inspection log in time while the customer configuration is not lost. And the problem of returning boards caused by triggering hardware by the software BUG is avoided.
From the description of the above embodiments, it will be clear to a person skilled in the art that the method according to the above embodiments may be implemented by means of software plus the necessary general hardware platform, but of course also by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk), comprising several instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method of the embodiments of the present application.
FIG. 7 is a block diagram of a data block verification device according to an embodiment of the present application; as shown in fig. 7, includes:
a first determining module 72, configured to determine space division information corresponding to a flash memory space associated with a board management controller when the board management controller loads a target file corresponding to a configuration partition;
a second determining module 74, configured to determine a first partition in the flash memory space for storing the target file according to the space division information;
And the verification module 76 is configured to verify the data block in the first partition by using the file system format of the target file, so as to obtain a first verification result.
Through the device, under the condition that the single board management controller loads the target file corresponding to the configuration partition, space division information corresponding to the flash memory space associated with the single board management controller is determined; determining a first partition for storing the target file in the flash memory space according to the space division information; the method comprises the steps of checking a data block in a first partition by using a file system format of a target file to obtain a first checking result, checking the file system format of the target file used by different partitions in a Flash memory space before loading the target file corresponding to a configuration partition by using a single board management controller, and checking a storage partition corresponding to the target file before writing the target file, thereby determining bad block conditions of the partitions in advance, improving detection efficiency of Flash particle damage caused by excessive use of a certain partition, and solving the problems of slow abnormal processing and low processing efficiency of the configuration partition when Flash particle hard failure occurs during each upgrade or BMC restart in the related art, so as to save maintenance cost of the single board management controller and avoid return board caused by hardware problems triggered by the software BUG.
In an exemplary embodiment, the apparatus further includes an instruction module, configured to verify a data block in the first partition using a file system format of the target file, and determine to continuously load the target file into the first partition after obtaining a first verification result, where the first verification result indicates that the data block in the first partition passes the verification; and adding a first mark for prohibiting loading of the target file to the first partition under the condition that the first check result indicates that the data block in the first partition fails to pass the check.
In an exemplary embodiment, the indicating module further includes: the configuration unit is used for reading a mapping configuration file corresponding to the first partition and used for indicating a partition address after adding a first mark for prohibiting loading of the target file to the first partition under the condition that the first check result indicates that the data block in the first partition does not pass the check; determining partition numbers of a plurality of partitions currently started in the flash memory space according to the mapping configuration file; and configuring the next partition adjacent to the first partition as a second partition for loading the target file according to the partition number, wherein the second partition has the same number of data blocks as the first partition.
In an exemplary embodiment, the indicating module further includes: a first obtaining unit, configured to determine a read-only memory associated with the board management controller before reading a mapping configuration file corresponding to the first partition and used for indicating a partition address; acquiring a preset mapping configuration file corresponding to a flash memory space associated with the single board management controller; and storing the preset mapping configuration file on the read-only memory.
In an exemplary embodiment, the indicating module further includes: a reset unit, configured to add a second flag to a second partition adjacent to the first partition after configuring the next partition as the second partition for loading the target file according to the partition number; and under the condition that the second mark addition is determined to be completed, sending a reset instruction to the single board management controller, wherein the reset instruction is used for indicating the single board management controller to restart loading of the target file.
In an exemplary embodiment, the above indication module is further configured to obtain a first type of configuration file in a random access memory included in the board management controller; and determining the first type of configuration file as a target file to be loaded into the first partition.
In an exemplary embodiment, the indicating module further includes: a second obtaining unit, configured to obtain an image file corresponding to the board management controller under the condition that it is determined that no configuration file exists in the random access memory before obtaining a first type of configuration file in the random access memory included in the board management controller; and determining the initial configuration file corresponding to the image file as a target file to be loaded into the first partition.
In an exemplary embodiment, the above apparatus further includes: the modification module is used for acquiring modification information sent by the target object to the single board management controller before the single board management controller loads the target file corresponding to the configuration partition; determining modification content corresponding to the target file according to the modification information; writing the modified content into a storage space corresponding to a random access memory contained in the single board management controller, and updating a file of a first type of configuration file existing in the storage space to obtain a second type of configuration file; and executing a loading operation on the second type of configuration file, wherein the loading operation is used for indicating the loading of the second configuration file in the random access memory into a flash memory space.
In an exemplary embodiment, the configuration unit is further configured to update the second partition to a storage partition corresponding to a target file to be loaded by the first partition; and under the condition that the updating is completed, generating a target log for replacing the second partition with the first partition.
In an exemplary embodiment, the indicating module further includes: the early warning unit is used for identifying whether the second partition is the last partition in the flash memory space after configuring the next partition adjacent to the first partition as the second partition for loading the target file according to the partition number; and under the condition that the second partition is determined to be the last partition, generating an early warning log of the flash memory space, wherein the early warning log is used for indicating that the partition in the flash memory space cannot be replaced.
In an exemplary embodiment, the early warning unit further includes: a checking subunit, configured to check, after determining that the second partition is the last partition, a data block in the second partition by using a file system format of the target file, to obtain a second check result; and determining whether to skip loading of the target file in the starting process of the single board management controller according to the second checking result.
In an exemplary embodiment, the above-mentioned checking subunit is further configured to determine to continuously load the target file into the second partition if the second check result indicates that the data block in the second partition passes the check; and under the condition that the second check result indicates that the data block in the second partition does not pass the check, the single board management controller is indicated to skip the loading of the target file in the starting process.
In an exemplary embodiment, the early warning unit further includes: the fault unit is used for indicating that the starting information of the single board management controller is obtained after the loading of the target file is skipped in the starting process of the single board management controller; and under the condition that the single board management controller is determined to finish starting according to the starting information, determining to generate a fault log of hardware faults in a flash memory space associated with the single board management controller.
In an exemplary embodiment, the above apparatus further includes: the prompt module is used for identifying all logs generated by the single board management controller in the whole starting process; and under the condition that the early warning log and the fault log exist in all logs at the same time, sending fault prompt information to a management object of the single board management controller, wherein the fault prompt information is used for indicating the management object to physically replace a flash memory space corresponding to the single board management controller.
In the present embodiment, the term "module" or "unit" refers to a computer program or a part of a computer program having a predetermined function, and works together with other relevant parts to achieve a predetermined object, and may be implemented in whole or in part by using software, hardware (such as a processing circuit or a memory), or a combination thereof. Also, a processor (or multiple processors or memories) may be used to implement one or more modules or units. Furthermore, each module or unit may be part of an overall module or unit that incorporates the functionality of the module or unit.
It should be noted that, for simplicity of description, the foregoing method embodiments are all described as a series of acts, but it should be understood by those skilled in the art that the present invention is not limited by the order of acts described, as some steps may be performed in other orders or concurrently in accordance with the present invention. Further, those skilled in the art will also appreciate that the embodiments described in the specification are all preferred embodiments, and that the acts and modules referred to are not necessarily required for the present invention.
Embodiments of the present application also provide a storage medium including a stored program, wherein the program performs the method of any one of the above when run.
Alternatively, in the present embodiment, the above-described storage medium may be configured to store program code for performing the steps of:
s1, under the condition that a single board management controller loads a target file corresponding to a configuration partition, determining space division information corresponding to a flash memory space associated with the single board management controller;
s2, determining a first partition for storing the target file in the flash memory space according to the space division information;
and S3, checking the data blocks in the first partition by using the file system format of the target file to obtain a first checking result.
In one exemplary embodiment, the computer readable storage medium may include, but is not limited to: a usb disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing a computer program.
Specific examples in this embodiment may refer to the examples described in the foregoing embodiments and the exemplary implementation, and this embodiment is not described herein.
Embodiments of the present application also provide an electronic device comprising a memory having stored therein a computer program and a processor arranged to run the computer program to perform the steps of any of the method embodiments described above.
Fig. 8 schematically shows a block diagram of a computer system for implementing an electronic device according to an embodiment of the present application. As shown in fig. 8, the computer system 800 includes a central processing unit 801 (Central Processing Unit, CPU) which can execute various appropriate actions and processes according to a program stored in a Read-Only Memory 802 (ROM) or a program loaded from a storage section 808 into a random access Memory 803 (Random Access Memory, RAM). In the random access memory 803, various programs and data required for system operation are also stored. The central processing unit 801, the read only memory 802, and the random access memory 803 are connected to each other through a bus 804. An Input/Output interface 805 (i.e., an I/O interface) is also connected to the bus 804.
The following components are connected to the input/output interface 805: an input portion 806 including a keyboard, mouse, etc.; an output portion 807 including a Cathode Ray Tube (CRT), a liquid crystal display (Liquid Crystal Display, LCD), and the like, and a speaker, and the like; a storage section 808 including a hard disk or the like; and a communication section 809 including a network interface card such as a local area network card, modem, or the like. The communication section 809 performs communication processing via a network such as the internet. The drive 810 is also connected to the input/output interface 805 as needed. A removable medium 811 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 810 as needed so that a computer program read out therefrom is mounted into the storage section 808 as needed.
In particular, according to embodiments of the present application, the processes described in the various method flowcharts may be implemented as computer software programs. For example, embodiments of the present application include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from a network via the communication section 809, and/or installed from the removable media 811. The computer programs, when executed by the central processor 801, perform the various functions defined in the system of the present application.
It should be noted that, the computer system 800 of the electronic device shown in fig. 8 is only an example, and should not impose any limitation on the functions and the application scope of the embodiments of the present application.
In an exemplary embodiment, the electronic device may further include a transmission device connected to the processor, and an input/output device connected to the processor.
Specific examples in this embodiment may refer to the examples described in the foregoing embodiments and the exemplary implementation, and this embodiment is not described herein.
It will be appreciated by those skilled in the art that the modules or steps of the application described above may be implemented in a general purpose computing device, they may be concentrated on a single computing device, or distributed across a network of computing devices, they may be implemented in program code executable by computing devices, so that they may be stored in a storage device for execution by computing devices, and in some cases, the steps shown or described may be performed in a different order than that shown or described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple modules or steps of them may be fabricated into a single integrated circuit module. Thus, the present application is not limited to any specific combination of hardware and software.
The foregoing description is only of the preferred embodiments of the present application and is not intended to limit the same, but rather, various modifications and variations may be made by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the principles of the present application should be included in the protection scope of the present application.

Claims (16)

1. A method for verifying a data block, comprising:
Under the condition that a single board management controller loads a target file corresponding to a configuration partition, determining space division information corresponding to a flash memory space associated with the single board management controller;
determining a first partition for storing the target file in the flash memory space according to the space division information;
checking the data blocks in the first partition by using the file system format of the target file to obtain a first checking result;
the method further includes, after the verifying the data block in the first partition by using the file system format of the target file to obtain a first verification result,:
determining to continuously load the target file into the first partition under the condition that a first check result indicates that the data block in the first partition passes the check;
if the first check result indicates that the data block in the first partition does not pass the check, adding a first mark for prohibiting loading of the target file to the first partition;
the size of the first partition corresponds to the partition size required by the data corresponding to the target file, and the first partition is formed by a plurality of partition sub-partitions corresponding to the flash memory space.
2. The method according to claim 1, wherein, in the case that the first check result indicates that the data block in the first partition fails the check, after adding a first flag to the first partition that prohibits loading of the target file, the method further comprises:
reading a mapping configuration file corresponding to the first partition and used for indicating the partition address;
determining partition numbers of a plurality of partitions currently started in the flash memory space according to the mapping configuration file;
and configuring the next partition adjacent to the first partition as a second partition for loading the target file according to the partition number, wherein the second partition has the same number of data blocks as the first partition.
3. The method according to claim 2, wherein before reading the mapping configuration file corresponding to the first partition and used for indicating the partition address, the method further comprises:
determining a read-only memory associated with the single board management controller;
acquiring a preset mapping configuration file corresponding to a flash memory space associated with the single board management controller;
and storing the preset mapping configuration file on the read-only memory.
4. The method according to claim 2, wherein after configuring a next partition adjacent to the first partition as a second partition for loading the target file according to the partition number, the method further comprises:
adding a second marker to the second partition;
and under the condition that the second mark addition is determined to be completed, sending a reset instruction to the single board management controller, wherein the reset instruction is used for indicating the single board management controller to restart loading of the target file.
5. The method of claim 1, wherein determining to continue loading the target file into the first partition if a first check result indicates that the data block in the first partition passes the check comprises:
acquiring a first type configuration file in a random access memory contained in the single board management controller;
and determining the first type of configuration file as a target file to be loaded into the first partition.
6. The method according to claim 5, wherein before obtaining the first type of configuration file in the random access memory included in the board management controller, the method further comprises:
Under the condition that no configuration file exists in the random access memory, acquiring an image file corresponding to the single board management controller;
and determining the initial configuration file corresponding to the image file as a target file to be loaded into the first partition.
7. The method for verifying a data block according to claim 1, wherein before the single board management controller loads the target file corresponding to the configuration partition, the method further comprises:
acquiring modification information sent by a target object to the single board management controller;
determining modification content corresponding to the target file according to the modification information;
writing the modified content into a storage space corresponding to a random access memory contained in the single board management controller, and updating a file of a first type of configuration file existing in the storage space to obtain a second type of configuration file;
and executing a loading operation on the second type of configuration file, wherein the loading operation is used for indicating the loading of the second configuration file in the random access memory into a flash memory space.
8. The method for verifying a data block according to claim 2, wherein a next partition adjacent to the first partition is configured as a second partition for loading the target file according to the partition number, comprising:
Updating the second partition to a storage partition corresponding to the target file to be loaded of the first partition;
and under the condition that the updating is completed, generating a target log for replacing the second partition with the first partition.
9. The method according to claim 2, wherein after configuring a next partition adjacent to the first partition as a second partition for loading the target file according to the partition number, the method further comprises:
identifying whether the second partition is the last partition in the flash space;
and under the condition that the second partition is determined to be the last partition, generating an early warning log of the flash memory space, wherein the early warning log is used for indicating that the partition in the flash memory space cannot be replaced.
10. The method of verifying a data block of claim 9, wherein after determining that the second partition is the last partition, the method further comprises:
checking the data blocks in the second partition by using the file system format of the target file to obtain a second checking result;
and determining whether to skip loading of the target file in the starting process of the single board management controller according to the second checking result.
11. The method according to claim 10, wherein determining whether to skip loading of the target file during startup of the board management controller according to the second check result comprises:
determining to continue loading the target file into the second partition if the second check result indicates that the data block in the second partition passes the check;
and under the condition that the second check result indicates that the data block in the second partition does not pass the check, the single board management controller is indicated to skip the loading of the target file in the starting process.
12. The method for verifying a data block of claim 11, wherein after instructing the on-board management controller to skip loading the target file during startup, the method further comprises:
acquiring starting information of the single board management controller;
and under the condition that the single board management controller is determined to finish starting according to the starting information, determining to generate a fault log of hardware faults in a flash memory space associated with the single board management controller.
13. A method of checking a data block according to any one of claims 9 to 12, further comprising:
Identifying all logs generated by the single board management controller in the whole starting process;
and under the condition that the early warning log and the fault log exist in all logs at the same time, sending fault prompt information to a management object of the single board management controller, wherein the fault prompt information is used for indicating the management object to physically replace a flash memory space corresponding to the single board management controller.
14. A device for verifying a data block, comprising:
the first determining module is used for determining space division information corresponding to a flash memory space associated with the single board management controller under the condition that the single board management controller loads a target file corresponding to a configuration partition;
the second determining module is used for determining a first partition for storing the target file in the flash memory space according to the space division information;
the verification module is used for verifying the data blocks in the first partition by using the file system format of the target file to obtain a first verification result;
the apparatus further comprises: the indication module is used for checking the data blocks in the first partition by using the file system format of the target file, and determining to continuously load the target file into the first partition when the first check result indicates that the data blocks in the first partition pass the check after the first check result is obtained; if the first check result indicates that the data block in the first partition does not pass the check, adding a first mark for prohibiting loading of the target file to the first partition;
The size of the first partition corresponds to the partition size required by the data corresponding to the target file, and the first partition is formed by a plurality of partition sub-partitions corresponding to the flash memory space.
15. A computer readable storage medium, characterized in that a computer program is stored in the computer readable storage medium, wherein the computer program, when being executed by a processor, implements the steps of the method according to any of the claims 1 to 13.
16. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the steps of the method of any one of claims 1 to 13 when the computer program is executed.
CN202311820665.2A 2023-12-27 2023-12-27 Data block verification method and device, storage medium and electronic equipment Active CN117472291B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311820665.2A CN117472291B (en) 2023-12-27 2023-12-27 Data block verification method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311820665.2A CN117472291B (en) 2023-12-27 2023-12-27 Data block verification method and device, storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN117472291A CN117472291A (en) 2024-01-30
CN117472291B true CN117472291B (en) 2024-03-22

Family

ID=89640017

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311820665.2A Active CN117472291B (en) 2023-12-27 2023-12-27 Data block verification method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN117472291B (en)

Citations (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20010065075A (en) * 1999-12-29 2001-07-11 서평원 method of office data loading in switching system
CN101106441A (en) * 2007-08-10 2008-01-16 华为技术有限公司 Method and device for reducing service interruption time
CN101290628A (en) * 2008-06-17 2008-10-22 中兴通讯股份有限公司 Data file updating storage method
CN101477480A (en) * 2009-02-05 2009-07-08 华为技术有限公司 Memory control method, apparatus and memory read-write system
CN101546291A (en) * 2009-05-12 2009-09-30 华为技术有限公司 Access method and device for increasing robustness of memory data
CN102968353A (en) * 2012-10-26 2013-03-13 华为技术有限公司 Fail address processing method and fail address processing device
CN103019873A (en) * 2012-12-03 2013-04-03 华为技术有限公司 Replacing method and device for storage fault unit and data storage system
CN103631721A (en) * 2012-08-23 2014-03-12 华为技术有限公司 Method and system for isolating bad blocks in internal storage
CN111400248A (en) * 2019-11-19 2020-07-10 杭州海康威视系统技术有限公司 Method for writing data and recovering data and file system
CN113590227A (en) * 2021-08-02 2021-11-02 中国大恒(集团)有限公司北京图像视觉技术分公司 Binary programming format loading method and system under embedded system
CN113918519A (en) * 2021-09-06 2022-01-11 中国长城科技集团股份有限公司 Folder loading method and device and terminal equipment
CN114281788A (en) * 2021-11-19 2022-04-05 苏州浪潮智能科技有限公司 BMC firmware data extraction method, device, terminal and storage medium
CN114461455A (en) * 2022-02-11 2022-05-10 瀚高基础软件股份有限公司 Method and device for repairing bad blocks of disk of stream replication cluster
CN114780019A (en) * 2022-03-22 2022-07-22 江苏泽景汽车电子股份有限公司 Electronic device management method and device, electronic device and storage medium
CN114860506A (en) * 2022-04-27 2022-08-05 珠海全志科技股份有限公司 Linux file system repairing method, system, device and storage medium
WO2022268108A1 (en) * 2021-06-22 2022-12-29 华为技术有限公司 Data processing method and related apparatus
CN116107516A (en) * 2023-04-10 2023-05-12 苏州浪潮智能科技有限公司 Data writing method and device, solid state disk, electronic equipment and storage medium
CN116149752A (en) * 2023-02-14 2023-05-23 苏州浪潮智能科技有限公司 Control method and device of baseboard management controller, electronic equipment and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7979626B2 (en) * 2008-05-13 2011-07-12 Microsoft Corporation Flash recovery employing transaction log

Patent Citations (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20010065075A (en) * 1999-12-29 2001-07-11 서평원 method of office data loading in switching system
CN101106441A (en) * 2007-08-10 2008-01-16 华为技术有限公司 Method and device for reducing service interruption time
CN101290628A (en) * 2008-06-17 2008-10-22 中兴通讯股份有限公司 Data file updating storage method
CN101477480A (en) * 2009-02-05 2009-07-08 华为技术有限公司 Memory control method, apparatus and memory read-write system
CN101546291A (en) * 2009-05-12 2009-09-30 华为技术有限公司 Access method and device for increasing robustness of memory data
CN103631721A (en) * 2012-08-23 2014-03-12 华为技术有限公司 Method and system for isolating bad blocks in internal storage
CN102968353A (en) * 2012-10-26 2013-03-13 华为技术有限公司 Fail address processing method and fail address processing device
CN103019873A (en) * 2012-12-03 2013-04-03 华为技术有限公司 Replacing method and device for storage fault unit and data storage system
CN111400248A (en) * 2019-11-19 2020-07-10 杭州海康威视系统技术有限公司 Method for writing data and recovering data and file system
WO2022268108A1 (en) * 2021-06-22 2022-12-29 华为技术有限公司 Data processing method and related apparatus
CN113590227A (en) * 2021-08-02 2021-11-02 中国大恒(集团)有限公司北京图像视觉技术分公司 Binary programming format loading method and system under embedded system
CN113918519A (en) * 2021-09-06 2022-01-11 中国长城科技集团股份有限公司 Folder loading method and device and terminal equipment
CN114281788A (en) * 2021-11-19 2022-04-05 苏州浪潮智能科技有限公司 BMC firmware data extraction method, device, terminal and storage medium
CN114461455A (en) * 2022-02-11 2022-05-10 瀚高基础软件股份有限公司 Method and device for repairing bad blocks of disk of stream replication cluster
CN114780019A (en) * 2022-03-22 2022-07-22 江苏泽景汽车电子股份有限公司 Electronic device management method and device, electronic device and storage medium
CN114860506A (en) * 2022-04-27 2022-08-05 珠海全志科技股份有限公司 Linux file system repairing method, system, device and storage medium
CN116149752A (en) * 2023-02-14 2023-05-23 苏州浪潮智能科技有限公司 Control method and device of baseboard management controller, electronic equipment and storage medium
CN116107516A (en) * 2023-04-10 2023-05-12 苏州浪潮智能科技有限公司 Data writing method and device, solid state disk, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN117472291A (en) 2024-01-30

Similar Documents

Publication Publication Date Title
US8423991B2 (en) Embedded network device and firmware upgrading method
CN108932249B (en) Method and device for managing file system
CN104536841B (en) A kind of android system Data subregions self-repair method and system
CN115934447A (en) Display information acquisition method and device, electronic equipment and storage medium
US20190149571A1 (en) Method and device for repairing page vulnerability
CN112162931A (en) Extraction and detection method, system, electronic equipment and storage medium
CN114385418A (en) Protection method, device, equipment and storage medium for communication equipment
CN111694684A (en) Abnormal construction method and device of storage equipment, electronic equipment and storage medium
CN117472291B (en) Data block verification method and device, storage medium and electronic equipment
US10691465B2 (en) Method for synchronization of system management data
CN116775061A (en) Deployment method, device, equipment and storage medium of micro-service application
US20080201572A1 (en) Method and system for uniformizing product data embedded in a computer platform
CN113114730B (en) Upgrading method and device, terminal equipment and storage medium
CN113672349A (en) Mirror image updating method, device, equipment and medium
CN114741091A (en) Firmware loading method and device, electronic equipment and computer readable storage medium
CN114153503A (en) BIOS control method, device and medium
CN112527343A (en) Firmware updating method and device, computer equipment and storage medium
CN108920480B (en) Processing method and device for file system exception and computer storage medium
CN110544504A (en) test method, system and equipment for memory ADDDC function
TWI777259B (en) Boot method
CN116627733A (en) Memory fault processing method and computing device
CN116820982A (en) Testing method and device of front-end software package manager, electronic equipment and storage medium
CN115454820A (en) Firmware upgrade exception test method and device, computer equipment and storage medium
CN118093028A (en) Firmware loading method, system and device of basic input/output system
CN117909221A (en) File testing method, device, electronic equipment and computer readable medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant