Embodiment
For the purpose, technical scheme and the advantage that make the embodiment of the invention clearer, below in conjunction with the accompanying drawing in the embodiment of the invention, technical scheme in the embodiment of the invention is clearly and completely described, obviously, described embodiment is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills belong to the scope of protection of the invention not making the every other embodiment that is obtained under the creative work prerequisite.
Fig. 1 shows the module map of the memory device of embodiment of the present invention, referring to accompanying drawing, comprising:
Described memory device 01 comprises memory cell array 10 and connects the interface 02 of memory device 01 and data handling system, ECC module 31, and wherein, described memory device 01 comprises at least one scanister 11, described scanister 11 comprises scanning element 14,
Described scanning element 14 is used for when the scan period arrives, according to scanister 11 preset reference value, reading of data from memory cell array 10;
Scanister 11 notifies 31 pairs of described reading of data of described ECC module to carry out error correction;
When the wrong figure place in the described data surpassed threshold value, then scanister 11 notified described control module 20 that the data of described error correction are written back in the described memory cell array 10.
For the memory device 01 of a plurality of data channel of configuration, for example, solid state hard disc, general, in the memory cell array 10, comprise a plurality of storage chips, memory device is configured to the M bit data is stored in the memory cell array 10.
In actual applications, according to the storage mode difference of memory cell array 10, memory device 01 can use memory buffer 40: be used for the data that interim storage receives from interface 02, or interim storage sends to the data of data handling system from memory device 01.
In the present embodiment, memory buffer 40 can be nonvolatile memory (as synchronous DRAM), and it is that unit reads and write data that memory buffer 40 can be configured to a sector.
Wherein, interface 02 is used for carrying out data transmission between data handling system and memory device 01;
In actual applications, between data handling system and memory device 01, can carry out data exchange operation by multiple communication interfaces such as USB (general serial type bus), IEEE1394, CF interface, SM interface, MMC interface, SD interface, MS interface, MD interface, X-D interface, pcmcia interface, serial ATA interface, ide interface, scsi interface, HiperLAN interface, blue tooth interface, IrDA infrared interfaces.
In actual applications, control module 20 may be embodied to all processors of operation of control store equipment 01, and control module 20 and memory cell array 10 can be passed through NAND, or the NOR interface communicates.Control module 20 sends read command to memory cell array 10; (for example, to memory cell array write command 00H) certain page address to the memory cell array 10.Then, from memory cell array 10, read corresponding data, start the read data operation of scan period.
In the present embodiment, the described default scan period can be by the application software configuration of data handling system.
Fig. 2 shows the disclosed scanister 11 of embodiment of the present invention,
Scanister 11 comprises scanning element 14,
Scanning element 14 is used for when the scan period arrives, according to preset reference value, and reading of data from memory cell array;
Scanister 11 notifies the data that read in 31 pairs of described memory cell arrays 10 of described ECC module to carry out error correction;
When described ECC module 3 was judged wrong figure place in the data and surpassed threshold value, scanister 11 notice control modules 20 were written back to the data of described error correction in the described memory cell array.
In the present embodiment, scanister 11 notifies control modules 20 that the data of described error correction are written back in the described memory cell array by calling scanning element 14.In data handling system, described scanister 11 and scanning element 14 may be embodied as solidification software or application software.
Fig. 3 has been described in detail scanister 11:
In the present embodiment, described scanister 11 comprises:
Timing unit 12 is used for the time that record control unit 20 read or write data.
Timing unit 12 comprises free time record cell 120, is used for the free time of recording storage equipment 01; Record cell 120 free time of being write down free time, to be control module 20 do not send the read-write processing command according to main frame to be set to the time of memory device 01.
Described timing unit 12 comprises record cell 121 sweep time, is used for the sweep time of 11 pairs of memory devices 01 of writing scan device.
Concrete, scanning element 14 is used to judge when sweep time to memory device 01 arriving the scan period, then notifies 31 pairs of data that read from described memory cell array of described ECC module to carry out error detection or error correction; Judge as scanning element 14 not reach a scan period, then scanning element 14 continues reading of data from memory cell array 10, arrives a scan period up to the read data running time sweep time to memory device 01.
Scanister 11 connects described ECC module 31, and described ECC module 31 is carried out error detection/correction by default error correction algorithm to the data that read from described memory cell array 10; And judge whether the data of error correction surpass the threshold value of write-back.
Scanister 11 comprises dispensing unit 21, and described dispensing unit 21 is used for the reference value of default scanning, and dispensing unit 21 preset reference value comprise:
The described scan period is represented the scan period to memory device 01;
Free time tolerance value representation dispensing unit 21 is preset the memory device free time tolerance value of 01 free time;
The threshold value of described reading of data amount is represented the threshold value of reading of data amount at least one scan period;
The initial value of described reading of data amount is represented the initial value of reading of data amount at least one scan period.
In actual applications, preferred, the initial value of dispensing unit 21 default data streams read amounts can be a sector length; The threshold value (threshold) of reading of data amount can be a physical block length when the 21 default scan periods of dispensing unit arrived.In actual applications, dispensing unit 21 can be application software or firmware etc., makes things convenient for the user to be configured according to different use scenes.
Need to prove that those skilled in the art can know that initial value of more than enumerating and threshold value are not limited to a sector or a physical block, also can be a plurality of; The setting of concrete initial value and threshold value (threshold) will be provided with according to the different application environment of reality, and the numerical value of more than enumerating is not as limitation of the present invention.
In the present embodiment, in scanister 11, can comprise data length control module 25, described data length control module 25 is used for when the scan period of scanister arrives, again dispose the initial value and the threshold value (threshold) of default data volume by dispensing unit 21, wherein said initial value can be a sectors of data length, and described threshold value can be the data length of a physical block.
Scanister 11 comprises data length judging unit 26: be used to judge that whether data volume that the scan period reads when arriving is greater than predetermined threshold value.
Fig. 4 shows the ECC module 31 of one embodiment of the present invention,
In the present embodiment, ECC module 31 is used for error scanning and/or error correction, and ECC module 31 comprises ECC error detection unit 32, ECC error correction unit 33;
ECC error detection unit 32 is used for scanning the wrong figure place that occurs from the data that memory cell array 10 reads, the data that read are offered memory buffer 40, if comprise mistake in the data that read, then ECC error detection unit 32 transfers to ECC error correction unit 33 with the misdata figure place and carries out correction process.
ECC error correction unit 33 is under the control of ECC module 31 and control module 20, and according to certain error correction logic, Search Error position in memory buffer 40 is carried out data to described misdata and corrected replication processes, with the data of correcting a mistake.ECC error correction unit 33 is unit for the data that make a mistake with the sector, according to the intermediate value of ECC error detection unit 32 outputs, the misdata that takes place is carried out error correction.
Start in the scan operation at scanister 11, scanister 11 passes through scanning element 14 from memory device 01 reading of data, concrete, after control module 20 is receiving the request of primary processor (CPU), control ECC error detection unit 32, ECC error correction unit 33 are finished the data EDC error detection and correction, finally control, comprise that data transmission correct after scanning error-free data and passing through error correction is to the read data end correct data.
In the present embodiment, in ECC module 31, provide ECC error logging unit 34, be used to write down the wrong figure place and the maximum wrong number that allows of described ECC module of the data that read in the scan period.In one embodiment, in the process of described read data, the error in data figure place that described ECC error detection unit 32 scans can be added up by the function of error counter or register in ECC error logging unit 34.
In the present embodiment, the error counter initial value of ECC error logging unit 34 is 0, whenever read byte error data and just described error count value is added one, described ECC error logging unit 34 can also be used to write down the figure place of correction of data, so that ECC module 31 compares with the threshold value of write-back default in the dispensing unit 21 according to the described data of having corrected a mistake, as write-back threshold value as described in reaching, then control module 10 correction of data (correction of data figure place) be written back to described memory cell array 10.
In the present embodiment, ECC module 31 needs query configuration unit 21 to carry out the threshold value of write-back after the error correction for data, and in practicing, the error correcting capability of the ECC module 31 of the setting of described threshold value and memory device 01 is relevant.
For example, the error correcting capability of error correction algorithm is for whenever reading 512 byte datas in the ECC module 31, but error correction 16 bit-errors, and in the data of being read, have only 15 bit-errors in per 512 byte datas of ECC error logging unit 34 records, then misdata can be by 33 error correction of ECC error correction unit, otherwise, then exceed the error correcting capability of ECC module 31.
Need to prove, if ECC error correction unit 33 judges that described misdata can not error correction, then export the ECC failure signal, illustrate that the data of reading write the data of certain storage area of described memory cell array 10 before not being, cause the unreliability of data storage like this.
In actual applications, when described memory device 01 was solid state hard disc (perhaps flash disk, MP3 controller), ECC module 31 can be passed through logic realization, also can realize with the form of firmware.If the CPU of data handling system has powerful operation capacity, ECC module 31 can be arranged in the operating system, so that the user carries out the adaptability upgrading by upgrading operation system to the algorithm of ECC module 31.
Fig. 5 shows the data scanning process flow diagram of an embodiment:
Need to prove that the scan method that present embodiment proposes is applicable to that all utilize the ECC algorithm to carry out the memory device of data check;
For example, in data handling system, described data managing method is applicable to NAND Flash memory device, NOR Flash memory device, phase-change random access memory device (PRAM), MRAM memory device memory devices such as (MRAM), or other non-volatile memory device.
In actual applications, described data scanning method can be implemented in ASIC, DSP, and programmable logic device (PLD), field programmable gate array (FPGA) is in the microprocessor.
The data scanning flow process of embodiment of the present invention comprises:
Step S1, when the scan period arrives, according to preset reference value in the scan period, reading of data from memory cell array;
Step S2 carries out correction process to described reading of data;
Step S3 when the wrong figure place in the described data surpasses threshold value, is written back to described data through error correction in the described memory cell array.
As shown in Figure 6, wherein, described step S1 may further include:
Step S10 starts scanister;
At first, in the present embodiment, when the memory device electrification reset, at first, read a byte data as scanister with the counter O reset of scanister, just with counter records data counts add one.
Need to prove, when scanister is known the memory device power down, the address of the current data that scan in memory cell array recorded in the log blocks of memory cell array, after memory device re-powers, address before the power down of preserving in the log blocks on the storage chip when scanister scans power down in the described memory cell array is scanned the start address of the address before the power down of described preservation as scanning to memory device; When scanister scanned certain storage chip in the memory cell array or storage unit end position the time, then write down the end position that reads, the next storage chip or the storage unit of simultaneously described scanister scanning memory cell array by log blocks.
Then, enter step S11, according to preset reference value in the scan period, reading of data from memory cell array, the step of described reading of data specifically:
S110 inquires about described control module and writes the time of data to storage unit, arrives a scan period writing time when inquiring, and then notifies described scanister that the data that the scan period read are sent to memory buffer.
In the present embodiment, can handle, so that dirigibility scan period is adjusted the data volume that scanister scan period reads.
In the present embodiment, the data that the scan period read are sent to memory buffer, enter step S2, described reading of data is carried out correction process when inquiring described scanister;
Step S20, from memory cell array, read one piece of data after, the data that read are sent to the ECC module, the proof test value that is stored in the spare area in certain page in the memory cell array is read and is calculated; Described result calculated and the proof test value that writes in this page are compared.
In the present embodiment, the ECC module scans wrong figure place, then writes down described wrong figure place, and the wrong figure place of in the report scanister scan period sense data being corrected.Verification rule according to the ECC module is corrected the misdata of reading in the described scan period; Control described ECC module with described result calculated and data write buffering memory together.
Step S21, the wrong figure place of judging the ECC module records if the judgment is Yes, then enters step S3 whether greater than the write-back threshold value of correction module, and the data that described ECC module was corrected are written back to described memory cell array.
Step S30, the notice control module (for example sends the data write command, send page or leaf program command 80H), with data one page from the storage chip of the buffer memory write storage unit array of control module, at last, write data write operation and confirm order (for example, sending 10H), confirm to write to finish to memory cell array.Whether the notice control module sends the read states order to memory cell array, successful to judge write operation.
Step S40 continues to wait for that the next scan period arrives.Operation after the next scan period of described wait is same as the preamble explanation, repeats no more.
Need to prove that the error in data in the memory cell array can in time be found and correct to the data scanning method in the present embodiment, thereby avoid the misdata accumulation to exceed the error correcting capability of memory device.
Fig. 7 shows the data scanning process flow diagram that is used for starting slowly of another embodiment of the present invention:
Normal running to data disposal system accessing storage device during for fear of the scanning memory device brings influence, in step S10, carry out the startup scan mode slowly of present embodiment, handle by the data volume that scanister read at least one scan period, the data volume that reads in described at least one scan period also can be expressed as data scanning length.
In one embodiment, as shown in Figure 7,
Step S10 further comprises:
Step S101: when sweep time of timing unit record to default scan period, start described data length control module and the described current scan period is finished the data volume that the back reads in the next one scan period handle;
In the present embodiment, the parameter of described data length control module reference comprises: the initial value of reading of data is a sector length in the described scan period; The threshold value (threshold) of reading of data amount is a physical block length in the described scan period.
Step S102, judges that whether described free time is greater than the dispensing unit free time tolerance value of default free time at the free time of obtaining the memory device of timing unit record; If described free time, then the data volume that the next scan period is not read was handled less than described free time tolerance value; Take place more than or equal to described free time tolerance value incident if inquire about described free time,
Then enter step S103, when incident described in the described previous scan period takes place,, the data volume integral multiple that reads is increased progressively from the next scan period;
Need to prove, gated sweep to the data volume integral multiple to increase progressively be according to the free time that scans memory device during more than or equal to free time tolerance value, illustrate that then the data volume that the read operation of each scan period of scanister is read can increase, because a scan operation can comprise several scan periods, increase by data volume described scanning, make in the scan period circulation, the data volume that each scan period reads reaches a suitable data length.The data volume integral multiple that reads in the process of described gated sweep loop cycle increases progressively, and is when taking place according to above-mentioned incident, finishes when the previous scan period, and the data volume that the next scan period of control reads then increases progressively according to certain multiple.
For example, in actual applications, the scan period is 2, and in the scanning process, the data total length that reads is 4; Scan period is 3, and then in the scanning process, the data length that reads is 8, and the scan period, the data total length that then reads in the scanning process was 16 when being 4.
As shown in Figure 8, in one embodiment, before entering step S20,
At first, step S111 judges that whether the data volume that reads in this way, then to the data volume that read is not handled greater than preset threshold value in the dispensing unit, jumps out step S11 in the scanning process; Otherwise, then enter step S1111, control the data volume that the described scan period reads and increase progressively in the process of cycling according to certain multiple,
S1112, up to the data volume that is read greater than dispensing unit in preset threshold value, or described free time less than described free time tolerance value, stop the data volume that reads in the described scan period is increased progressively processing, enter step S20.
In the present embodiment, according to control to scan data volume, can effectively utilize the idle condition of memory device, described data are carried out wrong error detection/correction, because the idle condition memory device do not carry out data read-write operation, data are carried out correction process so present embodiment can be implemented in not influence when the data of memory cell array are are normally read and write.
Fig. 9 shows the data stewardship program figure that an embodiment is used for congested control:
Step S110 reads described data; In the present embodiment, the described data volume that reads can be the data length that the data length that reads or single sweep operation arrive.
S1101 is if described data length judging unit inquires the described data volume that reads greater than dispensing unit 21 preset threshold value;
Step S1102 handles the data volume that a scan period reads;
After finishing as current scan period, then the data volume that reads increases a sector length the next scan period of control, thereby is linear growth according to the data total amount of data (or data length) that several continuous scan periods of scanning sequency read.
Step S120, scan period is inquired about the free time of described timing unit record when arriving, and whether free time of appliance arrangement of scanning described timing unit record is less than free time tolerance value default in the dispensing unit;
Step S1201 is if the free time that inquires is less than described free time tolerance value;
Then enter step S1202, the changes of threshold of the data volume that the gated sweep cycle reads for example, is half of the current data length that scans with the threshold value of data scanning length;
Step S1203, finish threshold process to scan period data scanning length after, described data scanning length is provided with again, as, the data length of described scan period is re-set as a sector length.
Figure 10 shows in the embodiment the scene graph after the data volume processing of reading in the scan period, startup slowly and jam control function by one embodiment of the present invention make described data volume increase gradually according to the free time of memory device, the influence of read write command response time in the memory device normal running in the time of can reducing the scan event generation.
In the present embodiment, a certain amount of data scan in the memory cell array by reading according to the scan period, make the wrong error detection/correction of data through the ECC module, the data that the wrong figure place of correcting surpassed certain thresholding are carried out the mistake that write-back is corrected data in the memory cell array, error in data in time is found, reduce in the memory cell array data since the bit flipping error accumulation to the degree that can not correct.In addition,, reduce the influence of scanning, in the same scan period, can respond more read write command normal readwrite performance by starting slowly and congested control.
Need to prove, in actual applications, the data managing method of the shown described memory device of present embodiment can be used for wireless data communication device, computer system, other mancarried electronic aids, as compact flash storer/card, secure data storage card etc., and the commercial unit of application solid state hard disc storage data etc.
Through the above description of the embodiments, those skilled in the art can be well understood to the present invention and can realize by the mode that software adds essential hardware platform, can certainly all implement, but the former is better embodiment under a lot of situation by hardware.Based on such understanding, all or part of can the embodying that technical scheme of the present invention contributes to background technology with the form of software product, this computer software product can be stored in the memory cell array, as ROM/RAM, magnetic disc, CD etc., comprise that some instructions are with so that a computer equipment (can be a personal computer, server, the perhaps network equipment etc.) carry out the described method of some part of each embodiment of the present invention or embodiment.
More than the present invention is described in detail, used specific case herein principle of the present invention and embodiment set forth, the explanation of above embodiment just is used for help understanding method of the present invention and core concept thereof; Simultaneously, for one of ordinary skill in the art, according to thought of the present invention, the part that all can change in specific embodiments and applications, in sum, this description should not be construed as limitation of the present invention.