Patent ID: 8131911
Filing Date: 2012-03-06
Classification: G06F

Abstract:
1. A data writing method, for writing data from a host to a flash memory of a flash storage system, wherein the flash memory is divided into a plurality of physical blocks for alternately mapping a plurality of logical blocks provided by the flash storage system for the host to access, the data writing method comprising: logically dividing the plurality of physical blocks of the flash memory into a data area, a spare area and a special area; judging whether update data to be written into the plurality of logical blocks by the host is a single accessing unit according to a data writing command received from the host; writing the update data into a corresponding physical block among the physical blocks of the special area if the update data is the single accessing unit; judging whether the physical blocks of the special area have stored at least one other data; if the update data is the single accessing unit and the physical blocks of the special area have stored the at least one other data, selecting data to be merged from the update data and the at least one other data, selecting a physical block from the spare area to be a new mapping physical block for a target logical block mapping to the data to be merged, moving valid old data belonging to the target logical block in the data area and the data to be merged in the special area to the new mapping physical block, wherein only a part of the data to be merged and the valid old data belonging to the target logical block are moved when the host performs the data writing command; and erasing the merged data belonging to the target logical block from the physical blocks of the special area after all of the valid old data and the merged data belonging to the target logical block are moved into the new mapping physical block for the target logical block.