Patent ID: 8271721

Claim:
A data writing method for a flash memory, wherein the data writing method comprises: receiving a write command, a write address, and write data from a host; determining whether a total number of block pairs in a flash memory is equal to a threshold value; determining whether execution of the write command increases the total number of block pairs; when the total number of block pairs is equal to the threshold value, and execution of the write command increases the total number of block pairs, writing the write data to a data buffer block of the flash memory, and storing the write address in an address storage table; selecting a target block pair for integration from the block pairs, wherein the target block pair comprises a target mother block and a target child block; when a plurality of subsequent write commands are received from the host, integrating the target mother block and the target child block into an integrated block during receiving intervals of subsequent write commands; and executing the write command according to the write data stored in the data buffer block and the write address stored in the address storage table.