Patent ID: 7904635

Claim:
A method of data management for a flash memory medium, wherein the flash memory medium includes a plurality of memory blocks, each memory block including a plurality of pages, each page including a data storage area and a redundancy area, the data management method comprising the steps of: setting a status flag in the redundancy area of at least one of said plurality of pages in at least one of the plurality of memory blocks to indicate an unfinished state when operating on the at least one memory block, the operating comprising: writing new data to a specified block of the at least one memory block specified to receive the new data if the specified block is blank, or copying data to be reserved from a specified block specified to receive new data to a new blank block if the specified block is not blank, writing new data to the new block, and erasing the specified block; and setting the status flag to indicate a finished state after the operating; wherein each status flag has only two states, an unfinished state and a finished state, the status flag is used to determine whether a failure has occurred during the writing of data, the erasing operation, or the setting of the status flags; wherein using the status flag to recover data comprises: finding a first block comprising a status flag of unfinished state when power is reapplied after a power loss; determining whether a second block, having the same logic address as the first block, exists; if the second block does not exist, determining that an error has occurred during the setting of the status flag, and recovering the data by setting all the status flags as finished state and modifying a check list; and if the second block exists, determining whether all the status flags in the first block are set as unfinished state, if all the status flags in the first block are set as unfinished state, determining that a failure has occurred during the erasing operation, and recovering the data by erasing the second block and setting all the status flags in the first block as finished state, and if all the status flags in the first block are set as finished state, determining that a failure has occurred during the writing of data, and recovering the data by erasing the first block, setting all the status flags in the second block as finished state, and modifying the check list.