CN101419840B - Data storage method for flash - Google Patents

Data storage method for flash Download PDF

Info

Publication number
CN101419840B
CN101419840B CN2007101656111A CN200710165611A CN101419840B CN 101419840 B CN101419840 B CN 101419840B CN 2007101656111 A CN2007101656111 A CN 2007101656111A CN 200710165611 A CN200710165611 A CN 200710165611A CN 101419840 B CN101419840 B CN 101419840B
Authority
CN
China
Prior art keywords
data
blocks
page
section
substitution
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
Application number
CN2007101656111A
Other languages
Chinese (zh)
Other versions
CN101419840A (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.)
Apacer Technology Inc
Original Assignee
Apacer Technology Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Apacer Technology Inc filed Critical Apacer Technology Inc
Priority to CN2007101656111A priority Critical patent/CN101419840B/en
Publication of CN101419840A publication Critical patent/CN101419840A/en
Application granted granted Critical
Publication of CN101419840B publication Critical patent/CN101419840B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

A data storage method of a flash memory divides a memory into a plurality of sections consisting of main blocks and substitution blocks. When data is written, if storage address points to one page of the main blocks, while the page is written but not deleted yet, the data storage method leads the data to be written any blank page of the substitution blocks in the same section; when the system is not in use, or the substitution blocks are fully written, the method causes the data stored in the main blocks and the substitution blocks of the section to be duplicated into the other blank section to be reformed and then deleting action is carried out on an original section, finally, the reformed data is stored back to the original section.

Description

The data storage method of flash memory
Technical field
The present invention relates to flash memory, be specifically related to the storage method of flash memory.
Background technology
In recent years, the development of flash memory is very fast, and its utilization is also maked rapid progress, and various storage card, dish (Flash drive) is all very universal with oneself.Yet along with flash memory technology reaches its maturity, cost reduces day by day, and each manufacturer also begins to drop into a large amount of The Study on Resources flash memories and uses widely, like solid-state hard disk SSD (Solid-State Disk).SSD is for make the pure electronic hard disc machine of Storage Media with flash memory; Characteristics such as this device possesses still that flash memory access speed is fast, low power consumption, low heat emission, in light weight, low vibrations and vibration resistance; Can in the incompetent rugged surroundings of traditional magnetic Winchester disk drive, use, even the potentiality that replace the traditional magnetic Winchester disk drive are arranged.
But itself has significant disadvantages flash memory, and certain limitation is arranged its serviceable life, and said restriction is to decide with respect to the number of times of its data deletion (Erase).At present but the number of times of the deleted data of flash memory is slightly different because of the difference of manufacturer, and on average about about 100,000 times, and the deleted number of times of this device is more near greatest limit, and data stored in the flash memory are more unstable.Therefore, if can not prolong the serviceable life of flash memory, will cause great restriction, and improve its displacement cost for using flash memory.Yet the number of times deleted of flash memory depends on the raising of semiconductor fabrication.Have under the prerequisite of breakthrough progress in the present manufacturing technology difficulty of flash memory, how to reduce the deletion number of times of flash memory, become the effective means that present stage prolongs the flash memory life-span.
The framework of flash memory is a base unit with the page (Page), and a plurality of pages are formed block (Block).Yet it is unit that flash memory has when storing with the page, is the characteristics that unit carries out with the block during deletion, owing to store the unit-sized difference with deletion, and with making the deletion number of times far above storing actual required number of times.For example, when computing machine only wants to store the data of page size,, then need earlier the whole deletion of block at this page place could be write this page with above-mentioned new data if this save command page pointed has been written into data and when not deleting as yet.Yet, with the irrelevant page of this new data, no matter wherein whether there have been data in this block, all need to be deleted.That is, deposit in smoothly for making said new data, all pages in this block all need be consumed deletion number of times once.For example; Comprise A, B, three pages of C in the block; And A, B two pages have been written into data, if want to revise the data in the A page, or when the A page is pointed in the address of storage data; According to the rule that writes preceding deletion (Erase before write), flash memory system need can write the A page with this new data after the content of this block of deletion.If when wanting to revise the B page, can new data be write the B page after also need deleting this block content, thus, the A page and all only be modified once with the B page, but will be by deletion twice, the number of times of waste deletion.And the blank C page is not used all the time, but need consume twice deletion number of times, forms unnecessary waste, so long-term the use, and the number of times of waste is real to be considerable.
Given this characteristics of data storing and deletion propose many special memory storage methods at present in succession to the influence that flash memory caused, and hope to reduce the deletion number of times through the application of optimizing the flash memory inner space, thereby reach the purpose that increases serviceable life.For example United States Patent (USP) 5; Disclosing for 937, No. 425 should technology, and the mentioned unit (Unit) of this patent is the block (Block) among the present invention; And mentioned block (Block) equals the page (Page) among the present invention in this patent; Because the defined noun of inventor is different, for avoiding confusion, following explanation to ' 425 patent will be adopted the title identical with the present invention.
The data storing synoptic diagram of ' No. 425 patent that Fig. 1 is above-mentioned supposes that this flash memory has a plurality of blocks, is two blocks wherein shown in the figure; I.e. first block (10) and second block (20), and each block respectively comprises five pages (10a~10e, 20a~20e); When save command after computing machine decoding; Point to second page (10b) in first block (10), and second page (10b) has been written into data, but as yet by when deletion; The method that deletion earlier writes data to second page (10b) is not more carried out in this invention; But seek complete vacant second block (20) separately, and find the page (20b) that has same offset (Offset) with second page (10b) within it, then new data is write.After accomplishing storage this time; If also want to write another piece of data; System points to the 4th page (10d) in first block (10), and the 4th page (10d) also has been written into data, but as yet by when deletion; As stated, stored programme need be looked for another vacant fully block and will want that another piece of data that writes writes.This is because second block (20) is though only be written into a page; Shang Yusi the blank page; But because vacant no longer fully, can't let second piece of data write, therefore must seek complete vacant the 3rd block (30) again; Second piece of data is write in the 3rd block (30), and the address that is write should have the page (30d) of same offset with the 4th page (10d) in this first block (10).
Though said method can reduce the average deletion number of times of each block, still has weak point, when promptly using this method, the flash memory stores utilization of space is extremely low.Like above-mentioned example; Write second page (20b) of second block (20) when first piece of data after; Though (10a, 10c~10e) be not written into as yet, second block (20) still can be non-vacant fully because of it for other page in second block (20); And be regarded as using (Unavailable) by system, cause when seeking next time and skipped.That is to say that no matter with residue how many blank pages in the block, as long as any page in this block is written into once, this block just can use all the other blank pages after can only waiting for deletion.Suppose that block is made up of 50 pages jointly, if wherein only a page be written into data, then the blank pages of all the other four nineteens all will be by vacant and can't use, and when reforming, waste deletion number of times once respectively.So flash memory space utilization, quite incorrect, this shows that the method is not the storage method of full blast, still have improvable space and necessity.
Summary of the invention
Fundamental purpose of the present invention provides a kind of data storage method of flash memory, and this method storage allocation volume inside is effectively also managed, and improves the efficient of data storing and reformation, and reduces the deletion number of times of internal memory, prolongs the serviceable life of flash memory.
The present invention provides a kind of data storage method of flash memory, and its characteristic comprises:
A) divide at least two storage compartments of being made up of main blocks and substitution blocks, wherein said block is made up of a plurality of page;
B) when the page that is pointed in the main blocks has been written into data but has not deleted as yet, earlier data are write in the substitution blocks;
C) send when reforming instruction when system, be stored in data in the said section and will be copied in other blank section and reform;
D) behind execution of step c, original section is deleted; And,
E) behind execution of step c, the data after reforming are deposited back in the said original section by temporary section.
Method proposed by the invention not only can effectively be used the flash memory volume inside, and the management when storage, reformation also without any confusion, can reach the order of raising the efficiency, reduce the deletion rate really.
Description of drawings
Fig. 1 is the data storing synoptic diagram of prior art;
Fig. 2 is the process flow diagram of a kind of example preferred embodiment of the flash memory stores method according to the present invention;
Fig. 3 A and 3B are the synoptic diagram of another preferred embodiment example of the flash memory stores method according to the present invention;
Fig. 4 is another process flow diagram of example preferred embodiment of the flash memory stores method according to the present invention; And,
Fig. 5 is another synoptic diagram of example preferred embodiment of the flash memory stores method according to the present invention.
[assembly conventional letter]
10... first page to the, five pages of first block 10a~10e..., first block
20... first page to the, five pages of second block 20a~20e..., second block
30... first page to the, five pages of the 3rd block 30a~30e... the 3rd block
4... section
5... the page in main blocks 51~55... main blocks
6... the page in first substitution blocks, 61~65: first substitution blocks
7... the blank section of the second substitution blocks 8...
S11~S15, S21~S25... step
Embodiment
Relevant technology contents of the present invention, existing accompanying drawings is following:
Fig. 2 is the process flow diagram of a kind of example preferred embodiment of the flash memory stores method according to the present invention; This embodiment is divided into a plurality of sections (Zone) with internal memory; And these sections are formed (S11) by main blocks and substitution blocks, and each block is made up of a plurality of page again.When computing machine is assigned logic addressing instruction LBA (Logical Block Addressing); Certain page (Page) in the main blocks (Block) in certain section is pointed in this LBA instruction after decoding; If this page has been written into data; But do not deleted as yet, system writes the arbitrary blank page (S12) in the substitution blocks in the same section with new data, replaces the page in the main blocks by the page in the substitution blocks; And when the another part storage data page pointed during still for the state that has been written into but do not deleted as yet, other the blank page in the substitution blocks in same section writes another piece of data in the same way.
Whole pages of the substitution blocks in section are all write full; Or system is when being in idle (Idle) state; Be copied in another blank section those main blocks and the data in those substitution blocks that are stored in this section and reform (S13); Data all duplicate and reform finish after, with original section deletion (S14), empty former storage data.After the deletion of original section finished, with above-mentioned temporary to other blank section data after haveing suffered of laying equal stress on, row was deposited back original section interior (S15) again.Certainly; Also can be in that original section deletion (S14) is preceding; Be about to those data later of reforming and deposit back this original section interior (S15), those skilled in the art should understand that also revocable step of said method, should be according to application target and in addition conversion; This embodiment does not limit the present invention for according to the described preferred implementation of preferred order.
Fig. 3 A and 3B are the synoptic diagram that another preferred embodiment of the flash memory stores method according to the present invention is shown instance.Shown in Fig. 3 A, comprise a plurality of main blocks 5 and a plurality of substitution blocks 6 in the section 4, for ease of explaining the present invention, the diagrammatic sketch that only indicates a block size is here respectively also described.Each block of hypothesis all is made up of 51~55,61~65 of five pages in this embodiment; When first data are desired to write in the main blocks 5 in the section 4; When not deleted as yet but its second page 52 pointed has been written into data; Just do not delete first data are write second page 52 in the main blocks 5; Being to accomplish through the arbitrary blank page that first data is write in the substitution blocks 6 in the same section 4, is that first piece of data will be write first page 61 in the substitution blocks 6 in this embodiment.And will write second data time, the 4th pages 54 in the main blocks 5 of system's indication also have been written into data but have not been deleted as yet, and system writes second data that the arbitrary blank page except that first page 61 gets final product in the substitution blocks 6 in the same section 4.When the page in the substitution blocks 6 in this section 4 is all write when full, shown in Fig. 3 B, only need look for the section 8 of a blank separately, the data in the original section 4 are all copied to described blank section 8 and reform get final product.Data in this embodiment are four parts altogether, when data duplicate totally finish after, with 4 deletions of former section, thereby empty former storage data, make it be reduced to vacant section, again those data later of reforming are deposited back in the original section 4.
Above-mentioned method can be used all pages in the substitution blocks effectively, causes the deletion cycle (Erase cycle) of internal memory to be able to prolong, and effectively falls the deletion rate of end internal memory.
Fig. 4 is another process flow diagram of example preferred embodiment according to flash memory stores method of the present invention, and its flow process roughly flow process with shown in Figure 2 is similar.Difference is; Section in this embodiment is by main blocks, first substitution blocks; The second substitution blocks three forms S21 jointly; Wherein first substitution blocks is identical with substitution blocks described in the above-mentioned embodiment, and being used to supply the less archives of requisite space is that unit writes page by page with the page, and second substitution blocks provides the requisite space size approximate or equal the continuity archives of a block and be that unit writes continuously with the block.Before data write, system will judge earlier and writes the required space of these data size S22, if required space is less, only needs the space S 22N of several pages, execution in step S22a, and step S22a is identical with step (S12) during second schemes.If but this piece of data is the continuity archives; Or its required space sizableness is when the block S22Y of a monoblock; Execution in step S22b; Be about to this part continuity archives and deposit in second substitution blocks, once write a main plot piece, rather than as step S22a and step S12, be the paging write memory.This machine-processed advantage is; When the data that write are the bigger continuity archives in the space that needs; System will this umber be that unit (being a plurality of continuous pages) writes for whole part continuously with the block, reduces the time of required cost when storing with reformation, and idle in system; Or first substitution blocks, second substitution blocks one of them write when full, action S23 again reforms.
Fig. 5 is another synoptic diagram of example preferred embodiment according to flash memory stores method of the present invention, and section 4 is divided into main blocks 5, first substitution blocks 6 and second substitution blocks 7.As above an embodiment is said, and this figure also only indicates the view of block size respectively and describes.Suppose that respectively this block all is made up of five pages 51~55,61~65; When the 3rd data want to write first page 51 in the main blocks 5; And the 3rd data size nearly during a block of depositing requisite space in, though do not write data in first page 51, be written into data in second page 52 and do not deleted as yet; Because 51~55 common blocks of forming 5 of this page are not vacant fully, therefore the 3rd data can't write in the block 5 continuously.This moment, system will the 3rd data storing in second substitution blocks 7 in the same section 4.Because the 3rd data are to be that unit deposits second substitution blocks 7 continuously in the block; Be not as the embodiment among Fig. 3, to be that unit deposits first substitution blocks 6 page by page in the page; This way can make the storage of continuity archives and reformation time all shorten, thereby improves very high efficient.
Through experiment, when the ratio of main blocks of the present invention 5, first substitution blocks 6, second substitution blocks 7 is 64: 8: 1, be suitable for often carrying out the flash memory of access action most, for example be used for the flash memory of storage system file.And main blocks 5, first substitution blocks 6, second substitution blocks 7 are 128: 4: 1 ratio, then are suitable for most storing the flash memory of general data.It will be understood by those skilled in the art that this experimental data is merely the explanation of preferred proportion, is not to immobilize, and should change according to demand when practical.
The above is merely the preferred embodiments of the invention, is not so promptly limits claim of the present invention, and every other equivalence of in characteristic range of the present invention, being done changes or modifies, and all should comprise within the scope of the invention.

Claims (7)

1. the data storage method of a flash memory is characterized in that, comprises the steps:
A) divide at least two sections, each section is made up of main blocks and substitution blocks, and wherein said main blocks and substitution blocks are made up of a plurality of page respectively;
B) when the page that is pointed in the main blocks has been written into data but has not deleted as yet, earlier data are write the arbitrary blank page in the substitution blocks in the same section;
C) send when reforming instruction when system, be stored in data in the said section and will be copied in other blank section and reform;
D) behind execution of step c, original section is deleted; And,
E) behind execution of step c, the data after reforming are deposited back in the said original section by temporary section.
2. the data storage method of flash memory as claimed in claim 1 is characterized in that, the said reformation instruction among the said step c is write in said substitution blocks and sent when full.
3. the data storage method of flash memory as claimed in claim 1 is characterized in that, sends when the said reformation instruction among the said step c is left unused in said system.
4. the data storage method of a flash memory is characterized in that, comprises the steps:
A) divide at least two sections, each section is made up of main blocks, first substitution blocks and second substitution blocks, and wherein said main blocks, first substitution blocks and second substitution blocks are made up of a plurality of pages respectively;
B) before data write, judge whether said data meet the service condition of second substitution blocks;
C) meet when condition, and the page that is pointed in the main blocks has been written into data but when not deleting as yet, data have been write in the same section in second substitution blocks;
D) do not meet when condition, and the page that is pointed in the main blocks has been written into data but when not deleting as yet, data has been write the arbitrary blank page in first substitution blocks in the same section;
E) send when reforming instruction when system, copy in other blank section and reform being stored in data in the said section;
F) behind execution of step e, original section is deleted;
G) behind execution of step e, the said data after reforming are deposited back in the said original section by temporary section.
5. the data storage method of flash memory as claimed in claim 4 is characterized in that, reformation among said step e instruction is write in said first substitution blocks to send when full.
6. the data storage method of flash memory as claimed in claim 4 is characterized in that, reformation among said step e instruction is write in said second substitution blocks to send when full.
7. the data storage method of flash memory as claimed in claim 4 is characterized in that, reformation among said step e instruction is to send when idle in said system.
CN2007101656111A 2007-10-23 2007-10-23 Data storage method for flash Active CN101419840B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2007101656111A CN101419840B (en) 2007-10-23 2007-10-23 Data storage method for flash

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2007101656111A CN101419840B (en) 2007-10-23 2007-10-23 Data storage method for flash

Publications (2)

Publication Number Publication Date
CN101419840A CN101419840A (en) 2009-04-29
CN101419840B true CN101419840B (en) 2012-05-30

Family

ID=40630591

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2007101656111A Active CN101419840B (en) 2007-10-23 2007-10-23 Data storage method for flash

Country Status (1)

Country Link
CN (1) CN101419840B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1619533A (en) * 2003-11-17 2005-05-25 鸿富锦精密工业(深圳)有限公司 Flash memory document management system and method
CN1659603A (en) * 2002-04-24 2005-08-24 伊特伦电学计量公司 Method of using flash memory for storing metering data
CN101030167A (en) * 2007-01-17 2007-09-05 忆正存储技术(深圳)有限公司 Flash-memory zone block management

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1659603A (en) * 2002-04-24 2005-08-24 伊特伦电学计量公司 Method of using flash memory for storing metering data
CN1619533A (en) * 2003-11-17 2005-05-25 鸿富锦精密工业(深圳)有限公司 Flash memory document management system and method
CN101030167A (en) * 2007-01-17 2007-09-05 忆正存储技术(深圳)有限公司 Flash-memory zone block management

Also Published As

Publication number Publication date
CN101419840A (en) 2009-04-29

Similar Documents

Publication Publication Date Title
CN101354681B (en) Memory system, abrasion equilibrium method and apparatus of non-volatile memory
US7937522B2 (en) Method for flash memory data management
US9436615B2 (en) Optimistic data read
CN103838853B (en) Mixed file system based on different storage media
CN106716334A (en) Efficient data movement within file system volumes
CN104899154B (en) The page management method hosted is mixed based on embedded system
CN104077235A (en) Method of partitioning physical block and memory system thereof
CN101620572B (en) Nonvolatile memory and control method
US9606746B2 (en) Shiftable memory supporting in-memory data structures
CN101625897B (en) Data write-in method, storage system and controller used for quick flash memory
US20140328127A1 (en) Method of Managing Non-Volatile Memory and Non-Volatile Storage Device Using the Same
CN101446976A (en) File storage method in distributed file system
CN102169460A (en) Method and device for managing variable length data
CN114510434A (en) Data aggregation in ZNS drivers
CN102306124A (en) Method for implementing hardware driver layer of Nand Flash chip
CN102520885B (en) Data management system for hybrid hard disk
CN104484128A (en) Read-once and write-once storage based read-more and write more storage and implementation method thereof
CN102541755B (en) The method of flash memories and reception data thereof
CN100580669C (en) Method for realizing cache memory relates to file allocation table on Flash storage medium
JP6531574B2 (en) Storage device, storage device control program and storage device control method
CN103246615A (en) Method and device for data management in flash memory device
CN109491927A (en) Data storage, read method, device and electronic equipment
CN101739350B (en) Memory storage device and control method thereof
CN105630410B (en) The method for managing file storage area using non-volatile random read-write storage chip dynamic
CN105630697B (en) A kind of storage device using MRAM storage small documents

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant