# US 2018/0024738 A1 · Data reading method, data writing method and storage controller using the same

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2018/0024738 A1
- Document ID: US20180024738A1
- Status: Published application
- Kind: A1
- Application number: 15/264,603
- Filed: 2016-09-14
- Published: 2018-01-25
- Earliest claimed: 2016-07-22
- Assignees: EpoStar Electronics Corp.
- Applicants: EpoStar Electronics Corp.
- Inventors: Di-Hsien Ngu
- Web page: https://patentgrep.com/patent/US20180024738A1

## CPC

- G06F 3/061: {Improving I/O performance}
- G06F 3/064: {Management of blocks}
- G06F 3/0659: {Command handling arrangements, e.g. command buffers, queues, command scheduling}
- G06F 3/0665: {at area level, e.g. provisioning of virtual or logical volumes}
- G06F 3/0679: {Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]}
- G06F 12/0246: {in block erasable memory, e.g. flash memory}
- G06F 2212/1016: Performance improvement
- G06F 2212/152: Virtualized environment, e.g. logically partitioned system
- G06F 2212/214: Solid state disk
- G06F 2212/7202: Allocation control and policies
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A data reading method is provided. The method includes receiving a read command from a host system, wherein the read command includes a starting logical block address, a number of logical blocks, a first physical region page pointer, and a second physical region page pointer, and the read command is configured to read target data from at least one target logical block of a rewritable non-volatile memory module and write the read target data into at least one target memory page of a host memory; obtaining an address of each of the target memory pages respectively corresponding to the at least one target logical block according to the read command; and selecting a first target logical block from the at least one target logical block, and writing the read first target data into a first target memory page according to the obtained address of the first target memory page.

## Claims

### Claim 1

A data reading method, suitable for reading data from a rewritable non-volatile memory module into a host memory of a host system, wherein the rewritable non-volatile memory module is assigned with a plurality of logical blocks, the host memory has a plurality of memory pages, and the data reading method comprises:
receiving a read command from the host system, wherein the read command comprises a starting logical block address, a number of logical blocks, a first physical region page pointer, and a second physical region page pointer, wherein the read command is configured to read target data from at least one target logical block of the rewritable non-volatile memory module and write the read target data into at least one target memory page of the host memory, wherein the target data is stored starting from a starting logical block in the at least one target logical block, wherein the starting logical block address is configured to indicate an address of the starting logical block, the number of logical blocks is configured to indicate a number of the logical blocks storing the target data in the at least one target logical block, the first physical region page pointer is configured to indicate a first memory page address of the host memory, and the second physical region page pointer is configured to indicate a second memory page address of the host memory;
obtaining an address of each of the target memory pages respectively corresponding to the at least one target logical block according to the starting logical block address, the number of logical blocks, the first physical region page pointer, and the second physical region page pointer; and
selecting a first target logical block from the at least one target logical block, reading first target data stored by the first target logical block, and writing the read first target data into a first target memory page according to the obtained address of the first target memory page corresponding to the first target logical block.

### Claim 2 (depends on 1)

The data reading method according to claim 1, wherein the step of selecting the first target logical block from the at least one target logical block comprises:
determining whether each target logical block among the at least one target logical block is in a readiness state, and selecting one target logical block in the readiness state from the at least one target logical block to be the first target logical block, wherein the readiness state is configured to indicate that the logical block in the readiness state is ready to be transferred.

### Claim 3 (depends on 1)

The data reading method according to claim 1, wherein the step of obtaining the address of each of the target memory pages respectively corresponding to the at least one target logical block according to the starting logical block address, the number of logical blocks, the first physical region page pointer, and the second physical region page pointer comprises:
determining whether use of the second physical region page pointer is required according to a size of each of the logical blocks, a size of each of the memory pages, the starting logical block address, the number of logical blocks, and the first physical region page pointer;
obtaining the address of each of the target memory pages respectively corresponding to the at least one target logical block according to the size of each of the logical blocks, the size of each of the memory pages, the starting logical block address, the number of logical blocks, the first physical region page pointer, and the second physical region page pointer if use of the second physical region page pointer is required; and
obtaining the address of each of the target memory pages respectively corresponding to the at least one target logical block according to the size of each of the logical blocks, the size of each of the memory pages, the starting logical block address, the number of logical blocks, and the first physical region page pointer if use of the second physical region page pointer does is not required.

### Claim 4 (depends on 3)

The data reading method according to claim 3, wherein the step of determining whether use of the second physical region page pointer is required according to the size of each of the logical blocks, the size of each of the memory pages, the starting logical block address, the number of logical blocks, and the first physical region page pointer comprises:
calculating a size of the target data according to the size of each of the logical blocks and the number of logical blocks;
determining an ending address of the memory page to which the first memory page address belongs according to the size of each of the memory pages and the first physical region page pointer, and using a space between the ending address and the first memory page address as an initial memory page space; and
determining that use of the second physical region page pointer is required if the size of the target data is greater than a size of the initial memory page space.

### Claim 5 (depends on 4)

The data reading method according to claim 4, wherein the step of obtaining the address of each of the target memory pages respectively corresponding to the at least one target logical block according to the size of each of the logical blocks, the size of each of the memory pages, the starting logical block address, the number of logical blocks, the first physical region page pointer, and the second physical region page pointer if use of the second physical region page pointer is required comprises:
calculating a difference obtained from the size of the target data minus the size of the initial memory page space;
identifying the second memory page address indicated by the second physical region page pointer as a list starting address of a physical region page pointer list if the difference is greater than the size of each of the memory pages, wherein the physical region page pointer list stores a plurality of entries, wherein each entry among the entries records one memory page address; and
determining the address of each of the target memory pages respectively corresponding to the at least one target logical block according to the initial memory page space and the physical region page pointer list.

### Claim 6 (depends on 5)

The data reading method according to claim 5, wherein the step of obtaining the address of each of the target memory pages respectively corresponding to the at least one target logical block according to the size of each of the logical blocks, the size of each of the memory pages, the starting logical block address, the number of logical blocks, the first physical region page pointer, and the second physical region page pointer if use of the second physical region page pointer is required further comprises:
identifying the second memory page address indicated by the second physical region page pointer as a starting address of a remaining memory page if the difference is not greater than the size of each of the memory pages; and
determining the address of each of the target memory pages respectively corresponding to the at least one target logical block according to the initial memory page space and the starting address of the remaining memory page.

### Claim 7

A data writing method, suitable for writing data from a host memory of a host system into a rewritable non-volatile memory module, wherein the rewritable non-volatile memory module is assigned with a plurality of logical blocks, the host memory has a plurality of memory pages, and the data writing method comprises:
receiving a write command from the host system, wherein the write command comprises a starting logical block address, a number of logical blocks, a first physical region page pointer, and a second physical region page pointer, wherein the write command is configured to write target data into at least one target logical block of the rewritable non-volatile memory module, wherein a foremost logical block sorted in the at least one target logical block is a starting logical block, wherein the starting logical block address is configured to indicate an address of the starting logical block, the number of logical blocks is configured to indicate a number of the logical blocks storing the target data in the at least one target logical block, the first physical region page pointer is configured to indicate a first memory page address of the host memory, and the second physical region page pointer is configured to indicate a second memory page address of the host memory, wherein the target data corresponding to the write command is stored in at least one target memory page among the memory pages of the host memory;
obtaining an address of each of the target memory pages respectively corresponding to the at least one target logical block according to the starting logical block address, the number of logical blocks, the first physical region page pointer, and the second physical region page pointer, wherein each of the target memory pages respectively corresponding to the target logical blocks is one of the at least one target memory page; and
selecting a first target logical block from the at least one target logical block, reading first target data according to the obtained address of a first target memory page corresponding to the first target logical block, and writing the read first target data into the first target logical block.

### Claim 8 (depends on 7)

The data writing method according to claim 7, wherein the step of selecting the first target logical block from the at least one target logical block comprises:
determining whether each target logical block among the at least one target logical block is in a readiness state, and selecting one target logical block in the readiness state from the at least one target logical block to be the first target logical block, wherein the readiness state is configured to indicate that the logical block in the readiness state is ready to be transferred.

### Claim 9 (depends on 7)

The data writing method according to claim 7, wherein the step of obtaining the address of each of the target memory pages respectively corresponding to the at least one target logical block according to the starting logical block address, the number of logical blocks, the first physical region page pointer, and the second physical region page pointer comprises:
determining whether use of the second physical region page pointer is required according to a size of each of the logical blocks, a size of each of the memory pages, the starting logical block address, the number of logical blocks, and the first physical region page pointer;
obtaining the address of each of the target memory pages respectively corresponding to the at least one target logical block according to the size of each of the logical blocks, the size of each of the memory pages, the starting logical block address, the number of logical blocks, the first physical region page pointer, and the second physical region page pointer if use of the second physical region page pointer is required; and
obtaining the address of each of the target memory pages respectively corresponding to the at least one target logical block according to the size of each of the logical blocks, the size of each of the memory pages, the starting logical block address, the number of logical blocks, and the first physical region page pointer if use of the second physical region page pointer does is not required.

### Claim 10 (depends on 9)

The data writing method according to claim 9, wherein the step of determining whether use of the second physical region page pointer is required according to the size of each of the logical blocks, the size of each of the memory pages, the starting logical block address, the number of logical blocks, and the first physical region page pointer comprises:
calculating a size of the target data according to the size of each of the logical blocks and the number of logical blocks;
determining an ending address of the memory page to which the first memory page address belongs according to the size of each of the memory pages and the first physical region page pointer, and using a space between the ending address and the first memory page address as an initial memory page space; and
determining that use of the second physical region page pointer is required if the size of the target data is greater than a size of the initial memory page space.

### Claim 11 (depends on 10)

The data writing method according to claim 10, wherein the step of obtaining the address of each of the target memory pages respectively corresponding to the at least one target logical block according to the size of each of the logical blocks, the size of each of the memory pages, the starting logical block address, the number of logical blocks, the first physical region page pointer, and the second physical region page pointer if use of the second physical region page pointer is required comprises:
calculating a difference obtained from the size of the target data minus the size of the initial memory page space;
identifying the second memory page address indicated by the second physical region page pointer as a list starting address of a physical region page pointer list if the difference is greater than the size of each of the memory pages, wherein the physical region page pointer list stores a plurality of entries, wherein each entry among the entries records one memory page address; and
determining the address of each of the target memory pages respectively corresponding to the at least one target logical block according to the initial memory page space and the physical region page pointer list.

### Claim 12 (depends on 11)

The data writing method according to claim 11, wherein the step of obtaining the address of each of the target memory pages respectively corresponding to the at least one target logical block according to the size of each of the logical blocks, the size of each of the memory pages, the starting logical block address, the number of logical blocks, the first physical region page pointer, and the second physical region page pointer if use of the second physical region page pointer is required further comprises:
identifying the second memory page address indicated by the second physical region page pointer as a starting address of a remaining memory page if the difference is not greater than the size of each of the memory pages; and
determining the address of each of the target memory pages respectively corresponding to the at least one target logical block according to the initial memory page space and the starting address of the remaining memory page.

### Claim 13

A storage controller, configured to control a storage device having a rewritable non-volatile memory module, the storage controller comprising:
a connection interface circuit, configured to couple to a host system, wherein the host system has a host memory, wherein the host memory has a plurality of memory pages;
a memory interface control circuit, configured to couple to the rewritable non-volatile memory module, wherein the rewritable non-volatile memory module is assigned with a plurality of logical blocks;
a processor, coupled to the connection interface circuit and the memory interface control circuit; and
a data transfer management circuit, coupled to the processor, the connection interface circuit and the memory interface control circuit,
wherein the processor is configured to receive a read command from the host system, wherein the read command comprises a starting logical block address, a number of logical blocks, a first physical region page pointer, and a second physical region page pointer, wherein the read command is configured to read target data from at least one target logical block of the rewritable non-volatile memory module and write the read target data into at least one target memory page of the host memory, wherein the target data is stored starting from a starting logical block in the at least one target logical block, wherein the starting logical block address is configured to indicate an address of the starting logical block, the number of logical blocks is configured to indicate a number of the logical blocks storing the target data in the at least one target logical block, the first physical region page pointer is configured to indicate a first memory page address of the host memory, and the second physical region page pointer is configured to indicate a second memory page address of the host memory,
wherein the processor is configured to instruct the data transfer management circuit to obtain an address of each of the target memory pages respectively corresponding to the at least one target logical block according to the starting logical block address, the number of logical blocks, the first physical region page pointer, and the second physical region page pointer,
wherein the memory interface control circuit is configured to select a first target logical block from the at least one target logical block, and read first target data stored by the first target logical block,
wherein the data transfer management circuit is configured to write the read first target data into a first target memory page according to the obtained address of the first target memory page corresponding to the first target logical block.

### Claim 14 (depends on 13)

The storage controller according to claim 13, wherein in the operation where the memory interface control circuit is configured to select the first target logical block from the at least one target logical block,
the memory interface control circuit determines whether each target logical block among the at least one target logical block is in a readiness state, and selects one target logical block in the readiness state from the at least one target logical block to be the first target logical block, wherein the readiness state is configured to indicate that the logical block in the readiness state is ready to be transferred.

### Claim 15 (depends on 13)

The storage controller according to claim 13, wherein in the operation where the data transfer management circuit obtains the address of each of the target memory pages respectively corresponding to the at least one target logical block according to the starting logical block address, the number of logical blocks, the first physical region page pointer, and the second physical region page pointer,
the data transfer management circuit determines whether use of the second physical region page pointer is required according to a size of each of the logical blocks, a size of each of the memory pages, the starting logical block address, the number of logical blocks, and the first physical region page pointer,
wherein the data transfer management circuit obtains the address of each of the target memory pages respectively corresponding to the at least one target logical block according to the size of each of the logical blocks, the size of each of the memory pages, the starting logical block address, the number of logical blocks, the first physical region page pointer, and the second physical region page pointer if use of the second physical region page pointer is required,
wherein the data transfer management circuit obtains the address of each of the target memory pages respectively corresponding to the at least one target logical block according to the size of each of the logical blocks, the size of each of the memory pages, the starting logical block address, the number of logical blocks, and the first physical region page pointer if use of the second physical region page pointer does is not required.

### Claim 16 (depends on 15)

The storage controller according to claim 15, wherein in the operation where the data transfer management circuit determines whether use of the second physical region page pointer is required according to the size of each of the logical blocks, the size of each of the memory pages, the starting logical block address, the number of logical blocks, and the first physical region page pointer,
the data transfer management circuit calculates a size of the target data according to the size of each of the logical blocks and the number of logical blocks,
wherein the data transfer management circuit determines an ending address of the memory page to which the first memory page address belongs according to the size of each of the memory pages and the first physical region page pointer, and uses a space between the ending address and the first memory page address as an initial memory page space,
wherein the data transfer management circuit determines that use of the second physical region page pointer is required if the size of the target data is greater than a size of the initial memory page space.

### Claim 17 (depends on 16)

The storage controller according to claim 16, wherein in the operation where the data transfer management circuit obtains the address of each of the target memory pages respectively corresponding to the at least one target logical block according to the size of each of the logical blocks, the size of each of the memory pages, the starting logical block address, the number of logical blocks, the first physical region page pointer, and the second physical region page pointer if use of the second physical region page pointer is required,
the data transfer management circuit calculates a difference obtained from the size of the target data minus the size of the initial memory page space,
wherein the data transfer management circuit identifies the second memory page address indicated by the second physical region page pointer as a list starting address of a physical region page pointer list if the difference is greater than the size of each of the memory pages, wherein the physical region page pointer list stores a plurality of entries, wherein each entry among the entries records one memory page address,
wherein the data transfer management circuit determines the address of each of the target memory pages respectively corresponding to the at least one target logical block according to the initial memory page space and the physical region page pointer list.

### Claim 18 (depends on 17)

The storage controller according to claim 17, wherein in the operation of obtaining the address of each of the target memory pages respectively corresponding to the at least one target logical block according to the size of each of the logical blocks, the size of each of the memory pages, the starting logical block address, the number of logical blocks, the first physical region page pointer, and the second physical region page pointer if use of the second physical region page pointer is required,
the data transfer management circuit identifies the second memory page address indicated by the second physical region page pointer as a starting address of a remaining memory page if the difference is not greater than the size of each of the memory pages,
wherein the data transfer management circuit determines the address of each of the target memory pages respectively corresponding to the at least one target logical block according to the initial memory page space and the starting address of the remaining memory page.

### Claim 19

A storage controller, configured to control a storage device having a rewritable non-volatile memory module, the storage controller comprising:
a connection interface circuit, configured to couple to a host system, wherein the host system has a host memory, wherein the host memory has a plurality of memory pages;
a memory interface control circuit, configured to couple to the rewritable non-volatile memory module, wherein the rewritable non-volatile memory module is assigned with a plurality of logical blocks;
a processor, coupled to the connection interface circuit and the memory interface control circuit; and
a data transfer management circuit, coupled to the processor, the connection interface circuit and the memory interface control circuit,
wherein the processor is configured to receive a write command from the host system, wherein the write command comprises a starting logical block address, a number of logical blocks, a first physical region page pointer, and a second physical region page pointer, wherein the write command is configured to write target data into at least one target logical block of the rewritable non-volatile memory module, wherein a foremost logical block sorted in the at least one target logical block is a starting logical block, wherein the starting logical block address is configured to indicate an address of the starting logical block, the number of logical blocks is configured to indicate a number of the logical blocks storing the target data in the at least one target logical block, the first physical region page pointer is configured to indicate a first memory page address of the host memory, and the second physical region page pointer is configured to indicate a second memory page address of the host memory, wherein the target data corresponding to the write command is stored in at least one target memory page among the memory pages of the host memory,
wherein the processor is configured to instruct the data transfer management circuit to obtain an address of each of the target memory pages respectively corresponding to the at least one target logical block according to the starting logical block address, the number of logical blocks, the first physical region page pointer, and the second physical region page pointer, wherein each of the target memory pages respectively corresponding to the target logical blocks is one of the at least one target memory page,
wherein the memory interface control circuit is configured to select a first target logical block from the at least one target logical block,
wherein the data transfer management circuit is configured to read first target data according to the obtained address of a first target memory page corresponding to the first target logical block, and the memory interface control circuit is further configured to write the read first target data into the first target logical block.

### Claim 20 (depends on 19)

The storage controller according to claim 19, wherein in the operation where the memory interface control circuit is configured to select the first target logical block from the at least one target logical block,
the memory interface control circuit determines whether each target logical block among the at least one target logical block is in a readiness state, and selects one target logical block in the readiness state from the at least one target logical block to be the first target logical block, wherein the readiness state is configured to indicate that the logical block in the readiness state is ready to be transferred.

### Claim 21 (depends on 19)

The storage controller according to claim 19, wherein in the operation where the data transfer management circuit obtains the address of each of the target memory pages respectively corresponding to the at least one target logical block according to the starting logical block address, the number of logical blocks, the first physical region page pointer, and the second physical region page pointer,
the data transfer management circuit determines whether use of the second physical region page pointer is required according to a size of each of the logical blocks, a size of each of the memory pages, the starting logical block address, the number of logical blocks, and the first physical region page pointer,
wherein the data transfer management circuit obtains the address of each of the target memory pages respectively corresponding to the at least one target logical block according to the size of each of the logical blocks, the size of each of the memory pages, the starting logical block address, the number of logical blocks, the first physical region page pointer, and the second physical region page pointer if use of the second physical region page pointer is required,
wherein the data transfer management circuit obtains the address of each of the target memory pages respectively corresponding to the at least one target logical block according to the size of each of the logical blocks, the size of each of the memory pages, the starting logical block address, the number of logical blocks, and the first physical region page pointer if use of the second physical region page pointer does is not required.

### Claim 22 (depends on 21)

The storage controller according to claim 21, wherein in the operation where the data transfer management circuit determines whether use of the second physical region page pointer is required according to the size of each of the logical blocks, the size of each of the memory pages, the starting logical block address, the number of logical blocks, and the first physical region page pointer,
the data transfer management circuit calculates a size of the target data according to the size of each of the logical blocks and the number of logical blocks,
wherein the data transfer management circuit determines an ending address of the memory page to which the first memory page address belongs according to the size of each of the memory pages and the first physical region page pointer, and uses a space between the ending address and the first memory page address as an initial memory page space,
wherein the data transfer management circuit determines that use of the second physical region page pointer is required if the size of the target data is greater than a size of the initial memory page space.

### Claim 23 (depends on 22)

The storage controller according to claim 22, wherein in the operation where the data transfer management circuit obtains the address of each of the target memory pages respectively corresponding to the at least one target logical block according to the size of each of the logical blocks, the size of each of the memory pages, the starting logical block address, the number of logical blocks, the first physical region page pointer, and the second physical region page pointer if use of the second physical region page pointer is required,
the data transfer management circuit calculates a difference obtained from the size of the target data minus the size of the initial memory page space,
wherein the data transfer management circuit identifies the second memory page address indicated by the second physical region page pointer as a list starting address of a physical region page pointer list if the difference is greater than the size of each of the memory pages, wherein the physical region page pointer list stores a plurality of entries, wherein each entry among the entries records one memory page address,
wherein the data transfer management circuit determines the address of each of the target memory pages respectively corresponding to the at least one target logical block according to the initial memory page space and the physical region page pointer list.

### Claim 24 (depends on 23)

The storage controller according to claim 23, wherein in the operation where the data transfer management circuit obtains the address of each of the target memory pages respectively corresponding to the at least one target logical block according to the size of each of the logical blocks, the size of each of the memory pages, the starting logical block address, the number of logical blocks, the first physical region page pointer, and the second physical region page pointer if use of the second physical region page pointer is required,
the data transfer management circuit identifies the second memory page address indicated by the second physical region page pointer as a starting address of a remaining memory page if the difference is not greater than the size of each of the memory pages,
wherein the data transfer management circuit determines the address of each of the target memory pages respectively corresponding to the at least one target logical block according to the initial memory page space and the starting address of the remaining memory page.
