CN102543177B - 一种固态盘静态磨损平衡算法 - Google Patents

一种固态盘静态磨损平衡算法 Download PDF

Info

Publication number
CN102543177B
CN102543177B CN201010601304.5A CN201010601304A CN102543177B CN 102543177 B CN102543177 B CN 102543177B CN 201010601304 A CN201010601304 A CN 201010601304A CN 102543177 B CN102543177 B CN 102543177B
Authority
CN
China
Prior art keywords
block
physical block
erasing
wiped
physical
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN201010601304.5A
Other languages
English (en)
Other versions
CN102543177A (zh
Inventor
刘升
王更磊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Leizhi Digital System Technology Xi'an Co ltd
Original Assignee
Xi'an Qivi Test & Control Technology Co Ltd
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 Xi'an Qivi Test & Control Technology Co Ltd filed Critical Xi'an Qivi Test & Control Technology Co Ltd
Priority to CN201010601304.5A priority Critical patent/CN102543177B/zh
Publication of CN102543177A publication Critical patent/CN102543177A/zh
Application granted granted Critical
Publication of CN102543177B publication Critical patent/CN102543177B/zh
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Techniques For Improving Reliability Of Storages (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

一种固态盘静态磨损平衡算法,它是:通过在内存中分别记录擦除块的次数、擦除操作的次数以及记录每个物理块是否擦除过的标志来实现静态磨损平衡;其中,物理块擦除表为一个数组,按位记录每个物理块的擦除标志,0代表未擦除过,1代表已擦除过。本发明将这两个物理块进行调整,从而达到静态磨损平衡,减少对于某一物理块反复擦除的几率,延长了物理块使用寿命。

Description

一种固态盘静态磨损平衡算法
技术领域
本发明涉及一种固态盘静态磨损平衡算法,具体涉及主要应用于基于NandFlash的闪存控制器中的一种固态盘静态磨损平衡算法,对嵌入式系统中需要nandflash芯片进行存储时也能应用本发明。
背景技术
固态盘是一种把Nandflash芯片作为存储介质的存储器。它具有:数据存取速度快、经久耐用、防震抗摔、工作时非常安静没有任何噪音产生等优点。NandFlash的读写是以页为单位进行的,而擦除是以块为单位的。而对于NandFlash的自身特点来说,对于一个物理块的擦除次数是有限的。一般的NandFlash对于一个物理块的可反复擦除次数为100K次,最多可以擦除1000K次,如果反复的对某一个物理块反复多次的擦除,将会导致这些物理块无法正常工作,甚至导致这些物理块不可以使用。
发明内容
本发明的目的在于提供一种固态盘静态磨损平衡算法,其解决了背景技术中物理块擦除次数有限,反复多次会导致这些物理块无法正常工作的技术问题,其减少对于某一物理块反复擦除的几率,延长了物理块使用寿命。
静态磨损平衡是对一个通道内的物理块进行擦除平衡调整的算法。它记录一个通道内进行擦除操作的次数和已被擦除物理块的个数,通过计算这两个值的比值达到预定义的阀值时就进行物理的调整。如果所有块都被擦除过后即开始新的一个调整周期。在一些应用中会出现静态数据的情况,这种数据一旦写入某些物理块后,以后就很少进行使用,而另外一种数据写入到某些物理块后,经常会被反复改写。本发明就是将这两个物理块进行调整,从而达到静态磨损平衡。
本发明的技术方案是:
一种固态盘静态磨损平衡方法,其特殊之处在于:
通过在内存中分别记录擦除块个数、擦除操作的次数以及记录每个物理块是否擦除过的标志来实现静态磨损平衡;
其中,物理块擦除记录表为一个数组,按位记录每个物理块的擦除标志,0代表未擦除过,1代表已擦除过;
本方法包括:
1)当对NandFlash进行擦除操作时,擦除操作次数加1,根据记录物理块擦除的标志判断当前擦除的块是否已经擦除过,如果没有擦除过,则擦除块次数加1,同时设置记录当前物理块擦除的标志;
2)计算擦除次数与擦除块个数的比值是否达到一预定的阀值,如果达到则开始调整;如果未大于阀值,则不作处理;
所述调整包括:
1)如果擦除块个数等于总物理块个数时,表明所有块都被擦除过,则需要重新复位擦除块个数、擦除次数以及物理块擦除记录表;
2)如果擦除块个数不等于总物理块个数,则通过物理块擦除记录表分别找到物理块上有有效数据并且物理块擦除记录表中对应的标志为0和物理块上没有有效数据并且物理块擦除记录表中对应的标志为1的2个物理块;并将这2个物理块分别定义为块1和块2;
3)将块1的有效数据拷贝到块2上;
4)将块1擦除并将对应的物理块擦除记录表中的标志设置为1。
上述固态盘静态磨损平衡方法,其特殊之处在于:对于4通道16G的固态盘,所述阀值定义为1000。
本发明的优点在于:将这两个物理块进行调整,从而达到静态磨损平衡,减少对于某一物理块反复擦除的几率,延长了物理块使用寿命。
附图说明
图1为本发明原理示意图;
图2为本发明具体流程示意图。
具体实施方式
参见图1,一种固态盘静态磨损平衡方法,它是:
通过在内存中分别记录擦除块的次数、擦除操作的次数以及记录每个物理块是否擦除过的标志来实现静态磨损平衡;
其中,物理块擦除表为一个数组,按位记录每个物理块的擦除标志,0代表未擦除过,1代表已擦除过;
本方法包括:
1)当对NandFlash进行擦除操作时,擦出操作次数加1,根据记录物理块擦除的标志判断当前擦除的块是否已经擦除过,如果没有擦除过,则擦除块次数加1,同时设置记录当前物理块擦除的标志;
2)计算擦除次数与擦除块个数的比值是否达到预定一的阀值,如果达到则开始调整;如果未大于阀值,则不作处理。
参见图2,本发明具体流程如下:
1)擦除一个物理块时,擦除次数加1。
2)在物理块擦除记录表中查询当前物理块的擦除状态,如果当前块的未被擦除过则擦除块个数加1,并将物理块擦除记录表中对应的当前物理块的标志记录为1。
3)擦除次数除以擦除块个数,如果大于阀值,则开始静态磨损调整。如果未大于阀值,则不作处理。
4)如果擦除块个数等于总物理块个数时,表明所有块都被擦除过,则需要重新复位擦除块个数、擦除次数以及物理块擦除记录表。
如果擦除块个数不等于总物理块个数,则通过物理块擦除记录表分别找到物理块上有有效数据并且物理块擦除记录表中对应的标志为0(定义为块1)和物理块上没有有效数据并且物理块擦除记录表中对应的标志为1(定义为块2)的2个块。
5)将块1的有效数据拷贝到块2上。
6)将块1擦除并将对应的物理块擦除记录表中的标志设置为1。
7)调整结束。
对于本方法中阀值的确定,一般是一个经验值,在工作过程中,发现对于4通道16G的固态盘上,此阀值定义为1000,效果最好。

Claims (2)

1.一种固态盘静态磨损平衡方法,其特征在于:
通过在内存中分别记录擦除块个数、擦除操作的次数以及记录每个物理块是否擦除过的标志来实现静态磨损平衡;
其中,物理块擦除记录表为一个数组,按位记录每个物理块的擦除标志,0代表未擦除过,1代表已擦除过;
本方法包括:
1)当对NandFlash进行擦除操作时,擦除操作次数加1,根据记录物理块擦除的标志判断当前擦除的块是否已经擦除过,如果没有擦除过,则擦除块次数加1,同时设置记录当前物理块擦除的标志;
2)计算擦除次数与擦除块个数的比值是否达到一预定的阀值,如果达到则开始调整;如果未大于阀值,则不作处理;
所述调整包括:
1)如果擦除块个数等于总物理块个数时,表明所有块都被擦除过,则需要重新复位擦除块个数、擦除次数以及物理块擦除记录表;
2)如果擦除块个数不等于总物理块个数,则通过物理块擦除记录表分别找到物理块上有有效数据并且物理块擦除记录表中对应的标志为0和物理块上没有有效数据并且物理块擦除记录表中对应的标志为1的2个物理块;并将这2个物理块分别定义为块1和块2;
3)将块1的有效数据拷贝到块2上;
4)将块1擦除并将对应的物理块擦除记录表中的标志设置为1。
2.根据权利要求1所述固态盘静态磨损平衡方法,其特征在于:对于4通道16G的固态盘,所述阀值定义为1000。
CN201010601304.5A 2010-12-17 2010-12-17 一种固态盘静态磨损平衡算法 Active CN102543177B (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201010601304.5A CN102543177B (zh) 2010-12-17 2010-12-17 一种固态盘静态磨损平衡算法

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201010601304.5A CN102543177B (zh) 2010-12-17 2010-12-17 一种固态盘静态磨损平衡算法

Publications (2)

Publication Number Publication Date
CN102543177A CN102543177A (zh) 2012-07-04
CN102543177B true CN102543177B (zh) 2016-01-06

Family

ID=46349876

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201010601304.5A Active CN102543177B (zh) 2010-12-17 2010-12-17 一种固态盘静态磨损平衡算法

Country Status (1)

Country Link
CN (1) CN102543177B (zh)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103077096A (zh) * 2012-12-31 2013-05-01 记忆科技(深圳)有限公司 数据纠错系统、固态硬盘及数据纠错方法
CN105468291B (zh) * 2014-08-21 2019-09-20 腾讯科技(深圳)有限公司 动态及静态磨损均衡控制方法及装置
US10585795B2 (en) * 2018-05-31 2020-03-10 Micron Technology, Inc. Data relocation in memory having two portions of data
CN110764712A (zh) * 2019-10-31 2020-02-07 江苏华存电子科技有限公司 一种提高耗损平均技术效率的方法

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1701307A (zh) * 2002-10-28 2005-11-23 桑迪士克股份有限公司 管理擦除计数区块的方法和设备
CN101369252A (zh) * 2008-09-16 2009-02-18 浙江大学 基于nand闪存文件系统中静态数据损耗均衡的方法

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7035967B2 (en) * 2002-10-28 2006-04-25 Sandisk Corporation Maintaining an average erase count in a non-volatile storage system
US7441067B2 (en) * 2004-11-15 2008-10-21 Sandisk Corporation Cyclic flash memory wear leveling

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1701307A (zh) * 2002-10-28 2005-11-23 桑迪士克股份有限公司 管理擦除计数区块的方法和设备
CN101369252A (zh) * 2008-09-16 2009-02-18 浙江大学 基于nand闪存文件系统中静态数据损耗均衡的方法

Also Published As

Publication number Publication date
CN102543177A (zh) 2012-07-04

Similar Documents

Publication Publication Date Title
CN107168647B (zh) Flash数据读写方法及系统
Smith Garbage collection
CN102306125B (zh) 一种flash存储器的数据擦写方法
CN103365739B (zh) 一种nand闪存存储设备及其数据恢复方法
CN106462493B (zh) 固态存储器损坏的减轻
US20130054878A1 (en) Solid state drive and wear-leveling control method thereof
CN107608625B (zh) 一种提升固存储设备读性能的方法
TW201528281A (zh) 資料儲存裝置以及快閃記憶體控制方法
TW200506609A (en) Data storage device, management information updating method in data storage device, and computer program
TW200608201A (en) Nonvolatile storage device and data write method
CN101727395A (zh) 闪存设备的管理系统、方法及闪存设备
CN102543177B (zh) 一种固态盘静态磨损平衡算法
CN101727295A (zh) 一种基于虚拟块闪存地址映射的数据写入及读出方法
CN101702139B (zh) 一种访问Nand闪存数据的方法和装置
CN102012873B (zh) Nand闪存的缓存系统及缓存方法
JP2015507798A5 (zh)
WO2014079201A1 (zh) 重复数据删除的方法及其固态硬盘
CN105280239A (zh) 一种动态实现固态硬盘ecc校验码的方法和装置
TW201917578A (zh) 存取快閃記憶體模組的方法及相關的快閃記憶體控制器與電子裝置
CN113190180A (zh) 一种基于混合介质的存储装置及分布式存储系统
CN101667160A (zh) 一种提高Nand Flash芯片使用寿命的方法
CN102867046B (zh) 基于固态硬盘的数据库优化方法及系统
Jeong et al. Improving {NAND} Endurance by Dynamic Program and Erase Scaling
CN105988719A (zh) 存储装置及其处理数据的方法
CN102789422B (zh) 固态硬盘的数据写入方法

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
C56 Change in the name or address of the patentee
CP01 Change in the name or title of a patent holder

Address after: 710077 Xi'an high tech Zone, Jin Industrial Road, No., No. C Venture Park, No. 8,

Patentee after: XI'AN KEYWAY TECHNOLOGY Co.,Ltd.

Address before: 710077 Xi'an high tech Zone, Jin Industrial Road, No., No. C Venture Park, No. 8,

Patentee before: Xi'an Keyway Technology Co.,Ltd.

CP03 Change of name, title or address

Address after: 710077 Xi'an high tech Zone, Jin Industrial Road, No., No. C Venture Park, No. 8,

Patentee after: XI'AN KEYWAY TECHNOLOGY Co.,Ltd.

Address before: 710077 Xi''an high tech Zone, Jin Industrial Road, No., No. C Venture Park, No. 8,

Patentee before: Xi'an keyway Measurement?& Control Technology Co.,Ltd.

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20171024

Address after: 710077 Xi'an high tech Zone, Jin Industrial Road, No., No. C Venture Park, No. 8,

Co-patentee after: BIT RACO ELECTRONIC INFORMATION TECHNOLOGY CO.,LTD.

Patentee after: XI'AN KEYWAY TECHNOLOGY Co.,Ltd.

Address before: 710077 Xi'an high tech Zone, Jin Industrial Road, No., No. C Venture Park, No. 8,

Patentee before: XI'AN KEYWAY TECHNOLOGY Co.,Ltd.

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20211026

Address after: 710117 No. a1-134, building 4, phase II, information industry park, No. 526, Xitai Road, high tech Zone, Xi'an, Shaanxi Province

Patentee after: Xi'an siduoruizhi Information Technology Co.,Ltd.

Patentee after: Leizhi digital system technology (Xi'an) Co.,Ltd.

Address before: 710077, No. 8, C zone, pioneering research and Development Park, 69 Kam Yip Road, hi tech Zone, Shaanxi, Xi'an

Patentee before: XI'AN KEYWAY TECHNOLOGY Co.,Ltd.

Patentee before: BIT RACO ELECTRONIC INFORMATION TECHNOLOGY Co.,Ltd.

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20211206

Address after: 710117 a2-02, building 4, phase II, information industry park, No. 526, banxitai Road, Xinglong Street, high tech Zone, Xi'an, Shaanxi Province

Patentee after: Leizhi digital system technology (Xi'an) Co.,Ltd.

Address before: 710117 No. a1-134, building 4, phase II, information industry park, No. 526, Xitai Road, high tech Zone, Xi'an, Shaanxi Province

Patentee before: Xi'an siduoruizhi Information Technology Co.,Ltd.

Patentee before: Leizhi digital system technology (Xi'an) Co.,Ltd.