Patent ID: 8560926

Claim:
A data writing method for writing page 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, the data writing method comprising: grouping the physical pages into a plurality of physical page groups according to write speed of each of the physical pages by a memory controller, wherein the physical page groups includes a first physical page group and a second physical page group and write speed of writing data into the physical pages belonging to the first physical page group are faster than write speed of writing data into the physical pages belonging to the second physical page group; compressing the page data to generate compressed data by the memory controller; calculating a data compression ratio corresponding to the compressed data by the memory controller; and writing the compressed data into one of the physical pages in a corresponding physical page group among the physical page groups according to the data compression ratio by the memory controller, wherein the step of writing the compressed data into one of the physical pages in the corresponding physical page group among the physical page groups according to the data compression ratio comprises: generating an error checking and correcting (ECC) code corresponding to the compressed data by the memory controller; generating an ECC frame according to the compressed data and the ECC code by the memory controller; determining whether the data compression ratio corresponding to the compressed data is greater than a predetermined threshold by the memory controller; when the data compression ratio corresponding to the compressed data is greater than the predetermined threshold, writing the ECC frame into one of the physical pages belonging to the second physical page group by the memory controller; and when the data compression ratio corresponding to the compressed data is not greater than the predetermined threshold, writing the ECC frame into one of the physical pages belonging to the first physical page group by the memory controller.