Through the method for information sequence realization flash controller management data storage with reduction
Technical field
The present invention relates to the memory technology of flash memory, be specifically related to a kind of through the method for information sequence realization flash controller management data storage with reduction.
Background technology
Serializing is the process that Obj State is converted to the form that can keep or transmit.Relative with serializing is unserializing, and it is changed to object with circulation.These two processes combine, and just make data to be stored like a cork and to transmit.Present most of flash controller is to write NandFlash preliminary data district to carry out storage administration for the information of NandFlash, want the spare area data of the corresponding sector of continuous access when the existence of doing is like this operated, frequent accessing operation has influenced the speed of read-write; Because space, preliminary data district is less, the structure of flash controller is more complicated a little, and just no longer suitable.
Summary of the invention
The object of the present invention is to provide a kind ofly through the information sequence realization flash controller management data storage method with reduction, it has solved in the background technology to the management information read or write speed of the piece among the NandFlash and sector slow and management information and has stored problem with regard to the restriction that is subjected to preliminary data district size separately.
Technical solution of the present invention is:
A kind of method through the storage of information sequence realization flash controller management data is characterized in that this method may further comprise the steps:
A). enumerate the identifier constant according to corresponding one of each information, set up the enumerated table that comprises all identifier constants;
B). generate one with enumerated list corresponding address map index table, the concrete data structure of map addresses concordance list comprises the start sector number and the information size of information, enumerates in the identifier constant manipulative indexing table one in each enumerated list;
C). the information in enumerated list and the map addresses concordance list is carried out the initialization assign operation;
D). the initialization information of managing is carried out storage administration;
E). the information of storage administration is set up scheduler map index table;
F). the information in the scheduler map index table is stored, finally finish the whole process of storage.
Storage administration in the above-mentioned steps (d) also comprises:
At first initialization information is stored, then obtained the start sector number of information, obtain the information size that to preserve according to initialization information according to the block address of information stores; Then the information size is judged, is specifically judged as follows:
If the size of information surpasses the size of a piece, then canned data start sector number and total size are striden the piece storage, then sector number in the map index table of address and information size are upgraded; If the size of information does not have to surpass the size of a piece, directly sector number in the map index table of address and information size are upgraded, upgraded back memory address map index table.
Above-mentionedly stride piece storage and at first obtain, realize storage through calculating the remaining information size again being used for storing the sector number of the piece of the information that lastblock do not stored.
A kind of method through the reduction of information sequence realization flash controller management data is characterized in that the reduction of described flash controller management information comprises step:
A). the information to address map index table reads;
B). to enumerate identifier is start sector number and the size that index obtains information;
C). read the information content at sector number that obtains and size by the sector;
D). will recombinate with the reduction of the pointed of restore information after the information content, thereby finish whole reduction process.
Above-mentioned steps (c) also comprises: whether reading of information finished judges,
Concrete judgement is as follows:
If after the information that will read reads and finishes, directly to the memory information reduction of recombinating;
If reading of information do not finish, enter next procedure and whether information is striden the piece storage judge;
If information is not striden the piece storage, directly return previous step and by the sector information content is read suddenly;
If information reads and finishes, directly to the memory information reduction of recombinating;
If information is striden the piece storage, enter next step, obtain start sector number and the size of remaining information at other pieces, return again by the sector after having obtained and read information content step, continue again information is read, read until information and to finish, again the information in the internal memory is recombinated after information reads and finishes and reduce, finally finish whole reduction process.
The present invention has the following advantages:
1. because the management information of sector can directly be obtained, and to obtain information from the spare area, sector many soon so speed is compared at every turn, can significantly improve the efficient of sector read-write in internal memory.
2. the independent storage of management information can not be subjected to the restriction of preliminary data district size.
3. flash controller applying flexible.
Description of drawings:
Fig. 1 is the composition frame chart of management information serializing of the present invention;
Fig. 2 is a management information operational block diagram of the present invention;
Fig. 3 is a restore management information operating block diagram of the present invention;
Fig. 4 is an information stores program flow diagram of the present invention;
Fig. 5 is an information reverting program flow diagram of the present invention.
Embodiment
Referring to Fig. 1-Fig. 5, a kind of method through the storage of information sequence realization flash controller management data is characterized in that this method may further comprise the steps:
A). enumerate the identifier constant according to corresponding one of each information, set up the enumerated table that comprises all identifier constants;
B). generate one with enumerated list corresponding address map index table, the concrete data structure of map addresses concordance list comprises the start sector number and the information size of information, enumerates in the identifier constant manipulative indexing table one in each enumerated list;
C). the information in enumerated list and the map addresses concordance list is carried out the initialization assign operation;
D). the initialization information of managing is carried out storage administration;
E). the information of storage administration is set up scheduler map index table;
F). the information in the scheduler map index table is stored, finally finish the whole process of storage.
Storage administration in the above-mentioned steps (d) also comprises:
At first initialization information is stored, then obtained the start sector number of information, obtain the information size that to preserve according to initialization information according to the block address of information stores; Then the information size is judged, is specifically judged as follows:
If the size of information surpasses the size of a piece, then canned data start sector number and total size are striden the piece storage, then sector number in the map index table of address and information size are upgraded; If the size of information does not have to surpass the size of a piece, directly sector number in the map index table of address and information size are upgraded, upgraded back memory address map index table.
Stride piece storage and at first obtain, realize storage through calculating the remaining information size again being used for storing the sector number of the piece of the information that lastblock do not stored.
A kind of method through the reduction of management information serializing realization flash controller management data is characterized in that the reduction of described flash controller management information comprises step:
A). the information to address map index table reads;
B). to enumerate identifier is start sector number and the size that index obtains information;
C). read the information content at sector number that obtains and size by the sector;
D). will recombinate with the reduction of the pointed of restore information after the information content, thereby finish whole reduction process.
Above-mentioned steps (c) also comprises: whether reading of information finished judges,
Concrete judge as follows: if the information that will read read finish after, directly to the memory information reduction of recombinating; If reading of information do not finish, enter next procedure and whether information is striden the piece storage judge; If information is not striden the piece storage, directly return previous step and by the sector information content is read suddenly; If information reads and finishes, directly to the memory information reduction of recombinating; If information is striden the piece storage, enter next step, obtain start sector number and the size of remaining information at other pieces, return again by the sector after having obtained and read information content step, continue again information is read, read until information and to finish, again the information in the internal memory is recombinated after information reads and finishes and reduce, finally finish whole reduction process.
The present invention extracts independent storage administration to some common informations commonly used in the NandFlash management, has so just overcome the little shortcoming in space, preliminary data district.Each powering up in the initialization procedure of flash controller corresponding management information is read in the internal memory, until all are all finished in internal memory the operation of NandFlash management information before the flash controller outage, ability is disposable in the time of outage writes back NandFlash to all management information.So just improved read or write speed to a great extent.The method of use flash controller management information serializing makes up, access management information, being mapped with corresponding piece and sector after canned data reads out before, has also increased the flash controller application flexibility.