CN103092727B - Data error-correcting method in flash storage medium and device - Google Patents

Data error-correcting method in flash storage medium and device Download PDF

Info

Publication number
CN103092727B
CN103092727B CN201310019990.9A CN201310019990A CN103092727B CN 103092727 B CN103092727 B CN 103092727B CN 201310019990 A CN201310019990 A CN 201310019990A CN 103092727 B CN103092727 B CN 103092727B
Authority
CN
China
Prior art keywords
user data
metadata
host sectors
data
error correction
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
CN201310019990.9A
Other languages
Chinese (zh)
Other versions
CN103092727A (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.)
Datang Mobile Communications Equipment Co Ltd
Original Assignee
Datang Mobile Communications Equipment 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 Datang Mobile Communications Equipment Co Ltd filed Critical Datang Mobile Communications Equipment Co Ltd
Priority to CN201310019990.9A priority Critical patent/CN103092727B/en
Publication of CN103092727A publication Critical patent/CN103092727A/en
Application granted granted Critical
Publication of CN103092727B publication Critical patent/CN103092727B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The embodiment of the invention discloses the data error-correcting method in a kind of flash storage medium and device, relate to field of data storage, accurate for the error correction improving the data in flash storage medium.In the present invention, metadata corresponding for user data is write simultaneously physics host sectors and physical backup sector, when reading user data, the metadata in physics host sectors and physical backup sector being carried out from correction process, uses the metadata obtained from correction process to carry out error correction to user data.Adopt the present invention can improve the error correction accuracy rate of the data in flash storage medium.

Description

Data error-correcting method in flash storage medium and device
Technical field
The present invention relates to field of data storage, particularly relate to the data error-correcting method in a kind of flash storage medium and device.
Background technology
Current Flash chip is widely used in all kinds of embedded device, and general service comprises storing software version, record running log etc.There is certain error probability because the storage medium of Flash chip is long-term, in frequent use procedure, makeing mistakes shows as Flash chip and occurs bit (bit) bit flipping, therefore needs to carry out necessary protection for user demand.
Also there is difference for the data fault tolerance method under different application scene, introduce three kinds of schemes below:
The first, have the application scenarios of high reliability request for storing software version, existing scheme is mostly direct stores two parts of softwares in Flash chip, judge by algorithm flow the software using which version, flow process as shown in Figure 1.After system starts, validity calculating is carried out to the software of version one, judges whether the software of version one can be used, if available according to result of calculation, then load and run the software of version one, otherwise, validity calculating is carried out to the software of version two, judges whether the software of version two can be used according to result of calculation, if available, then load and run the software of version two, otherwise this flow process terminates.
Wherein, the Effective judgement of version software specifically can use cyclic redundancy check (CRC) (Cyclic Redundancy Check, the CRC) method for version software, and this method is pure application layer protection mechanism.
Second, application is stored for simple daily record, because the write of Flash chip, read operation are very frequent, higher to the degree of wear of Flash chip, in order to tackle mistake, Flash chip is generally all divided into several standard-sized physical locations by existing Flash chip driver, common is 512 bytes, this physical location is called physical sector (sector), for physics sector computing error correction (the Error Checking and Correcting storing user data, ECC) code, is kept at ECC code in independent physics sector.User calculates ECC code and is saved in special physics sector when writing data, uses the ECC code preserved to carry out ECC error correction to needing the data read, the data after error correction are returned to user when user reads data.
The flow process of write user data as shown in Figure 2 A, when needs write user data, size according to user data distributes physics sector, size according to physics sector calculates ECC code, user data is written in the physics sector of distribution, and the ECC code calculated is written in special sector.
Read the flow process of user data as shown in Figure 2 B, when needs read user data, user data is read from physics sector, and ECC code is read from special sector, use the ECC code read to carry out ECC error correction to the user data read out, and the user data after error correction is submitted to user.
3rd, for the application scenarios using the complicated sector management algorithms such as file system, file system aspect uses logic sector (logic sector) numbering, bottom layer driving aspect uses physical sector (physics sector) numbering, in order to realize good abrasion equilibrium scheduling algorithm, need to set up index relative, when file system reads the logic sector specified, bottom layer driving software needs by tabling look-up by the physics sector address computation corresponding to logic sector out, thus reading data, need logic sector numbering and the using state of preserving the current correspondence of each physics sector simultaneously, the corresponding relation of logic sector and physics sector is recovered after being convenient to system reboot, logic sector numbering corresponding to physics sector will be preserved, the data of the information such as the ECC code of physics sector state and physics sector are called metadata, and data physics sector needing the user preserved import into are called user data.
As can be seen from Figure 3, each physics sector(1 ~ N for storing user data) there is corresponding metadata (1 ~ N), metadata is for describing the ECC code of the current service condition of the physics sector storing user data, corresponding logic sector numbering and physics sector.Wherein metadata itself also will take physics sector and stores.
In system starting process, by the metadata on scanning physics sector, thus the corresponding relation of physics sector and logic sector can be set up, in use, the relation of logic sector and physics sector can be constantly updated along with the change of data storage location.
Realizing in process of the present invention, inventor finds to there is following technical matters in prior art:
Existing scheme one require User Exploitation software flow participate in select version, opaque to user, ensure data correctness by application layer completely, adding users code complexity, and mistake can only be sentenced can not error correction.
Existing scheme two is identical in metadata part essence with scheme three, just can support sector administrative mechanism more flexibly owing to comprising more multivariate data information in scheme three, but all there is major defect in data security scheme in them: be first there is no mechanism for correcting errors for the metadata of key itself, the serious consequences such as data corruption can be caused after mistake appears in metadata, next is ECC code book body limited error recovery capability, the size of each physics sector is 512 bytes (byte), can only the limited bit number of error correction, error correction ratio is very low.
Summary of the invention
The embodiment of the present invention provides data error-correcting method in a kind of flash storage medium and device, for improving the error correction accuracy rate of the data in flash storage medium.
A data error-correcting method in flash storage medium, described flash storage medium comprises physics host sectors and physical backup sector, a corresponding physical backup sector, each physics host sectors, and the method comprises:
For needing the user data of write to distribute physics host sectors, and determine the metadata that described user data is corresponding, this metadata comprises the data of use when carrying out error correction to described user data; By the physics host sectors that described user data write distributes, the physics host sectors that described metadata write is used for Preservation Metadata is write physical backup sector corresponding to this physics host sectors as the second metadata as the first metadata and using described metadata;
From for reading the first metadata the physics host sectors of Preservation Metadata, from the physical backup sector that this physics host sectors is corresponding, read the second metadata; The first metadata read and the second metadata are carried out from correction process, obtains trinary data; From the physics host sectors of preserving user data, read user data, use trinary data to carry out error correction to the user data read.
Comprise a device for flash storage medium, described flash storage medium comprises physics host sectors and physical backup sector, a corresponding physical backup sector, each physics host sectors, and this device also comprises:
Data write unit, for for needing the user data of write to distribute physics host sectors, and determines the metadata that described user data is corresponding, and this metadata comprises the data of use when carrying out error correction to described user data; By the physics host sectors that described user data write distributes, the physics host sectors that described metadata write is used for Preservation Metadata is write physical backup sector corresponding to this physics host sectors as the second metadata as the first metadata and using described metadata;
Data-reading unit, for from for reading the first metadata in the physics host sectors of Preservation Metadata, reads the second metadata from the physical backup sector that this physics host sectors is corresponding; The first metadata read and the second metadata are carried out from correction process, obtains trinary data; From the physics host sectors of preserving user data, read user data, use trinary data to carry out error correction to the user data read.
In the scheme that the embodiment of the present invention provides, be need the user data of write to distribute physics host sectors, and determine the metadata that this user data is corresponding, this metadata comprises the data of use when carrying out error correction to this user data; By the physics host sectors that the write of this user data distributes, the physics host sectors that the write of this metadata is used for Preservation Metadata is write physical backup sector corresponding to this physics host sectors as the second metadata as the first metadata and using described metadata; From for reading the first metadata the physics host sectors of Preservation Metadata, from the physical backup sector that this physics host sectors is corresponding, read the second metadata; The first metadata read and the second metadata are carried out from correction process, obtains trinary data; From the physics host sectors of preserving user data, read user data, use trinary data to carry out error correction to the user data read.Because metadata also may occur mistake, therefore pass through metadata to write physics host sectors and physical backup sector in this programme simultaneously, when reading user data, metadata in physics host sectors and physical backup sector can be carried out from correction process, to reduce correct metadata as far as possible, re-use the metadata after correction process and error correction is carried out to the user data read, the consequence because metadata error causes user data to be made mistakes can be avoided as far as possible, thus improve the error correction accuracy rate of the data in flash storage medium.
Accompanying drawing explanation
Fig. 1 is data fault-tolerant protocol procedures schematic diagram of the prior art;
Fig. 2 A is data of the prior art write schematic flow sheet;
Fig. 2 B is digital independent schematic flow sheet of the prior art;
Fig. 3 is metadata of the prior art and storage of subscriber data schematic diagram;
The method flow schematic diagram that Fig. 4 provides for the embodiment of the present invention;
Fig. 5 A is the user data write schematic flow sheet in the embodiment of the present invention;
Fig. 5 B is that the user data in the embodiment of the present invention reads schematic flow sheet;
Fig. 5 C is the metadata store schematic diagram in the embodiment of the present invention;
Fig. 5 D is that the metadata in the embodiment of the present invention reads schematic flow sheet;
Fig. 5 E is the wrong schematic flow sheet of data self-picketing in the embodiment of the present invention;
The apparatus structure schematic diagram that Fig. 6 provides for the embodiment of the present invention.
Embodiment
In order to improve the error correction accuracy rate of the data in flash storage medium, the embodiment of the present invention provides the data error-correcting method in a kind of flash storage medium.In this method, metadata corresponding for user data is write simultaneously physics host sectors and physical backup sector, when reading user data, the metadata in physics host sectors and physical backup sector being carried out from correction process, uses the metadata obtained from correction process to carry out error correction to user data.
See Fig. 4, the data error-correcting method in the flash storage medium that the embodiment of the present invention provides, comprises the following steps:
Step 40: be need the user data of write to distribute physics host sectors, and determine the metadata that this user data is corresponding, this metadata comprises the data of use when carrying out error correction to this user data; By the physics host sectors that the write of this user data distributes, the physics host sectors that the write of this metadata is used for Preservation Metadata is write physical backup sector corresponding to this physics host sectors as the second metadata as the first metadata and using this metadata;
Step 41: from for reading the first metadata the physics host sectors of Preservation Metadata, read the second metadata from the physical backup sector that this physics host sectors is corresponding; The first metadata read and the second metadata are carried out from correction process, obtains trinary data; From the physics host sectors of preserving user data, read user data, use trinary data to carry out error correction to the user data read.
Concrete, the metadata that user data is corresponding can comprise ECC code; Accordingly, in step 41, use trinary data to carry out error correction to the user data read, be implemented as: use the ECC code in the trinary data obtained after correction process to carry out ECC error correction to the user data read.Further, the metadata that user data is corresponding can also comprise the service marking of the numbering of logic sector corresponding to physics host sectors that user data distributes and the physics host sectors for the distribution of this user data.
Concrete, for needing the user data of write to distribute physics host sectors in step 40, specific implementation can be adopted one of with the following method:
Method one: the size of the user data write as required is that user data distributes physics host sectors, is not less than the data volume of this user data with the total amount of data enabling the physics host sectors of distribution store;
Method two: the size of the user data write as required is user data assignment logic sector, and the total amount of data stored with the physics host sectors enabling the logic sector of distribution corresponding is not less than the data volume of this user data; By searching the mapping table of logic sector and physical sector, determine the physics host sectors that the logic sector of distribution is corresponding, user data to be distributed in the physics host sectors determined.
At employing said method for the moment, the metadata that user data is corresponding comprises ECC code; When adopting method two, the numbering of logic sector that the metadata that user data is corresponding comprises ECC code, the physics host sectors distributed for this user data is corresponding and the service marking (namely whether this physics host sectors is by the mark used) of the physics host sectors for the distribution of this user data.
Preferably, when the physics host sectors that user data write is distributed, the physical backup sector corresponding to the physics host sectors write of this user data can also distributed.
Accordingly, in step 41 after using the ECC code in the trinary data obtained after correction process to carry out ECC error correction to the user data read, if ECC error correction success, then the user data obtained after returning ECC error correction; If ECC error correction failure, then read user data from preserving physical backup sector corresponding to the physics host sectors of user data, the ECC code in the trinary data obtained after correction process is used to carry out ECC error correction to the user data read from physical backup sector, if ECC error correction success, the user data obtained after then returning ECC error correction, if ECC error correction failure, then the user data read from physics host sectors and the user data that reads from physical backup sector are carried out from correction process, and return the user data obtained after correction process.
Above-mentionedly carry out the first metadata read and the second metadata from correction process, specific implementation can be as follows: by read the first metadata and the corresponding bit position of the second metadata carry out position or operation, obtain trinary data.Such as, the first metadata read and the second metadata comprise ECC code all respectively, each ECC code comprises 3 bits, then first bit of first of one of them ECC code bit and another ECC code is carried out position or operation, obtain first bit of the ECC code after correction process, second bit of second of one of them ECC code bit and another ECC code is carried out position or operation, obtain second bit of the ECC code after correction process, 3rd bit of the 3rd of one of them ECC code the bit and another ECC code is carried out position or operation, obtain the 3rd bit of the ECC code after correction process, so far, obtain after correction process, comprise the ECC code of three bits.For another example, the first metadata read and the second metadata comprise ECC code all respectively, the numbering of logic sector and the service marking of physics host sectors, each ECC code, the numbering of logic sector and the service marking of physics host sectors all comprise 3 bits, then first bit of first of one of them ECC code bit and another ECC code is carried out position or operation, obtain first bit of the ECC code after correction process, second bit of second of one of them ECC code bit and another ECC code is carried out position or operation, obtain second bit of the ECC code after correction process, 3rd bit of the 3rd of one of them ECC code the bit and another ECC code is carried out position or operation, obtain the 3rd bit of the ECC code after correction process, so far, obtain after correction process, comprise the ECC code of three bits, first bit of the numbering of first of the numbering of one of them logic sector bit and another logic sector is carried out position or operation, obtain first bit of the numbering of the logic sector after correction process, second bit of the numbering of second of the numbering of one of them logic sector bit and another logic sector is carried out position or operation, obtain second bit of the numbering of the logic sector after correction process, 3rd bit of the numbering of the 3rd of the numbering of one of them logic sector the bit and another logic sector is carried out position or operation, obtain the 3rd bit of the numbering of the logic sector after correction process, so far, obtain after correction process, comprise the numbering of the logic sector of three bits, first bit of the service marking of first of the service marking of one of them physics host sectors bit and another physics host sectors is carried out position or operation, obtain first bit of the service marking of the physics host sectors after correction process, second bit of the service marking of second of the service marking of one of them physics host sectors bit and another physics host sectors is carried out position or operation, obtain second bit of the service marking of the physics host sectors after correction process, 3rd bit of the service marking of the 3rd of the service marking of one of them physics host sectors the bit and another physics host sectors is carried out position or operation, obtain the 3rd bit of the service marking of the physics host sectors after correction process, so far, obtain after correction process, comprise the service marking of the physics host sectors of three bits.
Above-mentioned the user data read from physics host sectors and the user data that reads from physical backup sector to be carried out from correction process, specific implementation can be as follows: the user data read from physics host sectors and the corresponding bit position of user data that reads from physical backup sector are carried out position or operation, obtains the user data after correction process.Such as, the user data read comprises 3 bits, then first bit of first of one of them user data bit and another user data is carried out position or operation, obtain first bit of the user data after correction process, second bit of second of one of them user data bit and another user data is carried out position or operation, obtain second bit of the user data after correction process, 3rd bit of the 3rd of one of them user data the bit and another user data is carried out position or operation, obtain the 3rd bit of the user data after correction process, so far, obtain after correction process, comprise the user data of three bits.
Below the present invention is specifically described:
Embodiment one:
The present embodiment realizes the transparent storage backup to user data.In order to realize data backup, need physics sector to be divided into two parts, a part is the main sector of physics that externally can present, and another part is the physical backup sector that backup uses.The main sector of each physics has unique corresponding physical backup sector, and physical backup sector is invisible to user, and physical backup sector and the main sector of physics has fixing offset relationship on flash.
As shown in Figure 5A, data write flow process is as follows:
Step 501: when user needs write data, the size of the user data write as required is that user data distributes physics host sectors, distributes the right to use of physical backup sector corresponding to this physics host sectors simultaneously;
Step 502: calculate ECC code according to sector-size;
Step 503: simultaneously write physical backup sector corresponding to the physics host sectors of distribution and this physics host sectors by needing the user data of write;
Step 504: the ECC code calculated is write the physics host sectors being exclusively used in Preservation Metadata simultaneously and write physical backup sector corresponding to this physics host sectors as the 2nd ECC code as an ECC code and using the ECC code calculated.
As shown in Figure 5 B, digital independent flow process is as follows:
Step 511: read an ECC code from the physics host sectors being exclusively used in Preservation Metadata;
Step 512: read the 2nd ECC code from the physical backup sector that the physics host sectors being exclusively used in Preservation Metadata is corresponding;
Step 513: the ECC code read and the 2nd ECC code are carried out from correction process, obtains the 3rd ECC code;
Step 514: read user data from the physics host sectors of preserving user data;
Step 515: use the 3rd ECC code obtained after correction process to carry out ECC error correction to the user data read;
Step 516: judge that whether ECC error correction is successful, if so, then arrive step 521, otherwise, to step 517;
Step 517: read user data from the physical backup sector that the physics host sectors of preserving user data is corresponding;
Step 518: use the 3rd ECC code obtained after correction process to carry out ECC error correction to the user data read from physical backup sector;
Step 519: judge that whether ECC error correction is successful, if so, then arrive step 521, otherwise, to step 520;
Step 520: the user data read from physics host sectors and the user data that reads from physical backup sector are carried out from correction process;
Step 521: the user data obtained is returned to user.
In digital independent flow process, being described in embodiment three from error correction algorithm is follow-up in step 513 and step 520.
By active and standby sector mechanism can be completely transparent realize data backup, this process is invisible to user.If wish in this implementation to save flash space, Backup Data sector is optional, also to a certain degree can promote data security only by ECC double copies.
Embodiment two:
The present embodiment realizes the double copies of metadata.
As shown in Figure 5 C, for the equipment there is complicated sector managing, except ECC code backs up as the part of metadata, the double copies realizing metadata are also needed for other metadata.
As shown in Figure 5 D, the reading for any metadata all needs to adopt following flow process:
Step 521: read the first metadata from the physics host sectors being exclusively used in Preservation Metadata;
Step 522: read the second metadata from the physical backup sector that the physics host sectors being exclusively used in Preservation Metadata is corresponding;
Step 523: the first metadata read and the second metadata are carried out from correction process.
Embodiment three:
The present embodiment is described the method that active and standby data adopt from error correction.
Flash has the advantages that first wipe and write afterwards, stores bit and is read as 1, can be programmed for 0 after write by 1 after erasing, this characteristic to make on Flash bit upset be to become 0 from 1, therefore this just provides a kind of simple and easy effective method to correcting data error, and as shown in fig. 5e, error correction flow process is as follows:
Step 531: read data from physics host sectors, be called master data;
Step 532: read data from physical backup sector, be called Backup Data;
Step 533: position or operation are carried out in the corresponding bit position of master data and Backup Data, obtains the data after correction process.As long as position or operation refer to that two bits have a bit for " 1 ", then position or result be " 1 ", otherwise position or result be " 0 ".
This error correction algorithm can correct most bit flop phenomenon, occurs that the situation of upset can not be corrected, occur that the probability of this situation is lower after all for bit identical on master/slave data.
See Fig. 6, the embodiment of the present invention provides a kind of device comprising flash storage medium 60, and described flash storage medium 60 comprises physics host sectors and physical backup sector, a corresponding physical backup sector, each physics host sectors, and this device also comprises:
Data write unit 61, for for needing the user data of write to distribute physics host sectors, and determines the metadata that described user data is corresponding, and this metadata comprises the data of use when carrying out error correction to described user data; By the physics host sectors that described user data write distributes, the physics host sectors that described ECC code write is used for Preservation Metadata is write physical backup sector corresponding to this physics host sectors as the second metadata as the first metadata and using described metadata;
Data-reading unit 62, for from for reading the first metadata in the physics host sectors of Preservation Metadata, reads the second metadata from the physical backup sector that this physics host sectors is corresponding; The first metadata read and the second metadata are carried out from correction process, obtains trinary data; From the physics host sectors of preserving user data, read user data, use trinary data to carry out error correction to the user data read.
Further, described data-reading unit 62 for:
When the metadata that described user data is corresponding comprises error correction ECC code, the ECC code in the trinary data obtained after correction process is used to carry out ECC error correction to the user data read.
Further, the metadata that described user data is corresponding also comprises:
The numbering of the logic sector that the physics host sectors distributed for described user data is corresponding and the service marking of physics host sectors distributed for described user data.
Further, described data write unit 61 also for:
When the physics host sectors that described user data write is distributed, the physical backup sector corresponding to the physics host sectors that described user data write is distributed.
Further, described data-reading unit 62 also for:
After using the ECC code in the trinary data obtained after correction process to carry out ECC error correction to the user data read, if ECC error correction success, then the user data obtained after returning ECC error correction; If ECC error correction failure, then from physical backup sector corresponding to the physics host sectors of described preservation user data, read user data, the ECC code in the trinary data obtained after correction process is used to carry out ECC error correction to the user data read, if ECC error correction success, the user data obtained after then returning ECC error correction, if ECC error correction failure, then the user data read from physics host sectors and the user data that reads from physical backup sector are carried out from correction process, and return the user data obtained after correction process.
Further, described data-reading unit 62 for:
Position or operation are carried out in the corresponding bit position of the first metadata read and the second metadata, obtains trinary data.
Further, described data-reading unit 62 for:
The user data read from physics host sectors and the corresponding bit position of user data that reads from physical backup sector are carried out position or operation, obtains the user data after correction process.
To sum up, beneficial effect of the present invention comprises:
In the scheme that the embodiment of the present invention provides, be need the user data of write to distribute physics host sectors, and determine the metadata that this user data is corresponding, this metadata comprises the data of use when carrying out error correction to this user data; By the physics host sectors that the write of this user data distributes, the physics host sectors that the write of this metadata is used for Preservation Metadata is write physical backup sector corresponding to this physics host sectors as the second metadata as the first metadata and using this metadata; From for reading the first metadata the physics host sectors of Preservation Metadata, from the physical backup sector that this physics host sectors is corresponding, read the second metadata; The first metadata read and the second metadata are carried out from correction process, obtains trinary data; From the physics host sectors of preserving user data, read user data, use trinary data to carry out error correction to the user data read.Because metadata also may occur mistake, therefore pass through metadata to write physics host sectors and physical backup sector in this programme simultaneously, when reading user data, metadata in physics host sectors and physical backup sector can be carried out from correction process, to reduce correct metadata as far as possible, re-use the metadata after correction process and error correction is carried out to the user data read, the consequence because metadata error causes user data to be made mistakes can be avoided as far as possible, thus improve the error correction accuracy rate of the data in flash storage medium.
The present invention describes with reference to according to the process flow diagram of the method for the embodiment of the present invention, equipment (system) and computer program and/or block scheme.Should understand can by the combination of the flow process in each flow process in computer program instructions realization flow figure and/or block scheme and/or square frame and process flow diagram and/or block scheme and/or square frame.These computer program instructions can being provided to the processor of multi-purpose computer, special purpose computer, Embedded Processor or other programmable data processing device to produce a machine, making the instruction performed by the processor of computing machine or other programmable data processing device produce device for realizing the function of specifying in process flow diagram flow process or multiple flow process and/or block scheme square frame or multiple square frame.
These computer program instructions also can be stored in can in the computer-readable memory that works in a specific way of vectoring computer or other programmable data processing device, the instruction making to be stored in this computer-readable memory produces the manufacture comprising command device, and this command device realizes the function of specifying in process flow diagram flow process or multiple flow process and/or block scheme square frame or multiple square frame.
These computer program instructions also can be loaded in computing machine or other programmable data processing device, make on computing machine or other programmable devices, to perform sequence of operations step to produce computer implemented process, thus the instruction performed on computing machine or other programmable devices is provided for the step realizing the function of specifying in process flow diagram flow process or multiple flow process and/or block scheme square frame or multiple square frame.
Although describe the preferred embodiments of the present invention, those skilled in the art once obtain the basic creative concept of cicada, then can make other change and amendment to these embodiments.So claims are intended to be interpreted as comprising preferred embodiment and falling into all changes and the amendment of the scope of the invention.
Obviously, those skilled in the art can carry out various change and modification to the present invention and not depart from the spirit and scope of the present invention.Like this, if these amendments of the present invention and modification belong within the scope of the claims in the present invention and equivalent technologies thereof, then the present invention is also intended to comprise these change and modification.

Claims (14)

1. the data error-correcting method in flash storage medium, is characterized in that, described flash storage medium comprises physics host sectors and physical backup sector, a corresponding physical backup sector, each physics host sectors, and the method comprises:
For needing the user data of write to distribute physics host sectors, and determine the metadata that described user data is corresponding, this metadata comprises the data of use when carrying out error correction to described user data; By the physics host sectors that described user data write distributes, the physics host sectors that described metadata write is used for Preservation Metadata is write physical backup sector corresponding to this physics host sectors as the second metadata as the first metadata and using described metadata;
From for reading the first metadata the physics host sectors of Preservation Metadata, from the physical backup sector that this physics host sectors is corresponding, read the second metadata; The first metadata read and the second metadata are carried out from correction process, obtains trinary data; From the physics host sectors of preserving user data, read user data, use trinary data to carry out error correction to the user data read.
2. the method for claim 1, is characterized in that, the metadata that described user data is corresponding comprises: error correction ECC code;
Described use trinary data carries out error correction to the user data read and comprises: use the ECC code in the trinary data obtained after correction process to carry out ECC error correction to the user data read.
3. method as claimed in claim 2, it is characterized in that, the metadata that described user data is corresponding also comprises:
The numbering of the logic sector that the physics host sectors distributed for described user data is corresponding and the service marking of physics host sectors distributed for described user data.
4. method as claimed in claim 2, is characterized in that, when the physics host sectors described user data write distributed, comprises further:
Physical backup sector corresponding to the physics host sectors that described user data write is distributed.
5. method as claimed in claim 4, is characterized in that, after using the ECC code in the trinary data obtained after correction process to carry out ECC error correction to the user data read, comprises further:
If ECC error correction success, then the user data obtained after returning ECC error correction; If ECC error correction failure, then from physical backup sector corresponding to the physics host sectors of described preservation user data, read user data, the ECC code in the trinary data obtained after correction process is used to carry out ECC error correction to the user data read, if ECC error correction success, the user data obtained after then returning ECC error correction, if ECC error correction failure, then the user data read from physics host sectors and the user data that reads from physical backup sector are carried out from correction process, and return the user data obtained after correction process.
6. as the method as described in arbitrary in claim 1-5, it is characterized in that, described the first metadata read and the second metadata to be carried out from correction process, specifically comprise:
Position or operation are carried out in the corresponding bit position of the first metadata read and the second metadata, obtains trinary data.
7. method as claimed in claim 5, is characterized in that, describedly carries out the user data read from physics host sectors and the user data that reads from physical backup sector from correction process, specifically comprises:
The user data read from physics host sectors and the corresponding bit position of user data that reads from physical backup sector are carried out position or operation, obtains the user data after correction process.
8. comprise a device for flash storage medium, it is characterized in that, described flash storage medium comprises physics host sectors and physical backup sector, a corresponding physical backup sector, each physics host sectors, and this device also comprises:
Data write unit, for for needing the user data of write to distribute physics host sectors, and determines the metadata that described user data is corresponding, and this metadata comprises the data of use when carrying out error correction to described user data; By the physics host sectors that described user data write distributes, the physics host sectors that described metadata write is used for Preservation Metadata is write physical backup sector corresponding to this physics host sectors as the second metadata as the first metadata and using described metadata;
Data-reading unit, for from for reading the first metadata in the physics host sectors of Preservation Metadata, reads the second metadata from the physical backup sector that this physics host sectors is corresponding; The first metadata read and the second metadata are carried out from correction process, obtains trinary data; From the physics host sectors of preserving user data, read user data, use trinary data to carry out error correction to the user data read.
9. device as claimed in claim 8, it is characterized in that, described data-reading unit is used for:
When the metadata that described user data is corresponding comprises error correction ECC code, the ECC code in the trinary data obtained after correction process is used to carry out ECC error correction to the user data read.
10. device as claimed in claim 9, it is characterized in that, the metadata that described user data is corresponding also comprises:
The numbering of the logic sector that the physics host sectors distributed for described user data is corresponding and the service marking of physics host sectors distributed for described user data.
11. devices as claimed in claim 9, is characterized in that, described data write unit also for:
When the physics host sectors that described user data write is distributed, the physical backup sector corresponding to the physics host sectors that described user data write is distributed.
12. devices as claimed in claim 11, is characterized in that, described data-reading unit also for:
After using the ECC code in the trinary data obtained after correction process to carry out ECC error correction to the user data read, if ECC error correction success, then the user data obtained after returning ECC error correction; If ECC error correction failure, then from physical backup sector corresponding to the physics host sectors of described preservation user data, read user data, the ECC code in the trinary data obtained after correction process is used to carry out ECC error correction to the user data read, if ECC error correction success, the user data obtained after then returning ECC error correction, if ECC error correction failure, then the user data read from physics host sectors and the user data that reads from physical backup sector are carried out from correction process, and return the user data obtained after correction process.
13. as the device as described in arbitrary in claim 8-12, and it is characterized in that, described data-reading unit is used for:
Position or operation are carried out in the corresponding bit position of the first metadata read and the second metadata, obtains trinary data.
14. devices as claimed in claim 12, it is characterized in that, described data-reading unit is used for:
The user data read from physics host sectors and the corresponding bit position of user data that reads from physical backup sector are carried out position or operation, obtains the user data after correction process.
CN201310019990.9A 2013-01-18 2013-01-18 Data error-correcting method in flash storage medium and device Active CN103092727B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310019990.9A CN103092727B (en) 2013-01-18 2013-01-18 Data error-correcting method in flash storage medium and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310019990.9A CN103092727B (en) 2013-01-18 2013-01-18 Data error-correcting method in flash storage medium and device

Publications (2)

Publication Number Publication Date
CN103092727A CN103092727A (en) 2013-05-08
CN103092727B true CN103092727B (en) 2015-08-26

Family

ID=48205331

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310019990.9A Active CN103092727B (en) 2013-01-18 2013-01-18 Data error-correcting method in flash storage medium and device

Country Status (1)

Country Link
CN (1) CN103092727B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110865945B (en) * 2018-08-28 2022-11-11 上海忆芯实业有限公司 Extended address space for memory devices

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030163635A1 (en) * 2002-02-27 2003-08-28 Aasheim Jered Donald Transactional file system for flash memory
CN1831786A (en) * 2005-12-14 2006-09-13 兆日科技(深圳)有限公司 Data completeness protection method of flash storage
CN101086715A (en) * 2007-07-23 2007-12-12 北京中星微电子有限公司 Method and device for reading CPU code
CN101124639A (en) * 2005-09-30 2008-02-13 西格马特尔公司 System and method of accessing non-volatile computer memory
CN101473308A (en) * 2006-05-18 2009-07-01 矽玛特公司 Non-volatile memory error correction system and method
CN102200937A (en) * 2011-05-31 2011-09-28 深圳创维-Rgb电子有限公司 Method, device and television system for reading data in not-and (NAND) flash memory

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101477481A (en) * 2009-02-06 2009-07-08 中国科学院计算技术研究所 Automatic error correction system and method

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030163635A1 (en) * 2002-02-27 2003-08-28 Aasheim Jered Donald Transactional file system for flash memory
CN101124639A (en) * 2005-09-30 2008-02-13 西格马特尔公司 System and method of accessing non-volatile computer memory
CN1831786A (en) * 2005-12-14 2006-09-13 兆日科技(深圳)有限公司 Data completeness protection method of flash storage
CN101473308A (en) * 2006-05-18 2009-07-01 矽玛特公司 Non-volatile memory error correction system and method
CN101086715A (en) * 2007-07-23 2007-12-12 北京中星微电子有限公司 Method and device for reading CPU code
CN102200937A (en) * 2011-05-31 2011-09-28 深圳创维-Rgb电子有限公司 Method, device and television system for reading data in not-and (NAND) flash memory

Also Published As

Publication number Publication date
CN103092727A (en) 2013-05-08

Similar Documents

Publication Publication Date Title
US9377960B2 (en) System and method of using stripes for recovering data in a flash storage system
KR101758544B1 (en) Synchronous mirroring in non-volatile memory systems
US8255742B2 (en) Dynamically replicated memory
US8543863B2 (en) Efficiency of hardware memory access using dynamically replicated memory
KR101730510B1 (en) Non-regular parity distribution detection via metadata tag
US7036066B2 (en) Error detection using data block mapping
CN101124639B (en) System and method of accessing non-volatile computer memory
US8601347B1 (en) Flash memory device and storage control method
US11029857B2 (en) Offloading device maintenance to an external processor in low-latency, non-volatile memory
CN101473308A (en) Non-volatile memory error correction system and method
US20140082264A1 (en) Nand flash storage chip checking method and device
US9063869B2 (en) Method and system for storing and rebuilding data
US10878111B2 (en) Peer storage devices supporting protection information
US8839072B2 (en) Access control apparatus, storage apparatus, and method
CN102520890B (en) RS (Reed-Solomon) - DRAID( D redundant array of independent disk) system based on GPUs (graphic processing units) and method for controlling data of memory devices
US11340986B1 (en) Host-assisted storage device error correction
US11314594B2 (en) Method, device and computer program product for recovering data
US10248497B2 (en) Error detection and correction utilizing locally stored parity information
CN110413454B (en) Data reconstruction method and device based on storage array and storage medium
CN103218271B (en) A kind of data error-correcting method and device
US9106260B2 (en) Parity data management for a memory architecture
US10552243B2 (en) Corrupt logical block addressing recovery scheme
CN104182292A (en) Data storage method and device
CN103092727B (en) Data error-correcting method in flash storage medium and device
CN112214346A (en) Method and apparatus for error detection during data modification in a memory subsystem

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