Data block management method, electronic equipment, storage medium and product
By obtaining the tag information of data blocks in solid-state hard disks and calculating the growth rate of bad blocks, the problem of inability to timely discover bad blocks and predict data failure risks in the prior art is solved, and the effect of timely warning and data security is achieved.
Patent Information
- Application Number
- CN202510389008.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-31
- Publication Date
- 2025-05-02
- Estimated Expiration
- 2045-03-31
AI Technical Summary
The existing technology cannot detect bad blocks in solid-state drives in a timely manner, nor can it predict the potential data failure risk under the cover of the error correction mechanism, resulting in the loss of data stored in solid-state drives.
By obtaining the total amount of data blocks contained in the storage unit at the current time and the marking information of each data block, it is determined whether there are bad blocks and calculates the bad block growth rate. If the growth rate of bad blocks exceeds the expected indicator, a warning message will be sent to prompt the user in a timely manner.
It realizes timely discovering bad blocks in solid-state drives, predicting potential data failure risks, avoiding data loss, and promptly notifying users of abnormal state of solid-state drives.
Smart Images

Figure CN119917029A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of storage technology, and in particular to a data block management method, electronic equipment, storage medium and product. Background Art
[0002] With the rapid development and widespread application of solid state drives (SSDs), data security has become one of the important concerns of SSDs. SSDs include flash memory particles, which include at least one storage unit, each storage unit includes multiple data blocks, and each data block includes at least one storage block; during the operation of the SSD, there may be a small probability that many bad blocks are added to the SSD due to the flash memory particles of the SSD or other problems, or too many bad blocks are added in a short period of time. At this time, although the error correction mechanism of the SSD temporarily maintains the normal transmission of data input and output, if the SSD is continued to be used, it is likely to cause the SSD to fail or even the data stored in the SSD to be lost, so bad blocks need to be managed.
[0003] Traditional bad block management usually marks bad blocks only when the number of faulty storage blocks included in the data blocks in the SSD reaches a certain threshold, resulting in failure to read, write or erase the data blocks. However, although this method can mark bad blocks to a certain extent to indicate that the SSD has a fault, it cannot detect bad blocks in time, nor can it predict the potential data failure risk hidden by the error correction mechanism, which will still lead to data loss stored in the SSD. Summary of the invention
[0004] The present application provides a data block management method, electronic device, storage medium and product to at least solve the problem in the related art that bad blocks in a solid-state drive cannot be discovered in time, and potential data failure risks hidden by an error correction mechanism cannot be predicted, resulting in loss of data stored in the solid-state drive.
[0005] The present application provides a data block management method, the method comprising: obtaining the total amount of data blocks contained in a storage unit at a current moment, and marking information of each data block, wherein the storage unit contains at least one data block, and the marking information is used to indicate whether a fault occurs in the current data block; determining whether there is a bad block in at least one data block based on the marking information, and counting a first number of the determined bad blocks; when the first number is less than a first threshold, obtaining the number of bad blocks newly added in the storage unit during N write-erase operations before the current moment, and calculating the ratio between the number of newly added bad blocks and N to obtain an average bad block growth number, where N is greater than or equal to 1 and is a positive integer; calculating the ratio between the average bad block growth number and the total amount of data blocks to obtain a first bad block growth rate of the storage unit at the current moment; if the first bad block growth rate is greater than or equal to a second bad block growth rate in a simulation test, sending a first warning message to a host, the first warning message being used to report to the host that the data block status of the storage unit at the current moment is abnormal.
[0006] The present application also provides a data block management device, which includes: a transceiver module, which is used to obtain the total amount of data blocks contained in the storage unit at the current moment, and the marking information of each data block, the storage unit contains at least one data block, and the marking information is used to indicate whether the current data block has a fault; a processing module, which is used to determine whether there is a bad block in at least one data block based on the marking information, and to count the first number of bad blocks determined; the processing module is also used to obtain the number of new bad blocks in the storage unit during N write-erase operations before the current moment when the first number is less than a first threshold, and calculate the ratio between the number of new bad blocks and N to obtain the average growth of bad blocks, N≥1 and is a positive integer; the processing module is also used to calculate the ratio between the average growth of bad blocks and the total amount of data blocks to obtain the first bad block growth rate of the storage unit at the current moment; the transceiver module is also used to send a first warning message to the host if the first bad block growth rate is greater than or equal to the second bad block growth rate in the simulation test, and the first warning message is used to report to the host that the data block status of the storage unit at the current moment is abnormal.
[0007] The present application also provides an electronic device, comprising: a memory for storing a computer program; and a processor for implementing the steps of any of the above-mentioned data block management methods when executing the computer program.
[0008] The present application also provides a computer-readable storage medium, in which a computer program is stored, wherein when the computer program is executed by a processor, the steps of any of the above-mentioned data block management methods are implemented.
[0009] The present application also provides a computer program product, including a computer program, which implements the steps of any of the above-mentioned data block management methods when the computer program is executed by a processor.
[0010] Through the present application, when the first number of bad blocks is less than the first threshold, the number of bad blocks newly added in the storage unit during the N write-erase operations before the current moment can be obtained, and the ratio between the number and N can be used to obtain the average bad block growth rate, and then the first bad block growth rate of the storage unit at the current moment can be calculated, that is, the real-time bad block growth rate of the storage unit can be obtained.
[0011] Afterwards, since the second bad block growth rate is the normal bad block growth rate corresponding to the normal operation of the storage unit determined based on the simulation test results, the real-time bad block growth rate is compared with the second bad block growth rate in the simulation test, so as to determine whether the bad block growth rate of the storage unit at the current moment exceeds the expected index. If so, it indicates that the current bad block growth rate is too fast, and the first warning information is sent to the host to promptly remind the user to pay attention to the abnormal state of the storage unit, so as to promptly determine that the solid-state hard disk is at risk and avoid the loss of data stored in the solid-state hard disk. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0013] Figure 1 A topological structure diagram of a data block management system provided in an embodiment of the present application; Figure 2 A flowchart of a data block management method provided in an embodiment of the present application; Figure 3 A schematic diagram of a process for determining a second bad block growth rate in a simulation test provided in an embodiment of the present application; Figure 4 A flowchart of a bad block marking method provided in an embodiment of the present application; Figure 5 A structural block diagram of a data block management device provided in an embodiment of the present application; Figure 6 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0014] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0015] It should be noted that, in the description of this application, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. The terms "first", "second", etc. in this application are used to distinguish similar objects, and are not used to describe a specific order or sequence.
[0016] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0017] In conjunction with a specific application environment architecture or a specific hardware architecture on which the execution of a data block management method depends, the specific application environment architecture or the specific hardware architecture is described herein.
[0018] The embodiments of the present application are applied to bad block management and early warning scenarios of solid state drives.
[0019] In the related technology, although traditional bad block management can mark bad blocks to a certain extent to indicate that the SSD has a fault, it cannot detect bad blocks in time, nor can it predict the potential data failure risk hidden by the error correction mechanism, which will still lead to the loss of data stored in the SSD.
[0020] In order to solve the above technical problems, the embodiment of the present application provides a data block management method, which includes: obtaining the total amount of data blocks contained in the storage unit at the current moment, and the marking information of each data block; determining whether there is a bad block in at least one data block based on the marking information, and counting the first number of bad blocks determined; when the first number is less than the first threshold, obtaining the number of bad blocks newly added in the storage unit during the N write-erase operations before the current moment, and calculating the ratio between the number of newly added bad blocks and N to obtain the average growth of bad blocks; calculating the ratio between the average growth of bad blocks and the total amount of data blocks to obtain the first bad block growth rate of the storage unit at the current moment; if the first bad block growth rate is greater than or equal to the second bad block growth rate in the simulation test, sending the first warning information to the host. In this way, when the bad block growth rate is too large, it can be determined in time that the bad blocks in the solid-state hard disk are growing too fast, and then it can be determined in time that the solid-state hard disk is at risk, thereby avoiding the loss of data stored in the solid-state hard disk.
[0021] Below Figure 1 Taking the management system of the data blocks shown as an example, the method provided in the embodiment of the present application is described.
[0022] like Figure 1 As shown, Figure 1A topological diagram of a data block management system provided in an embodiment of the present application. Figure 1 In the embodiment, the data block management system 100 includes a data block management device 101 , a host 102 and a solid state drive 103 .
[0023] The data block management device 101 in the embodiment of the present application can be any device with communication function and computing function. For example, the data block management device 101 can be a server, a virtual machine or a cloud server.
[0024] The host 102 in the embodiment of the present application may be a central processing unit (CPU), which is a core component of a computer system.
[0025] The solid state drive 103 in the embodiment of the present application may be a storage device based on flash memory particles. The solid state drive includes multiple storage units, each of which is also called a tube core (also called a DIE). Each storage unit includes multiple data blocks. Each data block includes multiple storage blocks.
[0026] Figure 1 The management system of the data block shown is only used as an example and is not used to limit the technical solution of the present application. Those skilled in the art should understand that in the specific implementation process, the management system at the data block can also include more devices without limitation.
[0027] The embodiment of the present application provides a data block processing method, which is applied to Figure 1 The management device of the data block shown, such as Figure 2 As shown, Figure 2 A flowchart of a data block management method provided in an embodiment of the present application, the data block management method comprises the following steps: S201: Obtain the total amount of data blocks contained in the storage unit at the current moment and the marking information of each data block.
[0028] The storage unit includes at least one data block and may be a single DIE in a solid state drive.
[0029] The mark information is used to indicate whether a fault occurs in the current data block.
[0030] It can be understood that if the marking information of a data block is marked, it indicates that the data block has a fault and the data block is called a bad block. If the marking information of a data block is empty, it indicates that the data block has no fault and the data block is a normal data block.
[0031] S202: Determine whether there is a bad block in at least one data block based on the mark information, and count a first number of the determined bad blocks.
[0032] In one example, a data block management device determines whether each data block fails based on marking information of each data block in at least one data block, and counts the failed data blocks to obtain a first number of bad blocks.
[0033] S203: When the first number is less than the first threshold, obtain the number of bad blocks newly added in the storage unit during N write-erase operations before the current moment, and calculate the ratio between the number of bad blocks newly added and N to obtain the average number of bad block growth.
[0034] Wherein, N ≥ 1 and is a positive integer.
[0035] In the embodiment of the present application, the first threshold is the maximum number of bad blocks in the entire life cycle of the storage unit recorded in the user manual of the solid-state drive. The maximum number of bad blocks is also called MAX_BAD_CNT.
[0036] In the embodiment of the present application, N can be determined based on the total number of data blocks of the storage unit, the maximum number of bad blocks, and the total number of write and erase operations performed on the storage unit at the current moment. The number of write and erase operations is also called the number of Program / Eras (P / E).
[0037] In one example, the data block management device determines the value of N based on the first expression, the total number of data blocks in the storage unit, the maximum number of bad blocks, and the total number of write and erase operations performed on the storage unit.
[0038] Among them, the first expression is:
[0039] in, is the total amount of data blocks; is the maximum number of bad blocks; The total number of write and erase operations performed at the current moment.
[0040] It can be understood that the data block management device comprehensively considers the impact of the total number of data blocks, the maximum number of bad blocks, and the number of P / Es on the life of the storage unit and the generation of bad blocks. The larger the total number of data blocks, the greater the number of bad blocks that may be generated; the maximum number of bad blocks limits the upper limit of bad blocks that the storage unit can tolerate; and the number of PEs at the current moment reflects the number of erase and write cycles experienced by the storage unit. The more times, the easier it is to generate bad blocks. The data block management device dynamically determines the value of N based on the specific storage unit parameters, so as to more reasonably obtain the number of bad blocks newly added in the storage unit during a certain number of write and erase operations before the current moment.
[0041] Optionally, when the first number is greater than or equal to a first threshold, the data block management device sends a second warning message to the host.
[0042] The second warning information indicates that the storage unit cannot be used any further.
[0043] It can be understood that if the first number is greater than or equal to the first threshold, it indicates that the storage unit is damaged. At this time, the data block management device turns on the red warning, and marks the position of the storage unit with the red warning mark, reduces the concurrency of writing data, and actively limits the speed. At the same time, the user is notified through the SMART log so that the user can deal with the abnormal disk in time.
[0044] S204: Calculate the ratio between the average bad block growth rate and the total number of data blocks to obtain the first bad block growth rate of the storage unit at the current moment.
[0045] S205: If the first bad block growth rate is greater than or equal to the second bad block growth rate in the simulation test, a first warning message is sent to the host.
[0046] The first warning information is used to report to the host that the data block status of the storage unit at the current moment is abnormal.
[0047] It can be understood that if the growth rate of the first bad block is greater than or equal to the growth rate of the second bad block in the simulation test, it means that the bad block growth rate is too fast. At this time, the yellow warning is turned on, and the data block management device can send the first warning information to the host through the SMART log to notify the user, so that the user can pay attention to the subsequent log information of this solid state drive.
[0048] Specifically, the data block management device performs a process of determining the second bad block growth rate in a simulation test, such as Figure 3 As shown, Figure 3 A schematic diagram of a process for determining a second bad block growth rate in a simulation test provided in an embodiment of the present application, wherein the data block management device performs the following steps: S301: Obtain the current temperature of the storage unit at the current moment and the total number of write and erase operations that have been performed.
[0049] S302: Based on a plurality of preset write-erase operation times and a plurality of temperatures, a bad block test is performed on the storage unit to obtain a mapping table.
[0050] The mapping table includes at least one mapping relationship, and each mapping relationship is a mapping relationship between a write-erase operation number ladder, a temperature ladder and a basic bad block growth rate.
[0051] In one example, the data block management device tests the storage unit at multiple P / E times ( ) and multiple temperatures ( ) to perform bad block test, and then calculate the growth rate of each step ( ). As shown in Table 1, Table 1 is a schematic diagram of the mapping table. In Table 1, the average growth rate of bad blocks under different P / E times and temperature T levels can be recorded.
[0052] Table 1: Mapping table
[0053] It is understandable that the maximum P / E times and the maximum withstand temperatures of different storage units may vary, and the gradient of the steps may be further refined for testing without limitation.
[0054] S303: Based on at least one mapping relationship, simulate the storage unit to obtain an aging influence coefficient and a temperature influence coefficient.
[0055] The aging impact coefficient reflects the relationship between the average growth rate of bad blocks and the number of P / Es, while the temperature impact coefficient reflects the relationship between the average growth rate of bad blocks and temperature.
[0056] In one example, a data block management device simulates a storage unit through a linear additive mathematical model based on at least one mapping relationship, multiple write and erase operation times, multiple temperature steps and multiple basic bad block growth rates to obtain an aging influence coefficient and a temperature influence coefficient.
[0057] S304: Determine a second bad block growth rate based on the current temperature, the total number of times, the mapping table, the aging influence coefficient, and the temperature influence coefficient.
[0058] In some optional embodiments, the data block management device searches in a mapping table for the target temperature step where the current temperature is located, the target write-erase operation step where the total number of times is located, and the target basic bad block growth rate corresponding to the target temperature step and the target write-erase operation step; and calculates the second bad block growth rate according to a preset expression based on the basic temperature value corresponding to the target temperature step, the basic write-erase operation number corresponding to the target write-erase operation step, the target basic bad block growth rate, the aging influence coefficient, the temperature influence coefficient, the current temperature and the total number of times.
[0059] The preset expression is: 。
[0060] is the second bad block growth rate; is the target basic bad block growth rate; is the aging influence coefficient; is the temperature influence coefficient; The total number of write and erase operations that have been performed; Is the number of basic write and erase operations; is the current temperature; The base temperature value.
[0061] Based on the above Figure 3 The method shown can calculate the second bad block growth rate.
[0062] Before obtaining the marking information of each data block, the embodiment of the present application also provides a bad block marking method, such as Figure 4 As shown, Figure 4 A flowchart of a bad block marking method provided in an embodiment of the present application; the data block management device may further perform the following steps: S401: At a first moment, receiving a read request sent from a host.
[0063] The read request carries address information of at least one storage block included in the target data block. The target data block is a data block in the storage unit.
[0064] The first moment may be any moment before the current moment.
[0065] S402: Reading storage data in at least one storage block from a target data block according to the address information.
[0066] In one example, the data block management device reads the storage data corresponding to the address information from the target data block according to the address information.
[0067] S403: Hard-decode the stored data and detect whether the hard-decoding is successful.
[0068] S404: If it is detected that the hard decoding is successful, the target data after hard decoding is obtained, and the first bit error rate of the stored data during the hard decoding process is recorded.
[0069] The bit error rate (BER) is the ratio of the number of erroneous bits in the bit stream received by the host to the total number of bits during the hard decoding process.
[0070] The target data is the data after the storage data is successfully decoded.
[0071] S405: Determine whether the first bit rate is greater than or equal to a second threshold.
[0072] In one example, the data block management device obtains multiple historical bit error rates within a historical time period; calculates the product of a preset ratio and a maximum historical bit error rate to obtain a second threshold.
[0073] Each historical bit error rate is a bit error rate corresponding to each successful hard decoding. The maximum historical bit error rate is the maximum historical bit error rate among multiple historical bit error rates, or the maximum historical bit error rate is the maximum BER of successful hard decoding when the host reads normally.
[0074] The historical time period may also be a time period during which the management device of the data block performs simulation testing.
[0075] The preset ratio can be set according to actual needs. For example, the preset ratio can be 80%.
[0076] S406: If the first bit error rate is greater than or equal to the second threshold, all stored data in the target data block are written into other data blocks.
[0077] The other data blocks are any free data blocks in the storage unit except the target data block.
[0078] In one example, if the first bit error rate is greater than or equal to the second threshold, the data block management device performs a forced garbage collection (force GC) process to write all stored data in the target data block into other data blocks.
[0079] It can be understood that since the first bit error rate is greater than or equal to the second threshold, it indicates that the bit error rate corresponding to the target data block is large, which means that the current data of the target data block is not stable and may trigger error correction. It needs to be moved as soon as possible and all stored data in the data block needs to be backed up to other data blocks.
[0080] S407: If the first bit error rate is less than the second threshold, it is determined that at least one storage block is normal.
[0081] It can be understood that if the first bit error rate is less than the second threshold, it indicates that the BER corresponding to the target data block is low, which means that the current data of the target data block is relatively healthy and no additional processing is required.
[0082] S408: If it is detected that the hard decoding fails, soft decoding is performed on the stored data, and it is detected whether the soft decoding is successful.
[0083] It is understandable that if hard decoding failure is detected, it means that the data cannot be read normally and soft decoding error correction is required.
[0084] S409: If soft decoding failure is detected, the target data block is marked as a bad block.
[0085] It is understandable that if it is detected that the soft decoding also fails, it means that the storage data corresponding to at least one current storage block has failed, and bad block marking and data migration processing are required (ie, all storage data in the target data block is written to other data blocks).
[0086] Optionally, the data block management device may also correct errors through other error correction means, which will not be described in detail here.
[0087] S410: If it is detected that the soft decoding is successful, the target data after the soft decoding and the first number of iterations required for the error correction algorithm to perform error correction during the soft decoding process are obtained.
[0088] The error correction algorithm is the Error Checking and Correction (ECC) algorithm, which is used to determine the location of the error and correct it according to pre-set rules when errors occur during data transmission or storage.
[0089] S411: Determine whether the first iteration number is less than a third threshold.
[0090] In one example, the data block management device obtains multiple historical iteration times within a historical time period; calculates the product of a preset ratio and a maximum historical iteration number to obtain a third threshold.
[0091] Wherein, each historical iteration number is the number of iterations required by the error correction algorithm to perform error correction after each successful soft decoding. The maximum historical iteration number is the maximum iteration number among multiple historical iteration numbers, or the maximum historical iteration number of the error correction algorithm.
[0092] S412: If the first iteration number is less than the third threshold, all stored data in the target data block are written into other data blocks.
[0093] It can be understood that when the first iteration number is less than the third threshold, that is, the number of iterations required for the error correction algorithm to correct errors during the soft decoding process is low, it means that the stored data is easy to correct back. Therefore, only the move processing is required, that is, all the stored data in the target data block is written to other data blocks.
[0094] S413: If the first iteration number is greater than or equal to the third threshold, the current error correction address and the first number of write and erase operations performed on the target storage unit at the first moment are recorded.
[0095] It can be understood that the target storage unit is the above storage unit. When the first iteration number is greater than or equal to the third threshold, that is, the number of iterations required for the error correction algorithm to perform error correction during the soft decoding process is high, it means that although the stored data can be corrected through soft decoding, the BER is very high. In addition to performing data movement processing on the current stored data, the current position needs to be recorded.
[0096] S414: During the M write-erase operations after the first number, when the data stored in the current error correction address is soft-decoded successfully again and the second iteration number is greater than or equal to a third threshold, the target data block is marked as a bad block.
[0097] The second number of iterations is the number of iterations required by the error correction algorithm to perform error correction during the soft decoding process of the data stored in the current error correction address.
[0098] M≥1 and is a positive integer. M can be set according to actual needs, for example, M is 5.
[0099] It can be understood that within the specified P / E added times, when this position is read again, if the second iteration number is still greater than or equal to the third threshold, it means that the current target data block is most likely a weak block, and the bad block is marked in advance to prevent the risk of data loss. At the same time, it can also reduce data error correction and thus reduce the impact on data input and output performance.
[0100] S415: During M write-erase operations after the first number, when the data stored at the current error correction address is hard-decoded again successfully, or the data stored at the current error correction address is soft-decoded again successfully and the second iteration number is less than a third threshold, it is determined that at least one storage block is normal.
[0101] It can be understood that within the specified P / E added times, when reading this position again, if the second iteration number is less than the third threshold, it means that the BER of the current target data block is low, and there is no need to mark the bad block, and it is determined that at least one storage block is normal.
[0102] Based on the above Figure 2 According to the method shown, when the first number of bad blocks is less than a first threshold, the data block management device can obtain the number of bad blocks newly added in the storage unit during the N write-erase operations before the current moment, and obtain the average bad block growth rate by comparing it with N, and then calculate the first bad block growth rate of the storage unit at the current moment, that is, the real-time bad block growth rate of the storage unit can be obtained.
[0103] Afterwards, since the second bad block growth rate is the normal bad block growth rate corresponding to the normal operation of the storage unit determined based on the simulation test results, the real-time bad block growth rate is compared with the second bad block growth rate in the simulation test, so as to determine whether the bad block growth rate of the storage unit at the current moment exceeds the expected index. If so, it indicates that the current bad block growth rate is too fast, and the first warning information is sent to the host to promptly remind the user to pay attention to the abnormal state of the storage unit, so as to promptly determine that the solid-state hard disk is at risk and avoid the loss of data stored in the solid-state hard disk.
[0104] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method.
[0105] The embodiment of the present application also provides a data block management device, such as Figure 5 As shown, Figure 5 A structural block diagram of a data block management device provided in an embodiment of the present application; the device includes: The transceiver module 501 is used to obtain the total amount of data blocks contained in the storage unit at the current moment and the marking information of each data block. The storage unit contains at least one data block, and the marking information is used to indicate whether a fault occurs in the current data block.
[0106] The processing module 502 is used to determine whether there is a bad block in at least one data block based on the marking information, and count a first number of the determined bad blocks.
[0107] The processing module 502 is also used to obtain the number of new bad blocks in the storage unit during N write and erase operations before the current moment when the first number is less than the first threshold, and calculate the ratio between the number of new bad blocks and N to obtain the average bad block growth, N≥1 and is a positive integer.
[0108] The processing module 502 is further used to calculate the ratio between the average growth rate of bad blocks and the total number of data blocks to obtain the first bad block growth rate of the storage unit at the current moment.
[0109] The transceiver module 501 is also used to send a first warning message to the host if the first bad block growth rate is greater than or equal to the second bad block growth rate in the simulation test. The first warning message is used to report to the host that the data block status of the storage unit at the current moment is abnormal.
[0110] In some optional embodiments, the transceiver module 501 is also used to obtain the current temperature of the storage unit at the current moment and the total number of write and erase operations that have been performed; the processing module 502 is also used to perform a bad block test on the storage unit based on a preset multiple number of write and erase operations and multiple temperatures to obtain a mapping table, the mapping table including at least one mapping relationship, each mapping relationship being a mapping relationship between a write and erase operation number ladder, a temperature ladder and a basic bad block growth rate; based on at least one mapping relationship, the storage unit is simulated to obtain an aging influence coefficient and a temperature influence coefficient; based on the current temperature, the total number of times, the mapping table, the aging influence coefficient and the temperature influence coefficient, the second bad block growth rate is determined.
[0111] In some optional implementations, the processing module 502 is specifically used to find the target temperature step where the current temperature is located, the target write-erase operation step where the total number of times is located, and the target basic bad block growth rate corresponding to the target temperature step and the target write-erase operation step in the mapping table; according to the basic temperature value corresponding to the target temperature step, the basic write-erase operation number corresponding to the target write-erase operation step, the target basic bad block growth rate, the aging influence coefficient, the temperature influence coefficient, the current temperature and the total number of times, the second bad block growth rate is calculated according to a preset expression, and the preset expression is: .
[0112] in, is the second bad block growth rate; is the target basic bad block growth rate; is the aging influence coefficient; is the temperature influence coefficient; The total number of write and erase operations that have been performed; Is the number of basic write and erase operations; is the current temperature; The base temperature value.
[0113] In some optional embodiments, the transceiver module 501 is also used to receive a read request sent from the host at a first moment, the read request carries address information of at least one storage block included in the target data block, and the target data block is a data block in the storage unit; the processing module 502 is also used to read storage data in at least one storage block from the target data block according to the address information; hard-decode the storage data; if the hard decoding is detected to be successful, obtain the target data after hard decoding, and record the first bit error rate of the storage data during the hard decoding process; if the first bit error rate is greater than or equal to the second threshold, write all the storage data in the target data block into other data blocks, and the other data blocks are any free data blocks in the storage unit except the target data block.
[0114] In some optional implementations, the processing module 502 is further configured to determine that at least one storage block is normal if the first bit error rate is less than a second threshold.
[0115] In some optional implementations, the processing module 502 is further configured to perform soft decoding on the stored data if hard decoding failure is detected; and to mark the target data block as a bad block if soft decoding failure is detected.
[0116] In some optional embodiments, the processing module 502 is also used to obtain the target data after soft decoding and the first number of iterations required for the error correction algorithm to perform error correction during the soft decoding process if the soft decoding is detected to be successful; if the first number of iterations is less than a third threshold, all the stored data in the target data block is written into other data blocks.
[0117] In some optional embodiments, the processing module 502 is further used to record the current error correction address and the first number of write and erase operations performed on the storage unit at the first moment if the first number of iterations is greater than or equal to a third threshold; during M write and erase operations after the first number, when the data stored at the current error correction address is soft-decoded again successfully, and the second number of iterations is greater than or equal to the third threshold, the target data block to which the stored data belongs is marked as a bad block, and the second number of iterations is the number of iterations required for the error correction algorithm to perform error correction during the soft decoding of the data stored at the current error correction address; M ≥ 1 and is a positive integer.
[0118] In some optional embodiments, the processing module 502 is also used to determine that at least one storage block is normal when, during M write-erase operations after the first number of times, the data stored at the current error correction address is hard-decoded again successfully, or when the data stored at the current error correction address is soft-decoded again successfully and the second iteration number is less than a third threshold.
[0119] In some optional implementations, the transceiver module 501 is further configured to send a second warning message to the host when the first number is greater than or equal to a first threshold, wherein the second warning message indicates that the storage unit cannot be used any further.
[0120] In some optional embodiments, the transceiver module 501 is also used to obtain multiple historical bit error rates within a historical time period, each historical bit error rate is a bit error rate corresponding to each successful hard decoding; the processing module 502 is also used to calculate the product of a preset ratio and a maximum historical bit error rate to obtain a second threshold, and the maximum historical bit error rate is the largest historical bit error rate among the multiple historical bit error rates.
[0121] In some optional implementations, the transceiver module 501 is also used to obtain multiple historical iteration numbers within a historical time period, each historical iteration number is the number of iterations required for the error correction algorithm to perform error correction after each successful soft decoding; the processing module 502 is also used to calculate the product of a preset ratio and a maximum historical iteration number to obtain a third threshold, and the maximum historical iteration number is the maximum iteration number among the multiple historical iteration numbers.
[0122] For the description of the features in the embodiment corresponding to the data block management device, reference can be made to the relevant description of the embodiment corresponding to the data block management method, which will not be described in detail here.
[0123] The embodiment of the present application also provides an electronic device, such as Figure 6 As shown, Figure 6 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application; the electronic device includes a processor 10 and a memory 20, the memory 20 stores a computer program, and the processor 10 is configured to run the computer program to execute the steps in any of the above-mentioned data block management method embodiments.
[0124] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above-mentioned data block management method embodiments when running.
[0125] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.
[0126] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any of the above data block management method embodiments are implemented.
[0127] An embodiment of the present application also provides another computer program product, including a non-volatile computer-readable storage medium, the non-volatile computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the steps in any of the above-mentioned data block management method embodiments are implemented.
[0128] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0129] The above is a detailed introduction to a data block management method, electronic device, storage medium and product provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core ideas of the present application. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of the present application.
Claims
1. A data block management method, characterized in that: The method comprises: Acquire the total amount of data blocks contained in the storage unit at the current moment and the marking information of each data block, wherein the storage unit contains at least one data block, and the marking information is used to indicate whether a fault occurs in the current data block; Determine whether there is a bad block in the at least one data block based on the marking information, and count a first number of the determined bad blocks; When the first number is less than a first threshold, obtaining the number of bad blocks newly added in the storage unit during N write-erase operations before the current moment, and calculating the ratio between the number of newly added bad blocks and N to obtain an average number of bad block growth, where N≥1 and is a positive integer; Calculating the ratio between the average growth rate of the bad blocks and the total number of data blocks to obtain a first bad block growth rate of the storage unit at the current moment; If the first bad block growth rate is greater than or equal to the second bad block growth rate in the simulation test, a first warning message is sent to the host, where the first warning message is used to report to the host that the data block status of the storage unit at the current moment is abnormal.
2. The method according to claim 1, characterized in that The process of determining the second bad block growth rate in the simulation test includes: Acquire the current temperature of the storage unit at the current moment and the total number of write and erase operations that have been performed; Based on a plurality of preset write-erase operation times and a plurality of temperatures, a bad block test is performed on the storage unit to obtain a mapping table, wherein the mapping table includes at least one mapping relationship, each of which is a mapping relationship between a write-erase operation times ladder, a temperature ladder and a basic bad block growth rate; Based on the at least one mapping relationship, simulating the storage unit to obtain an aging influence coefficient and a temperature influence coefficient; The second bad block growth rate is determined based on the current temperature, the total number of times, the mapping table, the aging influence coefficient, and the temperature influence coefficient.
3. The method according to claim 2, characterized in that The determining the second bad block growth based on the current temperature, the total number of times, the mapping table, the aging influence coefficient and the temperature influence coefficient includes: Searching in the mapping table the target temperature step where the current temperature is located, the target write-erase operation step where the total number of times is located, and the target basic bad block growth rate corresponding to the target temperature step and the target write-erase operation step; The second bad block growth rate is calculated according to a preset expression according to the basic temperature value corresponding to the target temperature step, the basic number of write and erase operations corresponding to the target write and erase operation number step, the target basic bad block growth rate, the aging influence coefficient, the temperature influence coefficient, the current temperature and the total number of times. The preset expression is: in, is the second bad block growth rate; is the target basic bad block growth rate; is the aging influence coefficient; is the temperature influence coefficient; The total number of write and erase operations that have been performed; Is the number of basic write and erase operations; is the current temperature; The base temperature value.
4. The method according to claim 3, characterized in that The method further comprises: At a first moment, receiving a read request sent from the host, the read request carrying address information of at least one storage block included in a target data block, the target data block being a data block in the storage unit; Reading the stored data in the at least one storage block from the target data block according to the address information; Hard decoding the stored data; If it is detected that the hard decoding is successful, the target data after the hard decoding is obtained, and the first bit error rate of the stored data during the hard decoding process is recorded; If the first bit error rate is greater than or equal to a second threshold, all stored data in the target data block are written into other data blocks, where the other data blocks are any free data blocks in the storage unit except the target data block.
5. The method according to claim 4, characterized in that The method further comprises: If the first bit error rate is less than the second threshold, it is determined that the at least one storage block is normal.
6. The method according to claim 4, characterized in that The method further comprises: If it is detected that the hard decoding fails, soft decoding is performed on the stored data; If the soft decoding fails, the target data block to which the stored data belongs is marked as the bad block.
7. The method according to claim 6, characterized in that The method further comprises: If it is detected that the soft decoding is successful, the target data after the soft decoding and the first number of iterations required for the error correction algorithm to perform error correction during the soft decoding process are obtained; If the first iteration number is less than a third threshold, all the stored data in the target data block are written into the other data blocks.
8. The method according to claim 7, characterized in that The method further comprises: If the first iteration number is greater than or equal to the third threshold, then recording the current error correction address and the first number of write and erase operations performed on the storage unit at the first moment; During the M write and erase operations after the first number of times, when the data stored at the current error correction address is successfully soft-decoded again, and the second number of iterations is greater than or equal to the third threshold, the target data block is marked as the bad block, and the second number of iterations is the number of iterations required for the error correction algorithm to perform error correction during the process of soft-decoding the data stored at the current error correction address again; M≥1 and is a positive integer.
9. The method according to claim 8, characterized in that The method further comprises: During the M write-erase operations after the first number of times, when the data stored at the current error correction address is hard-decoded again successfully, or the data stored at the current error correction address is soft-decoded again successfully and the second number of iterations is less than the third threshold, it is determined that at least one storage block is normal.
10. The method according to claim 9, characterized in that The method further comprises: When the first number is greater than or equal to the first threshold, a second warning message is sent to the host, where the second warning message indicates that the storage unit cannot be used any further.
11. The method according to claim 10, characterized in that The method further comprises: Acquire multiple historical bit error rates within a historical time period, each of the historical bit error rates being a bit error rate corresponding to each successful hard decoding; The second threshold is obtained by calculating the product of the preset ratio and the maximum historical bit error rate, where the maximum historical bit error rate is the largest historical bit error rate among the multiple historical bit error rates.
12. The method according to claim 11, characterized in that The method further comprises: Acquire multiple historical iteration numbers within the historical time period, each of the historical iteration numbers being the number of iterations required for the error correction algorithm to perform error correction after each successful soft decoding; The third threshold is obtained by calculating the product of the preset ratio and the maximum number of historical iterations, where the maximum number of historical iterations is the largest number of iterations among the multiple numbers of historical iterations.
13. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the data block management method according to any one of claims 1 to 12 when executing the computer program.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the data block management method according to any one of claims 1 to 12.
15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the data block management method according to any one of claims 1 to 12 are implemented.
Citation Information
Patent Citations
Method and device for monitoring hard disk, and server
CN108763027A
Solid state disk testing method and device and computer storage medium
CN109599145A
Bad block detection method and system for solid state disk
CN118394609A
Memory block replacement method and device based on solid state disk, equipment and medium
CN118585128A
Voice synthesis device and method using attention mechanism
KR1020220021257A