Patent ID: 9652378
Date: 2017-05-16
CPC Classifications: G06F

Claim:
1. A writing method for controlling a rewritable non-volatile memory module, wherein the rewritable non-volatile memory module comprises a plurality of physical blocks, each of the physical blocks comprises the same number of a plurality of physical pages, and the physical blocks are at least grouped into a storage area, wherein each of the physical block is the minimum unit for erasing, and the data storing method comprises: configuring a plurality of logical addresses to map to a part of the physical pages in the storage area, wherein at least one of the physical pages stores at least one valid data, wherein a plurality of spare physical blocks among the physical blocks in the storage area are not mapped to the logical addresses; transmitting a first write command to the rewritable non-volatile memory module, for writing a first data having a first data length to at least one first physical page of a first spare physical block among the spare physical blocks; receiving a status signal transmitted by the rewritable non-volatile memory module; selecting a second spare physical block from the spare physical blocks and copying the at least one valid data having a second data length to at least one second physical page of the second spare physical block, after transmitting the first write command and before receiving the status signal, wherein the second spare physical block is different from the first spare physical block; and deciding the second data length according to the first data length, a volume of all the logical addresses and a volume of all the spare physical blocks in the storage area, wherein the second data length is not less than the first data length.