CN104102459A - Flash memory device and data processing method thereof - Google Patents

Flash memory device and data processing method thereof Download PDF

Info

Publication number
CN104102459A
CN104102459A CN 201410315842 CN201410315842A CN104102459A CN 104102459 A CN104102459 A CN 104102459A CN 201410315842 CN201410315842 CN 201410315842 CN 201410315842 A CN201410315842 A CN 201410315842A CN 104102459 A CN104102459 A CN 104102459A
Authority
CN
Grant status
Application
Patent type
Prior art keywords
flash memory
memory device
queue
block
data
Prior art date
Application number
CN 201410315842
Other languages
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

Links

Abstract

The invention discloses a flash memory device and a data processing method thereof. The method includes presetting a wear redundancy value, namely the maximum value of difference of numbers of erasing times of different blocks of the flash memory device, of the blocks in the flash memory device to be N; establishing erasing counting tables EC(X) containing N+1 elements, setting a subscript value X to range from 0 to N, and arraying the N+1 elements from small to large according to the subscript value X; dividing all available blocks in the flash memory device into N+1 queues according to erasing counting values, adding the queues composed of the blocks with the erasing counting values to be zero into the EC (0), and allowing the queues contained by elements EC (1) to EC (N) to be empty; when writing the data, determining the minimum queue to be the one with the minimum erasing counting value but not empty in the erasing counting tables, and writing the data into the blocks of the minimum queue. The device and method has the advantages that wear balance of the blocks can be realized during data writing and deleting, and the purpose of prolonging service life can be achieved.

Description

一种闪存设备的数据处理方法及闪存设备 A flash memory device and data processing method of a flash memory device

技术领域 FIELD

[0001] 本发明涉及通信领域中闪存技术领域,具体地,涉及一种闪存设备的数据处理方法及闪存设备。 [0001] The present invention relates to flash memory technology in the field of communications, in particular, to a data processing method of a flash memory device and a flash memory device.

背景技术 Background technique

[0002] 闪存设备是一种可擦除、可重写的电子非易失性存储介质,它已被广泛用于数据存储系统中。 [0002] The flash memory device is an erasable, rewritable nonvolatile electronic storage media, it has been widely used in data storage system. 由于闪存设备断电时仍能保存数据,其通常用来保存预设信息,如电脑的BIOS (基本程序)、PDA (个人数字助理)、数码相机中保存资料等,闪存是一种比硬盘驱动器更好的存储方案,这在不超过4GB的低容量应用中表现得犹为明显。 Because flash memory devices can still save the data when power is off, which is usually used to save the preset information, such as the computer's BIOS (basic program), PDA (personal digital assistants), digital cameras and other data stored in flash memory than a hard disk drive better storage solution, which is evident in the performance was still no more than 4GB of low-volume applications.

[0003] 闪存设备以块(Block)为单位进行擦写操作,闪存的写入操作必须在空白区域进行,如果目标区域已经有数据,必须先擦除后写入,因此擦除操作是闪存设备的基本操作。 [0003] Flash memory devices, flash memory write operations must be performed on a block (Block) made to erase units in the blank area, if the target area has the data must be written after the first erasing, the erase operation is a flash memory device therefore the basic operation. 闪存具有编程速度快、擦除时间短、无噪音、散热小等优点。 Flash memory has a fast programming speed and erase time is short, noise, heat dissipation is small.

[0004] 在现有技术中,对闪存设备进行数据写入和擦除时,存在以下问题:擦除次数有限,一个典型的闪存可以被可靠的擦除最多100000 (SLC,Single Layer Cell,单层单元)和3000 (MLC,Multi-Level Cell,多层单元)次;现有技术中不能对闪存设备的块进行有效管理,导致闪存设备中所有块的擦写次数不均衡,降低了闪存设备的使用寿命。 When [0004] In the prior art, a flash memory device for data writing and erasing, the following problem: a limited number of erase, a typical flash memory can be erased reliably up to 100000 (SLC, Single Layer Cell, single layer units) and 3000 (MLC, Multi-Level cell, MLC) times; the prior art can not block effectively manage the flash memory device, flash memory devices leads to number of erasure of all blocks is not balanced, reducing the flash memory device life.

发明内容 SUMMARY

[0005]为了解决现有技术中存在的闪存设备内部块擦除次数不均衡导致的使用寿命较低的问题,本发明提出了一种闪存设备的数据处理方法及闪存设备。 [0005] In order to solve the prior art flash memory device internal blocks present in the life of a lower number of erase problems caused by unbalanced, the present invention provides a data processing method and apparatus for a flash memory of a flash memory device.

[0006] 本发明的闪存设备的数据处理方法,包括: [0006] The data processing method according to the present invention, a flash memory device, comprising:

[0007] 预设闪存设备中块的磨损冗余度的值为N,所述磨损冗余度N为允许闪存设备中不同块的擦除次数相差的最大值; [0007] Default wear block flash memory device redundancy is N, the difference between the maximum wear N redundancy to allow different number of erase blocks in a flash memory device;

[0008] 创建包含N+1个元素的擦除计数表EC (X),将下标值X分别设为0到N,将所述N+1 个元素按照所述下标值X从小到大依次排列; [0008] Creating a N + 1 elements of the erase count table EC (X), the index value X are set to 0 to N, the value of N + 1 elements according to the ascending subscript X in order of priority;

[0009] 根据擦除计数值将所述闪存设备中所有可用空块划分为N+1个队列,将擦除计数值为〇的块组成的队列加入EC(0)中,元素EC⑴到EC(N)包含的队列为空; [0009] The erase count values ​​of all the available space in the flash memory device is divided into blocks of N + 1 queue, the erase count values ​​of the square blocks of added queue EC (0), the element EC⑴ to EC ( N) contained in the queue is empty;

[0010] 当写入数据时,确定所述擦除计数表中擦除计数值最小且不为空的队列为最小队列,将数据写入所述最小队列的块中。 [0010] When writing data, determining the erase count table the minimum erase count value of the queue is not empty queue minimum, the minimum of the block of data is written in the queue.

[0011] 本发明的闪存设备的数据处理方法,利用磨损冗余度,可以控制闪存中块的擦除次数相差的最大值。 [0011] The data processing method of a flash memory device according to the present invention, by using the redundancy of wear, can control the maximum number of erase blocks in the flash memory of the phase difference. 通过设定磨损冗余度的值,可在写入和删除数据时实现块的磨损平衡。 By setting the value of the redundancy abrasion, wear leveling may be implemented in the block writing and deleting data. 磨损冗余度可以根据产品不同的用途来设定,值越小,磨损越均衡,从而使闪存设备中所有块的擦除次数均衡,以达到提高使用寿命的目的。 Wear redundancy according to different uses of the product is set, the smaller the value, the more balanced wear, so that the number of erase blocks in a flash memory device, all balanced, in order to achieve the purpose of improving the service life.

[0012] 本发明的闪存设备,包括: [0012] The flash memory device of the present invention, comprising:

[0013] 冗余度预设模块,用于预设闪存设备中块的磨损冗余度的值为N,所述磨损冗余度N为允许闪存设备中不同块的擦除次数相差的最大值; [0013] Redundant presetting module configured to preset value N redundancy wear blocks in the flash memory device, the redundancy flash memory device wear N maximum erasure count of the block to allow the phase difference ;

[0014] 计数表创建模块,用于创建包含N+1个元素的擦除计数表EC(X),将下标值X分别设为0到N,将所述N+1个元素按照所述下标值X从小到大依次排列; [0014] count table creation module for creating EC erase count table (X) comprising N + 1 elements, the index value X are set to 0 to N, the N + 1 th element in accordance with the X index values ​​are arranged in ascending order;

[0015] 队列划分模块,用于根据擦除计数值将所述闪存设备中所有可用空块划分为N+1 个队列,将擦除计数值为〇的块组成的队列加入EC(0)中,元素EC(1)到EC(N)包含的队列为空; [0015] dividing module queue, the queue according to the erase count values ​​of all the available space in the flash memory device is divided into blocks of N + 1 queue, the square value of the erase count block, is added to EC (0) in element EC (1) to EC (N) contained in the queue is empty;

[0016] 数据写入模块,用于当写入数据时,确定所述擦除计数表中擦除计数值最小且不为空的队列为最小队列,将数据写入所述最小队列的块中。 [0016] The data writing means for writing data, when determining that the erase count table the minimum erase count value of the queue is not empty queue minimum, the minimum of the block of data is written in the queue .

[0017] 本发明的闪存设备,利用磨损冗余度,可以控制闪存中块的擦除次数相差的最大值。 [0017] The flash memory device of the present invention, by using the redundancy of wear, can control the maximum number of erase blocks in the flash memory of the phase difference. 通过设定磨损冗余度的值,可在写入和删除数据时实现块的磨损平衡。 By setting the value of the redundancy abrasion, wear leveling may be implemented in the block writing and deleting data. 磨损冗余度可以根据产品不同的用途来设定,值越小,磨损越均衡,从而使闪存设备中所有块的擦除次数均衡,以达到提高使用寿命的目的。 Wear redundancy according to different uses of the product is set, the smaller the value, the more balanced wear, so that the number of erase blocks in a flash memory device, all balanced, in order to achieve the purpose of improving the service life.

[0018] 本发明的其它特征和优点将在随后的说明书中阐述,并且,部分地从说明书中变得显而易见,或者通过实施本发明而了解。 [0018] Other features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or learned by practice of the present invention. 本发明的目的和其他优点可通过在所写的说明书、权利要求书、以及附图中所特别指出的结构来实现和获得。 The objectives and other advantages of the invention may be realized and attained by the written description, claims, and drawings structure particularly pointed out.

[0019] 下面通过附图和实施例,对本发明的技术方案做进一步的详细描述。 [0019] The following drawings and embodiments, detailed description of the further aspect of the present invention.

附图说明 BRIEF DESCRIPTION

[0020] 附图用来提供对本发明的进一步理解,并且构成说明书的一部分,与本发明的实施例一起用于解释本发明,并不构成对本发明的限制。 [0020] The accompanying drawings provide a further understanding of the present invention, and constitute part of this specification, the embodiments of the invention, serve to explain the invention, not to limit the present invention. 在附图中: In the drawings:

[0021] 图1为本发明的方法流程图; [0021] FIG. 1 is a flowchart of a method of the present invention;

[0022] 图2为本发明实施例的擦除计数表的结构示意图; [0022] FIG. 2 is a schematic configuration table according to the erase count of the embodiment of the present invention;

[0023] 图3为本发明实施例的擦除计数表中队列结构示意图; [0023] Fig 3 a schematic view of the embodiment example of the queue structure erase count table of the present invention;

[0024] 图4为本发明实施例的块移动的示意图; [0024] FIG. 4 is a schematic block moves to an embodiment of the present invention;

[0025] 图5为本发明实施例的队列移动的示意图; [0025] FIG. 5 is a schematic embodiment of the queue moves embodiment of the invention;

[0026] 图6为本发明的闪存设备的结构示意图; Structure of a flash memory device [0026] FIG. 6 is a schematic view of the present disclosure;

[0027] 图7为本发明的擦除计数表中队列结构示意图。 [0027] FIG. 7 is a schematic diagram erase count table queue structure of the invention.

具体实施方式 detailed description

[0028] 下面结合附图,对本发明的具体实施方式进行详细描述,但应当理解本发明的保护范围并不受具体实施方式的限制。 [0028] below with the accompanying drawings, specific embodiments of the present invention will be described in detail, it should be understood that the scope of the present invention is not limited to the specific embodiments.

[0029] 为了解决现有技术中存在的闪存设备内部块擦除次数不均衡导致的使用寿命较低的问题,本发明提出了一种闪存设备的数据处理方法及闪存设备。 [0029] In order to solve the prior art flash memory device internal blocks present in the life of a lower number of erase problems caused by unbalanced, the present invention provides a data processing method and apparatus for a flash memory of a flash memory device.

[0030] 对于闪存设备写操作比较多的应用,可以对每个块(block)进行监测,从而使每个block的擦写次数比较平均,避免出现有的block擦写次数过多,而有的block擦写次数过少,进而提高闪存设备的寿命。 [0030] For a write operation of the flash memory device are more applications may be made to each block (block) monitoring, so that each block of erasing times more evenly, some block avoid excessive endurance, and some erase block number is too small, thereby increasing the life of the flash memory device. 本发明主要是针对闪存设备中的空block,动态调整闪存设备中不同块的擦除磨损。 The present invention is directed to a flash memory device empty block, dynamically adjusting the erase flash memory device, the wear of the different blocks. 下面的例子可以说明写平衡是如何提高闪存设备的寿命的: The following examples illustrate how to write balance is to improve the life of the flash memory device:

[0031] 假设一个MLC闪存中有4096个block,要写一个占用100个block大小的文件,每10分钟更新一次,写在同一个位置。 [0031] Suppose a MLC flash memory in block 4096, block 100 to write a file occupies size, updated every 10 minutes, written in the same position.

[0032] 没有写平衡方法时,闪存的生命周期是: [0032] when there is no write-balancing method, a flash of the life cycle are:

[0033] 生命周期(天)=(NAND闪存尺寸*擦除次数八每天写入block数量) [0033] Life Cycle (days) = (NAND flash memory sizes * Erase block number eight the number of writes per day)

[0034] 那么生命周期是:(100个block*3, 000次擦除)八100个block*6次/小时*24小时/天)=20. 83天 [0034] So life cycle: (100 block * 3, 000 erase) eight 100 block * 6 times / hour * 24 hours / day) = 2083 days.

[0035] 有写平衡方法时,擦除的次数可以平均的分配到每一个block上,假设有1000个块可以参与写平衡,那么新的生命周期是: [0035] The balancing method is write, erase times can be evenly distributed to each Block, assuming there are 1000 write leveling block can participate, then the new life cycle:

[0036] (1000个block*3, 000次擦除V(100个block*6次/小时*24小时/天)=200. 83 天。 [0036] (1000 block * 3, 000 erase V (100 th block * 6 times / hour * 24 hours / day) = 200.83 days.

[0037] 如图1所示,本发明的闪存设备数据处理方法包括: [0037] As shown in FIG. 1, a flash memory device for data processing method according to the present invention comprises:

[0038] 步骤S101 :初始化所述闪存设备,将所述闪存设备中所有空块的擦除计数值清零。 [0038] Step S101: initializing the flash memory device, the erase count value is cleared all empty blocks in the flash memory device.

[0039] 闪存设备初始化之后,所有可用空块的擦除计数值均为0,擦除计数值为对块进行擦除操作的次数。 After the [0039] initialization of flash memory devices, erase count values ​​of all available empty blocks are 0, the block erase count value of the number of erase operations.

[0040] 步骤S102 :预设闪存设备中块的磨损冗余度的值为N ; [0040] the step S102: the preset value N redundancy wear blocks in the flash memory device;

[0041] 磨损冗余度是指允许闪存设备中不同块的擦除次数值相差的最大值,具体的,N的值由闪存设备的用途以及主控、使用环境决定。 [0041] Wear redundancy refers to the maximum allowed times of erasing a flash memory device blocks of different values ​​of phase difference, the specific value of N by the use of a flash memory device and the host, the use of environmental determinants.

[0042] 步骤S103 :创建包含N+1个元素的擦除计数表EC(X),将下标值X分别设为0到N, 将所述N+1个元素按照所述下标值X从小到大依次排列; [0042] Step S103: Create EC erase count table (X) comprising N + 1 elements, the index value X are set to 0 to N, the N + 1 th element in accordance with said index value X arranged in order from small to large;

[0043] 具体的,如图2所示,该擦除计数表包含EC(0)、EC(1)……EC (N)等N+1个元素,将该表中各元素按照上述顺序依次从小到大排列。 [0043] Specifically, as shown, the erase count table contains EC (0) 2, EC (1) ...... EC (N) and the like of N + 1 elements, each element in the table sequentially in this order ascending order.

[0044] 步骤S104 :根据擦除计数值将所述闪存设备中所有可用空块划分为N+1个队列, 将擦除计数值为〇的块组成的队列加入EC(0)中,元素EC(1)到EC(N)包含的队列为空; [0044] Step S104: The count value of the erase flash memory device, all available empty block is divided into N + 1 queue, the erase count of blocks is square EC added queue (0), the element EC (1) to EC (N) contained in the queue is empty;

[0045] 具体的,如图7所示,为擦除计数表中每个队列的结构示意图。 [0045] Specifically, as shown in Figure 7, a schematic structural diagram of an erase count of each queue table. 每个队列包含闪存中的若干物理块,每一个块都有寄存器来记录块的擦除次数,在同一队列中,所有块的擦除计数值是相同的。 Each queue contains a plurality of flash memory physical blocks, each block has a register to record the number of erase blocks, in the same queue, the erase count values ​​of all blocks are identical. 如图3所示,在本实施例中,闪存设备初始化后,所有空块的擦除计数值均清零,因此,将所有空块组成一个队列加入元素EC(0)中,其余元素EC(1)到EC(N)的队列为空。 3, in the present embodiment, after the initialization of the flash memory device, all the empty block erase count values ​​are cleared, and therefore, all the blocks empty queue element added EC (0), the remaining elements EC ( 1) to EC (N) in the queue is empty.

[0046] 步骤S105 :当写入数据时,确定所述擦除计数表中擦除计数值最小且不为空的队列为最小队列,将数据写入所述最小队列的块中; [0046] Step S105: When writing data, determining the erase count table the minimum erase count value of the queue is not empty queue minimum, the minimum of the block of data is written in the queue;

[0047] 具体的,将数据写入闪存设备时,可以设置一个取块指针,用于指向擦除计数值最小且不为空的队列;采用先进先出的原则,从擦除计数表中选择擦除计数值最小且不为空的队列,将数据写入该队列的块中。 [0047] Specifically, when writing data to the flash memory device, may be provided to take a block pointer, for pointing to the minimum erase count value of the queue is not empty; FIFO principle employed, selected from the erase count table the minimum erase count value of the queue not empty, the data is written in blocks in the queue. 在本实施例中,闪存设备初始化之后,EC(0)中队列的块的擦除计数值最小,且EC(0)包含的队列不为空,取块指针指向的队列即为EC(0)中的队列,即将数据写入EC(0)中队列的块。 In the present embodiment, after initializing the flash memory device, EC (0) erase count block the minimum value of the queue, and the EC (0) contained in the queue is not empty, the pointer to the block fetch queue is the EC (0) in the queue, i.e. the data written EC (0) block queue.

[0048] 步骤S106 :当删除数据时,将被删除数据所在块的擦除计数值加1,并将所述被删除数据所在块移到下一队列中; [0048] Step S106: When the data is deleted, the deleted data erased block where the count value is incremented by 1, and the deletion block where the data is moved to the next queue;

[0049] 具体的,块中的数据被删除时,块会重新释放出来,块的擦除计数值加1,将该块的新的擦除计数值与擦除计数表中的各元素的下标值进行比较,将该块加入到下一队列,即与新的擦除计数值相应的队列中。 [0049] Specifically, the data block is deleted, the block is released again, the block erase count value is incremented by 1 at each new element erase count value of the block erase count in the table standard value, next the block is added to the queue, i.e. the new erase count value corresponding queue. 如图4所示,当元素EC(0)中的块block-OXz的数据被删除后,将该块的擦除计数值加1,并将该块移到EC(1)的队列中。 4, when the EC element blocks of block-OXz (0) of the data is deleted, erased block is added to the count value 1, the block moves and EC (1) queue.

[0050] 步骤S107 :当所述最小队列中的块全部移出时,将所述最小队列所在的元素移到所述擦除计数表的末端,重新确定最小队列; [0050] Step S107: When the minimum queue block out all the elements of the queue is located onto said smallest erase count table end, re-determining a minimum queue;

[0051] 具体的,当最小队列中的最后一个块被移出时,将该队列所在的元素的下标值修改为N+1,并将该元素移到擦除计数表的末端,如图5所示,在本实施例中,当初始化之后, 最小队列为元素EC(0)的队列,当EC(0)的最后一个块被移出时,将EC(0)修改为EC(N+1), 并移到擦除计数表的末端,此时擦除计数表中的元素变为EC (1)、EC (2)……EC (N+1)等N+1 个元素,取块指针指向EC(1)中的队列,如果EC(1)为空,将EC(1)移到擦除计数表的末端, 依次类推。 [0051] Specifically, when the last block is the smallest out of the queue, the queue is located the element values ​​of the index modified to N + 1, and the end of the element and to the erase count table, as shown in FIG 5 , in the present embodiment, after the initialization, the queue is a minimum element EC (0) of the queue, when the EC (0) of the last block is removed, the EC (0) modified to EC (N + 1) and moved to the end of the erase count table, the erased table element count becomes EC (1), EC (2) ...... EC (N + 1) of N + 1 elements and the like, take a pointer to the block EC queue (1), if the EC (1) is empty, EC (1) move the end of the erase count table, and so on.

[0052] 再次进行数据写入时,重新选择擦除计数值最小且不为空的队列,循环执行上述步骤S101-S106,即可实现闪存设备的擦除磨损均衡。 When the [0052] data is written again, re-select a minimum erase count value of the queue not empty, loop perform the above steps S101-S106, wear leveling can be achieved erase flash memory device.

[0053] 本发明的闪存设备的数据处理方法,利用磨损冗余度,可以控制闪存中块的擦除次数相差的最大值。 [0053] The data processing method of a flash memory device according to the present invention, by using the redundancy of wear, can control the maximum number of erase blocks in the flash memory of the phase difference. 通过设定磨损冗余度的值,可在写入和删除数据时实现块的磨损平衡。 By setting the value of the redundancy abrasion, wear leveling may be implemented in the block writing and deleting data. 磨损冗余度可以根据产品不同的用途来设定,值越小,磨损越均衡,从而使闪存设备中所有块的擦除次数均衡,以达到提高使用寿命的目的。 Wear redundancy according to different uses of the product is set, the smaller the value, the more balanced wear, so that the number of erase blocks in a flash memory device, all balanced, in order to achieve the purpose of improving the service life.

[0054] 如图6所示,本发明的闪存设备包括: [0054], the flash memory device according to the present invention in FIG. 6 comprises:

[0055] 初始化模块,用于初始化所述闪存设备,将所述闪存设备中所有空块的擦除计数值清零。 [0055] The initialization module for initializing the flash memory device, the erase count values ​​of all the empty blocks of the flash memory device is cleared.

[0056] 冗余度预设模块10,用于预设闪存设备中块的磨损冗余度的值为N,所述磨损冗余度N为允许闪存设备中不同块的擦除次数相差的最大值; Maximum [0056] Redundant presetting module 10, a preset wear redundancy flash device block is N, the wear N redundancy to allow the erasure count difference block flash memory device value;

[0057] 计数表创建模块20,用于创建包含N+1个元素的擦除计数表EC (X),将下标值X分别设为〇到N,将所述N+1个元素按照所述下标值X从小到大依次排列; [0057] 20 counter table creation module for creating EC erase count table (X) comprising N + 1 elements, the index value X are set square to N, the N + 1 th element in accordance with the said index values ​​X successively arranged from small to large;

[0058] 队列划分模块30,用于根据擦除计数值将所述闪存设备中所有可用空块划分为N+1个队列,将擦除计数值为0的块组成的队列加入EC(0)中,元素EC(1)到EC(N)包含的队列为空; [0058] division module 30 queues, a queue according to the erase count values ​​of all the available space in the flash memory device is divided into blocks of N + 1 queue, the erase count block is composed of added EC 0 (0) , the element EC (1) to EC (N) contained in the queue is empty;

[0059] 数据写入模块40,用于当写入数据时,确定所述擦除计数表中擦除计数值最小且不为空的队列为最小队列,将数据写入所述最小队列的块中。 [0059] The data write module 40, when data is written for determining the erase count table minimum erase count value is not a minimum queue is empty queue, the write data block of the minimum queue in.

[0060] 数据删除模块50,用于当删除数据时,将被删除数据所在块的擦除计数值加1,并将所述被删除数据所在块移到下一队列中。 [0060] Data deleting module 50, configured to, when deleting data, the data is deleted erased block where the count value is incremented by 1, and the deletion block where the data is moved to the next queue.

[0061] 队列下沉模块60,用于当所述最小队列中的块全部移出时,将所述最小队列所在的元素移到所述擦除计数表的末端,重新确定最小队列。 [0061] queue sink module 60, configured to, when said minimum queue block out all the elements of the queue where the minimum to move the end of the erase count table to redefine the minimum queue.

[0062] 本发明的闪存设备,利用磨损冗余度,可以控制闪存中块的擦除次数相差的最大值。 [0062] The flash memory device of the present invention, by using the redundancy of wear, can control the maximum number of erase blocks in the flash memory of the phase difference. 通过设定磨损冗余度的值,可在写入和删除数据时实现块的磨损平衡。 By setting the value of the redundancy abrasion, wear leveling may be implemented in the block writing and deleting data. 磨损冗余度可以根据产品不同的用途来设定,值越小,磨损越均衡,从而使闪存设备中所有块的擦除次数均衡,以达到提高使用寿命的目的。 Wear redundancy according to different uses of the product is set, the smaller the value, the more balanced wear, so that the number of erase blocks in a flash memory device, all balanced, in order to achieve the purpose of improving the service life.

[0063] 本发明能有多种不同形式的具体实施方式,上面以图1-图6为例结合附图对本发明的技术方案作举例说明,这并不意味着本发明所应用的具体实例只能局限在特定的流程或实施例结构中,本领域的普通技术人员应当了解,上文所提供的具体实施方案只是多种优选用法中的一些示例,任何体现本发明权利要求的实施方式均应在本发明技术方案所要求保护的范围之内。 [0063] The present invention is capable of embodiment in many different forms of the specific embodiments above as an example to Figures 1-6 in conjunction with the accompanying drawings aspect of the present invention will be illustrated, this does not mean the specific examples of the present invention is applied only can be limited to specific processes or structures embodiments, those of ordinary skill in the art will be appreciated, the specific embodiments provided above are only examples of various preferred usage, embody the claimed invention in any embodiment should be aspect of the present invention within the scope of the claims.

[0064] 最后应说明的是:以上所述仅为本发明的优选实施例而已,并不用于限制本发明, 尽管参照前述实施例对本发明进行了详细的说明,对于本领域的技术人员来说,其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换。 [0064] Finally, it should be noted that: the above embodiments are only preferred embodiments of the present invention, but the present invention is not intended to limit the present invention. Although the detailed description of the embodiments, those skilled in the art that aspect, each of which can still be described embodiments of the foregoing embodiment may be modified, or some technical features equivalents. 凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。 Any modification within the spirit and principle of the present invention, made, equivalent substitutions, improvements, etc., should be included within the scope of the present invention.

Claims (8)

  1. 1. 一种闪存设备的数据处理方法,其特征在于,包括: 预设闪存设备中块的磨损冗余度的值为N,所述磨损冗余度N为允许闪存设备中不同块的擦除次数相差的最大值; 创建包含N+1个元素的擦除计数表EC (X),将下标值X分别设为0到N,将所述N+1个元素按照所述下标值X从小到大依次排列; 根据擦除计数值将所述闪存设备中所有可用空块划分为N+1个队列,将擦除计数值为〇的块组成的队列加入EC(O)中,元素EC(1)到EC(N)包含的队列为空; 当写入数据时,确定所述擦除计数表中擦除计数值最小且不为空的队列为最小队列, 将数据写入所述最小队列的块中。 1. A data processing method of a flash memory device, characterized by comprising: a flash memory device in a predetermined wear block redundancy is N, said N redundancy to allow wear of the flash memory device of the erasure block the maximum number of times the phase difference; EC created erase count table (X) comprising N + 1 elements, the index value X are set to 0 to N, the N + 1 th element in accordance with said index value X arranged in order from small to large; added EC (O), the element EC according to the erasure count value N + 1 is divided into the queue, the erase count values ​​of the square blocks of the flash memory device is available queue empty block (1) to EC (N) contained in the queue is empty; when data is written, the erase count table is determined to erase the minimum count value of the queue is not empty queues is minimized, to write data to the minimum block queue.
  2. 2. 根据权利要求1所述的闪存设备的数据处理方法,其特征在于,在所述预设闪存设备中块的磨损冗余度的值为N之前还包括: 初始化所述闪存设备,将所述闪存设备中所有空块的擦除计数值清零。 The data processing method of a flash memory device according to claim 1, wherein prior to said predetermined degree of wear in the block redundancy is N flash memory device further comprising: initializing the flash memory device, The All empty block erase count values ​​of said flash memory device is cleared.
  3. 3. 根据权利要求1所述的闪存设备的数据处理方法,其特征在于,还包括: 当删除数据时,将被删除数据所在块的擦除计数值加1,并将所述被删除数据所在块移到下一队列中。 The data processing method of a flash memory device according to claim 1, characterized in that, further comprising: when data is deleted, is deleted erased count value where a data, where the data is deleted and the block moves to the next queue.
  4. 4. 根据权利要求1所述的闪存设备的数据处理方法,其特征在于,还包括: 当所述最小队列中的块全部移出时,将所述最小队列所在的元素移到所述擦除计数表的末端,重新确定最小队列。 The data processing method of the flash memory device as claimed in claim 1, characterized in that, further comprising: when said minimum queue block out all the elements of the queue is located is moved to the minimum erase count end of the table, to determine the minimum queue again.
  5. 5. -种闪存设备,其特征在于,包括: 冗余度预设模块,用于预设闪存设备中块的磨损冗余度的值为N,所述磨损冗余度N为允许闪存设备中不同块的擦除次数相差的最大值; 计数表创建模块,用于创建包含N+1个元素的擦除计数表EC (X),将下标值X分别设为〇到N,将所述N+1个元素按照所述下标值X从小到大依次排列; 队列划分模块,用于根据擦除计数值将所述闪存设备中所有可用空块划分为N+1个队列,将擦除计数值为0的块组成的队列加入EC(O)中,元素EC(1)到EC(N)包含的队列为空; 数据写入模块,用于当写入数据时,确定所述擦除计数表中擦除计数值最小且不为空的队列为最小队列,将数据写入所述最小队列的块中。 5. - kind of a flash memory device, characterized by comprising: redundancy presetting module configured to preset the wear is N redundancy flash memory device blocks the wear N redundancy to allow the flash memory device the maximum number of erase blocks different from the phase difference; count table creating module, for creating a table erase count EC (X) comprising N + 1 elements, the index value X are set square to N, the N + 1 elements are arranged in ascending order of the X-value index; queue dividing module, according to the erase count values ​​of all the available space in the flash memory device is divided into blocks of N + 1 queue, erase block count value is composed of queue 0 was added EC (O), the element EC (1) to EC (N) contained in the queue is empty; data write means for, when writing data, the erase determination erase count value in the counter table minimum queue is not empty queues is minimized, the smallest block of the write data queue.
  6. 6. 根据权利要求5所述的闪存设备,其特征在于,还包括: 初始化模块,用于初始化所述闪存设备,将所述闪存设备中所有空块的擦除计数值清零。 6. The flash memory device as claimed in claim 5, characterized in that, further comprising: initializing means for initializing the flash memory device, all the empty block erase count value is cleared flash memory device.
  7. 7. 根据权利要求5所述的闪存设备,其特征在于,还包括: 数据删除模块,用于当删除数据时,将被删除数据所在块的擦除计数值加1,并将所述被删除数据所在块移到下一队列中。 The flash memory device according to claim 5, characterized by further comprising: data deleting means for deleting the data when the data is deleted erased block where the count value is incremented by 1, and the deleted where the data block to the next queue.
  8. 8. 根据权利要求5所述的闪存设备,其特征在于,还包括: 队列下沉模块,用于当所述最小队列中的块全部移出时,将所述最小队列所在的元素移到所述擦除计数表的末端,重新确定最小队列。 A flash memory device according to claim 5, characterized in that, further comprising: a sink queue module configured to queue when the minimum block out all the elements of the queue is located is moved to the minimum the end of the erase count table to redefine the minimum queue.
CN 201410315842 2014-07-03 2014-07-03 Flash memory device and data processing method thereof CN104102459A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 201410315842 CN104102459A (en) 2014-07-03 2014-07-03 Flash memory device and data processing method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 201410315842 CN104102459A (en) 2014-07-03 2014-07-03 Flash memory device and data processing method thereof

Publications (1)

Publication Number Publication Date
CN104102459A true true CN104102459A (en) 2014-10-15

Family

ID=51670641

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 201410315842 CN104102459A (en) 2014-07-03 2014-07-03 Flash memory device and data processing method thereof

Country Status (1)

Country Link
CN (1) CN104102459A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070050536A1 (en) * 2005-09-01 2007-03-01 Cypress Semiconductor Corporation Flash drive fast wear leveling
CN101364437A (en) * 2007-08-07 2009-02-11 芯邦科技(深圳)有限公司 Method capable of loss equalization of flash memory and application thereof
CN102081576A (en) * 2011-03-01 2011-06-01 华中科技大学 Flash memory wear balance method
CN102193869A (en) * 2010-03-01 2011-09-21 群联电子股份有限公司 Memory management and write-in method, memory controller and storage system
CN102592678A (en) * 2011-12-30 2012-07-18 记忆科技(深圳)有限公司 Dynamic window management-based wear equilibrium method and device
CN103092766A (en) * 2012-12-28 2013-05-08 北京时代民芯科技有限公司 Balanced loss achievement method for NAND FLASH

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070050536A1 (en) * 2005-09-01 2007-03-01 Cypress Semiconductor Corporation Flash drive fast wear leveling
CN101364437A (en) * 2007-08-07 2009-02-11 芯邦科技(深圳)有限公司 Method capable of loss equalization of flash memory and application thereof
CN102193869A (en) * 2010-03-01 2011-09-21 群联电子股份有限公司 Memory management and write-in method, memory controller and storage system
CN102081576A (en) * 2011-03-01 2011-06-01 华中科技大学 Flash memory wear balance method
CN102592678A (en) * 2011-12-30 2012-07-18 记忆科技(深圳)有限公司 Dynamic window management-based wear equilibrium method and device
CN103092766A (en) * 2012-12-28 2013-05-08 北京时代民芯科技有限公司 Balanced loss achievement method for NAND FLASH

Similar Documents

Publication Publication Date Title
US7120729B2 (en) Automated wear leveling in non-volatile storage systems
US5745418A (en) Flash memory mass storage system
US8775720B1 (en) Hybrid drive balancing execution times for non-volatile semiconductor memory and disk
US20090300269A1 (en) Hybrid memory management
US20100017555A1 (en) Memory storage device and control method thereof
US20080109590A1 (en) Flash memory system and garbage collection method thereof
US20090089484A1 (en) Data protection method for power failure and controller using the same
US20080052446A1 (en) Logical super block mapping for NAND flash memory
US20070211551A1 (en) Method for dynamic performance optimization conforming to a dynamic maximum current level
US20080126720A1 (en) Multi-memory device system and method for managing a lifetime thereof
US8028123B2 (en) Circular wear leveling
US20090132770A1 (en) Data Cache Architecture and Cache Algorithm Used Therein
US20110191523A1 (en) Priority Ordered Multi-Medium Solid-State Storage System and Methods for Use
US20070094445A1 (en) Method to enable fast disk caching and efficient operations on solid state disks
US8316176B1 (en) Non-volatile semiconductor memory segregating sequential data during garbage collection to reduce write amplification
US7035967B2 (en) Maintaining an average erase count in a non-volatile storage system
US20120151124A1 (en) Non-Volatile Memory Device, Devices Having the Same, and Method of Operating the Same
US20140269090A1 (en) Periodic Erase Operation for a Non-Volatile Medium
US6831865B2 (en) Maintaining erase counts in non-volatile storage systems
US7039788B1 (en) Method and apparatus for splitting a logical block
US20090323419A1 (en) Read-time wear-leveling method in storage system using flash memory device
US20090172255A1 (en) Wear leveling method and controller using the same
US7809900B2 (en) System, method, and computer program product for delaying an operation that reduces a lifetime of memory
US20090259800A1 (en) Flash management using sequential techniques
US20120084489A1 (en) Synchronized maintenance operations in a multi-bank storage system

Legal Events

Date Code Title Description
C06 Publication
C10 Entry into substantive examination
RJ01