Patent ID: 8521947

Claim:
A method for writing data into flash memory, the flash memory including a control unit and a memory unit, in which the memory unit has a plurality of physical memory blocks, wherein the physical memory block includes a plurality of physical memory pages, and the control unit has a logical/physical address mapping table which is for recording a relation between logical addresses and physical addresses, the method comprising: receiving a writing instruction and a set of target data from a host by the control unit, in which the writing instruction includes a target logical address and a target data length corresponding to the set of target data; comparing the target data length with a threshold value by the control unit; when the target data length equals to or is smaller than the threshold value, the set of target data is determined to be a frequently-updated data and then stored into a first physical memory block; when the target data length is larger than the threshold value, determining whether the set of target data has a part of not-aligned target data which is not aligned to the physical memory page; and when the set of target data has the part of not-aligned target data, the part of not-aligned target data is then stored into a third physical memory block, and a part of aligned target data is then stored into a second physical memory block; wherein when the target data length is not an integral multiple of a storage size of one physical memory page, the target data has the part of not-aligned target data, and the part of not-aligned target data are data not filling one physical memory page to the full, and the part of aligned data are data filling at least one physical memory page to the full.