Flash memory management method and flash memory device

By establishing a mapping table between logical word lines and physical word line groups in the flash memory device, the compatibility problem caused by the inconsistent number of word line data pages is solved, and adaptation to different flash memory chips and data storage stability are achieved.

CN115641887BActive Publication Date: 2026-05-01DAPUSTOR CORP
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
DAPUSTOR CORP
Filing Date
2022-09-30
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

The inconsistent number of data pages in word lines within flash memory devices necessitates algorithmic improvements during data writing, impacting the compatibility of flash memory devices with flash memory chips.

Method used

By establishing a mapping table between logical word lines and physical word line groups, the physical word line group is determined based on the logical word line address, adapting to different types of flash memory chips and achieving stable data storage.

Benefits of technology

This improves the compatibility of flash memory devices with flash memory chips and the stability of data storage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115641887B_ABST
    Figure CN115641887B_ABST
Patent Text Reader

Abstract

The embodiment of the application relates to the application field of storage devices, and discloses a flash memory management method and a flash memory device, the flash memory management method comprises the following steps: acquiring a logical word line address corresponding to each logical unit in at least one logical unit; and searching a mapping table according to the logical word line address corresponding to each logical unit to determine a physical word line group corresponding to a logical word line of each logical unit. The application can map the logical word line and the physical word line group by using the mapping table, the physical word line group comprises at least one physical word line, the number of data pages included by at least two physical word lines is not completely same, so that the application can adapt to different types of flash memory particles, and the compatibility of the flash memory device to the flash memory particles is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Flash memory management methods and flash memory devices Technical Field

[0001] This application relates to the field of storage device applications, and in particular to a flash memory management method and a flash memory device. Background Technology

[0002] Flash memory devices, such as solid state drives (SSDs), are hard drives made using arrays of solid-state electronic storage chips. SSDs include a control unit and storage units (FLASH storage chips or DRAM storage chips).

[0003] Currently, flash memory devices typically collect a segment of data, and after mapping the logical address to the physical address, write the data segment into the word line of the data block.

[0004] However, due to architectural and technological reasons, the size of word lines within a data block is not uniform, meaning the number of data pages within a word line varies. For example, some word lines include 1, 2, or 3 data pages, which requires algorithmic improvements when writing data to word lines, resulting in insufficient compatibility of flash memory devices with flash memory chips.

[0005] Therefore, existing technologies urgently need improvement. Summary of the Invention

[0006] This application provides a flash memory management method and a flash memory device to improve the compatibility of the flash memory device with flash memory chips.

[0007] To address the aforementioned technical problems, this application provides the following technical solutions:

[0008] In a first aspect, embodiments of this application provide a flash memory management method applied to a flash memory device, the method comprising:

[0009] Obtain the write request, which includes physical address information and the data to be written;

[0010] Based on the physical address information corresponding to the write request, obtain the logical word line address corresponding to each logical unit in at least one logical unit;

[0011] Based on the logical word line address corresponding to each logical unit, the mapping table is looked up to determine the physical word line group corresponding to the logical word line of each logical unit. The mapping table includes the mapping relationship between logical word lines and physical word line groups. The physical word line group includes at least one physical word line. At least two physical word lines include different numbers of data pages. Each physical word line includes several data pages.

[0012] Based on the physical word line group corresponding to the logic word line of each logic unit, the write data is written to the physical word line corresponding to the physical word line group.

[0013] In some embodiments, the number of data pages corresponding to the largest physical word line in the physical word line group is equal to the number of data pages of one logical word line.

[0014] In some embodiments, before obtaining a write request, the method further includes: establishing a mapping table;

[0015] Establishing a mapping table specifically includes:

[0016] If a physical block of a flash memory device includes two physical word lines, namely a first physical word line and a second physical word line, then:

[0017] Mapping begins with the physical word line with the smallest sequence number;

[0018] Determine whether the current physical word line is the first physical word line;

[0019] If so, then combine several consecutive first physical word lines into a first physical word line group, and map a first physical word line group to a logic word line;

[0020] If not, then the current physical word line is determined to be the second physical word line, and the current physical word line is directly mapped to a logical word line;

[0021] Traverse all physical word lines of a physical block;

[0022] The first physical word line includes a first number of data pages, the second physical word line includes a second number of data pages, the second number is greater than the first number, and the number of data pages of the logic word line is less than or equal to the number of data pages of the physical word line or physical word line group corresponding to the logic word line, and the number of data pages of the logic word line is equal to the number of data pages corresponding to the largest physical word line.

[0023] In some embodiments, establishing a mapping table further includes:

[0024] If a physical block of a flash memory device includes three physical word lines, namely the first physical word line, the second physical word line, and the third physical word line, then:

[0025] Mapping begins with the physical word line with the smallest sequence number;

[0026] Determine whether the current physical word line is the first physical word line, wherein the first physical word line includes a first number of data pages;

[0027] If so, then combine several consecutive first physical word lines into a first physical word line group, and map a first physical word line group to a logic word line;

[0028] If not, then further determine whether the current physical word line is the second physical word line, wherein the second physical word line includes a second number of data pages, and the second number is greater than the first number;

[0029] If the current physical word line is the second physical word line, then combine several consecutive second physical word lines into a second physical word line group, and map a second physical word line group to a logic word line;

[0030] If the current physical word line is not the second physical word line, then the current physical word line is determined to be the third physical word line. At this time, the current physical word line is directly mapped to a logic word line.

[0031] Traverse all physical word lines of a physical block;

[0032] The third physical word line includes a third number of data pages, the third number being greater than the second number and the number of data pages of the logic word line being less than or equal to the number of data pages of the physical word line or physical word line group corresponding to the logic word line, and the number of data pages of the logic word line being equal to the number of data pages corresponding to the largest physical word line.

[0033] In some embodiments, establishing a mapping table further includes:

[0034] If a physical block of a flash memory device includes N physical word lines, namely the first physical word line, the second physical word line, ..., the (N-1)th physical word line and the Nth physical word line, then:

[0035] If the current physical word line is not the second physical word line, then continue to determine whether the current physical word line is the third physical word line;

[0036] If so, combine several third physical word lines into a third physical word line group, and map a third physical word line group to a logic word line;

[0037] This process continues until it is determined whether the current physical word line is the (N-1)th physical word line.

[0038] If the current physical word line is the (N-1)th physical word line, then combine several (N-1)th physical word lines into a (N-1)th physical word line group, and map a (N-1)th physical word line group to a logic word line;

[0039] If the current physical word line is not the (N-1)th physical word line, then the current physical word line is determined to be the Nth physical word line. In this case, the current physical word line is directly mapped to a logic word line.

[0040] Traverse all physical word lines of a physical block;

[0041] Wherein, N is a positive integer and N is greater than the third quantity, and the number of data pages for each logic word line is the same, and the number of data pages for each logic word line is less than or equal to the number of data pages for the physical word line or physical word line group corresponding to the logic word line, the logic word line corresponds one-to-one with the physical word line corresponding to the maximum number of data pages, and the number of data pages for each logic word line is equal to the number of data pages corresponding to the maximum physical word line.

[0042] In some embodiments, writing data to the physical word line corresponding to the physical word line group according to the physical word line group corresponding to the logic word line of each logic unit includes:

[0043] The data corresponding to each logical unit in the write data is written in parallel to the physical word line group corresponding to each logical unit; where...

[0044] If the physical word line group corresponding to the logic unit includes a physical word line, then the data corresponding to that logic unit in the write data will be written to the physical word line.

[0045] If the physical word line group corresponding to the logic unit includes at least two physical word lines, then the data corresponding to the logic unit in the write data is written to at least two physical word lines.

[0046] In some embodiments, the method further includes:

[0047] If the physical word line group corresponding to the logic unit includes a physical word line, then the data corresponding to the logic unit in the write data is written after the physical word line, and the write is confirmed to be complete.

[0048] If the physical word line group corresponding to the logic unit includes at least two physical word lines, then the data corresponding to the logic unit in the data to be written is written after at least two physical word lines, the remaining space in the physical word line group is filled with invalid data, and the writing is confirmed to be complete.

[0049] The amount of data written is equal to the number of logic cells in a single chip of the flash memory device multiplied by the number of data pages corresponding to one logic cell multiplied by the size of one data page.

[0050] In some embodiments,

[0051] Physical address information includes the chip address, the address of at least one logical unit, the physical block address, and the logical word line address.

[0052] Secondly, embodiments of this application provide a flash memory management method applied to a flash memory device, the method comprising:

[0053] Obtain the read request, which includes logical address information;

[0054] Obtain the logical word line address based on the logical address information corresponding to the read request;

[0055] Based on the logical word line address, look up the mapping table to determine the physical word line group corresponding to the logical word line. The mapping table includes the mapping relationship between logical word lines and physical word line groups. A physical word line group includes at least one physical word line. At least two physical word lines include different numbers of data pages. Each physical word line includes several data pages.

[0056] Read the data corresponding to the read request based on the physical word line address of the physical word line group.

[0057] In some embodiments, reading the data corresponding to the read request based on the physical word line address of the physical word line group includes:

[0058] Based on the physical word line address, determine the data page address corresponding to the physical word line address, and read the data corresponding to the data page address.

[0059] In some embodiments, the logical word line address includes a plurality of logical data pages, wherein the size of each logical data page is equal to the size of a physical data page, and the starting address of the logical data page is the address of the first mapped physical word line.

[0060] Thirdly, embodiments of this application provide a flash memory device, including:

[0061] At least one processor; and

[0062] A memory communicatively connected to at least one processor; wherein the memory stores instructions executable by at least one processor, the instructions being executed by at least one processor to enable at least one processor to perform a flash memory management method such as the first aspect or the second aspect.

[0063] Fourthly, embodiments of this application also provide a non-volatile computer-readable storage medium storing computer-executable instructions for enabling a flash memory device to perform the flash memory management method as described in the first aspect.

[0064] The beneficial effects of this application embodiment are as follows: Unlike the prior art, this application embodiment provides a flash memory management method applied to a flash memory device. The method includes: obtaining a write request, wherein the write request includes physical address information and write data; obtaining a logical word line address corresponding to each logical unit in at least one logical unit based on the physical address information corresponding to the write request; searching a mapping table based on the logical word line address corresponding to each logical unit to determine the physical word line group corresponding to the logical word line of each logical unit, wherein the mapping table includes a mapping relationship between logical word lines and physical word line groups, and the physical word line group includes at least one physical word line; and writing the write data to the physical word line corresponding to the physical word line group based on the physical word line group corresponding to the logical word line of each logical unit.

[0065] On the one hand, by obtaining the logical word line address corresponding to each logical unit in at least one logical unit; and by looking up the mapping table according to the logical word line address corresponding to each logical unit, the physical word line group corresponding to the logical word line of each logical unit is determined. This application can use the mapping table to map logical word lines and physical word line groups. The physical word line group includes at least one physical word line, and the number of data pages included in at least two physical word lines is not exactly the same, so that this application can adapt to different types of flash memory chips and improve the compatibility of flash memory devices with flash memory chips.

[0066] On the other hand, by writing data to the physical word line corresponding to the physical word line group of each logic unit through the physical word line group corresponding to the logic word line, this application can improve the stability of data storage. Attached Figure Description

[0067] One or more embodiments are illustrated by way of example with reference numerals in the accompanying drawings. These illustrations do not constitute a limitation on the embodiments. Elements with the same reference numerals in the drawings are denoted as similar elements. Unless otherwise stated, the figures in the drawings are not to be limited by scale.

[0068] Figure 1 is a schematic diagram of the structure of a flash memory device provided in an embodiment of this application;

[0069] Figure 2 is a schematic diagram of the firmware system of a flash memory device provided in an embodiment of this application;

[0070] Figure 3 is a schematic diagram of a NAND flash chip provided in an embodiment of this application;

[0071] Figure 4 is a schematic diagram of another NAND chip provided in an embodiment of this application;

[0072] Figure 5 is a flowchart illustrating a flash memory management method provided in an embodiment of this application;

[0073] Figure 6 is a schematic diagram of a mapping between logic word lines and physical word line groups provided in an embodiment of this application;

[0074] Figure 7 is a schematic diagram of a process for establishing a mapping table according to an embodiment of this application;

[0075] Figure 8 is a schematic diagram of another process for establishing a mapping table provided in an embodiment of this application;

[0076] Figure 9 is a schematic diagram of another process for establishing a mapping table provided in an embodiment of this application;

[0077] Figure 10 is a detailed flowchart of step S504 in Figure 5;

[0078] Figure 11 is a schematic diagram of the process of writing data to flash memory provided in an embodiment of this application;

[0079] Figure 12 is a flowchart illustrating another flash memory management method provided in an embodiment of this application;

[0080] Figure 13 is a detailed flowchart of step S1204 in Figure 12;

[0081] Figure 14A is a schematic diagram of the mapping relationship between logic word lines and physical word lines provided in an embodiment of this application;

[0082] Figure 14B is a schematic diagram of another mapping relationship between logic word lines and physical word lines provided in an embodiment of this application;

[0083] Figure 15 is a schematic diagram of a process for reading data from flash memory according to an embodiment of this application;

[0084] Figure 16 is a schematic diagram of the structure of a storage device provided in an embodiment of this application. Detailed Implementation

[0085] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application. All other embodiments obtained by those skilled in the art based on the embodiments in this application without inventive effort are within the scope of protection of this application.

[0086] It should be noted that, unless there is a conflict, the various features in the embodiments of this application can be combined with each other, all of which are within the protection scope of this application. Furthermore, although functional modules are divided in the device schematic diagram and a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than the module division in the device or the order in the flowchart. Moreover, the terms "first," "second," and "third" used in this application do not limit the data or execution order, but only distinguish identical or similar items with essentially the same function and effect.

[0087] Before providing a detailed description of this application, the nouns and terms used in the embodiments of this application are explained, and the nouns and terms used in the embodiments of this application shall be interpreted as follows:

[0088] (1) Word Line (WL) is the basic unit of writing in NAND. The number of data pages contained in each word line varies depending on the NAND chip. For example, a word line may contain one data page, or two data pages, or more than three data pages.

[0089] (2) Physical word line (physical WL) refers to the actual word line in NAND.

[0090] (3) Logical word line (logic WL, Log_WL) refers to the word line that is mapped to the physical word line. In the embodiments of this application, one logical word line corresponds to one or more physical word lines.

[0091] The technical solution of this application will be described in detail below with reference to the accompanying drawings:

[0092] Please refer to Figure 1, which is a schematic diagram of the structure of a flash memory device provided in an embodiment of this application;

[0093] As shown in Figure 1, the flash memory device 100 includes a flash memory medium 110 and a controller 120 connected to the flash memory medium 110. The flash memory device 100 communicates with the host 200 via wired or wireless means to achieve data interaction.

[0094] Flash memory medium 110, as the storage medium of flash memory device 100, is also called flash memory, Flash, Flash memory or Flash chip. It is a type of storage device and is a non-volatile memory that can retain data for a long time even without a current supply. Its storage characteristics are equivalent to hard disk, which makes flash memory medium 110 the basis for the storage medium of various portable digital devices.

[0095] The controller 120 includes a data converter 121, a processor 122, a cache 123, a flash memory controller 124, and an interface 125.

[0096] Data converter 121, connected to processor 122 and flash memory controller 124 respectively, is used to convert binary data to hexadecimal data and vice versa. Specifically, when flash memory controller 124 writes data to flash memory medium 110, data converter 121 converts the binary data to be written into hexadecimal data before writing it to flash memory medium 110. When flash memory controller 124 reads data from flash memory medium 110, data converter 121 converts the hexadecimal data stored in flash memory medium 110 into binary data, and then reads the converted data from the binary data page register. Data converter 121 may include a binary data register and a hexadecimal data register. The binary data register can be used to store data converted from hexadecimal to binary, and the hexadecimal data register can be used to store data converted from binary to hexadecimal.

[0097] The processor 122 is connected to the data converter 121, the cache 123, the flash memory controller 124, and the interface 125, respectively. The processor 122 can be connected to the data converter 121, the cache 123, the flash memory controller 124, and the interface 125 via a bus or other means. The processor is used to run non-volatile software programs, instructions, and modules stored in the cache 123, thereby implementing any method embodiment of this application.

[0098] The buffer 123 is mainly used to buffer the read / write commands sent by the host 200 and the read or write data obtained from the flash memory medium 110 according to the read / write commands sent by the host 200.

[0099] The flash controller 124 is connected to the flash media 110, the data converter 121, the processor 122, and the cache 123. It is used to access the back-end flash media 110 and manage various parameters and data I / O of the flash media 110; or, it is used to provide access interfaces and protocols, implement the corresponding SAS / SATA target protocol or NVMe protocol, obtain I / O instructions issued by the host 200, decode and generate internal private data results for execution; or, it is used to be responsible for the core processing of the flash translation layer (FTL).

[0100] Interface 125 connects host 200, data converter 121, processor 122, and buffer 123. It is used to receive data sent by host 200 or data sent by processor 122, so as to realize data transmission between host 200 and processor 122. Interface 125 can be SATA-2 interface, SATA-3 interface, SAS interface, MSATA interface, PCI-E interface, NGFF interface, CFast interface, SFF-8639 interface, and M.2 NVME / SATA protocol.

[0101] Please refer to Figure 2 again. Figure 2 is a schematic diagram of the structure of a firmware system for a flash memory device provided in an embodiment of this application.

[0102] It is understandable that the flash controller of a flash memory device includes a firmware system, which is used to connect the host and the flash array to handle data I / O.

[0103] As shown in Figure 2, the firmware system 210 includes:

[0104] Front End (FE) module 211 is used to obtain host commands to generate I / O operations. The front end module is also responsible for the communication protocol with the host, parsing host commands and solid-state drive commands, etc.

[0105] The flash algorithm module 212, namely the flash translation layer (FTL), is used to map IO operations to determine the flash array to be sent.

[0106] The flash algorithm module 212 sends IO operations to the back end module 213 (BE) of the flash controller so that the back end module 213 of the flash controller can receive the IO operations sent by the flash algorithm module 212.

[0107] Back End (BE) module 213 is connected to flash memory algorithm module 212 and is used to receive IO operations sent by flash memory algorithm module 212 in order to control hardware module 214 to perform read / write / erase operations on flash memory array;

[0108] Hardware module 214 (HW Op Nand Mode) refers to the module that operates the Flash memory. It is connected to the back-end module 213 and controlled by the back-end module 213. It is used to operate the Flash memory, such as performing operations on the corresponding flash array or flash medium according to the IO operation, that is, to complete the operation processing of data to the Flash memory. The operation includes read operation, write operation or erase operation.

[0109] In this process, after receiving a host command, the front-end module 211 processes it to generate an I / O operation, and then sequentially passes it through the flash memory algorithm module 212, the back-end module 213, and the hardware module 214 to operate the flash memory array. For example, when the host reads data, the host sends a host command to the flash memory device. The front-end module 211 (FE) of the flash memory device receives the host command, processes it, and distributes it to the flash memory algorithm module 212 (FTL). After receiving the command, the flash memory algorithm module 212 performs a logical-to-physical conversion and then sends the requested NAND read operation to the back-end module 213 (BE). After receiving the command, the back-end module 213 sends the hardware instructions to the hardware module (214) to perform NAND processing in parallel.

[0110] Please refer to Figure 3, which is a schematic diagram of a NAND chip provided in an embodiment of this application;

[0111] As shown in Figure 3, a physical block includes multiple word lines (WL), such as word line 0 (WL0), word line 1 (WL), ..., word line n (WLn). It can be understood that these word lines refer to the actual physical word lines in the flash memory device.

[0112] Each word line includes three data pages. For example, word line 0 includes data page 0, data page 1, and data page 2; word line 1 includes data page 3, data page 4, and data page 5; and word line n includes data page 3n, data page 3n+1, and data page 3n+2.

[0113] Obviously, each word line in the physical block of the NAND chip mentioned above is the same size, consisting of 3 word lines. In this case, the back-end module can determine the address to be written and the amount of data to be written, thereby writing a fixed amount of data in parallel to multiple logical cells of the NAND chip.

[0114] However, for NAND chips with different word line sizes, please refer to Figure 4, which is a schematic diagram of another NAND chip provided in the embodiment of this application.

[0115] As shown in Figure 4, for a physical block, there are at least two word lines (WL) of different sizes, that is, at least two word lines contain different numbers of data pages. For example: word lines 0 (WL0), 1 (WL1), 2 (WL2), and 3 (WL3) each include one data page, namely data page 0 (Page 0), data page 1 (Page 1), data page 2 (Page 2), and data page 3 (Page 3), respectively; while word line 4 (WL4) includes three data pages, namely data page 4 (Page 4), data page 5 (Page 5), and data page 6 (Page 6); word line 5 (WL5) also includes three data pages, namely data page 7 (Page 7), data page 8 (Page 8), and data page 9 (Page 9); while word line n (WLn) includes two data pages, namely data page 1056 (Page 1056) and data page 1057 (Page 1057), and word line n+1 (WLn+1) also includes two data pages, namely data page 1058 (Page 1058) and data page 1059 (Page 1059). 1059).

[0116] At this point, if a fixed amount of data is still written in parallel to multiple logical cells of the NAND chip, the backend module cannot determine the address to be written or the amount of data that can be written due to the different word line sizes in the physical block, thus making it unable to support this type of NAND chip.

[0117] In view of this, this application enables NAND chips that support different numbers of data pages included in physical word lines by mapping physical word lines to logical word lines.

[0118] Please refer to Figure 5, which is a flowchart illustrating a flash memory management method provided in an embodiment of this application;

[0119] The flash memory management method is applied to a flash memory device, which includes a flash memory controller, a firmware system, a front-end module, a flash memory algorithm module, a back-end module, and a hardware module.

[0120] As shown in Figure 5, the flash memory management method includes:

[0121] Step S501: Obtain a write request, wherein the write request includes physical address information and the data to be written;

[0122] Specifically, the write request is sent from the host to the flash memory device. The front-end module receives the write request from the host, sends a fixed amount of write data to the flash memory algorithm module for writing. After receiving the write request from the front-end module, the flash memory algorithm module maps the logical address to the physical address and forwards the write request to the back-end module. The back-end module receives the write request and writes the write data into the flash memory. The write request includes physical address information and the write data.

[0123] In this embodiment of the application, the physical address information includes the address of the die, the address of at least one plane, the address of the block, and the address of the logical word line (Log_WL address).

[0124] In this embodiment, the written data is related to the number of logical cells in a chip of the flash memory device. Specifically, the written data is positively correlated with the number of logical cells in a chip of the flash memory device. It is understood that a chip of a flash memory device includes at least one logical cell. The amount of data to be written by the front-end module (FE) is related to the number of logical cells (Plane). For example, for a 4-plane NAND chip, assuming the size of a physical word line (WL) is 3 data pages, the size of the written data P by the front-end module (FE) is: P = 1WL * 4plane = 4WL = 4 * 3 pages = 12 pages of data. Similarly, for a 2-plane NAND chip, the size of the written data P is: P = 2 * 3 = 6 pages of data.

[0125] Step S502: Based on the physical address information corresponding to the write request, obtain the logical word line address corresponding to each logical unit in at least one logical unit;

[0126] Specifically, the physical address information includes the address of the die, the address of at least one logical unit (Plane), the address of the physical block (Block), and the logical word line address (Log_WL address). Since a write request corresponds to multiple logical units (Plane), the logical word line address (Log_WL address) corresponding to each logical unit in at least one logical unit is obtained from the physical address information corresponding to the write request.

[0127] Step S503: Based on the logical word line address corresponding to each logical unit, look up the mapping table to determine the physical word line group corresponding to the logical word line of each logical unit. The mapping table includes the mapping relationship between logical word lines and physical word line groups. The physical word line group includes at least one physical word line. At least two physical word lines include different numbers of data pages. Each physical word line includes several data pages.

[0128] Specifically, based on the logical word line address corresponding to each logical unit, the mapping table is looked up to determine the physical word line group corresponding to the logical word line of each logical unit.

[0129] In this embodiment of the application, the mapping table is used to represent the mapping relationship between logical word lines and physical word line groups. The mapping relationship between logical word lines and physical word line groups includes the mapping relationship between logical word lines, logical word line addresses, physical word line groups, addresses of physical word line groups, and addresses of each physical word line in the physical word line group.

[0130] Please refer to Figure 6 again. Figure 6 is a schematic diagram of mapping logic word lines to physical word line groups according to an embodiment of this application.

[0131] As shown in Figure 6, a logical word line (Log_WL) maps to a physical word line group (WL_Group). A physical word line group includes at least one physical word line (WL). For example, logical word line Log_WL 0 maps to physical word line group WL_Group 0. This physical word line group WL_Group 0 includes four physical word lines, namely physical word lines WL0-WL3. Each physical word line includes a data page, namely data pages Page 0-3.

[0132] Logical word line Log_WL 1 maps to physical word line group WL_Group 1, which includes a physical word line WL4. Physical word line WL4 includes three data pages, namely data pages Page 4-6.

[0133] Logical word line Log_WL 351 maps to physical word line group WL_Group 351. This physical word line group WL_Group 351 includes two physical word lines WL, namely physical word line WL356 and physical word line WL357. Each physical word line includes two data pages. For example, physical word line WL356 includes data pages Page 1056 and Page 1057, and physical word line WL357 includes data pages Page 1058 and Page 1059.

[0134] It should be noted that each physical word line group can include one or more physical word lines, and the number of each physical word line group is determined according to the number of physical word lines of the specific NAND chip.

[0135] Understandably, in order to look up the mapping table, the mapping table is generally established before the write request is obtained; that is, the mapping table is established before the write request is obtained.

[0136] In this embodiment, the number of data pages for a logic word line is equal to the number of data pages for the maximum physical word line.

[0137] Understandably, in a flash memory device, a die may include multiple planes, a plane may include multiple blocks, and a block may include two, three, or more physical word lines. Therefore, statements on establishing mapping tables are made for each physical block that includes two, three, or more physical word lines.

[0138] (1) A physical block includes two physical word lines.

[0139] Specifically, a mapping table is established, including:

[0140] If a physical block of a flash memory device includes two physical word lines, namely a first physical word line and a second physical word line, then:

[0141] Mapping begins with the physical word line with the smallest sequence number;

[0142] Determine whether the current physical word line is the first physical word line;

[0143] If so, then combine several consecutive first physical word lines into a first physical word line group, and map a first physical word line group to a logic word line;

[0144] If not, then the current physical word line is determined to be the second physical word line, and the current physical word line is directly mapped to a logical word line;

[0145] Traverse all physical word lines of a physical block;

[0146] The first physical word line includes a first number of data pages, and the second physical word line includes a second number of data pages. The second number is greater than the first number, and the number of data pages of the logic word line is less than or equal to the number of data pages of the physical word line or physical word line group corresponding to the logic word line.

[0147] For example: one logical word line corresponds to one physical word line. In this case, the number of data pages for the physical word line is 3, and therefore the number of data pages for the logical word line is also 3. Alternatively, one logical word line corresponds to a group of physical word lines, which includes two physical word lines. The number of data pages corresponding to the two physical word lines are 2 and 3 respectively. In this case, the number of data pages for the physical word line group is 5, and the number of data pages for the logical word line is 3. Preferably, the number of data pages for the logical word line is equal to the number of data pages for the largest physical word line. As shown above, the largest physical word line is a physical word line with 3 data pages, so the number of data pages for the logical word line is also 3.

[0148] Please refer to Figure 7 again. Figure 7 is a schematic diagram of a process for establishing a mapping table provided in an embodiment of this application.

[0149] As shown in Figure 7, the process of establishing a mapping table includes:

[0150] Step S701: Start mapping from the physical word line with the smallest sequence number;

[0151] Specifically, assuming there are n physical word lines in a physical block, each physical word line corresponds to a sequence number, then the physical word line numbering starts from sequence number 0 and goes up to the last physical word line n-1. It can be understood that the mapping starts from the physical word line with the smallest sequence number and continues until the physical word line with the largest sequence number.

[0152] Step S702: Is it the first physical word line?

[0153] Specifically, if a physical block includes two physical word lines, then the two physical word lines are named the first physical word line and the second physical word line, respectively. The first physical word line includes a first number of data pages, and the second physical word line includes a second number of data pages. Furthermore, the second number is greater than the first number and is the maximum number of data pages in one physical word line. For example, the first number is 1, and the second number is 2; or, the first number is X, and the second number is X+M, where X and M are positive integers.

[0154] If the current physical word line is the first physical word line, proceed to step S703;

[0155] If the current physical word line is not the first physical word line, then the current physical word line is determined to be the second physical word line, and then proceed to step S704;

[0156] Step S703: Combine a series of consecutive first physical word lines into a first physical word line group, map a first physical word line group to a logic word line, and proceed to the next logic word line and physical word line;

[0157] Specifically, if the current physical word line is the first physical word line, then several consecutive first physical word lines are combined into a first physical word line group. Each physical word line in the first physical word line group is a first physical word line, and the number of data pages contained in all physical word lines of the first physical word line group is not less than the number of data pages contained in a second physical word line. For example, assuming the first physical word line includes 1 data page and the second physical word line includes 2 data pages, then two or more consecutive first physical word lines are combined into a first physical word line group. In this case, the number of data pages contained in all physical word lines of a first physical word line group is equal to or greater than the number of data pages contained in a second physical word line.

[0158] It is understandable that moving to the next logic word line and physical word line means incrementing the logic word line number by one and the physical word line number by n, where n is the number of first physical word lines in the first physical word line group. For example, if there are two first physical word lines in the first physical word line group, then the physical word line number is incremented by two.

[0159] At the same time, after entering the next logical word line and physical word line, proceed to step S705: determine whether the current word line is the last word line of the physical block, that is, determine whether the current physical word line is the last physical word line of the current physical block, that is, determine whether all physical word lines of the current physical block have been traversed. If so, proceed to step S706.

[0160] If not, proceed to the next physical word line, take the next physical word line as the current physical word line, and perform the same processing on the current physical word line, that is, determine whether the current physical word line is the first physical word line. If yes, proceed to step S703; if no, proceed to step S704; and so on, until all physical word lines of the current physical block are traversed.

[0161] Step S704: Determine the current physical word line as the second physical word line. At this time, map the current physical word line directly to a logic word line and proceed to the next logic word line and physical word line.

[0162] Step S705: Is the current word line the last word line of the physical block?

[0163] Specifically, determine whether the current physical word line is the last physical word line of the physical block, that is, determine whether all physical word lines of the current physical block have been traversed, that is, determine whether all physical word lines of the current physical block have been mapped. If yes, proceed to step S706; otherwise, return to step S702.

[0164] Step S706: Traverse all physical blocks of the flash memory device to complete the establishment of the mapping table.

[0165] Specifically, after traversing all physical word lines of the current physical block, the next physical block is mapped, and this process continues until all physical blocks of the flash memory device have been traversed to complete the mapping table. It is understandable that the operations for each physical block are the same as described above, and will not be repeated here.

[0166] (2) A physical block includes three physical word lines.

[0167] Specifically, a mapping table is established, including:

[0168] If a physical block of a flash memory device includes three physical word lines, namely the first physical word line, the second physical word line, and the third physical word line, then:

[0169] Mapping begins with the physical word line with the smallest sequence number;

[0170] Determine whether the current physical word line is the first physical word line, wherein the first physical word line includes a first number of data pages;

[0171] If so, then combine several consecutive first physical word lines into a first physical word line group, and map a first physical word line group to a logic word line;

[0172] If not, then further determine whether the current physical word line is the second physical word line, wherein the second physical word line includes a second number of data pages, and the second number is greater than the first number;

[0173] If the current physical word line is the second physical word line, then combine several consecutive second physical word lines into a second physical word line group, and map a second physical word line group to a logic word line;

[0174] If the current physical word line is not the second physical word line, then the current physical word line is determined to be the third physical word line. At this time, the current physical word line is directly mapped to a logic word line.

[0175] Traverse all physical word lines of a physical block;

[0176] The third physical word line includes a third number of data pages, the third number being greater than the second number and the number of data pages of the logic word line being less than or equal to the number of data pages of the physical word line or physical word line group corresponding to the logic word line, and the number of data pages of the logic word line being equal to the number of data pages corresponding to the largest physical word line.

[0177] Please refer to Figure 8 again. Figure 8 is a schematic diagram of another process for establishing a mapping table provided in an embodiment of this application.

[0178] As shown in Figure 8, the process of establishing the mapping table includes:

[0179] Step S801: Start mapping from the physical word line with the smallest sequence number;

[0180] Specifically, assuming there are n physical word lines in a physical block, each physical word line corresponds to a sequence number, then the physical word line numbering starts from sequence number 0 and goes up to the last physical word line n-1. It can be understood that the mapping starts from the physical word line with the smallest sequence number and continues until the physical word line with the largest sequence number.

[0181] Step S802: Is it the first physical word line?

[0182] Specifically, if a physical block includes three physical word lines, the three physical word lines are named the first physical word line, the second physical word line, and the third physical word line, respectively. The first physical word line includes a first number of data pages, the second physical word line includes a second number of data pages, and the third physical word line includes a third number of data pages. The second number is greater than the first number, the third number is greater than the second number, and the number of data pages of the logical word line is less than or equal to the number of data pages of the physical word line or physical word line group corresponding to the logical word line. Furthermore, the number of data pages of the logical word line is equal to the number of data pages corresponding to the largest physical word line.

[0183] For example: the first quantity is 1, the second quantity is 2, and the third quantity is 3; or, the first quantity is X, the second quantity is X+M, and the third quantity is X+M+N, where X, M, and N are all positive integers. For example: one logical word line corresponds to one physical word line. In this case, the number of data pages for the physical word line is 3, and therefore the number of data pages for the logical word line is 3; or, one logical word line corresponds to a group of physical word lines, which includes two physical word lines. The number of data pages corresponding to the three physical word lines are 2 and 2 respectively. In this case, the number of data pages for the physical word line group is 4, and the number of data pages for the logical word line is 3. Preferably, the number of data pages for the logical word line is equal to the number of data pages for the largest physical word line. As shown above, the largest physical word line is a physical word line with 3 data pages, so the number of data pages for the logical word line is 3.

[0184] If the current physical word line is the first physical word line, proceed to step S803;

[0185] If the current physical word line is not the first physical word line, then the current physical word line is determined to be the second physical word line, and then proceed to step S804;

[0186] Step S803: Combine a series of consecutive first physical word lines into a first physical word line group, map a first physical word line group to a logic word line, and proceed to the next logic word line and physical word line;

[0187] Specifically, if the current physical word line is the first physical word line, then several consecutive first physical word lines are combined into a first physical word line group. Each physical word line in the first physical word line group is a first physical word line, and the number of data pages contained in all physical word lines of the first physical word line group is not less than the number of data pages contained in a third physical word line. For example, assuming the first physical word line includes 1 data page, the second physical word line includes 2 data pages, and the third physical word line includes 3 data pages, then three or more consecutive first physical word lines are combined into a first physical word line group. In this case, the number of data pages contained in all physical word lines of a first physical word line group is equal to or greater than the number of data pages contained in a third physical word line.

[0188] It is understandable that moving to the next logic word line and physical word line means incrementing the logic word line number by one and the physical word line number by n, where n is the number of first physical word lines in the first physical word line group. For example, if there are four first physical word lines in the first physical word line group, then the physical word line number is incremented by four.

[0189] Step S804: Is it the second physical word line?

[0190] Specifically, determine whether the current physical word line is the second physical word line. If yes, proceed to step S805; otherwise, proceed to step S806.

[0191] Step S805: Combine a series of consecutive second physical word lines into a second physical word line group, map a second physical word line group to a logic word line, and proceed to the next logic word line and physical word line;

[0192] Specifically, if the current physical word line is a second physical word line, then several consecutive second physical word lines are combined into a second physical word line group. All physical word lines in the second physical word line group are second physical word lines, and the number of data pages contained in all physical word lines of the second physical word line group is not less than the number of data pages contained in a third physical word line. For example, assuming the first physical word line contains 1 data page, the second physical word line contains 2 data pages, and the third physical word line contains 3 data pages, then two consecutive second physical word lines are combined into a second physical word line group. In this case, the number of data pages contained in all physical word lines of a second physical word line group is 4, which is greater than the number of data pages contained in a third physical word line.

[0193] It is understandable that moving to the next logic word line and physical word line means incrementing the logic word line number by one and the physical word line number by n, where n is the number of second physical word lines in the second physical word line group. For example, if there are two second physical word lines in the second physical word line group, then the physical word line number is incremented by two.

[0194] Step S806: Determine that the current physical word line is the third physical word line. At this time, map the current physical word line directly to a logic word line and proceed to the next logic word line and physical word line.

[0195] Specifically, if the current physical word line is not the second physical word line, then the current physical word line is determined to be the third physical word line. At this time, the current third physical word line is treated as a third physical word line group, which includes only one third physical word line. The third physical word line group is then mapped to a logic word line, and the process proceeds to the next logic word line and physical word line.

[0196] It is understandable that, since the third physical word line group only includes one third physical word line, entering the next logic word line means incrementing the sequence number of the logic word line by one, and entering the next physical word line means incrementing the sequence number of the physical word line by one.

[0197] Step S807: Is the current physical word line the last word line of the physical block?

[0198] Specifically, determine whether the current physical word line is the last physical word line of the physical block, that is, determine whether all physical word lines of the current physical block have been traversed, that is, determine whether all physical word lines of the current physical block have been mapped. If yes, proceed to step S808; otherwise, return to step S802.

[0199] Step S808: Traverse all physical blocks of the flash memory device to complete the establishment of the mapping table.

[0200] Specifically, after traversing all physical word lines of the current physical block, the next physical block is mapped, and this process continues until all physical blocks of the flash memory device have been traversed to complete the mapping table. It is understandable that the operations for each physical block are the same as described above, and will not be repeated here.

[0201] Table 1 below is a mapping table obtained by mapping three types of physical word lines in a physical block.

[0202]

[0203]

[0204] Table 1

[0205] (3) A physical block includes more than four physical word lines.

[0206] Please refer to Figure 9 again. Figure 9 is a schematic diagram of another process for establishing a mapping table provided in an embodiment of this application.

[0207] As shown in Figure 9, the process of establishing the mapping table includes:

[0208] Step S901: Start mapping from the physical word line with the smallest sequence number;

[0209] Specifically, assuming there are n physical word lines in a physical block, each physical word line corresponds to a sequence number, then the physical word line numbering starts from sequence number 0 and goes up to the last physical word line n-1. It can be understood that the mapping starts from the physical word line with the smallest sequence number and continues until the physical word line with the largest sequence number.

[0210] Step S902: Is it the first physical word line?

[0211] Specifically, if a physical block includes N types of physical word lines, where N is a positive integer and N≥4, then the N types of physical word lines are named as the first physical word line, the second physical word line, ..., the Nth physical word line, respectively. The first physical word line includes a first number of data pages, the second physical word line includes a second number of data pages, ..., the Nth physical word line includes the Nth number of data pages, and the second number is greater than the first number, the third number is greater than the second number, ..., the Nth number is greater than the (N-1)th number. Furthermore, the number of data pages for each logical word line is the same, and the number of data pages for each logical word line is less than or equal to the number of data pages for the physical word line or group of physical word lines corresponding to the logical word line. Each logical word line corresponds one-to-one with the physical word line corresponding to the maximum number of data pages, and the number of data pages for each logical word line is equal to the number of data pages corresponding to the maximum physical word line.

[0212] For example: the first quantity is 1, the second quantity is 2, the third quantity is 3, and so on, until the Nth quantity is the Tth, where T is a positive integer.

[0213] Assuming N=5, the first quantity is 1, the second is 2, the third is 3, the fourth is 4, and the fifth is 5. Then: one logic word line corresponds to one physical word line, and the number of data pages for each physical word line is 5, therefore the number of data pages for the logic word line is 5. Alternatively, one logic word line corresponds to a group of physical word lines, which includes three physical word lines. The number of data pages for each physical word line is 2, 2, and 2 respectively. In this case, the number of data pages for the physical word line group is 6, and the number of data pages for the logic word line is 5. Preferably, the number of data pages for the logic word line is equal to the number of data pages for the largest physical word line. For example, the largest physical word line is a physical word line with 5 data pages, therefore the number of data pages for the logic word line is 5.

[0214] If the current physical word line is the first physical word line, proceed to step S903;

[0215] If the current physical word line is not the first physical word line, then the current physical word line is determined to be the second physical word line, and then proceed to step S904;

[0216] Step S903: Combine a series of consecutive first physical word lines into a first physical word line group, map a first physical word line group to a logic word line, and proceed to the next logic word line and physical word line;

[0217] Specifically, if the current physical word line is the first physical word line, then several consecutive first physical word lines are combined into a first physical word line group. Each physical word line in the first physical word line group is a first physical word line, and the number of data pages contained in all physical word lines in the first physical word line group is not less than the number of data pages contained in a single Nth physical word line. For example, assuming the first physical word line contains 1 data page, the second physical word line contains 2 data pages, the third physical word line contains 3 data pages, ..., the Nth physical word line contains N data pages, then N or more consecutive first physical word lines are combined into a first physical word line group. In this case, the number of data pages contained in all physical word lines in a first physical word line group is equal to or greater than the number of data pages contained in a single Nth physical word line.

[0218] It is understandable that moving to the next logic word line and physical word line means incrementing the logic word line number by one and the physical word line number by n, where n is the number of first physical word lines in the first physical word line group. For example, if there are five first physical word lines in the first physical word line group, then the physical word line number is incremented by five.

[0219] Step S904: Is it the second physical word line?

[0220] Specifically, determine whether the current physical word line is the second physical word line. If yes, proceed to step S905; otherwise, proceed to step S906.

[0221] Step S905: Combine a series of consecutive second physical word lines into a second physical word line group, map a second physical word line group to a logic word line, and proceed to the next logic word line and physical word line;

[0222] Specifically, if the current physical word line is the second physical word line, then several consecutive second physical word lines are combined into a second physical word line group. All physical word lines in the second physical word line group are second physical word lines, and the number of data pages contained in all physical word lines in the second physical word line group is not less than the number of data pages contained in a single Nth physical word line. For example, assuming the first physical word line contains 1 data page, the second physical word line contains 2 data pages, the third physical word line contains 3 data pages, ..., the Nth physical word line contains N data pages, then N / 2 or more consecutive second physical word lines are combined into a second physical word line group. In this case, the number of data pages contained in all physical word lines in a second physical word line group is N or more, greater than or equal to the number of data pages contained in a single Nth physical word line.

[0223] It is understandable that moving to the next logic word line and physical word line means incrementing the logic word line number by one and the physical word line number by n, where n is the number of second physical word lines in the second physical word line group. For example, if there are five second physical word lines in the second physical word line group, then the physical word line number is incremented by five.

[0224] Step S906: Is it the (N-1)th physical word line?

[0225] Specifically, after performing similar processing on each physical word line, the determination step reaches the second-to-last physical word line, which is the physical word line whose number of data pages is second only to the highest physical word line.

[0226] If the current physical word line is the (N-1)th physical word line, proceed to step S907;

[0227] If the current physical word line is not the (N-1)th physical word line, proceed to step S908.

[0228] Step S907: Combine several consecutive (N-1)th physical word lines into a second physical word line group, map an (N-1)th physical word line group to a logic word line, and proceed to the next logic word line and physical word line;

[0229] Specifically, the number of data pages contained in all physical word lines of a (N-1)th physical word line group is greater than or equal to the number of data pages contained in a Nth physical word line.

[0230] It is understandable that the operation of entering the next logical word line and physical word line is similar to the operation described above, and will not be repeated here.

[0231] Step S908: Determine the current physical word line as the Nth physical word line. At this time, map the current physical word line directly to a logic word line and proceed to the next logic word line and physical word line.

[0232] Step S909: Specifically, determine whether the current physical word line is the last physical word line of the physical block, that is, determine whether all physical word lines of the current physical block have been traversed, that is, determine whether all physical word lines of the current physical block have been mapped. If yes, proceed to step S910; otherwise, return to step S902.

[0233] Step S910: Traverse all physical blocks of the flash memory device to complete the establishment of the mapping table.

[0234] Specifically, after traversing all physical word lines of the current physical block, the next physical block is mapped, and this process continues until all physical blocks of the flash memory device have been traversed to complete the mapping table. It is understandable that the operations for each physical block are the same as described above, and will not be repeated here.

[0235] In the embodiments of this application, by traversing all physical word lines in a physical block, combining one or more physical word lines into a physical word line group, and mapping a physical word line group to a logical word line, it is possible to process different types of NAND chips, which is beneficial to improving the compatibility of flash memory devices.

[0236] Step S504: Write the data to the physical word line corresponding to the physical word line group according to the physical word line group corresponding to the logic word line of each logic unit.

[0237] Specifically, after determining the corresponding physical word line group based on the logical word line, the data to be written is written to the physical word line corresponding to the physical word line group.

[0238] Please refer to Figure 10 again. Figure 10 is a detailed flowchart of step S504 in Figure 5.

[0239] As shown in Figure 10, step S504 includes:

[0240] Step S5041: Write the data corresponding to each logical unit in the write data to the physical word line group corresponding to each logical unit in parallel.

[0241] Specifically, the flash memory algorithm module distributes write data based on the number of logic cells and the number of data pages corresponding to one logic cell. The amount of data to be written is equal to the number of logic cells in one chip of the flash memory device multiplied by the number of data pages corresponding to one logic cell multiplied by the size of one data page.

[0242] It is understandable that if the data to be written corresponds to at least two logical units, then the data corresponding to each logical unit in the data to be written in parallel to the physical word line group corresponding to each logical unit; if the data to be written corresponds to one logical unit, then the data to be written directly to the physical word line group corresponding to that logical unit.

[0243] In the embodiments of this application, the number of data pages corresponding to a logic unit is equal to the maximum number of data pages of a physical word line in the physical block of the logic unit. For example, if a physical block includes two or more physical word lines, and the maximum number of data pages of the physical word lines is N, then the number of data pages corresponding to a logic unit is N. For example, if a physical block includes three types of physical word lines, and each type of physical word line includes one data page, two data pages, and three data pages respectively, then the number of data pages corresponding to a logic unit is three.

[0244] Step S5042: Does the physical word line group corresponding to the logic unit include only one physical word line?

[0245] Specifically, determine whether the physical word line group corresponding to the logic unit includes only one physical word line. If yes, proceed to step S5043; otherwise, proceed to step S5044.

[0246] Step S5043: Write the data corresponding to the logic unit in the write data to the physical word line;

[0247] Specifically, the number of data pages corresponding to the logical unit in the written data is the number of data pages corresponding to the largest physical word line. If the physical word line group corresponding to the logical unit includes only one physical word line, then the number of data pages contained in the physical word line is equal to the number of data pages corresponding to the logical unit. In this case, the data corresponding to the logical unit in the written data can be directly written into the physical word line.

[0248] Step S5044: Write the data corresponding to the logic unit in the write data to at least two physical word lines.

[0249] Specifically, since the physical word line group includes at least two physical word lines, the number of data pages contained in any physical word line in the physical word line group is less than the maximum number of data pages in a physical word line, that is, less than the number of data pages in the written data corresponding to the logical unit. At this time, the data in the written data corresponding to the logical unit needs to be written to at least two physical word lines.

[0250] In this embodiment of the application, the method further includes:

[0251] If the physical word line group corresponding to the logic unit includes a physical word line, then the data corresponding to the logic unit in the write data is written after the physical word line, and the write is confirmed to be complete.

[0252] If the physical word line group corresponding to the logic unit includes at least two physical word lines, then the data corresponding to the logic unit in the data to be written is written after at least two physical word lines, the remaining space in the physical word line group is filled with invalid data, i.e., dummy data, and the writing is confirmed to be complete.

[0253] The amount of data written is equal to the number of logic cells in a single chip of the flash memory device multiplied by the number of data pages corresponding to one logic cell multiplied by the size of one data page.

[0254] Specifically, please refer to Figure 11, which is a schematic diagram of the process of writing data to flash memory provided in an embodiment of this application;

[0255] As shown in Figure 11, the process of writing data to flash memory includes:

[0256] Step S1101: Obtain the write request;

[0257] Step S1102: Based on the physical address information corresponding to the write request, obtain the logical word line address corresponding to each logical unit in at least one logical unit;

[0258] Step S1103: Based on the logic word line address corresponding to each logic unit, look up the mapping table to determine the physical word line group corresponding to each logic unit;

[0259] Step S1104: Write the data to the physical word line corresponding to the physical word line group according to the physical word line group corresponding to each logic unit;

[0260] Step S1105: Does the physical word line group corresponding to the logic unit include at least two physical word lines?

[0261] Step S1106: Write the data corresponding to the logic unit in the data to at least two physical word lines, and fill the remaining space in the physical word line group with invalid data;

[0262] Step S1107: Write the data corresponding to the logic unit in the write data to the physical word line;

[0263] Step S1108: Confirm that the writing is complete.

[0264] In this embodiment of the application, a flash memory management method is provided and applied to a flash memory device. The method includes: obtaining a write request, wherein the write request includes physical address information and write data; obtaining a logical word line address corresponding to each logical unit in at least one logical unit according to the physical address information corresponding to the write request; searching a mapping table according to the logical word line address corresponding to each logical unit to determine the physical word line group corresponding to the logical word line of each logical unit, wherein the mapping table includes a mapping relationship between logical word lines and physical word line groups, and the physical word line group includes at least one physical word line; and writing the write data to the physical word line corresponding to the physical word line group according to the physical word line group corresponding to the logical word line of each logical unit.

[0265] On the one hand, by obtaining the logical word line address corresponding to each logical unit in at least one logical unit; and by looking up the mapping table according to the logical word line address corresponding to each logical unit, the physical word line group corresponding to the logical word line of each logical unit is determined. This application can use the mapping table to map logical word lines and physical word line groups. The physical word line group includes at least one physical word line, and the number of data pages included in at least two physical word lines is not exactly the same, so that this application can adapt to different types of flash memory chips and improve the compatibility of flash memory devices with flash memory chips.

[0266] On the other hand, by writing data to the physical word line corresponding to the physical word line group of each logic unit through the physical word line group corresponding to the logic word line, this application can improve the stability of data storage.

[0267] Please refer to Figure 12 again. Figure 12 is a flowchart illustrating another flash memory management method provided in an embodiment of this application.

[0268] As shown in Figure 12, the flash memory management method includes:

[0269] Step S1201: Obtain a read request, wherein the read request includes logical address information;

[0270] Specifically, this logical address information includes logical word line addresses.

[0271] Step S1202: Obtain the logical word line address based on the logical address information corresponding to the read request;

[0272] Specifically, after receiving a read request from the flash memory algorithm module, the backend module parses the read request, obtains the logical address information corresponding to the read request, and then obtains the logical word line address in the logical address information.

[0273] Step S1203: Based on the logical word line address corresponding to the logical word line, look up the mapping table to determine the physical word line group corresponding to the logical word line. The mapping table includes the mapping relationship between logical word lines and physical word line groups. The physical word line group includes at least one physical word line. At least two physical word lines include different numbers of data pages. Each physical word line includes several data pages.

[0274] It is understandable that each logical word line corresponds to a logical word line address. The mapping table stores the mapping relationship between logical word lines and physical word line groups. Based on the logical word line corresponding to the logical word line address, the physical word line group corresponding to that logical word line is determined. For example, as shown in Table 1 above, by determining the sequence number of the logical word line, the corresponding physical word line group can be determined, and then at least one physical word line contained in the physical word line group can be determined. Each physical word line includes several data pages.

[0275] Step S1204: Read the data corresponding to the read request based on the physical word line address of the physical word line group.

[0276] Specifically, each physical word line group corresponds to at least one physical word line, and the physical word line address of the physical word line group is the address of the first physical word line. Since the physical word lines in the physical word line group are several consecutive physical word lines, the data corresponding to the read request can be read according to the physical word line address of the physical word line group.

[0277] For details, please refer to Figure 13, which is a detailed flowchart of step S1204 in Figure 12.

[0278] As shown in Figure 13, step S1204 includes:

[0279] Step S12041: Determine the data page address corresponding to the physical word line address based on the physical word line address, and read the data corresponding to the data page address.

[0280] It is understandable that the access address of NAND is: die address + plane address + block address + word line address.

[0281] Specifically, data pages serve as the basic read units of flash memory, and each data page is the same size. Therefore, based on the physical word line address, the data page address of each data page corresponding to the physical word line address can be determined. Thus, the data at the data page address corresponding to each data page can be read.

[0282] Please refer to Figure 14A, which is a schematic diagram of the mapping relationship between logic word lines and physical word lines provided in an embodiment of this application;

[0283] As shown in Figure 14A, logical word lines are mapped to the address of a data page and the number of data pages. For example, logical word line 0 (Log_WL 0) is mapped to the address A0 of a data page (Page address A0) and the number of data pages (Page number B0).

[0284] Please refer to Figure 14B again. Figure 14B is a schematic diagram of another mapping relationship between logic word lines and physical word lines provided in the embodiments of this application.

[0285] As shown in Figure 14B, the addresses of logical word lines and the number of physical word lines are mapped. For example, logical word line 0 (Log_WL 0) is mapped to the physical word line address A0 (WL address A0) and the number of physical word lines (WL number B0).

[0286] Understandably, a physical word line consists of at least one data page, and the address of a physical word line can be translated into the address of a data page.

[0287] In the embodiments of this application, the logical word line address includes a plurality of logical data pages, wherein the size of each logical data page is equal to the size of a physical data page, and the starting address of the logical data page is the address of the first mapped physical word line.

[0288] Please refer to Figure 15 again. Figure 15 is a schematic diagram of a process for reading data from flash memory according to an embodiment of this application.

[0289] As shown in Figure 15, the process of reading data from flash memory includes:

[0290] Step S1501: The backend module begins reading data;

[0291] Specifically, after receiving a read request from the flash memory algorithm module, the backend module begins reading data from the flash memory.

[0292] Step S1502: Based on the logical word lines, look up the mapping table to determine the physical word line group;

[0293] Specifically, the backend module determines the logical word line based on the logical word line address in the logical address information corresponding to the read request, and then looks up the mapping table to determine the physical word line group corresponding to the logical word line.

[0294] Step S1503: Determine the physical word lines based on the physical word line group;

[0295] Specifically, based on the address of the physical word line group, determine the address of at least one physical word line in the physical word line group.

[0296] Step S1504: Determine the address of the data page based on the physical word line;

[0297] Specifically, based on the address of the physical word line, the address of at least one data page in the physical word line is determined.

[0298] Step S1505: Read the data from the data page according to the address of the data page.

[0299] Specifically, based on the address of each data page, the data in each data page is read.

[0300] Please refer to Figure 16, which is a schematic diagram of the structure of a storage device provided in an embodiment of this application;

[0301] As shown in Figure 16, the storage device 1600 includes one or more processors 1601 and memory 1602. Figure 16 shows an example of one processor 1601.

[0302] The processor 1601 and the memory 1602 can be connected via a bus or other means. Figure 16 shows an example of connection via a bus.

[0303] Memory 1602, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. Processor 1601 executes various functional applications and data processing of the flash memory management method by running the non-volatile software programs, instructions, and modules stored in memory 1602, thereby implementing the flash memory management method described in the above embodiment. This flash memory management method can be executed by various electronic devices with certain logic processing capabilities, such as control chips.

[0304] Memory 1602 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some embodiments, memory 1602 may optionally include memory remotely located relative to processor 1601, which can be connected to processor 1601 via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0305] The module is stored in memory 1602. When executed by one or more processors 1601, it performs the flash memory management method in any of the above method embodiments, for example, performing the steps shown in FIG5 or FIG12 described above.

[0306] This application also provides a non-volatile computer storage medium storing computer-executable instructions that are executed by one or more processors. For example, the one or more processors can execute the flash memory management method in any of the above method embodiments, such as executing the various steps described above.

[0307] The apparatus or device embodiments described above are merely illustrative. The unit modules described as separate components may or may not be physically separate, and the components shown as module units may or may not be physical units; that is, they may be located in one place or distributed across multiple network module units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0308] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented using software plus a general-purpose hardware platform, or of course, using hardware. Based on this understanding, the above technical solutions, in essence or the parts that contribute to the related technology, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., including several instructions for a computer device (which may be a personal computer, server, or network device, etc.) to execute the various embodiments or some parts of the embodiments.

[0309] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and not to limit them; under the concept of this application, the technical features of the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations of different aspects of this application as described above. For the sake of brevity, they are not provided in detail; although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.

Claims

1. A flash memory management method, characterized in that, The method, applied to a flash memory device, includes: acquiring a write request, wherein the write request includes physical address information and write data; acquiring a logical word line address corresponding to each logical unit in at least one logical unit based on the physical address information corresponding to the write request; searching a mapping table based on the logical word line address corresponding to each logical unit to determine the physical word line group corresponding to the logical word line of each logical unit, wherein the mapping table includes a mapping relationship between logical word lines and physical word line groups, the physical word line group includes at least one physical word line, and each physical word line includes several data pages; and writing the write data to the physical word line corresponding to the physical word line group based on the physical word line group corresponding to the logical word line of each logical unit.

2. The method according to claim 1, characterized in that, The number of data pages corresponding to the largest physical word line in the physical word line group is equal to the number of data pages of one logical word line.

3. The method according to claim 1, characterized in that, Before obtaining the write request, the method further includes: establishing a mapping table; the establishment of the mapping table specifically includes: if a physical block of the flash memory device includes two types of physical word lines, namely a first physical word line and a second physical word line, then: mapping starts from the physical word line with the smallest sequence number; determining whether the current physical word line is a first physical word line; if so, combining several consecutive first physical word lines into a first physical word line group, and mapping a first physical word line group to a logical word line; if not, determining that the current physical word line is a second physical word line, and at this time mapping the current physical word line directly to a logical word line; traversing all physical word lines of a physical block; wherein, the first physical word line includes a first number of data pages, the second physical word line includes a second number of data pages, the second number is greater than the first number and the number of data pages of the logical word line is less than or equal to the number of data pages of the physical word line or physical word line group corresponding to the logical word line, and the number of data pages of the logical word line is equal to the number of data pages corresponding to the largest physical word line.

4. The method according to claim 3, characterized in that, The establishment of the mapping table further includes: if a physical block of the flash memory device includes three types of physical word lines, namely a first physical word line, a second physical word line, and a third physical word line, then: mapping begins from the physical word line with the smallest sequence number; it is determined whether the current physical word line is a first physical word line, wherein the first physical word line includes a first number of data pages; if so, several consecutive first physical word lines are combined into a first physical word line group, and a first physical word line group is mapped to a logical word line; if not, it is further determined whether the current physical word line is a second physical word line, wherein the second physical word line includes a second number of data pages, the second number being greater than the first number; if the current physical word line... If the current physical word line is a second physical word line, then a series of consecutive second physical word lines are combined into a second physical word line group, and a second physical word line group is mapped to a logical word line; if the current physical word line is not a second physical word line, then the current physical word line is determined to be a third physical word line, and the current physical word line is directly mapped to a logical word line; traverse all physical word lines of a physical block; wherein, the third physical word line includes a third number of data pages, the third number is greater than the second number, and the number of data pages of the logical word line is less than or equal to the number of data pages of the physical word line or physical word line group corresponding to the logical word line, and the number of data pages of the logical word line is equal to the number of data pages corresponding to the largest physical word line.

5. The method according to claim 4, characterized in that, The establishment of the mapping table further includes: if a physical block of the flash memory device includes N types of physical word lines, namely the first physical word line, the second physical word line, ..., the (N-1)th physical word line and the Nth physical word line, then: if the current physical word line is not the second physical word line, then continue to determine whether the current physical word line is the third physical word line; if so, combine several third physical word lines into a third physical word line group, and map a third physical word line group to a logical word line; and so on, until it is determined whether the current physical word line is the (N-1)th physical word line; if the current physical word line is the (N-1)th physical word line, then combine several (N-1)th physical word lines into a (N-1)th physical word line group, and map a third physical word line group to a logical word line; and so on, until it is determined whether the current physical word line is the (N-1)th physical word line; if the current physical word line is the (N-1)th physical word line, then combine several (N-1)th physical word lines into a (N-1)th physical word line group, and map a third physical word line group to a logical word line. A physical word line group (N-1) is mapped to a logical word line. If the current physical word line is not the N-1 physical word line, it is determined that the current physical word line is the Nth physical word line, and the current physical word line is directly mapped to a logical word line. All physical word lines of a physical block are traversed. Here, N is a positive integer and N is greater than the third number. The number of data pages of each logical word line is the same. The number of data pages of the logical word line is less than or equal to the number of data pages of the physical word line or physical word line group corresponding to the logical word line. There is a one-to-one correspondence between the logical word line and the physical word line corresponding to the maximum number of data pages. The number of data pages of the logical word line is equal to the number of data pages corresponding to the maximum physical word line.

6. The method according to claim 1, characterized in that, The step of writing the write data to the physical word line corresponding to the physical word line group according to the physical word line group corresponding to the logical word line of each logical unit includes: writing the data corresponding to each logical unit in the write data in parallel to the physical word line group corresponding to each logical unit; wherein, if the physical word line group corresponding to the logical unit includes one physical word line, then the data corresponding to that logical unit in the write data is written to the physical word line; if the physical word line group corresponding to the logical unit includes at least two physical word lines, then the data corresponding to that logical unit in the write data is written to at least two physical word lines, and the number of data pages included in the at least two physical word lines is not exactly the same.

7. The method according to claim 6, characterized in that, The method further includes: if the physical word line group corresponding to the logic unit includes one physical word line, then the data corresponding to the logic unit in the write data is written after the physical word line, and the write is determined to be complete; if the physical word line group corresponding to the logic unit includes at least two physical word lines, then the data corresponding to the logic unit in the write data is written after at least two physical word lines, invalid data is filled into the remaining space in the physical word line group, and the write is determined to be complete; wherein, the amount of the write data is equal to the number of logic units in one chip of the flash memory device. Number of data pages corresponding to one logical unit The size of a data page.

8. The method according to any one of claims 1-7, characterized in that, The physical address information includes the address of the wafer, the address of at least one logical unit, the address of the physical block, and the address of the logical word line.

9. A flash memory management method, characterized in that, The method, applied to a flash memory device, includes: acquiring a read request, wherein the read request includes logical address information; acquiring a logical word line address based on the logical address information corresponding to the read request; searching a mapping table based on the logical word line corresponding to the logical word line address to determine the physical word line group corresponding to the logical word line, wherein the mapping table includes a mapping relationship between logical word lines and physical word line groups, the physical word line group includes at least one physical word line, and each physical word line includes several data pages; and reading data corresponding to the read request based on the physical word line address of the physical word line group.

10. The method according to claim 9, characterized in that, The step of reading the data corresponding to the read request based on the physical word line address of the physical word line group includes: determining the data page address corresponding to the physical word line address based on the physical word line address, and reading the data corresponding to the data page address.

11. The method according to claim 9 or 10, characterized in that, The logical word line address includes several logical data pages, wherein the size of each logical data page is equal to the size of a physical data page, and the starting address of the logical data page is the address of the first mapped physical word line.

12. A flash memory device, characterized in that, include: At least one processor; And a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the flash memory management method as described in any one of claims 1-11.

Citation Information

Patent Citations

  • Flash memory device, and management method, data read-write method and data read-write device thereof

    CN102831072A

  • Multipage program scheme for flash memory

    CN103155044A