Patent ID: 11860669
Assignee: SILICON MOTION, INC.
Field: Computer technology (Electrical engineering)
Classification: CPC G | IPC G

Claim 11:
12. An apparatus for storing data in flash memory, equipped with a device side, comprising:
a flash interface (I/F), coupled to a flash module;
a host I/F, coupled to a host side; and
a processing unit, coupled to the flash OF and the host I/F, arranged operably to receive logical partitioning information describing a first logical partition type and a second logical partition type of storage from a file system run on a host side, wherein the logical partitioning information comprises a first length of the first logical partition type of storage and a second length of the second logical partition type of storage, the first length of the first logical partition type and the second length of the second logical partition type are represented by quantities of logical block address (LBA) numbers, the host side defines the first logical partition type and the second logical partition type, the host side defines to store a first type of files in the first logical partition type of storage, and the host side defines to store a second type of files in the second logical partition type of storage; divide storage space in the flash module into a first region and a second region, wherein the first region comprises a plurality of first physical blocks, the second region comprises a plurality of second physical blocks, each first physical block is programmed in a single level cell (SLC) mode only, each second physical block is programmed in the SLC mode or a non-SLC mode, the SLC mode is used to program a memory cell to store one of two states, and the non-SLC mode is used to program a memory cell to store one of at least four states; drive the flash OF to program data belonging to the first logical partition type, which is received from the host side through the host I/F, into a first physical block in the first region only; drive the flash OF to program data belonging to the second logical partition type, which is received from the host side, into either the first physical block in the first region or a second physical block in the second region; drive the flash OF to read data from a physical page of a data block in the first region, wherein the data block comprises the first physical block which has been fully programmed; examine a status for the first region; in response to the status for the first region meeting a condition, drive the flash OF to read and collect data stored in a plurality of first valid sectors of the data block, which belongs to the first logical partition type, and program first collected data into a first current block in the first region in the SLC mode; and in response to the status for the first region meeting the condition, drive the flash OF to read and collect data stored in a plurality of second valid sectors of the data block, which belongs to the second logical partition type, and program second collected data into a second current block in the second region in the non-SLC mode, wherein a current block comprises a spare block selected for storing data, wherein the status for the first region meets the condition when an error-correcting rate of the data block is higher than a threshold.