Data access management method of memory device, memory controller of memory device, memory device and electronic device

By using pausable serial numbers and virtual data in the memory controller, the problem of low efficiency of fault-tolerant disk array protection of memory devices under unexpected power outage events is solved, and fast recovery and efficient data management are achieved.

CN119025019APending Publication Date: 2024-11-26SILICON MOTION INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410425982.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2023-05-26
Filing Date
2024-04-10
Publication Date
2024-11-26

AI Technical Summary

Technical Problem

Prior art In the event of unexpected power outage events, the fault-tolerant disk array protection mechanism of memory devices results in increased processing time and lacks an effective solution to avoid side effects.

Method used

By using a pausable sequence number in the memory controller, writing data and metadata into active blocks in multiple blocks before an unexpected power outage event, and performing recovery programs after power outage, it is decided to damage the page group The start position of the virtual data is written to omit the fault-tolerant disk array encoding of the corrupted page group, ensuring the correctness and processing efficiency of the data.

Benefits of technology

Effectively reduces the unanticipated power outage recovery processing time, improves overall efficiency, and solves the problems in the prior art without introducing side effects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119025019A_ABST
    Figure CN119025019A_ABST
Patent Text Reader

Abstract

The invention relates to a method for performing data access management of a memory device in a predetermined communication architecture, a memory controller of the memory device, the memory device and an electronic device. The method for data access management enhances unexpected power-off recovery of fault tolerant disk array protection based on page groups by means of a pause sequence number, and includes: using a memory controller to write preceding data and metadata of the preceding data into at least one group of preceding pages of a first active block, the metadata carries at least one prior sequence number; writing the virtual data and other metadata into at least one group of virtual pages of the first active block, so that the other metadata carries at least one pause sequence number, and the at least one pause sequence number is equal to a last sequence number in the at least one preceding sequence number; and using the memory controller to write subsequent data and metadata of the subsequent data, so that the metadata carries at least one subsequent sequence number.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to memory control, and more particularly to a method and related apparatus for managing data access to a memory device in a predetermined communication architecture, so as to enhance the unexpected power off recovery (SPOR) of redundant array of independent disks (RAID) protection based on page groups by means of suspendable serial numbers. Background Art

[0002] The memory device may include a flash memory for storing data, and the access management for the flash memory is quite complex. For example, the memory device may be a memory card, a solid state drive (SSD), or an embedded storage device (e.g., an embedded storage device that complies with the universal flash storage (UFS) specification). The memory device can be used to store different files (e.g., system files and user files) in the host's file system. Since some files may be frequently accessed, some data may become invalid data, and more storage space may need to be released for further use. During the access of these files, the internal management information may change accordingly, and therefore there may be multiple different types of internal management information. When an unexpected power off (SPO) event occurs, the related processing may be quite time-consuming. For example, in the case where the memory device is equipped with a certain type of fault-tolerant disk array protection mechanism, the total processing time may be increased. There is no appropriate solution in the related art, therefore, an innovative method and related architecture are needed to solve these problems without introducing side effects or in a way that is unlikely to introduce side effects. Summary of the invention

[0003] Therefore, one of the objects of the present invention is to provide a method and related device for data access management of a memory device in a predetermined communication architecture (e.g., a universal flash storage (UFS) communication architecture) to enhance unexpected power failure recovery of a page group-based fault-tolerant disk array protection by means of suspendable sequence numbers to solve the above-mentioned problems.

[0004] According to at least one embodiment of the present invention, a method for data access management of a memory device in a predetermined communication architecture is provided to enhance unexpected power failure recovery of a fault-tolerant disk array protection based on page groups by means of a suspendable sequence number, wherein the method can be applied to a memory controller of the memory device, the memory device can include a memory controller and a non-volatile memory, the non-volatile memory can include at least one non-volatile memory element (e.g., one or more non-volatile memory elements), and the at least one non-volatile memory element can include a plurality of blocks. The method can include: before an unexpected power failure event occurs, using the memory controller to write previous data and metadata of the previous data to at least one group of previous pages in a first active block among the plurality of blocks, so that the metadata in the at least one group of previous pages carries at least one previous sequence number; and after the unexpected power failure event occurs, using the memory controller to perform an unexpected power failure recovery procedure in response to the unexpected power failure event. For example, the unexpected power failure recovery procedure may include: determining a starting position of a damaged page group; and writing virtual data and other metadata to at least one group of virtual pages in the first active block, so that the other metadata carries at least one pause sequence number for indicating that the fault-tolerant disk array encoding of at least one group of virtual pages in the damaged page group should be omitted, wherein the at least one pause sequence number is equal to a last sequence number among at least one previous sequence number, and the damaged page group includes at least one group of previous pages. The method further includes: after performing the unexpected power failure recovery procedure in response to the unexpected power failure event, using the memory controller to write subsequent data and metadata of the subsequent data to at least one group of subsequent pages in the damaged page group, so that the metadata in the at least one group of subsequent pages carries at least one subsequent sequence number, wherein each sequence number among the at least one subsequent sequence number is different from the last sequence number among the at least one previous sequence number.

[0005] In addition to the above method, the present invention also provides a memory controller of a memory device, wherein the memory device includes a memory controller and a non-volatile memory, the non-volatile memory may include at least one non-volatile memory element (e.g., one or more non-volatile memory elements), and the at least one non-volatile memory element may include a plurality of blocks. In addition, the memory controller includes a processing circuit, wherein the processing circuit is used to control the memory controller according to a plurality of host commands from a host device to allow the host device to access the non-volatile memory through the memory controller, and is also used to perform a method for data access management of the memory device in a predetermined communication architecture, so as to enhance the unexpected power failure recovery of the fault-tolerant disk array protection based on page groups by using the suspendable sequence number. For example, before an unexpected power failure event occurs, the memory controller writes previous data and metadata of the previous data to at least one group of previous pages in a first active block among a plurality of blocks, so that the metadata in the at least one group of previous pages carries at least one previous sequence number; and after the unexpected power failure event occurs, the memory controller performs an unexpected power failure recovery procedure in response to the unexpected power failure event. For example, the unexpected power failure recovery procedure may include: determining a starting position of a damaged page group; and writing virtual data and other metadata to at least one group of virtual pages in the first active block, so that the other metadata carries at least one pause sequence number for indicating that the fault-tolerant disk array encoding of at least one group of virtual pages in the damaged page group should be omitted, wherein the at least one pause sequence number is equal to a last sequence number among the at least one previous sequence number, and the damaged page group includes at least one group of previous pages. In addition, after performing an unexpected power failure recovery procedure in response to an unexpected power failure event, the memory controller writes subsequent data and metadata of the subsequent data to at least one group of subsequent pages in the damaged page group, so that the metadata in at least one group of subsequent pages carries at least one subsequent sequence number, wherein each of the at least one subsequent sequence number is different from the last sequence number of at least one previous sequence number.

[0006] In addition to the above method, the present invention also provides a memory device including the above memory controller, wherein the memory device includes: a non-volatile memory for storing information; and a memory controller coupled to the non-volatile memory and used to control the operation of the memory device.

[0007] In addition to the above method, the present invention also provides an electronic device including the above memory device, wherein the electronic device further includes a host device coupled to the memory device. The host device may include: at least one processor for controlling the operation of the host device; and a power supply circuit coupled to the at least one processor and used to provide power to the at least one processor and the memory device. In addition, the memory device provides storage space for the host device.

[0008] According to some embodiments, the device may include at least a portion (e.g., a portion or all) of an electronic device. For example, the device may include a memory controller in a memory device. For another example, the device may include a memory device. For another example, the device may include an electronic device.

[0009] According to some embodiments, the memory device can store data for the host device, wherein some of the stored data may need to be updated. In order to correct the problems of the related art, it is suggested that the memory device can be operated according to at least one control scheme (e.g., one or more control schemes) of the method, and in particular, multiple programs of the method are executed to perform related control using suspendable sequence numbers to increase overall performance.

[0010] The method and related apparatus of the present invention can ensure that the memory device can operate properly under different circumstances. For example, the memory controller can perform an unexpected power failure recovery procedure in response to an unexpected power failure event. In particular, during the processing of virtual pages in the unexpected power failure recovery procedure, the change of the sequence number is suspended to indicate that the fault-tolerant disk array encoding of the virtual page in the damaged page group should be omitted. The memory controller can refer to the suspendable sequence number to perform other procedures (such as fault-tolerant disk array decoding) to ensure the correctness of the data, reduce the processing time of related processing and improve the overall performance. In addition, the method and related apparatus of the present invention can solve the problems encountered by the prior art without introducing side effects or in a manner that is unlikely to introduce side effects. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] Figure 1 is a schematic diagram of an electronic device according to an embodiment of the present invention.

[0012] Figure 2 It is a schematic diagram of a table processing control scheme according to an embodiment of the present invention.

[0013] Figure 3 A schematic diagram of a protection control scheme of a method for managing data access to a memory device in a predetermined communication architecture according to an embodiment of the present invention, wherein the method enhances unexpected power failure recovery of a page group-based fault-tolerant disk array protection by utilizing suspendable sequence numbers.

[0014] Figure 4 FIG. 4 is a schematic diagram of a recovery control scheme of the method according to an embodiment of the present invention.

[0015] Figure 5 FIG. 4 is a schematic diagram of the main working process of the method according to an embodiment of the present invention.

[0016] Figure 6 According to an embodiment of the present invention Figure 5 Schematic diagram of the unexpected power outage recovery procedure showing the main work flow.

[0017] Figure 7 According to an embodiment of the present invention Figure 5 A schematic diagram of some implementation details related to the fault-tolerant RAID decoding process in the main workflow shown.

[0018]

Explanation of symbols

[0019] 10: Electronic devices

[0020] 50: Host device

[0021] 52: Processor

[0022] 54: Power supply circuit

[0023] 58,118: Transmission interface circuit

[0024] 100: memory device

[0025] 110: memory controller

[0026] 112: Microprocessor

[0027] 112C: Program code

[0028] 112M: Read-only memory

[0029] 114: Control logic circuit

[0030] 115E: Error Correction Code Circuit

[0031] 115R: Fault-tolerant disk array circuit

[0032] 116: Random Access Memory

[0033] 116R: homotopic region

[0034] 116T: Temporary logical to physical address mapping table

[0035] 117T: Temporary physical to logical address mapping table

[0036] 118C: Universal Flash Storage Controller

[0037] 118M:M physical layer circuit

[0038] 118U: Standardized communication protocol circuit

[0039] 120: Non-volatile memory

[0040] 120T: Global logical to physical address mapping table

[0041] 122-1~122-N: Non-volatile memory element

[0042] PRT:Parity

[0043] 220: Active block

[0044] 227T: Physical to logical address mapping table

[0045] XP(0),XP(1),XP(G-2),XP(G-1),XP(2),XP(3),XP(4),XP(5),XP(19):Superpage XB(0),XB(4):Superblock

[0046] GRP(0): Page Group

[0047] LPage2,LPage5,LPage8,LPage9,LPage10,LPage11,LPage12,LPage13: logical address

[0048] MD_ID: Predetermined metadata identifier

[0049] S10~S16,S20~S24,S31~S38: Steps DETAILED DESCRIPTION

[0050] Figure 11 is a schematic diagram of an electronic device 10 according to an embodiment of the present invention, wherein the electronic device 10 may include a host device 50 and a memory device 100. The host device 50 may include at least one processor (e.g., one or more processors; which may be collectively referred to as a processor 52), a power supply circuit 54, and a transmission interface circuit 58, wherein the processor 52 and the transmission interface circuit 58 may be coupled to each other through a bus, and may be coupled to the power supply circuit 54 to obtain power. The processor 52 may be used to control the operation of the host device 50, and the power supply circuit 54 may be used to provide power to the processor 52, the transmission interface circuit 58, and the memory device 100, and output one or more driving voltages to the memory device 100. The memory device 100 may be used to provide storage space for the host device 50, and may obtain one or more driving voltages from the host device 50 as a power supply for the memory device 100. Examples of the host device 50 may include, but are not limited to: a multi-function mobile phone, a tablet computer, a wearable device, and a personal computer, such as a desktop computer and a notebook computer. Examples of the memory device 100 may include, but are not limited to, portable memory devices (e.g., memory cards conforming to SD / MMC, CF, MS, or XD specifications, solid state drives (SSDs), and different types of embedded memory devices (e.g., embedded memory devices conforming to universal flash storage (UFS) specifications or embedded multi-media card (eMMC) specifications). According to the present embodiment, the memory device 100 may include a controller, such as a memory controller 110, and may further include a non-volatile (NV) memory 120 (for simplicity, the NV memory 120 is not shown in FIG. 1 ). Figure 1 1, wherein the memory controller 110 is used to access the non-volatile memory 120, and the non-volatile memory 120 is used to store information. The non-volatile memory 120 may include at least one non-volatile memory element (e.g., one or more non-volatile memory elements), such as a plurality of non-volatile memory elements 122-1, 122-2, ..., and 122-N (for simplicity, the non-volatile memory elements 122-1, 122-2, ..., and 122-N are referred to as "NV memory" in FIG. 1 ). Figure 1 , respectively, as “NV memory elements” in the figure), where “N” may represent a positive integer greater than 1. For example, the non-volatile memory 120 may be a flash memory, and the plurality of non-volatile memory elements 122-1, 122-2, . . . , and 122-N may be a plurality of flash memory chips or a plurality of flash memory dies, but the present invention is not limited thereto.

[0051] like Figure 1As shown, the memory controller 110 may include a processing circuit (e.g., a microprocessor 112), a storage unit (e.g., a read-only memory (ROM) 112M; for the sake of brevity, labeled as "ROM"), a control logic circuit 114, an error correction code (ECC) circuit 115E (for the sake of brevity, labeled as "ECC circuit"), a redundant array of independent disks (RAID) circuit 115R (for the sake of brevity, labeled as "RAID circuit"), a random access memory 116 (random access memory, RAM; for the sake of brevity, labeled as "RAM", for example, it can be implemented by a static random access memory (SRAM), but the present invention is not limited thereto) and a transmission interface circuit 118, wherein at least a portion (e.g., a portion or all) of the above components may be coupled to each other via a bus. The random access memory 116 may be used to provide an internal storage space for the memory controller 110 (e.g., temporarily storing information). In addition, the read-only memory 112M of the present embodiment is used to store the program code 112C, and the microprocessor 112 is used to execute the program code 112C to control the access of the non-volatile memory 120. It should be noted that the program code 112C can also be stored in the random access memory 116 or any type of memory. In addition, the control logic circuit 114 can be used to control the non-volatile memory 120. The error correction code circuit 115E can perform error correction code encoding and error correction code decoding to protect data and / or perform error correction for any sub-storage unit in a plurality of sub-storage units in a physical page, wherein the size of each of the plurality of sub-storage units is equal to a predetermined size. The fault-tolerant disk array circuit 115R can perform fault-tolerant disk array encoding and fault-tolerant disk array decoding to protect data and / or perform error correction for a physical page group.The transmission interface circuit 118 may include a plurality of sub-circuits, and the plurality of sub-circuits may interact with each other to communicate. The transmission interface circuit 118 may comply with one or more communication specifications among different communication specifications (e.g., Serial Advanced Technology Attachment (SATA) specification, Universal Serial Bus (USB) specification, Peripheral Component Interconnect Express (PCIe) specification, embedded multimedia card specification, or universal flash storage specification), and may enable the memory device 100 to communicate with the host device 50 (e.g., the transmission interface circuit 58) according to the one or more communication specifications. Similarly, the transmission interface circuit 58 may comply with the one or more communication specifications, and may enable the host device 50 to communicate with the memory device 100 (e.g., the transmission interface circuit 118) according to the one or more communication specifications. For example, the multiple sub-circuits of the transmission interface circuit 118 may include a universal flash storage controller 118C (labeled as a "UFS controller" for simplicity), a standardized communication protocol (Unified Protocol, commonly referred to as UniPro) circuit 118U (labeled as a "UniPro circuit" for simplicity), and a physical layer (physical layer, PHY) circuit (for example, an M physical layer (M-PHY) circuit 118M that complies with the relevant specifications of the MIPI Alliance), and the transmission interface circuit 58 can be implemented as having a circuit architecture similar to or the same as the circuit architecture of the transmission interface circuit 118 (for example, multiple corresponding sub-circuits), but the present invention is not limited to this.

[0052] In the present embodiment, the host device 50 can indirectly access the non-volatile memory 120 in the memory device 100 by transmitting a plurality of host commands and corresponding logical addresses to the memory controller 110. The memory controller 110 receives the plurality of host commands and corresponding logical addresses, and converts the plurality of host commands into a plurality of memory operation commands (which may be referred to as operation commands), and then uses the plurality of operation commands to control the non-volatile memory 120 to read or write / program memory cells or data pages at specific physical addresses in the non-volatile memory 120, etc., wherein the physical address may be related to the logical address. For example, the memory controller 110 may generate or update at least one logical-to-physical (L2P) address mapping table to manage the relationship between the physical address and the logical address, and the non-volatile memory 120 may store a global logical-to-physical address mapping table 120T for the memory controller 110 to control the memory device 100 to access the data in the non-volatile memory 120, but the present invention is not limited thereto. In addition, the memory controller 110 may generate or update at least one physical-to-logical (P2L) address mapping table (e.g., a temporary physical-to-logical address mapping table 117T). For example, when necessary, the memory controller 110 may refer to the temporary physical-to-logical address mapping table 117T to perform certain internal management operations (e.g., garbage collection (GC) operations).

[0053] For better understanding, the global logical-to-physical address mapping table 120T may be located in a predetermined region (e.g., a system region) within the non-volatile memory element 122-1, but the present invention is not limited thereto. For example, the global logical-to-physical address mapping table 120T may be divided into a plurality of local logical-to-physical address mapping tables, and the plurality of local logical-to-physical address mapping tables may be stored in one or more non-volatile memory elements of the non-volatile memory elements 122-1, 122-2, and 122-N, and in particular, may be stored in the non-volatile memory elements 122-1, 122-2, and 122-N, respectively. When necessary, the memory controller 110 may load at least a portion (e.g., a portion or all) of the global logical-to-physical address mapping table 120T into the random access memory 116 or other memory. For example, the memory controller 110 may load a local logical-to-physical address mapping table (e.g., a first local logical-to-physical address mapping table) from the multiple local logical-to-physical address mapping tables into the random access memory 116 as a temporary logical-to-physical address mapping table 116T for accessing data in the non-volatile memory 120 according to the local logical-to-physical address mapping table stored as the temporary logical-to-physical address mapping table 116T, but the present invention is not limited to this.

[0054] The memory area of ​​the random access memory 116 may include a plurality of sub-areas for temporarily storing different information (e.g., buffer data, a temporary logical-to-physical address mapping table 116T, and a temporary physical-to-logical address mapping table 117T), and at least a portion of the sub-areas (e.g., a portion of the sub-areas or all of the sub-areas) among the plurality of sub-areas of the memory area may be considered as a data buffer. For example, the sub-area for temporarily storing the buffer data may be considered as a data buffer, but the present invention is not limited thereto. According to some embodiments, the entire memory area (e.g., a plurality of sub-areas for temporarily storing the buffer data, the temporary logical-to-physical address mapping table 116T, and the temporary physical-to-logical address mapping table 117T) may be considered as a data buffer.

[0055] In addition, the at least one non-volatile memory element (e.g., one or more non-volatile memory elements, such as {122-1, 122-2, ..., 122-N}) may include a plurality of blocks, wherein the minimum unit for the memory controller 110 to perform a data erase operation on the non-volatile memory 120 is a block, and the minimum unit for the memory controller 110 to perform a data write operation on the non-volatile memory 120 is a page, but the present invention is not limited thereto. For example, any non-volatile memory element 122-n (the symbol "n" may represent any integer in the interval [1, N]) among the non-volatile memory elements 122-1, 122-2, ..., and 122-N may include a plurality of blocks, and a block within the plurality of blocks may include and record a specific number of pages, wherein the memory controller 110 may access a certain page of a certain block within the plurality of blocks according to a block address and a page address.

[0056] According to some embodiments, the memory controller 110 may monitor valid page counts of at least a portion (e.g., a portion or all) of the plurality of blocks, respectively, for use in subsequent processing (e.g., garbage collection operations). For data reception, the memory controller 110 may configure at least one block (e.g., one or more blocks) among the plurality of blocks of at least one non-volatile memory element (e.g., one or more non-volatile memory elements, such as {122-1, 122-2, ..., 122-N}) in the non-volatile memory 120 as at least one active block (e.g., one or more active blocks), and utilize the at least one active block to receive and store data (e.g., host-write data) from the host device 50. For example, the data (e.g., host write data, such as data to be written into the non-volatile memory 120) may include multiple sets of partial data, and the at least one active block may include a first active block, wherein the temporary physical-to-logical address mapping table 117T may correspond to the first active block, and in particular, the relevant mapping information may be stored for the first active block to indicate the physical-to-logical address mapping relationship. In addition, the memory controller 110 may maintain (e.g., generate or update) the temporary physical-to-logical address mapping table 117T for relevant internal management.

[0057] Figure 2Schematic diagram of a table processing control scheme according to an embodiment of the present invention. During the period of receiving and storing data from the host device 50 (e.g., host write data, such as data written to the non-volatile memory 120), the memory controller 110 can use the first active block (e.g., active block 220) to receive and store one or more sets of partial data among the multiple sets of partial data, and record the relevant mapping information (e.g., physical to logical table entry) in the temporary physical to logical address mapping table 117 corresponding to the active block 220 (for simplicity, in Figure 2 The memory controller 110 may further include a table entry (labeled as “P2L table”) for indicating a physical-to-logical address mapping relationship for the active block 220. The physical-to-logical address mapping relationship indicated by the physical-to-logical table entry may include a physical-to-logical address mapping relationship between a logical address and a physical address, wherein the host device 50 writes the one or more sets of partial data to the logical address, and the physical address indicates the location in the active block 220 where the one or more sets of partial data are stored. When a first predetermined criterion is reached (e.g., the active block 220 is completely programmed, or a predetermined number of pages of the active block 220 are programmed), the memory controller 110 may perform a set of table processing operations, and the set of table processing operations may include:

[0058] (1) A first table processing operation: According to the temporary physical to logical address mapping table 117T corresponding to the active block 220 (for simplicity, in Figure 2 to update the global logical to physical address mapping table 120T (for brevity, in Figure 2 In particular, according to the physical to logical table entries in the temporary physical to logical address mapping table 117T (for simplicity, in Figure 2 to update certain logic-to-physical table entries in the global logic-to-physical address mapping table 120T (for brevity, in Figure 2 , marked as “L2P item” in the figure, for indicating the logical to physical address mapping relationship for the active block 220;

[0059] (2) A second table processing operation: storing the temporary physical-to-logical address mapping table 117T (e.g., the physical-to-logical table entries therein) in the non-volatile memory 120 to generate or update a first physical-to-logical address mapping table (e.g., the physical-to-logical address mapping table 227T; for simplicity, the first physical-to-logical address mapping table 227T is not described in detail in the following sections). Figure 2For example, the above-mentioned subsequent operations are performed by writing all physical-to-logical table entries recorded in the temporary physical-to-logical address mapping table 117T into the physical-to-logical address mapping table 227T, wherein the physical-to-logical address mapping table 227T can be regarded as a backup version of the temporary physical-to-logical address mapping table 117T; and

[0060] (3) a third table processing operation: after performing the first table processing operation (e.g., updating the global logical-to-physical address mapping table 120T according to the temporary physical-to-logical address mapping table 117T) and the second table processing operation (e.g., storing the temporary physical-to-logical address mapping table 117T in the non-volatile memory 120), clearing the temporary physical-to-logical address mapping table 117T (e.g., the physical-to-logical table entries therein) to reuse the corresponding storage space in the temporary physical-to-logical address mapping table 117T and / or the random access memory 116;

[0061] However, the present invention is not limited thereto. According to some embodiments, the first table processing operation may include loading a local logical-to-physical address mapping table (e.g., the first local logical-to-physical address mapping table) in the global logical-to-physical address mapping table 120T into the random access memory 116 as the temporary logical-to-physical address mapping table 116T, updating one or more logical-to-physical table entries in the temporary logical-to-physical address mapping table 116T to indicate one or more logical-to-physical address mapping relationships among a plurality of logical-to-physical address mapping relationships for the active block 220, and updating the global logical-to-physical address mapping table 120T (e.g., the local logical-to-physical address mapping table therein) according to the temporary logical-to-physical address mapping table 116T.

[0062] After any active block (e.g., active block 220) among the at least one active block is completely programmed, the memory device 100 (e.g., memory controller 110) may close any active block to make any active block an inactive block, and select a blank block (e.g., an erased block) as a replacement for any active block to receive subsequent data corresponding to any active block. In addition, the subsequent processing may include performing a garbage collection process to write valid data among all data in the inactive block into another blank block (e.g., another erased block), but the present invention is not limited thereto.

[0063] According to certain embodiments, since the physical-to-logical address mapping relationship indicated by the physical-to-logical table item in the above-mentioned at least one physical-to-logical address mapping table (for example, the temporary physical-to-logical address mapping table 117T or the physical-to-logical address mapping table 227T) and the logical-to-physical address mapping relationship indicated by the related logical-to-physical table item in the logical-to-physical address mapping table 120T should be inverse address mapping relationships to each other, the memory controller 110 can determine the latest mapping information (for example, the physical address) carried by the related logical-to-physical table item in the logical-to-physical address mapping table 120T based on the latest mapping information (for example, the logical address) carried by the physical-to-logical table item in the above-mentioned at least one physical-to-logical address mapping table.

[0064] According to some embodiments, the memory controller 110 may operate according to one or more control schemes to perform internal management of the memory device 100, and in particular, may generate and update a valid page count (VPC) table for recording the valid page counts of the plurality of blocks, but the present invention is not limited thereto. According to some embodiments, the active block 220 may be implemented by a superblock XB among a plurality of superblocks {XB} (e.g., superblocks {XB(0), XB(1), ...}), in which case the valid page count in the valid page count table may represent the valid superpage counts of the plurality of superblocks {XB}.

[0065] For example, the non-volatile memory elements 122-1, 122-2, ... and 122-N may be implemented as a plurality of flash memory chips (e.g., chips #0 and #1) or a plurality of flash memory dies (e.g., dies #0 and #1), respectively, wherein the non-volatile memory elements 122-1, 122-2, ... and 122-N may include at least two memory elements 122-1 and 122-2, and the memory element count CNT_m of the non-volatile memory elements 122-1, 122-2, ... and 122-N (e.g., chip count of a plurality of flash memory chips or die count of a plurality of flash memory dies) may vary according to different configurations of the non-volatile memory 120. Any non-volatile memory element 122-n among the non-volatile memory elements 122-1, 122-2, ... and 122-N may include multiple planes (e.g., planes #0 and #1), any one of the multiple planes may include its own block {BLK(0), BLK(1), ...}, and any one of the multiple blocks {BLK(0), BLK(1), ...} may include its own page {Page(0), Page(1), ...}. The memory controller 110 may combine multiple groups of corresponding blocks {{BLK(0)}, {BLK(1)}, …} in all planes (e.g., planes #0 and #1) of all non-volatile memory elements into super blocks {XB(0), XB(1), …}, and may combine multiple groups of corresponding pages {{Page(0)}, {Page(1)}, …} in all planes of all non-volatile memory elements into super pages {XP(0), XP(1), …}. In addition, the memory controller 110 can access (e.g., read or write) a set of corresponding blocks {BLK(r0)} of the super block XB(r0) according to the physical block address (PBA) XBlk(r0), and in particular, can access a set of corresponding pages {Page(r1)} of the super page XP(r1) in the super block XB(r0) according to the physical block address XBlk(r0) and the physical page address (PPA) XPg(r1), where "r0" and "r1" can be non-negative integers.

[0066] Figure 31 is a schematic diagram of a protection control scheme of a method for data access management of a memory device (e.g., memory device 100) in a predetermined communication architecture (e.g., a universal flash storage communication architecture) according to an embodiment of the present invention, wherein the method utilizes a suspendible serial number to enhance unexpected power failure recovery (SPOR) of a page-group-based fault-tolerant RAID protection. The memory controller 110 may utilize a super block XB (e.g., super block XB(0)) as an active block 220 to receive and store host write data into a page group {GRP} (e.g., page groups {GRP(0), GRP(1), ...}) of the super block XB. Each page group GRP in the page group {GRP} may include G super pages {XP}, and the first (G-1) super pages and the last super page of the G super pages {XP} may be used to store data (e.g., part of the data written by the host) and the parity (e.g., a parity code) of the data, respectively. The parameter G may be a positive integer greater than one and may be used to indicate the super page count of each page group. For example, page group GRP(0) may include super pages {XP(0), XP(1), ..., XP(G-2), XP(G-1)}, page group GRP(1) may include super pages {XP(G), XP(G+1), ..., XP((2*G)-2), XP((2*G)-1)}, and the rest may be deduced in the same way. Figure 3 In the illustrated embodiment, the memory element count CNT_m (e.g., chip count or die count) may be equal to 2, and the plane count CNT_p of the plurality of planes in the non-volatile memory element 122-n may be equal to 2, but the invention is not limited thereto. According to some embodiments, the memory element count CNT_m and / or the plane count CNT_p may vary.

[0067] Figure 4Schematic diagram of the recovery control scheme of the method according to an embodiment of the present invention. Under the control of the processing circuit (e.g., microprocessor 112), the memory controller 110 may perform data access management of the memory device 100 in a predetermined communication architecture according to the method, and in particular, operate according to the protection control scheme, recovery control scheme, etc. of the method to enhance unexpected power failure recovery of the fault-tolerant disk array protection based on page groups with the help of suspendable sequence numbers. For example, the memory controller 110 may have started writing host write data and carrying the sequence number {SN} in metadata for storage in the corresponding super page {XP}, and after an unexpected power off (SPO) event occurs, the memory controller 110 may perform an unexpected power failure recovery procedure in response to the unexpected power off event and temporarily prevent the sequence number SN from changing. After performing the unexpected power failure recovery procedure in response to the unexpected power off event, the memory controller 110 may continue to write host write data and carry the sequence number {SN} in metadata for storage in the corresponding super page {XP}.

[0068] The memory controller 110 may write the host write data and the corresponding metadata into a plurality of physical pages of the host block 220, respectively, wherein the metadata of the data stored in any one of the plurality of physical pages may include the logical address of the data stored in any one of the physical pages. Figure 4Taking the architecture shown as an example, before an unexpected power failure event, the memory controller 110 may write the first data of the logical address {LPage2, LPage5, LPage8, LPage9} among the data written by the host and the first metadata of the first data into the super page XP(0), so that the first metadata carries the logical address {LPage2, LPage5, LPage8, LPage9}, and the metadata in the first page of the super page XP(0) carries the sequence number SN(0) (e.g., 0). Then, the memory controller 110 may write the second data of the logical address {LPage10, LPage11, LPage12, LPage13} among the data written by the host and the second metadata of the second data into the super page XP(1), so that the second metadata carries the logical address {LPage10, LPage11, LPage12, LPage13}, and the metadata in the first page of the super page XP(1) carries the sequence number SN(1) (e.g., 1). However, due to the unexpected power failure event, the memory controller 110 cannot correctly write any data and any metadata into the super page XP(2). After the unexpected power failure event, the memory controller 110 can perform an unexpected power failure recovery procedure to write the virtual data and other metadata into the super page XP(3), so that the metadata in the first page of the super page XP(3) carries a suspension sequence number SN(3), wherein the suspension sequence number SN(3) is equal to the sequence number SN(1) (e.g., 1). During the unexpected power failure recovery procedure, before writing the virtual data and other metadata into the super page XP(3), the memory controller 110 may pre-back up the first data and the first metadata from the super page XP(0) to at least one other block among the multiple blocks as a backup version thereof, for subsequent reading to generate the third data and the third metadata of the third data to be respectively written into the super page XP(4), and pre-back up the second data and the second metadata from the super page XP(1) to the at least one other block as a backup version thereof, for subsequent reading to generate the fourth data and the fourth metadata of the fourth data to be respectively written into the super page XP(5). For example, the memory controller 110 may write third data and third metadata into super page XP(4) so ​​that the metadata in the first page of super page XP(4) carries serial number SN(4) (e.g., 2), wherein the third data and the third metadata may be respectively equal to the first data and the first metadata, except that serial number SN(0) may be replaced by serial number SN(4) by the memory controller 110 to be carried by the metadata in the first page of super page XP(4).For another example, the memory controller 110 may write the fourth data and the fourth metadata into super page XP(5), so that the fourth metadata carries the logical address {LPage10, LPage11, LPage12, LPage13}, and the metadata in the first page of super page XP(5) carries the sequence number SN(5) (e.g., 3), wherein the fourth data and the fourth metadata may be respectively equal to the second data and the second metadata, except that the sequence number SN(1) may be replaced by the sequence number SN(5) by the memory controller 110 to be carried by the metadata in the first page of super page XP(5). In addition, since super page XP(2) is damaged, no metadata can be correctly read from the pages of super page XP(2) (labeled as "xxxxxxxx" for brevity), and no sequence number SN(2) can be correctly read from the first page of super page XP(2) (labeled as "x" for brevity). In addition, since super page XP(3) is written as a virtual super page, the memory controller 110 can simply write the virtual data into the pages of super page XP(3) without writing more metadata (labeled as "xxxxxxxx" for brevity). According to some embodiments, the memory controller 110 may omit carrying the logical address in the metadata as long as it does not hinder the implementation of the method.

[0069] according to Figure 4In the embodiment shown, the metadata in any one of the physical pages may be used to carry the logical address of a logical storage unit of the host device 50, such as any one of the logical addresses {LPage2, LPage5, LPage8, LPage9} and {LPage10, LPage11, LPage12, LPage13}, to indicate that any one of the physical pages stores data of the logical storage unit, but the present invention is not limited thereto. According to some embodiments, the metadata in any one of the physical pages may be used to carry at least one logical address of at least one logical storage unit of the host device 50, to indicate that any one of the physical pages stores data of the at least one logical storage unit. In particular, any one of the physical pages may be large enough to store data of multiple logical storage units (e.g., multiple logical blocks) of the host device 50, and the metadata in any one of the physical pages may be used to carry multiple logical addresses (e.g., multiple logical block addresses (LBAs)) of the multiple logical storage units, to indicate that any one of the physical pages stores data of the multiple logical storage units. For example, the data size of one of the plurality of logical storage units may be equal to 4 kilobytes (KB), and the total data size of the plurality of logical storage units may be equal to 16 KB. In this case, the metadata in any one of the physical pages may be used to carry 4 logical addresses (e.g., 4 logical block addresses) of 4 logical storage units (e.g., 4 logical blocks) to indicate that any one of the physical pages stores the data of the 4 logical storage units. For the sake of brevity, similar contents of these embodiments will not be described in detail again.

[0070] The following is a further description of the FRAID decoding. According to some embodiments, at a certain time during the reception and storage of host write data to the active block 220, the memory controller 110 may be receiving and storing the host write data to a current page group GRP of the page group {GRP} in the active block 220. During the reception and storage of the host write data to the current page group GRP, the memory controller 110 may utilize the FRAID circuit 115R to generate and update a co-bit PRT of data stored in one or more groups of non-damaged and non-virtual pages (e.g., pages in one or more non-damaged and non-virtual super pages {XP}), such as a bitwise exclusive OR (XOR) result of the data, for protecting the one or more groups of non-damaged and non-virtual pages and preparing to complete the FRAID encoding of the current page group GRP. For example, the parity PRT can be considered as a fault-tolerant disk array parity. The memory controller 110 can temporarily store the parity PRT (e.g., a bit-by-bit mutex or result) in the parity area 116R in the random access memory 116, and update the parity PRT as the number of the one or more groups of non-damaged and non-virtual pages increases, and in particular, update the parity PRT as a written page count WPC (e.g., the number of written pages) of the current page group GRP increases, wherein the written page count WPC can be counted according to all the pages that have been written to the current page group GRP, regardless of whether there is any damaged page or any virtual page in the current page group GRP. When the written page count WPC reaches a predetermined page count WPC1, the memory controller 110 can write the latest parity PRT (e.g., the latest version of the parity PRT in the random access memory 116) to a group of parity pages (e.g., pages of the last super page XP) of the current page group GRP to complete the writing of the current page group GRP for data protection. The write page count WPC and the predetermined page count WPC1 may be measured in units of super pages, where WPC1=(G-1), but the present invention is not limited thereto.

[0071] In addition, when no unexpected power failure event occurs during the writing of the current page group GRP, the memory controller 110 can generate the co-location PRT (WPC) of the super page {XP(0), ..., XP(WPC)} based on the data of the super page XP(WPC) and the co-location PRT (WPC-1) of the super page {XP(0), ..., XP(WPC-1)}. In particular, a bit-by-bit exclusive OR operation can be performed on the data of the super page XP(WPC) and the co-location PRT (WPC-1) to generate a bit-by-bit exclusive OR result as the co-location PRT (WPC). When an unexpected power failure event occurs during writing of the current page group GRP, the memory controller 110 may omit the fault-tolerant disk array encoding of any damaged or virtual super page XP (WPC_d), maintain the parity PRT (WPC_d) equal to the parity PRT (WPC_d-1), and generate the parity PRT (WPC) for other super pages {XP} in the current page group GRP. For example, by performing a bit-by-bit exclusive OR operation on the super page XP (WPC) and the parity PRT (WPC-1), a bit-by-bit exclusive OR result is generated as the parity PRT (WPC).

[0072] by Figure 4The page group GRP(0) shown is used as an example of the current page group GRP. When WPC=1, the memory controller may have written super page XP(0) and may write the data of super page XP(0) into the random access memory 116 as the same position PRT(0) of super page XP(0); when WPC=2, the memory controller 110 may have written super page {XP(0), XP(1)} and may perform a bit-by-bit exclusive OR operation on super page XP(1) and the same position PRT(0) to generate a bit-by-bit exclusive OR result as the super page XP(0). When WPC=3, an unexpected power failure may occur at time t1, and the memory controller 110 may regenerate the parity PRT(1) according to the data read from the super page {XP(0), XP(1)} in the unexpected power failure recovery procedure to recover the parity PRT(1) in the random access memory 116 and maintain PRT(2)=PRT(1), wherein the fault-tolerant RAID encoding of the damaged super page XP(2) should be omitted; when WPC=4, the memory controller 110 may write a virtual super page XP(3) and maintain PRT(3)=PRT(2), wherein the pause sequence number SN(3) of the metadata carried in the first page of super page XP(3) indicates that the fault-tolerant disk array encoding of the virtual super page XP(3) should be omitted; when WPC=5, the memory controller 110 may have written super pages {XP(0), ..., XP(4)} (which may include the damaged super page XP(2) and the virtual super page XP(3)), and may perform the data of super page XP(4) and the same PRT(3) (e.g., P RT(3)=PRT(2)=PRT(1)) performs a bit-by-bit exclusive OR operation to generate a bit-by-bit exclusive OR result as the same-bit PRT(4); when WPC=6, the memory controller 110 may have written super pages {XP(0),…,XP(5)} (which may include damaged super page XP(2) and virtual super page XP(3)), and may perform a bit-by-bit exclusive OR operation on the data of super page XP(5) and the same-bit PRT(4) to generate a bit-by-bit exclusive OR result as the same-bit PRT(5); the rest may be deduced in the same way. For example, when WPC=WPC1, the memory controller 110 may have written super pages {XP(0),…,XP(WPC1-1)} (which may include damaged super page XP(2) and virtual super page XP(3)), and may perform a bit-by-bit exclusive OR operation on the data of super page XP(WPC1-1) and the parity PRT(WPC1-2) to generate a bit-by-bit exclusive OR result as the above-mentioned latest parity, such as the parity PRT(WPC1-1).For better understanding, assume that G=20, and the memory controller 110 may write the co-located PRT(18) to the co-located pages of the page group GRP(0) (e.g., pages of super page XP(19)) to complete the writing of the page group GRP(0). For the sake of brevity, similar contents of these embodiments are not repeated in detail.

[0073] Figure 5 The diagram is a schematic diagram of the main working process of the method according to an embodiment of the present invention. The memory controller 110 can utilize the active block 220 to receive and store at least a portion (e.g., a portion or all) of the host write data into a current page group GRP through fault-tolerant RAID protection, wherein the current page group GRP may include G groups of pages in G super pages {XP}, such as (G*(CNT_m*CNT_p)) physical pages. For example, assuming G=20, the memory controller 110 can utilize the super block XB(4) as the active block 220 to receive and store the host write data into the current page group GRP (e.g., page group GRP(0)). In particular, at time point t1, a group of partial data may be being received and stored into super page XP(2), and an unexpected power failure event may have occurred at time point t1. Before the occurrence of the unexpected power failure event, the memory controller 110 may write the preceding data DATA(i) and the metadata METADATA(i) of the preceding data DATA(i) into at least one preceding super page XP(i) (or at least one group of preceding pages) in the active block 220, so that the metadata METADATA(i) in the at least one preceding super page XP(i) carries at least one preceding sequence number SN(i). After the occurrence of the unexpected power failure event, the memory controller 110 may perform an unexpected power failure recovery procedure, wherein the current page group GRP may be regarded as a damaged page group GRP affected by the unexpected power failure event. During the unexpected power failure recovery procedure, the memory controller 110 may write virtual data and other metadata METADATA(i) to at least one virtual super page XP(i) (or at least one group of virtual pages thereof) in the active block 220, so that the other metadata METADATA(i) carries at least one suspension sequence number SN(i) for indicating that the fault-tolerant disk array encoding of at least one virtual super page XP(i) in the above-mentioned damaged page group GRP should be omitted, wherein the at least one suspension sequence number SN(i) is equal to the last sequence number SN(i) among the above-mentioned at least one previous sequence number SN(i), and the damaged page group GRP may include the above-mentioned at least one previous super page XP(i) (or at least one group of previous pages thereof).

[0074] In step S10, before time point t1, the memory controller 110 may begin to write the data {DATA(i)} and its metadata {METADATA(i)} among the data written by the host into the super page {XP(i)} in the active block 220, so that the metadata {METADATA(i)} respectively carries the serial number {SN(i)}, wherein the serial numbers {SN(i)} respectively carried by the metadata {METADATA(i)} written in step S10 are different from each other. Therefore, the previous data DATA(i) may include data {DATA(0), DATA(1)}, the metadata METADATA(i) of the previous data DATA(i) may include metadata {METADATA(0), METADATA(1)}, the at least one group of previous pages of the above-mentioned at least one previous super page XP(i) may include two groups of (CNT_m*CNT_p) pages in the super page {XP(0), XP(1)}, and the at least one previous sequence number SN(i) carried by the metadata METADATA(i) in the above-mentioned at least one previous super page XP(i) may include the sequence number {SN(0), SN(1)} (for example, {0,1}). For example, when i=0, the memory controller 110 may write the data DATA(0) and the metadata METADATA(0) to a group of (CNT_m*CNT_p) pages (e.g., (2*2) pages) of the super page XP(0), so that the metadata METADATA(0) carries the sequence number SN(0) (e.g., 0); and when i=1, the memory controller 110 may write the data DATA(1) and the metadata METADATA(1) to a group of (CNT_m*CNT_p) pages (e.g., (2*2) pages) of the super page XP(1), so that the metadata METADATA(1) carries the sequence number SN(1) (e.g., 1). In addition, the memory controller 110 can write data {DATA(0), DATA(1)} (for example, first data and second data) into the super page {XP(0), XP(1)} in response to a set of first commands from the host device 50, wherein the set of first commands can indicate a request to write the data {DATA(0), DATA(1)} into the non-volatile memory 120.

[0075] In step S11, after time point t1, memory controller 110 may perform an unexpected power failure recovery procedure to process subsequent super pages XP(3), XP(4), and XP(5). Therefore, metadata METADATA(3) in virtual super page XP(3) may carry a suspension sequence number SN(3) equal to sequence number SN(1) (e.g., 1), metadata METADATA(4) in virtual super page XP(4) may carry sequence number SN(4) (e.g., 2), and metadata METADATA(5) in virtual super page XP(5) may carry sequence number SN(5) (e.g., 3).

[0076] After performing an unexpected power failure recovery procedure in response to an unexpected power failure event, the memory controller 110 may write the subsequent data DATA(i) and the metadata METADATA(i) of the subsequent data DATA(i) to at least one group of subsequent pages (e.g., pages of at least one subsequent super page XP(i)) in the damaged page group GRP (e.g., page group GRP(0)), so that the metadata METADATA(i) in the at least one group of subsequent pages carries at least one subsequent sequence number SN(i), wherein each sequence number SN(i) among the at least one subsequent sequence number SN(i) may be different from the last sequence number SN(i) among the at least one previous sequence number SN(i), and in particular, may be greater than the at least one previous sequence number SN(i), but the present invention is not limited thereto. Figure 5 As shown, the memory controller 110 may perform step S12 in the loop including steps S12 to S15 once or multiple times to complete the operation of writing the subsequent data DATA(i) and its metadata METADATA(i) into the at least one set of subsequent pages.

[0077] In step S12, the memory controller 110 may write the data DATA(i) and its metadata METADATA(i) among the data written by the host into the super page XP(i) in the active block 220, so that the metadata METADATA(i) carries the sequence number SN(i). In the loop including steps S12 to S15, the memory controller 110 may perform step S12 multiple times to continue writing the data DATA(i) and its metadata {METADATA(i)} among the data written by the host into the super page XP(i) in the active block 220, so that the metadata {METADATA(i)} carries the sequence number {SN(i)} respectively, wherein the sequence numbers {SN(i)} respectively carried by the metadata {METADATA(i)} written in step S12 are different from each other. Therefore, the subsequent data DATA(i) may include data {DATA(6),…,DATA(G-2), the metadata METADATA(i) of the subsequent data DATA(i) may include metadata {METADATA(6),…,METADATA(G-2)}, at least one group of subsequent pages in the above-mentioned at least one subsequent super page XP(i) may include (G-7) groups of (CNT_m*CNT_p) pages in the super page {XP(6),…,XP(G-2)}, and at least one subsequent sequence number SN(i) carried by the metadata METADATA(i) in the above-mentioned at least one subsequent super page XP(i) may include the sequence number {SN(6),…,SN(G-2)} (for example, {4,…,(G-4)}). For example, when i=6, the memory controller 110 may write the data DATA(6) and the metadata METADATA(6) into a group of (CNT_m*CNT_p) pages (e.g., (2*2) pages) in the super page XP(6), so that the metadata METADATA(6) carries the serial number SN(6) (e.g., 4); when i=7, the memory controller 110 may write the data DATA(7) and the metadata METADATA(7) into a group of (CNT_m*CNT_p) pages (e.g., (2*2) pages) in the super page XP(7), so that the metadata METADATA(7) carries the serial number SN(7) (e.g., 5); and the rest may be deduced in the same way. In addition, the memory controller 110 can write the data {DATA(6), DATA(7), ..., DATA(18)} into the super page {XP(6), XP(7), ..., XP(18)} in response to another set of first commands from the host device 50, wherein the other set of first commands indicates a request to write the data {DATA(6), DATA(7), ..., DATA(18)} into the non-volatile memory 120, but the present invention is not limited to this.For example, the memory controller 110 may write more subsequent data {DATA(i)} into more subsequent super pages {XP(i)} in response to other sets of first commands from the host device 50, where the other sets of first commands may indicate a request to write more subsequent data {DATA(i)} into the non-volatile memory 120.

[0078] In step S13, the memory controller 110 may determine whether the write page count WPC of the current page group GRP has reached a predetermined page count WPC1. If so (e.g., WPC = WPC1), it proceeds to step S14; if not (e.g., WPC < WPC1), it proceeds to step S15. The write page count WPC and the predetermined page count WPC1 may be measured in units of super pages. For example, when G = 20, WPC1 = (G - 1) = 19, but the present invention is not limited thereto. According to some embodiments, the write page count WPC and the predetermined page count WPC1 may be measured in units of physical pages. For example, when G = 20 and CNT_m = CNT_p = 2, WPC1 = ((G - 1)*(CNT_m*CNT_p)) = (19*(2*2)) = 76.

[0079] In step S14, the memory controller 110 may write a fault-tolerant disk array parity of the page group data (e.g., data {DATA(i)}) of the current page group GRP and related metadata METADATA(i) into the last super page XP(i) of the current page group GRP, so that the metadata METADATA(i) carries at least one predetermined metadata identifier (identifier) ​​MD_ID and a serial number SN(i), wherein the page group data may include the data {DATA(i)} of the current page group GRP, and the last super page XP(i) of the current page group GRP may include a group of (CNT_m*CNT_p) parity pages (e.g., (2*2) parity pages). In particular, the current page group GRP may represent the page group GRP(0), and the memory controller 110 may write a fault-tolerant disk array parity of the page group data of the page group GRP(0) into a group of (CNT_m*CNT_p) parity pages (e.g., (2*2) parity pages) in the last super page XP(19) of the page group GRP(0) to protect the page group data, wherein the page group data may include data {DATA(i)} of the page group GRP(0), such as data {DATA(0), DATA(1), DATA(4), DATA(5), . . . , DATA(18)}. For example, the memory controller 110 may utilize the fault-tolerant disk array circuit 115R to perform fault-tolerant disk array encoding on the page group data of the current page group GRP (e.g., the page group GRP(0)) to generate its fault-tolerant disk array parity. In addition, the memory controller 110 may write metadata METADATA(19) carrying a predetermined metadata identifier MD_ID to the group of (CNT_m*CNT_p) co-located pages (e.g., (2*2) co-located pages) in the last super page XP(19), so that the metadata in the first page of the super page XP(19) carries a serial number SN(19) (e.g., 17).

[0080] In step S15 , the memory controller 110 may determine whether any new first command (eg, any write command) is received from the host device 50 . If yes, the process goes to step S12 ; if no, the process goes to step S16 .

[0081] In step S16, the memory controller 110 may read the storage data from the non-volatile memory 120 in response to a set of second commands from the host device 50, wherein the set of second commands may indicate a request to read the storage data from the non-volatile memory 120. During the read operation of step S16, an uncorrectable error correction code (UECC) error of a target page group GRP_t may occur, and the memory controller 110 may perform a fault-tolerant RAID decoding procedure.

[0082] For a better understanding, this method can be Figure 5 The process is illustrated in the flowchart, but the present invention is not limited thereto. According to some embodiments, one or more steps may be performed in Figure 5 The memory controller 110 may add, delete or modify the workflow shown in the figure. For example, in the case where no unexpected power failure event occurs, the memory controller 110 may omit the unexpected power failure recovery procedure and perform the operation of step S10 without interruption, wherein step S11 may be deleted, and the operations of steps S10 and S12 may be integrated into the same step (e.g., step S12). Therefore, the memory controller 110 may process any one of the page groups GRP in the page group {GRP} of the active block 220 in a loop including steps S12 to S15. For another example, assuming that multiple unexpected power failure events occur during the period of writing the host write data to the page groups {GRP} of the active block 220, the memory controller 110 may perform the operations of steps S10 to S15 for any one of the above page groups GRP, wherein the arrow corresponding to the judgment result "yes" of step S15 should be redirected to step S10. For another example, in the case where no uncorrectable ECC error occurs, the memory controller 110 can directly read the stored data from the non-volatile memory 120 without performing the RAID decoding process. For the sake of brevity, similar contents of these embodiments are not described in detail again.

[0083] According to some embodiments, the memory controller 110 may control the metadata METADATA(i) in the super page XP(i) to carry the sequence number SN(i) in the j-th page of the super page XP(i), where "i" may be a non-negative integer, and "j" may be a positive integer in the interval [1, (CNT_m*CNT_p)]. Therefore, the metadata METADATA(i) may carry a plurality of sequence numbers {SN(i)} in a plurality of j-th pages of a plurality of super pages {XP(i)}, respectively. Figure 4 Taking the illustrated structure as an example, j=1. For the sake of brevity, similar contents of the embodiments will not be described in detail again.

[0084] According to some embodiments, the write page count WPC and the predetermined page count WPC1 may be measured in units of physical pages, in particular, when CNT_m=CNT_p=1, each of the plurality of page groups {GRP} may include G pages, such as the first (G-1) pages storing data and the last page storing the same bit of the data, wherein the parameter G may indicate the page count of each page group. For example, when G=20 and CNT_m=CNT_p=1, WPC1=((G-1)*(CNT_m*CNT_p))=(19*(1*1))=19. For the sake of brevity, similar contents of these embodiments are not repeated in detail.

[0085] Figure 6 According to an embodiment of the present invention Figure 5 The schematic diagram of the unexpected power failure recovery procedure of the main working process is shown. For example, the unexpected power failure recovery procedure may include the operations of steps S20 to S24.

[0086] In step S20, the memory controller 110 may determine whether the active block 220 (eg Figure 4 The memory controller 110 determines which page group GRP in the super block XB (4) shown in FIG. 1 is the damaged page group GRP, and in particular, determines the starting position of the damaged page group GRP. For example, during the period of receiving and storing the host write data to the active block 220, the memory controller 110 may record and update a completed page group count CNT_cpg, such as the number of multiple completed page groups {GRP} (e.g., multiple page groups {GRP} including their own co-located pages) that have been written to the active block 220, and stores the completed page group count CNT_cpg in the non-volatile memory 120, wherein the completed page group count CNT_cpg may be a non-negative integer. When performing step S20, the memory controller 110 may determine the starting position of the damaged page group GRP as the super page XP (CNT_cpg*G).

[0087] In step S21, the memory controller 110 may search for the last set of ECC-pass pages in the active block 220 to determine the location of at least one set of damaged pages (e.g., pages of damaged super page XP(2)). For example, the memory controller 110 may attempt to read one or more sets of pages (e.g., pages of one or more super pages {XP}) in the damaged page group GRP starting from the start position (or the first super page XP) of the damaged page group GRP to determine whether any uncorrectable ECC error has occurred, and in particular, back up any set of ECC-pass pages (e.g., pages of any ECC-pass super page XP) that do not have an uncorrectable ECC error to another block among the multiple blocks and attempt to read the next set of pages (e.g., pages of the next super page XP) until at least one set of damaged pages (e.g., pages of damaged super page XP(2)) having any uncorrectable ECC error is found. In addition, the memory controller 110 may record and update a non-damaged page count CNT_ndp to indicate the number of error correction code passing super pages {XP} found in the operation of step S21, and when any of the above error correction code passing super pages XP is found, the non-damaged page count CNT_ndp may be incremented by an increment (e.g., 1), wherein the non-damaged page count CNT_ndp may have an initial value (e.g., 0) and may be measured in units of super pages, but the present invention is not limited thereto. According to some embodiments, the non-damaged page count CNT_ndp may be measured in units of physical pages.

[0088] In step S22, the memory controller 110 may write the virtual data and other metadata METADATA(i) into the at least one virtual super page XP(i) so that the other metadata METADATA(i) carries the at least one suspension sequence number SN(i). In particular, the virtual data and metadata METADATA(3) may be written into a group of (CNT_m*CNT_p) virtual pages (e.g., (2*2) virtual pages) of the virtual super page XP(3) so that the metadata METADATA(3) carries the suspension sequence number SN(3) equal to the sequence number SN(1) (e.g., 1) to indicate that the fault-tolerant disk array encoding of the group of (CNT_m*CNT_p) virtual pages in the damaged page group GRP should be omitted. The memory controller 110 may write any group of virtual pages among the at least one group of virtual pages (e.g., pages of the virtual super page XP(3)) into the active block 220 and attempt to read any of the group of virtual pages to determine whether any uncorrectable ECC error occurs. For example, if no uncorrectable ECC error occurs (which indicates that the operation of step S22 is completed), the memory controller 110 may prevent repeated operations of writing to any of the above-mentioned groups of virtual pages and attempting to read any of the above-mentioned groups of virtual pages for any subsequent position in the damaged page group GRP (e.g., the position of super page XP(4)), wherein the above-mentioned at least one group of virtual pages may include a single group of virtual pages (e.g., Figure 4 otherwise, the memory controller 110 may repeat these operations for a subsequent location in the damaged page group GRP (e.g., the location of super page XP(4)) until no uncorrectable ECC errors occur, wherein the at least one group of virtual pages may include two or more groups of virtual pages, such as pages of super pages XP(3), XP(4), etc.

[0089] In step S23, the memory controller 110 may determine whether the non-damaged page count CNT_ndp is greater than 0. If so, the process proceeds to step S24. If not, Figure 6The workflow shown ends. The memory controller 110 may determine whether at least one group of first non-damaged pages (e.g., pages of any of the above-mentioned error correction codes passing through super page XP) exists in the damaged page group GRP during step S21. For example, for the case where any of the above-mentioned error correction codes passing through super page XP is found in the operation of step S21, the above-mentioned at least one group of first non-damaged pages, such as pages of multiple error correction codes passing through super page {XP} (e.g., pages of non-damaged super pages XP(0) and XP(1)), may have been backed up to other blocks by the memory controller 110, and its backup data may be protected in the other blocks to prevent any data loss that may be caused by the operation of step S21. Figure 4 The page group GRP(0) shown is used as an example of a damaged page group GRP. The backup data of the at least one group of first non-damaged pages may include backup data DATA(0), backup metadata METADATA(0), backup data DATA(1) and backup metadata METADATA(1), wherein the backup data DATA(0) and the backup metadata METADATA(0) may be respectively equal to the data DATA(0) and the metadata METADATA(0) originally stored in the super page XP(0), and the backup data DATA(1) and the backup metadata METADATA(1) may be respectively equal to the data DATA(1) and the metadata METADATA(1) originally stored in the super page XP(1).

[0090] In step S24, when CNT_ndp>0, the memory controller 110 may write the backup data {DATA(i)} and its metadata {METADATA(i)} into the super page {XP(i)} in the active block 220, so that the metadata {METADATA(i)} respectively carries the non-suspended sequence number {SN(i)}. Therefore, the memory controller 110 may write the backup data of the above-mentioned at least one group of first non-damaged pages into the active block (e.g., super block XB(4)) to generate at least one group of second non-damaged pages (e.g., pages of super pages XP(4) and XP(5)) for protection by a group of co-located pages (e.g., pages of super page XP(G-1)) after completing the fault-tolerant disk array encoding of the damaged page group GRP (e.g., page group GRP(0)). For example, the damaged page group GRP may represent Figure 4In the page group GRP(0) shown in FIG. 1 , in this case, when i=4, the memory controller 110 can read the backup data DATA(0) and the backup metadata METADATA(0) from the other blocks as the backup data DATA(4) and its metadata METADATA(4), respectively, change the sequence number SN(0) carried by the metadata METADATA(4) to the sequence number SN(2), and write the backup data DATA(4) and the metadata METADATA(4) to a group of (CNT_m*CNT_p) pages (e.g., (2*2) pages) in the super page XP(4), so that the metadata METADATA(4) carries the sequence number SN (4) (for example, 2); and when i=5, the memory controller 110 can read the backup data DATA(1) and the backup metadata METADATA(1) from the other blocks as the backup data DATA(5) and its metadata METADATA(5), respectively, change the serial number SN(1) carried by the metadata METADATA(5) to the serial number SN(3), and write the backup data DATA(5) and the metadata METADATA(5) to a group of (CNT_m*CNT_p) pages (for example, (2*2) pages) in the super page XP(5), so that the metadata METADATA(5) carries the serial number SN(5) (for example, 3).

[0091] For a better understanding, this method can be Figure 6 The process is illustrated in the flowchart, but the present invention is not limited thereto. According to some embodiments, one or more steps may be performed in Figure 6 Add, delete or modify the workflow shown.

[0092] Figure 7 According to an embodiment of the present invention Figure 5A schematic diagram of some implementation details related to the fault-tolerant RAID decoding procedure in the main workflow is shown. In response to the occurrence of an uncorrectable ECC error in the target page group GRP_t, the memory controller 110 may perform related operations in the fault-tolerant RAID decoding procedure, wherein the fault-tolerant RAID decoding procedure may include operations of steps S31 to S38, but the present invention is not limited thereto. According to some embodiments, the fault-tolerant RAID decoding procedure may vary. For example, the memory controller 110 may read multiple groups of pages in the target page group GRP_t (e.g., multiple groups of (CNT_m*CNT_p) pages in the super page {XP(i)} in the target page group GRP_t), and determine whether the metadata METADATA(i) read from a group of (CNT_m*CNT_p) pages in the super page XP(i) carries any pause sequence number SN for selecting a page to be decoded, wherein the any pause sequence number SN may represent any sequence number SN(i) that is equal to a previous sequence number SN carried by previous metadata METADATA read from a group of previous pages in the multiple groups of pages. Therefore, the memory controller 110 may decode at least a portion of the pages in the multiple groups of pages without using any non-RAID-encoded page to recover the target page group GRP_t. In addition, the target page group GRP_t may represent a certain page group GRP storing data among all page groups {GRP} of a super block XB.

[0093] In step S31, the memory controller 110 may read a super page XP(i) within the target page group GRP_t, and in particular, may read a group of (CNT_m*CNT_p) pages (e.g., (2*2) pages) in the super page XP(i) within the target page group GRP_t. For example, when step S31 is performed for the first time during processing of the target page group GRP_t, the memory controller 110 may read the starting super page XP(i) within the target page group GRP_t; and when step S31 is performed again during processing of the target page group GRP_t, the memory controller 110 may read a subsequent super page XP(i) within the target page group GRP_t.

[0094] In step S32, the memory controller 110 may determine whether an uncorrectable error correction code error occurs in super page XP(i). If so, re-enter step S31 to read the next super page XP, where the index i may be incremented by a predetermined increment (e.g., 1) (marked as "i++" for simplicity); if not, enter step S33.

[0095] In step S33 , the memory controller 110 may determine whether the metadata METADATA(i) read from the super page XP(i) (or the group of (CNT_m*CNT_p) pages therein) carries a predetermined metadata identifier MD_ID. If yes, the process proceeds to step S37 ; if not, the process proceeds to step S34 .

[0096] In step S34, the memory controller 110 may determine whether the metadata METADATA(i) read from the super page XP(i) (or the group of (CNT_m*CNT_p) pages therein) carries any pause sequence number SN. If yes, the process proceeds to step S35; if no, the process proceeds to step S36.

[0097] In step S35, the memory controller 110 may determine the group of (CNT_m*CNT_p) pages in the super page XP(i) as a group of non-FAD RAID coded pages, wherein the group of non-FAD RAID coded pages may represent a group of pages that are not involved in the FAD RAID coded pages of the target page group GRP_t, such as a group of pages that are not used in the calculation of the FAD parity of the target page group GRP_t. For example, the target page group GRP_t may represent Figure 4 As shown in the page group GRP(0), in this case, when i=3, the memory controller 110 may determine the group of (CNT_m*CNT_p) pages (eg, (2*2) pages) in the virtual super page XP(3) as the group of non-fault-tolerant RAID code pages.

[0098] In step S36, the memory controller 110 may determine the group of (CNT_m*CNT_p) pages in the super page XP(i) as a group of RAID-encoded pages, wherein the group of RAID-encoded pages may represent a group of pages related to the RAID encoding of the target page group GRP_t, such as a group of pages used in the calculation of the RAID parity of the target page group GRP_t. For example, the target page group GRP_t may represent Figure 4 As shown in the page group GRP(0), in this case, when i=4, the memory controller 110 can determine the group of (CNT_m*CNT_p) pages (e.g. (2*2) pages) in the virtual super page XP(4) as the group of fault-tolerant disk array code pages; the rest can be deduced in the same way.

[0099] In step S37, the memory controller 110 may utilize the fault-tolerant disk array circuit 115R to decode most of the pages (e.g., multiple groups of fault-tolerant disk array code pages) among the multiple groups of pages, without utilizing any non-fault-tolerant disk array code pages (e.g., damaged super pages XP with uncorrectable ECC errors and virtual super pages XP with a suspension sequence number SN), to recover the target page group GRP_t. Figure 4 Taking the structure shown as an example, the target page group GRP_t may represent the page group GRP(0) in the super block XB(4), and an uncorrectable ECC error is detected in a super page among the super pages {XP(0), XP(1), XP(4), XP(5), ..., XP(19)}. In this case, the memory controller 110 may utilize the RAID circuit 115R to perform RAID decoding on all super pages among the super pages {XP(0), XP(1), XP(4), XP(5), ..., XP(19)} in the page group GRP(0) that do not have the uncorrectable ECC error, without utilizing the damaged super page XP(2) and the virtual super page XP(3) that are not involved in the RAID encoding of the page group GRP(0) to recover the super page with the uncorrectable ECC error. In addition, assuming that when the host writes data to Figure 4 No more unexpected power failure events occur during the period in the super block XB(4) shown, and the target page group GRP_t may represent a subsequent page group GRP, such as one of the page groups GRP(1), GRP(2), etc. When an uncorrectable ECC error is detected in a super page XP in the subsequent page group GRP, the memory controller 110 may utilize the RAID circuit 115R to perform RAID decoding on all super pages {XP} in the subsequent page group GRP that do not have an uncorrectable ECC error except for the super page XP that has the uncorrectable ECC error.

[0100] In step S38 , the memory controller 110 may determine whether the next target page group GRP_t needs to be processed. If yes, the process proceeds to step S31 to read the next super page XP. If no, the process shown in FIG. 7 ends.

[0101] For a better understanding, the RAID decoding process can be found by Figure 7 The process is illustrated in the flowchart, but the present invention is not limited thereto. According to some embodiments, one or more steps may be performed in Figure 7 For example, the target page group GRP_t can represent Figure 4The page group GRP(0) shown, and an uncorrectable ECC error is detected in the damaged super page XP(2), wherein no sequence number SN(2) can be correctly read from the first page of the super page XP(2), and the fault-tolerant disk array encoding of the damaged super page XP(2) should be omitted. In addition, the suspension sequence number SN(3) carried by the metadata in the first page of the super page XP(3) can indicate that the fault-tolerant disk array encoding of the virtual super page XP(3) should be omitted, and can also indicate the existence of the damaged super page XP(2). Based on the suspension sequence number SN(3) carried by the metadata METADATA(3) in the super page XP(3), the memory controller 110 can detect that the super page XP(2) is a damaged super page, and delete the uncorrectable ECC error located in the damaged super page XP(2) in response to this detection. For the sake of brevity, similar contents of these embodiments will not be repeated in detail here.

[0102] exist Figure 6 and Figure 7 In the illustrated embodiment, the group of (CNT_m*CNT_p) pages mentioned in some steps may include multiple physical pages in a super page XP accessed by a physical page address, but the present invention is not limited thereto. According to some embodiments, when CNT_m=CNT_p=1, the multiple physical pages may be replaced by a single physical page accessed by the physical page address. For the sake of brevity, similar contents of these embodiments will not be described in detail again.

[0103] According to some embodiments, the memory controller 110 may configure the sequence number {SN(i)} of the active block 220 as an increasing sequence, and in particular, may configure all non-pause sequence numbers {SN(i)} of the active block 220 as a strictly increasing sequence, such as an arithmetic sequence {0,1,2,...}, but the present invention is not limited thereto. According to some embodiments, the memory controller 110 may configure the sequence number {SN(i)} of the active block 220 as a decreasing sequence, and in particular, may configure all non-pause sequence numbers {SN(i)} of the active block 220 as a strictly decreasing sequence, such as an arithmetic sequence {SN_Max, (SN_Max-1), (SN_Max-2),..., 2,1,0}, where "SN_Max" may be a positive integer. Therefore, each of the at least one subsequent sequence number SN(i) may be smaller than the at least one previous sequence number SN(i). For the sake of brevity, similar contents of the embodiments are not described in detail again.

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

Claims

1. A method for data access management of a memory device in a predetermined communication architecture, the method enhancing unexpected power failure recovery of a fault-tolerant disk array protection based on page groups by means of suspendable sequence numbers, and applied to a memory controller of the memory device, the memory device comprising the memory controller and a non-volatile memory, the non-volatile memory comprising at least one non-volatile memory element, the at least one non-volatile memory element comprising a plurality of blocks, the method comprising: Before an unexpected power failure event occurs, using the memory controller to write preceding data and metadata of the preceding data into at least one set of preceding pages in a first active block among the plurality of blocks, so that the metadata in the at least one set of preceding pages carries at least one preceding sequence number; After the unexpected power failure event occurs, the memory controller is used to respond to the unexpected power failure event to perform an unexpected power failure recovery procedure, wherein the unexpected power failure recovery procedure includes: Determining a starting position of a damaged page group; and Writing dummy data and other metadata to at least one set of virtual pages in the first active block such that the other metadata carries at least one pause sequence number for indicating that the at least one set of virtual pages in the damaged page group should be omitted from the fault-tolerant disk array encoding, wherein the at least one pause sequence number is equal to a last sequence number among the at least one previous sequence number, and the damaged page group includes the at least one previous page; as well as After performing the unexpected power failure recovery procedure in response to the unexpected power failure event, the memory controller is used to write subsequent data and metadata of the subsequent data into at least one group of subsequent pages in the damaged page group, so that the metadata in the at least one group of subsequent pages carries at least one subsequent sequence number, wherein each of the at least one subsequent sequence number is different from the last sequence number among the at least one previous sequence number.

2. The method according to claim 1, characterized in that Each of the at least one subsequent sequence number is greater than the at least one prior sequence number.

3. The method according to claim 1, characterized in that Before the unexpected power-off event occurs, the memory controller is used to write first data and first metadata of the first data into a group of first pages in the first active block so that the first metadata carries a first sequence number, and write second data and second metadata of the second data into a group of second pages in the first active block so that the second metadata carries a second sequence number, wherein the second sequence number is different from the first sequence number, the previous data contains the first data and the second data, and the at least one group of previous pages includes the group of first pages and the group of second pages.

4. The method according to claim 3, characterized in that The unexpected power outage recovery procedure also includes: Writing the third data and the third metadata of the third data into a set of third pages, so that the third metadata carries a third serial number; as well as The fourth data and fourth metadata of the fourth data are written into a set of fourth pages, so that the fourth metadata carries a fourth serial number, wherein the fourth serial number is different from the third serial number.

5. The method according to claim 1, characterized in that The unexpected power outage recovery procedure also includes: determining whether at least one set of first non-damaged pages exists in the damaged page group, wherein the at least one set of previous pages is detected as the at least one set of first non-damaged pages; In response to the existence of the at least one group of first non-damaged pages in the damaged page group, data of the at least one group of first non-damaged pages is written into the first active block to generate at least one group of second non-damaged pages to be protected by a group of co-located pages after the fault-tolerant disk encoding of the damaged page group is completed.

6. The method according to claim 5, characterized in that The step of writing the data of the at least one set of first non-damaged pages into the first active block to generate the at least one set of second non-damaged pages further comprises: Backing up the data of the at least one group of first non-damaged pages to another block among the plurality of blocks to serve as backup data of the at least one group of first non-damaged pages; as well as The backup data of the at least one set of first non-damaged pages is written into the first active block to generate the at least one set of second non-damaged pages.

7. The method according to claim 1, characterized in that The unexpected power outage recovery procedure also includes: The last set of error correction code passing pages in the first active block is found to determine a position of at least one set of damaged pages.

8. The method according to claim 7, characterized in that The step of finding the last set of error correction code passing pages in the first active block to determine the position of the at least one set of damaged pages further comprises: Reading one or more groups of pages in the damaged page group from the starting position of the damaged page group to determine whether any uncorrectable ECC error occurs; as well as Any set of ECCs without uncorrectable ECC errors is backed up to another block among the multiple blocks through pages and the next set of pages is read until the at least one set of damaged pages with any uncorrectable ECC errors is found.

9. The method according to claim 1, characterized in that In response to an uncorrectable ECC error of a target page group, the memory controller is used to perform a fault-tolerant RAID decoding procedure; and the fault-tolerant RAID decoding procedure includes: Reading a plurality of groups of pages in the target page group, and determining whether metadata read from a group of pages in the plurality of groups of pages carries any pause sequence number, wherein the any pause sequence number represents any sequence number equal to a previous sequence number, and previous metadata read from a group of previous pages in the plurality of groups of pages carries the previous sequence number; Selectively determining the group of pages as a group of non-fault-tolerant RAID code pages according to whether the metadata read from the group of pages carries any of the pause sequence numbers; as well as At least a portion of the plurality of groups of pages are decoded without utilizing any set of non-fault-tolerant disk array encoding pages to recover the target group of pages.

10. The method according to claim 9, characterized in that: If the metadata read from the set of pages carries any of the pause sequence numbers, the memory controller is used to determine the set of pages as the set of non-fault-tolerant RAID code pages; as well as If the metadata read from the set of pages does not carry any of the pause numbers, the memory controller is configured to determine the set of pages as a set of fault-tolerant disk array encoding pages for use during decoding of the at least a portion of the plurality of sets of pages.

11. The method according to claim 1, characterized in that The step of writing the virtual data and the other metadata into the at least one group of virtual pages in the active block so that the other metadata carries the pause sequence number further comprises: Writing the virtual data and the other metadata into any group of virtual pages among the at least one group of virtual pages and reading the any group of virtual pages to determine whether any uncorrectable error correction code error occurs; as well as If any of the uncorrectable error correction code errors occurs, the operation of writing the virtual data and the other metadata into the any group of virtual pages and reading the any group of virtual pages is repeated for a subsequent position in the damaged page group until no uncorrectable error correction code errors occur, otherwise, the operation of writing the virtual data and the other metadata into the any group of virtual pages and reading the any group of virtual pages is prevented from being repeated for any subsequent position in the damaged page group.

12. A memory controller of a memory device, the memory device comprising the memory controller and a non-volatile memory, the non-volatile memory comprising at least one non-volatile memory element, the at least one non-volatile memory element comprising a plurality of blocks, the memory controller comprising: a processing circuit for controlling the memory controller according to a plurality of host commands from a host device to allow the host device to access the non-volatile memory through the memory controller, wherein the processing circuit is used to perform data access management of the memory device in a predetermined communication framework to enhance unexpected power failure recovery of a fault-tolerant RAID protection based on page groups by means of suspendable sequence numbers; in: Before an unexpected power failure event occurs, the memory controller writes the previous data and metadata of the previous data into at least one set of previous pages in a first active block among the plurality of blocks, so that the metadata in the at least one set of previous pages carries at least one previous sequence number; After the unexpected power failure event occurs, the memory controller performs an unexpected power failure recovery procedure in response to the unexpected power failure event, wherein the unexpected power failure recovery procedure includes: Determining a starting position of a damaged page group; and Writing dummy data and other metadata to at least one set of virtual pages in the first active block such that the other metadata carries at least one pause sequence number for indicating that the at least one set of virtual pages in the damaged page group should be omitted from the fault-tolerant disk array encoding, wherein the at least one pause sequence number is equal to a last sequence number among the at least one previous sequence number, and the damaged page group includes the at least one previous page; as well as After performing the unexpected power failure recovery procedure in response to the unexpected power failure event, the memory controller writes subsequent data and metadata of the subsequent data to at least one group of subsequent pages in the damaged page group, so that the metadata in the at least one group of subsequent pages carries at least one subsequent sequence number, wherein each of the at least one subsequent sequence number is different from the last sequence number among the at least one previous sequence number.

13. A memory device comprising the memory controller according to claim 12, wherein the memory device comprises: The non-volatile memory is used to store information; and The memory controller is coupled to the non-volatile memory and is used to control the operation of the memory device.

14. An electronic device comprising the memory device of claim 13, and further comprising: The host device is coupled to the memory device, wherein the host device includes: at least one processor for controlling the operation of the host device; as well as a power supply circuit coupled to the at least one processor and configured to provide power to the at least one processor and the memory device; The memory device provides storage space for the host device.