CN104391804B - A kind of NAND flash data storage methods - Google Patents
A kind of NAND flash data storage methods Download PDFInfo
- Publication number
- CN104391804B CN104391804B CN201410587504.8A CN201410587504A CN104391804B CN 104391804 B CN104391804 B CN 104391804B CN 201410587504 A CN201410587504 A CN 201410587504A CN 104391804 B CN104391804 B CN 104391804B
- Authority
- CN
- China
- Prior art keywords
- current
- record
- block
- data
- download
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Read Only Memory (AREA)
Abstract
The invention belongs to avionics field, especially relates to a kind of NAND flash data storage methods, and this method can effectively solve the problems, such as aviation airborne equipment FIELD Data storage management.This method supports multi partition operation, automatic cycle can be recorded in each subregion, possess natural abrasion equilibrium feature.It is possible to prevente effectively from the power-off problems that other management methods run into.And it can support temporally to search for and by special parameter function of search, especially in mass data storage, the spool time of a large amount of garbages can be avoided, efficiently solve aviation airborne equipment FIELD Data storage management common problem.
Description
Technical field
The invention belongs to avionics field, especially relates to a kind of NADA flash data storage methods.
Background technology
NAND FLASH Memory are a kind of erasable read-write non-volatile memories of point.It has a high density, it is low into
This, it is non-volatile, low in energy consumption, the advantages that read-write and erasing speed are fast, therefore it is widely applied in a mobile device.At present
The date storage method used in NAND FLASH, including FAT, JFFS, YAFFS etc..But because NAND FLASH press block
Erasing, the characteristics of write-in by page, and NAND FLASH life-span limitation, cause this several management method, be required to complexity
Data structure and Wear leveling algorithm are supported, and are continuously increased with the capacity of NAND FLASH page, common algorithm
New NAND FLASH application scenario is less adapted to.
In aviation airborne equipment field, one group of parameter of cycle index is generally required, and older record can be automatically deleted,
Obviously common date storage method, it is difficult the application for meeting aviation airborne equipment field mass memory.At the same time, it is airborne
The power down of equipment is often uncertain, and power-fail interrupt gives reaction time very limited, the traditional data storage side of equipment
Method is difficult that the power down process work (such as writing end-of-file mark) of data is completed in the limited time, so as to cause data
Lose.
The content of the invention
Goal of the invention:It is an object of the invention to provide a kind of NAND flash data storage methods, solve aviation electronics neck
Domain NAND FLASH mass data storage problems of management.
Technical scheme:It is block according to NAND FLASH minimum erasure unit first that the scheme that the present invention uses, which is, block by
The feature of page composition, in the mass memory of the parallel channel of multiple chips composition, it is single that minimum tube reason is formed by a laterally chunk
Hyte block, when an only chip, then block is minimum management unit;Whole data area carries out subregion according to chunk, often
The first address of individual subregion is basei, is wrapped in the header of the homepage record current block of NAND FLASH each block, header
Include the data type of current block, affiliated subregion, block serial number, logical address, resume, time and status word information, its feature exists
In comprising the following steps:
A:The step of obtaining newest record position:
A1:Each subregion first address basei is obtained from pre-assigned partition information;
A2:The homepage of block is searched for since basei, when the first byte of homepage is FF, is stopped search;Record is current
Address is offseti, as newest record position;
B:The step of record:
B1:First header, simultaneously erased subsequent data chunk, if current block is last are write at page 0 of current block
One block, then subsequent data chunk is first address;
B2:Data to be recorded are write since page 1 of current block, until data are write all over, step B1 is then back to, opens
The record for next data block that begins, until record finishes;
C:The step of power down:During power down, due to being written with header, therefore stop recording in homepage position;
D:The step of being searched for and downloaded by resume:
D1:Current address current=offseti is obtained according to step A2, into step D2;
D2:The header of record block at current-1 is read, obtains the data type of current record, affiliated subregion, block is suitable
Sequence number, logical address, resume, time and status word information;Into step D3;If current is first address, current-
Rollback is answered after 1 to the end of current bay.
D3:Judge its record record information it is whether consistent with the record information that search for and download, unanimously then from
Start Download History information at current-1- block serial numbers, current=current-1- block serial numbers are otherwise made, into step
Rapid D2;
E:The step of temporally searching for and download:
E1:The record that search for and download is found according to D1, D2, D3, into step E2;
E2:First block of current record and last blocks of header are read, obtains the data of the block of current record
M and record beginning and ending time t0, t1 are measured, into step E3;
E3:Position k=(ts-t0) ÷ (t1-t0) × m that is to be searched and downloading moment ts is calculated, into step E4;
E4:Download the record at current record original position+k places, the record that as search for and download;
F:The step of being searched for and downloaded by special parameter:
F1:The record that search for and download is found according to D1, D2, D3, makes the first block address of current=records to be searched
Into step F2;
F2:The frame length for defining data storage is L, and to be searched and download parameters positions are j, downloads current block institute successively
There are data of the data page position j at the j+n × L of position, wherein n scope is from totalframes -1 that 0~current page records, into step
Rapid F3;
F3:Current block current=current+1, into step F2, until record end.
Beneficial effect:The present invention can effectively solve the problems, such as aviation airborne equipment FIELD Data storage management.Can be every
Automatic cycle records in individual subregion, possesses natural abrasion equilibrium feature.
Present invention employs the mode for first writing header, it is possible to prevente effectively from the power down that other management methods run into is asked
Topic.
The present invention can support the function of by resume, temporally and by special parameter searching for and download, especially in magnanimity number
According in storage, the download time of a large amount of garbages can be avoided.
Brief description of the drawings
Fig. 1 date storage method schematic diagrames
Fig. 2 File header informations, explanation:Wherein affiliated subregion and affiliated block number, it can be used for recovering to match somebody with somebody under the conditions of accident
Put table and substitution table.Affiliated block number is logical block number (LBN), non-physical piece number.
Fig. 3 data location mode schematic diagrames
Fig. 4 is embodiment data location mode schematic diagram
Fig. 5 is first header schematic diagram that single records in embodiment;
Fig. 6 is last header schematic diagram in embodiment.
Embodiment
The present invention is described in further detail below in conjunction with the accompanying drawings, as shown in Figure 2 and Figure 3, first, according to NAND
FLASH minimum erasure unit is block, the feature that block is made up of page, the mass memory in the parallel channel of multiple chips composition
In, minimum tube reason unit chunk is formed by a laterally chunk, when an only chip, then block is minimum management unit;It is whole
Individual data area carries out subregion according to chunk, and the first address of each subregion is basei, in the homepage of NAND FLASH each block
The header of current block is recorded, header includes the data type of current block, affiliated subregion, block serial number, logical address, carried out
Go through, time and status word information, a kind of NAND flash data storage methods comprise the following steps:
A:The step of obtaining newest record position:
A1:Each subregion first address basei is obtained from pre-assigned partition information;
A2:The homepage of block is searched for since basei, when the first byte of homepage is FF, is stopped search;Record is current
Address is offseti, as newest record position;
B:The step of record:
B1:First header, simultaneously erased subsequent data chunk, if current block is last are write at page 0 of current block
One block, then subsequent data chunk is first address;
B2:Data to be recorded are write since page 1 of current block, until data are write all over, step B1 is then back to, opens
The record for next data block that begins, until record finishes;
C:The step of power down:During power down, due to being written with header, therefore stop recording in homepage position;
D:The step of being searched for and downloaded by resume:
D1:Current address current=offseti is obtained according to step A2, into step D2;
D2:The header of record block at current-1 is read, obtains the data type of current record, affiliated subregion, block is suitable
Sequence number, logical address, resume, time and status word information;Into step D3;If current is first address, current-
Rollback is answered after 1 to the end of current bay.
D3:Judge its record record information it is whether consistent with the record information that search for and download, unanimously then from
Start Download History information at current-1- block serial numbers, current=current-1- block serial numbers are otherwise made, into step
Rapid D2;
E:The step of temporally searching for and download:
E1:The record that search for and download is found according to D1, D2, D3, into step E2;
E2:First block of current record and last blocks of header are read, obtains the data of the block of current record
M and record beginning and ending time t0, t1 are measured, into step E3;
E3:Position k=(ts-t0) ÷ (t1-t0) × m that is to be searched and downloading moment ts is calculated, into step E4;
E4:Download the record at current record original position+k places, the record that as search for and download;
F:The step of being searched for and downloaded by special parameter:
F1:The record that search for and download is found according to D1, D2, D3, makes the first block address of current=records to be searched
Into step F2;
F2:The frame length for defining data storage is L, and L is 512 integral multiple, and to be searched and download parameters positions are j,
Data of all data page position j of current block at the j+n × L of position are downloaded successively, and wherein n scope records from 0~current page
Totalframes -1, into step F3;
F3:Current block current=current+1, into step F2, until record end.
It is described below exemplified by shown in Fig. 4, Fig. 5, Fig. 6
1~block of block 16000 of 1~chip of chip 8 forms 1~chunk of chunk 16000, and each block includes 2048 pages again,
Whole data area carries out subregion according to chunk, is boundary as subregion 2 using chunk 10000, it is assumed that data are recorded in the position of subregion 2
Put, have recorded 50 blocks, last 20 minutes, then in the header for the homepage record current block for completing to record each block, header
Include the information such as the data type of current block, affiliated subregion, block serial number, logical address, resume, time and status word, its
First header of middle single record is as shown in figure 5, last header is as shown in Figure 6.The then main bag of the application present invention
Include following steps:
A:The step of obtaining newest record position:
A1:Subregion first address 10000 is obtained from pre-assigned partition information;
A2:The homepage of block is searched for since chunk 10000, when 10501, when the first byte of homepage is FF, is stopped
Record current address is offseti=10051, as newest record position.
B:The step of record:
B1:First header, simultaneously erased subsequent data chunk are write in current block offseti homepage.Current block is most
The latter address 16000, it is that subsequent data chunk is first address 10000;
B2:Data to be recorded are write since current block offseti page 1, until data are write all over.Current block adjusts
For offseti+1, B1 is then gone to step, starts the record of next data block, until record finishes;
C:The step of power down:During power down, due to being written with header, therefore stop recording in homepage position;
D:The step of being searched for and downloaded by resume:
D1:Current address current=offseti=10051 is obtained according to step A2, into step D2;
D2:The header of record block at current-1=10050 is read, the time that can obtain current record is 2014/
05/06/10/20/00th, size be 50 blocks, original position be offseti- (50+1)=16000.Into step D3;If
Current is first address 10000, then rollback is answered after current-1 to the end of current bay, i.e. chunk 16000.
D3:Judge its record record information it is whether consistent with the record information that search for and download, unanimously then from
Current-1- blocks start Download History information at serial number=10000, otherwise make current=current-1- blocks order
Number=10000, into step D2;
E:The step of temporally searching for and download, with the search data instance of the 10th minute:
E1:The record that search for and download is found according to D1, D2, D3, into step E2;
E2:First block of current record and last blocks of header are read, obtains the data of the block of current record
Amount 50 and record beginning and ending time t0=2014/05/06/10/00/00, t1=2014/05/06/10/20/00, into step E3;
E3:Position k=10 ÷ 0.4=25 that are to be searched and downloading moment ts are calculated, into step E4;
E4:Download the record at current record 10000+25=10025, the record that as search for and download;
F:Search for and download by special parameter, it is as follows the step of by taking L=512 as an example:
F1:The record that search for and download is found according to D1, D2, D3, makes the first block address of current=records to be searched
=10000, into step F2;
F2:The frame length for defining data storage is 512, and to be searched and download parameters positions are 500, is downloaded successively current
All data page positions the 500,500+512 × 1st of block, 500+512 × 2, the data of 500+512 × 3 ... 500+512 × 16,
Wherein n scope is from totalframes -1 that 0~current page records, into step F3;
F3:Current block current=current+1, into step F2, until record end.
Claims (1)
1. a kind of NAND flash data storage methods, it is block according to NAND FLASH minimum erasure unit, block is by page first
The feature of composition, in the mass memory of the parallel channel of multiple chips composition, minimum tube reason unit is formed by a laterally chunk
Chunk, when an only chip, then block is minimum management unit;Whole data area carries out subregion according to chunk, each
The first address of subregion is basei, and in the header of the homepage record current block of NAND FLASH each block, header includes
The data type of current block, affiliated subregion, block serial number, logical address, resume and status word information, it is characterised in that including
Following steps:
A:The step of obtaining newest record position:
A1:Each subregion first address basei is obtained from pre-assigned partition information;
A2:The homepage of block is searched for since basei, when the first byte of homepage is FF, is stopped search;Record current address
For offseti, as newest record position;
B:The step of record:
B1:First header, simultaneously erased subsequent data chunk, if current block is last are write at page 0 of current block
Block, then subsequent data chunk is first address;
B2:Data to be recorded are write since page 1 of current block, until data are write all over, step B1 are then back to, under starting
The record of one data block, until record finishes;
C:The step of power down:During power down, due to being written with header, therefore stop recording in homepage position;
D:The step of being searched for and downloaded by resume:
D1:Current address current=offseti is obtained according to step A2, into step D2;
D2:The header of record block at current-1 is read, obtains the data type of current record, affiliated subregion, block order
Number, logical address, resume and status word information;Into step D3;If current is first address, should be rolled up after current-1
Return to the end of current bay;
D3:Judge whether the record information of its record is consistent with the record information that search for and download, unanimously then from current-
Start Download History information at 1- block serial numbers, otherwise make current=current-1- block serial numbers, into step D2;
E:The step of temporally searching for and download:
E1:The record that search for and download is found according to D1, D2, D3, into step E2;
E2:Read current record first block and last blocks of header, obtain current record block data volume m and
Beginning and ending time t0, t1 are recorded, into step E3;
E3:Position k=(ts-t0) ÷ (t1-t0) × m that is to be searched and downloading moment ts is calculated, into step E4;
E4:Download the record at current record original position+k places, the record that as search for and download;
F:The step of being searched for and downloaded by special parameter:
F1:The record that search for and download is found according to D1, D2, D3, makes the first block address of current=records to be searched enter
Step F2;
F2:The frame length for defining data storage is L, and to be searched and download parameters positions are j, downloads all numbers of current block successively
According to data of the page position j at the j+n × L of position, wherein n scope is from totalframes -1 that 0~current page records, into step
F3;
F3:Current block current=current+1, into step F2, until record end.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410587504.8A CN104391804B (en) | 2014-10-28 | 2014-10-28 | A kind of NAND flash data storage methods |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410587504.8A CN104391804B (en) | 2014-10-28 | 2014-10-28 | A kind of NAND flash data storage methods |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104391804A CN104391804A (en) | 2015-03-04 |
CN104391804B true CN104391804B (en) | 2017-11-28 |
Family
ID=52609711
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410587504.8A Active CN104391804B (en) | 2014-10-28 | 2014-10-28 | A kind of NAND flash data storage methods |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104391804B (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105306569B (en) * | 2015-10-20 | 2018-07-17 | 红石阳光(北京)科技股份有限公司 | One kind being based on the data download method of Flash (flash memory) |
CN108897499A (en) * | 2018-07-19 | 2018-11-27 | 江苏华存电子科技有限公司 | The kind identification method of block in a kind of flash memory |
CN112085865B (en) * | 2020-08-14 | 2023-09-15 | 陕西千山航空电子有限责任公司 | Aerial real-time early warning system based on flight data |
CN114489478A (en) * | 2021-12-20 | 2022-05-13 | 山西转型综改示范区华纳方盛科技有限公司 | Data storage method of data recorder, data storage module and data recorder |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1383565A (en) * | 2000-06-06 | 2002-12-04 | 英特尔公司 | Method and appts. for predective flash memory erase and write times |
CN101882111A (en) * | 2009-05-05 | 2010-11-10 | 群联电子股份有限公司 | Data access method, storage system and controller for flash memory |
CN102819493A (en) * | 2011-11-30 | 2012-12-12 | 凯迈(洛阳)环测有限公司 | Storage and query method based on non-volatile memory chip |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8040744B2 (en) * | 2009-01-05 | 2011-10-18 | Sandisk Technologies Inc. | Spare block management of non-volatile memories |
KR101861545B1 (en) * | 2012-01-02 | 2018-05-29 | 삼성전자주식회사 | Method for managing data in storage device |
-
2014
- 2014-10-28 CN CN201410587504.8A patent/CN104391804B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1383565A (en) * | 2000-06-06 | 2002-12-04 | 英特尔公司 | Method and appts. for predective flash memory erase and write times |
CN101882111A (en) * | 2009-05-05 | 2010-11-10 | 群联电子股份有限公司 | Data access method, storage system and controller for flash memory |
CN102819493A (en) * | 2011-11-30 | 2012-12-12 | 凯迈(洛阳)环测有限公司 | Storage and query method based on non-volatile memory chip |
Also Published As
Publication number | Publication date |
---|---|
CN104391804A (en) | 2015-03-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107168647B (en) | FLASH data read-write method and system | |
CN101354681B (en) | Memory system, abrasion equilibrium method and apparatus of non-volatile memory | |
CN106354662B (en) | A kind of NAND flash data storage method | |
CN102567184B (en) | Journal storage method based on Flash | |
CN104391804B (en) | A kind of NAND flash data storage methods | |
CN103646063B (en) | A kind of spaceborne high speed document management system | |
CN107844431A (en) | Map table updating method, memorizer control circuit unit and memory storage apparatus | |
US20130060991A1 (en) | Solid state drive and garbage collection control method thereof | |
CN103577342B (en) | Method for managing data stored in flash memory and related memory device and controller | |
US8996794B2 (en) | Flash memory controller | |
JP2009099149A (en) | Control method of adaptive hybrid density memory storage device, and adaptive hybrid density memory storage device | |
CN102253898B (en) | Memory management method and memory management device of image data | |
CN109597580B (en) | Flash operation method suitable for intelligent electric meter load curve storage | |
CN102819493B (en) | A kind of storage based on non-volatile memory chip and querying method | |
CN111007985A (en) | Compatible processing method, system and equipment for space recovery of storage system | |
CN104166627B (en) | A kind of SCM Based NAND FLASH write operation methods | |
TW201719674A (en) | Non-volatile memory device and control method thereof | |
CN109582229A (en) | A kind of storage of solid state record device data and lookup method | |
JP2009503745A5 (en) | ||
US9928177B2 (en) | Managing method for cache memory of solid state drive | |
CN104133640B (en) | From the fast quick-recovery of dormancy | |
CN113010091B (en) | Method for writing data into solid state disk, method and device for recycling garbage | |
CN105653466A (en) | Data storage device and flash memory control method | |
CN108279852A (en) | Method for improving NORFLASH service lifes in intelligent electric energy meter | |
CN111324289B (en) | Memory device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |