Flash memory controller, storage device and address mapping method of flash memory controller

Through address mapping technology of multiple levels, the mapping relationship between logical addresses and entity addresses is divided into multiple parts, solving the problem of insufficient built-in buffer space in traditional flash memory controllers, and supporting larger capacity memory address space Efficient access operations.

CN118939584APending Publication Date: 2024-11-12SILICON MOTION INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410020389.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2023-05-10
Filing Date
2024-01-05
Publication Date
2024-11-12

AI Technical Summary

Technical Problem

Traditional flash memory controllers lack built-in buffer cache space and cannot support physical memory address space of more than 4TB, limiting the capacity of address mapping.

Method used

Using multiple levels of address mapping technology, the mapping relationship between logical addresses and entity addresses is divided into multiple parts, partly stored in the cache space of the flash memory controller, partly stored in the flash memory, and the address is realized through the processing circuit. dynamic mapping and updates.

Benefits of technology

It realizes support for a larger capacity memory address space, improves the efficiency and capacity of access operations, reduces circuit costs, and maintains high efficiency of access operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118939584A_ABST
    Figure CN118939584A_ABST
Patent Text Reader

Abstract

The invention relates to a flash memory controller, a storage device and an address mapping method of the flash memory controller. The flash memory controller includes a specific buffer and a processing circuit. The cache space of the specific buffer is used for caching the data of the temporary flash memory. The processing circuit reads and loads a corresponding address index mapping table into the cache space from the flash memory according to address content connected with a specific address index corresponding to a specific host address, and determines a specific address index from the corresponding address index mapping table according to the specific host address. And reading the specific address index from the flash memory according to the address content of the specific address index, loading a corresponding address mapping table into the cache space, and finding a specific flash memory address from the corresponding address mapping table so as to execute an access operation according to the found specific flash memory address.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a flash memory control mechanism, and more particularly to a flash memory controller, a storage device and an address mapping method of the flash memory controller. Background Art

[0002] Generally speaking, the traditional method is to place all mapping relationships of logical addresses to physical addresses in a buffer cache space that is permanently stored in a flash memory controller. For users, although this method allows users to quickly find and update the physical address of any logical address from the cache space when they want to read / write, it is inevitable that the traditional method is limited by the size of the buffer cache space. Due to the current circuit cost, the buffer cache space cannot be greatly expanded, so only address mapping relationships of limited size can be placed. Due to insufficient built-in cache space and firmware design architecture considerations, current address mapping can only support a physical memory address space of up to 4TB in size, and cannot support a physical memory address space of larger capacity, such as 8TB, 16TB or larger capacity. Summary of the invention

[0003] Therefore, one of the objectives of the present invention is to provide a flash memory controller, an address mapping method used in the flash memory controller, and a storage device to solve the above-mentioned problem.

[0004] According to an embodiment of the present invention, a flash memory controller is disclosed. The flash memory controller is coupled between a host device and a flash memory and includes a specific buffer and a processing circuit. The specific buffer is used to configure a cache space to cache and temporarily store data stored in the flash memory externally coupled to the flash memory controller. The processing circuit is coupled to the specific buffer and is used to receive a specific host address from the host device, read out and load a corresponding address pointer mapping table from the flash memory according to the address content pointed to by a specific address pointer link corresponding to the specific host address into the cache space of the specific buffer, then determine a specific address pointer corresponding to the specific host address from the corresponding address pointer mapping table according to the specific host address, then read out and load a corresponding address mapping table from the flash memory according to the address content pointed to by the specific address pointer into the cache space of the specific buffer, and then find a specific flash memory address from the corresponding address mapping table according to the specific host address to perform an access operation according to the found specific flash memory address.

[0005] According to an embodiment of the present invention, an address mapping method for a flash memory controller is disclosed. The flash memory controller is coupled between a host device and a flash memory. The address mapping method includes: providing a specific buffer to configure a cache space to cache and temporarily store data stored in the flash memory externally coupled to the flash memory controller; providing a processing circuit coupled to the specific buffer; using the processing circuit to receive a specific host address from the host device; and linking the address pointed to by a specific address pointer corresponding to the specific host address. The content is read out from the flash memory and loaded into a corresponding address pointer mapping table into the cache space of the specific buffer; a specific address pointer corresponding to the specific host address is determined from the corresponding address pointer mapping table according to the specific host address; the content of the address pointed to by the specific address pointer is read out from the flash memory and loaded into a corresponding address mapping table into the cache space of the specific buffer; and a specific flash memory address is found from the corresponding address mapping table according to the specific host address to perform an access operation according to the found specific flash memory address.

[0006] According to an embodiment of the present invention, a storage device is disclosed. The storage device is coupled to a host device. The storage device includes a flash memory and a flash memory controller. The flash memory controller is coupled between the host device and the flash memory and includes a time sharing buffer and a processing circuit. The time sharing buffer is used to configure a cache space to cache and temporarily store data stored in the flash memory. The processing circuit is coupled to the time-sharing buffer, and is used to receive a specific host address from the host device, read out from the flash memory and load a corresponding address pointer mapping table into the cache space of the time-sharing buffer according to the address content pointed to by a specific address pointer link corresponding to the specific host address, then determine a specific address pointer corresponding to the specific host address from the corresponding address pointer mapping table according to the specific host address, then read out from the flash memory and load a corresponding address mapping table into the cache space of the time-sharing buffer according to the address content pointed to by the specific address pointer, and then find a specific flash memory address from the corresponding address mapping table according to the specific host address to perform a read operation according to the found specific flash memory address. BRIEF DESCRIPTION OF THE DRAWINGS

[0007] Figure 1 is a block diagram of a storage device according to an embodiment of the present invention.

[0008] Figure 2 FIG. 4 is a schematic diagram of a two-level address mapping operation of a flash memory controller according to an embodiment of the present invention.

[0009] Figure 3 FIG. 4 is a flow chart of a flash memory controller mapping a host address to a flash memory address through a two-level address mapping operation according to an embodiment of the present invention.

[0010]

Explanation of symbols

[0011] 100: Storage device

[0012] 101: Host device

[0013] 105: Flash memory controller

[0014] 110: Flash memory

[0015] 1051: Processing circuit

[0016] 1052: Time-sharing buffer

[0017] 205PL:H2F address pointer link mapping table

[0018] 210A, 210B: H2F address indicator mapping table DETAILED DESCRIPTION

[0019] The present invention aims to provide a technical solution for address mapping conversion of a storage device or a flash memory controller, which expands a single-level logical-physical address mapping relationship to at least two levels of address mapping relationships, equivalently, divides all address mapping relationships into several portions or segments through at least two levels of address mapping relationships, caches the address mapping relationships to be used in the flash memory controller and stores the unused address mapping relationships in the flash memory, correctly reads and loads the address mapping relationships to be used into a cache space (such as a static random access memory with a faster access speed; but not limited to) built into a flash memory controller, thereby converting a host address into a flash memory address. A host address is a host-to-flash address mapping relationship. A host address may be referred to as a logical address, and a flash memory address may be referred to as a physical address.

[0020] The present invention uses at least two levels of address mapping technology to enable a storage device to have a larger memory capacity and only increase the partial flash memory read time when reading and loading the address mapping relationship. Therefore, the ideal state of not slowing down the operation rate of access operations or disk tests (such as disk benchmark testing tools CDM (Crystal Disk Mark)) can be achieved, and the effect of supporting a larger memory capacity can be achieved.

[0021] In comparison, the traditional method is to place all H2F address mapping relationships and store them in a flash memory controller. For users, although this method allows users to quickly find the physical address of any logical address to be read / written, the disadvantage is that the traditional method is limited by the internal storage capacity of the flash memory controller because the circuit cost cannot be greatly expanded, and only a limited size of address mapping relationships can be placed. Because the built-in storage space of the flash memory controller is insufficient and the firmware design architecture and other considerations, it can generally only support a physical memory address space of up to 4TB (Terabyte, abbreviated as TB, indicating that the unit is megabyte). On the contrary, if the conversion technology solution of address mapping of multiple levels (such as conversion of 2 levels or more than 2 levels, but not limited) provided by the present invention is used, the problems of the traditional technology can be effectively solved, and a larger capacity of physical memory address space, such as 8TB, 16TB or larger capacity, can be supported.

[0022] Figure 1 FIG. 1 is a block diagram of a storage device 100 based on a flash memory according to an embodiment of the present invention. Figure 1As shown, the storage device 100 includes a flash memory controller 105 and a flash memory 110, wherein the flash memory 110 includes, for example, one or more flash memory chips, and the storage device 100 is externally coupled to, for example, a host device 101, and the flash memory controller 105 is coupled to the flash memory 110 and is used to control access to the flash memory 110 according to, for example, an access command sent by the host device 101. In addition, the flash memory controller 105 includes a processing circuit 1051 and a specific buffer 1052, such as a time sharing buffer (TSB), and the time sharing buffer 1052 is, for example, a static random access memory or a cache memory built in or configured in the flash memory controller 105, so as to configure a cache space to cache and temporarily store data stored in the flash memory 110 externally coupled to the flash memory controller 105. The processing circuit 1051 includes, for example, a processor (single core or multi-core) and other hardware circuits (eg, an input / output circuit coupled to output data to the flash memory 110 or receive information from the flash memory 110) or firmware circuits, etc.

[0023] The flash memory controller 105 of the present invention uses a multi-level (e.g., 2 levels or more) address mapping technology to perform the mapping conversion of a logical address to a physical address. In one embodiment of the present invention, for performing the address mapping conversion of a logical address to a physical address, the 2-level address mapping technology is, for example, that the flash memory controller 105 (or the processing circuit 1051) first receives a specific host address (i.e., a logical address) from the host device 101, reads out and loads a corresponding address pointer mapping table from the flash memory 110 according to the address content pointed to by a specific address pointer linker corresponding to the specific host address into the cache space of the time-shared buffer 1052, then determines a specific address pointer corresponding to the specific host address from the corresponding address pointer mapping table according to the specific host address, then reads out and loads a corresponding address mapping table from the flash memory 110 according to the address content pointed to by the specific address pointer linker into the cache space of the time-shared buffer 1052, table) to the cache space of the time-shared buffer 1052, and then find a specific flash memory address from the corresponding address mapping table according to the specific host address to perform an access operation according to the found specific flash memory address. An address pointer link is also an H2F address pointer link, and an address pointer is also an H2F address pointer. In other words, the flash memory controller 105 (or the processing circuit 1051) first finds an H2F address pointer link (H2F address pointer linker) from an H2F address pointer link mapping table, then points to an H2F address pointer mapping table according to the found H2F address pointer link, then finds an H2F address pointer from the H2F address pointer mapping table, then points to an H2F address mapping table according to the found H2F address pointer, and finally finds a corresponding physical address from the H2F address mapping table. The H2F address pointer link mapping table includes, for example, N H2F address pointer links, such as 32 H2F ​​address pointer links, which can be permanently stored in the cache space of the time-sharing buffer 1052 because the data volume occupied is extremely small (for example, 32 H2F ​​address pointer links may only occupy 128 bytes of data). The N address pointer links can correspond to and map to N equal segments or N portions of a memory space (or a maximum memory space) that can be configured by the flash memory 110.

[0024] In other words, in order to simplify the circuit cost requirements of the time-sharing buffer 1052, the flash memory controller 105 (or the processing circuit 1051) can cache only a portion or an equal portion of the H2F address pointer to the cache space configured by the time-sharing buffer 1052, while the other portions or other equal portions of the H2F address pointer are stored in the flash memory 110. If the H2F address pointer corresponding to the host address cannot be found in the cache space, the flash memory controller 105 will read out and load the other portions or other equal portions of the H2F address pointer from the flash memory 110. In other words, by permanently storing N H2F address pointer links instead of storing all H2F address pointers, the flash memory controller 105 only needs to read and load the content of the H2F address pointer mapping table pointed to from the flash memory 110 according to a physical address pointed to by the found H2F address pointer link, and then read and load the content of the H2F address mapping table pointed to from the flash memory 110 according to another physical address pointed to by the H2F address pointer found in the H2F address pointer mapping table to determine a physical address from the H2F address mapping table.

[0025] In addition, the flash memory controller 105 may also periodically or irregularly update the content of the H2F address pointer of a portion of the cached data in the cache space of the time-shared buffer 1052 to improve the overall data access performance.

[0026] Through the above-mentioned two-level address mapping operation, the flash memory controller 105 of the present invention can dynamically respond to the needs of different customers or users to set the size of the cache space configured by the time shared buffer 1052, set the size of a physical address memory space required corresponding to an H2F address pointer mapping table, and set the size of a physical address memory space required corresponding to an H2F address mapping table, so as to meet actual needs and minimize or reduce the size of the cache space used to reduce circuit costs.

[0027] For example (but not limited to), assume that one or each H2F address pointer stores, points to or indicates a physical address of a corresponding H2F address mapping table by using a 4B data size (the suffix "B" indicates that the unit is one byte, which is 4 bytes in this example), and if the storage space required for a planned H2F address pointer mapping table is 128KB (Kilobyte, abbreviated as KB, indicating that the unit is kilobytes), then a H2F address pointer mapping table may include a total of 128KB divided by 4B = 32K H2F address pointers. If a H2F address mapping table corresponding to an H2F address pointer can be mapped to a data storage space of 128MB (Megabyte, abbreviated as MB, indicating that the unit is one million bytes), then 32K H2F address pointers * 128MB = 4TB, which can map a data size of 4TB. In a single-level implementation, when the contents of all 32K H2F address pointers in the H2F address pointer mapping table are cached in the cache space, the time-shared buffer 1052 will allocate the required storage space of 128KB, and the flash memory controller 105 (or the processing circuit 1051) can directly find the address of an H2F address mapping table corresponding to an H2F address pointer from the cached H2F address pointer mapping table, and read and load the contents of the H2F address mapping table from the flash memory 110 according to the address to find a flash memory address therefrom. In an embodiment with more than two levels, the flash memory controller 105 (or the processing circuit 1051) can support address mapping of a flash memory space larger than 4TB through the above-mentioned H2F address pointer connection.

[0028] In addition, in one embodiment, under the condition of supporting the same flash memory space size (for example, a flash memory space size of 4TB), the flash memory controller 105 (or the processing circuit 1051) may also enlarge the total number of H2F address indicators, for example, enlarge the total number of 32K H2F address indicators to twice, that is, 64K H2F address indicators, so as to reduce the size of a storage space required for an H2F address mapping table used to store all H2F addresses to half, for example, from the above-mentioned 128MB to 64MB. In this case, the storage space required for an H2F address pointer mapping table for storing 64K H2F address pointers will also be doubled from, for example, 128KB to 2 times, that is, 64K*4B=256KB. In this embodiment, if the time-sharing buffer 1052 allows the configuration of a 256KB cache space, the contents of the 64K H2F address pointers can be cached in the cache space at the same time. Conversely, if the time-sharing buffer 1052 only allows the configuration of a 128KB storage space, another static random access memory can also be used to implement a 256KB memory space, or the time-sharing buffer 1052 and the static random access memory can both be used to store part of the contents of the H2F address pointers.

[0029] In the embodiment of the present invention, if the flash memory controller 105 (or the processing circuit 1051) needs to support a flash memory space with a relatively large storage capacity (for example, a flash memory space size of 8TB or more than 16TB), the flash memory controller 105 (or the processing circuit 1051) can reduce the size of a storage space required for an H2F address mapping table for storing multiple H2F addresses to half, for example, from 128MB to 64MB, and with such a design configuration, a design in which an H2F address pointer mapping table includes 128K H2F address pointers is adopted. That is, in this case, to cache the contents of an H2F address pointer mapping table, a memory space size of 512KB (128K*4B=512KB) may be required to be able to simultaneously reside in the 128K H2F address pointers. However, in addition to being configured to cache the contents of the H2F address pointers, the cache space of the time-shared buffer 1052 may also be used to temporarily store certain variable information, such as the read / write buffer (R / W Therefore, in one embodiment, if the cache space of the time-shared buffer 1052 cannot be configured with a memory space size of 512KB to cache the data content of the 128K H2F address pointers, the flash memory controller 105 (or the processing circuit 1051) can adopt the above-mentioned two-level address mapping technology to maintain the system access read and write performance without slowing down under the condition of reducing circuit cost. In other words, when the cache space of the time-shared buffer or the memory space size of the static random access memory of the flash memory device under a certain flash memory specification cannot support sufficient memory space, the two-level (or more than two-level) address mapping conversion technology of the present invention can be adopted to achieve the performance of maintaining the system access without slowing down under the condition of reducing circuit cost.

[0030] In one embodiment, for example, a flash memory space size supporting 16TB flash memory storage space (i.e., 16384GB, GB is the abbreviation of Gigabyte, indicating that the unit is gigabyte or billion bytes) is configured. In view that all H2F address contents of an H2F address mapping table can be mapped to a 64MB physical address memory space, a total of 16384GB divided by 64MB=256K H2F address mapping tables are required to indicate the physical address mapping relationship of 16384GB, and the physical address of each H2F address mapping table is pointed to by a corresponding H2F address pointer. A corresponding H2F address pointer requires a 4B memory space size, so a total of 256K tables*4B size=1024KB memory space size is required to fully store and place the content information of all H2F address pointers at the same time.Assume (but not limited to) that the total memory space size of the time shared buffer 1052 that the flash memory controller 105 (or the processing circuit 1051) can use is only 1024KB=1MB and the total memory space size of the time shared buffer 1052 is not all used to store the content information of all H2F address pointers at the same time. For example (but not limited to), the time shared buffer 1052 can only configure a 512KB memory space as its cache space at most at the same time to allow the firmware of the flash memory controller 105 (or the processing circuit 1051) to store the H2F address pointers. In this case, the contents of all H2F address pointers cannot be cached in the cache space of the time-sharing buffer 1052 at the same time. In this case, the flash memory controller 105 (or the processing circuit 1051) is equivalent to splitting a memory space (e.g., 16TB size) that can be configured by the flash memory 110 under the current specifications into several parts (portions) or equal parts (segments) and managing them, for example, splitting into N equal parts, N can be a multiple of 2 (but not limited to), N can be equal to (but not limited to) 32, the N equal parts correspond to the N H2F address pointer links in an H2F address pointer link mapping table, each equal part represents a corresponding memory space of a physical address of 16384GB divided by N, that is, a memory space of a physical address of 16384GB / 32=512GB, and each equal part corresponds to a different H2F address pointer link. The flash memory controller 105 (or the processing circuit 1051) temporarily stores the N H2F address pointer links in the cache space that can be configured by the time-sharing buffer 1052. When it is determined that When a specific H2F address pointer corresponding to a host address is linked, the flash memory controller 105 (or the processing circuit 1051) reads the content of an H2F address pointer mapping table corresponding to the specific H2F address pointer link from the flash memory 110 and loads it into the cache space of the time shared buffer 1052. At this time, the content of multiple H2F address pointers included in the loaded H2F address pointer mapping table will occupy a size of 1024KB*4B / 32=128KB and can be cached and temporarily stored in the cache space of the time shared buffer 1052 at the same time.

[0031] That is, the flash memory controller 105 (or the processing circuit 1051) uses an H2F address pointer link to store and point to a physical address space that is divided into equal parts. For example (but not limited to), the flash memory controller 105 (or the processing circuit 1051) can divide the largest cache memory space that can be configured into 32 equal parts, each of which represents a corresponding memory space with a physical address of 16384GB / 32=512GB, and each of which corresponds to an H2F address pointer link. For example, a first H2F address pointer link PL_0 represents a memory space range of 0 to 512GB, a second H2F address pointer link PL_1 represents a range of 512GB to 1024GB, and so on.

[0032] Please refer to Figure 2 , Figure 2 FIG. 1 is a schematic diagram of a 2-layer address mapping operation of a flash memory controller 105 (or a processing circuit 1051) according to an embodiment of the present invention. Figure 2 As shown, an H2F address pointer link mapping table 205PL includes a plurality of H2F address pointer links PL_0-PL_N, where N is equal to 31, for example, to indicate that there are 32 H2F ​​address pointer links in total. Each H2F address pointer link PL_0-PL_N points to a different H2F address pointer mapping table, for example, Figure 2 In the figure, a first H2F address pointer link PL_0 points to an H2F address pointer mapping table 210A, and a second H2F address pointer link PL_1 points to another different H2F address pointer mapping table 210B. If the storage memory space of the flash memory 110 requires a total of 256K address mapping tables (that is, a total of 256K address pointers are required to point to these address mapping tables respectively), then one H2F address pointer link can correspond to 256K divided by 32=8K address pointers. Therefore, an H2F address pointer mapping table pointed to by an H2F address pointer link will include 8K address pointers, and the 8K address pointers will point to 8K different address mapping tables respectively.

[0033] In order to make the reader more aware of the spirit of the present invention, please refer to Figure 3 , Figure 3 1 is a flow chart of a flash memory controller 105 (or processing circuit 1051 ) mapping a host address to a flash memory address through a two-level address mapping operation according to an embodiment of the present invention; the steps are described as follows.

[0034] Step S305: start;

[0035] Step S307: Initially, the cache space of the time-shared buffer 1052 of the flash memory controller 105 only caches N H2F address pointer links, but does not temporarily store the address pointer mapping table and does not temporarily store the address mapping table;

[0036] Step S310: The flash memory controller 105 receives a host address (ie, a logical address);

[0037] Step S315: The flash memory controller 105 determines whether a H2F address pointer mapping table pointed to by a H2F address pointer link corresponding to the host address has been cached and temporarily stored in the cache space of the flash memory controller 105 according to the address content of the host address; if the corresponding H2F address pointer mapping table has been cached and temporarily stored in the cache space, step S320A is performed; otherwise, if the corresponding H2F address pointer mapping table has not been cached and temporarily stored in the cache space, step S320B is performed;

[0038] Step S320A: The flash memory controller 105 determines an H2F address pointer from the H2F address pointer mapping table according to the content of the H2F address pointer mapping table that has been cached;

[0039] Step S320B: the flash memory controller 105 reads out and loads the contents of the H2F address pointer mapping table of different sheets pointed to by other H2F address pointer links from the flash memory 110 into the cache space;

[0040] Step S322: The flash memory controller 105 determines whether a H2F address mapping table pointed to by the H2F address pointer has been cached and temporarily stored in the cache space of the flash memory controller 105 according to the address content of the host address; if the corresponding H2F address mapping table has been cached and temporarily stored in the cache space, step S324A is performed; otherwise, if the corresponding H2F address mapping table has not been cached and temporarily stored in the cache space, step S324B is performed;

[0041] Step S324A: The flash memory controller 105 finds a corresponding H2F address from the H2F address mapping table cached in the cache space according to the content of the logical address as a flash memory address (ie, a physical address) determined by mapping;

[0042] Step S324B: the flash memory controller 105 reads out and loads the contents of the different H2F address mapping tables pointed to by other H2F address pointers from the flash memory 110 into the cache space;

[0043] Step S325: The flash memory controller 105 performs a specific access operation, such as a read operation, according to the flash memory address; and

[0044] Step S330: End.

[0045] As described above, for example, before determining a specific address pointer link corresponding to a specific host address, the time shared buffer 1052 only caches the contents of the N address pointer links of the address pointer link mapping table 205PL, but does not cache the corresponding address pointer mapping table and does not cache the corresponding address mapping table. In addition, after a host address has been successfully mapped to a flash memory address, when receiving another host address from the host device 101, and the other host address also corresponds to the specific address pointer link, the corresponding address pointer mapping table and the corresponding address mapping table, the processing circuit 1051 directly determines another flash memory address according to the specific address pointer link, the corresponding address pointer mapping table and the corresponding address mapping table cached in the time shared buffer 1052 to perform another access operation according to the found another flash memory address, without reading out and loading the corresponding address pointer mapping table and the corresponding address mapping table from the flash memory 110. Alternatively, after a host address has been successfully mapped to a flash memory address, when the processing circuit 1051 receives another host address from the host device 101, and the other host address corresponds to the specific address pointer link, the corresponding address pointer mapping table and another address mapping table, the processing circuit 1051 directly determines another pointer based on the specific address pointer link temporarily stored in the cache space of the time shared buffer 1052 and the corresponding address pointer mapping table, and then reads out and loads the other address mapping table from the flash memory 110 based on the address content pointed to by the other pointer, so as to determine another flash memory address from the other address mapping table to perform another access operation based on the other flash memory address found, without reading out and loading the corresponding address pointer mapping table from the flash memory 110. Alternatively, after a host address has been successfully mapped to a flash memory address, when the processing circuit 1051 receives another host address from the host device 101, and the other host address corresponds to another specific address pointer link, another address pointer mapping table and another address mapping table respectively, the processing circuit 1051 reads out and loads the content of the other address pointer mapping table from the flash memory 110 into the cache space of the specific buffer according to the address content pointed to by the other specific address pointer link, then reads out and loads the content of the other address mapping table from the flash memory 110 into the cache space of the specific buffer according to the address content pointed to by another pointer corresponding to the other host address in the other address pointer mapping table, and then determines another flash memory address from the other address mapping table to perform another access operation according to the found another flash memory address.

[0046] For example (but not limited to), in one embodiment, the above-mentioned logical address is a logical block address (Logical Block Address, abbreviated as LBA) and is expressed in hexadecimal. For example, the hexadecimal value of the LBA address is 0x7480_6EA4. The flash memory controller 105 divides the hexadecimal value of the LBA address by a hexadecimal value of a memory space size corresponding to an equal division to obtain its quotient and remainder. For example, in this example, the first quotient obtained by dividing the hexadecimal value of the LBA address 0x7480_6EA4 by the hexadecimal value of an equal division (for example, 0x4000_0000, which corresponds to a memory space size of 512GB) is 1 and the first remainder obtained is 0x3480_6EA4. Therefore, the flash memory controller 105 can determine that the LBA address 0x7480_6EA4 corresponds to the first H2F address pointer link based on the first quotient being 1. Then, according to the physical address pointed to by the content of the first H2F address pointer link, an H2F address pointer mapping table corresponding to the first H2F address pointer link is read from the flash memory 110 and loaded into the cache space of the flash memory controller 105. Then, the flash memory controller 105 divides the first remainder 0x3480_6EA4 by the hexadecimal value of the size of the physical address memory space that can be mapped to the H2F address mapping table (for example, 0x0002_0000, which corresponds to the physical address memory space size of 64MB), and the second quotient obtained is 0x1A40 and the second remainder obtained is 0x0000_06EA4. Then, according to the obtained second quotient 0x1A40, it is determined that the LBA address corresponds to the 0x1A40th H2F address pointer on the H2F address pointer mapping table.Next, assuming that a storage page has 8 sectors, the flash memory controller 105 will then divide the second remainder 0x0000_06EA4 by 8 to obtain a third quotient of 0x0DD4. In this way, the flash memory controller 105 calculates the third quotient according to the first quotient (e.g., 1) and the first remainder (e.g., 0x3480_6EA4) obtained by the first division operation, the second quotient (e.g., 0x1A40) and the second remainder (e.g., 0x0000_06EA4) obtained by the second division operation, and the third quotient obtained by the third division operation. By using a number (e.g., 0x0DD4), it can be correctly determined that the storage data (e.g., storage page data) of the hexadecimal value 0x7480_6EA4 of the LBA address is placed on the 0xDD4th storage page in a block pointed to by the 0x1A40th H2F address pointer in an H2F address pointer mapping table (i.e., the first H2F address pointer mapping table) to which the first H2F address pointer link corresponds (i.e., the physical address recorded by the H2F address in the 0xDD4th column of the H2F address mapping table pointed to by the 0x1A40th H2F address pointer).

[0047] Through the above Figure 2 With the two-level mapping (the mapping relationship pointed to by the H2F address pointer link and the mapping relationship pointed to by the H2F address pointer) and simple read, load and divide operations, the flash memory controller 105 does not need to record all address mapping relationships in its limited cache space, and can correctly map the LBA address to a physical address, so as to find the storage data recorded by the physical address in the flash memory 110. In terms of performance, the technical solution of multi-level address mapping in this case can reduce the cache space size in the flash memory controller and support a larger capacity flash memory space size at the same time, and can maintain the access operation without slowing down.

[0048] In other embodiments, the flash memory controller 105 may also use address mapping technology with more than 2 levels (eg, 3 or 4 levels) to support a larger capacity flash memory address space. The operation is similar to the above-mentioned embodiment of the present invention and will not be repeated.

[0049] In addition, in other embodiments, the flash memory controller 105 may also use Figure 2 The multi-level address mapping shown is used to convert a physical address into a logical address, which also falls within the scope of the present invention.

[0050] The above description is only a preferred embodiment of the present invention. All equivalent changes and modifications made according to the scope of the patent application of the present invention should fall within the scope of the present invention.

Claims

1. A flash memory controller coupled between a host device and a flash memory, comprising: a specific buffer for configuring a cache space to cache and temporarily store data stored in the flash memory externally coupled to the flash memory controller; and A processing circuit is coupled to the specific buffer, and is used to receive a specific host address from the host device, read out and load a corresponding address pointer mapping table from the flash memory according to the address content pointed to by a specific address pointer link corresponding to the specific host address into the cache space of the specific buffer, then determine a specific address pointer corresponding to the specific host address from the corresponding address pointer mapping table according to the specific host address, then read out and load a corresponding address mapping table from the flash memory according to the address content pointed to by the specific address pointer into the cache space of the specific buffer, and then find a specific flash memory address from the corresponding address mapping table according to the specific host address to perform an access operation according to the found specific flash memory address.

2. The flash memory controller according to claim 1, It is characterized in that The processing circuit uses an address pointer link mapping table including N address pointer links, and the address pointer link mapping table is permanently stored in the cache space of the specific buffer. The N address pointer links correspond to N equal parts of a memory space that can be configured by the flash memory, and the processing circuit determines the specific address pointer link corresponding to the specific host address from the N address pointer links cached in the specific buffer.

3. The flash memory controller as claimed in claim 2, It is characterized in that Before determining the specific address pointer link corresponding to the specific host address, the specific buffer only caches the contents of the N address pointer links of the address pointer link mapping table without temporarily storing the corresponding address pointer mapping table.

4. The flash memory controller as claimed in claim 2, It is characterized in that When the processing circuit subsequently receives another host address from the host device, and the other host address also corresponds to the specific address pointer link, the corresponding address pointer mapping table and the corresponding address mapping table, the processing circuit directly determines another flash memory address based on the specific address pointer link, the corresponding address pointer mapping table and the corresponding address mapping table temporarily stored in the cache space of the specific buffer to perform another access operation based on the found other flash memory address, without reading out and loading the corresponding address pointer mapping table and the corresponding address mapping table from the flash memory.

5. The flash memory controller as claimed in claim 2, It is characterized in that When the processing circuit subsequently receives another host address from the host device, and the other host address corresponds to the specific address pointer link, the corresponding address pointer mapping table and another address mapping table, the processing circuit directly determines another pointer based on the specific address pointer link temporarily stored in the cache space of the specific buffer and the corresponding address pointer mapping table, and then reads out and loads the other address mapping table from the flash memory based on the address content pointed to by the other pointer, so as to determine another flash memory address from the other address mapping table to perform another access operation based on the found other flash memory address, without reading out and loading the corresponding address pointer mapping table from the flash memory.

6. The flash memory controller as claimed in claim 2, It is characterized in that When the processing circuit then receives another host address from the host device, and the other host address corresponds to another specific address pointer link, another address pointer mapping table and another address mapping table respectively, the processing circuit reads out the content of the other address pointer mapping table from the flash memory according to the address content pointed to by the other specific address pointer link and loads it into the cache space of the specific buffer, then reads out the content of the other address mapping table from the flash memory according to the address content pointed to by another pointer corresponding to the other host address in the other address pointer mapping table and loads it into the cache space of the specific buffer, and then determines another flash memory address from the other address mapping table to perform another access operation according to the found another flash memory address.

7. The flash memory controller as claimed in claim 2, It is characterized in that The specific host address is a logical block address. The processing circuit divides the hexadecimal value of the logical block address by a hexadecimal value of a memory space size corresponding to an equal division to obtain a first quotient, so as to determine the specific address pointer link from the N address pointer links according to the first quotient.

8. The flash memory controller as claimed in claim 7, It is characterized in that The processing circuit divides the hexadecimal value of the logical block address by the hexadecimal value of the memory space size corresponding to the equal division to obtain a first remainder, and then divides the first remainder by the hexadecimal value of the size of a physical address memory space that can be mapped to an address mapping table to generate a second quotient, so as to determine the specific address pointer corresponding to the specific host address from the corresponding address pointer mapping table according to the second quotient.

9. The flash memory controller as claimed in claim 8, It is characterized in that The processing circuit divides the first remainder by the hexadecimal value of the size of the physical address memory space that can be mapped to the address mapping table to generate a second remainder, and then divides the second remainder by the total number of sectors included in a storage page to generate a third quotient, so as to determine the specific flash memory address corresponding to the specific host address from the corresponding address mapping table according to the third quotient.

10. An address mapping method for a flash memory controller, wherein the flash memory controller is coupled between a host device and a flash memory, the address mapping method comprising: Providing a specific buffer for configuring a cache space to cache and temporarily store data stored in the flash memory externally coupled to the flash memory controller; providing a processing circuit coupled to the specific buffer; Using the processing circuit to receive a specific host address from the host device; Reading the address content pointed to by a specific address pointer link corresponding to the specific host address from the flash memory and loading a corresponding address pointer mapping table into the cache space of the specific buffer; Determine a specific address indicator corresponding to the specific host address from the corresponding address indicator mapping table according to the specific host address; Reading out and loading a corresponding address mapping table from the flash memory into the cache space of the specific buffer according to the address content pointed to by the specific address pointer; as well as A specific flash memory address is found from the corresponding address mapping table according to the specific host address to perform an access operation according to the found specific flash memory address.

11. The address mapping method according to claim 10, It is characterized in that Also includes: Using an address pointer link mapping table including N address pointer links, the address pointer link mapping table is permanently stored in the cache space of the specific buffer, the N address pointer links respectively corresponding to N equal divisions of a memory space that can be configured by the flash memory; and The processing circuit is used to determine the specific address pointer link corresponding to the specific host address from the N address pointer links cached and temporarily stored in the specific buffer.

12. The address mapping method according to claim 11, It is characterized in that include: Before determining the specific address pointer link corresponding to the specific host address, the specific buffer is used to cache only the contents of the N address pointer links of the address pointer link mapping table without temporarily storing the corresponding address pointer mapping table.

13. The address mapping method according to claim 11, It is characterized in that include: When the processing circuit subsequently receives another host address from the host device, and the other host address also corresponds to the specific address pointer link, the corresponding address pointer mapping table and the corresponding address mapping table, the processing circuit is used to directly determine another flash memory address based on the specific address pointer link, the corresponding address pointer mapping table and the corresponding address mapping table temporarily stored in the cache space of the specific buffer to perform another access operation based on the found other flash memory address, without reading out and loading the corresponding address pointer mapping table and the corresponding address mapping table from the flash memory.

14. The address mapping method according to claim 11, It is characterized in that include: When the processing circuit then receives another host address from the host device, and the other host address corresponds to the specific address pointer link, the corresponding address pointer mapping table and another address mapping table, the processing circuit is used to directly determine another pointer based on the specific address pointer link temporarily stored in the cache space of the specific buffer and the corresponding address pointer mapping table, and then read out and load the other address mapping table from the flash memory according to the address content pointed to by the other pointer, so as to determine another flash memory address from the other address mapping table to perform another access operation according to the found other flash memory address, without reading out and loading the corresponding address pointer mapping table from the flash memory.

15. The address mapping method according to claim 11, It is characterized in that include: When the processing circuit then receives another host address from the host device, and the other host address corresponds to another specific address pointer link, another address pointer mapping table and another address mapping table respectively, the processing circuit is used to read out and load the content of the other address pointer mapping table from the flash memory according to the address content pointed to by the other specific address pointer link into the cache space of the specific buffer, and then read out and load the content of the other address mapping table from the flash memory according to the address content pointed to by another pointer corresponding to the other host address in the other address pointer mapping table into the cache space of the specific buffer, and then determine another flash memory address from the other address mapping table to perform another access operation according to the found another flash memory address.

16. The address mapping method according to claim 11, It is characterized in that The specific host address is a logical block address, and the address mapping method includes: The hexadecimal value of the logical block address is divided by a hexadecimal value of a memory space size corresponding to an equal division to obtain a first quotient, and the specific address pointer link is determined from the N address pointer links according to the first quotient.

17. The address mapping method according to claim 16, It is characterized in that Include: The hexadecimal value of the logical block address is divided by the hexadecimal value of the memory space size corresponding to the equal division to obtain a first remainder, and then the first remainder is divided by the hexadecimal value of the size of a physical address memory space that can be mapped to an address mapping table to generate a second quotient, so as to determine the specific address pointer corresponding to the specific host address from the corresponding address pointer mapping table according to the second quotient.

18. The address mapping method according to claim 17, It is characterized in that Include: The first remainder is divided by the hexadecimal value of the size of the physical address memory space that can be mapped to the address mapping table to generate a second remainder, and then the second remainder is divided by the total number of sectors included in a storage page to generate a third quotient, so as to determine the specific flash memory address corresponding to the specific host address from the corresponding address mapping table according to the third quotient.

19. A storage device coupled to a host device, the storage device comprising: A flash memory ; as well as A flash memory controller is coupled between the host device and the flash memory and includes: A time-sharing buffer is used to configure a cache space to cache and temporarily store the data stored in the flash memory; as well as A processing circuit is coupled to the time-sharing buffer, and is used to receive a specific host address from the host device, read out from the flash memory and load a corresponding address pointer mapping table into the cache space of the time-sharing buffer according to the address content pointed to by a specific address pointer link corresponding to the specific host address, then determine a specific address pointer corresponding to the specific host address from the corresponding address pointer mapping table according to the specific host address, then read out from the flash memory and load a corresponding address mapping table into the cache space of the time-sharing buffer according to the address content pointed to by the specific address pointer, and then find a specific flash memory address from the corresponding address mapping table according to the specific host address to perform a read operation according to the found specific flash memory address.

20. The storage device according to claim 19, It is characterized in that The flash memory controller uses an address pointer link mapping table including N address pointer links, and the address pointer link mapping table is permanently stored in the cache space of the time-sharing buffer. The N address pointer links correspond to N equal parts of a memory space that can be configured by the flash memory, and the flash memory controller determines the specific address pointer link corresponding to the specific host address from the N address pointer links cached in the time-sharing buffer.