主权项 |
1. A solid state drive, comprising:
a flash memory having a plurality of blocks storing write data, wherein the blocks have respective history number and respective physical-to-logical data; and a controlling unit connected with the flash memory, and comprising a history number generator and a mapping unit, wherein the history number generator provides history numbers to respective blocks in an ascending order according to a writing sequence of the blocks, and the mapping unit comprises a logical-to-physical table and a bitmap table, wherein the bitmap table is used to indicate whether plurality of physical allocation addresses located in the flash memory respectively contain valid data or not, wherein once the history number reaches a first value, the first value is set as a reference history number, and the logical-to-physical table and the bitmap table are written into the flash memory by the controlling unit, wherein once the solid state drive is powered on again, the logical-to-physical table and the bitmap table in the flash memory are read by the controlling unit and stored into the mapping unit, the newly-written blocks whose history numbers are higher than the reference history number are searched from the flash memory by the controlling unit, then the physical-to-logical data in the newly-written blocks are sequentially reconstructed into the logical-to-physical table and the bitmap table of the mapping unit according to the history numbers in an ascending order, and then the bitmap table is verified by confirming whether the physical allocation addresses contained in the reconstructed logical-to-physical table are set as valid data. |