CN109271100A - A kind of flash storage date storage method and read method - Google Patents
A kind of flash storage date storage method and read method Download PDFInfo
- Publication number
- CN109271100A CN109271100A CN201810984917.8A CN201810984917A CN109271100A CN 109271100 A CN109271100 A CN 109271100A CN 201810984917 A CN201810984917 A CN 201810984917A CN 109271100 A CN109271100 A CN 109271100A
- Authority
- CN
- China
- Prior art keywords
- data
- flash storage
- catalogue
- storage
- area
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0668—Interfaces specially adapted for storage systems adopting a particular infrastructure
- G06F3/0671—In-line storage system
- G06F3/0673—Single storage device
- G06F3/0679—Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
- G06F3/0614—Improving the reliability of storage systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0629—Configuration or reconfiguration of storage systems
- G06F3/0632—Configuration or reconfiguration of storage systems by initialisation or re-initialisation of storage systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0638—Organizing or formatting or addressing of data
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Techniques For Improving Reliability Of Storages (AREA)
Abstract
The invention discloses a kind of flash storage date storage method and read methods, it is related to technical field of data storage, by the way that flash storage memory space is initialized, flash storage memory space is separated into gauge outfit area, directory area and data field, and the data address stored every time is backed up in gauge outfit area, it can be applied to flash storage circulation in the prior art to read, write the mode of data, it realizes while the uniform read-write to each sector, it prevents under unexpected power-down conditions, the insecure problem of data caused by the end of data storage address of catalogue is imperfect, the reliability of read-write data is ensured, and then it realizes under the premise of ensureing flash storage service life, ensure the reliable access of data.Storage catalogue creation time, the time interval that data are written, data frame length make the information more horn of plenty for saving data in catalogue simultaneously, more can flexibly be used by other programs.
Description
Technical field
The present invention relates to technical field of data storage, especially a kind of flash storage date storage method and reading side
Method.
Background technique
In existing flash storage circulation read-write application, after system is powered down, data address is easy to be lost to be asked
Topic.Meanwhile in Flash memory technology, there is also the periods of data storage to be fixed, and the timing node of data storage can not be looked into
The problem of inquiry, therefore, it is necessary to invent a kind of flash storage date storage method to solve the above problems.
Summary of the invention
The present invention is directed to solve at least some of the technical problems in related technologies.For this purpose, of the invention
One purpose is to provide the flash storage data storage of a kind of raising flash storage physical life and data not easy to lose
Method and read method.
The technical scheme adopted by the invention is that:
A kind of flash storage date storage method, includes the following steps:
S1 initializes flash storage;
The initialization includes: that flash storage data space is divided into gauge outfit area, directory area and data field;
The gauge outfit area includes: gauge outfit mark and data address backup area, and the gauge outfit mark is for identifying the Flash
Whether memory, which is completed, initializes, and the data address backup area is used to record the storage address of preset data;
The catalogue of the directory area for storing data;
The data field, for storing data.
Further, the catalogue includes directory creating time, time interval, data frame length, the data that data are written
The initial address of section storage and end address.
It further, further include step S0 before the step initializes flash storage, described in judgement
Whether flash storage is initialized, if so, executing step S3, writes data into flash storage;If it is not, executing step
Rapid S1, initializes flash storage.
Further, the step S3, writes data into flash storage, specifically includes:
S30, judges whether data need to be stored in the catalogue recorded data area created, if so, executing step
Rapid S32;If it is not, executing step S31;
S31 creates catalogue;
S32 stores data in the corresponding data field of catalogue for described;
S33, the data address backup area by the storage address of data in gauge outfit back up;
S34, judges whether storing data terminates, if so, entering step S35;If it is not, re-executeing the steps S32;
End address is written in directory area in S35.
It further, further include step S2 before the step S3 writes data into flash storage, verifying directory area is last
The end address of the catalogue of one generation whether there is, if so, executing step S3;If it is not, executing step S20;
S20 is held in the end address of the data address write-in catalogue of the storage of data address backup area described in gauge outfit area
Row S3.
Further, the data address backup area, the directory area and the data field include multiple sectors, the number
After being write completely according to address backup area, the directory area and the data field memory space, the sector that erasing is used earliest, and will
Data are recorded in the sector.
Further, after the step S35 and step S20 further include: back up catalogue in RAM.
The invention also provides a kind of flash storage method for reading data, comprising steps of
Step1 searches the address of data to be read in directory area;
Step3 reads data according to catalogue within a data area.
Further, further include step Step5, the directory creating time is read from catalogue.
10. a kind of flash storage date storage method characterized by comprising
At least one processor;And
The memory being connect at least one described processor communication;Wherein,
The memory is stored with the instruction that can be executed by least one described processor, and described instruction is by described at least one
A processor executes, so that at least one described processor is able to carry out method as described in any one of claim 1 to 9.
The beneficial effects of the present invention are:
Flash storage memory space is separated by the present invention by initializing flash storage memory space
Gauge outfit area, directory area and data field, and the data address stored every time is backed up in gauge outfit area, it can be applied in the prior art
Flash storage recycles the mode of reading and writing data, realizes while the uniform read-write to each sector, prevents from surprisingly falling
In electric situation, the insecure problem of data caused by the end of data storage address of catalogue is imperfect has ensured read-write data
Reliability, and then realize under the premise of ensureing flash storage service life, ensure the reliable access of data.
Storage catalogue creation time, the time interval that data are written, data frame length to save number in catalogue simultaneously
According to information more horn of plenty, more can flexibly be used by other programs.
Detailed description of the invention
Fig. 1 is a kind of flow chart of one specific embodiment of flash storage date storage method in the present invention;
Fig. 2 is a kind of flow chart of flash storage date storage method still another embodiment in the present invention;
Fig. 3 is a kind of flow chart of flash storage date storage method still another embodiment in the present invention;
Fig. 4 is a kind of flow chart of one specific embodiment of flash storage method for reading data in the present invention.
Specific embodiment
It should be noted that in the absence of conflict, the features in the embodiments and the embodiments of the present application can phase
Mutually combination.
As shown in Figure 1, Fig. 1 shows a kind of specific embodiment of flash storage date storage method of the present invention, including
Following steps:
S1 initializes flash storage;
The initialization includes: that flash storage data space is divided into gauge outfit area, directory area and data field;
The gauge outfit area includes: gauge outfit mark and data address backup area, and the gauge outfit mark is for identifying the Flash
Whether memory, which is completed, initializes, and the data address backup area is used to record the storage address of preset data;
The catalogue of the directory area for storing data;
The data field, for storing data.
By the way that flash storage memory space is separated into gauge outfit area, directory area and data field, according to the characteristics of data pairs
The size of directory area, data field and gauge outfit area carries out classifying rationally, so that it is relatively uniform to the access of each sector, it can effectively mention
The physical life of high data, while the address of data being backed up in gauge outfit area, it can prevent data caused by accident power-off from losing
It loses.
Catalogue include the directory creating time, be written the time intervals of data, data frame length, data segment storage starting point
Location and end address.
There is no the timing node information of storing data storage, data type in previous flash storage storage scheme
Deng, the format once the data content after can not be changed, by catalogue distinguish storage catalogue creation time, write-in data
The information such as time interval, data frame length, data can be divided into small data module position as unit of catalogue and stored respectively,
In the operation such as reading data, deletion, data can be operated as unit of catalogue, more flexibly.
As shown in Fig. 2, Fig. 2 shows a kind of another specific implementations of flash storage date storage method of the invention
Example.
Further include step S0 before the step initializes flash storage, judges that the flash storage is
It is no to be initialized, if so, executing step S3, write data into flash storage;If it is not, step S1 is executed, to Flash
Memory is initialized.It can judge whether flash storage is completed to initialize by reading the gauge outfit mark in gauge outfit area.
As shown in figure 3, Fig. 3 shows a kind of method for reading data of flash storage date storage method of the present invention
A kind of specific embodiment.
S30, judges whether data need to be stored in the catalogue recorded data area created, if so, executing step
Rapid S32;If it is not, executing step S31;
S31 creates catalogue;
S32 stores data in the corresponding data field of catalogue for described;
S33, the data address backup area by the storage address of data in gauge outfit back up;
S34, judges whether storing data terminates, if so, entering step S35;If it is not, re-executeing the steps S32;
End address is written in directory area in S35.
In another embodiment, further include step S2 before the step S3 writes data into flash storage, verify mesh
The end address of the last one catalogue generated of record area whether there is, if so, executing step S3;If it is not, executing step S20;
Generating catalogue by the last one in verifying catalogue whether there is, when can determine whether last storage whether generating system
Emergency cases, the specific methods such as power-off are, if the data of end address field are 0xFFFFFFFF, represent upload storage and have occurred
Situations such as power down, the end data of storage catalogue, the end address of catalogue are not present, the improper closing of catalogue.If catalogue
End address it is effective, i.e. the non-zero xFFFFFFFF of the content of the storage address of catalogue, representative has stored data segment and terminates ground
Location, catalogue are complete
S20 is held in the end address of the data address write-in catalogue of the storage of data address backup area described in gauge outfit area
Row S3.
The last one valid data that data backup address is searched in the data address backup region of gauge outfit, by the data
It is deposited into the end address of catalogue, the prior arts such as dichotomy, fast row's method can be used in lookup method, do not do and have in the present embodiment
Body limitation.
It, may be without the end address of record catalogue, with will lead to catalogue in catalogue in the case where system power down suddenly
Location is unreliable, and the present invention backs up the data address that the storage address of data is recorded in gauge outfit when data store every time
Therefore Qu Zhong when storing each data, is in advance backed up the address of each data, can be under power-down conditions
The data finally stored are found out from data address backup area, improve the safety of data, are effectively avoided because system is powered down
Caused by catalogue it is imperfect, lead to the insecure technical problem of the data recorded in this catalogue.
Further, the data address backup area, the directory area and the data field include multiple sectors, each fan
The size in area is 4096 bytes, after the data address backup area, the directory area and the data field memory space are write completely,
The sector that erasing is used earliest, and record data in the sector.
Datacycle storage, can be improved the service life of flash storage.
In another embodiment, after the step S35 and step S20 further include: back up catalogue in RAM
(not shown).After directory address is backed up, in step s 30, directly it can search and judge from the catalogue backup in RAM
Whether data, which need, is stored in the catalogue created, the speed of service of the system of raising.
As shown in figure 4, Fig. 4 shows a kind of specific embodiment of flash storage method for reading data of the present invention, including
Step:
Step1 searches the address of data to be read in directory area;
Step3 reads data according to catalogue within a data area.
Step5 reads the directory creating time from catalogue.
It, can also be automatic using the flash storage of this method even if power down has occurred before system when reading data
Restore the data stored before power down.
In addition can also read out the directory creating time is the time that data are written, the time interval that data are written, data frame
The information such as length more can flexibly be used so that saving the information more horn of plenty of data by other programs.
The invention also provides a kind of flash storage date storage methods, comprising:
At least one processor;And
The memory being connect at least one described processor communication;Wherein,
The memory is stored with the instruction that can be executed by least one described processor, and described instruction is by described at least one
A processor executes, so that at least one described processor is able to carry out above-mentioned data storage and data query method.
The invention also provides a kind of computer readable storage medium, the computer-readable recording medium storage has calculating
Machine executable instruction, the computer executable instructions are used to that computer to be made to execute above-mentioned data storage and data query side
Method.
It is to be illustrated to preferable implementation of the invention, but the invention is not limited to the implementation above
Example, those skilled in the art can also make various equivalent variations on the premise of without prejudice to spirit of the invention or replace
It changes, these equivalent deformations or replacement are all included in the scope defined by the claims of the present application.
Claims (10)
1. a kind of flash storage date storage method, which comprises the steps of:
S1 initializes flash storage;
The initialization includes: that flash storage data space is divided into gauge outfit area, directory area and data field;
The gauge outfit area includes: gauge outfit mark and data address backup area, and the gauge outfit mark is for identifying the Flash storage
Whether device, which is completed, initializes, and the data address backup area is used to record the storage address of preset data;
The catalogue of the directory area for storing data;
The data field, for storing data.
2. a kind of flash storage date storage method according to claim 1, which is characterized in that the catalogue includes
Directory creating time, the time interval that data are written, data frame length, the initial address of data segment storage and end address.
3. a kind of flash storage date storage method according to claim 1, which is characterized in that in the step S1
Further include step S0 before being initialized to flash storage, judges whether the flash storage is initialized, if
It is to execute step S3 to write data into flash storage;If it is not, executing step S1, flash storage is initialized.
4. a kind of flash storage date storage method according to claim 3, which is characterized in that the step S3, it will
Flash storage is written in data, specifically includes:
S30, judges whether data need to be stored in the catalogue recorded data area created, if so, executing step
S32;If it is not, executing step S31;
S31 creates catalogue;
S32 stores data in the corresponding data field of catalogue for described;
S33, the data address backup area by the storage address of data in gauge outfit back up;
S34, judges whether storing data terminates, if so, entering step S35;If it is not, re-executeing the steps S32;
End address is written in directory area in S35.
5. a kind of flash storage date storage method according to claim 4, which is characterized in that the step S3 will
Data further include step S2 before flash storage is written, and whether the end address of the last one catalogue generated of verifying directory area
In the presence of if so, executing step S3;If it is not, executing step S20;
S20 is executed in the end address of the data address write-in catalogue of the storage of data address backup area described in gauge outfit area
S3。
6. a kind of flash storage date storage method according to any one of claims 1 to 5, which is characterized in that described
Data address backup area, the directory area and the data field include multiple sectors, the data address backup area, the catalogue
After area and the data field memory space are write completely, the sector that erasing is used earliest, and record data in the sector.
7. a kind of flash storage date storage method according to claim 5, which is characterized in that the step S35 and
After the step S20 further include: back up catalogue in RAM.
8. a kind of flash storage method for reading data is applied to a kind of corresponding Flash storage of any one of claim 1 to 7
Device date storage method, which is characterized in that comprising steps of
Step1 searches the address of data to be read in directory area;
Step3 reads data according to catalogue within a data area.
9. a kind of flash storage method for reading data according to claim 8, which is characterized in that further include step
Step5 reads the directory creating time from catalogue and/or the time interval and/or data frame length of data is written.
10. a kind of flash storage date storage method characterized by comprising
At least one processor;And
The memory being connect at least one described processor communication;Wherein,
The memory is stored with the instruction that can be executed by least one described processor, and described instruction is by described at least one
It manages device to execute, so that at least one described processor is able to carry out method as described in any one of claim 1 to 9.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810984917.8A CN109271100A (en) | 2018-08-28 | 2018-08-28 | A kind of flash storage date storage method and read method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810984917.8A CN109271100A (en) | 2018-08-28 | 2018-08-28 | A kind of flash storage date storage method and read method |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109271100A true CN109271100A (en) | 2019-01-25 |
Family
ID=65154636
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810984917.8A Pending CN109271100A (en) | 2018-08-28 | 2018-08-28 | A kind of flash storage date storage method and read method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109271100A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112947862A (en) * | 2021-03-10 | 2021-06-11 | 歌尔科技有限公司 | Device, Flash memory and data storage method thereof |
CN113094369A (en) * | 2021-04-13 | 2021-07-09 | 深圳市魔样科技有限公司 | Flash memory data management method |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102053796A (en) * | 2009-11-10 | 2011-05-11 | 群联电子股份有限公司 | Flash memory storage system, flash memory controller and data processing method |
CN105260270A (en) * | 2015-11-11 | 2016-01-20 | 恒宝股份有限公司 | Flash storage space dynamic recovery method and device |
CN105589767A (en) * | 2015-12-21 | 2016-05-18 | 北京时代民芯科技有限公司 | System power failure protection realizing method for NAND FLASH |
CN106959906A (en) * | 2017-03-28 | 2017-07-18 | 联想(北京)有限公司 | Information processing method, information processor and electronic equipment |
US20170322728A1 (en) * | 2016-05-03 | 2017-11-09 | SK Hynix Inc. | Grouped trim bitmap |
CN107818269A (en) * | 2017-11-27 | 2018-03-20 | 杭州中天微系统有限公司 | A kind of file saving method and system based on Flash |
-
2018
- 2018-08-28 CN CN201810984917.8A patent/CN109271100A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102053796A (en) * | 2009-11-10 | 2011-05-11 | 群联电子股份有限公司 | Flash memory storage system, flash memory controller and data processing method |
CN105260270A (en) * | 2015-11-11 | 2016-01-20 | 恒宝股份有限公司 | Flash storage space dynamic recovery method and device |
CN105589767A (en) * | 2015-12-21 | 2016-05-18 | 北京时代民芯科技有限公司 | System power failure protection realizing method for NAND FLASH |
US20170322728A1 (en) * | 2016-05-03 | 2017-11-09 | SK Hynix Inc. | Grouped trim bitmap |
CN106959906A (en) * | 2017-03-28 | 2017-07-18 | 联想(北京)有限公司 | Information processing method, information processor and electronic equipment |
CN107818269A (en) * | 2017-11-27 | 2018-03-20 | 杭州中天微系统有限公司 | A kind of file saving method and system based on Flash |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112947862A (en) * | 2021-03-10 | 2021-06-11 | 歌尔科技有限公司 | Device, Flash memory and data storage method thereof |
CN112947862B (en) * | 2021-03-10 | 2022-09-20 | 歌尔科技有限公司 | Device, Flash memory and data storage method thereof |
CN113094369A (en) * | 2021-04-13 | 2021-07-09 | 深圳市魔样科技有限公司 | Flash memory data management method |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10061655B2 (en) | Volatile cache reconstruction after power failure | |
CN102779180B (en) | The operation processing method of data-storage system, data-storage system | |
CN111752487B (en) | Data recovery method and device and solid state disk | |
US8694984B2 (en) | Memory apparatus and method of updating firmware of the memory apparatus | |
JP6112595B2 (en) | Erase management in memory systems | |
CN103049349B (en) | Based on Snapshot Method and the system of Bedding storage | |
CN103577121A (en) | High-reliability linear file access method based on nand flash | |
CN112631950B (en) | L2P table saving method, system, device and medium | |
CN103226965B (en) | Based on the audio/video data access method of time bitmap | |
CN106294007B (en) | Data recovery method and device | |
CN108959589B (en) | STT-MRAM-based method for accelerating log file saving and recovery of solid-state memory device | |
WO2023116346A1 (en) | Method and system for recovering trim data under abnormal power failure, and solid-state drive | |
US20130013885A1 (en) | Memory storage device, memory controller, and method for identifying valid data | |
JP5956971B2 (en) | WORM cartridge support realized by LTFS (LinearTapeFileSystem) | |
CN109271100A (en) | A kind of flash storage date storage method and read method | |
US8938641B2 (en) | Method and apparatus for synchronizing storage volumes | |
CN107037988B (en) | A kind of flash memory safety deleting method and system based on file-level granularity | |
CN104794066A (en) | Storage apparatus and method for selecting storage area where data is written | |
CN110262980B (en) | High-speed storage system based on limited-life storage medium | |
KR20090094594A (en) | Information storage medium recording data according to journaling file system, method and apparatus of writing/recovering data using journaling file system | |
CN110308861B (en) | Storage data storage method, device, electronic equipment and readable storage medium | |
CN113535086B (en) | Acceleration method for reconstruction in solid state disk | |
CN112817520B (en) | Data disk refreshing method and device | |
CN109521961B (en) | Method and system for improving read-write performance of solid state disk | |
CN107273051B (en) | The reading/writing method and device of I/O data |
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 | ||
AD01 | Patent right deemed abandoned |
Effective date of abandoning: 20220311 |
|
AD01 | Patent right deemed abandoned |