主权项 |
1. A data writing method for writing data into a rewritable non-volatile memory module, wherein the rewritable non-volatile memory module includes a plurality of physical erasing units, each of the physical erasing units includes a plurality of physical programming units, the physical erasing units are grouped into at least a data area and a spare area, the physical erasing units of the spare area are used for substituting the physical erasing units of the data area to write data, a plurality of logical units are configured for mapping to the physical erasing units of the data area, and each of the logical units includes a plurality of logical pages, the data writing method comprising:
selecting at least one physical erasing unit from the physical erasing units of the spare area as a global random area, wherein the global random area is used for temporarily storing data belonging to a plurality of updated logical pages, and the updated logical pages belong to a plurality of updated logical units among the logical units; building a global random area searching table to record a plurality of updated information corresponding to the updated logical pages in the global random area; receiving a write command and an updated data corresponding to the write command, wherein the updated data belongs to a first logical page and the first logical page belongs to a first logical unit among the logical units; recording a data dispersedness degree corresponding to the global random area; determining whether the data dispersedness degree corresponding to the global random area is smaller than a data dispersedness degree threshold; and if the data dispersedness degree corresponding to the global random area is smaller than the data dispersedness degree threshold, writing the updated data into the global random area and recording updated information corresponding to the first logical page in the global random area searching table. |