CN101620575A - Flash card and method for flash memory to prevent data from being damaged - Google Patents

Flash card and method for flash memory to prevent data from being damaged Download PDF

Info

Publication number
CN101620575A
CN101620575A CN200810176140A CN200810176140A CN101620575A CN 101620575 A CN101620575 A CN 101620575A CN 200810176140 A CN200810176140 A CN 200810176140A CN 200810176140 A CN200810176140 A CN 200810176140A CN 101620575 A CN101620575 A CN 101620575A
Authority
CN
China
Prior art keywords
paging
last
data
block
weak
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.)
Granted
Application number
CN200810176140A
Other languages
Chinese (zh)
Other versions
CN101620575B (en
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.)
Huiguo (Shanghai) Software Technology Co Ltd
Silicon Motion Inc
Original Assignee
Huiguo (Shanghai) Software Technology Co Ltd
Silicon Motion Inc
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 Huiguo (Shanghai) Software Technology Co Ltd, Silicon Motion Inc filed Critical Huiguo (Shanghai) Software Technology Co Ltd
Priority to PCT/CN2009/072596 priority Critical patent/WO2010000205A1/en
Publication of CN101620575A publication Critical patent/CN101620575A/en
Application granted granted Critical
Publication of CN101620575B publication Critical patent/CN101620575B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

The present invention provides a flash card and a method for flash memory to prevent data from being damaged. Firstly, when a controller completes to write data in a plurality of pagings of a first block of the flash memory, a final weak paging of the a plurality of pagings is found. Then, a first strong paging corresponding with the final weak paging is found. Then, a plurality of strong pagings between the first strong paging and the final weak paging are determined. Finally, the data of the a plurality of strong pagings are copied to a backup data storage region of the flash to recover the data when the data are damaged.

Description

The method that flash card and flash memory prevention data are damaged
Technical field
The invention relates to storage card, particularly relevant for flash card.
Background technology
At present many electronic installations such as digital camera and mobile phone all use flash memory to store data.One NAND type flash memory comprises a plurality of blocks (block), and each block comprises a plurality of pagings (page) again.These a plurality of pagings can be divided into strong paging (strong page) and weak paging (weak page) again.So-called strong paging is meant that the busy time (program busy time) of programming when this paging is written into data is shorter.Otherwise so-called weak paging is meant that the busy time of programming required when this paging is written into data is longer.
Fig. 1 shows many pagings synoptic diagram that a block 100 of a NAND type flash memory is comprised.Block 100 comprises a plurality of pagings.In paging 0~paging 9, visible paging 0,1,2,3,6,7 is strong paging, and paging 4,5,8,9 is weak paging.In addition, each strong paging has a weak paging corresponding with it, and each weak paging has corresponding strong paging with it.For example, strong paging 0 is corresponding with weak paging 4, and strong paging 2 is corresponding with weak paging 8, and weak paging 9 is with paging 3 is corresponding by force.Therefore a block comprises a plurality of pagings again and is corresponding in twos relation.
Can influence each other when having the strong paging of corresponding relation and weak paging to be subjected to programming to write data.Owing to the busy time of the required programming of strong paging is shorter, when being programmed, strong paging makes a mistake, and when for example cutting off the power supply, the weak paging corresponding with this strong paging usually can be not influenced.Otherwise owing to the busy time of the required programming of weak paging is longer, when making a mistake when weak paging is programmed, the stored data of the strong paging corresponding with paging a little less than this is damaged by related influence so that generation data probably.Therefore, need a kind of method, can when above-mentioned data damage situation takes place, reply data, to guarantee the integrality of data.
Summary of the invention
In view of this, the method that the object of the present invention is to provide a kind of flash memory prevention data to damage is to solve the problem that prior art exists.At first, when a controller is finished a plurality of paging of one first block that writes document to a flash memory, find out the last weak paging (weak page) of one in these a plurality of pagings.Then, find out and be somebody's turn to do last weak corresponding the last the first paging of paging (strong page).Then, determine between this last the first paging and a plurality of strong paging between the paging a little less than being somebody's turn to do at last.Then, duplicate the backup information storage area of the data of these a plurality of strong pagings, reply the usefulness of data when damaging for data to this flash memory.
The present invention more provides a kind of flash card, can the prevention data damage.In an embodiment, this flash card comprises a flash memory and a controller.When finishing when writing a document to a plurality of paging of one first block of this flash memory, this controller is found out the last weak paging (weak page) of one in these a plurality of pagings, find out and be somebody's turn to do last weak corresponding the last the first paging of paging (strong page), decision a plurality of strong paging between the paging between this last the first paging and a little less than being somebody's turn to do at last, and duplicate the backup information storage area of the data of these a plurality of strong pagings to this flash memory, reply the usefulness of data when damaging for data.
Description of drawings
For above-mentioned purpose of the present invention, feature and advantage can be become apparent, below in conjunction with accompanying drawing the specific embodiment of the present invention is elaborated, wherein:
Fig. 1 is many pagings synoptic diagram that a block of a NAND type flash memory is comprised;
Fig. 2 is the block diagram according to flash card of the present invention;
Fig. 3 is the process flow diagram according to the method for backup flash memory data of the present invention;
Fig. 4 A is the synoptic diagram of an embodiment of the stored block of flash memory of the present invention;
Fig. 4 B is the synoptic diagram of the stored data in the backup information storage area of corresponding diagram 4A;
Fig. 5 A is the synoptic diagram of another embodiment of the stored block of flash memory of the present invention;
Fig. 5 B is the synoptic diagram of the stored data in the backup information storage area of corresponding diagram 5A; And
Fig. 6 is the process flow diagram according to the method for answer flash memory data damage of the present invention.
The main element symbol description:
202~main frame;
204~flash card;
206~controller;
208~flash memory.
Embodiment
Fig. 2 is the block diagram according to flash card 204 of the present invention.In an embodiment, flash card 204 comprises a controller 206 and a flash memory 208.Flash memory 208 comprises a plurality of blocks (block), and each block comprises a plurality of pagings (page), to store data.In an embodiment, this flash memory 208 is a NAND type flash memory.Controller 206 is connected to main frame 202, and according to the indication access flash memory 208 of main frame 202, for example the data that main frame 202 is transmitted writes flash memory 208, or reads data to be back to main frame 202 from flash memory 208.In an embodiment, 208 of controller 206 and flash memories couple an order wire CMD who transmits order, and a plurality of data line D0, the D1 of the data of transmission ..., Dn.
Fig. 3 is the process flow diagram according to the method 300 of backup flash memory data of the present invention.Whenever controller 206 writes a document to flash memory 208 (step 302), detect just whether this document writes finish (step 304).In an embodiment, when controller 206 receives the 0x24 write command that main frame 202 is sent, to write this document to flash memory 208, just can borrow and whether detect that the current potential of controller 206 and the data line D0 of 208 of flash memories is (ready) state of awaiting orders from (busy) replying state of having much to do, write the time point that finishes to learn data.In another embodiment, controller 206 receives the 0x25 write command that main frame 202 is sent, to write this document to flash memory 208, detect the 0x12 the finish command whether controller 206 reception main frames 202 are sent and can borrow, also can learn that data writes the time point that finishes.It is to decide according to different main frame interfaces that data writes the time point that finishes, and the foregoing description is to be example with the SD card, but does not exceed with the foregoing description.
Fig. 4 A is the synoptic diagram of an embodiment of the stored block 400 of flash memory of the present invention 208.Suppose that controller 206 is a plurality of pagings 0~4 that this document write the block 400 of flash memory 208, shown in label 410.Controller is had a last weak paging of last tagmeme 206 this moments by search in these a plurality of pagings 0~4.If the last paging 4 in these a plurality of pagings 0~4 is a weak paging (step 306), then this last paging 4 of controller 206 decisions is for being somebody's turn to do last weak paging.Then, controller 206 is found out this last weak paging 4 pairing the last the first pagings 0 (step 314), and and then a plurality of strong paging 1,2,3 (step 316) of decision between last weak paging 4 and the last the first paging 0.Then, controller 206 duplicates the backup information storage area of the data of these a plurality of strong pagings 1,2,3 to flash memory 208, replys the usefulness (step 312) of data when damaging for data.Fig. 4 B is the synoptic diagram of the stored data in the backup information storage area 450 of corresponding diagram 4A.As shown in the figure, backup information storage area 450 has stored the data of strong paging 1,2,3.
Suppose that controller 206 has next record data (step 318) to be written, and write the block 400 (step 302) of second document, shown in the paging 5~10 that the label 510 of Fig. 5 A is comprised to flash memory 208.When second document 510 writes finish (step 304), controller 206 is just by searching the last weak paging with last tagmeme in these a plurality of pagings 5~10.If the last paging 10 in these a plurality of pagings 5~10 is the last one paging (step 306), then controller 206 serves as last weak paging (step 308) with the weak paging 9 before this last paging 10, and finds out this last weak paging 9 pairing the last the first pagings 3 (step 308).Then, controller 206 and then the decision a plurality of strong paging 6,7 (step 310) between last weak paging 9 and the last the first paging 3.Then, controller 206 duplicates the backup information storage area of the data of these a plurality of strong pagings 6,7 to flash memory 208, replys the usefulness (step 312) of data when damaging for data.Fig. 5 B is the synoptic diagram of the stored data in the backup information storage area 450 of corresponding diagram 5A.As shown in the figure, except the data of the last time strong paging 1,2,3 of storage, backup information storage area 450 has more stored the data of strong paging 6,7.
Fig. 6 is the process flow diagram according to the method 600 of answer flash memory data damage of the present invention.At first, controller 206 writes the block (step 602) of data to flash memory 208.When controller 206 writes data, just detect the data ablation process and whether make a mistake (step 604), for example when writing data, cut off the power supply.With Fig. 5 A is example, supposes to write the block 400 of the 3rd document to flash memory 208 when controller 206, and outage takes place and the generation write error when writing data to paging 13.At this moment, because paging 13 is a weak paging, corresponding strong paging 7 stored data have the related generation data damage of very big probability with it.
Controller 206 at first determines block 400 that one first paging 13 (step 606) of write error takes place.If this first paging is the last one paging, the situation that the weak paging of its correspondence can't the generation data be damaged.At this moment, because of this first paging 13 is a weak paging (step 608), controller 206 determines the last the first paging 7 (step 610) of first paging, 13 correspondences.Then, controller 206 is searched the backup information storage area 450 of Fig. 5 B to obtain the data (step 512) of this last the first paging 7.Then, controller 206 just can be replied the data of the last the first paging of generation data damage according to the backup information of this last the first paging 7.
In an embodiment, controller 206 is obtained a blank block, and duplicates the data of block 400 and step 612 in regular turn and search the data of the last the first paging 7 of gained to this blank block (step 614).Then, controller 206 replaces block 400 (step 616) with this blank block.In an embodiment, controller 206 corresponds to the physical blocks address that stores the blank block of replying the gained data with the logical block addresses of block 400, so that replace block 400.At last, the block 400 of controller 206 removing data damage.
The present invention in every document write finish after just data to the backup information storage area of the strong paging of may the generation data damaging of backup in advance.Damage when data in case take place, just can be by being obtained the source book that the strong paging of damaging takes place by part data storage district, and and then reply the data blocks of damaging.
Though the present invention discloses as above with preferred embodiment; right its is not in order to qualification the present invention, any those skilled in the art, without departing from the spirit and scope of the present invention; when can doing a little modification and perfect, so protection scope of the present invention is when with being as the criterion that claims were defined.

Claims (18)

1. the method that flash memory prevention data is damaged comprises the following steps:
When a controller is finished a plurality of paging of one first block that writes document to a flash memory, find out the last weak paging of one in those a plurality of pagings;
Find out and be somebody's turn to do last weak corresponding the last the first paging of paging;
Decision a plurality of strong paging between the paging between this last the first paging and a little less than being somebody's turn to do at last; And
Duplicate the backup information storage area of the data of these a plurality of strong pagings, reply the usefulness of data when damaging for data to this flash memory.
2. the method that flash memory prevention data as claimed in claim 1 is damaged is characterized in that, the step of finding out this last weak paging comprises:
Find out the last paging in those a plurality of pagings;
If this last paging is weak paging, then this last paging of decision is for being somebody's turn to do last weak paging; And
If this last paging is strong paging, determine that then the weak paging before this last paging is should last weak paging.
3. the method that flash memory prevention data as claimed in claim 1 is damaged, it is characterized in that, when this controller receives a 0x24 write command writing this document to this flash memory, and this document write to finish be that whether to detect that the current potential of a data line of this controller and this flash memory replys from a busy condition be an armed state.
4. the method that flash memory prevention data as claimed in claim 1 is damaged, it is characterized in that, when this controller receives a 0x25 write command writing this document to this flash memory, and this document write to finish be to detect whether this controller receives a 0x12 the finish command.
5. the method that flash memory prevention data as claimed in claim 1 is damaged is characterized in that this method more comprises:
When the process of one second paging that data is write to this first block of this flash memory when this controller makes a mistake, check whether this second paging is a weak paging;
If this second paging is a weak paging, find out and corresponding the last the second paging of this second paging;
Search this backup information storage area, to obtain the backup information of this last the second paging; And
Reply the data of this last the second paging according to the backup information of this last the second paging.
6. the method that flash memory prevention data as claimed in claim 5 is damaged is characterized in that the return phase of the data of this last the second paging comprises:
Obtain second block of a blank;
Write this second block with the data of this first block and from the backup information of this resulting this last the second paging in backup information storage area;
Replace this first block with this second block; And
Remove this first block.
7. the method that flash memory prevention data as claimed in claim 6 is damaged is characterized in that the step that replaces this first block with this second block comprises that the logical block addresses with this first block corresponds to the physical blocks address of this second block.
8. the method that flash memory prevention data as claimed in claim 1 is damaged is characterized in that, this strong paging needs the short programming time, and should weak paging need the long programming time.
9. the method that flash memory prevention data as claimed in claim 1 is damaged, it is characterized in that, each paging of this first block can be weak paging or strong paging, and each weak paging has corresponding strong paging with it, when wherein the process that data is write a weak paging when this controller makes a mistake, there is the very big probability can the damage of generation data with corresponding this strong paging of paging a little less than this.
10. a flash card can the prevention data be damaged, and comprising:
One flash memory; And
One controller, when finishing when writing a document to a plurality of paging of one first block of this flash memory, find out the last weak paging of one in those a plurality of pagings, find out and be somebody's turn to do last weak corresponding the last the first paging of paging, decision a plurality of strong paging between the paging between this last the first paging and a little less than being somebody's turn to do at last, and duplicate the backup information storage area of the data of these a plurality of strong pagings to this flash memory, reply the usefulness of data when damaging for data.
11. flash card as claimed in claim 10, it is characterized in that, this controller is found out the last paging in those a plurality of pagings earlier, if being weak paging, this last paging then determine this last paging for being somebody's turn to do last weak paging, as if this last paging is that strong paging then determines this last paging weak paging before to be paging a little less than being somebody's turn to do at last, finds out this last weak paging to reach.
12. flash card as claimed in claim 10, it is characterized in that, when this controller receives a 0x24 write command writing this document to this flash memory, and this document write to finish be that whether to detect that the current potential of a data line of this controller and this flash memory replys from a busy condition be an armed state.
13. flash card as claimed in claim 10 is characterized in that, when this controller receives a 0x25 write command writing this document to this flash memory, and this document write to finish be to detect whether this controller receives a 0x12 the finish command.
14. flash card as claimed in claim 10, it is characterized in that, when the process of one second paging that data is write to this first block of this flash memory when this controller makes a mistake, whether this second paging is a weak paging in this controller inspection, if this second paging is a weak paging, then this controller is found out and corresponding the last the second paging of this second paging, search this backup information storage area obtaining the backup information of this last the second paging, and reply the data of this last the second paging according to the backup information of this last the second paging.
15. flash card as claimed in claim 14, it is characterized in that, this controller is at first obtained second block of a blank, write this second block with the data of this first block and from the backup information of this resulting this last the second paging in backup information storage area, replace this first block with this second block, then remove this first block, to reach the data of replying this last the second paging.
16. flash card as claimed in claim 15 is characterized in that, this controller corresponds to the physical blocks address of this second block with the logical block addresses of this first block, to reach this second block is replaced this first block.
17. flash card as claimed in claim 10 is characterized in that, this strong paging needs the short programming time, and should weak paging need the long programming time.
18. flash card as claimed in claim 10, it is characterized in that, each paging of this first block can be weak paging or strong paging, and each weak paging has corresponding strong paging with it, when wherein the process that data is write a weak paging when this controller makes a mistake, there is the very big probability can the damage of generation data with corresponding this strong paging of paging a little less than this.
CN2008101761409A 2008-07-02 2008-11-06 Flash card and method for flash memory to prevent data from being damaged Active CN101620575B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2009/072596 WO2010000205A1 (en) 2008-07-02 2009-07-02 Flash memory apparatus and method for securing a flash memory from data damage

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
US7754908P 2008-07-02 2008-07-02
US61/077,549 2008-07-02

Publications (2)

Publication Number Publication Date
CN101620575A true CN101620575A (en) 2010-01-06
CN101620575B CN101620575B (en) 2011-07-27

Family

ID=41513822

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2008101761409A Active CN101620575B (en) 2008-07-02 2008-11-06 Flash card and method for flash memory to prevent data from being damaged

Country Status (2)

Country Link
CN (1) CN101620575B (en)
TW (1) TWI386803B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103514101A (en) * 2012-06-18 2014-01-15 慧荣科技股份有限公司 Method for accessing flash memory and related memory device

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI438632B (en) 2011-04-14 2014-05-21 Mstar Semiconductor Inc Controlling method and controller for memory
TWI492052B (en) * 2012-06-18 2015-07-11 Silicon Motion Inc Method for accessing flash memory and associated memory device

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW484064B (en) * 1999-07-12 2002-04-21 Feiya Technology Corp Flash memory management, data linking architecture and algorithm
US6349056B1 (en) * 2000-12-28 2002-02-19 Sandisk Corporation Method and structure for efficient data verification operation for non-volatile memories
TWI240862B (en) * 2003-04-22 2005-10-01 Mobitek Comm Corp File system managing-method of flash memory and its logic framework
US7275140B2 (en) * 2005-05-12 2007-09-25 Sandisk Il Ltd. Flash memory management method that is resistant to data corruption by power loss
US20070086244A1 (en) * 2005-10-17 2007-04-19 Msystems Ltd. Data restoration in case of page-programming failure
JP2008033801A (en) * 2006-07-31 2008-02-14 Victor Co Of Japan Ltd Memory data management device
CN1936866A (en) * 2006-08-18 2007-03-28 福昭科技(深圳)有限公司 Flash memory body storing mechanism with data restoring function
JP2008146253A (en) * 2006-12-07 2008-06-26 Sony Corp Storage device, computer system, and data processing method for storage device
CN100555246C (en) * 2007-09-24 2009-10-28 中兴通讯股份有限公司 A kind of on flash memory the system and method for access data

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103514101A (en) * 2012-06-18 2014-01-15 慧荣科技股份有限公司 Method for accessing flash memory and related memory device
US9384125B2 (en) 2012-06-18 2016-07-05 Silicon Motion Inc. Method for accessing flash memory having pages used for data backup and associated memory device

Also Published As

Publication number Publication date
TWI386803B (en) 2013-02-21
CN101620575B (en) 2011-07-27
TW201003399A (en) 2010-01-16

Similar Documents

Publication Publication Date Title
US8006030B2 (en) Memory controller for identifying the last valid page/segment in a physical block of a flash memory
JP4633802B2 (en) Nonvolatile storage device, data read method, and management table creation method
CN101859604B (en) Utilization method of flash memory bad block
US20110238898A1 (en) Nonvolatile memory controller and nonvolatile storage device
CN103995756B (en) Storage control, storage device, information processing system and storage controlling method
CN101599305B (en) Storage system with data repair function and data repair method thereof
TW201719416A (en) Data storage device and data maintenance method thereof
US20130097362A1 (en) Data writing method, and memory controller and memory storage apparatus using the same
CN103645972A (en) Method and device for automatic recovery of system
US8074012B2 (en) Flash memory apparatus and method for securing a flash memory from data damage
US9552287B2 (en) Data management method, memory controller and embedded memory storage apparatus using the same
KR102114642B1 (en) Data protection method, apparatus and device
CN103218274A (en) Failure accumulation preventing method and solid state disk
CN106354652B (en) Nonvolatile memory read-write control circuit
CN102298543A (en) Memory management method and memory management device
CN103136108A (en) Quick flashing memory device and data reading method thereof
JPWO2009004674A1 (en) Storage device, disk device, write determination method, control device
CN103778964A (en) Processing and using method, device and system for NAND Flash programmed data,
CN102959548A (en) Data storage method, search method and device
CN105608013A (en) MRAM-integrated memory card control chip and memory card
CN101620575B (en) Flash card and method for flash memory to prevent data from being damaged
US20160124650A1 (en) Data Storage Device and Flash Memory Control Method
CN102737716B (en) Memorizer memory devices, Memory Controller and method for writing data
CN111324289B (en) Memory device
CN105446652A (en) Method and device for storing camera shooting data

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