Patent ID: 8589620

Claim:
A data writing method for writing data into a rewritable non-volatile memory module, wherein the rewritable non-volatile memory module has a plurality of physical blocks, and each of the physical blocks has a plurality of physical pages arranged in a sequence, the data writing method comprising: grouping the physical blocks into at least a data area and a free area; configuring a plurality of logical blocks for mapping to the physical blocks of the data area, wherein each of the logical blocks has a plurality of logical pages; receiving a plurality of update data, wherein the update data is corresponding to a plurality of continuous logical pages among the logical pages, the continuous logical pages belong to a first logical block among the logical blocks, and the first logical block is mapped to a first physical block among the physical blocks; determining whether any one of the physical blocks in the free area is selected to serve as a child physical block corresponding to the first physical block; when a second physical block among the physical blocks in the free area is selected and moved from the free area to serve as the child physical block corresponding to the first physical block, determining whether at least a portion of the physical pages of the second physical block that are corresponding to the continuous logical pages already store data; and when at least a portion of the physical pages of the second physical block that are corresponding to the continuous logical pages already store data, executing a second writing procedure, wherein the second writing procedure comprises: identifying data stored in the second physical block as first data and second data; selecting a third physical block from the physical blocks of the free area; writing the update data and the second data into the third physical block; serving the third physical block as the child physical block corresponding to the first physical block; and executing an erasing operation on the second physical block, wherein the first data is data stored in the physical pages of the second physical block that are corresponding to the continuous logical pages, and the second data is data stored in the physical pages of the second physical block that are not corresponding to the continuous logical pages.