Data writing method, memory controller and memory storage apparatus
First Claim
1. A data writing method for writing page data into a rewritable non-volatile memory module, wherein the rewritable non-volatile memory module has a plurality of physical blocks, and each of the physical blocks has a plurality of physical pages, the data writing method comprising:
- grouping the physical pages into a plurality of physical page groups according to write speed of each of the physical pages by a memory controller, wherein the physical page groups includes a first physical page group and a second physical page group and write speed of writing data into the physical pages belonging to the first physical page group are faster than write speed of writing data into the physical pages belonging to the second physical page group;
compressing the page data to generate compressed data by the memory controller;
calculating a data compression ratio corresponding to the compressed data by the memory controller; and
writing the compressed data into one of the physical pages in a corresponding physical page group among the physical page groups according to the data compression ratio by the memory controller,wherein the step of writing the compressed data into one of the physical pages in the corresponding physical page group among the physical page groups according to the data compression ratio comprises;
generating an error checking and correcting (ECC) code corresponding to the compressed data by the memory controller;
generating an ECC frame according to the compressed data and the ECC code by the memory controller;
determining whether the data compression ratio corresponding to the compressed data is greater than a predetermined threshold by the memory controller;
when the data compression ratio corresponding to the compressed data is greater than the predetermined threshold, writing the ECC frame into one of the physical pages belonging to the second physical page group by the memory controller; and
when the data compression ratio corresponding to the compressed data is not greater than the predetermined threshold, writing the ECC frame into one of the physical pages belonging to the first physical page group by the memory controller.
1 Assignment
0 Petitions
Accused Products
Abstract
A data writing method for writing page data into a rewritable non-volatile memory module is provided, the rewritable non-volatile memory module has a plurality of physical blocks, and each of the physical blocks has a plurality of physical pages. The data writing method includes grouping the physical pages into a plurality of physical page groups according to write speed of each physical page. The data writing method also includes compressing the page data to generate compressed data and calculating a data compression ratio corresponding to the compressed data. The data writing method further includes writing the compressed data into one of the physical pages in a corresponding physical page group among the physical page groups according to the data compression ratio. Accordingly, the data writing method can effectively ensure the accuracy of data stored in the rewritable non-volatile memory module.
-
Citations
16 Claims
-
1. A data writing method for writing page data into a rewritable non-volatile memory module, wherein the rewritable non-volatile memory module has a plurality of physical blocks, and each of the physical blocks has a plurality of physical pages, the data writing method comprising:
-
grouping the physical pages into a plurality of physical page groups according to write speed of each of the physical pages by a memory controller, wherein the physical page groups includes a first physical page group and a second physical page group and write speed of writing data into the physical pages belonging to the first physical page group are faster than write speed of writing data into the physical pages belonging to the second physical page group; compressing the page data to generate compressed data by the memory controller; calculating a data compression ratio corresponding to the compressed data by the memory controller; and writing the compressed data into one of the physical pages in a corresponding physical page group among the physical page groups according to the data compression ratio by the memory controller, wherein the step of writing the compressed data into one of the physical pages in the corresponding physical page group among the physical page groups according to the data compression ratio comprises; generating an error checking and correcting (ECC) code corresponding to the compressed data by the memory controller; generating an ECC frame according to the compressed data and the ECC code by the memory controller; determining whether the data compression ratio corresponding to the compressed data is greater than a predetermined threshold by the memory controller; when the data compression ratio corresponding to the compressed data is greater than the predetermined threshold, writing the ECC frame into one of the physical pages belonging to the second physical page group by the memory controller; and when the data compression ratio corresponding to the compressed data is not greater than the predetermined threshold, writing the ECC frame into one of the physical pages belonging to the first physical page group by the memory controller. - View Dependent Claims (2, 3, 4, 5)
-
-
6. A data writing method for writing page data into a rewritable non-volatile memory module, wherein the rewritable non-volatile memory module has a plurality of physical blocks, each of the physical blocks has a plurality of physical pages, and the physical pages are categorized into a plurality of fast physical pages and a plurality of slow physical pages, the data writing method comprising:
-
grouping the physical blocks into a first physical block group and a second physical block group by a memory controller; compressing the page data to generate compressed data by the memory controller; calculating a data compression ratio corresponding to the compressed data by the memory controller; determining whether the data compression ratio corresponding to the compressed data is greater than a predetermined threshold by the memory controller; when the data compression ratio corresponding to the compressed data is greater than the predetermined threshold, writing the compressed data into a fast physical page or a slow physical page among the physical pages in the physical blocks belonging to the second physical block group by the memory controller; and when the data compression ratio corresponding to the compressed data is not greater than the predetermined threshold, writing the compressed data into a fast physical page among the physical pages in the physical blocks belonging to the first physical block group by the memory controller.
-
-
7. A memory controller for writing page data from a host system into a rewritable non-volatile memory module, wherein the rewritable non-volatile memory module has a plurality of physical blocks, and each of the physical blocks has a plurality of physical pages, the memory controller comprising:
-
a host interface, configured to couple to the host system; a memory interface, configured to couple to the rewritable non-volatile memory module; a data compression/decompression circuit, coupled to the host interface and configured to compress the page data to generate compressed data and calculate a data compression ratio corresponding to the compressed data; a memory management circuit, coupled to the data compression/decompression circuit; and an ECC circuit coupled to the memory management circuit and configured to generate an ECC code corresponding to the compressed data; wherein the memory management circuit is configured to group the physical pages into a plurality of physical page groups according to write speed of each of the physical pages, wherein the physical page groups includes a first physical page group and a second physical page group and write speed of writing data into the physical pages belonging to the first physical page group are faster than write speed of writing data into the physical pages belonging to the second physical page group, wherein the memory management circuit generates an ECC frame according to the compressed data and the ECC code and determines whether the data compression ratio corresponding to the compressed data is greater than a predetermined threshold, when the data compression ratio corresponding to the compressed data is greater than the predetermined threshold, the memory management circuit writes the ECC frame into one of the physical pages belonging to the second physical page group, and when the data compression ratio corresponding to the compressed data is not greater than the predetermined threshold, the memory management circuit writes the ECC frame into one of the physical pages belonging to the first physical page group. - View Dependent Claims (8, 9, 10, 11)
-
-
12. A memory storage apparatus, comprising:
-
a connector, configured to couple to a host system; a rewritable non-volatile memory module, having a plurality of physical blocks, wherein each of the physical blocks has a plurality of physical pages; and a memory controller, coupled to the connector and the rewritable non-volatile memory module, wherein the memory controller is configured to receive page data from the host system, wherein the memory controller is further configured to compress the page data to generate compressed data and calculate a data compression ratio corresponding to the compressed data, wherein the memory controller is further to group the physical pages into a plurality of physical page groups according to write speed of each of the physical pages, wherein the physical page groups includes a first physical page group and a second physical page group and write speed of writing data into the physical pages belonging to the first physical page group are faster than write speed of writing data into the physical pages belonging to the second physical page group, wherein the memory controller generates an ECC code corresponding to the compressed data, wherein the memory controller generates an ECC frame according to the compressed data and the ECC code and determines whether the data compression ratio corresponding to the compressed data is greater than a predetermined threshold, when the data compression ratio corresponding to the compressed data is greater than the predetermined threshold, the memory controller writes the ECC frame into one of the physical pages belonging to the second physical page group, and when the data compression ratio corresponding to the compressed data is not greater than the predetermined threshold, the memory controller writes the ECC frame into one of the physical pages belonging to the first physical page group. - View Dependent Claims (13, 14, 15, 16)
-
Specification