CN108804344A - The flash memory storage method and device of tape file system - Google Patents

The flash memory storage method and device of tape file system Download PDF

Info

Publication number
CN108804344A
CN108804344A CN201810480660.2A CN201810480660A CN108804344A CN 108804344 A CN108804344 A CN 108804344A CN 201810480660 A CN201810480660 A CN 201810480660A CN 108804344 A CN108804344 A CN 108804344A
Authority
CN
China
Prior art keywords
file system
data
snapshot
memory
flash
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
CN201810480660.2A
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.)
Ramaxel Technology Shenzhen Co Ltd
Original Assignee
Ramaxel Technology Shenzhen 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 Ramaxel Technology Shenzhen Co Ltd filed Critical Ramaxel Technology Shenzhen Co Ltd
Priority to CN201810480660.2A priority Critical patent/CN108804344A/en
Publication of CN108804344A publication Critical patent/CN108804344A/en
Pending legal-status Critical Current

Links

Classifications

    • 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
    • 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/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1458Management of the backup or restore process
    • G06F11/1469Backup restoration techniques

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

The present invention relates to the flash memory storage method of tape file system and device, this method includes that flash memory is divided into SLC area and the regions TLC;SLC area is divided into file system memory and non-file system memory;Obtain the file system data of write-in;Judge that file system memory whether there is memory capacity;If it is not, the data in non-file system memory are then transferred to the regions TLC, and enter next step, if so, into next step;The file system data of write-in is stored in file system memory.The present invention is not when the memory of storage file system data has content, non- file system data is moved to the regions TLC, vacate the new user data of capacity storage write-in, during booting restores data, it is only necessary to restore the block where file system, restore without overall surface sweeping, reduce the recovery time of file system data, after file system initialization is restored, you can respond the access of host side, rate is fast.

Description

The flash memory storage method and device of tape file system
Technical field
The present invention relates to data storages, more specifically refer to the flash memory storage method and device of tape file system.
Background technology
At present in terms of computer storage, storage medium used includes mainly:Magnetic medium (hard disk), optical medium (CD) And the solid storage medium with flash memory (Flash, also known as flash memory) for representative of rapid proliferation is being obtained now, In with solid-state storage develop it is the swiftest and the most violent.With popularizing for flash media, correspondingly, its price is also declining rapidly, certain Has there is the trend that SSD (solid-state disk) gradually replaces hard disk in field;CD is mainly used in media releasing at present, packet Include software, multimedia, data etc., but CD there are volumes big, flimsy disadvantage, while carrying out media hair with CD Cloth is not easily accomplished copyright protection.In this background, it is carried out using the flash media substitute disc that current cost reduces rapidly Media releasing has broad application prospects, because flash media not only has small, low in energy consumption, access speed fast etc. excellent Point, while the interests of publisher can also be safeguarded using advanced digital copyright protection technology (DRM).
Flash-memory storage system generally uses Page-level mapping algorithms at present, using such algorithm, number of users According to being possibly stored on any Page in any Block, this is very flexible, but also one very direct problem of band:It is all User data is all identical processing mode.The process of flash memory storage will not be stored in not same district because data type is different Domain, but it is just different for application system (the especially system with OS), and such as camera of a video monitoring, it is written The data of storage mainly have:File system data, video stream data and picture data these three, the importance of these three data and Characteristic is clearly different.File system data is especially sensitive and important, light then damage if data therein are wrong Mass data is lost, heavy then whole system is damaged;Video stream data is then made of thousands of frame data up to a hundred, is come from file angle It sees, it is that big file (MB is unit), some bits overturn or have segment data mistake one by one, may shadow for entire file It rings less, from the point of view of flow angle, it is rolled in real time, the error in data of some a certain position carved, may be in next frame Or lower one piece of data is completed supplement or is repaired, mistake just seems not serious;Picture data is that (KB is single to small documents one by one Position), relative to video stream file, it requires data correctness can be high many.For file system data, as shown in Figure 1, with User data constantly write-in and update, will disperse on each piece of Nand-flash and each page, the number of Nand-flash Precondition according to read-write is the mapping table reconstructed completion in FTL algorithms, although as long as reading file system data The reconstruction of file system is completed, but because this partial data is dispersed in each piece, is caused only that the mapping table of whole disk is extensive After multiple success, could carry out the access of file system data, this time overhead be it is huge, if mapping table snapshot loss or If person damages, that will be one minute even ten minutes order of magnitude, and the recovery time of file system data is long, leads to host side Access response it is slower.
Therefore, it is necessary to design a kind of new flash memory storage method, the recovery time of reduction file system data is realized, soon The access of speed response host side.
Invention content
It is an object of the invention to overcome the deficiencies of existing technologies, the flash memory storage method and dress of tape file system are provided It sets.
To achieve the above object, the present invention uses following technical scheme:The flash memory storage method of tape file system, the side Method includes:
Flash memory is divided into SLC area and the regions TLC;
SLC area is divided into file system memory and non-file system memory;
Obtain the file system data of write-in;
Judge that file system memory whether there is memory capacity;
If it is not, the data in non-file system memory are then transferred to the regions TLC, and enter next step, if so, Into next step;
The file system data of write-in is stored in file system memory.
Its further technical solution is:Before the step of obtaining the file system data of write-in, further include:
Recovery is booted up to flash-memory storage system.
Its further technical solution is:The step of recovery is booted up to flash-memory storage system, including step in detail below:
Flash-memory storage system is powered on, and completes the initialization of infrastructure component;
Data in initialization files system storage.
Its further technical solution is:The step of data in initialization files system storage, including walk in detail below Suddenly:
Obtain the file system data after the file system data and snapshot before snapshot;
Judge whether snapshot damages;
If it is not, then carrying out snapshot recovery to the file system data before snapshot, the file system data before snapshot is obtained Mapping relations;
If so, being scanned to the file system data before snapshot, the mapping of the file system data before snapshot is obtained Relationship;
File system data after snapshot is scanned, the mapping relations of the file system data after snapshot are obtained.
Its further technical solution is:Before the step of data in non-file system memory are transferred to the regions TLC, Further include:
Set flash-memory storage system to write-protect state.
The present invention provides the flash memory devices of tape file system, including system realm division unit, SLC area to divide Unit, capacity judging unit, moves unit and storage unit at data capture unit;
The system realm division unit, for flash memory to be divided into SLC area and the regions TLC;
The SLC area division unit, for SLC area being divided into file system memory and non-file system is deposited Reservoir;
The data capture unit, the file system data for obtaining write-in;
The capacity judging unit, for judging that file system memory whether there is memory capacity;
It is described to move unit, for if it is not, the data in non-file system memory are then transferred to SLC area;
The storage unit, for the file system data of write-in to be stored in file system memory.
Its further technical solution is:Described device further includes recovery unit;
The recovery unit, for booting up recovery to flash-memory storage system.
Its further technical solution is:The recovery unit includes powering on processing module and initialization module;
It is described to power on processing module, for being powered on to flash-memory storage system, and complete the initialization of infrastructure component;
The initialization module, for the data in initialization files system storage.
Its further technical solution is:The initialization module include snapshot data acquisition submodule, damage judge submodule Block, snapshot restore submodule, the first scanning restores submodule and the second scanning restores submodule;
The snapshot data acquisition submodule, for obtaining the file system after file system data and snapshot before snapshot Data;
The damage judging submodule, for judging whether snapshot damages;
The snapshot restores submodule, is used for if it is not, then carrying out snapshot recovery, acquisition to the file system data before snapshot The mapping relations of file system data before snapshot;
First scanning restores submodule, for if so, being scanned to the file system data before snapshot, acquisition The mapping relations of file system data before snapshot;
Second scanning restores submodule, for being scanned to the file system data after snapshot, after obtaining snapshot File system data mapping relations.
Its further technical solution is:The system also includes state set units;
The state set unit, for setting flash-memory storage system to write-protect state.
Compared with the prior art, the invention has the advantages that:The flash memory storage method of the tape file system of the present invention is led to It crosses and flash-memory storage system is divided into SLC area and the regions TLC, then physical division is carried out to SLC area, to file system data It is stored in fixed piece of the inside, when the memory of storage file system data does not have content, non-file system data is moved To the regions TLC, the new user data of capacity storage write-in, including file system data and non-file system data are vacateed, During booting restores data, it is only necessary to restore the block where file system, restore without overall surface sweeping, reduce file system The recovery time of data, after file system initialization is restored, you can the access of host side is responded, so that the access of host side is rung Answer rate fast.
The invention will be further described in the following with reference to the drawings and specific embodiments.
Description of the drawings
Fig. 1 is the file system data distribution schematic diagram of the prior art;
Fig. 2 is the flow chart of the flash memory storage method for the tape file system that the specific embodiment of the invention one provides;
Fig. 3 is the distribution schematic diagram for the flash-memory storage system that the specific embodiment of the invention one provides;
Fig. 4 is the file system data changes in distribution schematic diagram that the specific embodiment of the invention one provides;
Fig. 5 is the schematic diagram for the flash state migration that the specific embodiment of the invention one provides;
Fig. 6 is the schematic diagram for the user data flow direction that the specific embodiment of the invention one provides;
Fig. 7 is the flow chart that recovery is booted up to flash-memory storage system that the specific embodiment of the invention one provides;
Fig. 8 is the flow chart for the initialization files system storage that the specific embodiment of the invention one provides;
Fig. 9 is the structure diagram of the flash memory device for the tape file system that the specific embodiment of the invention one provides;
Figure 10 is the structure diagram for the recovery unit that the specific embodiment of the invention one provides;
Figure 11 is the structure diagram for the initialization module that the specific embodiment of the invention one provides.
Specific implementation mode
In order to more fully understand the present invention technology contents, with reference to specific embodiment to technical scheme of the present invention into One step introduction and explanation, but not limited to this.
The specific embodiment as shown in Fig. 2~11, the flash memory storage method of tape file system provided in this embodiment can be with Apply to the various data such as storage file system data, video stream data and picture data, realizes reduction file system data Recovery time, the access of quick response host side.
Flash memory is a storage system formed in blocks, and several pages are contained in each block, and each page can be deposited The data for storing up several bytes, for the flash memory of TLC types, each block may be designated as SLC patterns or TLC patterns, Page therein is read and write, erasing operation.
As shown in Fig. 2, the present embodiment one provides the flash memory storage method of tape file system, this method includes:
S1, flash memory is divided into SLC area and the regions TLC;
S2, SLC area is divided into file system memory and non-file system memory;
S4, the file system data for obtaining write-in;
S5, judge that file system memory whether there is memory capacity;
S6, if it is not, the data in non-file system memory are then transferred to the regions TLC, and enter S7 steps, if so, Then enter S7 steps;
S7, the file system data of write-in is stored in file system memory.
For above-mentioned S1 steps, specifically according to storage class, flash memory is divided into two regions, for example:Make With 3D TLC Nand-Flash, file system data can be stored in SLC area, and other user data are then in the regions TLC, The former reliability is greatly strengthened, and the access time expense of SLC is substantially the half or even smaller of TLC, it therefore, can It can be promoted at double by property and response speed.
As shown in Fig. 2, the separation of the final extraction system of separation of file system data, whole system be divided into file system and Global function system, that is, SLC area and the regions TLC, and the data of file system are no longer distributed in each piece, they can be limited It is scheduled in fixed piece of region.These blocks are the blocks in SLC area, and reliability and performance are greatly improved.
As shown in fig. 6, entire flash memory system is divided into SLC area and the regions TLC, this division is the division of physics, example Such as:The block of number 0-149 forms SLC area, and other pieces form the regions TLC, then in the life cycle of flash-memory storage system, The property of these blocks will not change (unless carrying out capacity change with Customization Tool) again, and the block of SLC can be the block of SLC always, The block of TLC always also is the block of TLC, wherein the regions TLC are completely used for storage user data, and SLC area stores number of users According to (including file system data and non-file system data) and FTL internal management datas.SLC area be divided into SLC Cache and Other (corresponding to user data and FTL internal management datas respectively).
SLC area and the regions TLC are divisions physically, otherwise that is, a block is in SLC area or in the regions TLC.Text Part system storage is division in logic, i.e., the SLC block that they are used is not fixed, but one is scheduled in SLC area, with reality The capacity of file system memory in existing dynamic regulation SLC area, so that the practicality is stronger.
Preferably, above-mentioned S4 steps further include before the step of obtaining the file system data of write-in:
S3, recovery is booted up to flash-memory storage system.
As shown in fig. 7, further, above-mentioned S3 steps, the step of recovery is booted up to flash-memory storage system, packet Include step in detail below:
S31, flash-memory storage system is powered on, and completes the initialization of infrastructure component;
Data in S32, initialization files system storage.
For above-mentioned S31 steps, the initialization of the infrastructure components such as drive load, memory management is specifically included.
Preferably for above-mentioned S32 steps, the step of data in initialization files system storage, including it is following Specific steps:
The file system data after file system data and snapshot before S321, acquisition snapshot;
S322, judge whether snapshot damages;
S323, if it is not, then to before snapshot file system data carry out snapshot recovery, obtain snapshot before file system number According to mapping relations, and enter S325 steps;
S324, if so, be scanned to the file system data before snapshot, obtain the file system data before snapshot Mapping relations, and enter S325 steps;
S325, the file system data after snapshot is scanned, the mapping for obtaining the file system data after snapshot is closed System.
For the data in fast quick-recovery after the power is turned on flash-memory storage system, flash-memory storage system can periodically preserve snapshot (such as one day or a hour etc.), as a result, system data can be divided into before snapshot data after data and snapshot, before snapshot The mapping relations of file system data can be recovered by snapshot, so the time overhead of this part is substantially snapshot The time loss of loading, and the mapping relations of file system data then need scan data to restore after snapshot, this part-time Expense is bigger, but due to the presence of snapshot, its window size is within controlled range, and such as control is in 2 to 3 SLC Within block (specifically related to the strategy of snapshot) so that whole to spend time very little (when the booting relative to application system restores Between), be above there is the case where complete snapshot, once but snapshot damage or lose, the data before snapshot and after snapshot Scan data is required for restore, this workload is huge, under original framework, it may be necessary to scan 3000 or so blocks (being mostly TLC blocks), it is assumed that the scanning of average each block needs 300 milliseconds, then entire scanning process just needs cost 2 Minute or more time, in fact, this time overhead can bigger because in this recovery process, in addition to scan data it Outside, also many other operation, such as the loading and preservation of algorithm management data, lookup and update of mapping relations etc., at this In the case of kind, flash-memory storage system is divided into two regions by the present embodiment, and two regions store different according to memory module Data, the SLC block number for limiting save file system data is much smaller, such as 100 or so, simultaneously as can ensure file In the mapping relations memory-resident of system data, the time overheads such as loading and the preservation of algorithm management data are not had.It is all excellent Chemical industry work combines, and the block (i.e. the block without idle capacity) of full data average sweep time is in Millisecond in 100 SLC blocks Not;And block (only a few, such as 1-2) average sweep time of available free capacity in hundred milliseconds of ranks, entire file system Sweep time, if it is considered that the efficiency executed parallel, sweep time can be shorter in hundred milliseconds of ranks.
For above-mentioned S4 steps, the file system data for needing to store specifically is obtained.
For above-mentioned S5 steps to S7 steps, the file system data in file system memory can have been stored in text In part system storage rather than file system data can move the regions TLC, when file system memory memory is full It waits, as shown in the user data GC in Fig. 6, when data are written in any user, data first pass through file system memory, work as text When the memory capacity of part system storage has expired, the data (data in namely non-file system memory) of non-file system It can move to the regions TLC, in this way, when writing area has little time to refresh in system exception power down or flash memory system, flash memory is situated between User data in matter is unaffected, and SLC block does not have the Share Page and TLC of MLC Nand-Flash flash memories The wordline of block is limited, and Share Page are a proprietary words of MLC Nand-Flash flash memories, is described at one Relationship between block internal page and page, when the state an of page another page of extreme influence in a program, the two pages are referred to as Share Page (low page and upper page);Wordline is that one of TLC Nand-Flash flash memories is proprietary It is similar with Share Page to describe the relationship between three Pages, property inside a Block for word.
As shown in figure 5, for this method, it is related to the state transition step of flash-memory storage system, mainly from being System no initializtion state, enters file system state, finally enters write-protect state;For flash-memory storage system state and Speech comprising eight states, respectively:After the completion of system no initializtion state, file system state, entire flash memory system restore State, write-protect state, electrification standby mode, Low-power-consumptiodormancy dormancy state and the idle state of entrance;For this eight states For, wherein it is any will not to respond host for system no initializtion state i.e. unknown (or no initializtion) state of system It asks (except IP is automatically replied);File system state is that the recovery of file system is completed, can be with response file system number According to read-write, the inquiry of flash memory system state, and the other custom commands of response can regard a micro-system as;It is entire to dodge It is the state that a global function opens that deposit system, which restores the state that enters after the completion, including in the response of host read write command, FTL Portion's management role, such as GC, WL;For write-protect state, when flash-memory storage system receives host specific command (Lock) And a kind of special state entered, in this state, demand of the system based on data protection only responds host read request, such as Fruit system enters life cycle latter stage, with the increase of bad block number, when regional space is not enough to support active user's capacity, also can Into write-protect state;For idle state, when long-time is without host request, flash-memory storage system can enter Idle shapes State.Under Idle states, system can do some rollback tasks.
In the flash-memory storage system state transition the step of, file system memory is isolated, increases the file system step Suddenly play the role of as follows:After file system recovery success, so that it may to be interacted with host, including status inquiry, debugging Deng first, substantially reducing the time (the especially situation of snapshot exception) of response host the first stroke request;Second, due to depositing The variation for storing up region characteristic, enhances the reliability of significant data;Third, the presence of file system memory, for abnormal feelings System important information is obtained under condition and debugging brings great convenience;Fourth, when the abnormal restoring for whole system has been won Between.
The data of file system are stripped out from other user data, from totally in construct a file system this The subsystem of sample.After being achieved, the recovery and read-write of file system data will be completely independent:Start process is shorter, is being switched on In the process, host can only access the data of file system, and file system only accounts for overall very small ratio, such as a 128G Video TF card, its file system may only have 20MB or so, i.e., only account for overall 1:6553.5, that is to say, that restore file system Data of uniting when abnormal, handle than restoring overall fast many times and restore more efficient and flexible, when mapping table is abnormal Or when damage, in start process, whole disk data need not be scanned, after the completion of file system reconstruction, then carry out the weight of whole disk It builds.Because after the completion of file system recovery, can respond the access of host, such host can obtain the current shape of flash memory system State determines subsequent operation again according to different states, and if system is abnormal, host can wait for flash memory system with continued power Overall mapping reconstruction is completed;Write-protect state is such as entered, then can only carry out read access operation.
, can be by dynamic regulation for the capacity of above-mentioned file system data memory in other embodiment, foundation is deposited The size for storing up data carries out dynamic regulation, and particular by several blocks are set, according to its coding settings, it stores the mould of data The type of formula and storage data.
In other embodiment, for above-mentioned S6 steps, the data in non-file system memory are transferred to TLC The step of region, after the data backup in non-file system memory, will specifically be temporarily stored into and postpone area or high in the clouds, and backup is simultaneously After temporary, then the data in non-file system memory are deleted, then from area or high in the clouds downloading data is postponed to the regions TLC It is interior, alternatively, can also be by the way of write-in, be written to the regions TLC after the mark of the data in area or high in the clouds will be postponed, Certainly, the data of this process can pass through file system memory, then need the state of file system memory being switched to electrification Standby mode, that is, new data is no longer received, the data being written at this time can be then directly entered in the regions TLC, to reach quick Shift the purpose of data.
For the flash memory storage method of above-mentioned tape file system, by by flash-memory storage system be divided into SLC area and The regions TLC, then physical division is carried out to SLC area, fixed piece of the inside is stored in file system data, when storage file system The memory of system data is moved non-file system data to the regions TLC when not having content, and the new of capacity storage write-in is vacateed User data, including file system data and non-file system data, during booting restores data, it is only necessary to restore text Block where part system restores without overall surface sweeping, reduces the recovery time of file system data, when file system initialization is extensive After multiple, you can the access of host side is responded, so that the access response rate of host side is fast.
In addition, as shown in figure 9, the present embodiment additionally provides the flash memory device of tape file system comprising system area Domain division unit 1, data capture unit 4, capacity judging unit 5, moves unit 6 and storage list at SLC area division unit 2 Member 7.
System realm division unit 1, for flash memory to be divided into SLC area and the regions TLC.
SLC area division unit 2, for SLC area to be divided into file system memory and the storage of non-file system Device.
Data capture unit 4, the file system data for obtaining write-in.
Capacity judging unit 5, for judging that file system memory whether there is memory capacity.
Unit 6 is moved, for if it is not, the data in non-file system memory are then transferred to SLC area.
Storage unit 7, for the file system data of write-in to be stored in file system memory.
For above-mentioned system realm division unit 1, specifically according to storage class, flash memory is divided into the areas Liang Ge Domain, for example:Using 3D TLC Nand-Flash, file system data can be stored in SLC area, and other numbers of users According to then in the regions TLC, greatly strengthening the former reliability, and the access time expense of SLC is substantially the half of TLC, very To smaller, therefore, reliability and response speed can be promoted at double.
As shown in Fig. 2, the separation of the final extraction system of separation of file system data, whole system be divided into file system and Global function system, that is, SLC area and the regions TLC, and the data of file system are no longer distributed in each piece, they can be limited It is scheduled in fixed piece of region.These blocks are the blocks in SLC area, and reliability and performance are greatly improved.
As shown in fig. 6, entire flash memory system is divided into SLC area and the regions TLC, this division is the division of physics, example Such as:The block of number 0-149 forms SLC area, and other pieces form the regions TLC, then in the life cycle of flash-memory storage system, The property of these blocks will not change (unless carrying out capacity change with Customization Tool) again, and the block of SLC can be the block of SLC always, The block of TLC always also is the block of TLC, wherein the regions TLC are completely used for storage user data, and SLC area stores number of users According to (including file system data and non-file system data) and FTL internal management datas.SLC area be divided into SLC Cache and Other (corresponding to user data and FTL internal management datas respectively).
Preferably, above-mentioned device further includes recovery unit 3.
Recovery unit 3, for booting up recovery to flash-memory storage system.
Specifically, above-mentioned recovery unit 3 includes powering on processing module 31 and initialization module 32.
Processing module 31 is powered on, for being powered on to flash-memory storage system, and completes the initialization of infrastructure component.Specifically Include the initialization of the infrastructure components such as drive load, memory management.
Initialization module 32, for the data in initialization files system storage.It includes that snapshot data obtains submodule It is extensive that block 321, damage judging submodule 322, snapshot restore the scanning recovery scanning of submodule 324 and second of submodule 323, first Multiple submodule 325.
Snapshot data acquisition submodule 321, for obtaining the file system after file system data and snapshot before snapshot Data.
Judging submodule 322 is damaged, for judging whether snapshot damages.
Snapshot restores submodule 323, is used for if it is not, then carrying out snapshot recovery, acquisition to the file system data before snapshot The mapping relations of file system data before snapshot.
First scanning restores submodule 324, for if so, being scanned to the file system data before snapshot, acquisition The mapping relations of file system data before snapshot.
Second scanning restores submodule 325, for being scanned to the file system data after snapshot, after obtaining snapshot The mapping relations of file system data.
For the data in fast quick-recovery after the power is turned on flash-memory storage system, flash-memory storage system can periodically preserve snapshot (such as one day or a hour etc.), as a result, system data can be divided into before snapshot data after data and snapshot, before snapshot The mapping relations of file system data can be recovered by snapshot, so the time overhead of this part is substantially snapshot The time loss of loading, and the mapping relations of file system data then need scan data to restore after snapshot, this part-time Expense is bigger, but due to the presence of snapshot, its window size is within controlled range, and such as control is in 2 to 3 SLC Within block (specifically related to the strategy of snapshot) so that whole to spend time very little (when the booting relative to application system restores Between), be above there is the case where complete snapshot, once but snapshot damage or lose, the data before snapshot and after snapshot Scan data is required for restore, this workload is huge, under original framework, it may be necessary to scan 3000 or so blocks (being mostly TLC blocks), it is assumed that the scanning of average each block needs 300 milliseconds, then entire scanning process just needs cost 2 Minute or more time, in fact, this time overhead can bigger because in this recovery process, in addition to scan data it Outside, also many other operation, such as the loading and preservation of algorithm management data, lookup and update of mapping relations etc., at this In the case of kind, flash-memory storage system is divided into two regions by the present embodiment, and two regions store different according to memory module Data, the SLC block number for limiting save file system data is much smaller, such as 100 or so, simultaneously as can ensure file In the mapping relations memory-resident of system data, the time overheads such as loading and the preservation of algorithm management data are not had.It is all excellent Chemical industry work combines, and the block (i.e. the block without idle capacity) of full data average sweep time is in Millisecond in 100 SLC blocks Not;And block (only a few, such as 1-2) average sweep time of available free capacity in hundred milliseconds of ranks, entire file system Sweep time, if it is considered that the efficiency executed parallel, sweep time can be shorter in hundred milliseconds of ranks.
File system data in file system memory can have been stored in file system memory rather than file system System data can move the regions TLC, when file system memory memory has been expired, as shown in the user data GC in Fig. 6, When data are written in any user, data first pass through file system memory, when the memory capacity of file system memory has expired When, the data (data in namely non-file system memory) of non-file system can be moved to the regions TLC, in this way, when being When writing area has little time to refresh in system powered-off fault or flash memory system, the user data in flash media will not be by shadow It rings, SLC block does not have the wordline of Share Page and the TLC blocks of MLC Nand-Flash flash memories to limit, Share Page is a proprietary word of MLC Nand-Flash flash memories, describes the relationship between a block internal page and page, When the state an of page another page of extreme influence in a program, the two pages be referred to as Share Page (low page and upper page);Wordline is a proprietary word of TLC Nand-Flash flash memories, is described inside a Block Relationship between three Pages, property are similar with Share Page.
As shown in figure 5, for this method, it is related to the state transition step of flash-memory storage system, mainly from being System no initializtion state, enters file system state, finally enters write-protect state;For flash-memory storage system state and Speech comprising eight states, respectively:After the completion of system no initializtion state, file system state, entire flash memory system restore State, write-protect state, electrification standby mode, Low-power-consumptiodormancy dormancy state and the idle state of entrance;For this eight states For, wherein it is any will not to respond host for system no initializtion state i.e. unknown (or no initializtion) state of system It asks (except IP is automatically replied);File system state is that the recovery of file system is completed, can be with response file system number According to read-write, the inquiry of flash memory system state, and the other custom commands of response can regard a micro-system as;It is entire to dodge It is the state that a global function opens that deposit system, which restores the state that enters after the completion, including in the response of host read write command, FTL Portion's management role, such as GC, WL;For write-protect state, when flash-memory storage system receives host specific command (Lock) And a kind of special state entered, in this state, demand of the system based on data protection only responds host read request, such as Fruit system enters life cycle latter stage, with the increase of bad block number, when regional space is not enough to support active user's capacity, also can Into write-protect state;For idle state, when long-time is without host request, flash-memory storage system can enter Idle shapes State.Under Idle states, system can do some rollback tasks.
In the flash-memory storage system state transition the step of, file system memory is isolated, increases the file system step Suddenly play the role of as follows:After file system recovery success, so that it may to be interacted with host, including status inquiry, debugging Deng first, substantially reducing the time (the especially situation of snapshot exception) of response host the first stroke request;Second, due to depositing The variation for storing up region characteristic, enhances the reliability of significant data;Third, the presence of file system memory, for abnormal feelings System important information is obtained under condition and debugging brings great convenience;Fourth, when the abnormal restoring for whole system has been won Between.
The data of file system are stripped out from other user data, from totally in construct a file system this The subsystem of sample.After being achieved, the recovery and read-write of file system data will be completely independent:Start process is shorter, is being switched on In the process, host can only access the data of file system, and file system only accounts for overall very small ratio, such as a 128G Video TF card, its file system may only have 20MB or so, i.e., only account for overall 1:6553.5, that is to say, that restore file system Data of uniting when abnormal, handle than restoring overall fast many times and restore more efficient and flexible, when mapping table is abnormal Or when damage, in start process, whole disk data need not be scanned, after the completion of file system reconstruction, then carry out the weight of whole disk It builds.Because after the completion of file system recovery, can respond the access of host, such host can obtain the current shape of flash memory system State determines subsequent operation again according to different states, and if system is abnormal, host can wait for flash memory system with continued power Overall mapping reconstruction is completed;Write-protect state is such as entered, then can only carry out read access operation.
, can be by dynamic regulation for the capacity of above-mentioned file system data memory in other embodiment, foundation is deposited The size for storing up data carries out dynamic regulation, and particular by several blocks are set, according to its coding settings, it stores the mould of data The type of formula and storage data.
In other embodiment, for it is above-mentioned move unit 6 for, the data in non-file system memory are transferred to The step of regions TLC, after the data backup in non-file system memory, will specifically be temporarily stored into and postpone area or high in the clouds, standby Part and it is temporary after, then the data in non-file system memory are deleted, then from area or high in the clouds downloading data is postponed to the areas TLC In domain, alternatively, can also be by the way of write-in, be written to the regions TLC after the mark of the data in area or high in the clouds will be postponed Interior, certainly, the data of this process can pass through file system memory, then need the state of file system memory being switched to band Electric standby mode, that is, new data is no longer received, the data being written at this time can be then directly entered in the regions TLC, to reach fast The purpose of speed transfer data.
For the flash-memory storage system of above-mentioned tape file system, by by flash-memory storage system be divided into SLC area and The regions TLC, then physical division is carried out to SLC area, fixed piece of the inside is stored in file system data, when storage file system The memory of system data is moved non-file system data to the regions TLC when not having content, and the new of capacity storage write-in is vacateed User data, including file system data and non-file system data, during booting restores data, it is only necessary to restore text Block where part system restores without overall surface sweeping, reduces the recovery time of file system data, when file system initialization is extensive After multiple, you can the access of host side is responded, so that the access response rate of host side is fast.
It is above-mentioned only with embodiment come the technology contents that further illustrate the present invention, in order to which reader is easier to understand, but not It represents embodiments of the present invention and is only limitted to this, any technology done according to the present invention extends or recreation, by the present invention's Protection.Protection scope of the present invention is subject to claims.

Claims (10)

1. the flash memory storage method of tape file system, which is characterized in that the method includes:
Flash memory is divided into SLC area and the regions TLC;
SLC area is divided into file system memory and non-file system memory;
Obtain the file system data of write-in;
Judge that file system memory whether there is memory capacity;
If it is not, the data in non-file system memory are then transferred to the regions TLC, and enter next step, if so, into Next step;
The file system data of write-in is stored in file system memory.
2. the flash memory storage method of tape file system according to claim 1, which is characterized in that obtain the file system of write-in Before the step of data of uniting, further include:
Recovery is booted up to flash-memory storage system.
3. the flash memory storage method of tape file system according to claim 2, which is characterized in that flash-memory storage system into The step of row booting restores, including step in detail below:
Flash-memory storage system is powered on, and completes the initialization of infrastructure component;
Data in initialization files system storage.
4. the flash memory storage method of tape file system according to any one of claims 1 to 3, which is characterized in that initialization The step of data in file system memory, including step in detail below:
Obtain the file system data after the file system data and snapshot before snapshot;
Judge whether snapshot damages;
If it is not, then carrying out snapshot recovery to the file system data before snapshot, the mapping of the file system data before snapshot is obtained Relationship;
If so, being scanned to the file system data before snapshot, the mapping relations of the file system data before snapshot are obtained;
File system data after snapshot is scanned, the mapping relations of the file system data after snapshot are obtained.
5. the flash memory storage method of tape file system according to claim 1, which is characterized in that store non-file system Data in device were transferred to before the step of regions TLC, further included:
Set flash-memory storage system to write-protect state.
6. the flash memory device of tape file system, which is characterized in that divided including system realm division unit, SLC area single Member, capacity judging unit, moves unit and storage unit at data capture unit;
The system realm division unit, for flash memory to be divided into SLC area and the regions TLC;
The SLC area division unit, for SLC area to be divided into file system memory and the storage of non-file system Device;
The data capture unit, the file system data for obtaining write-in;
The capacity judging unit, for judging that file system memory whether there is memory capacity;
It is described to move unit, for if it is not, the data in non-file system memory are then transferred to SLC area;
The storage unit, for the file system data of write-in to be stored in file system memory.
7. the flash memory device of tape file system according to claim 6, which is characterized in that described device further includes extensive Multiple unit;
The recovery unit, for booting up recovery to flash-memory storage system.
8. the flash memory device of tape file system according to claim 7, which is characterized in that the recovery unit includes Power on processing module and initialization module;
It is described to power on processing module, for being powered on to flash-memory storage system, and complete the initialization of infrastructure component;
The initialization module, for the data in initialization files system storage.
9. the flash memory device of tape file system according to claim 8, which is characterized in that the initialization module packet It includes snapshot data acquisition submodule, damage judging submodule, snapshot and restores submodule, the first scanning recovery submodule and second Scanning restores submodule;
The snapshot data acquisition submodule, for obtaining the file system number after file system data and snapshot before snapshot According to;
The damage judging submodule, for judging whether snapshot damages;
The snapshot restores submodule, is used for if it is not, then carrying out snapshot recovery, acquisition snapshot to the file system data before snapshot The mapping relations of preceding file system data;
First scanning restores submodule, for if so, being scanned to the file system data before snapshot, acquisition snapshot The mapping relations of preceding file system data;
Second scanning restores submodule, for being scanned to the file system data after snapshot, obtains the text after snapshot The mapping relations of part system data.
10. the flash memory device of tape file system according to claim 6, which is characterized in that the system also includes State set unit;
The state set unit, for setting flash-memory storage system to write-protect state.
CN201810480660.2A 2018-05-18 2018-05-18 The flash memory storage method and device of tape file system Pending CN108804344A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810480660.2A CN108804344A (en) 2018-05-18 2018-05-18 The flash memory storage method and device of tape file system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810480660.2A CN108804344A (en) 2018-05-18 2018-05-18 The flash memory storage method and device of tape file system

Publications (1)

Publication Number Publication Date
CN108804344A true CN108804344A (en) 2018-11-13

Family

ID=64091130

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810480660.2A Pending CN108804344A (en) 2018-05-18 2018-05-18 The flash memory storage method and device of tape file system

Country Status (1)

Country Link
CN (1) CN108804344A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109947374A (en) * 2019-04-01 2019-06-28 江苏华存电子科技有限公司 The redundancy redundant guard method of write error in a kind of flash memory main control module
CN110825714A (en) * 2019-11-08 2020-02-21 珠海奔图电子有限公司 File storage control method and device, file storage device and electronic device
CN111324281A (en) * 2018-12-14 2020-06-23 北京兆易创新科技股份有限公司 Memory and control method and device thereof
CN111506262A (en) * 2020-03-25 2020-08-07 华为技术有限公司 Storage system, file storage and reading method and terminal equipment
CN112684987A (en) * 2021-01-07 2021-04-20 南方电网数字电网研究院有限公司 Data classification storage method and device based on double-core intelligent electric meter
CN113031868A (en) * 2021-03-24 2021-06-25 联想(北京)有限公司 Control method and device of memory
CN116467037A (en) * 2023-06-09 2023-07-21 成都融见软件科技有限公司 Graphic user interface work state recovery method

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101872326A (en) * 2010-06-24 2010-10-27 济南大学 Data storage management method for OTP flash memory under embedded environment
CN102591807A (en) * 2011-12-30 2012-07-18 记忆科技(深圳)有限公司 Processing method for power down and abnormal writing of solid state disc and system
CN107357534A (en) * 2017-07-18 2017-11-17 深圳市德名利电子有限公司 A kind of dynamic switching method and system of flash block pattern

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101872326A (en) * 2010-06-24 2010-10-27 济南大学 Data storage management method for OTP flash memory under embedded environment
CN102591807A (en) * 2011-12-30 2012-07-18 记忆科技(深圳)有限公司 Processing method for power down and abnormal writing of solid state disc and system
CN107357534A (en) * 2017-07-18 2017-11-17 深圳市德名利电子有限公司 A kind of dynamic switching method and system of flash block pattern

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111324281A (en) * 2018-12-14 2020-06-23 北京兆易创新科技股份有限公司 Memory and control method and device thereof
CN111324281B (en) * 2018-12-14 2024-02-06 兆易创新科技集团股份有限公司 Memory and control method and device thereof
CN109947374A (en) * 2019-04-01 2019-06-28 江苏华存电子科技有限公司 The redundancy redundant guard method of write error in a kind of flash memory main control module
CN109947374B (en) * 2019-04-01 2022-07-22 江苏华存电子科技有限公司 Redundancy backup protection method for write errors in flash memory master control module
CN110825714A (en) * 2019-11-08 2020-02-21 珠海奔图电子有限公司 File storage control method and device, file storage device and electronic device
CN111506262A (en) * 2020-03-25 2020-08-07 华为技术有限公司 Storage system, file storage and reading method and terminal equipment
CN112684987A (en) * 2021-01-07 2021-04-20 南方电网数字电网研究院有限公司 Data classification storage method and device based on double-core intelligent electric meter
CN113031868A (en) * 2021-03-24 2021-06-25 联想(北京)有限公司 Control method and device of memory
CN116467037A (en) * 2023-06-09 2023-07-21 成都融见软件科技有限公司 Graphic user interface work state recovery method
CN116467037B (en) * 2023-06-09 2023-09-22 成都融见软件科技有限公司 Graphic user interface work state recovery method

Similar Documents

Publication Publication Date Title
CN108804344A (en) The flash memory storage method and device of tape file system
CN102043727B (en) Method and device for recovering solid-state hard disc mapping table
CN103530237B (en) A kind of rubbish recovering method of Solid-state disc array
CN104461964B (en) A kind of storage device
CN107632939A (en) Mapping table for storage device
CN106066890B (en) Distributed high-performance database all-in-one machine system
CN105122218A (en) Memory systems and methods including training,data organizing,and/or shadowing
CN104969168A (en) Persistent storage device with NVRAM for staging writes
CN102722339A (en) Power-safe data management system
CN104572478A (en) Data access method and data access device
CN101963891A (en) Method and device for data storage and processing, solid-state drive system and data processing system
CN107329696A (en) A kind of method and system for ensureing data corruption uniformity
CN103544110A (en) Block-level continuous data protection method based on solid-state disc
CN104620230A (en) Method of managing memory
CN104050088A (en) DIFFERENCE L2P METHOD and system
CN104615381B (en) A kind of redundant arrays of inexpensive disks of video monitoring system
CN107908571A (en) A kind of method for writing data, flash memory device and storage device
CN104778018A (en) Broad-strip disk array based on asymmetric hybrid type disk image and storage method of broad-strip disk array
CN105608016B (en) Solid state hard disk of the DRAM in conjunction with MRAM and the storage card using MRAM
CN104166601A (en) Storage data backup method and device
CN109240939A (en) A kind of method of quick processing solid state hard disk TRIM
CN108062201A (en) For the self-virtualizing flash memory of solid state drive
CN105607862A (en) Solid state disk capable of combining DRAM (Dynamic Random Access Memory) with MRAM (Magnetic Random Access Memory) and being provided with backup power
CN104391802A (en) Simplified pool metadata node refreshing consistency protection method
CN105335220A (en) Transaction recovery method and apparatus for storage device

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

Application publication date: 20181113

RJ01 Rejection of invention patent application after publication