CN101403986A - Disaster tolerance technology for storing and leading out flash memory data - Google Patents

Disaster tolerance technology for storing and leading out flash memory data Download PDF

Info

Publication number
CN101403986A
CN101403986A CNA2008101976148A CN200810197614A CN101403986A CN 101403986 A CN101403986 A CN 101403986A CN A2008101976148 A CNA2008101976148 A CN A2008101976148A CN 200810197614 A CN200810197614 A CN 200810197614A CN 101403986 A CN101403986 A CN 101403986A
Authority
CN
China
Prior art keywords
data
measuring point
read
disaster tolerance
little
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
CNA2008101976148A
Other languages
Chinese (zh)
Other versions
CN101403986B (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.)
No709 Inst China Ship Heavy Industry Group Co Ltd
709th Research Institute of CSIC
Original Assignee
No709 Inst China Ship Heavy Industry Group 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 No709 Inst China Ship Heavy Industry Group Co Ltd filed Critical No709 Inst China Ship Heavy Industry Group Co Ltd
Priority to CN 200810197614 priority Critical patent/CN101403986B/en
Publication of CN101403986A publication Critical patent/CN101403986A/en
Application granted granted Critical
Publication of CN101403986B publication Critical patent/CN101403986B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

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

Abstract

The invention relates to a disaster recovery technology for storing or educing data by flash memory, which comprises that an atomic operation is designed and all the interior operations are executed during the process of atomic operation; if the operations stop abnormally, all the operated contents are abandoned. The disaster recovery technology has the advantages that when the system is corrupted suddenly, the data stored by the flash memory is guaranteed to have no bad influence on the data stored before and after due to the loss of the data stored by the flash memory, namely, if the electricity of the system is cut off, the data which the system records is lost certainly; but the storing operation can be executed continuously and the result stored before and after is not interfered when the same data is recorded next time; namely, each batch of data can be stored completely, or the data fails to be stored.

Description

The disaster tolerance technology of flash data storage/derivation
Technical field
The present invention relates to flash memory, specifically, relate to that system is in service to carry out in the storing process data, situations such as the unexpected power down of system take place and have caused system crash to quit work, and start-up system once more is when writing new a collection of data again, that batch data that writes when guaranteeing except system crash is invalid, the data of all operate as normal record and the data that write down of all operate as normal afterwards can be guaranteed effectively to charge to, and reclaim by certain retrieval management way before the collapse.
Background technology
In scientific research process; usually can be at random or regular with a collection of data recording that collects among some memory devices; by the time after certain time limit, the scientific research personnel carries out unloading with all data that write down by software, analyzes then and studies.Therefore design one and repeatedly store the data-storage system of repeatedly deriving, for the modern scientific research person, be very important.
Flash memory device has very big advantage for the storage of Large Volume Data in the embedded system.Yet different with magnetic storage apparatus that can the overwrite data, flash memory can't the overwrite data.For overwrite is stored in data in the flash memory, must at first wipe existing data.Owing to the time of wiping cost is long, the space size of therefore wiping is general fixing, and the size that writes the space can be controlled, and same like this some unnecessary data that can cause are wiped free of.
In existing environment, often some rugged environments can cause system crash, if writing down a collection of valid data this moment, this batch data is a record part only, often the user does not need a collection of so incomplete data, so this batch data can be abandoned.But, can not recover these data because power down etc. cause system to quit work.The only guaranteed record that batch data can be complete down of user, and the data of all complete documentations before preserving are just passable.And flash memory be can't overwrite memory device, the partial data that those have been recorded after being recorded, if it is impossible continuing record data in its position, need be distinguished those and complete data area occur not writing down because of collapse.
And, the present invention proposes measuring point and reading a little, about measuring point with read acting on argumentation is hereinafter arranged a little.Therefore, if neither one disaster tolerance mechanism, may cause when collapsing so to read a little/measuring point and real data area are inconsistent, there is mistake the data area and our the actual position that will charge to of measuring point sensing just, read the data area of a sensing and valid data position that we will read mistake is arranged, such result is a danger close, can cause whole historical data all can all lose in the time of serious.
Summary of the invention
The objective of the invention is to develop a kind of at above-mentioned application background, data are carried out in the storing process in that computer system is in service, situations such as the unexpected power down of system take place and have caused system crash to quit work, start-up system once more, when writing newly a collection of data again, that batch data that writes when guaranteeing except system crash is invalid, the data of all operate as normal record and the data that write down of all operate as normal afterwards before the collapse, can guarantee effectively to charge to, and the disaster tolerance technology of the flash data storage/derivation of reclaiming by certain retrieval management way.
The disaster tolerance technology of flash data storage/derivation of the present invention comprises: design an atomic operation, and any built-in function in the atomic operation process or all execution, if abnormal end, the content of so having operated all abandons.That is to say, user program is submitted a batch data to, and this batch data or all be credited to so is if any abnormal end occurs in the recording process, to before and the data of effectively charging to afterwards without any influence, and a batch data of charging to abnormal end the time will all be dropped.
The present invention requires the user must understand the ABC of NandFlash and NorFlash programming, and certain programming experience about flash memory is preferably arranged.The present invention only considers hardware software disaster tolerance technology just often, if NandFlash or NorFlash break down, that the present invention is not considered.The mistake of bit may occur at NandFlash, can adopt relevant Hamming code verification or redundancy to handle, that is the problem of error correction, and the present invention is not considered.The present invention supposes that here the NandFlash space enough can hold all data, cover the possibility that takes place when not considering the record space restriction, at covering problem, because the content that relates to is many, here can't disposablely describe, other patents of invention of my application are done to discuss in detail in addition.
The present invention's record is what to write down according to the sequence of addresses on NorFlash and the NandFlash.
Among the present invention, the initial physical location that a measuring point (also being referred to as write pointer) is told system's each record one batch data is set, why measuring point is set is branch batch records because of record data; And be provided with one and read the initial physical location that point (also being referred to as read pointer) is told system's each derivation one batch data, guarantee that the data that read do not have misdata, it a little is because user's derived data also is one leads that same setting is read; Rationally use these two kinds of pointers, guarantee the disaster tolerance of system.
Among the present invention, by strict ocntrol-metering point and the order of reading a little of charging to, the measuring point of coming the assurance system to collapse halfway may to cause and reading under the loss situation, program implementation status in the time of can the correct positioning system crash, and carrying out that can be correct some handle in earlier stage.
Among the present invention, about measuring point with read searching a little, invention has provided a kind ofly searches measuring point fast and accurately and reads a little method, when guaranteeing the disaster generation, provides measuring point fast and reads a little effective value.Consider the instability of NandFlash, require measuring point here and read a little all to be logged among the NorFlash that what NandFlash charged to is data.
Among the present invention, because measuring point is constantly charged to, being fully loaded with may appear in NorFlash---and be that the NorFlash space takes NorFlash.In order to guarantee to have caused losing of measuring point, taked certain measure in the invention because of system crash.
Among the present invention,, proposed the definition of four kinds of data blocks of different nature, considered the instability of NandFlash, adopted suitable mark way, correctly distinguished this four kinds of data blocks for correct differentiation invalid data and bad block data.Simultaneously, based on these four kinds of data of different types pieces, under the situation of considering disaster tolerance, proposed at the disposal route in the read-write process of these four kinds of data blocks.
Among the present invention,, provided the operating process of operation NandFlash and NorFlash in order to coordinate the disaster tolerance technology of NandFlash and NorFlash.
Some measuring point that provide among the present invention and read a disposal route, also can allow the user careless destroy read a little or the situation of measuring point under, can carry out suitable recovery.
The advantage of the disaster tolerance technology of flash data storage/derivation of the present invention is: when unexpected collapse appears in system, the data that guarantee flash memory storage can not produce harmful effect to the data of front and back storage because of losing midway, that is to say, if the unexpected power down of system, the data that writing down of system are certain to lose so, this has no idea to keep, but when can guarantee to charge to same data next time, can allow storage operation to continue to carry out, and the result of storage before and after can not disturbing; That is to say, every batch data or all deposit in, or deposit failure in.
Description of drawings
Fig. 1 is the hardware architecture synoptic diagram.
Fig. 2 is a NorFlash processing sequence synoptic diagram.
Fig. 3 is measuring point and the search procedure synoptic diagram of reading a little.
Embodiment
Be illustrated in figure 1 as this data recording hardware block diagram structure, in the figure, CPU can visit two flash memories---NandFlash and NorFlash simultaneously, and in the whole recording process and the derivation of data, CPU achieves the goal by controlling these two Flash always.Here all discussion all are that piece number at NorFlash and NandFlash is all more than 4.
Considering measuring point and reading a little is very crucial data, in the process of design with measuring point with read a little to be logged among the NorFlash, and the data of obtaining are logged among the NandFlash, because the reliability of NorFlash is higher than NandFlash, it can guarantee the correctness of data recording, and it a little is suitable therefore being used for the measuring point of recorded key and reading.
1. measuring point and read a little disaster tolerance technology
1.1NorFlash last inscription record point and read a little disaster tolerance technology
The front is mentioned, and the initial physical location that a measuring point (also being referred to as write pointer) is told system's each record one batch data is set in the invention.For the ease of derived data, also be provided with one in the invention and read point (also being referred to as read pointer) and tell when the each data of system derive, read the initial physical location of NandFlash.
Is to determine according to the cell size of NandFlash about measuring point with the width of reading a little.If NandFlash is no more than 2G (2 31, consider that NandFlash covers zone bit) or 4G (2 32, do not consider that NandFlash covers zone bit) and individual data unit, measuring point and read a little to take the integer data of 32 bits then, otherwise take the data of 64 bits.The space size that the address of original 32 bits can be controlled is 4G, and the purpose of doing like this in case the phenomenon that data cover occurred, can be designated as the most significant digit of measuring point " 1 " in order to guarantee no matter how these measuring point are used.At the NandFlash Large Volume Data, need cover processing to NandFlash, another patent of my application " allowing the flash memory uniform wear circulating queue technology of covering " is done to discuss in detail.
In order to prevent the measuring point that system crash causes and read a little to lose that the present invention charges to NorFlash four data at every turn, first data begin to charge to most, by charging to complete " 0 ", represent that the action that this batch data begins to handle has taken place.Charge to then read a little or measuring point in corresponding position, charge to the value of complete " 0 " at last---more than four numbers charged to according to being referred to as four cell datas, generally charge to complete " 0 " and represent that the operation of measuring point finishes.A little is example with 32 measuring point with reading, if the sign that action takes place is not 0x00000000, think that then this operation does not begin, if the sign of release is not 0xffffffff, think that then operation finishes, why Here it is charges to the reason of numerical value 0.
Disaster tolerance is analyzed: why the mark of a beginning and the mark of an end are set, and mainly are to guarantee measuring point and read a little not only to have charged to, and complete charging to.When can guarantee data recording like this, whether system's end of record midway appears when can correctly judge last registration.If system closure may have been charged to a collection of dirty data so, at this time will distinguish the zone at dirty data place, keep clean data.Wherein may need the valid data that are in the dirty data zone are carried, need to upgrade measuring point in the carrying or read a little.Even in the process that data are moved, system crash occurred, also can judge guilty culprit.
In the time of data recording, each batch data that finishes that writes down all needs the amendment record point, points to the initial physical location of new recorded data, reads a little constant.When data derived, every derivation finished a part of data, and deriving finishes just will read a modification, and measuring point is constant.No matter be that amendment record point or modification are read a little at every turn, all need to write down then and once read a little and a measuring point after the sign of an action beginning of record earlier, write down an end mark again and represent that record finishes.
1.2NorFlash the fully loaded disaster tolerance technology of data
If at inscription record point with read in a little the process because the NorFlash space is limited, caused spatial registration full, as Fig. 2 for NorFlash in record measuring point/read the mobile order of pointer in the point process, this forms a round-robin queue in proper order.When the space is fully loaded, again from first unit opening entry.
Before half-and-half searching, by having at least one to charge to data in last four cell data of judging last piece, show that then NorFlash writes all over, need wipe NorFlash and continue record.Yet consider based on disaster tolerance, need at first wipe first NorFlash piece, with several effective measuring point of NorFlash space trailer record with read a little to copy to first block space.All then that NorFlash is remaining pieces are wiped successively, and the purpose of duplicating is a little can be unlikely to lose when all remaining pieces are wiped in order to guarantee nearest several effective measuring point and to read.If occurred system crash equally in the reproduction process or when wiping last several, then last several last plurality of units has still write down data, in next start-up routine, can repeat above process equally.(replenish: owing to carry out in the epimere content process, power down occurs in the process of last blocks of data of NorFlash and caused those measuring point that need copy to first/read point data to be modified if wipe, that consequence also is serious.Therefore, need to judge whether penult NorFlash data block is wiped free of (whether is that complete " 1 " is determined by judging corresponding action opening flag and end mark), if be wiped free of, show that then it is correct that data are duplicated, directly wipe last piece, otherwise need to carry out the step that epimere is carried out, just several effective measuring point of NorFlash space trailer record and read a little to copy to first block space).
1.3NorFlash the disaster tolerance technology of last measuring point/read a little to search
About valid data measuring point and the implementation method of reading a little of searching, consider based on disaster tolerance simultaneously, take following method.In the time of each record data or derived data, all need to search measuring point and read a little.Because each measuring point and the way of reading a little of charging to are according to charging to beginning flag earlier, charge to then and read a little, inscription record point again, the way that charging at last finishes indicates is determined.Because the physical space size of NorFlash is 2 nIn order to save the time of searching, data recording point and read a little to search be way according to half-and-half searching, the foundation of judging is whether each numerical value of four cell datas of each location is complete " 1 ", if all values all are complete " 1 " (being exactly 0xffffffff for 32), then search to first half, represent that this unit do not charged to data, otherwise think its data-in, search to latter half of.
The data that find according to double lookup method are determined measuring point and are read a validity again.After half-and-half searching, in four data of reading,, then show the measuring point that comprises in these four unit and read point data effective if last unit has been recorded a number (these data are non-complete " 1 ") at random.Otherwise by judging that whether measuring point is non-complete " 1 " data, judge whether read point data effective.If read a little to charge to effectively, will read a preservation, read the data of four unit, front again, circulation searching is judged, up to finding out effective measuring point.If do not have effective measuring point and read a little, then can only search effective measuring point forward and read a little.
Search flow process as shown in Figure 3.
2.NandFlash the disaster tolerance technology of data
As can be seen from Figure 2, after measuring point on NorFlash/read point data is read out, just possibly NandFlash is carried out disaster tolerance and handle, directly begin data-in under the normal condition toward the address that measuring point is pointed to, without any the processing of disaster tolerance, just do not go through here.
Disaster tolerance in the time of at the collapse that may occur is handled, and in conjunction with the NandFlash feature, key will be done following processing here.
2.1 NandFlash Block Sort based on the disaster tolerance consideration
NandFlash itself just is divided into two kinds of active block and invalid block to data block, generally accepts or rejects according to this enabledisable piece exactly.But being based on disaster tolerance considers, in NandFlash data-in process, it or not the simple effective invalid block of mark, following several possibility also occurs: first kind of situation is, if a data block is originally as active block, but there is the dirty data of part in the data of such data block record owing to reasons such as power down, because can not continue to charge to inside new data this moment, in order to avoid mix with dirty data; Though can continue to charge to new data if wipe this data block this moment, but the part valid data that cause having charged to are destroyed, and consider based on disaster tolerance, and the data of this piece are carried out mark, if be logged into this position from now on again, can wipe this piece and charge to again; Second kind of situation is, a data block itself is an invalid block, but such data block has been charged to the part active data inside when being found to be invalid block, if be directly labeled as invalid data block with this blocks of data this moment, when deriving, will lose the data that those have been charged to so, if the valid data that will charge to are moved again, it can be a very big workload, can become the bottleneck of a record, in view of this consideration, need carry out mark to this piece, be logged into this position from now on again, directly skip this data block.So, also need further segmentation based on active block and invalid block.So, following classification is just arranged:
Permanent invalid block: be exactly that this data block is physically invalid, and also top without any valid data, forever all can not charge to the invalid data block of new data from now on.
Temporary transient active block:,, before not deriving these data, this piece can not be lost as permanent invalid block because this piece part page or leaf is still being stored the part valid data though this data block is invalid.Derived up to these data, just it can be labeled as permanent invalid block.
Can wipe active block: be exactly that this data block is physically effective, and can be wiped free of the active block that use also can not cause loss of data again.
Temporary transient invalid block: though this data block is physically effective, but owing to system crash reasons such as power down cause on it reserve part active data still, these data can not be wiped free of, but can't on this data block, charge to new data, because the disaster reason causes system to charge to dirty data, can't continue in the new data of these position overwrites.Therefore this data block has become temporary transient invalid block surely.
2.2 storage and disaster tolerance technology at different N andFlash data block
Because there is remaining space in NandFlash, mark is logged in the remaining space.Before charging to a new data block, to wipe this new data block earlier at every turn.Therefore, wipe certain data block and judge whether that earlier bad mark has been arranged before,, then do not wipe this piece, wipe next data block if find it is permanent invalid block.If temporary transient active block, then need this piece is labeled as permanent invalid block, allow from now on and never to use, do not wipe this piece equally, wipe next data block.If occurred physically damaging when wiping this piece and the data block that causes is invalid, then directly it is labeled as permanent invalid block, continue to wipe next data block.
If in the process of programming, then divide several situations:
(1) if in the time of initial one page of these record data, this page kept the tail of last batch data, and finds that the recorded data piece is bad this moment, then needs to be labeled as temporary transient active block.Consider based on disaster tolerance, according to following flow operations: at first need to be recorded in the valid data removal of home of the last consignment of record in this one page, move on to the next one and can wipe first page of active block.Do a temporary transient active block sign then.Again this one page is done a sign, stop to this position in the time of so next derived data.Calculate new measuring point, charge among the NorFlash.
Disaster tolerance is analyzed: if termination occurred in this process, after then starting next time, charged to temporary transient active block mark if find this piece, then according to (1) situation, continued this one page of sign, measuring point is charged among the NorFlash.Otherwise the mode according to (3) is handled, though be labeled as temporary transient invalid block since its physically invalid can be in recording process next time, identified.
(2) if not initial one page of record data the time, that is to say, this page do not have to keep the tail of going up batch data, at this moment find that the recorded data piece is bad, owing to charged to the part valid data, need do the mark and the temporary transient active block mark of a bad page or leaf, but when handle this piece next time once more, this piece is labeled as permanent invalid block.
Disaster tolerance is analyzed: if termination occurred in this process, after then starting next time, be marked as temporary transient active block mark if find this piece, then according to the operating process of top (1), continue the page or leaf at flag data tail place, charge to new measuring point to NorFlash, otherwise handle according to following (3).
(3) if do not occur invalid block in the recording process, but unusual because system crash stops, when starting once more, can and read a little whether complete documentation judges whether to occur system crash by the NorFlash measuring point, then need to be labeled as temporary transient invalid block.Consider based on disaster tolerance, according to following flow operations: at first need to be recorded in the valid data removal of home of the last consignment of record in this one page, move on to the next one and can wipe first page of active block.Do a temporary transient invalid block mark then.Again this one page is done a sign, stop to this position in the time of so next derived data.Calculate new measuring point, charge among the NorFlash.
Disaster tolerance is analyzed: if termination occurred in this process, after then starting next time, be marked as temporary transient invalid block mark if find this piece, then according to the situation of (3), continue this one page of mark, charge to new measuring point, handle otherwise repeat (3) to NorFlash.
(4) if in the recording process, certain data block has been marked as temporary transient invalid block, then at first formats the data of this piece, makes it to charge to new data, becomes and can wipe active block.
2.3 the disaster tolerance technology of reading at different N andFlash data block
Can not cause NandFlash invalid about reading NandFlash, can not occur misreading yet because of system crash midway because in the process of reading to data without any modification, therefore only need read again.As for the disaster tolerance of reading, mainly be based on four kinds of different data blocks and control.When data derive, handle the data block that four kinds of situations are arranged:
First kind of situation: if temporary transient active block needs then to judge whether every page of this piece effectively decides the data of this page whether should to be derived.After the data of all good pages or leaves of this piece are finished by derivation, though this data block has lost effect, can not continue to use, but this process rushes this piece is labeled as permanent invalid block, mark again when allowing next data-in, the purpose of doing like this is in order to guarantee if this time the data that derive are invalid, can also continue derives, if be labeled as permanent bad piece, mean that then one of this blocks of data all can not derive once more.This also is based on the disaster tolerance consideration.
Second kind of situation: be that this piece has been permanent invalid block, then this data block is directly skipped, and does not derive any data;
The third situation: this piece is a temporary transient invalid block, needs then to judge whether every page of this piece effectively decides the data of this page whether should to be derived.After the data of all good pages or leaves of this piece are finished by derivation, this data block can also continue to use, but rushing this piece is labeled as, this process can wipe active block, mark again when allowing next data-in, the purpose of doing like this is in order to guarantee if this time the data that derive are invalid, can also continue derives, and can wipe active block if be labeled as, and means that then all data of this piece can derive once more.This also is based on the disaster tolerance consideration.
The 4th kind of situation: this piece is then directly read the data that all have write down for can wipe active block.
2.4NandFlash page or leaf in data block and the piece is carried out mark
Utilize the remaining space of NandFlash to come four kinds of data of different types pieces of mark, in general NandFlash provides sufficient remaining space to being used for effects such as ECC verification, marked invalid piece in the user program process, and remaining space generally all can have sufficient capacity to be used for mark.
Because after Nand type Flash was wiped free of, all bits all became " 1 ", for mark, exactly " 1 " are become " 0 ".For wiping active block, can any mark.Consider that simultaneously the NandFlash bit makes mistakes, suggestion here takes to write for three times the way of " 0 ", if complete " 0 " is arranged in three times twice, thinks that then mark exists.
For the marked region of block type and the marked region of page or leaf type, can not overlap, otherwise can not distinguish.For example, if three unit, remaining space front are the piece marked region, then the page marker zone can not be marked at three unit, front of remaining space.
Here suppose that piece is marked at three unit, front of remaining space, page marker is in three unit, back of remaining space, and the block mark among the NandFlash is divided into three kinds of situations:
(1) if this piece needs by permanent invalid block, mark " 0 " in first three unit of remaining space of first of this piece page and second page then;
(2) if this piece is temporary transient active block, first three unit mark " 0 " of first of this piece page remaining space then, and first invalid data page or leaf of this piece made page marker, at back three unit marks " 0 " of its remaining space;
(3) if this piece is temporary transient invalid block, first three unit mark " 0 " of second of this piece page remaining space then, and first invalid data page or leaf of this piece made page marker, at back three unit marks " 0 " of its remaining space;
(4) if this piece for can wipe active block, then need not any mark.
3. the disaster tolerance technology of data recording and derivation
Processing and NandFlash that NorFlash measuring point/read storage and disaster tolerance a little has been discussed respectively above carry out the processing of disaster tolerance to data.This disaster tolerance technology has guaranteed that measuring point/read a little is recorded or the disaster tolerance searched the time is handled.The relation that successively is recorded by four cell datas guarantees each or four unit are all charged to, otherwise when a record part occurring, it is effective can to allow program judge which measuring point, and which measuring point is invalid.For the ease of utilizing binary search, the data of these four unit also will be remained their position even without all successfully charging to.Four new cell datas can not take the space here.The foundation of search then is based on the data characteristics after NorFlash is wiped free of.Because measuring point/reading the very possible NorFlash appearance of a little frequent record is fully loaded with, and at this time just need wipe, and also has the problem of power down in wiping so, therefore also discusses fully loaded handling problem.
About NandFlash mainly is to provide four kinds of data of different types pieces, according to these four kinds of different types of data pieces disaster tolerance has been discussed respectively and has been read and the disaster tolerance writing technology, and discussed and how those data blocks have been carried out mark and page or leaf carries out mark.Yet, in the process of reality, should consider that measuring point/read disaster tolerance a little handles, also the appearance that will consider the NandFlash data is in technology, and the two combines and handles.When this part is then mainly discussed these two contents is combined, the disaster tolerance of system and the relation between the two.
3.1 the co-ordination of NandFlash and NorFlash under the normal condition
In data recording and derivation process, as long as start-of-record, so at first will charge to the sign complete " 0 " of beginning, any then operation causes reads a little/and one of measuring point is modified, will charge to NorFlash timely, and charge to the remainder of four cell datas again, and order is to charge to earlier to read a little, inscription record point again, last end of record (EOR) operational label complete " 0 ".
Under the normal condition, if record NandFlash, then read a little can not change, directly charge to and read a little, then to the NandFlash record data, in this process main pay close attention to whether new permanent invalid block appear, how to skip permanent invalid block, temporary transient active block etc. whether occurs, just known the size of new measuring point after handling.Charge to an end mark then.
If derive the NandFlash data, then read a meeting and be modified, therefore need to derive earlier the NandFlash partial data, in deriving the NandFlash data procedures, mainly be how to skip permanent invalid block, choose the valid data of temporary transient active block, read all data that to wipe active block.Charge to new reading a little after deriving, it is a little constant to hold the record again, promptly as the end operation mark.
3.2 the co-ordination of NandFlash and NorFlash under the abnormal conditions
Owing to before the NorFlash zone be complete " 1 ", therefore, so long as not complete " 1 ", then proof necessarily was modified.Order according to top four cell datas record if the back is modified, system crash do not occur when then proving all unit records of front.So just can determine whether to occur collapse, the measuring point of handling before the collapse or read point which is effective.
When unusual reason condition occurring, at first need to locate effective measuring point and read a little, write down the atomic operation opening flag then.
If be record NandFlash before, record time once more after restarting, then read a little can not change, directly charge to and read a little, need the temporary transient invalid block of mark and invalid page then, perhaps to before collapsing the temporary transient invalid block of mark further handle.Temporary transient invalid block moved just known the size of new measuring point after handling.Charge to an end mark then.Carry out normal recordings according to 3.1 step again.
Derive the NandFlash data if be before, derive several once more after restarting, if read a record effectively, illustrative system collapse to the data of having read without any influence, data are derived, directly, charge to end mark then, continue normal read operations charging to that effective measuring point repeats.If read a protocol failure, owing to read the NandFlash data are not revised, and crucial reading a little/measuring point is not made any modification among the NorFlash, only needs charge to beginning label in the next space of NorFlash again, carries out new one and takes turns normal derivation operation.
4. other content of the present invention
In fact, formatted as long as the NandFlash data do not have among the present invention, because all historical measuring point generally can also be saved as long as covering does not appear in NorFlash, the inquiry through appropriateness also can recover more historical data.
If format NandFlash space can be read a little/measuring point by modification, such as all pointing to the starting position.So just know that the NandFlash space can reuse.

Claims (7)

1, a kind of disaster tolerance technology of flash data storage/derivation is characterized in that: comprising: design an atomic operation, and any built-in function in the atomic operation process or all execution, if abnormal end, the content of so having operated all abandons; That is to say, user program is submitted a batch data to, and this batch data or all be credited to so is if any abnormal end occurs in the recording process, to before and the data of effectively charging to afterwards without any influence, and a batch data of charging to abnormal end the time will all be dropped.
2, the disaster tolerance technology of flash data storage/derivation according to claim 1 is characterized in that: in the atomic operation process, a measuring point is set at first, also is referred to as write pointer, tell the initial physical location of system's each record one batch data; And be provided with one and read a little, also be referred to as read pointer, tell system each initial physical location of deriving a batch data; Then, by strict ocntrol-metering point and the order of reading a little of charging to, the measuring point of coming the assurance system to collapse halfway may to cause and reading under the loss situation, program implementation status in the time of can the correct positioning system crash, and carrying out that can be correct some handle in earlier stage.
3, the disaster tolerance technology of flash data storage/derivation according to claim 2, it is characterized in that: measuring point and read searching a little, provide a kind of measuring point and method of reading a little of searching fast and accurately, when guaranteeing that disaster takes place, provided measuring point and the effective value of reading a little fast; Consider the instability of NandFlash, require measuring point here and read a little all to be logged among the NorFlash that what NandFlash charged to is data.
4, the disaster tolerance technology of flash data storage/derivation according to claim 2 is characterized in that: because measuring point is constantly charged to, being fully loaded with may appear in NorFlash---and be that the NorFlash space takes NorFlash; In order to guarantee to have caused losing of measuring point, taked certain measure to keep not losing of data in the invention because of system crash.
5, the disaster tolerance technology of flash data storage/derivation according to claim 2, it is characterized in that: for correct differentiation invalid data and bad block data, the definition of four kinds of data blocks of different nature has been proposed, consider the instability of NandFlash, adopt suitable mark way, correctly distinguish this four kinds of data blocks; Simultaneously, based on these four kinds of data of different types pieces, under the situation of considering disaster tolerance, proposed at the disposal route in the read-write process of these four kinds of data blocks.
6, according to the disaster tolerance technology of claim 2,3 described flash data storage/derivation, it is characterized in that: some measuring point that provide among the present invention and read a disposal route, also can allow the user careless destroy read a little or the situation of measuring point under, can carry out suitable recovery.
7, according to the disaster tolerance technology of claim 2,3 described flash data storage/derivation, it is characterized in that:, provided the operating process of operation NandFlash and NorFlash in order to coordinate the disaster tolerance technology of NandFlash and NorFlash.
CN 200810197614 2008-11-12 2008-11-12 Disaster tolerance technology for storing and leading out flash memory data Expired - Fee Related CN101403986B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 200810197614 CN101403986B (en) 2008-11-12 2008-11-12 Disaster tolerance technology for storing and leading out flash memory data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 200810197614 CN101403986B (en) 2008-11-12 2008-11-12 Disaster tolerance technology for storing and leading out flash memory data

Publications (2)

Publication Number Publication Date
CN101403986A true CN101403986A (en) 2009-04-08
CN101403986B CN101403986B (en) 2010-12-08

Family

ID=40538010

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 200810197614 Expired - Fee Related CN101403986B (en) 2008-11-12 2008-11-12 Disaster tolerance technology for storing and leading out flash memory data

Country Status (1)

Country Link
CN (1) CN101403986B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108228483A (en) * 2016-12-15 2018-06-29 北京忆恒创源科技有限公司 The method and apparatus for handling atom write order

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI633428B (en) * 2017-09-28 2018-08-21 慧榮科技股份有限公司 Data storage device and methods for processing data in the data storage device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108228483A (en) * 2016-12-15 2018-06-29 北京忆恒创源科技有限公司 The method and apparatus for handling atom write order

Also Published As

Publication number Publication date
CN101403986B (en) 2010-12-08

Similar Documents

Publication Publication Date Title
US9836362B2 (en) Cyclic commit transaction protocol
CN102160030B (en) Aggregation of write traffic to data store
KR100301719B1 (en) Fault Prevention Cue System
US8028120B2 (en) System with flash memory device and data recovery method thereof
CA2818472C (en) Optimized startup verification of file system integrity
GB2330672A (en) Storing and retrieving data in a control system eg in a motor vehicle
US20070005874A1 (en) File system storing transaction records in flash-like media
US7020805B2 (en) Efficient mechanisms for detecting phantom write errors
CN103577574A (en) High-reliability linear file system based on nand flash
CN102460401A (en) Techniques for system recovery using change tracking
US5590298A (en) Method of restoring and updating records in a disk cache system during disk drive idle time using start and end addresses
US11841801B2 (en) Metadata management in non-volatile memory devices using in-memory journal
CN109240622A (en) A kind of method and system of EEPROM data write-in
CN101253485A (en) Memory arrangement and method for the operation thereof
US7657795B2 (en) Method and apparatus for writing to a target memory page of a memory
CN101403986B (en) Disaster tolerance technology for storing and leading out flash memory data
CN104169981B (en) POS terminal
JP3675375B2 (en) Nonvolatile memory and data rewriting method of nonvolatile memory
JP5541194B2 (en) Control device for reading and writing data to flash memory
CN101599032A (en) Storage node management method, control subsystem and storage system
US20100169572A1 (en) Data storage method, apparatus and system for interrupted write recovery
US20230044942A1 (en) Conditional update, delayed lookup
CN109325005A (en) A kind of data processing method and electronic equipment
CN115373608A (en) Data storage method and device
CN103389943A (en) Control device, storage device, and storage control method

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
EE01 Entry into force of recordation of patent licensing contract

Assignee: China Shipbuilding Heavy Industries (Wuhan) Long Ling Electronics Co., Ltd.

Assignor: No.709 Research Institute of China Shipbuilding Industry Corporation

Contract record no.: 2011420000070

Denomination of invention: Disaster tolerance technology for storing and leading out flash memory data

Granted publication date: 20101208

License type: Exclusive License

Open date: 20090408

Record date: 20110510

CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20101208

Termination date: 20181112