Data processing method and device of storage device, terminal device and storage medium

By calculating the open state, read and erase counts of NAND flash blocks, its security is determined and data migration is performed, solving the problems of long processing time and read disturb, and realizing fast security detection and data migration.

CN117742600BActive Publication Date: 2026-11-24SLICONGO MICROELECTRONICS INC
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311760623.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-18
Publication Date
2026-11-24
Estimated Expiration
2043-12-18

AI Technical Summary

Technical Problem

In existing technologies, NAND flash storage devices take a long time to determine whether a block is safe and suffer from read disturb problems.

Method used

By obtaining the open state, read count, and erase wear count of the target block, its placement time is calculated, and the number of computation error bits of the target block is calculated based on these data. When the number of computation error bits is greater than the safety threshold, the number of error bits is read and recorded, and a data migration operation is performed.

Benefits of technology

This reduces the time required to scan all blocks, lowers the probability of read disturb, and enables fast and accurate security detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117742600B_ABST
    Figure CN117742600B_ABST
Patent Text Reader

Abstract

This application relates to the field of storage technology and provides a data processing method, apparatus, terminal device, and storage medium for a storage device. The data processing method for the storage device includes: acquiring the open state, read count, and erase wear count of a target block; calculating the placement time of the target block; calculating the number of computational error bits of the target block based on the open state, read count, erase wear count, and placement time; when the number of computational error bits exceeds a safety threshold, reading the number of recorded error bits of the target block; and when the number of recorded error bits exceeds the safety threshold, performing a data migration operation on the target block. This application embodiment can detect whether all blocks in the NAND flash are safe without scanning and detecting the error bit count of all blocks, resulting in shorter processing time and reducing the probability of read disturb problems.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of storage technology, and in particular relates to a data processing method, apparatus, terminal device and storage medium for a storage device. Background Technology

[0002] Storage devices are widely used in various electronic devices. NAND flash is one type of storage device, characterized by high storage density, low power consumption, long lifespan, and high reliability. However, NAND flash suffers from the data retention problem, specifically referring to the loss of data stored in NAND flash over time. In related technologies, all blocks in the NAND flash are typically scanned and inspected to determine if each block is safe (i.e., the data within the block will not be permanently corrupted). However, scanning and inspecting all blocks is time-consuming and suffers from read disturb problems. Summary of the Invention

[0003] This application provides a data processing method, apparatus, terminal device, and storage medium for a storage device, which can solve the problem in the related art that it takes a long time and there is a read disturb problem when determining whether a block in NAND flash is safe.

[0004] In a first aspect, embodiments of this application provide a data processing method for a storage device, including: Obtain the open state, read count, and erase wear count of the target block; Calculate the placement time of the target block; The number of computational error bits of the target block is calculated based on the open state, the number of reads, the number of erase wears, and the placement time. When the number of calculated error bits is greater than the security threshold, the number of recorded error bits of the target block is read. When the number of recorded error bits exceeds the security threshold, a data migration operation is performed on the target block.

[0005] Secondly, embodiments of this application provide a data processing apparatus for a storage device, comprising: The acquisition module is used to acquire the open status, read count, and erase wear count of the target block; The first calculation module is used to calculate the placement time of the target block; The second calculation module is used to calculate the number of calculation error bits of the target block based on the open state, the number of reads, the number of erase wears, and the placement time. The reading module is used to read the number of recorded error bits of the target block when the number of calculated error bits is greater than a safety threshold; The migration module is used to perform a data migration operation on the target block when the number of recorded error bits is greater than a security threshold.

[0006] Thirdly, embodiments of this application provide a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the data processing method of the aforementioned storage device.

[0007] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the data processing method of the storage device described above.

[0008] Fifthly, embodiments of this application provide a computer program product that, when run on a terminal device, causes the terminal device to execute the data processing method of the storage device described above.

[0009] The beneficial effects of this application embodiment compared with the prior art are as follows: This application embodiment obtains the open state, read count, and erase wear count of the target block, calculates the placement time of the target block, and then calculates the number of computational error bits of the target block based on the open state, read count, erase wear count, and placement time. When the number of computational error bits is greater than the safety threshold, the recorded error bits of the target block are read. When the recorded error bits are greater than the safety threshold, a data migration operation is performed on the target block. This application embodiment calculates the number of computational error bits of the target block. For target blocks with a number of computational error bits greater than the safety threshold, the recorded error bits are read for confirmation, and a data migration operation is performed on the target blocks with a recorded error bits greater than the safety threshold. This application embodiment does not need to scan and detect the error bits of all blocks. Instead, it calculates the number of computational error bits of the target block. For target blocks with a number of computational error bits greater than the safety threshold, the recorded error bits are read for confirmation. Therefore, this application embodiment can detect whether all blocks in the NAND flash are safe, without scanning and detecting the error bits of all blocks, which is less time-consuming and can reduce the probability of read disturb problems. Attached Figure Description

[0010] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0011] Figure 1 This is a schematic diagram illustrating the implementation flow of a data processing method for a storage device provided in an embodiment of this application; Figure 2 This is a schematic diagram of the structure of a data processing apparatus for a storage device provided in an embodiment of this application; Figure 3 This is a schematic diagram of the structure of the terminal device provided in the embodiments of this application. Detailed Implementation

[0012] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are protected by this application.

[0013] It should be noted that the terms "comprising," "including," and "having," and any variations thereof, in the specification, claims, and accompanying drawings of this application, are intended to cover non-exclusive inclusion. For example, a process, method, terminal, product, or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or devices. Terms such as "first" and "second" in the claims, specification, and accompanying drawings of this application, as well as relational terms, are used merely to distinguish one entity / operation / object from another entity / operation / object, and do not necessarily require or imply any such immediate relationship or order between these entities / operations / objects.

[0014] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a mutually exclusive, independent, or alternative embodiment. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0015] Storage devices are widely used in various electronic devices. NAND flash is one type of storage device, characterized by high storage density, low power consumption, long lifespan, and high reliability. However, NAND flash suffers from the data retention problem, specifically referring to the loss of data stored in NAND flash over time. In related technologies, all blocks in the NAND flash are typically scanned and inspected to determine if each block is safe (i.e., the data within the block will not be permanently corrupted). However, scanning and inspecting all blocks is time-consuming and suffers from read disturb problems.

[0016] Therefore, this embodiment does not require scanning and detecting the error bit count of all blocks. Instead, it calculates the error bit count of the target block. For target blocks with a calculated error bit count greater than the safety threshold, it reads the recorded error bit count within the block for confirmation. Thus, this embodiment can detect whether all blocks in the NAND flash are safe without scanning and detecting the error bit count of all blocks, which is less time-consuming and reduces the probability of read disturb problems.

[0017] To illustrate the technical solution of this application, specific embodiments are described below.

[0018] Figure 1 This illustration shows a schematic flowchart of a data processing method for a storage device according to an embodiment of this application. This method can be applied to terminal devices. Terminal devices can be mobile phones, tablets, laptops, ultra-mobile personal computers (UMPCs), netbooks, etc.

[0019] Specifically, the data processing method of the above-mentioned storage device may include the following steps S101 to S105.

[0020] Step S101: Obtain the open state, number of reads, and number of erase wear counts of the target block.

[0021] Here, the target block is a block in NAND flash memory. It can be understood that there can be one or more target blocks. The open state indicates whether the target block is in an open state, the read count indicates the number of times the target block has been read, and the erase wear count indicates the number of times the target block has been programmed and erased.

[0022] Understandably, before executing step S101, the terminal device can first determine which blocks are target blocks. Specifically, the terminal device can consider blocks that are used more frequently as target blocks, that is, blocks that are read more often as target blocks.

[0023] In the embodiments of this application, the terminal device can obtain the open state, number of reads, and number of erase wear counts of the target block by reading the relevant information recorded in the target block.

[0024] Specifically, in some embodiments of this application, obtaining the open state, read count, and erase wear count of the target block may include the following steps: Obtain the second reservation table of the target block; read the open state, read count, and erase wear count of the target block from the second reservation table.

[0025] The reserved table records data such as the open status of the corresponding block, the number of reads, and the number of erase wear events.

[0026] Understandably, when a block is erased, read, or opened, the NAND flash can record relevant information. For example, when a block is erased, it records the timestamp of the erase and the number of erase wear events; when a block is read, it records the number of times the block has been read; and when a block is opened or closed, it records the open state of the block. This information can be recorded in the reserved table of the corresponding block.

[0027] Step S102: Calculate the placement time of the target block.

[0028] The placement time can characterize the duration for which the target block stores data, that is, the duration for which the target block data is retained.

[0029] In the embodiments of this application, the terminal device can calculate the placement time of the target block by determining the current time and the initial time of the target block storage data.

[0030] Step S103: Calculate the number of computational error bits of the target block based on the open state, number of reads, number of erase wear cycles, and placement time.

[0031] The calculation of the number of error bits can represent the number of error bits in the target block obtained through calculation. It is understood that the calculated number of error bits may have a certain error from the actual number of error bits in certain situations.

[0032] In the embodiments of this application, the terminal device can use the error bit number calculation formula to calculate the number of error bits of the target block based on data such as open state, number of reads, number of erase wears, and placement time.

[0033] Step S104: When the number of error bits calculated is greater than the security threshold, read the number of recorded error bits of the target block.

[0034] The security threshold characterizes the maximum number of error bits a block can have while it is in a secure state. In other words, when the number of error bits in a block exceeds the security threshold, it indicates that the block is in an unsecured state (meaning the data in the block may be permanently corrupted). The security threshold can be set empirically, for example, to 230 bits. Recording the number of error bits characterizes the actual number of error bits in the corresponding target block.

[0035] In the embodiments of this application, when the number of error bits is greater than the security threshold, the corresponding target block may be considered to be insecure. At this time, it can be further confirmed whether the target block is really in an insecure state. Specifically, the terminal device can read the number of recorded error bits of the target block to make a further judgment.

[0036] It is important to understand that the target block can record the number of error bits it contains and can be read out to determine the actual number of error bits. However, it should be noted that the process of reading the recorded number of error bits in the block takes a long time.

[0037] Step S105: When the number of recorded error bits exceeds the security threshold, perform a data migration operation on the target block.

[0038] In the embodiments of this application, when the number of recorded error bits is greater than the security threshold, it can be indicated that the target block is in an unsafe state. At this time, the terminal device can perform a data migration operation on the target block.

[0039] Specifically, in some embodiments of this application, the above-mentioned data migration operation on the target block when the number of recorded error bits exceeds the security threshold may include the following steps: When the number of recorded error bits exceeds the security threshold, the target block data on the target block is read into the buffer; the target block data in the buffer is then programmed into the safe block.

[0040] A safe block is a block that is in a safe state, that is, a block whose number of error bits does not exceed the safe threshold.

[0041] In the embodiments of this application, when the number of recorded error bits exceeds the security threshold, the terminal device can read the target block data from the target block, copy it to the buffer inside the main controller, and then program the target block data in the buffer onto the secure block. During this process, the error bits caused by data retention and read disturb problems on the target block will disappear when reprogrammed onto the secure block.

[0042] The beneficial effects of this application embodiment compared with the prior art are as follows: This application embodiment obtains the open state, read count, and erase wear count of the target block, calculates the placement time of the target block, and then calculates the number of computational error bits of the target block based on the open state, read count, erase wear count, and placement time. When the number of computational error bits is greater than the safety threshold, the recorded error bits of the target block are read. When the recorded error bits are greater than the safety threshold, a data migration operation is performed on the target block. This application embodiment calculates the number of computational error bits of the target block. For target blocks with a number of computational error bits greater than the safety threshold, the recorded error bits are read for confirmation, and a data migration operation is performed on the target blocks with a recorded error bits greater than the safety threshold. This application embodiment does not need to scan and detect the error bits of all blocks. Instead, it calculates the number of computational error bits of the target block. For target blocks with a number of computational error bits greater than the safety threshold, the recorded error bits are read for confirmation. Therefore, this application embodiment can detect whether all blocks in the NAND flash are safe, without scanning and detecting the error bits of all blocks, which is less time-consuming and can reduce the probability of read disturb problems.

[0043] In some embodiments of this application, the calculation of the number of error bits of the target block based on the open state, number of reads, number of erase wears, and placement time may specifically include steps S401 to S404.

[0044] Step S401: Determine the corresponding open state coefficients based on the open state.

[0045] In embodiments of this application, the terminal device can assign different open state coefficients to the target block based on its open state. For example, if the target block is in an open state, its corresponding open state coefficient is determined to be 1.2; if the target block is in a closed state, its corresponding open state coefficient is determined to be 1.0.

[0046] S402, determine the corresponding erasure wear number coefficient based on the erasure wear number.

[0047] In the embodiments of this application, the terminal device can assign different erasure wear coefficients to the target block based on the number of erasure wear cycles. For example, if the number of erasure wear cycles of the target block is between 0 and 500, the corresponding erasure wear coefficient is determined to be 1.0; if the number of erasure wear cycles of the target block is between 500 and 1000, the corresponding erasure wear coefficient is determined to be 1.3; if the number of erasure wear cycles of the target block is between 1000 and 1500, the corresponding erasure wear coefficient is determined to be 1.8; and if the number of erasure wear cycles of the target block is above 1500, the corresponding erasure wear coefficient is determined to be 2.0.

[0048] S403, obtain the maximum allowed placement time and the maximum allowed number of reads for the target block.

[0049] The maximum allowed placement time can be the longest data retention time allowed in the NAND design. The maximum allowed number of reads can be the maximum number of reads allowed in the NAND design. Both the maximum allowed placement time and the maximum allowed number of reads are recorded in the NAND.

[0050] In embodiments of this application, the terminal device can read the maximum allowed placement time and the maximum allowed number of reads of a target block from the NAND flash memory.

[0051] S404, according to the error bit count calculation formula, calculates the error bit count based on the maximum allowed placement time, the maximum allowed number of reads, the open state coefficient, the erase wear coefficient, the number of reads, and the placement time.

[0052] Specifically, in some specific embodiments of this application, the formula for calculating the number of error bits is as follows: ; in, To calculate the number of error bits, For placement time, To allow the longest possible placement time, For the number of reads, To allow the maximum number of reads, To remove the wear coefficient, For open state coefficients.

[0053] In the embodiments of this application, the terminal device can calculate the number of error bits by substituting the above data into the error bit calculation formula.

[0054] In some embodiments of this application, the above-mentioned calculation of the placement time of the target block may specifically include steps S501 to S507.

[0055] Step S501: Determine the reference block.

[0056] The reference block can be used to determine the placement time of the target block. Specifically, the reference block can be a block that is closed and has been read very infrequently.

[0057] In the embodiments of this application, the NAND flash can record the open / closed state and read count of each block. The terminal device can select a block that is in the closed state and has a very low read count as a reference block based on the open / closed state and read count of each block recorded by the NAND flash.

[0058] Step S502: Read the number of bits and the number of error bits of the reference block from the page information of the reference block.

[0059] In the embodiments of this application, the page information of the reference block records the number of bits and the number of error bits of the reference block. Therefore, the terminal device can read the number of bits and the number of error bits of the reference block from the page information of the reference block.

[0060] Step S503: Divide the number of error bits by the number of bits to obtain the quotient of the number of error bits and the number of bits.

[0061] In embodiments of this application, the terminal device can divide the number of error bits by the number of bits to obtain the quotient of the number of error bits and the number of bits.

[0062] Step S504: Obtain the first reserved table of the reference block.

[0063] Step S505: Read the number of erase wear cycles and the erase timestamp of the reference block from the first retention table.

[0064] The first reserved table records data such as the number of times the reference block was erased and the erasure timestamp.

[0065] In an embodiment of this application, the terminal device can obtain a first reservation table of the reference block from the NAND flash, and read the erase wear count and erase timestamp of the reference block from the first reservation table.

[0066] Step S506: Calculate the current time by combining the number of erase wear cycles of the reference block, the quotient, and the first mapping relationship.

[0067] The first mapping relationship is used to characterize the mapping relationship between the number of error bits and the data retention time under the number of erase wear cycles. Specifically, the first mapping relationship can be an abstract representation of a graph, where the vertical axis of the graph is the quotient of the number of error bits and the number of bits, and the horizontal axis is the data retention time. Different erase wear cycles correspond to different curves.

[0068] The current time is the time we are in right now. It's important to understand that storage devices like NAND flash memory are not constantly powered during use due to power consumption and other factors, therefore, accurate time tracking is not possible.

[0069] In an embodiment of this application, the terminal device can obtain the corresponding current time by substituting the number of erase wear cycles of the reference block and its quotient into the first mapping relationship. Specifically, the quotient can be substituted into the corresponding point on the curve corresponding to the number of erase wear cycles, where the horizontal axis of the curve is the current time.

[0070] Step S507: Subtract the erase timestamp of the reference block from the current time to obtain the placement time of the target block.

[0071] The erasure timestamp of the reference block can be used to characterize the initial time when the target block saves data. This is because the reference block is rarely erased, so the erasure time of the reference block can be considered as the time when data saving begins, which is also the initial time when the target block saves data.

[0072] In an embodiment of this application, the terminal device can subtract the erasure timestamp of the reference block from the current time to obtain the placement time of the target block.

[0073] In some embodiments of this application, after calculating the number of computational error bits of the target block based on the open state, number of reads, number of erase wears, and placement time, the method may further include the following steps: When the number of error bits is not greater than the security threshold, the remaining safe storage time is calculated by combining the security threshold of the target block, the number of erasure wear times, the placement time, and the second mapping relationship.

[0074] The second mapping relationship is used to characterize the mapping relationship between the number of error bits and the data retention time under the number of erase wear cycles. It can be understood that the second mapping relationship can be consistent with the first mapping relationship.

[0075] In the embodiments of this application, when the number of error bits is not greater than the security threshold, it can be said that the target block is in a safe state. At this time, the terminal device can substitute the quotient of the security threshold and the number of bits of the target block into the curve corresponding to the second mapping relationship under the number of erase wear cycles of the target block. The x-coordinate of the point corresponding to the security threshold in the curve is the total safe storage time of the target block. Then, the remaining safe storage time can be obtained by subtracting the placement time of the target block from the total safe storage time.

[0076] Once the remaining safe storage time is obtained, the terminal device can notify the user of the remaining safe storage time.

[0077] Figure 2This illustration shows a structural diagram of a data processing apparatus for a storage device according to an embodiment of this application. The data processing apparatus 2 of the storage device can be configured on a terminal device. Specifically, the data processing apparatus 2 of the storage device may include: The acquisition module 201 is used to acquire the open status, read count, and erase wear count of the target block.

[0078] The first calculation module 202 is used to calculate the placement time of the target block.

[0079] The second calculation module 203 is used to calculate the number of calculation error bits of the target block based on the open state, number of reads, number of erase wears, and placement time.

[0080] The read module 204 is used to read the number of recorded error bits in the target block when the number of calculated error bits is greater than the safety threshold.

[0081] The migration module 205 is used to perform data migration operations on the target block when the number of recorded error bits exceeds the safety threshold.

[0082] The beneficial effects of this application embodiment compared with the prior art are as follows: This application embodiment obtains the open state, read count, and erase wear count of the target block, calculates the placement time of the target block, and then calculates the number of computational error bits of the target block based on the open state, read count, erase wear count, and placement time. When the number of computational error bits is greater than the safety threshold, the recorded error bits of the target block are read. When the recorded error bits are greater than the safety threshold, a data migration operation is performed on the target block. This application embodiment calculates the number of computational error bits of the target block. For target blocks with a number of computational error bits greater than the safety threshold, the recorded error bits are read for confirmation, and a data migration operation is performed on the target blocks with a recorded error bits greater than the safety threshold. This application embodiment does not need to scan and detect the error bits of all blocks. Instead, it calculates the number of computational error bits of the target block. For target blocks with a number of computational error bits greater than the safety threshold, the recorded error bits are read for confirmation. Therefore, this application embodiment can detect whether all blocks in the NAND flash are safe, without scanning and detecting the error bits of all blocks, which is less time-consuming and can reduce the probability of read disturb problems.

[0083] In some embodiments of this application, the second calculation module 203 described above can also be used to: determine the corresponding open state coefficient based on the open state; determine the corresponding erase wear number coefficient based on the erase wear number; obtain the maximum allowed placement time and the maximum allowed number of reads for the target block; and calculate the number of error bits according to the error bit calculation formula, based on the maximum allowed placement time, the maximum allowed number of reads, the open state coefficient, the erase wear number coefficient, the number of reads, and the placement time.

[0084] In some embodiments of this application, the formula for calculating the number of error bits is as follows: ; in, To calculate the number of error bits, For placement time, To allow the longest possible placement time, For the number of reads, To allow the maximum number of reads, To remove the wear coefficient, For open state coefficients.

[0085] In some embodiments of this application, the first calculation module 202 described above can also be used to: determine a reference block; read the number of bits and the number of error bits of the reference block from the page information of the reference block; divide the number of error bits by the number of bits to obtain the quotient of the number of error bits and the number of bits; obtain a first retention table of the reference block; read the erase wear count and erase timestamp of the reference block from the first retention table; calculate the current time by combining the erase wear count of the reference block, the quotient and a first mapping relationship, wherein the first mapping relationship is used to characterize the mapping relationship between the number of error bits and the data retention time under the erase wear count; and subtract the erase timestamp of the reference block from the current time to obtain the placement time of the target block.

[0086] In some embodiments of this application, the data processing apparatus 2 of the above-mentioned storage device may further include a third calculation module, which is used to calculate the remaining safe storage time by combining the security threshold of the target block, the number of erase wear times, the placement time, and a second mapping relationship when the number of calculation error bits is not greater than the security threshold. The second mapping relationship is used to characterize the mapping relationship between the number of calculation error bits and the data retention time under the number of erase wear times.

[0087] In some embodiments of this application, the data processing apparatus 2 of the storage device may further include a preprocessing module for cleaning the original audio to obtain cleaned audio; cutting the cleaned audio to obtain cut audio; and performing data enhancement on the cut audio to obtain enhanced audio.

[0088] In some embodiments of this application, the acquisition module 201 described above can also be used to: acquire a second reservation table of the target block; and read the open state, the number of reads, and the number of erase wears of the target block from the second reservation table.

[0089] In some embodiments of this application, the migration module 205 can also be used to: read the target block data on the target block into a buffer when the number of recorded error bits is greater than a security threshold; and program the target block data on the buffer into a secure block.

[0090] like Figure 3 The diagram shown is a schematic of a terminal device provided in an embodiment of this application. The terminal device 3 may include: a processor 301, a memory 302, and a computer program 303 stored in the memory 302 and executable on the processor 301, such as a data processing program for a storage device. When the processor 301 executes the computer program 303, it implements the steps in the data processing method embodiments of the various storage devices described above, for example... Figure 1 Steps S101 to S105 are shown. Alternatively, when the processor 301 executes the computer program 303, it implements the functions of each module / unit in the above-described device embodiments, for example... Figure 2 The module shown is the acquisition module 201, the first calculation module 202, the second calculation module 203, the reading module 204, and the migration module 205.

[0091] The computer program can be divided into one or more modules / units, which are stored in the memory 302 and executed by the processor 301 to complete this application. The one or more modules / units can be a series of computer program instruction segments capable of performing specific functions, which describe the execution process of the computer program in the terminal device.

[0092] The terminal device may include, but is not limited to, a processor 301 and a memory 302. Those skilled in the art will understand that... Figure 3 This is merely an example of a terminal device and does not constitute a limitation on the terminal device. It may include more or fewer components than shown, or combine certain components, or different components. For example, the terminal device may also include input / output devices, network access devices, buses, etc.

[0093] The processor 301 may be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.

[0094] The memory 302 can be an internal storage unit of the terminal device, such as a hard drive or memory. The memory 302 can also be an external storage device of the terminal device, such as a plug-in hard drive, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card. Furthermore, the memory 302 can include both internal and external storage units. The memory 302 is used to store the computer program and other programs and data required by the terminal device. The memory 302 can also be used to temporarily store data that has been output or will be output.

[0095] It should be noted that, for the sake of convenience and brevity, the structure of the terminal device described above can also be referred to the specific description of the structure in the method embodiment, which will not be repeated here.

[0096] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0097] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, can implement the steps in the data processing method of the storage device described above.

[0098] This application provides a computer program product that, when run on a mobile terminal, enables the mobile terminal to implement the steps in the data processing method of the storage device described above.

[0099] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0100] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for various specific applications, but such implementations should not be considered beyond the scope of this application.

[0101] In the embodiments provided in this application, it should be understood that the disclosed devices / terminal equipment and methods can be implemented in other ways. For example, the device / terminal equipment embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling or direct coupling or communication connection may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0102] The units described as separate components may or may not be physically separate. 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 units can be selected to achieve the purpose of this embodiment according to actual needs.

[0103] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0104] If the integrated module / unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium can be appropriately added or removed according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electrical carrier signals and telecommunication signals.

[0105] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.

Claims

1. A data processing method for a storage device, characterized in that, include: Obtain the open state, read count, and erase wear count of the target block; Calculate the placement time of the target block; The number of computational error bits of the target block is calculated based on the open state, the number of reads, the number of erase wears, and the placement time. When the number of calculated error bits is greater than the security threshold, the number of recorded error bits of the target block is read. When the number of recorded error bits exceeds the security threshold, a data migration operation is performed on the target block; The step of calculating the number of computational error bits of the target block based on the open state, the number of reads, the number of erase wear cycles, and the placement time includes: Determine the corresponding open state coefficient based on the open state; The corresponding erasure wear number coefficient is determined based on the number of erasure wear cycles; Obtain the maximum allowed placement time and the maximum allowed number of reads for the target block; The number of error bits is calculated according to the error bit calculation formula, based on the maximum allowed placement time, the maximum allowed number of reads, the open state coefficient, the erase wear coefficient, the number of reads, and the placement time. The calculation of the placement time of the target block includes: Determine the reference block; The number of bits and the number of error bits of the reference block are read from the page information of the reference block; Divide the number of error bits by the number of bits to obtain the quotient of the number of error bits and the number of bits; Obtain the first reservation table of the reference block; The erase wear count and erase timestamp of the reference block are read from the first retention table; The current time is calculated by combining the number of erase wear cycles of the reference block, the quotient, and the first mapping relationship. The first mapping relationship is used to characterize the mapping relationship between the number of error bits and the data retention time under the number of erase wear cycles. Subtract the erasure timestamp of the reference block from the current time to obtain the placement time of the target block.

2. The data processing method for the storage device as described in claim 1, characterized in that, The formula for calculating the number of error bits is: ; in, To calculate the number of error bits, For placement time, To allow the longest possible placement time, For the number of reads, To allow the maximum number of reads, To remove the wear coefficient, For open state coefficients.

3. The data processing method for the storage device as described in claim 1, characterized in that, After calculating the number of computational error bits of the target block based on the open state, the number of reads, the number of erase wear cycles, and the placement time, the method further includes: When the number of computational error bits is not greater than the security threshold, the remaining safe storage time is calculated by combining the security threshold of the target block, the number of erasure wear times, the placement time, and the second mapping relationship. The second mapping relationship is used to characterize the mapping relationship between the number of computational error bits and the data retention time under the number of erasure wear times.

4. The data processing method for the storage device as described in claim 1, characterized in that, The acquisition of the target block's open state, read count, and erase wear count includes: Obtain the second reservation table of the target block; The open state, the number of reads, and the number of erase wears of the target block are read from the second reservation table.

5. The data processing method for the storage device as described in any one of claims 1 to 4, characterized in that, When the number of recorded error bits exceeds a security threshold, performing a data migration operation on the target block includes: When the number of recorded error bits exceeds the safety threshold, the target block data on the target block is read into the buffer; The target block data on the buffer is programmed onto the safe block.

6. A data processing apparatus for a storage device, characterized in that, include: The acquisition module is used to acquire the open status, read count, and erase wear count of the target block; The first calculation module is used to calculate the placement time of the target block; The second calculation module is used to calculate the number of calculation error bits of the target block based on the open state, the number of reads, the number of erase wears, and the placement time. The reading module is used to read the number of recorded error bits of the target block when the number of calculated error bits is greater than a safety threshold; The migration module is used to perform a data migration operation on the target block when the number of recorded error bits is greater than a security threshold. The step of calculating the number of computational error bits of the target block based on the open state, the number of reads, the number of erase wear cycles, and the placement time includes: Determine the corresponding open state coefficient based on the open state; The corresponding erasure wear number coefficient is determined based on the number of erasure wear cycles; Obtain the maximum allowed placement time and the maximum allowed number of reads for the target block; The number of error bits is calculated according to the error bit calculation formula, based on the maximum allowed placement time, the maximum allowed number of reads, the open state coefficient, the erase wear coefficient, the number of reads, and the placement time. The calculation of the placement time of the target block includes: Determine the reference block; The number of bits and the number of error bits of the reference block are read from the page information of the reference block; Divide the number of error bits by the number of bits to obtain the quotient of the number of error bits and the number of bits; Obtain the first reservation table of the reference block; The erase wear count and erase timestamp of the reference block are read from the first retention table; The current time is calculated by combining the number of erase wear cycles of the reference block, the quotient, and the first mapping relationship. The first mapping relationship is used to characterize the mapping relationship between the number of error bits and the data retention time under the number of erase wear cycles. Subtract the erasure timestamp of the reference block from the current time to obtain the placement time of the target block.

7. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the data processing method of the storage device as claimed in any one of claims 1 to 5.

8. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the data processing method for the storage device as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Data protection method and device, terminal equipment and readable storage medium

    CN115132266A

  • Method, system and equipment for acquiring read interference times of storage medium and medium

    CN115963997A