Patent ID: 8516184

Claim:
A data writing method, for writing updated data into a rewritable non-volatile memory module, wherein the rewritable non-volatile memory module has a plurality of physical blocks, each of the physical blocks has a plurality of physical pages, the physical blocks are logically grouped into at least a data area and a spare area, a plurality of logical blocks is configured and mapped to the physical blocks of the data area, each of the logical blocks has a plurality of logical pages, the updated data belongs to a first logical page of a first logical block among the logical blocks, and the first logical block is mapped to a first physical block among the physical blocks of the data area, the data writing method comprising: setting a plurality of mark count values for the logical pages, wherein each of the logical pages is corresponding to one of the mark count values; selecting at least one of the physical blocks in the spare area as a first storage area; selecting at least another one of the physical blocks in the spare area as a second storage area; determining whether the mark count value corresponding to the first logical page is greater than a predetermined threshold; when the mark count value corresponding to the first logical page is not greater than the predetermined threshold, changing the mark count value corresponding to the first logical page and writing the updated data and the mark count value corresponding to the first logical page into the first storage area or the second storage area; and when the mark count value corresponding to the first logical page is greater than the predetermined threshold, writing the updated data and the mark count value corresponding to the first logical page into the second storage area.