CN106776106A - A kind of date storage method based on NandFlash - Google Patents

A kind of date storage method based on NandFlash Download PDF

Info

Publication number
CN106776106A
CN106776106A CN201611039944.5A CN201611039944A CN106776106A CN 106776106 A CN106776106 A CN 106776106A CN 201611039944 A CN201611039944 A CN 201611039944A CN 106776106 A CN106776106 A CN 106776106A
Authority
CN
China
Prior art keywords
data
block
area
write pointer
data storage
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201611039944.5A
Other languages
Chinese (zh)
Inventor
李桂平
熊光亚
华涛
景波云
罗孝兵
李冰
吕敏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nanjing NARI Group Corp
State Grid Electric Power Research Institute
Original Assignee
Nanjing NARI Group Corp
State Grid Electric Power Research Institute
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 Nanjing NARI Group Corp, State Grid Electric Power Research Institute filed Critical Nanjing NARI Group Corp
Priority to CN201611039944.5A priority Critical patent/CN106776106A/en
Publication of CN106776106A publication Critical patent/CN106776106A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/08Error detection or correction by redundancy in data representation, e.g. by using checking codes
    • G06F11/10Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's
    • G06F11/1004Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's to protect a block of data words, e.g. CRC or checksum
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • G06F12/0238Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory
    • G06F12/0246Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory in block erasable memory, e.g. flash memory

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Quality & Reliability (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a kind of date storage method based on NandFlash, NandFlash is divided into two onesize data storage areas, a Ge Huaikuai areas, a preliminary data area, and set up corresponding mapping table, when bad block occurs in data storage area, bad block can be substituted with the available block in preliminary data area.Definition data structure is 4 byte index, 2 byte flag positions, user data, 2 byte CRC16, next data record can rapidly be navigated to, ensure the reliability of data storage, and operation to data can carry out data deletion action by rewriteeing the method for flag bit.Present invention can be widely used to be widely used for need to carry out the occasion of data storage and data retrieval in middle-size and small-size embedded system, with access speed block, storage efficiency is high, the characteristics of good reliability.

Description

A kind of date storage method based on NandFlash
Technical field
The present invention relates to a kind of date storage method based on NandFlash, belong to technical field.
Background technology
In embedded systems, to the characteristic of the operation with timing restriction of database, here being applied to embedded system The data base set of system is referred to as embedded type database system or embedded real time software systems (ERTDBS).
One of challenge of current embedded software system exploitation, is embodied in can the management of various data set up it is a set of can By, efficiently, stabilization management mode, embedded database is to arise at the historic moment.The title of embedded database is unique from it Operational mode.This database has been embedded into program process, eliminates open related to client-server configuration Pin.Embedded database is actually lightweight, and operationally, they need less internal memory.They are to use to simplify generation What code was write, for embedded device, faster, effect is more preferable for its speed.Embedded operational mode allows embedded database Application data is easily managed by SQL, and not against original text.Embedded database also provides zero configuration Operational mode, can so enable one of them and run a snapshot.
Embedded system is allowed in the case of no manual intervention, is run incessantly for a long time, it is necessary to fully Ensure its reliability.Require that database manipulation possesses predictability simultaneously, and system size and performance also all must be can Precognition, so just can guarantee that the performance of system.Inevitably can be come into contacts with bottom hardware in embedded system, therefore During data management, also there is the ability of bottom control, such as when disk operating can occur, the number of times of disk operating, how Control etc..The ability of bottom control is the key of determination data library management operation.
Embedded database is the important component of embedded system, also as opening increasing personalized application Hair and a kind of essential effective means for managing and using.
Embedded database is widely used, and such as consumption electronic product, mobile computing device, enterprise's real-time management should With, the network storage and management and various special equipments, this market is currently under among rapid growth.
Conventional embedded database has Berkeley DB, SQLite, Empress, eXtremeDB, Firebird at present Embedded server version, mSQL, but these embedded databases are required for the support of embedded system and file system, and it is right The program storage and internal memory of system have comparing requirement high, are not suitable for being applied in middle-size and small-size embedded system.
NandFlash internal memories are one kind of flash internal memories, and it is internal using non-linear macroelement pattern, is solid-state great Rong The realization for measuring internal memory provides cheap effective solution.Nand-flash memories have capacity larger, rewrite speed fast The advantages of, it is adaptable to the storage of mass data, thus in the industry cycle obtained increasingly being widely applied, such as wrapped in embedded product Include digital camera, MP3 walkmans memory card, USB flash disk of compact etc..
Due to the problem of production technology, it there may be certain bad block when dispatching from the factory to NandFlash.These intrinsic bad blocks Data storage is cannot be used for, having been produced house identifies.In addition, due to read-write increased frequency during use, good block can also become Unstable or failure, as bad block, here it is the bad block produced after dispatching from the factory, so as to cause the data age of storage.
The content of the invention
The technical problems to be solved by the invention are the defects for overcoming prior art, there is provided a kind of based on NandFlash's Date storage method, the NandFlash chips based on Large Copacity, using data redundancy techniques, can update in operation The bad block mapping table and information table memory of NandFlash, it is to avoid the loss of data.
In order to solve the above technical problems, the present invention provides a kind of date storage method based on NandFlash, including it is following Step:
1) data structure of design data storage;The data structure is:
WritePtr --- the write pointer of next data record;
ValidFlag --- data effective marker;
UserData --- user data;
CRC --- CRC16 is verified;
Left side is field, the implication that right side is referred to by field;
2) the bad block to Nandflash is detected;
3) design data storage mapping;Data storage mapping is specially:The bad block of NandFlash is detected, bad block is set up and is reflected Firing table, by the available block of NandFlash be divided into two formed objects data storage area and a preliminary data area, set up two Individual data storage area mapping table and a preliminary data area mapping table;
4) data storage is carried out, it is specific as follows:
The memory space of each data 4-1) is distributed, memory space is distributed simultaneously at two data storage areas, two numbers Data storage area 1 and data storage area 2 are defined as according to memory block, are one concordance list of this every kind of data configuration, the number of concordance list It is according to structure:
InitFlag --- concordance list initialisation identifications;
StartBlock --- starting block number;
EndBlock --- terminate block number;
BlockSize --- block size;
RecordLen --- a data record size;
DataLength --- valid data total length;
WritePtr1 --- write pointer 1;
WritePtr2 --- write pointer 2;
Left side is field, the implication that right side is referred to by field;
Data directory 4-2) is read, the validity of concordance list is then judged, if concordance list is invalid, table is indexed Initialization, if concordance list is effective, then judges whether data storage synchronization;
4-3) if it is, judging whether data write pointer is block first address, then first wiped if block first address, Then by user data and verification two buffering areas of write-in;
If 4-4) NandFlash carries out data write-in failure, mark current block is bad block, then updates the mapping of bad block Table, distributes a buffering area to data storage area, then update preliminary data area mapping table and data storage area from preliminary data area Mapping table, then re-writes;
4-5) each data storage area updates the data the write pointer of concordance list after writing successfully.
The foregoing bad block to Nandflash carries out detection to be included detecting congenital bad block and to posteriority bad block Detected;
Carrying out detection method to congenital bad block is:Call erasing program, by NandFlash all erasing one time, then Perform following detection operation:
If page is more than 512 bytes, badblockpos=0;Badblockbytes=2;
If page is less than 512 bytes, badblockpos=5;Badblockbytes=1;
Read the rear badblockbytes bytes that the badblockpos in the preceding OOB regions of page two of each block starts Whether it is full 0 xff, if it is then illustrating that the block is good, otherwise the block is bad block;
Carrying out detection method to posteriority bad block is:If Block Erase or Page Program mistakes, for bad Block, then be collectively labeled as the value of non-zero xff by preceding 6 Byte of the spare area of first page of bad block.
Foregoing step 4) in, then write timing updates write pointer 1, then data storage area first to write data storage area 1 2, final updating write pointer 2.
Foregoing step 4) in, the total length to data storage is limited, when the data of storage reach the length of setting When spending, then write-in is circulated, by earliest data cover.
When the data for two data storage areas occur are asynchronous, it is necessary to carry out data syn-chronization, detailed process is as follows:
When write pointer 1 is consistent with write pointer 2, data storage area 1 reads the RecordLen length datas that write pointer 1 starts, Judge the validity of data, data effectively then update write pointer 1, then write data into data storage area 2, update write pointer 2;
When write pointer 1 and write pointer 2 are inconsistent, for data storage, the not more news of write pointer 2, judges data Validity, data effectively then update write pointer 2, then write data into data storage area 2;Do not have also for data storage area 2 Start the situation of write-in, it is only necessary to the data lacked in data storage area 2 are then written to data from the reading of data storage area 1 and are deposited Storage area 2, then write pointer 2 is updated.
When needing to carry out data retrieval, process is as follows:
6-1), concordance list is read first, the validity of concordance list is then judged, concordance list is invalid, reinitialize index Table;
6-2), judge whether data there occurs recurrent wrIting, in the event of recurrent wrIting, then divide into data storage Liang Ge areas are searched, and one is region before write pointer, and also one is the region after write pointer, be then transferred to step 6-3);If not there is recurrent wrIting, step 6-4 is transferred to)
6-3), first data record for meeting search condition, write-in are inquired about using dichotomy to the region before write pointer Inquiry buffering area, can be navigated to rapidly using dichotomy needs the data of inquiry, is then sought successively backward from first record Look for, until be no longer complies with querying condition or inquiry buffering area expiring, retrieval terminates;If the region before write pointer is not inquired about To data, then first data record for meeting search condition of the site polling after write pointer, writes inquiry buffering area, until Being no longer complies with querying condition or inquiry buffering area expires, and retrieval terminates;
6-4), first data record for meeting search condition, write-in inquiry are inquired about in data memory area using dichotomy Buffering area, then finds successively backward from first record, until be no longer complies with querying condition or inquiry buffering area expiring, retrieval Terminate.
When needing data to delete, the data for needing to delete are positioned using data retrieval flow, write the data record Invalid flag, both can delete data from database.
When needing to carry out data renewal, process is as follows:
8-1), the data block A where positioning needs the data for the updating and offset address Offset in data block;
8-2), a data block B is chosen from preliminary data area and is wiped;
8-3), by the data writing data blocks B in data block A from address 0 to offset address Offset;
8-4), after data are updated, RecordLen length datas after offset address Offset in writing data blocks B;
8-5), by same location in remaining data writing data blocks B in data block A;
8-6), data block A is assigned to preliminary data area, updates the data memory block mapping table and mapped with preliminary data area Table.
The beneficial effect that the present invention is reached:
1st, the present invention provide NandFlash partition method by maintenance data storage area mapping table, bad block mapping table, The method of preliminary data area mapping table is carried out, that is, isolated the bad block of NandFlash, and the redundant storage of data is realized again.
2nd, the data structure of the data record that the present invention is provided can rapidly navigate to next data record, it is ensured that data The reliability of storage, and operation to data can carry out data deletion action by rewriteeing the method for flag bit.
3rd, the write timing of the data record that the present invention is provided, can when there is strong jamming or power down causes system reset Ensure that concordance list does not occur confusion, it is ensured that the stability of system operation.
4th, the present invention can be widely used in middle-size and small-size embedded system needing carrying out data storage and data retrieval Occasion, with access speed block, storage efficiency is high, the characteristics of good reliability, and without the support of file system, is especially suitable for The commercial Application of middle-size and small-size embedded system.
Brief description of the drawings
Fig. 1 is NandFlash subregions and mapping table;
Fig. 2 is data write-in flow;
Fig. 3 is data syn-chronization flow;
Fig. 4 is data retrieval flow.
Specific embodiment
The invention will be further described below in conjunction with the accompanying drawings.Following examples are only used for clearly illustrating the present invention Technical scheme, and can not be limited the scope of the invention with this.
Date storage method based on NandFlash of the invention, including following components:
1st, the data structure of design data storage
When user data is stored, when embedded system meets with strong jamming or power down, the data of write-in can lose and lead Cause index information to be destroyed, to improve the reliability of data storage, devise following data structure:
Wherein, WritePtr is the write pointer of next data record of 4 bytes, and ValidFlag is that the data of 2 bytes have Valid flag, UserData is user data, and CRC is the CRC16 verifications of the user data of 2 bytes.
2nd, the bad block to Nandflash is detected
2.1 congenital bad block detections
This bad block is produced in process of production, and general chip genuine all can be in the Shi Douhui that dispatches from the factory according to page-size 1~2 type flags by the spare area of first page of bad block are the value for being not equal to 0xff.Erasing program is called, will NandFlash all erasing one times, then perform following detection operation:
If page is more than 512 bytes, badblockpos=0;Badblockbytes=2;
If page is less than 512 bytes, badblockpos=5;Badblockbytes=1;
Read the rear badblockbytes bytes that the badblockpos in the preceding OOB regions of page two of each block starts Whether it is full 0 xff, if it is then illustrating that the block is good, otherwise the block is bad block.
2.2 posteriority bad blocks are detected
The bad block produced during NandFlash uses is referred to as posteriority bad block, if Block Erase or Page Program mistakes, it is possible to simply this block is processed as bad block, need bad block mark to get up this when.For And congenital bad block message is consistent, by preceding 6 Byte of the spare area of first page of newfound bad block It is collectively labeled as the value of non-zero xff.
3rd, design data storage mapping
To ensure the reliable memory of data, the bad block of NandFlash is detected first, set up bad block mapping table, will The available block of NandFlash be divided into two formed objects data storage area and a preliminary data area, set up two data Memory block mapping table and a preliminary data area mapping table, NandFlash subregions and mapping table are as shown in Figure 1.Go out when running Now after bad block, bad block is marked, then update bad block mapping table, then substitute bad block using a memory block in preliminary data area, will The data backup new data block of another data storage area relevant block, then updates the data memory block mapping table and preliminary data area Mapping table.
4th, data storage is carried out
It is first according to set the memory space for distributing each data, memory space (is defined as at two data storage areas Data storage area 1 and data storage area 2) while distribution, is one concordance list of this every kind of data configuration, the data structure of concordance list It is as follows.
The implication of each field of concordance list is as shown in table 1.
The field definition of the concordance list of table 1
Sequence number Field Implication
1 InitFlag Concordance list initialisation identifications
2 StartBlock Starting block number
3 EndBlock Terminate block number
4 BlockSize Block size
5 RecordLen One data record size
6 DataLength Valid data total length
7 WritePtr1 Write pointer 1
8 WritePtr2 Write pointer 2
Wherein, InitFlag represents that concordance list is initialized for 0x55AA, starting block number with terminate block number for data are deposited Sequence number in storage area mapping table, rather than Nandflash physical blocks sequence number, the different blocks of different NandFlash chips correspondences Size BlockSize, because data are all stored at two data storage areas, to prevent unexpected interference, is write in index using two Pointer, carries out data syn-chronization to ensure the double copies of data when occurring mismatching.
Then the write-in flow of data record judges the effective of concordance list as shown in Fig. 2 read data directory first Property, if concordance list is invalid, table initialization is indexed, if concordance list is effective, then judge whether that data storage is same Step;If it is, judging whether data write pointer is block first address, then first wiped if block first address, then first will User data and verification two buffering areas of write-in.
When NandFlash carries out data write-in failure, then it is bad block to mark current block, then updates bad block mapping table, from Preliminary data area distributes a buffering area to data storage area, then updates preliminary data area mapping table with data storage area mapping Table, then re-writes.The write pointer of concordance list is updated the data after each data storage area writes successfully.
Then write timing updates write pointer 1, then data storage area 2 first to write data storage area 1, and final updating writes finger Pin 2, when such write timing can ensure to meet strong jamming or power down, data directory can be automatically according to flow with data record Reviewed and recovered automatically.
In order to avoid data unrestrictedly expand, the total length to data is limited, when the data of storage reach setting Length when, then write-in is circulated, by earliest data cover.
5th, synchronous data storage
Data storage is at two data storage areas, it is necessary to assure data are preserved and are correctly just avoided that one simultaneously two positions Loss of data in the case of individual data block damage, when abnormal conditions such as power down, thunderbolt is run into, the data of storage will occur not It is synchronous, it is embodied in write pointer 1 inconsistent with write pointer 2.Now need to carry out data syn-chronization, synchronous particular flow sheet As shown in Figure 3.
When write pointer 1 is consistent with write pointer 2, there are egregious cases, be exactly data storage area 1 data had been written into and Write pointer 1 does not write, and at this moment can read the RecordLen length datas of the beginning of write pointer 1, judges the validity of data, Data effectively then update write pointer 1, then write data into data storage area 2, update write pointer 2.
All it is first to write data storage area 1 due to data storage, then write data storage when write pointer 1 is inconsistent with write pointer 2 Area 2, there occurs interruption during necessarily writing data storage area 2, it may be possible to data storage and write pointer 2 does not update, Also it is exactly that data storage area 2 does not start write-in also.For the former, handling process as the egregious cases of data storage area 1, Judge the validity of data, data effectively then update write pointer 2, then write data into data storage area 2.
For the latter, it is only necessary to the data lacked in data storage area 2 are read from data storage area 1 and is then written to data Memory block 2, then write pointer 2 is updated.
6th, data retrieval is carried out
In industrial applications, the write-in of data is that, as order, it with the time is suitable that the retrieval of data is equally with the time Sequence, for convenience of data retrieval, markers is compiled per data, the flow of data retrieval is as shown in Figure 4.
6-1, concordance list is read first, then judge the validity of concordance list, reinitialized the need for concordance list is invalid Concordance list.
6-2, judge whether data there occurs recurrent wrIting, in the event of recurrent wrIting, then divide into data storage Liang Ge areas are searched, and one is region before write pointer, and also one is the region after write pointer, be then transferred to step 6-3);If not there is recurrent wrIting, it is transferred to step 6-4)
6-3, first data record for meeting search condition is inquired about using dichotomy to the region before write pointer, write-in is looked into Buffering area is ask, can be navigated to rapidly using dichotomy needs the data of inquiry, is then found successively backward from first record, Until be no longer complies with querying condition or inquiry buffering area expiring, retrieval terminates.If the region before write pointer does not inquire Data, then first data record for meeting search condition of the site polling after write pointer, writes inquiry buffering area, until not Meeting querying condition or inquiry buffering area again expires, and retrieval terminates.
6-4), first data record for meeting search condition, write-in inquiry are inquired about in data memory area using dichotomy Buffering area, then finds successively backward from first record, until be no longer complies with querying condition or inquiry buffering area expiring, retrieval Terminate.
7th, data are deleted
The delet method of data record is as follows:The data for needing to delete are positioned using data retrieval flow, the data are write The invalid flag of record, both can reach the purpose deleted from database.
8th, the renewal of data record
When needing to be updated a certain data record, could again after must being wiped due to the sector of NandFlash Secondary write-in, and erasing operation must be fast to one of NandFlash, due to devising preliminary data area, it is possible to use standby One block of data field carries out transfer, and specific data more new record flow is as follows:
The first step, the data block A where the data that positioning needs the update and offset address Offset in data block;
Second step, chooses a data block B and is wiped from preliminary data area;
3rd step, by the data writing data blocks B in data block A from address 0 to offset address Offset;
4th step, after data are updated, RecordLen length datas after offset address Offset in writing data blocks B;
5th step, by same location in remaining data writing data blocks B in data block A;
6th step, preliminary data area is assigned to by data block A, is updated the data memory block mapping table and is mapped with preliminary data area Table.
The above is only the preferred embodiment of the present invention, it is noted that for the ordinary skill people of the art For member, on the premise of the technology of the present invention principle is not departed from, some improvement and deformation can also be made, these improve and deform Also should be regarded as protection scope of the present invention.

Claims (8)

1. a kind of date storage method based on NandFlash, it is characterised in that comprise the following steps:
1)The data structure of design data storage;The data structure is:
WritePtr --- the write pointer of next data record;
ValidFlag --- data effective marker;
UserData --- user data;
CRC --- CRC16 is verified;
Left side is field, the implication that right side is referred to by field;
2)Bad block to Nandflash is detected;
3)Design data storage mapping;Data storage mapping is specially:The bad block of NandFlash is detected, bad block mapping table is set up, By the available block of NandFlash be divided into two formed objects data storage area and a preliminary data area, set up two numbers According to memory block mapping table and a preliminary data area mapping table;
4)Data storage is carried out, it is specific as follows:
4-1)The memory space of each data is distributed, memory space is distributed simultaneously at two data storage areas, and two data are deposited Storage area is defined as data storage area 1 and data storage area 2, is one concordance list of this every kind of data configuration, the data knot of concordance list Structure is:
InitFlag --- concordance list initialisation identifications;
StartBlock --- starting block number;
EndBlock --- terminate block number;
BlockSize --- block size;
RecordLen --- a data record size;
DataLength --- valid data total length;
WritePtr1 --- write pointer 1;
WritePtr2 --- write pointer 2;
Left side is field, the implication that right side is referred to by field;
4-2)Data directory is read, the validity of concordance list is then judged, if concordance list is invalid, table is indexed initial Change, if concordance list is effective, then judge whether data storage synchronization;
4-3)If it is, judging whether data write pointer is block first address, then first wiped if block first address, then By user data and verification two buffering areas of write-in;
4-4)If NandFlash carries out data write-in failure, mark current block is bad block, then updates bad block mapping table, A buffering area is distributed to data storage area from preliminary data area, then updates preliminary data area mapping table mapped with data storage area Table, then re-writes;
4-5)Each data storage area updates the data the write pointer of concordance list after writing successfully.
2. a kind of date storage method based on NandFlash according to claim 1, it is characterised in that described right The bad block of Nandflash carries out detection to be included detecting congenital bad block and detecting posteriority bad block;
Carrying out detection method to congenital bad block is:Erasing program is called, then NandFlash all erasing one times perform Following detection operation:
If page is more than 512 bytes, badblockpos=0;badblockbytes = 2;
If page is less than 512 bytes, badblockpos=5;badblockbytes = 1;
Whether read rear badblockbytes bytes that the badblockpos in the preceding OOB regions of page two of each block starts It is full 0 xff, if it is then illustrating that the block is good, otherwise the block is bad block;
Carrying out detection method to posteriority bad block is:If Block Erase or Page Program mistakes, are bad block, Preceding 6 Byte of the spare area of first page of bad block are then collectively labeled as the value of non-zero xff.
3. a kind of date storage method based on NandFlash according to claim 1, it is characterised in that the step 4)In, then write timing updates write pointer 1, then data storage area 2, final updating write pointer 2 first to write data storage area 1.
4. a kind of date storage method based on NandFlash according to claim 1, it is characterised in that the step 4)In, the total length to data storage is limited, and when the data of storage reach the length of setting, is then circulated and is write Enter, by earliest data cover.
5. a kind of date storage method based on NandFlash according to claim 1, it is characterised in that when occurring two , it is necessary to carry out data syn-chronization when the data of individual data storage area are asynchronous, detailed process is as follows:
When write pointer 1 is consistent with write pointer 2, data storage area 1 reads the RecordLen length datas that write pointer 1 starts, and judges The validity of data, data effectively then update write pointer 1, then write data into data storage area 2, update write pointer 2;
When write pointer 1 and write pointer 2 are inconsistent, the not more news of write pointer 2 for data storage, judge data has Effect property, data effectively then update write pointer 2, then write data into data storage area 2;Do not start also for data storage area 2 The situation of write-in, it is only necessary to the data lacked in data storage area 2 are read from data storage area 1 and is then written to data storage area 2, then write pointer 2 is updated.
6. a kind of date storage method based on NandFlash according to claim 1, it is characterised in that when need into During row data retrieval, process is as follows:
6-1), read concordance list first, then judge the validity of concordance list, concordance list is invalid, reinitializes concordance list;
6-2), judge whether data there occurs recurrent wrIting, in the event of recurrent wrIting, then data storage is divided into two Area is searched, and one is region before write pointer, and also one is the region after write pointer, be then transferred to step 6- 3);If not there is recurrent wrIting, step 6-4 is transferred to)
6-3), use dichotomy to inquire about first data record for meeting search condition, write-in inquiry the region before write pointer Buffering area, can be navigated to rapidly using dichotomy needs the data of inquiry, is then found successively backward from first record, directly Expire to querying condition or inquiry buffering area is no longer complies with, retrieval terminates;If the region before write pointer does not inquire number According to then first data record for meeting search condition of the site polling after write pointer, writes inquiry buffering area, until no longer Meeting querying condition or inquiry buffering area expires, and retrieval terminates;
6-4), data memory area use dichotomy to inquire about first data record for meeting search condition, write-in inquiry buffering Area, then finds successively backward from first record, until be no longer complies with querying condition or inquiry buffering area expiring, retrieval knot Beam.
7. a kind of date storage method based on NandFlash according to claim 6, it is characterised in that when needing number During according to deleting, the data for needing to delete are positioned using data retrieval flow, writing the invalid flag of the data record, both can be from number Data are deleted according to storehouse.
8. a kind of date storage method based on NandFlash according to claim 1, it is characterised in that when need into When row data update, process is as follows:
8-1), the data block A where the data that positioning needs the update and offset address Offset in data block;
8-2), a data block B is chosen from preliminary data area and is wiped;
8-3), by the data writing data blocks B in data block A from address 0 to offset address Offset;
8-4), after data are updated, RecordLen length datas after offset address Offset in writing data blocks B;
8-5), by same location in remaining data writing data blocks B in data block A;
8-6), data block A is assigned to preliminary data area, update the data memory block mapping table and preliminary data area mapping table.
CN201611039944.5A 2016-11-11 2016-11-11 A kind of date storage method based on NandFlash Pending CN106776106A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611039944.5A CN106776106A (en) 2016-11-11 2016-11-11 A kind of date storage method based on NandFlash

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611039944.5A CN106776106A (en) 2016-11-11 2016-11-11 A kind of date storage method based on NandFlash

Publications (1)

Publication Number Publication Date
CN106776106A true CN106776106A (en) 2017-05-31

Family

ID=58975493

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611039944.5A Pending CN106776106A (en) 2016-11-11 2016-11-11 A kind of date storage method based on NandFlash

Country Status (1)

Country Link
CN (1) CN106776106A (en)

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107463507A (en) * 2017-07-14 2017-12-12 惠州市天泽盈丰物联网科技股份有限公司 Record pointer processing method
CN107748703A (en) * 2017-09-29 2018-03-02 南京南瑞集团公司 It is a kind of fault-tolerant with the embedded data storage method of mechanism for correcting errors comprising markers
CN108228095A (en) * 2017-12-15 2018-06-29 中国航空工业集团公司西安飞行自动控制研究所 A kind of method that real time information record is carried out based on Flash
CN109032832A (en) * 2017-06-12 2018-12-18 中兴通讯股份有限公司 With outer OOB layout method and device
CN109299018A (en) * 2018-08-15 2019-02-01 深圳拓邦股份有限公司 The read method and device of historical data in a kind of flash storage
CN109343790A (en) * 2018-08-06 2019-02-15 百富计算机技术(深圳)有限公司 A kind of date storage method based on NAND FLASH, terminal device and storage medium
CN109360258A (en) * 2018-08-21 2019-02-19 上海嘉奥信息科技发展有限公司 Body renders the method and system of real time data modification
WO2019136980A1 (en) * 2018-01-12 2019-07-18 江苏华存电子科技有限公司 Bad block processing method for multi-channel memory system
CN110688084A (en) * 2019-10-14 2020-01-14 深圳市蓝度汽车电控技术有限公司 First-in first-out FLASH data storage method, system and terminal
CN110765140A (en) * 2019-10-31 2020-02-07 江苏华存电子科技有限公司 Mapping table dispersed storage method
CN111722808A (en) * 2020-06-22 2020-09-29 北京卫星环境工程研究所 Storage processing method, processing device and processor for satellite loads
CN112068781A (en) * 2020-09-10 2020-12-11 深圳芯邦科技股份有限公司 Data reading and writing method of memory and related equipment
CN113311988A (en) * 2020-02-26 2021-08-27 北京君正集成电路股份有限公司 Method for ensuring NAND FLASH serial number and MAC address to be stored correctly
CN113553003A (en) * 2021-06-17 2021-10-26 厦门大手控制技术有限公司 Data storage device and parking lot data storage system

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101124639A (en) * 2005-09-30 2008-02-13 西格马特尔公司 System and method of accessing non-volatile computer memory
CN101908073A (en) * 2010-08-13 2010-12-08 清华大学 Method for deleting duplicated data in file system in real time
US20110141823A1 (en) * 2009-12-11 2011-06-16 Teruo Takagiwa Semiconductor memory device and method for controlling the same
CN102169460A (en) * 2010-02-26 2011-08-31 航天信息股份有限公司 Method and device for managing variable length data
CN102200937A (en) * 2011-05-31 2011-09-28 深圳创维-Rgb电子有限公司 Method, device and television system for reading data in not-and (NAND) flash memory
CN102331911A (en) * 2011-06-17 2012-01-25 杭州华三通信技术有限公司 Driving device and method for writing data to Nand Flash by file system
CN102981976A (en) * 2012-12-05 2013-03-20 清华大学 Access control method for data storage
CN103186471A (en) * 2011-12-30 2013-07-03 深圳市共进电子股份有限公司 Method and system for managing bad blocks in storage equipment

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101124639A (en) * 2005-09-30 2008-02-13 西格马特尔公司 System and method of accessing non-volatile computer memory
US20110141823A1 (en) * 2009-12-11 2011-06-16 Teruo Takagiwa Semiconductor memory device and method for controlling the same
CN102169460A (en) * 2010-02-26 2011-08-31 航天信息股份有限公司 Method and device for managing variable length data
CN101908073A (en) * 2010-08-13 2010-12-08 清华大学 Method for deleting duplicated data in file system in real time
CN102200937A (en) * 2011-05-31 2011-09-28 深圳创维-Rgb电子有限公司 Method, device and television system for reading data in not-and (NAND) flash memory
CN102331911A (en) * 2011-06-17 2012-01-25 杭州华三通信技术有限公司 Driving device and method for writing data to Nand Flash by file system
CN103186471A (en) * 2011-12-30 2013-07-03 深圳市共进电子股份有限公司 Method and system for managing bad blocks in storage equipment
CN102981976A (en) * 2012-12-05 2013-03-20 清华大学 Access control method for data storage

Cited By (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109032832A (en) * 2017-06-12 2018-12-18 中兴通讯股份有限公司 With outer OOB layout method and device
CN107463507A (en) * 2017-07-14 2017-12-12 惠州市天泽盈丰物联网科技股份有限公司 Record pointer processing method
CN107463507B (en) * 2017-07-14 2020-05-08 惠州市天泽盈丰物联网科技股份有限公司 Recording pointer processing method
CN107748703A (en) * 2017-09-29 2018-03-02 南京南瑞集团公司 It is a kind of fault-tolerant with the embedded data storage method of mechanism for correcting errors comprising markers
CN108228095A (en) * 2017-12-15 2018-06-29 中国航空工业集团公司西安飞行自动控制研究所 A kind of method that real time information record is carried out based on Flash
CN108228095B (en) * 2017-12-15 2021-02-09 中国航空工业集团公司西安飞行自动控制研究所 Method for recording real-time information based on Flash
WO2019136980A1 (en) * 2018-01-12 2019-07-18 江苏华存电子科技有限公司 Bad block processing method for multi-channel memory system
CN109343790A (en) * 2018-08-06 2019-02-15 百富计算机技术(深圳)有限公司 A kind of date storage method based on NAND FLASH, terminal device and storage medium
CN109343790B (en) * 2018-08-06 2021-07-13 百富计算机技术(深圳)有限公司 Data storage method based on NAND FLASH, terminal equipment and storage medium
CN109299018A (en) * 2018-08-15 2019-02-01 深圳拓邦股份有限公司 The read method and device of historical data in a kind of flash storage
CN109299018B (en) * 2018-08-15 2023-12-29 深圳拓邦股份有限公司 Method and device for reading historical data in Flash memory
CN109360258A (en) * 2018-08-21 2019-02-19 上海嘉奥信息科技发展有限公司 Body renders the method and system of real time data modification
CN110688084A (en) * 2019-10-14 2020-01-14 深圳市蓝度汽车电控技术有限公司 First-in first-out FLASH data storage method, system and terminal
CN110765140A (en) * 2019-10-31 2020-02-07 江苏华存电子科技有限公司 Mapping table dispersed storage method
WO2021082111A1 (en) * 2019-10-31 2021-05-06 江苏华存电子科技有限公司 Mapping table distributed storage method
CN113311988A (en) * 2020-02-26 2021-08-27 北京君正集成电路股份有限公司 Method for ensuring NAND FLASH serial number and MAC address to be stored correctly
CN111722808A (en) * 2020-06-22 2020-09-29 北京卫星环境工程研究所 Storage processing method, processing device and processor for satellite loads
CN112068781A (en) * 2020-09-10 2020-12-11 深圳芯邦科技股份有限公司 Data reading and writing method of memory and related equipment
CN112068781B (en) * 2020-09-10 2024-03-22 深圳芯邦科技股份有限公司 Data reading and writing method of memory and related equipment
CN113553003A (en) * 2021-06-17 2021-10-26 厦门大手控制技术有限公司 Data storage device and parking lot data storage system

Similar Documents

Publication Publication Date Title
CN106776106A (en) A kind of date storage method based on NandFlash
CN101501623B (en) Filesystem-aware block storage system, apparatus, and method
US11853549B2 (en) Index storage in shingled magnetic recording (SMR) storage system with non-shingled region
US7761648B2 (en) Caching method for NAND flash translation layer
CN103577121B (en) A kind of highly reliable linear file access method based on Nand Flash
US8010770B2 (en) Caching device for NAND flash translation layer
CN105843551B (en) Data integrity and loss resistance in high performance and large capacity storage deduplication
CN101903866B (en) Method and system for storage of data in non-volatile media
CN101515276B (en) Method for write operation of file data, and recovery method and recovery system for file data
CN101944115B (en) Method and system for searching logs
US9727245B2 (en) Method and apparatus for de-duplication for solid state disks (SSDs)
US20070136387A1 (en) Transaction-Safe FAT Files System
CN103617277A (en) Method for restoring data table content deleted mistakenly
CN104461390A (en) Method and device for writing data into imbricate magnetic recording SMR hard disk
CN103617097B (en) File access pattern method and device
WO2003056433A1 (en) Memory device and recording/reproducing apparatus using the same
CN101582076A (en) Data de-duplication method based on data base
CN101777017A (en) Rapid recovery method of continuous data protection system
CN104166605A (en) Data backup method and system based on incremental data files
CN109496292A (en) A kind of disk management method, disk management device and electronic equipment
CN104281717A (en) Method for establishing massive ID mapping relation
KR20110046118A (en) Adaptive logging apparatus and method
CN105045540B (en) A kind of data layout method of Solid-state disc array
CN1205577C (en) Database table recovery system
CN103761156B (en) A kind of online restorative procedure for file system

Legal Events

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

Application publication date: 20170531