CN104391804A - Storage method for NAND FLASH data - Google Patents

Storage method for NAND FLASH data Download PDF

Info

Publication number
CN104391804A
CN104391804A CN201410587504.8A CN201410587504A CN104391804A CN 104391804 A CN104391804 A CN 104391804A CN 201410587504 A CN201410587504 A CN 201410587504A CN 104391804 A CN104391804 A CN 104391804A
Authority
CN
China
Prior art keywords
current
record
block
data
address
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
CN201410587504.8A
Other languages
Chinese (zh)
Other versions
CN104391804B (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.)
Shaanxi Qianshan Avionics Co Ltd
Original Assignee
Shaanxi Qianshan Avionics 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 Shaanxi Qianshan Avionics Co Ltd filed Critical Shaanxi Qianshan Avionics Co Ltd
Priority to CN201410587504.8A priority Critical patent/CN104391804B/en
Publication of CN104391804A publication Critical patent/CN104391804A/en
Application granted granted Critical
Publication of CN104391804B publication Critical patent/CN104391804B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Read Only Memory (AREA)

Abstract

The invention belongs to the technical field of aviation electronics and particularly relates to a storage method for NAND FLASH data. According to the storage method, the problem about data storage and management in the field of aircraft airborne equipment can be effectively solved. The method supports multi-partition operation, automatic cycle record in each partition can be realized, and the characteristic of natural wear leveling is realized; power failure existing in other management methods can be effectively avoided; the function of searching according to time and specific parameters can be supported; particularly in massive data storage, transfer time of a large amount of unwanted information can be avoided, and the problem about data storage and management which generally exist in the field of the aircraft airborne equipment is effectively solved.

Description

A kind of NAND flash data storage method
Technical field
The invention belongs to avionics field, particularly relate to a kind of NADA flash data storage method.
Background technology
NAND FLASH Memory is the erasable read-write non-volatile memory of a kind of point.It has high density, low cost, non-volatile, low in energy consumption, and read-write and the advantage such as erasing speed is fast, be therefore widely applied in a mobile device.The date storage method adopted in NAND FLASH at present, comprises FAT, JFFS, YAFFS etc.But because NAND FLASH presses block erasing, by the feature of page write, and the life-span restriction of NAND FLASH, cause this several management method, complicated data structure and Wear leveling algorithm is all needed to support, along with the continuous increase of the capacity of the page of NAND FLASH, common algorithm has not too adapted to the application scenario of new NAND FLASH.
In aviation airborne equipment field, often need cycle index one group of parameter, and can automatically delete older record, obviously common date storage method, be all difficult to the application meeting aviation airborne equipment field mass memory.Meanwhile, the power down of airborne equipment is uncertain often, the reaction time that power-fail interrupt gives equipment is very limited, traditional date storage method is difficult to the power down process work (as writing in files end mark etc.) completing data in the limited time, thus causes loss of data.
Summary of the invention
Goal of the invention: the object of this invention is to provide a kind of NAND flash data storage method, solves aviation electronics field NAND FLASH mass data storage problem of management.
Technical scheme: first the scheme that the present invention adopts is, be block according to the minimum unit of erase of NAND FLASH, the feature that block is made up of page, in the mass memory of the parallel channel that multiple chip forms, form minimum tube by a horizontal chunk and manage unit chunk, when only having a chip, then block is minimum management unit; Subregion is carried out according to chunk in whole data area, the first address of each subregion is basei, at the header of the homepage record current block of each piece of NAND FLASH, header comprises the data type of current block, affiliated subregion, block serial number, logical address, resume, time and status word information, is characterized in that, comprise the following steps:
A: the step obtaining up-to-date record position:
A1: obtain each subregion first address basei from pre-assigned partition information;
A2: the homepage of searching for block from basei, until when the first byte of homepage is FF, stop search; Record current address is offseti, is up-to-date record position;
B: the step of record:
B1: first in the 0th page of write head information of current block, wipe subsequent data chunk, if current block is last block, then subsequent data chunk is first address simultaneously;
B2: write data to be recorded from the 1st page of current block, until data are write all over, then return step B1, start the record of next data block, until record complete;
C: the step of power down: during power down, owing to being written with header in homepage position, therefore stops recording;
D: search for by resume and the step downloaded:
D1: obtain current address current=offseti according to steps A 2, enter step D2;
D2: the header reading current-1 place record block, obtains the data type of current record, affiliated subregion, block serial number, logical address, resume, time and status word information; Enter step D3; If current is first address, then answer rollback to the end of current bay after current-1.
D3: judge its record information recorded whether with to search for and the record information downloaded is consistent, unanimously then Download History information from current-1-block serial number place, otherwise make current=current-1-block serial number, enters step D2;
E: temporally search for and the step downloaded:
E1: find according to D1, D2, D3 and will search for and the record downloaded, enter step e 2;
E2: read first block of current record and the header of last block, obtains data volume m and record beginning and ending time t0, the t1 of the block of current record, enters step e 3;
E3: calculate to be searched and download position k=(ts-t0) ÷ (the t1-t0) × m of moment ts, entering step e 4;
E4: the record downloading current record reference position+k place, is and will searches for and the record downloaded;
F: search for by special parameter and the step downloaded:
F1: find according to D1, D2, D3 and will search for and the record downloaded, makes the first block address of current=record to be searched enter step F 2;
F2: the frame length that definition stores data is L, and the to be searched and position of download parameters is j, download the data of current block all data page positions j to j+n × L place, position successively, wherein the scope of n is from the totalframes-1 of 0 ~ current page record, enters step F 3;
F3: current block current=current+1, enter step F 2, until end of record (EOR).
Beneficial effect: the present invention effectively can solve the problem of aviation airborne equipment FIELD Data storage administration.Can in each subregion automatic cycle record, possess natural abrasion equilibrium feature.
Present invention employs the mode of first write head information, effectively can avoid the power-off problems that other management methods run into.
The present invention can support by resume, temporally and search for by special parameter and the function downloaded, especially in mass data storage, can avoid the download time of a large amount of garbage.
Accompanying drawing explanation
Fig. 1 date storage method schematic diagram
Fig. 2 File header information, illustrates: subregion and affiliated block number wherein, can be used for recovery configuring table and substitution table under unexpected condition.Affiliated block number is logical block number (LBN), non-physical block number.
figure3 deposit data modes are illustrated figure
figure4 illustrate for embodiment deposit data mode figure
figure5 is first header signal of single record in embodiment figure;
figure6 is last header signal in embodiment figure.
embodiment
Below in conjunction with accompanying drawing, the present invention is described in further detail, as shown in Figure 2 and Figure 3, first, be block according to the minimum unit of erase of NAND FLASH, the feature that block is made up of page, in the mass memory of the parallel channel that multiple chip forms, forms minimum tube by a horizontal chunk and manages unit chunk, when only having a chip, then block is minimum management unit; Subregion is carried out according to chunk in whole data area, the first address of each subregion is basei, at the header of the homepage record current block of each piece of NAND FLASH, header comprises the data type of current block, affiliated subregion, block serial number, logical address, resume, time and status word information, a kind of NAND flash data storage method comprises the following steps:
A: the step obtaining up-to-date record position:
A1: obtain each subregion first address basei from pre-assigned partition information;
A2: the homepage of searching for block from basei, until when the first byte of homepage is FF, stop search; Record current address is offseti, is up-to-date record position;
B: the step of record:
B1: first in the 0th page of write head information of current block, wipe subsequent data chunk, if current block is last block, then subsequent data chunk is first address simultaneously;
B2: write data to be recorded from the 1st page of current block, until data are write all over, then return step B1, start the record of next data block, until record complete;
C: the step of power down: during power down, owing to being written with header in homepage position, therefore stops recording;
D: search for by resume and the step downloaded:
D1: obtain current address current=offseti according to steps A 2, enter step D2;
D2: the header reading current-1 place record block, obtains the data type of current record, affiliated subregion, block serial number, logical address, resume, time and status word information; Enter step D3; If current is first address, then answer rollback to the end of current bay after current-1.
D3: judge its record information recorded whether with to search for and the record information downloaded is consistent, unanimously then Download History information from current-1-block serial number place, otherwise make current=current-1-block serial number, enters step D2;
E: temporally search for and the step downloaded:
E1: find according to D1, D2, D3 and will search for and the record downloaded, enter step e 2;
E2: read first block of current record and the header of last block, obtains data volume m and record beginning and ending time t0, the t1 of the block of current record, enters step e 3;
E3: calculate to be searched and download position k=(ts-t0) ÷ (the t1-t0) × m of moment ts, entering step e 4;
E4: the record downloading current record reference position+k place, is and will searches for and the record downloaded;
F: search for by special parameter and the step downloaded:
F1: find according to D1, D2, D3 and will search for and the record downloaded, makes the first block address of current=record to be searched enter step F 2;
F2: the frame length that definition stores data is L, L is the integral multiple of 512, and the to be searched and position of download parameters is j, downloads the data of current block all data page positions j to j+n × L place, position successively, wherein the scope of n is from the totalframes-1 of 0 ~ current page record, enters step F 3;
F3: current block current=current+1, enter step F 2, until end of record (EOR).
Below with Fig. 4, Fig. 5, Figure 6 shows that example is described
Block 1 ~ the block 16000 of chip 1 ~ chip 8 forms chunk 1 ~ chunk 16000, each piece comprises again 2048 pages, subregion is carried out according to chunk in whole data area, be that boundary is for subregion 2 with chunk 10000, tentation data is recorded in the position of subregion 2, have recorded 50 blocks, last 20 minutes, then at the header completing the homepage record current block recording each piece, header comprises the data type of current block, affiliated subregion, block serial number, logical address, resume, the information such as time and status word, wherein first header of single record as shown in Figure 5, last header as shown in Figure 6.Then apply the present invention mainly to comprise the following steps:
A: the step obtaining up-to-date record position:
A1: obtain subregion first address 10000 from pre-assigned partition information;
A2: the homepage of searching for block from chunk 10000, until 10501 time, when the first byte of homepage is FF, stop record current address be offseti=10051, be up-to-date record position.
B: the step of record:
B1: first in the homepage write head information of current block offseti, simultaneously wipe subsequent data chunk.Current block is last address 16000, be subsequent data chunk is first address 10000;
B2: write data to be recorded from the 1st page of current block offseti, until data are write all over.Current block is adjusted to offseti+1, then goes to step B1, starts the record of next data block, until record complete;
C: the step of power down: during power down, owing to being written with header in homepage position, therefore stops recording;
D: search for by resume and the step downloaded:
D1: obtain current address current=offseti=10051 according to steps A 2, enter step D2;
D2: the header reading current-1=10050 place record block, the time that can obtain current record is 2014/05/06/10/20/00, size is 50 blocks, reference position is offseti-(50+1)=16000.Enter step D3; If current is first address 10000, then answer rollback to the end of current bay after current-1, i.e. chunk 16000.
D3: judge its record information recorded whether with to search for and the record information downloaded is consistent, consistent then from the place of current-1-block serial number=10000 Download History information, otherwise make current=current-1-block serial number=10000, enter step D2;
E: temporally search for and the step downloaded, to search for the data instance of the 10th minute:
E1: find according to D1, D2, D3 and will search for and the record downloaded, enter step e 2;
E2: read first block of current record and the header of last block, obtains data volume 50 and record beginning and ending time t0=2014/05/06/10/00/00, the t1=2014/05/06/10/20/00 of the block of current record, enters step e 3;
E3: calculate to be searched and download the position k=10 ÷ 0.4=25 of moment ts, entering step e 4;
E4: the record downloading current record 10000+25=10025 place, is and will searches for and the record downloaded;
F: search for by special parameter and download, as follows for the step of L=512:
F1: find according to D1, D2, D3 and will search for and the record downloaded, make first block address=10000 of current=record to be searched, enter step F 2;
F2: the frame length that definition stores data is 512, to be searched and the position of download parameters is 500, download all data page positions the 500th of current block successively, 500+512 × 1,500+512 × 2,500+512 × 3 ... the data of 500+512 × 16, wherein the scope of n is from the totalframes-1 of 0 ~ current page record, enters step F 3;
F3: current block current=current+1, enter step F 2, until end of record (EOR).

Claims (1)

1. a NAND flash data storage method, first, be block according to the minimum unit of erase of NAND FLASH, the feature that block is made up of page, in the mass memory of the parallel channel that multiple chip forms, form minimum tube by a horizontal chunk and manage unit chunk, when only having a chip, then block is minimum management unit; Subregion is carried out according to chunk in whole data area, the first address of each subregion is basei, at the header of the homepage record current block of each piece of NAND FLASH, header comprises the data type of current block, affiliated subregion, block serial number, logical address, resume, time and status word information, is characterized in that, comprise the following steps:
A: the step obtaining up-to-date record position:
A1: obtain each subregion first address basei from pre-assigned partition information;
A2: the homepage of searching for block from basei, until when the first byte of homepage is FF, stop search; Record current address is offseti, is up-to-date record position;
B: the step of record:
B1: first in the 0th page of write head information of current block, wipe subsequent data chunk, if current block is last block, then subsequent data chunk is first address simultaneously;
B2: write data to be recorded from the 1st page of current block, until data are write all over, then return step B1, start the record of next data block, until record complete;
C: the step of power down: during power down, owing to being written with header in homepage position, therefore stops recording;
D: search for by resume and the step downloaded:
D1: obtain current address current=offseti according to steps A 2, enter step D2;
D2: the header reading current-1 place record block, obtains the data type of current record, affiliated subregion, block serial number, logical address, resume, time and status word information; Enter step D3; If current is first address, then answer rollback to the end of current bay after current-1;
D3: judge its record information recorded whether with to search for and the record information downloaded is consistent, unanimously then Download History information from current-1-block serial number place, otherwise make current=current-1-block serial number, enters step D2;
E: temporally search for and the step downloaded:
E1: find according to D1, D2, D3 and will search for and the record downloaded, enter step e 2;
E2: read first block of current record and the header of last block, obtains data volume m and record beginning and ending time t0, the t1 of the block of current record, enters step e 3;
E3: calculate to be searched and download position k=(ts-t0) ÷ (the t1-t0) × m of moment ts, entering step e 4;
E4: the record downloading current record reference position+k place, is and will searches for and the record downloaded;
F: search for by special parameter and the step downloaded:
F1: find according to D1, D2, D3 and will search for and the record downloaded, makes the first block address of current=record to be searched enter step F 2;
F2: the frame length that definition stores data is L, and the to be searched and position of download parameters is j, download the data of current block all data page positions j to j+n × L place, position successively, wherein the scope of n is from the totalframes-1 of 0 ~ current page record, enters step F 3;
F3: current block current=current+1, enter step F 2, until end of record (EOR).
CN201410587504.8A 2014-10-28 2014-10-28 A kind of NAND flash data storage methods Active CN104391804B (en)

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 true CN104391804A (en) 2015-03-04
CN104391804B 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)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105306569A (en) * 2015-10-20 2016-02-03 红石阳光(北京)科技有限公司 Data downloading method based on Flash (flash)
WO2020015131A1 (en) * 2018-07-19 2020-01-23 江苏华存电子科技有限公司 Type identification method of block in flash memory
CN112085865A (en) * 2020-08-14 2020-12-15 陕西千山航空电子有限责任公司 Air 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 (5)

* Cited by examiner, † Cited by third party
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
US20100172179A1 (en) * 2009-01-05 2010-07-08 Sergey Anatolievich Gorobets Spare Block Management of Non-Volatile Memories
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
US20130173854A1 (en) * 2012-01-02 2013-07-04 Samsung Electronics Co., Ltd. Method for managing data in storage device and memory system employing such a method

Patent Citations (5)

* Cited by examiner, † Cited by third party
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
US20100172179A1 (en) * 2009-01-05 2010-07-08 Sergey Anatolievich Gorobets Spare Block Management of Non-Volatile Memories
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
US20130173854A1 (en) * 2012-01-02 2013-07-04 Samsung Electronics Co., Ltd. Method for managing data in storage device and memory system employing such a method

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105306569A (en) * 2015-10-20 2016-02-03 红石阳光(北京)科技有限公司 Data downloading method based on Flash (flash)
CN105306569B (en) * 2015-10-20 2018-07-17 红石阳光(北京)科技股份有限公司 One kind being based on the data download method of Flash (flash memory)
WO2020015131A1 (en) * 2018-07-19 2020-01-23 江苏华存电子科技有限公司 Type identification method of block in flash memory
CN112085865A (en) * 2020-08-14 2020-12-15 陕西千山航空电子有限责任公司 Air real-time early warning system based on flight data
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

Also Published As

Publication number Publication date
CN104391804B (en) 2017-11-28

Similar Documents

Publication Publication Date Title
CN101354681B (en) Memory system, abrasion equilibrium method and apparatus of non-volatile memory
US9208074B2 (en) Updating address mapping in sub-intervals in a flash memory data storage device
CN107391774B (en) The rubbish recovering method of log file system based on data de-duplication
CN106354662B (en) A kind of NAND flash data storage method
CN104484283B (en) A kind of method for reducing solid state disk write amplification
CN103761056A (en) Stream data storage method in video monitoring application
CN104461390A (en) Method and device for writing data into imbricate magnetic recording SMR hard disk
CN1963814A (en) Managing method of data of memorizer
CN104391804A (en) Storage method for NAND FLASH data
CN103186617B (en) A kind of method and apparatus storing data
CN102306125A (en) Method for erasing and writing data of FLASH memory
CN108628542B (en) File merging method and controller
CN102169460A (en) Method and device for managing variable length data
CN109240939B (en) Method for rapidly processing solid state disk TRIM
CN104424103A (en) Management method for cache in solid state storage device
CN103970669A (en) Method for accelerating physical-to-logic address mapping of recycling operation in solid-state equipment
CN102819493B (en) A kind of storage based on non-volatile memory chip and querying method
CN104166627B (en) A kind of SCM Based NAND FLASH write operation methods
CN107506311B (en) Method and device for flashing FTL (flash translation layer) table of solid state disk
CN111007985A (en) Compatible processing method, system and equipment for space recovery of storage system
CN109582229A (en) A kind of storage of solid state record device data and lookup method
CN103823634A (en) Data processing method and system supporting non-random write mode
CN113190180A (en) Storage device based on mixed media and distributed storage system
CN113010091B (en) Method for writing data into solid state disk, method and device for recycling garbage
CN107430546A (en) A kind of file updating method and storage 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