Summary of the invention
Fundamental purpose of the present invention, for a kind of Flash data search method and device are provided, by Flash data are searched for generally and obtained preliminary Search Results, then is carried out ECC and precise search, has shortened the Flash data search time.
The present invention proposes a kind of Flash data search method, comprising:
By default key word and the first search blur level, in Flash data, search for doubtful data block, one or more data block that described doubtful data block is Flash data;
Doubtful data block is carried out bug check and corrected ECC;
According to the second search blur level and described key word, the result of ECC is searched for, and return to Search Results.
Preferably, describedly by default key word and the first search blur level, in Flash data, search for doubtful data block and comprise:
According to default key word and the first search blur level, locate doubtful key word;
Return to the doubtful data block information at doubtful key word place.
Preferably, described by default key word and search blur level Flash data are searched for and are comprised:
In default data area, Flash data are searched for, described data area comprises one or more data block.
Preferably, after Flash data being searched for by default key word and the first search blur level described in carrying out, comprising:
When not there is not corresponding Search Results, do not start ECC.
Preferably, before Flash data being searched for by default key word and search blur level described in carrying out, also comprise:
Key word, the first search blur level and the second search blur level are set.
The present invention also proposes a kind of Flash data serching device, comprising:
Preliminary search module, searches for doubtful data block in Flash data, one or more data block that described doubtful data block is Flash data for the key word by default and the first search blur level;
ECC module, for carrying out bug check and correcting ECC to doubtful data block;
Precise search module, for according to the second search blur level and described key word, the result of ECC being searched for, and returns to Search Results.
Preferably, described ECC module comprises:
Positioning unit, for locating doubtful data block, one or more data block that described doubtful data block is Flash data according to Search Results;
Error correction unit, for carrying out ECC to doubtful data block.
Preferably, described preliminary search module specifically for:
In default data area, Flash data are searched for, described data area comprises one or more data block.
Preferably, described Flash data serching device also comprises:
End module, when not there is not corresponding Search Results, do not start ECC.
Preferably, described Flash data serching device also comprises:
Module is set, for key word, the first search blur level and the second search blur level are set.
A kind of Flash data search method and device that the present invention proposes, first search for generally Flash data, when there is Search Results, Search Results carried out ECC and carries out precise search, shortened the Flash data search time.
Embodiment
A kind of Flash data search method and device that the present invention proposes, first search for generally Flash data, on the basis of preliminary Search Results, carries out ECC and precise search again, obtains final Search Results.
With reference to Fig. 1, a kind of Flash data search method one embodiment of the present invention is proposed, comprising:
Step S101 searches for doubtful data block by default key word and the first search blur level in Flash data, and doubtful data block is one or more data block of Flash data;
First user arranges a Flash data serching device, and this device can be connected with Flash, and Flash data serching device first, by Flash interface controller, reads out data from Flash, is placed on data storage area.According to default key word and the first search blur level, these Flash data are searched for, the first search blur level allows fault-tolerant ability.Whether this search, for preliminary search, exists and needs the doubtful key word of inquiry therein in the Flash data of definite search.As existed, return to one or more the doubtful data block that comprises doubtful key word, doubtful data block is one or more data block of Flash data.
Step S102, carries out bug check and corrects ECC doubtful data block;
The doubtful data block searching is carried out to ECC.Due to doubtful key word be possible consistent with key word data, must first to this doubtful key word, carry out can further determining after decoding and error.As do not found doubtful key word, Flash data serching device can pass through Flash interface controller again, from Flash, reads the Flash data that the next one will be searched for.
Step S103, searches for the result of ECC according to the second search blur level and key word, and returns to Search Results.
Flash data serching device is the further precise search of result after to ECC according to the second search blur level and key word, finally determines whether this doubtful key word is default key word, and returns to Search Results.The accurate program of the second search blur level will be higher than the first search blur level.
A kind of Flash data search method that the present invention proposes, first searches for generally Flash data, when there is Search Results, Search Results is positioned and carries out precise search, has shortened the Flash data search time.
With reference to Fig. 2, in Flash data search method one embodiment of the present invention, step S101 can comprise:
Step S1011, locates doubtful key word according to default key word and the first search blur level;
If found doubtful key word from Flash data, locate this doubtful key word.
Step S1012, returns to the doubtful data block information at doubtful key word place.
Return the doubtful data block at doubtful key word place.
With reference to Fig. 3, the another embodiment of Flash data search method of the present invention is proposed, in one embodiment, after execution step S101, also comprise:
Step S104, when not there is not corresponding Search Results, does not start ECC.
When after preliminary search, while not there is not doubtful key word, do not start ECC, avoid unnecessary operation.
Before execution step S101, also comprise:
Step S100, arranges key word, the first search blur level and the second search blur level.
The levels of precision that it should be noted that the second search blur level will, higher than the first search blur level, just can reach object of the present invention.
On a upper embodiment basis, there are not the Flash data of doubtful key word in the present embodiment, stops follow-up ECC for preliminary search, on a upper embodiment basis, improved search efficiency.And key word, the first search blur level and the second search blur level are set according to actual needs flexibly.
With reference to Fig. 4, Flash data serching device one embodiment of the present invention is proposed, comprising:
Preliminary search module 10, searches for doubtful data block for the key word by default and the first search blur level in Flash data, and doubtful data block is one or more data block of Flash data;
ECC module 20, for carrying out bug check and correcting ECC to doubtful data block;
Precise search module 30, for according to the second search blur level and described key word, the result of ECC being searched for, and returns to Search Results.
Flash data serching device can be connected with Flash, and Flash data serching device first, by Flash interface controller, reads out data from Flash, is placed on data storage area.Preliminary search module 10 is searched for these Flash data according to default key word and the first search blur level, and the first search blur level allows fault-tolerant ability.Whether this search, for preliminary search, exists and needs the doubtful key word of inquiry therein in the Flash data of definite search.As existed, return to one or more the doubtful data block that comprises doubtful key word, doubtful data block is one or more data block of Flash data.
The doubtful data block that 20 pairs of ECC modules search is carried out ECC.Due to doubtful key word be possible consistent with key word data, must first to this doubtful key word, carry out can further determining after decoding and error.As do not found doubtful key word, Flash data serching device can pass through Flash interface controller again, from Flash, reads the Flash data that the next one will be searched for.
Precise search module 30 is the further precise search of result after to ECC according to the second search blur level and key word, finally determines whether this doubtful key word is default key word, and returns to Search Results.The accurate program of the second search blur level will be higher than the first search blur level.
A kind of Flash data serching device that the present invention proposes, first searches for generally Flash data, when there is Search Results, Search Results is carried out ECC and carries out precise search, has shortened the Flash data search time.
In Flash data serching device one embodiment of the present invention, preliminary search module 10 specifically for:
In default data area, Flash data are searched for, this data area comprises one or more data block.
With reference to Fig. 5, in Flash data serching device one embodiment of the present invention, preliminary search module 10 can comprise:
Positioning unit 11, for locating doubtful key word according to default key word and the first search blur level;
Feedback unit 12, for returning to the doubtful data block information at doubtful key word place.
If found doubtful key word from Flash data, positioning unit 11 is located these doubtful key words.
Feedback unit 12 is returned the doubtful data block at doubtful key word place.
With reference to Fig. 6, the another embodiment of Flash data serching device of the present invention is proposed, in Flash data serching device one embodiment, also comprise:
Module 40 is set, for key word, the first search blur level and the second search blur level are set.
End module 50, when not there is not corresponding Search Results, do not start ECC.
When after preliminary search, while not there is not doubtful key word, end module 50 and do not start ECC hardware module and do not start ECC, avoid unnecessary operation.
The levels of precision that it should be noted that the second search blur level in the present invention will, higher than the first search blur level, just can reach object of the present invention.
On a upper embodiment basis, there are not the Flash data of doubtful key word in the present embodiment, stops follow-up ECC for preliminary search, on a upper embodiment basis, improved search efficiency.And key word, the first search blur level and the second search blur level are set according to actual needs flexibly.
The foregoing is only the preferred embodiments of the present invention; not thereby limit the scope of the claims of the present invention; every equivalent structure or conversion of equivalent flow process that utilizes instructions of the present invention and accompanying drawing content to do; or be directly or indirectly used in other relevant technical fields, be all in like manner included in scope of patent protection of the present invention.