Data storage method and electronic equipment

By calculating the lifespan wear index of storage blocks and combining historical write/erase times data, the shortcomings of existing wear leveling algorithms are addressed, enabling accurate identification and balanced utilization of storage blocks and extending the lifespan of the memory.

CN121785546APending Publication Date: 2026-04-03南昌勤胜电子科技有限公司
View PDF 0 Cites 1 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-30
Publication Date
2026-04-03

AI Technical Summary

Technical Problem

In the prior art, wear leveling algorithms for non-volatile memory rely on the number of erase and write cycles, which makes it impossible to accurately reflect the actual physical aging state and remaining lifespan of the memory blocks, resulting in insufficient predictive ability and uneven resource utilization.

Method used

By calculating the lifespan decay index of storage blocks and combining historical write/erase counts and historical erase time data, the wear leveling strategy is dynamically adjusted to prioritize writing to free blocks with higher health.

Benefits of technology

It achieves accurate identification and balanced utilization of storage blocks, extends the overall lifespan of the memory, reduces the bad block rate, and improves resource utilization efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121785546A_ABST
    Figure CN121785546A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of memories, and discloses a data storage method and electronic equipment. The method comprises the following steps: determining a life loss index of each storage block, wherein the life loss index is calculated according to historical erasing times and historical erasing time consumption data of the corresponding storage block; and according to the life loss index, determining a target storage block of the current to-be-written data from the storage blocks in the current idle state. According to the embodiment of the invention, the life loss index fuses the historical erasing times and the historical erasing time consumption data, so that the prediction capability of the residual service life of the storage block can be improved, the erasing operation of a healthy block with more erasing times and good actual health state is increased, the erasing operation of a weak block with less erasing times and poor actual performance is reduced, and the prediction efficiency of the residual service life of the storage block is improved. Abrasion of all memory blocks is more balanced, and the overall service life of the memory is prolonged.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of storage management technology, and in particular to a data storage method and electronic device. Background Technology

[0002] Currently, wear leveling algorithms for each block of non-volatile memory (such as NAND Flash) mainly rely on recording the number of erase / write operations for each block and determining the block to be written to next based on the number of erase / write operations.

[0003] This method uses the number of erase / write cycles as the sole metric, resulting in a limited monitoring method that fails to accurately reflect the actual physical aging state and remaining lifespan of each storage block. This is especially problematic in high-density and advanced NAND flash memory, where aging rates vary significantly, potentially leading to premature failure of some weaker blocks. This will result in:

[0004] Insufficient predictive capability: Unable to accurately predict the remaining lifetime of storage blocks, lacking real-time assessment of storage block failure risk;

[0005] Uneven resource utilization: Healthy storage blocks may be prematurely discarded, while degraded storage blocks may be overused, resulting in low overall storage resource utilization efficiency.

[0006] Therefore, improvements to existing technologies are necessary.

[0007] The above information is provided as background information only to aid in understanding this application and does not constitute an assertion or admission that any of the above content can be used as prior art relative to this application. Summary of the Invention

[0008] This application provides a data storage method and an electronic device to solve the problem of poor wear uniformity of storage blocks caused by using the number of erase / write cycles as a single indicator to measure the physical aging state of storage blocks in the prior art.

[0009] To achieve the above objectives, this application provides the following technical solution:

[0010] In a first aspect, embodiments of this application provide a data storage method applied to the memory of an electronic device, the memory comprising multiple storage blocks, the method comprising:

[0011] The lifetime attrition index of each storage block is determined; the lifetime attrition index is calculated based on the historical write / erase count and historical erase time data of the corresponding storage block.

[0012] Based on the lifetime decay index, the target storage block for the current data to be written is determined from the currently idle storage blocks.

[0013] Optionally, it also includes: in the calculation of the lifespan loss index, assigning a higher weight to the historical erase time data than to the historical erase / write count.

[0014] Optionally, the historical erase time data includes the latest erase time and / or the change in erase time; the change in erase time is the change in the latest erase time relative to the initial erase time.

[0015] Optionally, the life loss index is calculated according to the following formula:

[0016] ;

[0017] in, For the first The lifetime degradation index of a storage block;

[0018] These are the weighting coefficients, and ;

[0019] For the first The historical number of erase / write operations for each storage block;

[0020] For the first The maximum number of erase / write cycles per memory block;

[0021] For the first The latest erase time for each storage block;

[0022] For the first The initial erase time for each storage block;

[0023] The maximum acceptable erase time threshold.

[0024] Optionally, determining the target storage block from the currently idle storage blocks includes:

[0025] The storage block with the lowest lifespan depletion index is identified as the target storage block.

[0026] Secondly, embodiments of this application provide an electronic device, including:

[0027] The memory includes multiple memory blocks;

[0028] The lifetime status data acquisition module is used to record and update the historical write / erase count and historical erase time data of each storage block based on the execution status of the block erase operation;

[0029] A lifetime attrition index calculation module is used to determine the lifetime attrition index of each of the storage blocks; the lifetime attrition index is calculated based on the historical write / erase count and the historical erase time data of the corresponding storage block.

[0030] The dynamic wear leveling decision module is used to determine the target storage block for writing data from the currently idle storage blocks based on the wear leveling index.

[0031] Optionally, the lifetime attrition index calculation module, when calculating the lifetime attrition index, is specifically used to calculate the lifetime attrition index by combining the historical erase / write counts, the latest erase time, and / or the change in erase time; the change in erase time is the change in the latest erase time relative to the initial erase time.

[0032] Optionally, the memory includes non-volatile flash memory.

[0033] Thirdly, embodiments of this application provide an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement any of the above-described data storage methods.

[0034] Fourthly, embodiments of this application provide a computer-readable storage medium having computer-executable instructions stored thereon, which are executed by a computer processor to implement any of the data storage methods described above.

[0035] Compared with the prior art, this application has the following beneficial effects:

[0036] Unlike traditional wear leveling schemes that use the number of erase / write cycles as a single indicator, the embodiments of this application determine the target storage block for writing data based on the physical aging characteristics of the storage block (i.e., the correlation between erase time and oxide layer damage) and historical erase / write cycles and historical erase time data. This approach has the following advantages:

[0037] The lifetime attrition index in this application embodiment integrates historical write / erase counts and historical erase time data. Historical erase time data directly reflects the degree of damage to the tunnel oxide layer: generally, the longer the time, the more severe the aging. Therefore, even if two memory blocks have the same historical write / erase count, this application embodiment can accurately identify weak blocks with "few write / erase counts but poor actual performance" by analyzing the difference in erase time, thereby reducing the number of writes to them, delaying the failure time of weak blocks, and lowering the overall bad block rate.

[0038] This application embodiment prioritizes writing data to free blocks with higher health by using a lifespan wear index. This can increase the write operations on healthy blocks that have been erased many times but are actually in good health, while reducing the write operations on weak blocks that have been erased few times but are actually in poor performance. This dynamic allocation strategy makes the wear of all storage blocks more even, thereby improving the overall lifespan of the memory.

[0039] This application has other features and advantages that will be apparent from or will be set forth in detail in the accompanying drawings and following detailed description, which together serve to explain the particular principles of this application. Attached Figure Description

[0040] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, 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.

[0041] Figure 1 This is a flowchart of the data storage method provided in the embodiments of this application. Detailed Implementation

[0042] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0043] NAND flash memory is a storage array composed of floating-gate transistors. Each storage cell represents the data state through the amount of charge in the floating gate. Data erasure and programming operations are controlled by the tunneling effect to manage the charge in the floating gate.

[0044] The inventors discovered that during the erasure and writing process, electrons pass through an extremely thin tunnel oxide layer. As the number of erasures and writes increases, the tunnel oxide layer will continue to age and become damaged. The damaged oxide layer makes it more difficult for electrons to be effectively and evenly extracted or injected during subsequent erasures. This manifests as increased erasure and writing time and a higher error rate, ultimately leading to bad blocks.

[0045] Based on this, the inventors concluded that the time required to erase a block is positively correlated with the aging and damage degree of its tunnel oxide layer. The longer the erasure time, the more severe the physical aging of the block, the shorter its remaining lifespan, and the more prone it is to bad blocks.

[0046] Based on this, please refer to Figure 1 This application proposes a data storage method applied to the memory of an electronic device, wherein the memory includes multiple storage blocks, and the method includes:

[0047] S1. Determine the lifetime attrition index of each storage block; the lifetime attrition index is calculated based on the historical write / erase count and historical erase time data of the corresponding storage block.

[0048] The lifetime attrition index is used as a health assessment indicator for storage blocks. In this embodiment, the smaller the value, the healthier the storage block and the longer its remaining lifetime.

[0049] S2. Based on the lifetime decay index, determine the target storage block from the currently idle storage blocks to be written.

[0050] In this step, the storage block with the lowest lifespan decay index can be identified as the target storage block.

[0051] Unlike traditional wear leveling schemes that use the number of erase / write cycles as a single indicator, the embodiments of this application determine the target storage block for writing data based on the physical aging characteristics of the storage block (i.e., the correlation between erase time and oxide layer damage) and historical erase / write cycles and historical erase time data. This approach has the following characteristics:

[0052] The lifetime attrition index in this application embodiment integrates historical write / erase counts and historical erase time data. Historical erase time data directly reflects the degree of damage to the tunnel oxide layer: generally, the longer the time, the more severe the aging. Therefore, even if two memory blocks have the same historical write / erase count, this application embodiment can accurately identify weak blocks with "few write / erase counts but poor actual performance" by analyzing the difference in erase time, thereby reducing the number of writes to them, delaying the failure time of weak blocks, and lowering the overall bad block rate.

[0053] This application embodiment prioritizes writing data to free blocks with higher health by using a lifespan wear index. This can increase the write operations on healthy blocks that have been erased many times but are actually in good health, while reducing the write operations on weak blocks that have been erased few times but are actually in poor performance. This dynamic allocation strategy makes the wear of all storage blocks more even, thereby improving the overall lifespan of the memory.

[0054] Weak blocks refer to memory blocks with inherent defects during manufacturing (such as thin oxide layer) or that exhibit rapid aging characteristics in the early stages of use (such as rapid increase in erase time), and their actual lifespan is lower than the average level of the same batch.

[0055] In some embodiments, the above data storage method further includes: in the calculation of the lifetime attrition index, assigning a higher weight to historical erasure time data than to historical write / erase count data.

[0056] This is because the inventors discovered that the core of NAND Flash aging is the irreversible defects generated in the tunnel oxide layer during repeated erase and write operations. The outward manifestation of this physical damage is prolonged erase time: the more defects in the oxide layer, the greater the resistance to electron passage, and the longer the erase operation takes. In contrast, historical erase / write counts are merely statistical values ​​of "usage frequency," failing to reflect the dispersion in aging rates caused by manufacturing process variations (for example, within the same batch of memory blocks, weaker blocks age much faster than ordinary blocks; they may have the same number of erase / write operations, but their erase times differ significantly). Therefore, assigning higher weight to historical erase time data allows the calculation of the lifespan degradation index to more closely reflect the actual physical state of the memory blocks, rather than relying solely on idealized assumptions about "number of erases."

[0057] Furthermore, in traditional solutions, a block is considered near failure only after reaching a specified write / erase count threshold. However, in real-world scenarios, many weak blocks exhibit high error rates and erase timeouts due to severe oxide layer damage even when the number of write / erase cycles is far below the specified threshold. Changes in erase timeout duration can show signs of failure earlier than the write / erase count threshold. Giving greater weight to erase timeout allows the lifetime decay index to detect this risk signal earlier, avoiding over-allocating write / erase tasks to weak blocks with low write / erase cycles but poor actual physical condition, thus improving the foresight and accuracy of the assessment.

[0058] In some embodiments, historical erase time data includes the latest erase time and / or the change in erase time; the change in erase time is the change in the latest erase time relative to the initial erase time.

[0059] The latest erasure time refers to the time taken for the most recent erasure operation. It directly reflects the current degree of damage to the tunnel oxide layer and is an instant snapshot of the physical aging state.

[0060] The change in erase time measures the aging of a storage block from its new state to its current state. It directly reflects the aging rate. The larger the change, the more accumulated damage to the tunnel oxide layer and the faster the aging rate.

[0061] This embodiment combines the latest two-dimensional indicators of erase time and erase time change, which can further improve the accuracy and sensitivity of the lifetime loss index in assessing the physical aging state of storage blocks, such as identifying weak blocks with accelerated aging earlier and distinguishing storage blocks with different aging rates.

[0062] Furthermore, in some embodiments, the lifetime loss index can be specifically calculated according to the following formula:

[0063] ;

[0064] in, For the first The lifetime degradation index of a storage block;

[0065] These are the weighting coefficients, and ;

[0066] For the first The historical number of erase / write operations for each storage block;

[0067] For the first The maximum number of erase / write cycles per memory block;

[0068] For the first The latest erase time for each storage block;

[0069] For the first The initial erase time for each storage block;

[0070] The maximum acceptable erase time threshold.

[0071] In summary, this application's embodiments introduce historical erase time data to calculate the lifespan depletion index based on the traditional historical write / erase counts. Using this index as a key indicator of storage block lifespan status enables a superior wear leveling algorithm, aiming to more accurately extend the lifespan of each storage block. This approach offers the following advantages:

[0072] 1) Intelligent wear leveling is achieved: the block health status can be dynamically evaluated through the life loss index to achieve an adaptive wear leveling strategy.

[0073] 2) More accurate wear leveling decisions: By combining multiple dimensions such as erase / write cycles, erase time, and error rate, a comprehensive assessment system for block health status can be established, enabling more accurate wear leveling decisions.

[0074] 3) Enables predictive maintenance and extends lifespan: It can predict block lifespan based on historical data and implement preventive data migration strategies, thereby extending the overall lifespan of the storage system.

[0075] Secondly, embodiments of this application provide an electronic device, including:

[0076] The memory, which consists of multiple memory blocks;

[0077] The lifetime status data acquisition module is used to record and update the historical write / erase count and historical erase time data of each storage block based on the execution status of block erase operations;

[0078] The lifetime attrition index calculation module is used to determine the lifetime attrition index of each storage block; the lifetime attrition index is calculated based on the historical write / erase count and historical erase time data of the corresponding storage block.

[0079] The dynamic wear leveling decision module is used to determine the target storage block for the current data to be written from the currently idle storage blocks based on the lifespan wear index.

[0080] It should be noted that the electronic device can be a mobile phone, tablet computer, desktop computer, laptop computer, handheld computer, notebook computer, super mobile personal computer, netbook, as well as cellular phone, personal digital assistant, augmented reality device, virtual reality device, artificial intelligence device, wearable device, in-vehicle device, smart home device and / or smart city device. The embodiments of this application do not impose any special restrictions on the specific type of the electronic device.

[0081] In this embodiment, taking NAND Flash as an example, the specific data storage process may include:

[0082] Lifetime status data acquisition: Accurately measure and record the completion time of each block erase operation. .Will It is stored in the metadata area of ​​NAND or in the controller SRAM / DRAM.

[0083] Lifetime Depletion Index (LDI) Calculation: Periodically or when new data needs to be written, calculate the Lifetime Depletion Index (LDI) of all available free blocks.

[0084] LDI can be defined as:

[0085] in, The number of times history has been erased; Time taken for the latest erase of the storage block; This represents the change in the latest erasure time relative to the initial erasure time (i.e., the aging rate).

[0086] During calculation, it can be assigned or Compared to Higher weight.

[0087] Dynamic wear leveling decision: Select from all free blocks. As the next write target, new data is preferentially written to the free block with the lowest LDI (i.e., the healthiest and youngest). Additionally, after each block erase, the corresponding... and .

[0088] The above-mentioned electronic device can execute the methods provided in any embodiment of this application, and has the corresponding functional modules and beneficial effects for executing the methods, which will not be described in detail here.

[0089] Thirdly, embodiments of this application provide an electronic device, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the data storage method provided in any embodiment of this application.

[0090] Fourthly, Embodiment 4 of this application provides a computer-readable storage medium storing computer-executable instructions that, when executed by a processor, implement the shopping delivery method based on a mobile delivery vehicle as provided in all embodiments of this application.

[0091] Any combination of one or more computer-readable media may be used. A computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium can be, for example—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in connection with an instruction execution system, apparatus, or device.

[0092] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, capable of sending, propagating, or transmitting programs for use by or in connection with an instruction execution system, apparatus, or device.

[0093] The program code contained on a computer-readable medium may be transmitted using any suitable medium, including—but not limited to—wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.

[0094] Computer program code for performing the operations of this application can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0095] Finally, it should be noted that although the above embodiments have been described in the text and drawings of this application, this should not limit the scope of patent protection of this application. Any technical solutions that are based on the essential concept of this application and utilize the content described in the text and drawings of this application, resulting in equivalent structural or procedural substitutions or modifications, as well as the direct or indirect application of the technical solutions of the above embodiments to other related technical fields, are all included within the scope of patent protection of this application.

Claims

1. A data storage method, characterized in that, A memory used in an electronic device, the memory comprising multiple memory blocks, the method comprising: The lifetime attrition index of each storage block is determined; the lifetime attrition index is calculated based on the historical write / erase count and historical erase time data of the corresponding storage block. Based on the lifetime decay index, the target storage block for the current data to be written is determined from the currently idle storage blocks.

2. The data storage method according to claim 1, characterized in that, Also includes: In the calculation of the lifetime attrition index, the weight of the historical erase time data is higher than the weight of the historical erase / write count.

3. The data storage method according to claim 2, characterized in that, The historical erase time data includes the latest erase time and / or the change in erase time; the change in erase time is the change in the latest erase time relative to the initial erase time.

4. The data storage method according to claim 3, characterized in that, The life loss index is calculated using the following formula: ; in, For the first The lifetime degradation index of a storage block; These are the weighting coefficients, and ; For the first The historical number of erase / write operations for each storage block; For the first The maximum number of erase / write cycles per memory block; For the first The latest erase time for each storage block; For the first The initial erase time for each storage block; The maximum acceptable erase time threshold.

5. The data storage method according to claim 1, characterized in that, The step of determining the target storage block from the currently idle storage blocks includes: The storage block with the lowest lifespan depletion index is identified as the target storage block.

6. An electronic device, characterized in that, include: The memory includes multiple memory blocks; The lifetime status data acquisition module is used to record and update the historical write / erase count and historical erase time data of each storage block based on the execution status of the block erase operation; A lifetime attrition index calculation module is used to determine the lifetime attrition index of each of the storage blocks; the lifetime attrition index is calculated based on the historical write / erase count and the historical erase time data of the corresponding storage block. The dynamic wear leveling decision module is used to determine the target storage block for writing data from the currently idle storage blocks based on the wear leveling index.

7. The electronic device according to claim 6, characterized in that, The lifetime attrition index calculation module, when calculating the lifetime attrition index, specifically combines the historical erase / write counts, the latest erase time, and / or the change in erase time to obtain the lifetime attrition index; the change in erase time is the change in the latest erase time relative to the initial erase time.

8. The electronic device according to claim 6, characterized in that, The memory includes non-volatile flash memory.

9. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the data storage method as described in any one of claims 1 to 5.

10. A computer-readable storage medium having computer-executable instructions stored thereon, characterized in that, The computer-executable instructions are executed by a computer processor to implement the data storage method as described in any one of claims 1 to 5.

Citation Information

Cited By

  • A method and apparatus for adjusting the life of a memory block

    CN122131987A