Method, device and solid state hard disk for checking storage medium failure
By obtaining the operation data and error counting information of the solid-state drive, the failure of the flash memory block is solved, and the problem that the solid-state drive cannot detect the failure of the storage medium is improved in time, and the stability and reliability of the hard disk are improved.
Patent Information
- Application Number
- CN202111626136.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-28
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2041-12-28
AI Technical Summary
Existing solid-state drives cannot detect whether the storage media (die) fails in time, resulting in low stability and prone to downtime and data loss.
By obtaining operation data of the storage medium, counting error counting information, and detecting whether the failure diagnosis is triggered based on the error counting information, reading the flash memory block that has already performed a write operation, and checking whether the storage medium is invalid based on the read operation result.
It realizes timely detection of storage media failure without affecting the performance of the solid-state drive, avoiding data loss and downtime, and improving the stability of the solid-state drive.
Smart Images

Figure CN114300032B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data storage, and in particular to a method and device for checking storage medium failure, and a solid state hard disk. Background Art
[0002] Solid-state drives (SSDs) are hard drives made with an array of solid-state electronic memory chips. They consist of a control unit and a storage unit (FLASH or DRAM). Currently, a significant portion of SSD systems utilize dynamic random access memory (DRAM), so SSDs have a large data cache space for caching data.
[0003] NAND Flash is the primary storage medium for solid-state drives (SSDs). Flash has evolved to 3D TLC, with I / O interface speeds reaching 1600 MT. This development also presents challenges, such as storage medium (die) failure during use. A die is the basic unit that receives and executes memory commands, and die failures refer to read, write, and erase errors. If die failures are not addressed promptly, numerous errors can occur during SSD operation, leading to downtime and data loss.
[0004] The existing SSD controller or firmware does not provide a die failure interface, making it impossible for the software to know whether the die has failed, resulting in SSD downtime and data loss, thereby reducing the stability of the SSD. Summary of the Invention
[0005] The embodiments of the present invention provide a method, device and solid-state drive for checking storage medium failure, aiming to solve the technical problem in the prior art that the SSD cannot promptly know whether the storage medium has failed, resulting in low stability.
[0006] To solve the above technical problems, a technical solution adopted in an embodiment of the present invention is: providing a method for checking storage medium failure, which is applied to a solid-state hard disk, wherein the storage medium of the solid-state hard disk includes a plurality of flash memory blocks, and the method includes: obtaining operation data of the storage medium, and obtaining error count information of the storage medium based on the operation data; detecting whether to trigger failure diagnosis of the storage medium based on the error count information; when it is determined to perform failure diagnosis on the storage medium, performing a read operation on the flash memory block on which a write operation has been performed; and checking whether the storage medium is failed based on the result of the read operation.
[0007] Optionally, obtaining the operation data of the storage medium and obtaining the error count information of the storage medium based on the operation data includes: obtaining the write operation data, read operation data and erase operation data corresponding to the storage medium; and counting the error count information corresponding to the write operation data, the error count information corresponding to the read operation data, and the error count information corresponding to the erase operation data.
[0008] Optionally, the detection of whether to trigger failure diagnosis of the storage medium based on the error count information includes: obtaining the write weight corresponding to the write operation data, the read weight corresponding to the read operation data, and the erase weight corresponding to the erase operation data; calculating a first product of the error count information corresponding to the write operation data and the write weight; calculating a second product of the error count information corresponding to the read operation data and the read weight; calculating a third product of the error count information corresponding to the erase operation data and the erase weight; when the first product is greater than a write threshold, and / or the second product is greater than a read threshold, and / or the third product is greater than an erase threshold, failure diagnosis of the storage medium is triggered.
[0009] Optionally, the method also includes: counting the count growth rates per unit time corresponding to the error count information corresponding to the write operation data, the error count information corresponding to the read operation data, and the error count information corresponding to the erase operation data; and determining the write weight corresponding to the write operation data, the read weight corresponding to the read operation data, and the erase weight corresponding to the erase operation data according to the count growth rates.
[0010] Optionally, performing a read operation on the flash memory block on which a write operation has been performed specifically includes: determining the number of flash memory blocks to perform a read operation from the flash memory blocks on which a write operation has been performed according to the bandwidth pressure of the port, and performing a read operation on the determined flash memory blocks.
[0011] Optionally, checking whether the storage medium is invalid based on the result of the read operation includes: checking whether the read data is correct and whether the read position is deviated based on the result of the read operation; when the read data is wrong and / or the read position is deviated, recording and updating the error count information corresponding to the read operation; when the recorded error count information corresponding to the read operation is greater than a first set threshold, recording and updating the error count information corresponding to the flash memory block; when the recorded error count information corresponding to the flash memory block is greater than a second set threshold, determining that the storage medium is invalid.
[0012] To solve the above technical problems, another technical solution adopted in an embodiment of the present invention is: providing a device for checking storage medium failure, which is applied to a solid-state hard disk, wherein the storage medium of the solid-state hard disk includes a plurality of flash memory blocks, and the device includes: an acquisition module, which is used to obtain operation data of the storage medium and obtain error count information of the storage medium based on the operation data; a trigger module, which is used to detect whether to trigger failure diagnosis of the storage medium based on the error count information; an execution module, which is used to perform a read operation on the flash memory block that has performed a write operation when it is determined that a failure diagnosis is to be performed on the storage medium; and a determination module, which is used to check whether the storage medium is failed based on the result of the read operation.
[0013] Optionally, the acquisition module includes: a first acquisition unit, used to acquire write operation data, read operation data and erase operation data corresponding to the storage medium; a statistical unit, used to count error count information corresponding to the write operation data, error count information corresponding to the read operation data, and error count information corresponding to the erase operation data.
[0014] Optionally, the trigger module includes: a second acquisition unit, used to acquire the write weight corresponding to the write operation data, the read weight corresponding to the read operation data, and the erase weight corresponding to the erase operation data; a first calculation unit, used to calculate the first product of the error count information corresponding to the write operation data and the write weight; a second calculation unit, used to calculate the second product of the error count information corresponding to the read operation data and the read weight; a third calculation unit, used to calculate the third product of the error count information corresponding to the erase operation data and the erase weight; a judgment unit, used to trigger failure diagnosis of the storage medium when the first product is greater than the write threshold, and / or the second product is greater than the read threshold, and / or the third product is greater than the erase threshold.
[0015] To solve the above technical problems, another technical solution adopted in the embodiment of the present invention is: providing a solid-state hard disk, comprising: a storage medium; and a main controller, connected to the storage medium; wherein the main controller comprises: at least one processor; and a cache, connected to the at least one processor; wherein the cache stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method for checking storage medium failure as described above.
[0016] Different from the related art, the embodiments of the present invention provide a method, device and solid-state hard disk for checking storage medium failure, which are applied to solid-state hard disks. The method obtains the operation data of the storage medium and obtains the error count information of the storage medium based on the operation data. Then, based on the error count information, it is detected whether to trigger the failure diagnosis of the storage medium. When it is determined to perform failure diagnosis on the storage medium, a flash memory block that has performed a write operation is obtained from several flash memory blocks of the storage medium, and a read operation is performed on the flash memory block that has performed a write operation. Finally, it is checked whether the storage medium is failed based on the result of the read operation. By diagnosing the flash memory block that has performed a write operation, the embodiments of the present invention realize the failure diagnosis of the storage medium in the storage medium without affecting the performance of the solid-state hard disk, thereby avoiding the loss of data and downtime of the solid-state hard disk due to untimely storage medium failure detection, and improving the stability of the solid-state hard disk. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] One or more embodiments are exemplarily illustrated by corresponding drawings, which do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings are represented as similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.
[0018] Figure 1 This is a schematic structural diagram of a solid-state hard disk provided by an embodiment of the present invention;
[0019] Figure 2 It is a schematic diagram of the logical layout of the storage medium provided by an embodiment of the present invention.
[0020] Figure 3 This is a flow chart of a method for checking storage medium failure provided by an embodiment of the present invention;
[0021] Figure 4 This is a flowchart of triggering failure diagnosis provided by one embodiment of the present invention;
[0022] Figure 5 This is a schematic diagram of a storage medium failure in a storage medium provided by this embodiment;
[0023] Figure 6 This is a structural block diagram of a device for checking storage medium failure provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0024] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0025] It should be noted that, unless there is a conflict, the various features of the embodiments of the present invention may be combined with each other and are all within the scope of protection of the present invention. In addition, although the functional modules are divided in the device schematics and the logical order is shown in the flowcharts, in some cases, the steps shown or described may be performed in a different order than the module division in the device schematics or the order in the flowcharts.
[0026] Unless otherwise defined, all technical and scientific terms used in this specification have the same meanings as those commonly understood by those skilled in the art to which this invention pertains. The terms used in this specification are intended solely for the purpose of describing specific embodiments and are not intended to limit the invention. The term "and / or" as used in this specification includes any and all combinations of one or more of the associated listed items.
[0027] Typical solid-state drives (SSDs) usually include an SSD controller (main controller), a flash memory array, a cache module, and other peripheral modules.
[0028] Among them, the solid-state drive controller is used as a control and operation module to manage the internal system of the SSD; the flash memory array (NAND Flash) is used as a storage module to store data, including user data and system data. The flash memory array generally presents multiple channels (Channel, abbreviated as CH), and a channel independently connects a group of NAND Flash, such as CH0 / CH1...CH x NAND Flash memory must be erased before writing, cannot be overwritten, and each flash memory has a limited number of erase times. The cache module is used to cache the mapping table. The cache module is generally dynamic random access memory (DRAM). Other peripheral modules may include sensors, registers, and other components.
[0029] NAND Flash is a non-volatile storage medium that can store electrons within a cell. The number of stored electrons can be expressed as a voltage value, which can be divided into multiple regions. Two regions store only one bit (this type of Flash is called SLC). Four regions store two bits (this type of Flash is called MLC). Eight regions store three bits (this type of Flash is called TLC). Similarly, the number of regions is determined by powers of two as the number of bits stored.
[0030] When data is written, the number of stored electrons can be presented as a voltage value, and the value when reading is determined by comparing the voltage value of the unit with a reference voltage (or threshold voltage).
[0031] A storage medium die (also called a LUN) consists of several flash planes, each of which contains several flash blocks, and each block contains several pages. The storage medium die / LUN is the basic unit that receives and executes flash commands, and can only execute one command at a time.
[0032] See also Figure 1 , Figure 1 FIG. 1 is a structural diagram of a solid state hard disk provided by an embodiment of the present invention. Figure 1 As shown, the solid state drive 100 includes a storage medium 110 and a main controller 120 connected to the storage medium. The solid state drive 100 is connected to the host 200 in a wired or wireless manner to achieve data exchange.
[0033] The storage medium 110, as the storage medium of the solid-state drive 100, is also called flash memory, Flash, Flash memory or Flash particles. It is a type of storage device and a non-volatile memory that can store data for a long time even without current supply. Its storage characteristics are equivalent to those of a hard disk, making the storage medium 110 the basis of the storage medium of various portable digital devices.
[0034] The main controller 120 includes a data converter 121 , a processor 122 , a buffer 123 , a flash memory controller 124 , and an interface 125 .
[0035] The data converter 121 is connected to the processor 122 and the flash memory controller 124, respectively. The data converter 121 is used to convert binary data into hexadecimal data, and vice versa. The data converter 121 may include a binary data register and a hexadecimal data register. The binary data register may be used to store data converted from hexadecimal to binary, and the hexadecimal data register may be used to store data converted from binary to hexadecimal.
[0036] The processor 122 is respectively connected to the data converter 121, the cache 123, the flash memory controller 124 and the interface 125, wherein the processor 122 and the data converter 121, the cache 123, the flash memory controller 124 and the interface 125 can be connected via a bus or other means. The processor is used to run the non-volatile software programs, instructions and modules stored in the cache 123, thereby implementing any method embodiment of the present invention.
[0037] The cache 123 is mainly used to cache the read / write instructions sent by the host 200 and the read data or write data obtained from the storage medium 110 according to the read / write instructions sent by the host 200. The cache 123, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer executable programs and modules. The cache 123 may include a program storage area, which can store an operating system and application programs required for at least one function. In addition, the cache 123 may include a high-speed random access memory and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the cache 123 may optionally include a memory remotely located relative to the processor 124. Examples of the above-mentioned network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network and a combination thereof.
[0038] The flash memory controller 124 is connected to the storage medium 110, the data converter 121, the processor 122, and the cache 123, and is used to access the back-end storage medium 110 and manage various parameters and data I / O of the storage medium 110; or, it is used to provide an access interface and protocol, implement the corresponding SAS / SATA target protocol end or NVMe protocol end, obtain I / O instructions issued by the host 200, and decode and generate internal private data results for execution; or, it is used to be responsible for the core processing of the FTL (Flash translation layer).
[0039] The interface 125 connects the host 200 and the data converter 121, the processor 122 and the buffer 123, and is used to receive data sent by the host 200, or receive data sent by the processor 122 to realize data transmission between the host 200 and the processor 122. The interface 125 can be a SATA-2 interface, a SATA-3 interface, a SAS interface, an MSATA interface, a PCI-E interface, an NGFF interface, a CFast interface, an SFF-8639 interface and an M.2 NVME / SATA protocol.
[0040] See also Figure 2 , Figure 2This is a schematic diagram of the logical layout of the storage medium provided by an embodiment of the present invention. Since the storage medium is issued read, write and erase operation instructions by the FTL (Flash Translation Layer), the storage medium is abstractly divided according to the Flash Translation Layer, where Figure 2 As shown, the storage medium is divided horizontally into super flash blocks (sblk) and flash pages, and vertically into storage medium die, LUN, CE, CH, and plane. CE refers to the connection pins between the flash controller and the storage medium, and the CE is the enable signal terminal. By abstractly dividing the storage medium, all channels in the storage medium can execute commands in parallel, making it easier to control the internal algorithms of the storage medium.
[0041] Specifically, the bottom layer of the vertical partitioning has two signal enable terminals (CE0 and CE1), which are connected to two channels (CH0 and CH1), respectively. Each channel corresponds to a storage medium die. Each of the four storage medium dies contains a LUN unit, and each storage medium die includes two flash planes. The storage medium dies on each channel can operate in parallel, and the number of storage medium dies on a channel can be determined based on the capacity and performance requirements of the solid-state drive. The greater the number of storage medium dies, the greater the number of concurrent operations and the better the performance of the solid-state drive. In the case of horizontal partitioning, the storage medium can be divided into several hyperflash blocks (SBLKs), each of which includes several flash pages. Writing and erasing the storage medium are processed using the hyperflash block (SBLK) as the operation unit, while reading the storage medium is processed using a single flash page as the minimum unit. The minimum unit of a flash page is 4KB, meaning that each flash plane has a unit of 16KB. Optionally, in the abstract division, from the perspective of the vertical division, the storage medium die includes several super flash memory blocks sblk, and from the perspective of the horizontal division, the super flash memory block sblk includes several storage medium dies.
[0042] In this embodiment, the failure of the storage medium includes read errors, including physical position read errors, data read errors, and data that cannot be read, write errors, and erase errors.
[0043] See also Figure 3 , Figure 3 1 is a flowchart of a method for checking storage medium failure provided by an embodiment of the present invention, which is applied to the solid-state drive described above. The method includes:
[0044] S01. Acquire operation data of the storage medium, and acquire error count information of the storage medium according to the operation data.
[0045] Specifically, the commands executed by the storage medium include read, write and erase, and the operation data of the storage medium are corresponding write operation data, read operation data and erase operation data; then, error count information corresponding to the write operation data, error count information corresponding to the read operation data, and error count information corresponding to the erase operation data are counted.
[0046] S02: Detecting whether to trigger failure diagnosis of the storage medium according to the error count information.
[0047] Specifically, first, the read threshold, write threshold, and erase threshold are set according to the type and capacity of the storage medium, and then the read threshold, write threshold, and erase threshold are compared with the corresponding read, write, and erase error counts. Figure 4 , Figure 4 FIG. 1 is a flowchart of triggering failure diagnosis provided by one embodiment of the present invention, such as Figure 4 As shown, when the number of errors in one operation is greater than the corresponding threshold, or the number of errors in all operations is greater than the corresponding threshold, the failure diagnosis is confirmed to be triggered. The number of errors recorded by the counter can be directly obtained and compared with the corresponding threshold, or the product of the number of errors recorded by the counter and the weight can be compared with the corresponding threshold.
[0048] Optionally, obtain the write weight corresponding to the write operation data, the read weight corresponding to the read operation data, and the erase weight corresponding to the erase operation data; calculate the first product of the error count information corresponding to the write operation data and the write weight; calculate the second product of the error count information corresponding to the read operation data and the read weight; calculate the third product of the error count information corresponding to the erase operation data and the erase weight; when the first product is greater than the write threshold, and / or the second product is greater than the read threshold, and / or the third product is greater than the erase threshold.
[0049] Optionally, the weight can be set according to the type and capacity of the storage medium (for example, the read threshold is 1, the write threshold is 2, and the erase threshold is 1), or it can be determined according to the technology growth rate of the number of errors per unit time, that is, first, the error count information corresponding to the write operation data, the error count information corresponding to the read operation data, and the error count information corresponding to the erase operation data are respectively counted, and then the write weight corresponding to the write operation data, the read weight corresponding to the read operation data, and the erase weight corresponding to the erase operation data are respectively determined according to the count growth rate, wherein the greater the technology growth rate per unit, the greater the weight, or the greater the growth rate per unit time, the smaller the weight.
[0050] S03: When it is determined to perform failure diagnosis on the storage medium, perform a read operation on the flash memory block on which a write operation has been performed.
[0051] In some embodiments, the storage medium includes several flash memory blocks, including flash memory blocks that have performed write operations and flash memory blocks that have not performed write operations. When performing failure diagnosis, the flash memory blocks that have not performed write operations can be skipped and not perform failure diagnosis.
[0052] Optionally, the number of flash memory blocks to be read is determined from the flash memory blocks to which write operations have been performed according to the bandwidth pressure of the port, and the read operation is performed on the determined flash memory blocks.
[0053] The port includes an IO interface of the storage medium, and the greater the pressure on the port, the more the bandwidth is fully loaded. In some embodiments, the greater the pressure on the IO interface, the greater the number of read operations.
[0054] S04: Check whether the storage medium is invalid according to the result of the read operation.
[0055] Optionally, check whether the read data is correct and whether the read position is deviated based on the result of the read operation; when the read data is wrong and / or the read position is deviated, record and update the error count information corresponding to the read operation; when the recorded error count information corresponding to the read operation is greater than a first set threshold, record and update the error count information corresponding to the flash memory block; when the recorded error count information corresponding to the flash memory block is greater than a second set threshold, determine that the storage medium has failed.
[0056] Specifically, since the read operation uses the flash memory page in the flash memory block as the minimum operation unit, it is first determined whether the error number of the flash memory page in the flash memory block exceeds a preset first threshold value. When the data of the read operation is read incorrectly and / or the position is read incorrectly, the error number of the flash memory page increases. When the error number of the flash memory page is greater than the first preset threshold value, the error number of the flash memory block increases. When the error number of the flash memory block exceeds the second preset threshold value, the storage medium is determined to have failed.
[0057] For details, please refer to Figure 5 , Figure 5 FIG. 1 is a schematic diagram of a storage medium failure in a storage medium provided in this embodiment, such as Figure 5 As shown, the read fail refers to a read error, the program fail refers to a write error, and the erase fail refers to an erase failure. Figure 5 It can be seen that the storage medium DIE1 of the CE0 port fails.
[0058] An embodiment of the present invention provides a method for checking for storage medium failure. The method obtains operation data of the storage medium and obtains error count information of the storage medium based on the operation data. Then, based on the error count information, the method detects whether a failure diagnosis of the storage medium has been triggered. When it is determined that a failure diagnosis of the storage medium has been performed, a flash memory block on which a write operation has been performed is obtained from several flash memory blocks of the storage medium. A read operation is performed on the flash memory block on which a write operation has been performed. Finally, the method checks whether the storage medium has failed based on the result of the read operation. By diagnosing the flash memory block on which a write operation has been performed, the method performs failure diagnosis on the storage medium in the storage medium without affecting the performance of the solid-state drive. The method also avoids data loss and / or downtime caused by untimely detection of storage medium failure, thereby improving the stability of the solid-state drive.
[0059] See also Figure 6 , Figure 6 is a structural block diagram of a device for checking storage medium failure provided by an embodiment of the present invention, such as Figure 6 As shown, the device 40 for checking storage medium failure includes an acquisition module 41 , a trigger module 42 , an execution module 43 and a determination module 44 .
[0060] The acquisition module 41 is configured to acquire operation data of the storage medium and acquire error count information of the storage medium according to the operation data.
[0061] The acquisition module 41 includes a first acquisition unit 411 and a statistical unit 412 .
[0062] The first acquiring unit 411 is used to acquire write operation data, read operation data and erase operation data corresponding to the storage medium;
[0063] The statistical unit 412 is configured to collect statistics on error count information corresponding to the write operation data, error count information corresponding to the read operation data, and error count information corresponding to the erase operation data.
[0064] The trigger module 42 is configured to check whether to trigger failure diagnosis of the storage medium according to the error count information.
[0065] The triggering unit 42 includes a second acquiring unit 421 , a first calculating unit 422 , a second calculating unit 423 , a third calculating unit 424 and a determining unit 425 .
[0066] The second acquiring unit 421 is configured to acquire a write weight corresponding to the write operation data, a read weight corresponding to the read operation data, and an erase weight corresponding to the erase operation data;
[0067] The first calculation unit 422 is configured to calculate a first product of the error count information corresponding to the write operation data and the write weight;
[0068] The second calculation unit 423 is configured to calculate a second product of the error count information corresponding to the read operation data and the read weight;
[0069] The third calculation unit 424 calculates a third product of the error count information corresponding to the erasure operation data and the erasure weight;
[0070] The determination unit 425 is configured to trigger failure diagnosis of the storage medium when the first product is greater than a write threshold, and / or the second product is greater than a read threshold, and / or the third product is greater than an erase threshold.
[0071] The execution module 43 is configured to execute a read operation on the flash memory block on which a write operation has been executed when it is determined to perform failure diagnosis on the storage medium.
[0072] The determination module 44 is configured to check whether the storage medium is invalid according to the result of the read operation.
[0073] It should be noted that the aforementioned apparatus for detecting storage medium failure can execute the method for detecting storage medium failure provided in the embodiments of the present invention, and has the corresponding functional modules and beneficial effects of executing the method. For technical details not fully described in the embodiments of the apparatus for detecting storage medium failure, reference can be made to the method for detecting storage medium failure provided in the embodiments of the present invention.
[0074] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of this embodiment.
[0075] Through the description of the above embodiments, it is clear to those skilled in the art that each embodiment can be implemented by means of software plus a general hardware platform, or of course by hardware. It is understood by those skilled in the art that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
[0076] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Under the concept of the present invention, the technical features in the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations in different aspects of the present invention as described above. For the sake of simplicity, they are not provided in detail. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in this field should understand that they can still modify the technical solutions described in the above embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for checking storage medium failure, applied to a solid-state hard disk, wherein the storage medium of the solid-state hard disk includes a plurality of flash memory blocks, characterized in that: The method comprises: Acquiring operation data of the storage medium, and acquiring error count information of the storage medium according to the operation data; detecting whether to trigger failure diagnosis of the storage medium according to the error count information; When it is determined to perform failure diagnosis on the storage medium, performing a read operation on the flash memory blocks that have been written to, and skipping the failure diagnosis on the flash memory blocks that have not been written to; checking whether the storage medium is invalid according to the result of the read operation; The performing of a read operation on the flash memory block on which a write operation has been performed specifically includes: The number of flash memory blocks that perform read operations is determined from the flash memory blocks that have performed write operations based on the bandwidth pressure of the port, and the read operation is performed on the determined flash memory blocks, wherein the port includes an IO interface of the storage medium, and the greater the pressure on the IO interface, the greater the number of the read operations.
2. The method according to claim 1, characterized in that The acquiring operation data of the storage medium and acquiring error count information of the storage medium according to the operation data includes: Acquiring write operation data, read operation data, and erase operation data corresponding to the storage medium; The error counting information corresponding to the write operation data, the error counting information corresponding to the read operation data, and the error counting information corresponding to the erase operation data are counted.
3. The method according to claim 2, characterized in that The detecting, according to the error count information, whether to trigger failure diagnosis of the storage medium includes: Obtaining a write weight corresponding to the write operation data, a read weight corresponding to the read operation data, and an erase weight corresponding to the erase operation data; Calculating a first product of error count information corresponding to the write operation data and the write weight; Calculating a second product of the error count information corresponding to the read operation data and the read weight; Calculating a third product of the error count information corresponding to the erase operation data and the erase weight; When the first product is greater than a write threshold, and / or the second product is greater than a read threshold, and / or the third product is greater than an erase threshold, failure diagnosis of the storage medium is triggered.
4. The method according to claim 3, characterized in that The method further comprises: Counting the count growth rates per unit time corresponding to the error count information corresponding to the write operation data, the error count information corresponding to the read operation data, and the error count information corresponding to the erase operation data; A write weight corresponding to the write operation data, a read weight corresponding to the read operation data, and an erase weight corresponding to the erase operation data are determined respectively according to the count growth rate.
5. The method according to any one of claims 1 to 4, characterized in that The checking whether the storage medium is invalid according to the result of the read operation includes: Checking whether the read data is correct and whether the position is read incorrectly based on the result of the read operation; When the read data is erroneous and / or the read position is off, the error count information corresponding to the read operation is recorded and updated; When the recorded error count information corresponding to the read operation is greater than a first set threshold, the error count information corresponding to the flash memory block is recorded and updated; When the recorded error count information corresponding to the flash memory block is greater than a second set threshold, it is determined that the storage medium is invalid.
6. A device for checking storage medium failure, applied to a solid-state hard disk, wherein the storage medium of the solid-state hard disk includes a plurality of flash memory blocks, characterized in that: The device comprises: an acquisition module, configured to acquire operation data of the storage medium and acquire error count information of the storage medium according to the operation data; a triggering module, configured to detect whether to trigger failure diagnosis of the storage medium according to the error counting information; an execution module, configured to, when determining to perform failure diagnosis on the storage medium, perform a read operation on the flash memory blocks on which a write operation has been performed, and skip performing failure diagnosis on the flash memory blocks on which a write operation has not been performed; a determination module, configured to check whether the storage medium is invalid according to a result of the read operation; The execution module is specifically configured to: The number of flash memory blocks that perform read operations is determined from the flash memory blocks that have performed write operations based on the bandwidth pressure of the port, and the read operation is performed on the determined flash memory blocks, wherein the port includes an IO interface of the storage medium, and the greater the pressure on the IO interface, the greater the number of the read operations.
7. The device according to claim 6, characterized in that The acquisition module includes: a first acquiring unit, configured to acquire write operation data, read operation data, and erase operation data corresponding to the storage medium; A statistics unit is used to count error counting information corresponding to the write operation data, error counting information corresponding to the read operation data, and error counting information corresponding to the erase operation data.
8. The device according to claim 7, characterized in that The trigger module includes: A second acquiring unit, configured to acquire a write weight corresponding to the write operation data, a read weight corresponding to the read operation data, and an erase weight corresponding to the erase operation data; a first calculating unit, configured to calculate a first product of error count information corresponding to the write operation data and the write weight; a second calculating unit, configured to calculate a second product of the error count information corresponding to the read operation data and the read weight; a third calculating unit, calculating a third product of the error count information corresponding to the erasure operation data and the erasure weight; A determination unit is configured to trigger a failure diagnosis of the storage medium when the first product is greater than a write threshold, and / or the second product is greater than a read threshold, and / or the third product is greater than an erase threshold.
9. A solid state hard disk, characterized in that: include: storage media; as well as, a main controller connected to the storage medium; Wherein, the main controller includes: at least one processor; and A cache is connected to the at least one processor; wherein, The cache stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method for checking storage medium failure according to any one of claims 1 to 5.
Citation Information
Patent Citations
Method, device, apparatus and medium for marking bad blocks in solid-state hard disk
CN109271275A
A method for handle data block errors of a solid state hard disk
CN109460371A