WO2024055612A1 - Data storage method and apparatus for flash memory, and terminal device and storage medium - Google Patents

Data storage method and apparatus for flash memory, and terminal device and storage medium Download PDF

Info

Publication number
WO2024055612A1
WO2024055612A1 PCT/CN2023/093322 CN2023093322W WO2024055612A1 WO 2024055612 A1 WO2024055612 A1 WO 2024055612A1 CN 2023093322 W CN2023093322 W CN 2023093322W WO 2024055612 A1 WO2024055612 A1 WO 2024055612A1
Authority
WO
WIPO (PCT)
Prior art keywords
flash memory
storage
data
block
storage block
Prior art date
Application number
PCT/CN2023/093322
Other languages
French (fr)
Chinese (zh)
Inventor
邓伟超
吴大畏
李晓强
Original Assignee
深圳市硅格半导体有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳市硅格半导体有限公司 filed Critical 深圳市硅格半导体有限公司
Publication of WO2024055612A1 publication Critical patent/WO2024055612A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0679Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0604Improving or facilitating administration, e.g. storage management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0646Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
    • G06F3/0652Erasing, e.g. deleting, data cleaning, moving of data to a wastebasket

Definitions

  • the present application relates to the field of memory technology, and in particular to a data storage method, device, terminal equipment and computer storage medium of a flash memory.
  • the erroneous bits present in the data stored in the flash memory can be corrected using hard solution or soft solution.
  • a hard solution can be used for error correction.
  • a soft solution will be used for error correction.
  • Soft decryption requires the master control to cooperate with the hard decryption module to perform multiple matches. Therefore, when there are too many erroneous bits in the data stored in the blocks in the flash memory, the reading speed will slow down.
  • the main purpose of this application is to provide a data storage method, device, terminal equipment and computer storage medium for a flash memory, aiming to solve the problem of excessive block wear of the flash memory and excessive number of erroneous bits in the data stored on the blocks resulting in reading Slow technical issues.
  • this application provides a data storage method in a flash memory.
  • the data storage in the flash memory includes the following steps:
  • Data storage in the flash memory is performed according to the target storage block.
  • the first error bit number is the number of error bits present in every 2KB of data on the storage block
  • the step of calculating the first error bit number of each storage block in the initialized flash memory is, include:
  • For each storage block calculate the difference between the basic number of error bits and the third number of error bits, and use the absolute value of the difference divided by the preset number to calculate the number of the storage block.
  • the average number of error bits and use the average number of error bits to calculate the number of error bits per 2KB of data.
  • the data storage method in the flash memory further includes:
  • the wear table is updated according to each storage block in the flash memory, so as to determine a target storage block in each storage block according to the updated wear table.
  • the data storage method of the flash memory further includes:
  • the step of updating the wear table according to each storage block in the flash memory includes:
  • the wear table is updated using the fourth error bit number.
  • the step of updating the wear table according to each storage block in the flash memory includes:
  • the first erasure is performed on the worn block after the number of erasures is equal to the preset number of times. After the operation, calculate the fifth error bit number of the worn block;
  • the wear table is updated using the fifth error bit number.
  • the data storage method of the flash memory before the step of calculating the fifth error bit number of the worn block, the data storage method of the flash memory further includes:
  • the step of calculating the fifth error bit number of the worn block includes:
  • the data storage method of the flash memory further includes:
  • the step of updating the wear table according to each storage block in the flash memory includes:
  • the storage block For each storage block, when the data storage amount of the flash memory reaches a preset storage amount threshold, the storage block is erased for the first time after the data storage amount reaches the storage amount threshold. After the operation, calculate the sixth error bit number of each storage block;
  • the wear table is updated using each of the sixth error bit numbers.
  • the present application also provides a data storage device of a flash memory.
  • the data storage device of the flash memory includes:
  • a calculation module used to calculate the first error bit number and the basic error bit number of each storage block in the initialized flash memory
  • An adding module configured to add the basic error bit number and the first error bit number to a wear table of the flash memory, wherein the wear table includes the number of erasures of each of the storage blocks;
  • Determining module configured to determine the target storage block in each of the storage blocks according to the wear table, wherein the sum of the second error bit number of the target storage block and the basic error bit number is At the minimum, the second number of error bits is the product of the first number of error bits and the number of erasures;
  • the determining module is also configured to store data in the flash memory according to the target storage block.
  • the present application also provides a terminal device, which includes: a memory, a processor, and a data storage program of a flash memory stored in the memory and executable on the processor, wherein the When the data storage program of the flash memory is executed by the processor, the steps of the data storage method of the flash memory as described above are implemented.
  • the present application also proposes a computer storage medium.
  • a data storage program of a flash memory is stored on the computer storage medium.
  • the data storage program of the flash memory is executed by a processor, the above mentioned steps are implemented. Steps of data storage method of flash memory.
  • the basic error bit number and the first error bit number are added to the wear table of the flash memory, where the wear table Including the number of erasures of each storage block, the target storage block in each storage block is determined according to the wear table. Among them, the sum of the second error bit number of the target storage block and the basic error bit number is the smallest in the wear table.
  • the number of error bits is the product of the first number of error bits and the number of erases, and data is stored in the flash memory according to the target storage block.
  • this application realizes that the storage block used each time for data storage is the block with the smallest sum of the second error bit number and the basic error bit number in each storage block, so that each storage block is used evenly and avoids data storage in Part of the memory block has too many first error bits and erase times, thereby avoiding slow reading speed caused by too many error bits and too many erase times in the data of the storage block.
  • Figure 1 is a schematic structural diagram of a terminal device of the hardware operating environment involved in the embodiment of the present application
  • Figure 2 is a schematic flow chart of the first embodiment of the data storage method of the flash memory of the present application
  • FIG. 3 is a schematic diagram of functional modules of a data storage device of a flash memory according to an embodiment of the present application.
  • Figure 1 is a schematic structural diagram of the hardware operating environment of the terminal device involved in the solution of the embodiment of the present application.
  • Figure 1 is a schematic structural diagram of the hardware operating environment of the terminal device.
  • the terminal device may be a mobile terminal, a data storage control terminal, a PC or a portable computer, or other terminals.
  • the terminal device may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, and a communication bus 1002.
  • the communication bus 1002 is used to realize connection communication between these components.
  • the user interface 1003 may include a display screen (Display) and an input unit such as a keyboard (Keyboard).
  • the user interface 1003 may also include a standard wired interface and a wireless interface.
  • the network interface 1004 may include standard wired interfaces and wireless interfaces (such as WI-FI interfaces).
  • the memory 1005 can be a non-volatile memory (eg, flash memory), a high-speed RAM memory, or a stable memory (non-volatile memory), such as a disk memory.
  • the memory 1005 may also be a storage device independent of the aforementioned processor 1001.
  • the structure of the terminal device shown in Figure 1 does not constitute a limitation on the terminal device, and may include more or fewer components than shown, or combine certain components, or arrange different components.
  • memory 1005 which is a computer storage medium, may include a communication bus interface, a main control chip, storage particles, and a data storage program of a flash memory.
  • the main control chip contains firmware programs, which are used to manage and control the hardware and software resources of the sample terminal equipment.
  • the user interface 1003 is mainly used to communicate data with each terminal;
  • the network interface 1004 is mainly used to connect to the background server and communicate data with the background server;
  • the processor 1001 can be used to call the memory 1005 Store the data in the flash memory and perform the following operations:
  • Data storage in the flash memory is performed according to the target storage block.
  • processor 1001 can call the data storage program of the flash memory stored in the memory 1005, and also perform the following operations:
  • For each storage block calculate the difference between the basic number of error bits and the third number of error bits, and use the absolute value of the difference divided by the preset number to calculate the number of the storage block.
  • the average number of error bits and use the average number of error bits to calculate the number of error bits per 2KB of data.
  • processor 1001 can call the data storage program of the flash memory stored in the memory 1005, and also perform the following operations:
  • the wear table is updated according to each storage block in the flash memory, so as to determine a target storage block in each storage block according to the updated wear table.
  • processor 1001 can call the data storage program of the flash memory stored in the memory 1005, and also perform the following operations:
  • the operation of updating the wear table according to each storage block in the flash memory includes:
  • the wear table is updated using the fourth error bit number.
  • processor 1001 can call the data storage program of the flash memory stored in the memory 1005, and also perform the following operations:
  • the first erasure is performed on the worn block after the number of erasures is equal to the preset number of times. After the operation, calculate the fifth error bit number of the worn block;
  • the wear table is updated using the fifth error bit number.
  • processor 1001 can call the data storage program of the flash memory stored in the memory 1005, and also perform the following operations:
  • the operation of calculating the fifth error bit number of the worn block includes:
  • processor 1001 can call the data storage program of the flash memory stored in the memory 1005, and also perform the following operations:
  • the operation of updating the wear table according to each storage block in the flash memory includes:
  • the storage block For each storage block, when the data storage amount of the flash memory reaches a preset storage amount threshold, the storage block is erased for the first time after the data storage amount reaches the storage amount threshold. After the operation, calculate the sixth error bit number of each storage block;
  • the wear table is updated using each of the sixth error bit numbers.
  • hard solution or soft solution can be used to correct the error in the data stored in the flash memory.
  • a hard solution can be used for error correction.
  • a soft solution will be used for error correction.
  • soft solution requires the main control to cooperate with the hard solution module for multiple matching. Flash memory reads data in blocks. Therefore, when there are too many erroneous bits in the data stored in blocks in the flash memory, the number of erroneous bits will affect the decoding speed, and the master will need to perform error correction, resulting in the Blocks are read slower.
  • Flash memory performs data erasure operations in blocks.
  • all data in the block where the data is located often needs to be erased.
  • the number of erases for each block is limited. Repeated erasing of the same block will cause excessive wear of the block, resulting in an increase in the number of erroneous bits in the data of the block. Due to excessive block wear, the decoding time will become longer, resulting in Reading speeds will also be slower.
  • this embodiment proposes a data storage method of flash memory.
  • the number of error bits in each block (hereinafter referred to as storage block for distinction) in the initialized flash memory.
  • the number of error bits is added to the wear table.
  • the storage block with the smallest product of the number of error bits and the number of erasures is selected from each storage block to store the data, avoiding the need for Too many erroneous bits in the data of the storage block and too many erasures cause the speed of reading data to slow down.
  • the storage block selected from each storage block with the smallest product of the number of error bits and the number of erasures is called the target storage block.
  • FIG. 2 is a schematic flowchart of a data storage method in a flash memory according to a first embodiment of the present application. It should be noted that although a logical sequence is shown in the flowcharts, in some cases the steps shown or described may be performed in a sequence different from that herein.
  • the data storage method of the flash memory includes:
  • Step S100 calculate the first error bit number and the basic error bit number of each memory block in the initialized flash memory
  • the average number of error bits (hereinafter referred to as the first number of error bits for distinction) caused by each erase operation of each memory block in the initialized flash memory is calculated, and the initialized flash memory is calculated separately.
  • the number of error bits in each memory block (hereinafter referred to as the basic number of error bits for distinction).
  • the number of error bits of a storage block can be the number of error bits per 2KB of data in the storage block, or it can be the number of error bits when the storage block is full of data. It can be set according to actual needs. This is not restricted.
  • Step S200 Add the basic error bit number and the first error bit number to a wear table of the flash memory, where the wear table includes the number of erasures of each of the storage blocks;
  • a wear leveling algorithm is usually used to ensure that the number of erasures of each storage block in the flash memory is balanced, and to avoid excessive wear and tear due to too many erasures of a certain storage block, which will cause the performance of the flash memory to degrade.
  • the wear leveling of flash memory is achieved by constructing a wear table, which records the cumulative number of erasures of each storage block. Each time a write or erase operation is performed on the flash memory, the storage block with the least number of erasures in the wear table is selected for operation. , so that each storage block can be fully utilized.
  • the first error bit number and the basic error bit number corresponding to each storage block are added to the wear table to obtain a new wear table, and the wear table after adding the first error bit number and the basic error bit number is used as the selection The basis used to store data.
  • Step S300 Determine a target storage block in each storage block according to the wear table, wherein the sum of the second error bit number of the target storage block and the basic error bit number is the smallest in the wear table. , the second number of error bits is the product of the first number of error bits and the number of erasures;
  • the product of the first number of error bits and the number of erasures in each memory block is calculated to obtain the second number of error bits. It can be understood that the second number of error bits is the number of error bits generated by the erasure operation of the memory block. .
  • the wear table may pre-contain the sum of the second error bit number and the basic error bit number corresponding to each storage block, and the smallest and corresponding storage block is directly selected when selecting the target storage block;
  • the sum of the second error bit number and the basic error bit number can also be calculated to select the storage block with the smallest sum of the second error bit number and the basic error bit number as the storage block.
  • Target storage block The specific settings can be set according to the actual situation, and there are no restrictions here.
  • Step S400 Store data in the flash memory according to the target storage block.
  • the target storage block is selected for data storage.
  • Step S100 includes
  • Step S101 erase the data on each storage block in the initialized flash memory and rewrite the data on the storage block;
  • the first number of error bits is calculated for the initialized flash memory.
  • Data may be pre-stored in the initialized flash memory, so an erase operation is performed on each storage block in the flash memory to re-store the data.
  • each storage block is filled with data, or it can be written in each storage block.
  • Step S102 Read the rewritten data from each storage block to obtain the basic error bit number of each storage block;
  • Step S103 After repeating a preset number of erasing operations on each of the storage blocks, rewrite data on each of the storage blocks, and read the rewritten data from each of the storage blocks respectively. Obtain the third error bit number of each of the storage blocks;
  • a preset number of erase operations are repeated for each storage block. After repeating a preset number of erase operations on each memory block, rewrite data on each memory block, and read the rewritten data from each memory block to obtain errors in the respective data of each memory block.
  • the total number of bits hereinafter referred to as the third error bit number for distinction).
  • the preset number can be set according to actual needs.
  • the preset number can be set to 10.
  • Step S104 For each storage block, calculate the difference between the basic number of error bits and the third number of error bits, and use the absolute value of the difference divided by the preset number to calculate the The average number of error bits for a block is stored and used to calculate the number of error bits per 2KB of data.
  • For each storage block calculate the difference between the basic number of error bits and the third number of error bits, and use the absolute value of the difference divided by the preset number to calculate the average number of error bits of the storage block. Use the average number of error bits to calculate the number of error bits in every 2KB data and obtain the first number of error bits.
  • the basic error bit number and the first error bit number are added to the wear table of the flash memory, where the wear The table includes the number of erasures of each storage block.
  • the target storage block in each storage block is determined according to the wear table.
  • the sum of the second error bit number and the basic error bit number of the target storage block is the smallest in the wear table.
  • the second error bit number is the product of the first error bit number and the number of erases, and the data in the flash memory is stored according to the target storage block.
  • the storage block used for each data storage is the block with the smallest sum of the second error bit number and the basic error bit number in each storage block, so that each storage block is used evenly and avoids the data storage in some of the first errors.
  • the storage block with too many bits and erase times it avoids slowing down the reading speed due to too many erroneous bits and too many erasures in the data of the memory block.
  • the data storage method of the flash memory of the present application also includes:
  • Step S500 Update the wear table according to each storage block in the flash memory to determine a target storage block in each storage block according to the updated wear table.
  • the number of first error bits in each storage block in the flash memory is compared with the initialization The flash memory will undergo certain changes.
  • the target storage block is determined according to the updated wear table and the target storage block is used for data storage, so that data can be stored according to the actual usage of the flash memory, so that the flash memory can Each storage block can be used evenly.
  • the data storage method of the flash memory of the present application also includes:
  • Step S600 monitor the usage time of the flash memory
  • the usage time of the flash memory is detected, and whether to update the wear table is confirmed based on the usage time of the flash memory.
  • step S500 includes:
  • Step S501 For each storage block, when the monitored usage duration is equal to the preset duration, perform the first erasure on the storage block after the usage duration is equal to the preset duration. After the operation, calculate the fourth error bit number of the storage block;
  • Step S502 Use the fourth number of error bits to update the wear table.
  • the storage block is calculated.
  • the average number of error bits generated by each erase operation hereinafter referred to as the fourth number of error bits for distinction).
  • the fourth number of error bits for distinction.
  • the number of preset durations may be one, that is, the wear table is updated only once; in another embodiment, the number of preset durations may also be multiple, that is, every time the wear table is updated, the number of preset durations may be multiple.
  • the wear table is updated at a certain time interval, which can be set according to actual needs and is not limited here.
  • step S500 includes:
  • Step S503 When it is determined that there is a worn block in the storage block of the flash memory whose number of erasures is equal to the preset number of times, the first step after the number of erasures of the worn block is equal to the preset number of times is performed. After the erasure operation, calculate the fifth error bit number of the worn block;
  • Step S504 Update the wear table using the fifth error bit number.
  • a storage block whose number of erasures is equal to the preset number of times is called a wear block.
  • the first time the wear block is erased after the number of times is equal to the preset number of times.
  • calculate the average number of error bits generated by each erase operation of the worn block hereinafter referred to as the fifth error bit number for distinction.
  • the fifth error bit number for calculating the fifth error bit number, reference may be made to steps S101 to S104 in the first embodiment, which will not be described in detail here.
  • step S503 before the step of calculating the fifth error bit number of the second storage block in step S503, the step further includes:
  • Step S505 perform data exchange for the worn blocks in each storage block of the flash memory
  • data is exchanged for the worn blocks in each storage block whose erasure times have reached a preset number of times, that is, hot data on the worn blocks is exchanged with cold data on the storage blocks with fewer erasure times. This reduces the number of erases of worn blocks to extend the life of flash memory.
  • the step of calculating the fifth error bit number of the second storage block in step S503 includes:
  • Step S5031 Calculate the fifth error bit number of the worn block after data exchange
  • the fifth error bit number of the worn block after data exchange is calculated.
  • the fifth error bit number is used to replace the error bit number of the corresponding wear block block in the wear table to update the wear table, so that the target storage block can be determined according to the updated wear table and the target storage block can be used for data storage.
  • the number of erasure times of the worn blocks can be reduced to extend the use time of the flash memory.
  • the values in the wear table can be made to conform to the actual usage of the flash memory, so that each storage block in the flash memory can be used evenly.
  • the data storage method of the flash memory of the present application also includes:
  • Step S700 determine the data storage amount of the flash memory
  • the data storage amount of the flash memory is determined, and whether to erase invalid data in the flash memory is determined based on the data storage amount, so that the flash memory can store more useful data and extend the use time of the flash memory.
  • step S500 includes:
  • Step S506 For each storage block, when the data storage amount of the flash memory reaches a preset storage amount threshold, perform the first step on the storage block after the data storage amount reaches the storage amount threshold. After the erasure operation, calculate the sixth error bit number of each second memory block;
  • each calculation is performed.
  • the average number of error bits generated by each erase operation of a memory block hereinafter referred to as the sixth number of error bits for distinction).
  • the sixth number of error bits for distinction.
  • Step S507 Update the wear table using each of the sixth error bit numbers.
  • the sixth error bit number is used to replace the error bit number of the corresponding storage block in the wear table to update the wear table, so that the target storage block can be determined according to the updated wear table and the target storage block can be used for data storage.
  • the values in the wear table can be made to conform to the actual usage of the flash memory, so that each storage block in the flash memory can be used evenly.
  • the wear table is updated for flash memories with different usage conditions, and the target storage block is determined based on the updated wear table to use the target storage block for data storage, so that it can be performed based on the actual usage of the flash memory.
  • Data storage allows each storage block in the flash memory to be used evenly.
  • the present application also provides a data storage device of a flash memory.
  • the data storage device of the flash memory includes:
  • the calculation module 10 is used to calculate the first error bit number and the basic error bit number of each storage block in the initialized flash memory
  • Adding module 20 configured to add the basic error bit number and the first error bit number to a wear table of the flash memory, wherein the wear table includes the number of erasures of each of the storage blocks;
  • the determination module 30 is configured to determine a target storage block in each of the storage blocks according to the wear table, wherein the sum of the second error bit number of the target storage block and the basic error bit number is the wear table The smallest number of error bits is the product of the first error bit number and the number of erasures;
  • the determination module 30 is also configured to store data in the flash memory according to the target storage block.
  • the first number of error bits is the number of error bits present in every 2KB of data on the storage block, and the calculation module 10 is also used to:
  • For each storage block calculate the difference between the basic number of error bits and the third number of error bits, and use the absolute value of the difference divided by the preset number to calculate the number of the storage block.
  • the average number of error bits and use the average number of error bits to calculate the number of error bits per 2KB of data.
  • the data storage device of the flash memory also includes an update module, the update module is used for:
  • the wear table is updated according to each storage block in the flash memory, so as to determine a target storage block in each storage block according to the updated wear table.
  • the data storage device of the flash memory also includes a monitoring module, the monitoring module is used for:
  • the update module is also used to:
  • the wear table is updated using the fourth error bit number.
  • update module is also used to:
  • the first erasure is performed on the worn block after the number of erasures is equal to the preset number of times. After the operation, calculate the fifth error bit number of the worn block;
  • the wear table is updated using the fifth error bit number.
  • update module is also used to:
  • the step of calculating the fifth error bit number of the worn block includes:
  • monitoring module is also used to:
  • the update module is also used to:
  • the storage block For each storage block, when the data storage amount of the flash memory reaches a preset storage amount threshold, the storage block is erased for the first time after the data storage amount reaches the storage amount threshold. After the operation, calculate the sixth error bit number of each storage block;
  • the wear table is updated using each of the sixth error bit numbers.
  • the embodiment of the present application also proposes a computer storage medium.
  • a data storage program of a flash memory is stored on the computer storage medium.
  • the data storage program of the flash memory is executed by a processor, the above-described operation of the flash memory is realized. Steps of data storage method.
  • the methods of the above embodiments can be implemented by means of software plus the necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is better. implementation.
  • the technical solution of the present application can be embodied in the form of a software product in nature or in part that contributes to the existing technology.
  • the computer software product is stored in a computer storage medium (such as ROM/ RAM, magnetic disk, optical disk), includes several instructions to cause a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the method described in each embodiment of the application.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

The present application discloses a data storage method and apparatus for a flash memory, and a terminal device and a storage medium. The data storage method for a flash memory comprises the following steps: calculating the number of first error bits and the number of basic error bits of each storage block in an initialized flash memory; and adding the number of basic error bits and the number of first error bits to a wear table of the flash memory, wherein the wear table comprises the number of erasure times of each storage block.

Description

闪存存储器的数据存储方法、装置、终端设备及存储介质Data storage method, device, terminal equipment and storage medium of flash memory
本申请要求于2022年09月13日申请的、申请号为202211114195.3的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims priority to the Chinese patent application with application number 202211114195.3 filed on September 13, 2022, the entire content of which is incorporated into this application by reference.
技术领域Technical field
本申请涉及存储器技术领域,尤其涉及一种闪存存储器的数据存储方法、装置、终端设备及计算机存储介质。The present application relates to the field of memory technology, and in particular to a data storage method, device, terminal equipment and computer storage medium of a flash memory.
背景技术Background technique
对闪存存储器存储的数据中存在的错误bit可以采用硬解或者软解的方式进行纠错。当闪存存储器存储的数据中错误bit的个数较少时,可以采用硬解进行纠错,但是当闪存存储器存储的数据中错误bit的个数超出一定的数量时,会采用软解进行纠错。软解需要主控配合硬解模块进行多次匹配,因此当闪存存储器中的块所存储的数据中错误bit数量过多时,会导致读取速度变慢。The erroneous bits present in the data stored in the flash memory can be corrected using hard solution or soft solution. When the number of erroneous bits in the data stored in the flash memory is small, a hard solution can be used for error correction. However, when the number of erroneous bits in the data stored in the flash memory exceeds a certain number, a soft solution will be used for error correction. . Soft decryption requires the master control to cooperate with the hard decryption module to perform multiple matches. Therefore, when there are too many erroneous bits in the data stored in the blocks in the flash memory, the reading speed will slow down.
当闪存存储器中的数据需要进行擦除操作时,往往需要对该数据所在块的所有数据进行擦除。每个块的擦除次数是有限,对同一个块进行重复地擦除,会导致该块磨损过度,从而导致该块的数据中错误bit数量增加,同时由于块磨损过度,同样会导致读取速度变慢。When the data in the flash memory needs to be erased, all the data in the block where the data is located often needs to be erased. The number of erases for each block is limited. Repeated erasing of the same block will cause excessive wear of the block, which will lead to an increase in the number of erroneous bits in the data of the block. At the same time, excessive wear of the block will also cause read Slows down.
上述内容仅用于辅助理解本申请的技术方案,并不代表承认上述内容是现有技术。The above content is only used to assist in understanding the technical solutions of the present application, and does not represent an admission that the above content is prior art.
技术问题technical problem
本申请的主要目的在于提供一种闪存存储器的数据存储方法、装置、终端设备及计算机存储介质,旨在解决闪存存储器的块磨损过度以及块上所存储的数据中错误bit数量过多导致读取速度慢的技术问题。The main purpose of this application is to provide a data storage method, device, terminal equipment and computer storage medium for a flash memory, aiming to solve the problem of excessive block wear of the flash memory and excessive number of erroneous bits in the data stored on the blocks resulting in reading Slow technical issues.
技术解决方案Technical solutions
为实现上述目的,本申请提供一种闪存存储器的数据存储方法,所述闪存存储器的数据存储包括以下步骤:To achieve the above objectives, this application provides a data storage method in a flash memory. The data storage in the flash memory includes the following steps:
计算初始化的闪存存储器中各存储块各自的第一错误bit数和基础错误bit数;Calculate the first error bit number and the basic error bit number of each storage block in the initialized flash memory;
将所述基础错误bit数和所述第一错误bit数添加至所述闪存存储器的磨损表,其中,所述磨损表包括各所述存储块各自的擦除次数;Add the basic error bit number and the first error bit number to a wear table of the flash memory, wherein the wear table includes the number of erasures of each of the storage blocks;
根据所述磨损表确定各所述存储块中的目标存储块,其中,所述目标存储块的第二错误bit数与所述基础错误bit数的和为所述磨损表中最小的,所述第二错误bit数为所述第一错误bit数和擦除次数的积;Determine the target storage block in each of the storage blocks according to the wear table, wherein the sum of the second error bit number of the target storage block and the basic error bit number is the smallest in the wear table, and The second number of error bits is the product of the first number of error bits and the number of erasures;
根据所述目标存储块进行闪存存储器的数据存储。Data storage in the flash memory is performed according to the target storage block.
在一实施例中,所述第一错误bit数为所述存储块上每2KB数据中存在的错误bit数,所述计算初始化的闪存存储器中各存储块各自的第一错误bit数的步骤,包括:In one embodiment, the first error bit number is the number of error bits present in every 2KB of data on the storage block, and the step of calculating the first error bit number of each storage block in the initialized flash memory is, include:
擦除初始化的闪存存储器中各所述存储块上的数据并在所述存储块上重新写入数据;Erase the data on each storage block in the initialized flash memory and rewrite the data on the storage block;
分别从各所述存储块中读取重新写入的数据以得到各所述存储块各自的所述基础错误bit数;Read the rewritten data from each storage block respectively to obtain the basic error bit number of each storage block;
在对各个所述存储块重复进行预设数量的擦除操作后,在各个所述存储块上重新写入数据,并分别从各所述存储块中读取重新写入的数据以得到各所述存储块各自的第三错误bit数;After repeating a preset number of erasing operations on each of the storage blocks, data is rewritten on each of the storage blocks, and the rewritten data is read from each of the storage blocks to obtain each of the storage blocks. The third error bit number of each of the above memory blocks;
针对各所述存储块,计算所述基础错误bit数与所述第三错误bit数之间的差值,使用所述差值的绝对值除以所述预设数量计算得到所述存储块的平均错误bit数,并使用所述平均错误bit数计算每2KB数据中的错误bit数。For each storage block, calculate the difference between the basic number of error bits and the third number of error bits, and use the absolute value of the difference divided by the preset number to calculate the number of the storage block. The average number of error bits, and use the average number of error bits to calculate the number of error bits per 2KB of data.
在一实施例中,在所述根据所述目标存储块进行闪存存储器的数据存储的步骤之后,所述闪存存储器的数据存储方法还包括:In one embodiment, after the step of storing data in the flash memory according to the target storage block, the data storage method in the flash memory further includes:
根据所述闪存存储器中各所述存储块针对所述磨损表进行更新,以根据更新后的磨损表确定各所述存储块中的目标存储块。The wear table is updated according to each storage block in the flash memory, so as to determine a target storage block in each storage block according to the updated wear table.
在一实施例中,所述闪存存储器的数据存储方法还包括:In an embodiment, the data storage method of the flash memory further includes:
监测所述闪存存储器的使用时长;Monitor the usage duration of the flash memory;
所述根据所述闪存存储器中各所述存储块针对所述磨损表进行更新的步骤,包括:The step of updating the wear table according to each storage block in the flash memory includes:
针对各所述存储块,当监测到的所述使用时长与预设时长相等时,在对所述存储块进行所述使用时长与所述预设时长相等后的第一次擦除操作后,计算所述存储块的第四错误bit数;For each of the storage blocks, when the monitored usage time is equal to the preset time length, after the first erasure operation is performed on the storage block after the usage time is equal to the preset time length, Calculate the fourth error bit number of the storage block;
使用所述第四错误bit数更新所述磨损表。The wear table is updated using the fourth error bit number.
在一实施例中,所述根据所述闪存存储器中各所述存储块针对所述磨损表进行更新的步骤,包括:In one embodiment, the step of updating the wear table according to each storage block in the flash memory includes:
当确定所述闪存存储器各所述存储块中存在擦除次数与预设次数相等的磨损块时,在对所述磨损块进行擦除次数与所述预设次数相等后的第一次擦除操作后,计算所述磨损块的第五错误bit数;When it is determined that there is a worn block in each storage block of the flash memory whose number of erasures is equal to the preset number of times, the first erasure is performed on the worn block after the number of erasures is equal to the preset number of times. After the operation, calculate the fifth error bit number of the worn block;
使用所述第五错误bit数更新所述磨损表。The wear table is updated using the fifth error bit number.
在一实施例中,所述计算所述磨损块的第五错误bit数的步骤之前,所述闪存存储器的数据存储方法还包括:In one embodiment, before the step of calculating the fifth error bit number of the worn block, the data storage method of the flash memory further includes:
针对所述闪存存储器各所述存储块中的所述磨损块进行数据交换;Exchanging data for the worn blocks in each storage block of the flash memory;
所述计算所述磨损块的第五错误bit数的步骤包括:The step of calculating the fifth error bit number of the worn block includes:
计算进行数据交换后的所述磨损块的所述第五错误bit数。Calculate the fifth error bit number of the worn block after data exchange.
在一实施例中,所述闪存存储器的数据存储方法还包括:In an embodiment, the data storage method of the flash memory further includes:
确定所述闪存存储器的数据存储量;Determine the data storage amount of the flash memory;
所述根据所述闪存存储器中各所述存储块针对所述磨损表进行更新的步骤,包括:The step of updating the wear table according to each storage block in the flash memory includes:
针对各所述存储块,当所述闪存存储器的数据存储量达到预设的存储量阈值时,在对所述存储块进行所述数据存储量达到所述存储量阈值后的第一次擦除操作后,计算各所述存储块的第六错误bit数;For each storage block, when the data storage amount of the flash memory reaches a preset storage amount threshold, the storage block is erased for the first time after the data storage amount reaches the storage amount threshold. After the operation, calculate the sixth error bit number of each storage block;
使用各所述第六错误bit数更新所述磨损表。The wear table is updated using each of the sixth error bit numbers.
为实现上述目的,本申请还提供一种闪存存储器的数据存储装置,所述闪存存储器的数据存储装置包括:In order to achieve the above object, the present application also provides a data storage device of a flash memory. The data storage device of the flash memory includes:
计算模块,用于计算初始化的闪存存储器中各存储块各自的第一错误bit数和基础错误bit数;A calculation module used to calculate the first error bit number and the basic error bit number of each storage block in the initialized flash memory;
添加模块,用于将所述基础错误bit数和所述第一错误bit数添加至所述闪存存储器的磨损表,其中,所述磨损表包括各所述存储块各自的擦除次数;An adding module, configured to add the basic error bit number and the first error bit number to a wear table of the flash memory, wherein the wear table includes the number of erasures of each of the storage blocks;
确定模块,用于根据所述磨损表确定各所述存储块中的目标存储块,其中,所述目标存储块的第二错误bit数与所述基础错误bit数的和为所述磨损表中最小的,所述第二错误bit数为所述第一错误bit数和擦除次数的积;Determining module, configured to determine the target storage block in each of the storage blocks according to the wear table, wherein the sum of the second error bit number of the target storage block and the basic error bit number is At the minimum, the second number of error bits is the product of the first number of error bits and the number of erasures;
所述确定模块,还用于根据所述目标存储块进行闪存存储器的数据存储。The determining module is also configured to store data in the flash memory according to the target storage block.
为实现上述目的,本申请还提供一种终端设备,所述终端设备包括:存储器、处理器及存储在所述存储器上并可在所述处理器上运行的闪存存储器的数据存储程序,所述闪存存储器的数据存储程序被所述处理器执行时实现如上所述的闪存存储器的数据存储方法的步骤。To achieve the above object, the present application also provides a terminal device, which includes: a memory, a processor, and a data storage program of a flash memory stored in the memory and executable on the processor, wherein the When the data storage program of the flash memory is executed by the processor, the steps of the data storage method of the flash memory as described above are implemented.
此外,为实现上述目的,本申请还提出一种计算机存储介质,所述计算机存储介质上存储有闪存存储器的数据存储程序,所述闪存存储器的数据存储程序被处理器执行时实现如上所述的闪存存储器的数据存储方法的步骤。In addition, in order to achieve the above object, the present application also proposes a computer storage medium. A data storage program of a flash memory is stored on the computer storage medium. When the data storage program of the flash memory is executed by a processor, the above mentioned steps are implemented. Steps of data storage method of flash memory.
有益效果beneficial effects
本申请中,通过计算初始化的闪存存储器中各存储块各自的第一错误bit数和基础错误bit数,将基础错误bit数和第一错误bit数添加至闪存存储器的磨损表,其中,磨损表包括各存储块各自的擦除次数,根据磨损表确定各存储块中的目标存储块,其中,目标存储块的第二错误bit数与基础错误bit数的和为磨损表中最小的,第二错误bit数为第一错误bit数和擦除次数的积,根据目标存储块进行闪存存储器的数据存储。如此,本申请实现了每次进行数据存储时使用的存储块为各个存储块中第二错误bit数与基础错误bit数的和最小的块,使得各个存储块被均衡使用,避免了数据存储在部分第一错误bit数与擦除次数过多的存储块上,从而避免了因为存储块的数据中错误bit数过多以及擦除次数过多导致读取速度变慢。In this application, by calculating the first error bit number and the basic error bit number of each storage block in the initialized flash memory, the basic error bit number and the first error bit number are added to the wear table of the flash memory, where the wear table Including the number of erasures of each storage block, the target storage block in each storage block is determined according to the wear table. Among them, the sum of the second error bit number of the target storage block and the basic error bit number is the smallest in the wear table. The number of error bits is the product of the first number of error bits and the number of erases, and data is stored in the flash memory according to the target storage block. In this way, this application realizes that the storage block used each time for data storage is the block with the smallest sum of the second error bit number and the basic error bit number in each storage block, so that each storage block is used evenly and avoids data storage in Part of the memory block has too many first error bits and erase times, thereby avoiding slow reading speed caused by too many error bits and too many erase times in the data of the storage block.
附图说明Description of drawings
图1是本申请实施例方案涉及的硬件运行环境的终端设备的结构示意图;Figure 1 is a schematic structural diagram of a terminal device of the hardware operating environment involved in the embodiment of the present application;
图2为本申请闪存存储器的数据存储方法第一实施例的流程示意图;Figure 2 is a schematic flow chart of the first embodiment of the data storage method of the flash memory of the present application;
图3为本申请闪存存储器的数据存储装置实施例功能模块示意图。FIG. 3 is a schematic diagram of functional modules of a data storage device of a flash memory according to an embodiment of the present application.
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The realization of the purpose, functional features and advantages of the present application will be further described with reference to the embodiments and the accompanying drawings.
本发明的实施方式Embodiments of the invention
应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。It should be understood that the specific embodiments described here are only used to explain the present application and are not used to limit the present application.
如图1所示,图1是本申请实施例方案涉及终端设备的硬件运行环境的结构示意图。As shown in Figure 1, Figure 1 is a schematic structural diagram of the hardware operating environment of the terminal device involved in the solution of the embodiment of the present application.
需要说明的是,图1即可为终端设备的硬件运行环境的结构示意图。该终端设备具体可以是移动终端、数据存储控制终端、PC或者便携计算机等终端。It should be noted that Figure 1 is a schematic structural diagram of the hardware operating environment of the terminal device. Specifically, the terminal device may be a mobile terminal, a data storage control terminal, a PC or a portable computer, or other terminals.
如图1所示,该终端设备可以包括:处理器1001,例如CPU,网络接口1004,用户接口1003,存储器1005,通信总线1002。其中,通信总线1002用于实现这些组件之间的连接通信。用户接口1003可以包括显示屏(Display)、输入单元比如键盘(Keyboard),用户接口1003还可以包括标准的有线接口、无线接口。网络接口1004可以包括标准的有线接口、无线接口(如WI-FI接口)。存储器1005可以是非易失性存储器(如,闪存存储器)、高速RAM存储器,也可以是稳定的存储器(non-volatile memory),例如磁盘存储器。存储器1005还可以是独立于前述处理器1001的存储装置。As shown in Figure 1, the terminal device may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, and a communication bus 1002. Among them, the communication bus 1002 is used to realize connection communication between these components. The user interface 1003 may include a display screen (Display) and an input unit such as a keyboard (Keyboard). The user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may include standard wired interfaces and wireless interfaces (such as WI-FI interfaces). The memory 1005 can be a non-volatile memory (eg, flash memory), a high-speed RAM memory, or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.
本领域技术人员可以理解,图1中示出的终端设备结构并不构成对终端设备的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。Those skilled in the art can understand that the structure of the terminal device shown in Figure 1 does not constitute a limitation on the terminal device, and may include more or fewer components than shown, or combine certain components, or arrange different components.
如图1所示,作为一种计算机存储介质的存储器1005中可以包括通信总线接口、主控芯片、存储颗粒以及闪存存储器的数据存储程序。其中,主控芯片中含有固件程序,用于管理和控制样本终端设备硬件和软件资源。As shown in Figure 1, memory 1005, which is a computer storage medium, may include a communication bus interface, a main control chip, storage particles, and a data storage program of a flash memory. Among them, the main control chip contains firmware programs, which are used to manage and control the hardware and software resources of the sample terminal equipment.
在图1所示的终端设备中,用户接口1003主要用于与各个终端进行数据通信;网络接口1004主要用于连接后台服务器,与后台服务器进行数据通信;而处理器1001可以用于调用存储器1005中存储的闪存存储器的数据存储程序,并执行以下操作:In the terminal device shown in Figure 1, the user interface 1003 is mainly used to communicate data with each terminal; the network interface 1004 is mainly used to connect to the background server and communicate data with the background server; and the processor 1001 can be used to call the memory 1005 Store the data in the flash memory and perform the following operations:
计算初始化的闪存存储器中各存储块各自的第一错误bit数和基础错误bit数;Calculate the first error bit number and the basic error bit number of each storage block in the initialized flash memory;
将所述基础错误bit数和所述第一错误bit数添加至所述闪存存储器的磨损表,其中,所述磨损表包括各所述存储块各自的擦除次数;Add the basic error bit number and the first error bit number to a wear table of the flash memory, wherein the wear table includes the number of erasures of each of the storage blocks;
根据所述磨损表确定各所述存储块中的目标存储块,其中,所述目标存储块的第二错误bit数与所述基础错误bit数的和为所述磨损表中最小的,所述第二错误bit数为所述第一错误bit数和擦除次数的积;Determine the target storage block in each of the storage blocks according to the wear table, wherein the sum of the second error bit number of the target storage block and the basic error bit number is the smallest in the wear table, and The second number of error bits is the product of the first number of error bits and the number of erasures;
根据所述目标存储块进行闪存存储器的数据存储。Data storage in the flash memory is performed according to the target storage block.
进一步地,处理器1001可以调用存储器1005中存储的闪存存储器的数据存储程序,还执行以下操作:Further, the processor 1001 can call the data storage program of the flash memory stored in the memory 1005, and also perform the following operations:
擦除初始化的闪存存储器中各所述存储块上的数据并在所述存储块上重新写入数据;Erase the data on each storage block in the initialized flash memory and rewrite the data on the storage block;
分别从各所述存储块中读取重新写入的数据以得到各所述存储块各自的所述基础错误bit数;Read the rewritten data from each storage block respectively to obtain the basic error bit number of each storage block;
在对各个所述存储块重复进行预设数量的擦除操作后,在各个所述存储块上重新写入数据,并分别从各所述存储块中读取重新写入的数据以得到各所述存储块各自的第三错误bit数;After repeating a preset number of erasing operations on each of the storage blocks, data is rewritten on each of the storage blocks, and the rewritten data is read from each of the storage blocks to obtain each of the storage blocks. The third error bit number of each of the above memory blocks;
针对各所述存储块,计算所述基础错误bit数与所述第三错误bit数之间的差值,使用所述差值的绝对值除以所述预设数量计算得到所述存储块的平均错误bit数,并使用所述平均错误bit数计算每2KB数据中的错误bit数。For each storage block, calculate the difference between the basic number of error bits and the third number of error bits, and use the absolute value of the difference divided by the preset number to calculate the number of the storage block. The average number of error bits, and use the average number of error bits to calculate the number of error bits per 2KB of data.
进一步地,处理器1001可以调用存储器1005中存储的闪存存储器的数据存储程序,还执行以下操作:Further, the processor 1001 can call the data storage program of the flash memory stored in the memory 1005, and also perform the following operations:
根据所述闪存存储器中各所述存储块针对所述磨损表进行更新,以根据更新后的磨损表确定各所述存储块中的目标存储块。The wear table is updated according to each storage block in the flash memory, so as to determine a target storage block in each storage block according to the updated wear table.
进一步地,处理器1001可以调用存储器1005中存储的闪存存储器的数据存储程序,还执行以下操作:Further, the processor 1001 can call the data storage program of the flash memory stored in the memory 1005, and also perform the following operations:
监测所述闪存存储器的使用时长;Monitor the usage duration of the flash memory;
所述根据所述闪存存储器中各所述存储块针对所述磨损表进行更新的操作,包括:The operation of updating the wear table according to each storage block in the flash memory includes:
针对各所述存储块,当监测到的所述使用时长与预设时长相等时,在对所述存储块进行所述使用时长与所述预设时长相等后的第一次擦除操作后,计算所述存储块的第四错误bit数;For each of the storage blocks, when the monitored usage time is equal to the preset time length, after the first erasure operation is performed on the storage block after the usage time is equal to the preset time length, Calculate the fourth error bit number of the storage block;
使用所述第四错误bit数更新所述磨损表。The wear table is updated using the fourth error bit number.
进一步地,处理器1001可以调用存储器1005中存储的闪存存储器的数据存储程序,还执行以下操作:Further, the processor 1001 can call the data storage program of the flash memory stored in the memory 1005, and also perform the following operations:
当确定所述闪存存储器各所述存储块中存在擦除次数与预设次数相等的磨损块时,在对所述磨损块进行擦除次数与所述预设次数相等后的第一次擦除操作后,计算所述磨损块的第五错误bit数;When it is determined that there is a worn block in each storage block of the flash memory whose number of erasures is equal to the preset number of times, the first erasure is performed on the worn block after the number of erasures is equal to the preset number of times. After the operation, calculate the fifth error bit number of the worn block;
使用所述第五错误bit数更新所述磨损表。The wear table is updated using the fifth error bit number.
进一步地,处理器1001可以调用存储器1005中存储的闪存存储器的数据存储程序,还执行以下操作:Further, the processor 1001 can call the data storage program of the flash memory stored in the memory 1005, and also perform the following operations:
针对所述闪存存储器各所述存储块中的所述磨损块进行数据交换;Exchanging data for the worn blocks in each storage block of the flash memory;
所述计算所述磨损块的第五错误bit数的操作包括:The operation of calculating the fifth error bit number of the worn block includes:
计算进行数据交换后的所述磨损块的所述第五错误bit数。Calculate the fifth error bit number of the worn block after data exchange.
进一步地,处理器1001可以调用存储器1005中存储的闪存存储器的数据存储程序,还执行以下操作:Further, the processor 1001 can call the data storage program of the flash memory stored in the memory 1005, and also perform the following operations:
确定所述闪存存储器的数据存储量;Determine the data storage amount of the flash memory;
所述根据所述闪存存储器中各所述存储块针对所述磨损表进行更新的操作,包括:The operation of updating the wear table according to each storage block in the flash memory includes:
针对各所述存储块,当所述闪存存储器的数据存储量达到预设的存储量阈值时,在对所述存储块进行所述数据存储量达到所述存储量阈值后的第一次擦除操作后,计算各所述存储块的第六错误bit数;For each storage block, when the data storage amount of the flash memory reaches a preset storage amount threshold, the storage block is erased for the first time after the data storage amount reaches the storage amount threshold. After the operation, calculate the sixth error bit number of each storage block;
使用各所述第六错误bit数更新所述磨损表。The wear table is updated using each of the sixth error bit numbers.
基于上述的结构,提出本申请闪存存储器的数据存储方法的各个实施例。Based on the above structure, various embodiments of the data storage method of the flash memory of the present application are proposed.
需要说明的是,当闪存存储器中存储的数据出现错误时,可以采用硬解或者软解的方式对闪存存储器存储的数据进行纠错。当闪存存储器存储的数据中错误bit的个数较少时,可以采用硬解进行纠错,但是当闪存存储器存储的数据中错误bit的个数超出一定的数量时,会采用软解进行纠错,软解需要主控配合硬解模块进行多次匹配。闪存存储器以块为单位进行数据的读取操作,因此当闪存存储器中的块所存储的数据中错误bit数量过多时,错误bit数会影响解码速度,主控会需要进行纠错,从而导致该块的读取速度变慢。It should be noted that when an error occurs in the data stored in the flash memory, hard solution or soft solution can be used to correct the error in the data stored in the flash memory. When the number of erroneous bits in the data stored in the flash memory is small, a hard solution can be used for error correction. However, when the number of erroneous bits in the data stored in the flash memory exceeds a certain number, a soft solution will be used for error correction. , soft solution requires the main control to cooperate with the hard solution module for multiple matching. Flash memory reads data in blocks. Therefore, when there are too many erroneous bits in the data stored in blocks in the flash memory, the number of erroneous bits will affect the decoding speed, and the master will need to perform error correction, resulting in the Blocks are read slower.
闪存存储器以块为单位进行数据擦除操作,当闪存存储器中的数据需要进行擦除时,往往需要对该数据所在块的所有数据进行擦除。每个块的擦除次数是有限,对同一个块进行重复地擦除,会导致该块磨损过度,从而导致该块的数据中错误bit数量增加,由于块磨损过度,解码时间变长,导致读取速度同样会变慢。Flash memory performs data erasure operations in blocks. When the data in the flash memory needs to be erased, all data in the block where the data is located often needs to be erased. The number of erases for each block is limited. Repeated erasing of the same block will cause excessive wear of the block, resulting in an increase in the number of erroneous bits in the data of the block. Due to excessive block wear, the decoding time will become longer, resulting in Reading speeds will also be slower.
针对以上现象,本实施例提出一种闪存存储器的数据存储方法,通过计算初始化闪存存储器中各个块(以下称为存储块以示区分)的错误bit数,将错误bit数添加至磨损表中,在选择存储数据的存储块时,根据磨损表中的错误bit数和擦除次数,从各个存储块中选出错误bit数和擦除次数的积最小的存储块用于存储数据,避免了因为存储块的数据中错误bit数过多以及擦除次数过多导致读取数据的速度变慢。以下为方便描述将各个存储块中选出错误bit数和擦除次数的积最小的存储块称为目标存储块。In view of the above phenomenon, this embodiment proposes a data storage method of flash memory. By calculating the number of error bits in each block (hereinafter referred to as storage block for distinction) in the initialized flash memory, the number of error bits is added to the wear table. When selecting the storage block to store data, based on the number of error bits and the number of erasures in the wear table, the storage block with the smallest product of the number of error bits and the number of erasures is selected from each storage block to store the data, avoiding the need for Too many erroneous bits in the data of the storage block and too many erasures cause the speed of reading data to slow down. For the convenience of description below, the storage block selected from each storage block with the smallest product of the number of error bits and the number of erasures is called the target storage block.
请参照图2,图2为本申请一种闪存存储器的数据存储方法第一实施例的流程示意图。需要说明的是,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。本实施例中,所述闪存存储器的数据存储方法包括:Please refer to FIG. 2 , which is a schematic flowchart of a data storage method in a flash memory according to a first embodiment of the present application. It should be noted that although a logical sequence is shown in the flowcharts, in some cases the steps shown or described may be performed in a sequence different from that herein. In this embodiment, the data storage method of the flash memory includes:
步骤S100,计算初始化的闪存存储器中各存储块各自的第一错误bit数和基础错误bit数;Step S100, calculate the first error bit number and the basic error bit number of each memory block in the initialized flash memory;
在本实施例中,分别计算初始化的闪存存储器中各个存储块各自的平均每次擦除操作导致的错误bit数(以下称为第一错误bit数以示区分),以及分别计算初始化的闪存存储器中各个存储块各自存在的错误bit数(以下称为基础出错误bit数以示区分)。在具体实施方式中,存储块的错误bit数可以是该存储块中每2KB数据的错误bit数,也可以是该存储块存满数据时的错误bit数,具体可以根据实际需求进行设置,在此不进行限制。In this embodiment, the average number of error bits (hereinafter referred to as the first number of error bits for distinction) caused by each erase operation of each memory block in the initialized flash memory is calculated, and the initialized flash memory is calculated separately. The number of error bits in each memory block (hereinafter referred to as the basic number of error bits for distinction). In a specific implementation, the number of error bits of a storage block can be the number of error bits per 2KB of data in the storage block, or it can be the number of error bits when the storage block is full of data. It can be set according to actual needs. This is not restricted.
步骤S200,将所述基础错误bit数和所述第一错误bit数添加至所述闪存存储器的磨损表,其中,所述磨损表包括各所述存储块各自的擦除次数;Step S200: Add the basic error bit number and the first error bit number to a wear table of the flash memory, where the wear table includes the number of erasures of each of the storage blocks;
为了延长闪存存储器的使用时间,通常会采用磨损均衡算法以保证闪存存储器中各个存储块的擦除次数均衡,避免由于某一个存储块擦除次数过多导致磨损过度使得闪存存储器的性能下降。闪存存储器的磨损均衡通过构建磨损表,磨损表中记录各个存储块累计的擦除次数,在每次对闪存存储器进行写或擦除操作时,选择磨损表中擦除次数少的存储块进行操作,令每一个存储块能充分利用。In order to prolong the service life of flash memory, a wear leveling algorithm is usually used to ensure that the number of erasures of each storage block in the flash memory is balanced, and to avoid excessive wear and tear due to too many erasures of a certain storage block, which will cause the performance of the flash memory to degrade. The wear leveling of flash memory is achieved by constructing a wear table, which records the cumulative number of erasures of each storage block. Each time a write or erase operation is performed on the flash memory, the storage block with the least number of erasures in the wear table is selected for operation. , so that each storage block can be fully utilized.
本实施例中,将各个存储块对应的第一错误bit数和基础错误bit数添加至磨损表中得到新的磨损表,将添加第一错误bit数和基础错误bit数后的磨损表作为选取用于存储数据的依据。In this embodiment, the first error bit number and the basic error bit number corresponding to each storage block are added to the wear table to obtain a new wear table, and the wear table after adding the first error bit number and the basic error bit number is used as the selection The basis used to store data.
步骤S300,根据所述磨损表确定各所述存储块中的目标存储块,其中,所述目标存储块的第二错误bit数与所述基础错误bit数的和为所述磨损表中最小的,所述第二错误bit数为所述第一错误bit数和擦除次数的积;Step S300: Determine a target storage block in each storage block according to the wear table, wherein the sum of the second error bit number of the target storage block and the basic error bit number is the smallest in the wear table. , the second number of error bits is the product of the first number of error bits and the number of erasures;
本实施例中,计算各个存储块中第一错误bit数和擦除次数的积得到第二错误bit数,可以理解的是,第二错误bit数为存储块擦除操作所产生的错误bit数。In this embodiment, the product of the first number of error bits and the number of erasures in each memory block is calculated to obtain the second number of error bits. It can be understood that the second number of error bits is the number of error bits generated by the erasure operation of the memory block. .
根据磨损表选取各个存储块中第二错误bit数和基础错误bit数的和最小的目标存储块。According to the wear table, select the target storage block with the smallest sum of the second error bit number and the basic error bit number in each storage block.
具体地,在一实施方式中,磨损表中可以预先包含各个存储块各自对应的第二错误bit数和基础错误bit数的和值,在选取目标存储块时直接选取最小和对应的存储块;在另一实施方式中,也可以是在需要存储数据时计算第二错误bit数和基础错误bit数的和值,以选取第二错误bit数和基础错误bit数的和值最小的存储块作为目标存储块。具体可以根据实际情况进行设置,在此不进行限制。Specifically, in one embodiment, the wear table may pre-contain the sum of the second error bit number and the basic error bit number corresponding to each storage block, and the smallest and corresponding storage block is directly selected when selecting the target storage block; In another embodiment, when data needs to be stored, the sum of the second error bit number and the basic error bit number can also be calculated to select the storage block with the smallest sum of the second error bit number and the basic error bit number as the storage block. Target storage block. The specific settings can be set according to the actual situation, and there are no restrictions here.
步骤S400,根据所述目标存储块进行闪存存储器的数据存储。Step S400: Store data in the flash memory according to the target storage block.
当需要在闪存存储器中进行数据存储时,选择目标存储块进行数据存储。When data storage needs to be performed in the flash memory, the target storage block is selected for data storage.
进一步地,在一实施方式中,所述第一错误bit数为所述存储块上每2KB数据中存在的错误bit数,步骤S100包括Further, in one embodiment, the first number of error bits is the number of error bits present in every 2KB of data on the storage block. Step S100 includes
步骤S101,擦除初始化的闪存存储器中各所述存储块上的数据并在所述存储块上重新写入数据;Step S101, erase the data on each storage block in the initialized flash memory and rewrite the data on the storage block;
本实施方式中,对初始化的闪存存储器进行第一错误bit数的计算。初始化闪存存储器中可能预先存入了数据,因此对闪存存储器中各个存储块进行擦除操作以重新存入数据。In this embodiment, the first number of error bits is calculated for the initialized flash memory. Data may be pre-stored in the initialized flash memory, so an erase operation is performed on each storage block in the flash memory to re-store the data.
在各个存储块中重新写入数据,在具体实施方式中,可以是在各个存储块中写入等量的数据,例如各个存储块中都写满数据,也可以是在各个存储块中写入不等量的数据,具体在此不进行限制,可以根据实际需求进行设置。To rewrite data in each storage block, in a specific implementation, the same amount of data can be written in each storage block, for example, each storage block is filled with data, or it can be written in each storage block. There are no restrictions on the different amounts of data and can be set according to actual needs.
步骤S102,分别从各所述存储块中读取重新写入的数据以得到各所述存储块各自的所述基础错误bit数;Step S102: Read the rewritten data from each storage block to obtain the basic error bit number of each storage block;
读取各个存储块中重新写入的数据,根据写入的数据和读取的数据计算得到各个存储块各自数据中的错误bit总数,也即基础错误bit数。Read the rewritten data in each storage block, and calculate the total number of error bits in the respective data of each storage block based on the written data and the read data, that is, the basic number of error bits.
步骤S103,在对各个所述存储块重复进行预设数量的擦除操作后,在各个所述存储块上重新写入数据,并分别从各所述存储块中读取重新写入的数据以得到各所述存储块各自的第三错误bit数;Step S103: After repeating a preset number of erasing operations on each of the storage blocks, rewrite data on each of the storage blocks, and read the rewritten data from each of the storage blocks respectively. Obtain the third error bit number of each of the storage blocks;
计算得到基础错误bit数后,对各个存储块重复进行预设数量的擦除操作。在对各个存储块重复进行预设数量的擦除操作后,在各个存储块上重新写入数据,并分别从各存储块中读取重新写入的数据以得到各存储块各自数据中的错误bit总数(以下称为第三错误bit数以示区分)。After calculating the basic number of error bits, a preset number of erase operations are repeated for each storage block. After repeating a preset number of erase operations on each memory block, rewrite data on each memory block, and read the rewritten data from each memory block to obtain errors in the respective data of each memory block. The total number of bits (hereinafter referred to as the third error bit number for distinction).
在具体实施方式中,预设数量可以根据实际需求进行设置,例如,在一实施方式中,预设数量可以设置为10。In a specific implementation, the preset number can be set according to actual needs. For example, in one implementation, the preset number can be set to 10.
步骤S104,针对各所述存储块,计算所述基础错误bit数与所述第三错误bit数之间的差值,使用所述差值的绝对值除以所述预设数量计算得到所述存储块的平均错误bit数,并使用所述平均错误bit数计算每2KB数据中的错误bit数。Step S104: For each storage block, calculate the difference between the basic number of error bits and the third number of error bits, and use the absolute value of the difference divided by the preset number to calculate the The average number of error bits for a block is stored and used to calculate the number of error bits per 2KB of data.
针对各个存储块,计算基础错误bit数与第三错误bit数之间的差值,使用差值的绝对值除以预设数量计算得到存储块的平均错误bit数。使用平均错误bit数计算每2KB数据中的错误bit数,得到第一错误bit数。For each storage block, calculate the difference between the basic number of error bits and the third number of error bits, and use the absolute value of the difference divided by the preset number to calculate the average number of error bits of the storage block. Use the average number of error bits to calculate the number of error bits in every 2KB data and obtain the first number of error bits.
本实施例中,通过计算初始化的闪存存储器中各存储块各自的第一错误bit数和基础错误bit数,将基础错误bit数和第一错误bit数添加至闪存存储器的磨损表,其中,磨损表包括各存储块各自的擦除次数,根据磨损表确定各存储块中的目标存储块,其中,目标存储块的第二错误bit数与基础错误bit数的和为磨损表中最小的,第二错误bit数为第一错误bit数和擦除次数的积,根据目标存储块进行闪存存储器的数据存储。实现了每次进行数据存储时使用的存储块为各个存储块中第二错误bit数与基础错误bit数的和最小的块,使得各个存储块被均衡使用,避免了数据存储在部分第一错误bit数与擦除次数过多的存储块上,避免了因为存储块的数据中错误bit数过多以及擦除次数过多导致读取速度变慢。In this embodiment, by calculating the first error bit number and the basic error bit number of each storage block in the initialized flash memory, the basic error bit number and the first error bit number are added to the wear table of the flash memory, where the wear The table includes the number of erasures of each storage block. The target storage block in each storage block is determined according to the wear table. The sum of the second error bit number and the basic error bit number of the target storage block is the smallest in the wear table. The second error bit number is the product of the first error bit number and the number of erases, and the data in the flash memory is stored according to the target storage block. It is realized that the storage block used for each data storage is the block with the smallest sum of the second error bit number and the basic error bit number in each storage block, so that each storage block is used evenly and avoids the data storage in some of the first errors. On a memory block with too many bits and erase times, it avoids slowing down the reading speed due to too many erroneous bits and too many erasures in the data of the memory block.
进一步地,基于上述第一实施例,提出本申请闪存存储器的数据存储方法的第二实施例。Furthermore, based on the above first embodiment, a second embodiment of the data storage method of the flash memory of the present application is proposed.
在本实施例中,在上述的步骤S400之后,本申请闪存存储器的数据存储方法还包括:In this embodiment, after the above step S400, the data storage method of the flash memory of the present application also includes:
步骤S500,根据所述闪存存储器中各所述存储块针对所述磨损表进行更新,以根据更新后的磨损表确定各所述存储块中的目标存储块。Step S500: Update the wear table according to each storage block in the flash memory to determine a target storage block in each storage block according to the updated wear table.
受到闪存存储器的使用时间、存储数据量以及闪存存储器本身的性能等各方面的因素的影响,当闪存存储器中存入数据后,闪存存储器中各个存储块中的第一错误bit数相比于初始化的闪存存储器会发生一定的变化。Affected by various factors such as the usage time of the flash memory, the amount of stored data, and the performance of the flash memory itself, when data is stored in the flash memory, the number of first error bits in each storage block in the flash memory is compared with the initialization The flash memory will undergo certain changes.
本实施例中,通过对磨损表进行更新,根据更新后的磨损表确定目标存储块以使用该目标存储块进行数据存储,从而使得可以根据闪存存储器的实际使用情况进行数据存储,使得闪存存储器中的各个存储块可以被均衡使用。In this embodiment, by updating the wear table, the target storage block is determined according to the updated wear table and the target storage block is used for data storage, so that data can be stored according to the actual usage of the flash memory, so that the flash memory can Each storage block can be used evenly.
进一步地,在一实施方式中,本申请闪存存储器的数据存储方法还包括:Further, in one embodiment, the data storage method of the flash memory of the present application also includes:
步骤S600,监测所述闪存存储器的使用时长;Step S600, monitor the usage time of the flash memory;
本实施方式中,检测闪存存储器的使用时长,根据闪存存储器的使用时长确认是否更新磨损表。In this embodiment, the usage time of the flash memory is detected, and whether to update the wear table is confirmed based on the usage time of the flash memory.
本实施方式中,步骤S500包括:In this implementation, step S500 includes:
步骤S501,针对各所述存储块,当监测到的所述使用时长与预设时长相等时,在对所述存储块进行所述使用时长与所述预设时长相等后的第一次擦除操作后,计算所述存储块的第四错误bit数;Step S501: For each storage block, when the monitored usage duration is equal to the preset duration, perform the first erasure on the storage block after the usage duration is equal to the preset duration. After the operation, calculate the fourth error bit number of the storage block;
步骤S502,使用所述第四错误bit数更新所述磨损表。Step S502: Use the fourth number of error bits to update the wear table.
本实施方式中,针对各个存储块,当监测到闪存存储器的使用时长与预设时长相等时,在对存储块进行使用时长与预设时长相等后的第一次擦除操作后,计算存储块平均每次擦除操作产生的错误bit数(以下称为第四错误bit数以示区分)。具体地,计算第四错误bit数可以参照第一实施例中步骤S101~S104,在此不做赘述。In this embodiment, for each storage block, when it is detected that the usage time of the flash memory is equal to the preset time length, after the first erase operation is performed on the storage block after the usage time is equal to the preset time length, the storage block is calculated. The average number of error bits generated by each erase operation (hereinafter referred to as the fourth number of error bits for distinction). Specifically, for calculating the fourth error bit number, reference may be made to steps S101 to S104 in the first embodiment, which will not be described in detail here.
得到第四错误bit数后,使用第四错误bit数替换各自对应的存储块在磨损表中的错误bit数以更新磨损表,从而可以根据更新后的磨损表确定目标存储块以使用该目标存储块进行数据存储。After obtaining the fourth error bit number, use the fourth error bit number to replace the error bit number of the corresponding storage block in the wear table to update the wear table, so that the target storage block can be determined based on the updated wear table to use the target storage Blocks are used for data storage.
具体地,在一实施方式中,预设时长的数量可以是一个,也即只对磨损表进行一次更新;在另一实施方式中,预设时长的数量也可以是多个,也即每隔一定的时间间隔对磨损表进行更新,具体可以根据实际需求进行设置,在此不进行限制。Specifically, in one embodiment, the number of preset durations may be one, that is, the wear table is updated only once; in another embodiment, the number of preset durations may also be multiple, that is, every time the wear table is updated, the number of preset durations may be multiple. The wear table is updated at a certain time interval, which can be set according to actual needs and is not limited here.
需要说明的是,通过对一定使用时长的闪存存储器计算各存储块的第四错误bit数以更新磨损表,可以减少计算次数,从而保证运行性能。It should be noted that by calculating the fourth error bit number of each storage block for a flash memory with a certain usage time to update the wear table, the number of calculations can be reduced, thereby ensuring the operating performance.
进一步地,在一实施方式中,步骤S500包括:Further, in one implementation, step S500 includes:
步骤S503,当确定所述闪存存储器个所述存储块中存在擦除次数与预设次数相等的磨损块时,在对所述磨损块进行擦除次数与所述预设次数相等后的第一次擦除操作后,计算所述磨损块的第五错误bit数;Step S503: When it is determined that there is a worn block in the storage block of the flash memory whose number of erasures is equal to the preset number of times, the first step after the number of erasures of the worn block is equal to the preset number of times is performed. After the erasure operation, calculate the fifth error bit number of the worn block;
步骤S504,使用所述第五错误bit数更新所述磨损表。Step S504: Update the wear table using the fifth error bit number.
本实施方式中,将擦除次数与预设次数相等的存储块称为磨损块,当确定闪存存储器中存在磨损块时,在对磨损块进行擦除次数与预设次数相等后的第一次擦除操作后,计算磨损块平均每次擦除操作产生的错误bit数(以下称为第五错误bit数以示区分)。具体地,计算第五错误bit数可以参照第一实施例中步骤S101~S104,在此不做赘述。In this embodiment, a storage block whose number of erasures is equal to the preset number of times is called a wear block. When it is determined that a wear block exists in the flash memory, the first time the wear block is erased after the number of times is equal to the preset number of times. After the erase operation, calculate the average number of error bits generated by each erase operation of the worn block (hereinafter referred to as the fifth error bit number for distinction). Specifically, for calculating the fifth error bit number, reference may be made to steps S101 to S104 in the first embodiment, which will not be described in detail here.
得到第五错误bit数后,使用第五错误bit数替换各自对应的磨损块块在磨损表中的错误bit数以更新磨损表,从而可以根据更新后的磨损表确定目标存储块以使用该目标存储块进行数据存储。After obtaining the fifth error bit number, use the fifth error bit number to replace the error bit number of the corresponding wear block in the wear table to update the wear table, so that the target storage block can be determined based on the updated wear table to use the target. Memory blocks are used for data storage.
需要说明的是,通过对闪存存储器中的磨损块的计算第五错误bit数以更新磨损表,可以减少计算次数,从而保证运行性能。It should be noted that by calculating the fifth error bit number of the worn blocks in the flash memory to update the wear table, the number of calculations can be reduced, thereby ensuring operating performance.
进一步地,在一实施方式中,所述步骤S503中计算所述第二存储块的第五错误bit数的步骤之前,还包括:Further, in one embodiment, before the step of calculating the fifth error bit number of the second storage block in step S503, the step further includes:
步骤S505,针对所述闪存存储器各所述存储块中的所述磨损块进行数据交换;Step S505, perform data exchange for the worn blocks in each storage block of the flash memory;
当存储块的擦除次数多时,可以确定该存储块上的数据经常被更新,将擦除次数多的存储块上的数据称为热数据,将擦除次数少的存储块中的数据称为冷数据以示区分。When a storage block has been erased a large number of times, it can be determined that the data on the storage block is frequently updated. The data on a storage block with a large number of erasures is called hot data, and the data in a storage block with a small number of erasures is called hot data. Cold data is used to distinguish.
本实施方式中,针对各存储块中擦除次数达到预设次数的磨损块进行数据交换,也即将磨损块上的热数据与擦除次数少的存储块上的冷数据进行交换。从而减少磨损块的擦除次数以延长闪存存储器的使用时间。In this embodiment, data is exchanged for the worn blocks in each storage block whose erasure times have reached a preset number of times, that is, hot data on the worn blocks is exchanged with cold data on the storage blocks with fewer erasure times. This reduces the number of erases of worn blocks to extend the life of flash memory.
所述步骤S503中计算所述第二存储块的第五错误bit数的步骤包括:The step of calculating the fifth error bit number of the second storage block in step S503 includes:
步骤S5031,计算进行数据交换后的所述磨损块的所述第五错误bit数;Step S5031: Calculate the fifth error bit number of the worn block after data exchange;
进行数据交换后,计算进行数据交换后的磨损块的第五错误bit数。以使用第五错误bit数替换各自对应的磨损块块在磨损表中的错误bit数,以更新磨损表,从而可以根据更新后的磨损表确定目标存储块以使用该目标存储块进行数据存储。After data exchange, the fifth error bit number of the worn block after data exchange is calculated. The fifth error bit number is used to replace the error bit number of the corresponding wear block block in the wear table to update the wear table, so that the target storage block can be determined according to the updated wear table and the target storage block can be used for data storage.
需要说明的是,通过针对各存储块中擦除次数达到预设次数的磨损块进行数据交换,可以减少磨损块的擦除次数以延长闪存存储器的使用时间。It should be noted that by exchanging data for the worn blocks whose erasure times reach a preset number of times in each storage block, the number of erasure times of the worn blocks can be reduced to extend the use time of the flash memory.
通过使用数据交换后的磨损块的第五错误bit数更新磨损表,可以使得磨损表中的数值符合闪存存储器的实际使用情况,使得闪存存储器中的各个存储块可以被均衡使用。By updating the wear table using the fifth error bit number of the wear block after data exchange, the values in the wear table can be made to conform to the actual usage of the flash memory, so that each storage block in the flash memory can be used evenly.
进一步地,在一实施方式中,本申请闪存存储器的数据存储方法还包括:Further, in one embodiment, the data storage method of the flash memory of the present application also includes:
步骤S700,确定所述闪存存储器的数据存储量;Step S700, determine the data storage amount of the flash memory;
本实施方式中,确定闪存存储器的数据存储量,根据数据存储量确定是否对闪存存储器中的无效数据进行擦除,使得闪存存储器可以存储更多有用的数据,延长闪存存储器的使用时间。In this embodiment, the data storage amount of the flash memory is determined, and whether to erase invalid data in the flash memory is determined based on the data storage amount, so that the flash memory can store more useful data and extend the use time of the flash memory.
本实施方式中,步骤S500包括:In this implementation, step S500 includes:
步骤S506,针对各所述存储块,当所述闪存存储器的数据存储量达到预设的存储量阈值时,在对所述存储块进行所述数据存储量达到所述存储量阈值后的第一次擦除操作后,计算各所述第二存储块的第六错误bit数;Step S506: For each storage block, when the data storage amount of the flash memory reaches a preset storage amount threshold, perform the first step on the storage block after the data storage amount reaches the storage amount threshold. After the erasure operation, calculate the sixth error bit number of each second memory block;
本实施方式中,针对各存储块,当闪存存储器的数据存储量达到预设的存储量阈值时,在对存储块进行数据存储量达到存储量阈值后的第一次擦除操作后,计算各存储块平均每次擦除操作产生的错误bit数(以下称为第六错误bit数以示区分)。具体地,计算第六错误bit数可以参照第一实施例中步骤S101~S104,在此不做赘述。In this embodiment, for each storage block, when the data storage amount of the flash memory reaches the preset storage amount threshold, after the first erase operation is performed on the storage block after the data storage amount reaches the storage amount threshold, each calculation is performed. The average number of error bits generated by each erase operation of a memory block (hereinafter referred to as the sixth number of error bits for distinction). Specifically, for calculating the sixth error bit number, reference may be made to steps S101 to S104 in the first embodiment, which will not be described again.
步骤S507,使用各所述第六错误bit数更新所述磨损表。Step S507: Update the wear table using each of the sixth error bit numbers.
使用第六错误bit数替换各自对应的存储块在磨损表中的错误bit数,以更新磨损表,从而可以根据更新后的磨损表确定目标存储块以使用该目标存储块进行数据存储。The sixth error bit number is used to replace the error bit number of the corresponding storage block in the wear table to update the wear table, so that the target storage block can be determined according to the updated wear table and the target storage block can be used for data storage.
需要说明的是,通过使用第六错误bit数更新磨损表,可以使得磨损表中的数值符合闪存存储器的实际使用情况,使得闪存存储器中的各个存储块可以被均衡使用。It should be noted that by updating the wear table using the sixth error bit number, the values in the wear table can be made to conform to the actual usage of the flash memory, so that each storage block in the flash memory can be used evenly.
本实施例中,通过对不同使用情况的闪存存储器进行磨损表的更新,根据更新后的磨损表确定目标存储块以使用该目标存储块进行数据存储,从而使得可以根据闪存存储器的实际使用情况进行数据存储,使得闪存存储器中的各个存储块可以被均衡使用。In this embodiment, the wear table is updated for flash memories with different usage conditions, and the target storage block is determined based on the updated wear table to use the target storage block for data storage, so that it can be performed based on the actual usage of the flash memory. Data storage allows each storage block in the flash memory to be used evenly.
本申请还提供一种闪存存储器的数据存储装置,参照图3,所述闪存存储器的数据存储装置包括:The present application also provides a data storage device of a flash memory. Referring to Figure 3, the data storage device of the flash memory includes:
计算模块10,用于计算初始化的闪存存储器中各存储块各自的第一错误bit数和基础错误bit数;The calculation module 10 is used to calculate the first error bit number and the basic error bit number of each storage block in the initialized flash memory;
添加模块20,用于将所述基础错误bit数和所述第一错误bit数添加至所述闪存存储器的磨损表,其中,所述磨损表包括各所述存储块各自的擦除次数;Adding module 20, configured to add the basic error bit number and the first error bit number to a wear table of the flash memory, wherein the wear table includes the number of erasures of each of the storage blocks;
确定模块30,用于根据所述磨损表确定各所述存储块中的目标存储块,其中,所述目标存储块的第二错误bit数与所述基础错误bit数的和为所述磨损表中最小的,所述第二错误bit数为所述第一错误bit数和擦除次数的积;The determination module 30 is configured to determine a target storage block in each of the storage blocks according to the wear table, wherein the sum of the second error bit number of the target storage block and the basic error bit number is the wear table The smallest number of error bits is the product of the first error bit number and the number of erasures;
所述确定模块30,还用于根据所述目标存储块进行闪存存储器的数据存储。The determination module 30 is also configured to store data in the flash memory according to the target storage block.
进一步地,所述第一错误bit数为所述存储块上每2KB数据中存在的错误bit数,所述计算模块10还用于:Further, the first number of error bits is the number of error bits present in every 2KB of data on the storage block, and the calculation module 10 is also used to:
擦除初始化的闪存存储器中各所述存储块上的数据并在所述存储块上重新写入数据;Erase the data on each storage block in the initialized flash memory and rewrite the data on the storage block;
分别从各所述存储块中读取重新写入的数据以得到各所述存储块各自的所述基础错误bit数;Read the rewritten data from each storage block respectively to obtain the basic error bit number of each storage block;
在对各个所述存储块重复进行预设数量的擦除操作后,在各个所述存储块上重新写入数据,并分别从各所述存储块中读取重新写入的数据以得到各所述存储块各自的第三错误bit数;After repeating a preset number of erasing operations on each of the storage blocks, data is rewritten on each of the storage blocks, and the rewritten data is read from each of the storage blocks to obtain each of the storage blocks. The third error bit number of each of the above memory blocks;
针对各所述存储块,计算所述基础错误bit数与所述第三错误bit数之间的差值,使用所述差值的绝对值除以所述预设数量计算得到所述存储块的平均错误bit数,并使用所述平均错误bit数计算每2KB数据中的错误bit数。For each storage block, calculate the difference between the basic number of error bits and the third number of error bits, and use the absolute value of the difference divided by the preset number to calculate the number of the storage block. The average number of error bits, and use the average number of error bits to calculate the number of error bits per 2KB of data.
进一步地,所述闪存存储器的数据存储装置还包括更新模块,所述更新模块用于:Further, the data storage device of the flash memory also includes an update module, the update module is used for:
根据所述闪存存储器中各所述存储块针对所述磨损表进行更新,以根据更新后的磨损表确定各所述存储块中的目标存储块。The wear table is updated according to each storage block in the flash memory, so as to determine a target storage block in each storage block according to the updated wear table.
进一步地,所述闪存存储器的数据存储装置还包括监测模块,所述监测模块用于:Further, the data storage device of the flash memory also includes a monitoring module, the monitoring module is used for:
监测所述闪存存储器的使用时长;Monitor the usage duration of the flash memory;
所述更新模块还用于:The update module is also used to:
针对各所述存储块,当监测到的所述使用时长与预设时长相等时,在对所述存储块进行所述使用时长与所述预设时长相等后的第一次擦除操作后,计算所述存储块的第四错误bit数;For each of the storage blocks, when the monitored usage time is equal to the preset time length, after the first erasure operation is performed on the storage block after the usage time is equal to the preset time length, Calculate the fourth error bit number of the storage block;
使用所述第四错误bit数更新所述磨损表。The wear table is updated using the fourth error bit number.
进一步地,所述更新模块还用于:Further, the update module is also used to:
当确定所述闪存存储器各所述存储块中存在擦除次数与预设次数相等的磨损块时,在对所述磨损块进行擦除次数与所述预设次数相等后的第一次擦除操作后,计算所述磨损块的第五错误bit数;When it is determined that there is a worn block in each storage block of the flash memory whose number of erasures is equal to the preset number of times, the first erasure is performed on the worn block after the number of erasures is equal to the preset number of times. After the operation, calculate the fifth error bit number of the worn block;
使用所述第五错误bit数更新所述磨损表。The wear table is updated using the fifth error bit number.
进一步地,所述更新模块还用于:Further, the update module is also used to:
针对所述闪存存储器各所述存储块中的所述磨损块进行数据交换;Exchanging data for the worn blocks in each storage block of the flash memory;
所述计算所述磨损块的第五错误bit数的步骤包括:The step of calculating the fifth error bit number of the worn block includes:
计算进行数据交换后的所述磨损块的所述第五错误bit数。Calculate the fifth error bit number of the worn block after data exchange.
进一步地,所述监测模块还用于:Furthermore, the monitoring module is also used to:
确定所述闪存存储器的数据存储量;Determine the data storage amount of the flash memory;
所述更新模块还用于:The update module is also used to:
针对各所述存储块,当所述闪存存储器的数据存储量达到预设的存储量阈值时,在对所述存储块进行所述数据存储量达到所述存储量阈值后的第一次擦除操作后,计算各所述存储块的第六错误bit数;For each storage block, when the data storage amount of the flash memory reaches a preset storage amount threshold, the storage block is erased for the first time after the data storage amount reaches the storage amount threshold. After the operation, calculate the sixth error bit number of each storage block;
使用各所述第六错误bit数更新所述磨损表。The wear table is updated using each of the sixth error bit numbers.
本申请闪存存储器的数据存储装置的各实施例,均可参照本申请闪存存储器的数据存储方法各实施例,此处不再赘述。For each embodiment of the data storage device of the flash memory of the present application, reference can be made to the various embodiments of the data storage method of the flash memory of the present application, and will not be described again here.
此外,本申请实施例还提出一种计算机存储介质,所述计算机存储介质上存储有闪存存储器的数据存储程序,所述闪存存储器的数据存储程序被处理器执行时实现如上所述的闪存存储器的数据存储方法的步骤。In addition, the embodiment of the present application also proposes a computer storage medium. A data storage program of a flash memory is stored on the computer storage medium. When the data storage program of the flash memory is executed by a processor, the above-described operation of the flash memory is realized. Steps of data storage method.
本申请计算机存储介质的各实施例,均可参照本申请闪存存储器的数据存储方法各实施例,此处不再赘述。For each embodiment of the computer storage medium of the present application, reference may be made to the various embodiments of the data storage method of the flash memory of the present application, which will not be described again here.
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者系统不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者系统所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者系统中还存在另外的相同要素。It should be noted that, as used herein, the terms "include", "comprising" or any other variation thereof are intended to cover a non-exclusive inclusion, such that a process, method, article or system that includes a list of elements not only includes those elements, but It also includes other elements not expressly listed or that are inherent to the process, method, article or system. Without further limitation, an element defined by the statement "comprises a..." does not exclude the presence of additional identical elements in the process, method, article, or system that includes that element.
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。The above serial numbers of the embodiments of the present application are only for description and do not represent the advantages or disadvantages of the embodiments.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在如上所述的一个计算机存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本申请各实施例所述的方法。Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus the necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is better. implementation. Based on this understanding, the technical solution of the present application can be embodied in the form of a software product in nature or in part that contributes to the existing technology. The computer software product is stored in a computer storage medium (such as ROM/ RAM, magnetic disk, optical disk), includes several instructions to cause a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the method described in each embodiment of the application.
以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the description and drawings of the present application may be directly or indirectly used in other related technical fields. , are all equally included in the scope of patent protection of this application.

Claims (10)

  1. 一种闪存存储器的数据存储方法,其中,所述闪存存储器的数据存储方法包括以下步骤:A data storage method of flash memory, wherein the data storage method of flash memory includes the following steps:
    计算初始化的闪存存储器中各存储块各自的第一错误bit数和基础错误bit数;Calculate the first error bit number and the basic error bit number of each storage block in the initialized flash memory;
    将所述基础错误bit数和所述第一错误bit数添加至所述闪存存储器的磨损表,其中,所述磨损表包括各所述存储块各自的擦除次数;Add the basic error bit number and the first error bit number to a wear table of the flash memory, wherein the wear table includes the number of erasures of each of the storage blocks;
    根据所述磨损表确定各所述存储块中的目标存储块,其中,所述目标存储块的第二错误bit数与所述基础错误bit数的和为所述磨损表中最小的,所述第二错误bit数为所述第一错误bit数和擦除次数的积;Determine the target storage block in each of the storage blocks according to the wear table, wherein the sum of the second error bit number of the target storage block and the basic error bit number is the smallest in the wear table, and The second number of error bits is the product of the first number of error bits and the number of erasures;
    根据所述目标存储块进行闪存存储器的数据存储。Data storage in the flash memory is performed according to the target storage block.
  2. 如权利要求1所述的闪存存储器的数据存储方法,其中,所述第一错误bit数为所述存储块上每2KB数据中存在的错误bit数,所述计算初始化的闪存存储器中各存储块各自的第一错误bit数和基础错误bit数的步骤,包括:The data storage method of a flash memory as claimed in claim 1, wherein the first number of error bits is the number of error bits present in every 2KB of data on the storage block, and the calculation initialization of each storage block in the flash memory is The steps for the respective first error bit number and basic error bit number include:
    擦除初始化的闪存存储器中各所述存储块上的数据并在所述存储块上重新写入数据;Erase the data on each storage block in the initialized flash memory and rewrite the data on the storage block;
    分别从各所述存储块中读取重新写入的数据以得到各所述存储块各自的所述基础错误bit数;Read the rewritten data from each storage block respectively to obtain the basic error bit number of each storage block;
    在对各个所述存储块重复进行预设数量的擦除操作后,在各个所述存储块上重新写入数据,并分别从各所述存储块中读取重新写入的数据以得到各所述存储块各自的第三错误bit数;After repeating a preset number of erasing operations on each of the storage blocks, data is rewritten on each of the storage blocks, and the rewritten data is read from each of the storage blocks to obtain each of the storage blocks. The third error bit number of each of the above memory blocks;
    针对各所述存储块,计算所述基础错误bit数与所述第三错误bit数之间的差值,使用所述差值的绝对值除以所述预设数量计算得到所述存储块的平均错误bit数,并使用所述平均错误bit数计算每2KB数据中的错误bit数。For each storage block, calculate the difference between the basic number of error bits and the third number of error bits, and use the absolute value of the difference divided by the preset number to calculate the number of the storage block. The average number of error bits, and use the average number of error bits to calculate the number of error bits per 2KB of data.
  3. 如权利要求1所述的闪存存储器的数据存储方法,其中,在所述根据所述目标存储块进行闪存存储器的数据存储的步骤之后,所述闪存存储器的数据存储方法还包括:The data storage method of a flash memory as claimed in claim 1, wherein after the step of storing data in the flash memory according to the target storage block, the data storage method of the flash memory further includes:
    根据所述闪存存储器中各所述存储块针对所述磨损表进行更新,以根据更新后的磨损表确定各所述存储块中的目标存储块。The wear table is updated according to each storage block in the flash memory, so as to determine a target storage block in each storage block according to the updated wear table.
  4. 如权利要求3所述的闪存存储器的数据存储方法,其中,所述闪存存储器的数据存储方法还包括:The data storage method of flash memory as claimed in claim 3, wherein the data storage method of flash memory further includes:
    监测所述闪存存储器的使用时长;Monitor the usage duration of the flash memory;
    所述根据所述闪存存储器中各所述存储块针对所述磨损表进行更新的步骤,包括:The step of updating the wear table according to each storage block in the flash memory includes:
    针对各所述存储块,当监测到的所述使用时长与预设时长相等时,在对所述存储块进行所述使用时长与所述预设时长相等后的第一次擦除操作后,计算所述存储块的第四错误bit数;For each of the storage blocks, when the monitored usage time is equal to the preset time, after performing the first erasing operation on the storage block after the usage time is equal to the preset time, calculating the fourth number of error bits of the storage block;
    使用所述第四错误bit数更新所述磨损表。The wear table is updated using the fourth error bit number.
  5. 如权利要求3所述的闪存存储器的数据存储方法,其中,所述根据所述闪存存储器中各所述存储块针对所述磨损表进行更新的步骤,包括:The data storage method of a flash memory as claimed in claim 3, wherein the step of updating the wear table according to each storage block in the flash memory includes:
    当确定所述闪存存储器各所述存储块中存在擦除次数与预设次数相等的磨损块时,在对所述磨损块进行擦除次数与所述预设次数相等后的第一次擦除操作后,计算所述磨损块的第五错误bit数;When it is determined that there is a worn block in each storage block of the flash memory whose number of erasures is equal to the preset number of times, the first erasure is performed on the worn block after the number of erasures is equal to the preset number of times. After the operation, calculate the fifth error bit number of the worn block;
    使用所述第五错误bit数更新所述磨损表。The wear table is updated using the fifth error bit number.
  6. 如权利要求5所述的闪存存储器的数据存储方法,其中,所述计算所述磨损块的第五错误bit数的步骤之前,所述闪存存储器的数据存储方法还包括:The data storage method of flash memory as claimed in claim 5, wherein before the step of calculating the fifth error bit number of the worn block, the data storage method of flash memory further includes:
    针对所述闪存存储器各所述存储块中的所述磨损块进行数据交换;Exchanging data for the worn blocks in each storage block of the flash memory;
    所述计算所述磨损块的第五错误bit数的步骤包括:The step of calculating the fifth error bit number of the worn block includes:
    计算进行数据交换后的所述磨损块的所述第五错误bit数。Calculate the fifth error bit number of the worn block after data exchange.
  7. 如权利要求3所述的闪存存储器的数据存储方法,其中,所述闪存存储器的数据存储方法还包括:The data storage method of flash memory as claimed in claim 3, wherein the data storage method of flash memory further includes:
    确定所述闪存存储器的数据存储量;Determine the data storage amount of the flash memory;
    所述根据所述闪存存储器中各所述存储块针对所述磨损表进行更新的步骤,包括:The step of updating the wear table according to each storage block in the flash memory includes:
    针对各所述存储块,当所述闪存存储器的数据存储量达到预设的存储量阈值时,在对所述存储块进行所述数据存储量达到所述存储量阈值后的第一次擦除操作后,计算各所述存储块的第六错误bit数;For each storage block, when the data storage amount of the flash memory reaches a preset storage amount threshold, the storage block is erased for the first time after the data storage amount reaches the storage amount threshold. After the operation, calculate the sixth error bit number of each storage block;
    使用各所述第六错误bit数更新所述磨损表。The wear table is updated using each of the sixth error bit numbers.
  8. 一种闪存存储器的数据存储装置,其中,所述闪存存储器的数据存储装置包括:A data storage device of a flash memory, wherein the data storage device of the flash memory includes:
    计算模块,用于计算初始化的闪存存储器中各存储块各自的第一错误bit数和基础错误bit数;The calculation module is used to calculate the first error bit number and the basic error bit number of each storage block in the initialized flash memory;
    添加模块,用于将所述基础错误bit数和所述第一错误bit数添加至所述闪存存储器的磨损表,其中,所述磨损表包括各所述存储块各自的擦除次数;An adding module, configured to add the basic error bit number and the first error bit number to a wear table of the flash memory, wherein the wear table includes the number of erasures of each of the storage blocks;
    确定模块,用于根据所述磨损表确定各所述存储块中的目标存储块,其中,所述目标存储块的第二错误bit数与所述基础错误bit数的和为所述磨损表中最小的,所述第二错误bit数为所述第一错误bit数和擦除次数的积;Determining module, configured to determine the target storage block in each of the storage blocks according to the wear table, wherein the sum of the second error bit number of the target storage block and the basic error bit number is At the minimum, the second number of error bits is the product of the first number of error bits and the number of erasures;
    所述确定模块,还用于根据所述目标存储块进行闪存存储器的数据存储。The determining module is also configured to store data in the flash memory according to the target storage block.
  9. 一种终端设备,其中,所述终端设备包括:存储器、处理器及存储在所述存储器上并可在所述处理器上运行的闪存存储器的数据存储程序,所述闪存存储器的数据存储程序被所述处理器执行时实现如权利要求1至7中任一项所述的闪存存储器的数据存储方法的步骤。A terminal device, wherein the terminal device includes: a memory, a processor, and a data storage program of a flash memory stored on the memory and operable on the processor, and the data storage program of the flash memory is When the processor executes the steps, the data storage method of the flash memory according to any one of claims 1 to 7 is implemented.
  10. 一种计算机存储介质,其中,所述计算机存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现如权利要求1至7中任一项所述的闪存存储器的数据存储方法的步骤。A computer storage medium, wherein a computer program is stored on the computer storage medium, and when the computer program is executed by a processor, the steps of the data storage method of the flash memory according to any one of claims 1 to 7 are implemented. .
PCT/CN2023/093322 2022-09-13 2023-05-10 Data storage method and apparatus for flash memory, and terminal device and storage medium WO2024055612A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202211114195.3A CN115543189A (en) 2022-09-13 2022-09-13 Data storage method and device of flash memory, terminal equipment and storage medium
CN202211114195.3 2022-09-13

Publications (1)

Publication Number Publication Date
WO2024055612A1 true WO2024055612A1 (en) 2024-03-21

Family

ID=84727718

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/093322 WO2024055612A1 (en) 2022-09-13 2023-05-10 Data storage method and apparatus for flash memory, and terminal device and storage medium

Country Status (2)

Country Link
CN (1) CN115543189A (en)
WO (1) WO2024055612A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115543189A (en) * 2022-09-13 2022-12-30 深圳市硅格半导体有限公司 Data storage method and device of flash memory, terminal equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090172255A1 (en) * 2007-12-31 2009-07-02 Phison Electronics Corp. Wear leveling method and controller using the same
CN104360957A (en) * 2014-11-26 2015-02-18 上海爱信诺航芯电子科技有限公司 Method for maintaining flash memory wear leveling
CN111078123A (en) * 2018-10-19 2020-04-28 浙江宇视科技有限公司 Method and device for evaluating wear degree of flash memory block
CN112256193A (en) * 2020-09-16 2021-01-22 浙江大华存储科技有限公司 Method, device and storage medium for improving data security of solid state disk
CN115543189A (en) * 2022-09-13 2022-12-30 深圳市硅格半导体有限公司 Data storage method and device of flash memory, terminal equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090172255A1 (en) * 2007-12-31 2009-07-02 Phison Electronics Corp. Wear leveling method and controller using the same
CN104360957A (en) * 2014-11-26 2015-02-18 上海爱信诺航芯电子科技有限公司 Method for maintaining flash memory wear leveling
CN111078123A (en) * 2018-10-19 2020-04-28 浙江宇视科技有限公司 Method and device for evaluating wear degree of flash memory block
CN112256193A (en) * 2020-09-16 2021-01-22 浙江大华存储科技有限公司 Method, device and storage medium for improving data security of solid state disk
CN115543189A (en) * 2022-09-13 2022-12-30 深圳市硅格半导体有限公司 Data storage method and device of flash memory, terminal equipment and storage medium

Also Published As

Publication number Publication date
CN115543189A (en) 2022-12-30

Similar Documents

Publication Publication Date Title
US9520992B2 (en) Logical-to-physical address translation for a removable data storage device
US7962807B2 (en) Semiconductor storage apparatus managing system, semiconductor storage apparatus, host apparatus, program and method of managing semiconductor storage apparatus
US10698762B2 (en) Data reading method and storage controller
US10509570B2 (en) Method, device, and program for managing a flash memory for mass storage
US10310739B2 (en) Memory management method, memory control circuit unit and memory storage device
US10303371B2 (en) Data storage device that stabilizes write latency
US8407408B2 (en) Static wear leveling
US7925822B2 (en) Erase count recovery
WO2024055612A1 (en) Data storage method and apparatus for flash memory, and terminal device and storage medium
US9721669B2 (en) Data protection method, memory control circuit unit and memory storage apparatus
JP2005242897A (en) Flash disk drive
TW201730741A (en) Data storage device and operating method thereof
WO2010028585A1 (en) Method for improving usable lifespan of flash memory
TWI748410B (en) Method and apparatus for performing block management regarding non-volatile memory
TWI653632B (en) Memory management method, memory control circuit unit and memory storage device
CN110083496B (en) Power-down time estimation method and device of nonvolatile storage device
US8225051B2 (en) Access control method for a memory, memory controller for controlling access to the memory, and data processing apparatus
JP2006164354A (en) Counter device and counting method
KR20200140074A (en) Volatile memory device and operating method thereof
TWI841281B (en) Voltage prediction method, memory storage device and memory control circuit unit
CN113626347B (en) Storage device and working method thereof
TWI852352B (en) Valid node management method, memory storage device and memory control circuit unit
TWI851329B (en) Device control method, memory storage device and memory control circuit unit
JP5787095B2 (en) Method for storing data in non-volatile memory
US20230359357A1 (en) Write control method based on write behavior prediction, memory storage device, and memory control circuit unit

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23864351

Country of ref document: EP

Kind code of ref document: A1