CN103077118A - Method and system for recovering invalid data - Google Patents

Method and system for recovering invalid data Download PDF

Info

Publication number
CN103077118A
CN103077118A CN2012105873151A CN201210587315A CN103077118A CN 103077118 A CN103077118 A CN 103077118A CN 2012105873151 A CN2012105873151 A CN 2012105873151A CN 201210587315 A CN201210587315 A CN 201210587315A CN 103077118 A CN103077118 A CN 103077118A
Authority
CN
China
Prior art keywords
data
block
invalid data
leaf
page
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.)
Pending
Application number
CN2012105873151A
Other languages
Chinese (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.)
SHENZHEN SILICONGO SEMICONDUCTOR CO Ltd
Original Assignee
SHENZHEN SILICONGO SEMICONDUCTOR 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 SHENZHEN SILICONGO SEMICONDUCTOR CO Ltd filed Critical SHENZHEN SILICONGO SEMICONDUCTOR CO Ltd
Priority to CN2012105873151A priority Critical patent/CN103077118A/en
Publication of CN103077118A publication Critical patent/CN103077118A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

The invention discloses a method and a system for recovering invalid data. The method comprises the following steps of: receiving writing operation commands, writing data in blank blocks, detecting a flash memory zone after one blank block is used, so as to judge whether the quantity of the blank blocks is smaller than a preset quantity, entering into a recovery state if the quantity of the blank blocks is smaller than the preset quantity, continuing writing operation after invalid data pages in a data block are recovered, if not, continuing the writing operation. The system comprises a detection module, a judgment module and a processing module. The technical scheme manages the flash memory by taking a page as a unit, so as to realize data writing, and simultaneously and uniformly performs the operation of invalid data page recovery, thereby realizing the efficient recovery of invalid data, improving the recovery efficiency, and simultaneously increasing the flash memory writing speed and the service life.

Description

A kind of invalid data recovery method and system
Technical field
The present invention relates to the data record field, relate in particular to a kind of invalid data recovery method and system.
Background technology
Flash memory (flash memory) is comprised of a plurality of data pages (page), and per 64 pages or 128 page definitions are a block (block), with the storage unit as flash memory.Yet the characteristic of flash memory is after one page is written into data, formation can't write new data to described data page immediately again, the block at described page or leaf place must be carried out (erase) step of erasing, become after the blank block, could continue described page or leaf is write new data.Yet the mode of data writing is quite consuming time again again for the above-mentioned block of erasing, so normally the more new data of wanting to write to described page or leaf is write to first another physical address that corresponds to same logical address.
Fig. 1 is the synoptic diagram during the flash memory data writing in the prior art, as shown in Figure 1, when being updated in the block 2 of flash memory when writing " logical data 0011 ", " logical data 0013 ", " logical data 0015 ", three corresponding in the block 2 data pages all become the valid data page or leaf, accordingly, because same logical address is written into repeatedly, in the block 1, three valid data pages or leaves that are written into the correspondence of " logical data 0011 ", " logical data 0013 ", " logical data 0015 " originally become the invalid data page or leaf at this moment.Because this physical characteristics of flash memory, a lot of invalid data pages or leaves can appear, at this moment need the invalid data page or leaf that produces is processed, need to adopt certain method that the block of flash memory is managed, at present the processing mode of prior art generally is that the valid data on the piece and the data that newly write are write on the new empty piece together, and then with old recovery, processing needs the moving data amount large like this, poor efficiency, consuming time, thus speed and the serviceable life of flash memory affected.
Summary of the invention
Fundamental purpose of the present invention provides a kind of invalid data recovery method and system, is intended to improve the organic efficiency of invalid data, and improves flash memory writing speed and serviceable life.
The invention provides a kind of invalid data recovery method, comprising:
Receive the write operation instruction, data writing in blank block;
After a blank block is finished using, detect flash area, judge whether its blank block is less than predefined quantity;
If, enter the recovery state, behind the invalid data page or leaf of data collection block, continue write operation;
Otherwise, continue write operation.
Preferably, the invalid data page or leaf of described data collection block comprises: detect the valid data number of pages of described block, and selected block with minimum valid data number of pages, and reclaim its invalid data page or leaf.
Preferably, its invalid data page or leaf of described recovery is specially: the selected block with minimum valid data number of pages is moved operation, its valid data page or leaf is moved to blank block, and described block is recovered as blank block.
Preferably, described write operation process comprises: in the time of data writing, data page is labeled as valid data page or leaf or invalid data page or leaf.
Preferably, be 1 with described valid data page marker, be 0 with described invalid data page marker.
Preferably, the described write operation process of carrying out also comprises: the flag state of described data page is upgraded and storage.
The present invention also provides a kind of invalid data recovery system, comprising:
Detection module is for detection of the blank block of flash area or the quantity of data module;
Judge module is used for judging whether its blank block is less than predefined quantity;
Processing module is used for carrying out write operation or carrying out reclaimer operation.
Preferably, described detection module is also for detection of the valid data number of pages of described block;
Described processing module also is used for the block with minimum valid data number of pages that described detection module detects is moved operation, its valid data page or leaf is moved to blank block, and described block is recovered as blank block.
Preferably, described processing module also is used for when data writing data page being labeled as valid data page or leaf or invalid data page or leaf.
Preferably, also comprise memory module, be used for the data that write and the flag state of data page are stored.
Invalid data recovery method of the present invention comprises: receive the write operation instruction, data writing in blank block; After a blank block is finished using, detect flash area, judge whether its blank block is less than predefined quantity; If, enter the recovery state, behind the invalid data page or leaf of data collection block, continue write operation; Otherwise, continue write operation.The present invention carries out take page or leaf as unit flash memory is managed, and realizes writing of data, and unified operation of reclaiming the invalid data page or leaf, has improved the organic efficiency of invalid data, has improved simultaneously flash memory writing speed and serviceable life.
Description of drawings
Fig. 1 is the synoptic diagram during the flash memory data writing in the prior art;
Fig. 2 is the process flow diagram of invalid data recovery method one embodiment of the present invention;
Fig. 3 is the synoptic diagram that data page of the present invention is effective or disarmed state records;
Fig. 4 is the synoptic diagram of resettlement of the present invention and data collection block;
Fig. 5 is the structural representation of invalid data recovery system one embodiment of the present invention.
The realization of the object of the invention, functional characteristics and advantage are described further with reference to accompanying drawing in connection with embodiment.
Embodiment
Further specify technical scheme of the present invention below in conjunction with Figure of description and specific embodiment.Should be appreciated that specific embodiment described herein only in order to explain the present invention, is not intended to limit the present invention.
With reference to Fig. 2, Fig. 2 is the process flow diagram of invalid data recovery method one embodiment of the present invention; The invention provides a kind of invalid data recovery method, comprising:
Receive the write operation instruction, data writing in blank block;
After a blank block is finished using, detect flash area, judge whether its blank block is less than predefined quantity;
If, enter the recovery state, behind the invalid data page or leaf of data collection block, continue write operation;
Otherwise, continue write operation.
In the flash memory write operating process, take out a blank block and data writing, when described block is not finished using, do not need the invalid data page or leaf in original block is carried out reclaimer operation; After a blank block is finished using, detect the clear area number of blocks in the flash area, when the quantity of described blank block is not less than the predefined value of system, continue to carry out write operation, until when detecting clear area number of blocks in this flash area and being lower than described system preset value, carry out the action of the invalid data page or leaf of data collection block.The present invention carries out take page or leaf as unit flash memory is managed, and unified operation of reclaiming the invalid data page or leaf has improved the organic efficiency of invalid data, has improved simultaneously flash memory writing speed and serviceable life.
With reference to Fig. 3, Fig. 3 is the synoptic diagram that the present invention is effective or disarmed state records; The invalid data page or leaf of described data collection block comprises: detect the valid data number of pages of described block, and selected block with minimum valid data number of pages, and reclaim its invalid data page or leaf.As shown in Figure 3, block 1 has respectively a plurality of valid data pages or leaves and a plurality of invalid data page or leaf to N, can detect the maximum block of described valid data number of pages, and reclaims its invalid data page or leaf.
With reference to Fig. 4, Fig. 4 is the synoptic diagram of resettlement of the present invention and data collection block; The invalid data page or leaf of the described block of above-mentioned recovery is specially: the selected block with minimum valid data number of pages is moved operation, its valid data page or leaf is moved to blank block, and described block is recovered as blank block.As shown in Figure 3, detect described block 2 and only have three valid data blocks, for having the block of minimum valid data number of pages, need to reclaim the invalid data page or leaf of described block 2 this moment, namely as shown in Figure 4, three valid data pages or leaves of described block 2 are moved to blank block, and the valid data block 2 that will no longer have simultaneously the valid data page or leaf is recovered as blank block, finishes the process of the invalid data page or leaf that reclaims described block.
Further, the described write operation that carries out comprises: in the time of data writing, data page is labeled as valid data page or leaf or invalid data page or leaf.Concrete, present embodiment is 1 with described valid data page marker as shown in Figure 3, is 0 with described invalid data page marker.The described write operation that carries out also comprises: the flag state of described data page is upgraded and storage.Present embodiment is provided with data page statistic table, the state that is used for adding up described data page is invalid or effective, and with after its status indication, be recorded to described data page statistic table, so that detect at any time the state of its data page, thereby when satisfying, condition reclaims the operation of invalid data page or leaf.
With reference to Fig. 5, Fig. 5 is the structural representation of invalid data recovery system one embodiment of the present invention; The present invention also provides a kind of invalid data recovery system, comprising:
Detection module 10 is for detection of the blank block of flash area or the quantity of data module;
Judge module 20 is used for judging whether its blank block is less than predefined quantity;
Processing module 30 is used for carrying out write operation or carrying out reclaimer operation.
Further, described detection module 10 is also for detection of the valid data number of pages of described block;
Described processing module 30 also is used for the block with minimum valid data number of pages that described detection module 10 detects is moved operation, its valid data page or leaf is moved to blank block, and described block is recovered as blank block.Described processing module also is used for when data writing data page being labeled as valid data page or leaf or invalid data page or leaf.
Further, described invalid data recovery system also comprises memory module, is used for the data that write and the flag state of data page are stored.
The embodiment of the invention carries out take page or leaf as unit flash memory is managed, realize writing of data, data with 1 BIT size, namely whether 0 or 1 come the flag data page or leaf effective, simultaneously to data page effectively or disarmed state add up and store, unified operation of reclaiming the invalid data page or leaf, thus reach the high efficiente callback of invalid data, improve organic efficiency, improved simultaneously flash memory writing speed and serviceable life.
The above only is the preferred embodiments of the present invention; be not so limit its claim; every equivalent structure or equivalent flow process conversion that utilizes instructions of the present invention and accompanying drawing content to do; directly or indirectly be used in other relevant technical fields, all in like manner be included in the scope of patent protection of the present invention.

Claims (10)

1. an invalid data recovery method is characterized in that, comprising:
Receive the write operation instruction, data writing in blank block;
After a blank block is finished using, detect flash area, judge whether its blank block is less than predefined quantity;
If, enter the recovery state, behind the invalid data page or leaf of data collection block, continue write operation;
Otherwise, continue write operation.
2. invalid data recovery method according to claim 1, it is characterized in that, the invalid data page or leaf of described data collection block comprises: detect the valid data number of pages of described block, and selected block with minimum valid data number of pages, and reclaim its invalid data page or leaf.
3. invalid data recovery method according to claim 2, it is characterized in that, its invalid data page or leaf of described recovery is specially: the selected block with minimum valid data number of pages is moved operation, its valid data page or leaf is moved to blank block, and described block is recovered as blank block.
4. invalid data recovery method according to claim 1 is characterized in that, described write operation gc comprises: in the time of data writing, data page is labeled as valid data page or leaf or invalid data page or leaf.
5. invalid data recovery method according to claim 4 is characterized in that, is 1 with described valid data page marker, is 0 with described invalid data page marker.
6. according to claim 4 or 5 described invalid data recovery methods, it is characterized in that described write operation process also comprises: the flag state of described data page is upgraded and storage.
7. an invalid data recovery system is characterized in that, comprising:
Detection module is for detection of the blank block of flash area or the quantity of data module;
Judge module is used for judging whether its blank block is less than predefined quantity;
Processing module is used for carrying out write operation or carrying out reclaimer operation.
8. invalid data recovery system according to claim 7 is characterized in that,
Described detection module is also for detection of the valid data number of pages of described block;
Described processing module also is used for the block with minimum valid data number of pages that described detection module detects is moved operation, its valid data page or leaf is moved to blank block, and described block is recovered as blank block.
9. invalid data recovery system according to claim 7 is characterized in that, described processing module also is used for when data writing data page being labeled as valid data page or leaf or invalid data page or leaf.
10. invalid data recovery system according to claim 7 is characterized in that, also comprises memory module, is used for the data that write and the flag state of data page are stored.
CN2012105873151A 2012-12-28 2012-12-28 Method and system for recovering invalid data Pending CN103077118A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2012105873151A CN103077118A (en) 2012-12-28 2012-12-28 Method and system for recovering invalid data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2012105873151A CN103077118A (en) 2012-12-28 2012-12-28 Method and system for recovering invalid data

Publications (1)

Publication Number Publication Date
CN103077118A true CN103077118A (en) 2013-05-01

Family

ID=48153650

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2012105873151A Pending CN103077118A (en) 2012-12-28 2012-12-28 Method and system for recovering invalid data

Country Status (1)

Country Link
CN (1) CN103077118A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103914392A (en) * 2014-04-03 2014-07-09 深圳市硅格半导体有限公司 Blank block recycling method and device for flash memory
CN106326136A (en) * 2015-07-02 2017-01-11 广明光电股份有限公司 Method for collecting garage block in solid state disk
CN108776614A (en) * 2018-05-03 2018-11-09 华为技术有限公司 The recovery method and device of memory block
CN109669889A (en) * 2018-12-24 2019-04-23 青岛方寸微电子科技有限公司 A kind of light-type Nor Flash flash memory control method and device
CN109725853A (en) * 2018-12-04 2019-05-07 浙江大华技术股份有限公司 A kind of data recovery method and device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020184436A1 (en) * 2001-06-04 2002-12-05 Samsung Electronics Co., Ltd. Flash memory management method
CN101339537A (en) * 2008-08-14 2009-01-07 四川登巅微电子有限公司 NAND flash memory management process using page as unit
CN102012869A (en) * 2009-09-04 2011-04-13 威刚科技股份有限公司 Data recording method of flash memory storage system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020184436A1 (en) * 2001-06-04 2002-12-05 Samsung Electronics Co., Ltd. Flash memory management method
CN101339537A (en) * 2008-08-14 2009-01-07 四川登巅微电子有限公司 NAND flash memory management process using page as unit
CN102012869A (en) * 2009-09-04 2011-04-13 威刚科技股份有限公司 Data recording method of flash memory storage system

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103914392A (en) * 2014-04-03 2014-07-09 深圳市硅格半导体有限公司 Blank block recycling method and device for flash memory
CN103914392B (en) * 2014-04-03 2017-05-03 深圳市硅格半导体有限公司 Blank block recycling method and device for flash memory
CN106326136A (en) * 2015-07-02 2017-01-11 广明光电股份有限公司 Method for collecting garage block in solid state disk
CN108776614A (en) * 2018-05-03 2018-11-09 华为技术有限公司 The recovery method and device of memory block
CN108776614B (en) * 2018-05-03 2021-08-13 华为技术有限公司 Recovery method and device of storage block
CN109725853A (en) * 2018-12-04 2019-05-07 浙江大华技术股份有限公司 A kind of data recovery method and device
CN109669889A (en) * 2018-12-24 2019-04-23 青岛方寸微电子科技有限公司 A kind of light-type Nor Flash flash memory control method and device

Similar Documents

Publication Publication Date Title
CN106598878B (en) Solid state disk cold and hot data separation method
EP2115595B1 (en) Memory device performance enhancement through pre-erase mechanism
CN102043727B (en) Method and device for recovering solid-state hard disc mapping table
CN101859604B (en) Utilization method of flash memory bad block
CN102508788B (en) SSD (solid state drive) and SSD garbage collection method and device
CN102622309B (en) Data security erase method and device
US8874830B2 (en) Method for controlling memory array of flash memory, and flash memory using the same
CN104484283B (en) A kind of method for reducing solid state disk write amplification
CN103077118A (en) Method and system for recovering invalid data
CN106681934A (en) Method and system for rubbish recycling of solid state disk, and solid state disk controller
CN101673243B (en) Data storage device and method
CN102511044A (en) Method for deleting the data and device thereof
CN101963891A (en) Method and device for data storage and processing, solid-state drive system and data processing system
CN106649132A (en) Solid-state drive junk recovery method
CN107301132A (en) A kind of flash memory garbage reclamation optimization method
CN103744798A (en) Garbage recycling method of solid state discs
CN103970669A (en) Method for accelerating physical-to-logic address mapping of recycling operation in solid-state equipment
CN106326136A (en) Method for collecting garage block in solid state disk
CN108874574B (en) Garbage recycling method and related device
CN104899114A (en) Continuous time data protection method on solid state drive
CN107562378A (en) A kind of method for lifting the solid storage device life-span
CN102243884B (en) Method for storing streaming media data and apparatus thereof
CN103778964A (en) Processing and using method, device and system for NAND Flash programmed data,
CN105988939A (en) Data storage device and flash memory control method
CN103914397A (en) Flash memory device and management method thereof

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C12 Rejection of a patent application after its publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20130501