Data write method and memory controller
Through various randomization operations and verification mechanisms, the uniform distribution of data in the 3D NAND flash memory is ensured, solving the problem of uneven data distribution in existing technologies and improving storage reliability and device lifespan.
Patent Information
- Application Number
- CN202510064946.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-15
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2045-01-15
AI Technical Summary
In existing technologies, the data randomization methods for 3D NAND flash memory are ineffective and lack effective verification mechanisms, resulting in uneven data distribution, which affects storage performance and reliability. In particular, in high-density storage scenarios, it may cause read and write interference, shortening the lifespan of the device.
A combination of randomization operations and randomization verification mechanisms is employed, including XOR operation, shift operation, permutation operation, dynamic random seed operation, and grouping operation, to process the original data multiple times. The randomization quality of the written data is verified to ensure its uniform distribution.
It improves the reliability and performance of data storage, optimizes storage efficiency, extends device lifespan, and provides an adaptive data management solution.
Smart Images

Figure CN119847447B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of semiconductor storage, and in particular, to a data writing method for a rewritable non-volatile memory module and a memory controller using the method. BACKGROUND
[0002] With the rapid development of information technology, non-volatile storage devices are increasingly widely used in various electronic products. In particular, three-dimensional NAND flash memory has become the mainstream of current non-volatile storage technology due to its high storage density, low cost, and excellent performance. However, as the storage density continues to increase, the reliability of data and the interference between storage units have become increasingly prominent.
[0003] In order to improve the reliability of data storage and reduce the interference between units, data randomization technology is widely used in NAND flash memory. Traditional data randomization methods usually use a single randomization algorithm, such as a simple XOR operation or a fixed permutation table. Although this method improves the data distribution to some extent, it often does not meet expectations in the face of increasingly complex three-dimensional NAND flash memory structures.
[0004] In addition, the prior art generally lacks an effective verification mechanism for the randomization result. Without verifying the quality of randomization, directly writing data may result in certain data patterns still not being uniformly distributed in the memory, thereby affecting storage performance and reliability. Especially in high-density storage scenarios, improper data distribution may cause read interference, write interference, and other problems, thereby shortening the service life of the storage device. SUMMARY
[0005] The purpose of the present application is to solve the above problems, which can perform multiple randomization operations and effectively verify the quality of randomization to ensure that the data written to the memory has good random distribution characteristics, thereby improving the reliability and performance of storage.
[0006] One or more embodiments of the present application provide a data writing method for a rewritable non-volatile memory module having a plurality of storage units. The method comprises: obtaining original data from a host system; performing a plurality of randomization operations on the original data to obtain a plurality of write data; performing a randomization verification operation on each write data to obtain a target write data in the plurality of write data, wherein the quality of randomization of the target write data is determined to be qualified; and storing the target write data to a plurality of target storage units among the plurality of storage units.
[0007] In one or more embodiments of the present application, wherein each randomization operation uses a different randomization algorithm to process the original data, wherein the different randomization algorithm comprises at least one of: an exclusive-OR (XOR) operation, XORing the original data with a predefined different plurality of random sequences; a bit-shifting operation, applying a different plurality of cyclic bit-shifting or logical bit-shifting to the original data; a permutation operation, changing the order of bits in the original data according to a predefined different plurality of permutation tables; a dynamic random seed operation, generating a different plurality of random seeds based on system time, data address or other system variables, and using the plurality of random seeds and the original data to generate the plurality of write data; and a grouping operation, dividing the original data into a plurality of sub-blocks, and applying a different one of the XOR operation, the bit-shifting operation, the permutation operation, and the dynamic random seed operation to the plurality of sub-blocks.
[0008] In one or more embodiments of the present application, wherein the step of performing the randomization verification operation on each write data comprises: obtaining a plurality of bit values of the write data, each bit value corresponding to one of N bit states, wherein N is 2 X , and X is the number of bits that each memory cell can store; based on the plurality of bit values, obtaining N state proportions of the write data corresponding to the N bit states; and based on the N state proportions, obtaining a quality of the randomization of the write data.
[0009] In one or more embodiments of the present application, wherein the step of performing the randomization verification operation on each write data further comprises: based on the N bit states, obtaining a reference proportion value; and based on the N state proportions and the reference proportion value, obtaining the quality of the randomization of the write data.
[0010] In one or more embodiments of the present application, wherein the step of performing the randomization verification operation on each write data further comprises: based on the plurality of bit values, obtaining N deviation values between the N state proportions and the reference proportion value; determining a maximum deviation value among the N deviation values; if the maximum deviation value is not greater than a first preset threshold, determining that the quality of the randomization of the write data is qualified; and if the maximum deviation value is greater than the first preset threshold, determining that the quality of the randomization of the write data is unqualified.
[0011] In one or more embodiments of the present application, wherein after determining that the quality of the randomization of the write data is unqualified, the method further comprises: obtaining an abnormal bit state corresponding to the maximum deviation value among the N bit states; and recording the abnormal bit state.
[0012] In one or more embodiments of the present application, wherein if the quality of the randomization of the plurality of write data is all unqualified, the method further comprises: according to the abnormal bit state, adjusting the plurality of randomization operations to regenerate a new plurality of write data; and performing the randomization verification operation on each new write data again to attempt to obtain the target write data, and then storing the target write data to the plurality of target storage units.
[0013] In one or more embodiments of the present application, wherein the step of performing the randomization verification operation on each write data further comprises: based on the plurality of bit values, obtaining N deviation values between the N state proportions and the reference proportion value; determining a maximum deviation value in the N deviation values; if the maximum deviation value is not greater than the first preset threshold, determining that the quality of the randomization of the write data is qualified; if the maximum deviation value is greater than the first preset threshold, determining that the quality of the randomization of the write data is unqualified, and determining whether the maximum deviation value is greater than a second preset threshold, wherein if the maximum deviation value is greater than the second preset threshold, obtaining one or more target deviation values in the N deviation values greater than the first preset threshold.
[0014] In one or more embodiments of the present application, wherein after determining that the quality of the randomization of the write data is unqualified, the method further comprises: if the maximum deviation value is not greater than the second preset threshold, obtaining an abnormal bit state corresponding to the maximum deviation value in the N bit states and recording the abnormal bit state; and if the maximum deviation value is greater than the second preset threshold, obtaining one or more abnormal bit states corresponding to the one or more target deviation values in the N bit states and recording the one or more abnormal bit states.
[0015] One or more embodiments of the present application provide a memory controller suitable for a storage device configured with a rewritable non-volatile memory module, wherein the storage device is electrically connected to a host system. The memory controller comprises a memory interface control circuit electrically connected to the rewritable non-volatile memory module, wherein the rewritable non-volatile memory module has a plurality of storage units; and a processor electrically connected to the memory interface control circuit. The processor is configured to: obtain original data from a host system; perform a plurality of randomization operations on the original data to obtain a plurality of write data; perform a randomization verification operation on each write data to obtain a target write data in the plurality of write data, wherein the quality of the randomization of the target write data is determined to be qualified; and store the target write data to a plurality of target storage units among the plurality of storage units.
[0016] Based on the above, the data writing method and the memory controller provided by the present application have outstanding advantages in improving data randomization quality, optimizing storage efficiency, prolonging device life, etc. An efficient, reliable and adaptive solution is provided for data storage management of non-volatile storage devices. BRIEF DESCRIPTION OF DRAWINGS
[0017] The accompanying drawings are included to provide a further understanding of the present application, and are incorporated in and constitute a part of this specification. The drawings illustrate embodiments of the present application and, together with the description, serve to explain the principles of the present application.
[0018] Figure 1 A block diagram of a host system and a storage device according to an embodiment of the present application;
[0019] Figure 2 A flowchart of a data writing method according to an embodiment of the present application;
[0020] Figure 3 A schematic diagram of a randomization operation according to an embodiment of the present application;
[0021] Figure 4 A schematic diagram of a three-dimensional circuit architecture of a plurality of storage units of a rewritable non-volatile memory module according to an embodiment of the present application;
[0022] Figure 5 A flowchart of a randomization verification operation according to an embodiment of the present application.
[0023] DETAILED DESCRIPTION
[0024] 10: host system
[0025] 20: storage device
[0026] 211: first processor
[0027] 110: second processor
[0028] 120: host memory
[0029] 130: data transfer interface circuit
[0030] 210: memory controller
[0031] 212: data management circuit
[0032] 213: memory interface control circuit
[0033] 214: buffer memory
[0034] 220: rewritable non-volatile memory module
[0035] 230: connection interface circuit
[0036] S210-S240: flow steps of memory testing method
[0037] OD1, OD2: original data
[0038] WD1-WD4: write data
[0039] A31-A34: arrow
[0040] WL0-WL3: word line
[0041] BL0-BL2: bit line
[0042] CSTR: cell string
[0043] SL0-SL2: string line
[0044] SSL: source select line
[0045] GSL: ground select line
[0046] CSL: common source line
[0047] MCT: memory cell transistor
[0048] SST: source select transistor
[0049] GST: ground select transistor
[0050] S510-S580: flow steps of randomization verification operation DETAILED DESCRIPTION
[0051] Reference will now be made in detail to the exemplary embodiments of the present application, examples of which are illustrated in the accompanying drawings. Wherever possible, the same reference numbers are used in the drawings and the description to refer to the same or like parts.
[0052] Figure 1 A block diagram of a host system and a memory device according to embodiments of the present application is shown. Please refer to FIG. 1. Figure 1The host system 10 is, for example, a personal computer, a notebook computer, or a server. The host system 10 includes a processor 110 (also referred to as a second processor) and a host memory 120, and a data transfer interface circuit 130. In this embodiment, the processor 110 is coupled to (also referred to as electrically connected to) the host memory 120 and the data transfer interface circuit 130. In another embodiment, the processor 110, the host memory 120, and the data transfer interface circuit 130 are electrically connected to each other by a system bus. In this embodiment, the processor 110, the host memory 120, and the data transfer interface circuit 130 can be disposed on a host board of the host system 10. In this embodiment, the original data is, for example, user data transmitted by the host system 10 to the storage device 20, or data that has not been subjected to a randomization operation.
[0053] The storage device 20 includes a storage controller 210, a rewritable non-volatile memory module 220, and a connection interface circuit 230. The storage controller 210 includes a processor 211 (also referred to as a first processor), a data management circuit 212, and a memory interface control circuit 213.
[0054] In this embodiment, the host system 10 performs a data access operation by being electrically connected to the storage device 20 through the data transfer interface circuit 130 and the connection interface circuit 230 of the storage device 20. For example, the host system 10 can store data to the storage device 20 or read data from the storage device 20 via the data transfer interface circuit 130.
[0055] In the present embodiment, the number of data transfer interface circuits 130 can be one or more. Through the data transfer interface circuits 130, the host board can be electrically connected to the storage device 20 via wired or wireless means. The storage device 20 can be, for example, a USB flash drive, a memory card, a solid state drive (SSD), or a wireless memory storage device. The wireless memory storage device can be, for example, a Near Field Communication (NFC) memory storage device, a WiFi memory storage device, a Bluetooth memory storage device, or a Bluetooth Low Energy memory storage device (e.g., iBeacon), or the like memory storage device based on various wireless communication technologies. In addition, the host board can also be electrically connected to various I / O devices such as a Global Positioning System (GPS) module, a network interface card, a wireless transmission device, a keyboard, a screen, a speaker, and the like via a system bus.
[0056] In the present embodiment, the data transfer interface circuit 130 and the connection interface circuit 230 are interface circuits compatible with the Peripheral Component Interconnect Express (PCI Express) standard. In addition, data transfer between the data transfer interface circuit 130 and the connection interface circuit 230 is performed using the Non-Volatile Memory express (NVMe) communication protocol.
[0057] In addition, in another embodiment, the connection interface circuit 230 can be packaged in a chip with the memory controller 210, or the connection interface circuit 230 can be disposed outside a chip containing the memory controller 210.
[0058] In the present embodiment, the host memory 120 is used to temporarily store instructions or data executed by the processor 110. For example, in the present embodiment, the host memory 120 can be a Dynamic Random Access Memory (DRAM), a Static Random Access Memory (SRAM), or the like. However, it must be understood that the present application is not limited thereto, and the host memory 120 can also be other suitable memories.
[0059] The memory controller 210 is used to execute a plurality of logic gates or control instructions implemented in a hardware type or a firmware type and perform operations such as writing, reading, and erasing data in the rewritable non-volatile memory module 220 according to instructions of the host system 10.
[0060] In more detail, the processor 211 in the memory controller 210 is a hardware with computing capability, which is used to control the overall operation of the memory controller 210. Specifically, the processor 211 is programmed with a plurality of control instructions / program codes, and when the storage device 20 is operated, the control instructions / program codes are executed to perform operations such as writing, reading and erasing data. In addition, in the present embodiment, the control instructions / program codes can also be executed to perform a data writing operation, a randomization verification operation or a randomization operation, so as to implement the data writing method provided by the present application. The control instructions / program codes corresponding to the data writing method can also be implemented as a circuit unit in hardware form, so as to implement the data writing method provided by the present application.
[0061] It is worth mentioning that, in the present embodiment, the processor 110 and the processor 211 are, for example, a central processing unit (CPU), a micro-processor, or other programmable processing units (Microprocessor), a digital signal processor (DSP), a programmable controller, an application specific integrated circuit (ASIC), a programmable logic device (PLD) or other similar circuit components, and the present application is not limited thereto.
[0062] In the present embodiment, as described above, the memory controller 210 further includes a data management circuit 212 and a memory interface control circuit 213. It should be noted that the operations performed by the components of the memory controller 210 can also be considered as operations performed by the memory controller 210.
[0063] The data management circuit 212 is electrically connected to the processor 211, the memory interface control circuit 213, and the connection interface circuit 230. The data management circuit 212 is used to accept the indication of the processor 211 to perform data transmission. For example, data is read from the host system 10 (e.g., the host memory 120) via the connection interface circuit 230, and the read data is written into the rewritable non-volatile memory module 220 via the memory interface control circuit 213 (e.g., a write operation is performed according to a write instruction from the host system 10). For another example, data is read from one or more physical units of the rewritable non-volatile memory module 220 (the data can be read from one or more storage units of one or more physical units) via the memory interface control circuit 213, and the read data is written into the host system 10 (e.g., the host memory 120) via the connection interface circuit 230 (e.g., a read operation is performed according to a read instruction from the host system 10). In another embodiment, the data management circuit 212 can also be integrated into the processor 211.
[0064] The memory interface control circuit 213 is used to accept the indication of the processor 211 to perform a write (also referred to as programming) operation, a read operation, or an erase operation on the rewritable non-volatile memory module 220 in cooperation with the data management circuit 212.
[0065] In addition, the data to be written into the rewritable non-volatile memory module 220 is converted into a format acceptable to the rewritable non-volatile memory module 220 via the memory interface control circuit 213. Specifically, if the processor 211 wants to access the rewritable non-volatile memory module 220, the processor 211 transmits a corresponding instruction sequence to the memory interface control circuit 213 to instruct the memory interface control circuit 213 to perform a corresponding operation. For example, the instruction sequence can include a write instruction sequence to instruct writing data, a read instruction sequence to instruct reading data, an erase instruction sequence to instruct erasing data, and corresponding instruction sequences to instruct various memory operations. The instruction sequence can include one or more signals, or data on a bus. The signal or data can include an instruction code or a program code. For example, in the read instruction sequence, information such as a read identification code, a memory address, a physical address, etc. is included.
[0066] In addition, the memory controller 210 establishes a logical to physical address mapping table and a physical to logical address mapping table to record the mapping relationship between the logical addresses of the logical units (e.g., logical blocks, logical pages) configured to the rewritable non-volatile memory module 220 and the physical addresses of the physical units (e.g., physical erase units / physical blocks, physical pages). In other words, the memory controller 210 can look up the physical unit mapped by a logical unit (e.g., look up the physical page mapped by a logical page; look up the physical address mapped by a logical address) through the logical to physical address mapping table (also referred to as a logical to physical mapping table), and the memory controller 210 can look up the logical unit mapped by a physical unit (e.g., look up the logical page mapped by a physical page; look up the logical address mapped by a physical address) through the physical to logical address mapping table (also referred to as a physical to logical mapping table).
[0067] In an embodiment, the memory controller 210 further includes a buffer memory 214. The buffer memory is electrically connected to the processor 211 and is used to temporarily store data and instructions from the host system 10, data from the rewritable non-volatile memory module 220, or other system data (e.g., various mapping tables, index tables, various information or data related to randomization operations and randomization verification operations) used to manage the storage device 20, so that the processor 211 can quickly access the data, instructions, or system data from the buffer memory 214. In an embodiment, the memory controller 210 can establish one or more write mapping tables in the buffer memory 214 to indicate the target physical addresses for writing valid data. It should be noted that in other embodiments, the buffer memory 214 can also be configured outside the memory controller 210. Alternatively, the memory controller 210 can be configured with the buffer memory 214 inside and outside.
[0068] The rewritable non-volatile memory module 220 is electrically connected to the memory controller 210 (the memory interface control circuit 213) and is used to store user data sent by the host system 10.
[0069] In this embodiment, each memory die (chip) of the rewritable non-volatile memory module 220 has a plurality of planes, and each plane has a plurality of physical blocks. Each physical block includes a plurality of physical program units (also referred to as physical pages). Each physical page has a plurality of memory cells (also referred to as physical bytes or bytes), each of which corresponds to a physical address. The physical address is used to record the physical location of the data stored in the memory cell. It should be noted that the present application is not limited to the size of each physical page and logical page.
[0070] Figure 2 A flowchart of the data writing method according to an embodiment of the present application.
[0071] Please refer to Figure 2 In step S210, the memory controller 210 (processor 211) obtains original data from the host system 10. Then, in step S220, the processor 211 performs a plurality of randomization operations on the original data to obtain a plurality of write data.
[0072] In an embodiment, the processor 211 performs a randomization operation on the original data to obtain write data, wherein the randomization operation is used to change the distribution pattern of a first bit value and a second bit value in the original data, so that the arrangement of the first bit value and the second bit value in the write data exhibits a random distribution characteristic, wherein the first bit value and the second bit value correspond to "0" and "1" in binary data, respectively. After performing the randomization operation, the processor 211 stores the obtained corresponding write data to the buffer memory 214.
[0073] Figure 3 A schematic diagram of the randomization operation according to an embodiment of the present application. For example, the randomization operation of the present application can be further illustrated by a specific example. As shown in Figure 3 The figure shows the process of performing a randomization operation on original data. In this example, consider two groups of original data OD1 and OD2, each containing 8 bits.
[0074] OD1 consists of 8 consecutive "1"s (11111111), and OD2 consists of 8 consecutive "0"s (00000000). These two groups of data represent a non-random distribution in an extreme case, in which the distribution of the first bit value ("0") and the second bit value ("1") is highly concentrated. The original data is, for example, user data that the host system 10 wants to store to the storage device 20.
[0075] By performing the randomization operation, the corresponding write data WD1, WD2, WD3 and WD4 are obtained. Specifically:
[0076] OD1 after the first randomization operation A31, WD1 (01010101) is generated.
[0077] OD1 after the second randomization operation A32, WD2 (10101010) is generated.
[0078] OD2 after the third randomization operation A33, WD3 (10101010) is generated.
[0079] OD2 after the fourth randomization operation A34, WD4 (01010101) is generated.
[0080] As can be seen from the results, regardless of whether the original data is all "1" or all "0", the write data obtained after the randomization operation presents a pattern of uniform alternation of "0" and "1". This pattern obviously changes the original distribution of the first bit value and the second bit value in the original data, so that the arrangement of "0" and "1" in the write data presents a more random distribution characteristic.
[0081] It is worth noting that although the write data in this example presents a regular alternating pattern, this is only for the purpose of simplifying the explanation. In actual applications, the results of the randomization operation will usually produce a more complex and irregular bit distribution to ensure the security of the data stored in the storage device.
[0082] Through this example, it can be clearly seen how the randomization operation effectively changes the distribution pattern of the bit values in the original data, thereby achieving the purpose of data randomization. This randomization not only improves the uniformity of data storage, so that the storage cells will not be affected by the non-uniform distribution of data bit values, but also enhances the security of the data.
[0083] In more detail, in an embodiment, the process of performing multiple randomization operations on the original data can use different randomization algorithms to process the original data, wherein the different randomization algorithms include at least one of the following:
[0084] (1) XOR operation: the system (e.g., processor 211) pre-defines multiple groups of random sequences of different lengths, stored in a lookup table. According to the size of the original data, an appropriate length of random sequence is selected. If the length of the original data exceeds the random sequence, the random sequence is used in a loop. When performing the XOR operation, each bit of the original data is XORed with the corresponding bit of the random sequence to generate the first write data.
[0085] (2) Bit-shifting operation: the system maintains a pool of bit-shifting values, including different cyclic shifts and logical shifts. When performing a bit-shifting operation on the original data, a value is selected from the pool and applied to the entire data block. For large data blocks, they can be segmented into fixed-size segments, each segment using a different bit-shifting value, and then recombined to generate the second kind of written data.
[0086] (3) Permutation operation: the system predefines multiple permutation tables, each defining a different bit reordering scheme. A permutation table is selected, and the bits in the original data are rearranged according to the order defined in the table. For large data blocks, they can be segmented into fixed-size blocks, each block using a different permutation table, and then recombined to generate the third kind of written data.
[0087] (4) Dynamic random seed operation: the system collects multiple system variables as inputs for the random seed, including but not limited to: system time (including the local time of the host system 10 or the storage device 20), data address, temperature sensor reading, power supply voltage fluctuation value, working frequency of the memory controller 210, number of recent data read / write operations, unique identifier of the storage device 20, process ID or thread ID of the host system 10, MAC address of the network interface (if available), current remaining capacity of the storage device 20, running time since the last boot, value of the internal error counter of the storage device 20, etc. The system can select one of these variables as a seed, or combine multiple variables to generate a more complex seed. For example, the system time, temperature reading, and error counter value can be combined using bit operations to generate a composite seed. Using this seed to initialize a pseudo-random number generator (such as a linear congruential generator or a Mersenne Twister algorithm), a random sequence is generated. Then, this random sequence is used to transform the original data (such as XOR operation or bitwise addition), generating the fourth kind of written data.
[0088] (5) Grouping operation: the original data is divided into multiple sub-blocks, each of which can be fixed in size (such as 4KB) or dynamically determined (such as based on the entropy value of the data). For each sub-block, the system selects one or more of the above four operations to combine and apply. For example:
[0089] The first sub-block can first perform the XOR operation, and then the bit-shifting operation.
[0090] The second sub-block can first perform the permutation operation, and then use the dynamic random seed operation.
[0091] The third sub-block can only perform the dynamic random seed operation.
[0092] After processing all sub-blocks, they are recombined to form the fifth kind of written data.
[0093] Through these five different randomization operations, the system generates five different write data. This diversified randomization strategy increases the randomness of the data, making the distribution of the bit state of the bit value of the finally generated write data more uniform.
[0094] Please go back to Figure 2 . Then, in step S230, the processor 211 performs a randomization verification operation on each write data to obtain a target write data in the plurality of write data, wherein the quality of the randomization of the target write data is determined to be qualified.
[0095] Before explaining the details of the randomization verification operation, the three-dimensional circuit architecture of the plurality of memory cells of the rewritable non-volatile memory module 220 is described, wherein the plurality of memory cells are considered to be configured at the intersection of M first reference lines corresponding to the X direction, P second reference lines corresponding to the Y direction and Q third reference lines corresponding to the Z direction.
[0096] Figure 4 A schematic diagram of the three-dimensional circuit architecture of the plurality of memory cells of the rewritable non-volatile memory module according to the embodiment of the present application. The structure contains a plurality of key components, forming a complex three-dimensional memory array. Taking a NAND-type rewritable non-volatile memory module as an example, the specific structure is as follows:
[0097] Word line (WL): marked as WL0, WL1, WL2 and WL3 in the figure, arranged horizontally along the x-axis direction. There are a plurality of parallel word lines on each plane, which are used to select the memory cells of a specific layer. The word line can be regarded as a first reference line corresponding to the X direction (also referred to as the first direction).
[0098] Bit line (BL): marked as BL0, BL1, BL2, etc. in the figure, arranged vertically along the y-axis direction. The word line can be regarded as a second reference line corresponding to the Y direction (also referred to as the second direction).
[0099] Cell string (CSTR): a physical structure containing a series of vertically stacked memory cells and a top SST and a bottom GST. It represents a complete vertical NAND string in the three-dimensional memory array and is the basic building block in the memory array.
[0100] String Line (SL): Marked as SL0, SL1, SL2, etc. in the figure, arranged vertically along the z-axis direction. Each string line contains a series of vertically stacked memory cells, forming a NAND string structure. The string line can be regarded as the third reference line corresponding to the Z direction (also known as the third direction). CSTR (Cell String) in this invention refers to the complete vertical structure containing a series of vertically stacked memory cells and the top SST and bottom GST. Among them, the vertical memory cell stack part inside the CSTR can be called a string line (String Line).
[0101] Source Select Line (SSL): Located at the top of the NAND string, used to control the source select transistor (SST).
[0102] Ground Select Line (GSL): Located at the bottom of the NAND string, used to control the ground select transistor (GST).
[0103] Common Source Line (CSL): Located at the bottom, providing a common source connection for all NAND strings.
[0104] Memory Cell Transistor (MCT): Marked as MCT in the figure, it is the unit that actually stores data.
[0105] Source Select Transistor (SST): Located at the top of each NAND string, controlled by SSL.
[0106] Ground Select Transistor (GST): Located at the bottom of each NAND string, controlled by GSL.
[0107] In simple terms, in this three-dimensional structure, the reference lines in three directions are:
[0108] X direction: Word line (WL), first reference line;
[0109] Y direction: Bit line (BL), second reference line;
[0110] Z direction: String line (SL); third reference line.
[0111] The intersection of the three reference lines is set as a memory cell (labeled as "Cell" in the figure). Each memory cell is located at the intersection of a specific WL, BL, and SL, and can independently store and access data. This three-dimensional structure significantly improves storage density, allowing more memory cells to be accommodated on the same chip area. It should be noted that the three directions are perpendicular to each other.
[0112] In an embodiment, the processor 211 obtains a plurality of bit values for each write data, each of which is one of a predetermined N-bit state. In the present application, the memory cells of the non-volatile storage device can be configured to store different amounts of bit data. The number of bits that each memory cell can store can vary depending on the specific application requirements and technical implementation, ranging from 1 bit to multiple bits. There are several types: SLC (Single-Level Cell), single-layer cell; MLC (Multi-Level Cell), multi-layer cell; TLC (Triple-Level Cell), three-layer cell; QLC (Quad-Level Cell), four-layer cell; PLC (Penta-Level Cell), five-layer cell.
[0113] Specifically, a single memory cell can be programmed to have 2 X different threshold voltage states, where X represents the number of bits that the memory cell can store. For example, when X = 1, the memory cell has two bit states and can store 1 bit of data (SLC); when X = 2, the memory cell has four bit states (MLC) and can store 2 bits of data; when X = 3, the memory cell has eight bit states and can store 3 bits of data (TLC); when X = 4, the memory cell has 16 bit states and can store 4 bits of data (QLC); when X = 5, the memory cell has 32 bit states and can store 5 bits of data (PLC). And so on. This approach allows the storage device to achieve different storage densities under the same physical structure, balancing capacity, performance, and reliability.
[0114] Taking TLC (Triple-Level Cell) flash memory as an example, each memory cell can store 3 bits of information / data, corresponding to 8 bit states (N = 8), usually denoted as S0, S1, S2, S3, S4, S5, S6, and S7. The processor 211 reads the voltage level of each memory cell and converts it to the corresponding bit state. For example, the voltage level of a certain memory cell may correspond to state S3.
[0115] The following embodiments are used to illustrate the implementation of the randomization verification operation of the present application.
[0116] Example 1: Obtain the N state proportions of the N bit states of the write data.
[0117] For example, in one embodiment, assume that the storage unit is SLC, i.e., X = 1, N = 2 1 = 2.
[0118] Initially, the processor 211 obtains the bit values of the write data. Assume that the obtained write data is "10110101" with eight bits.
[0119] Next, the processor 211 obtains the state proportions of the N bit states.
[0120] In this example, N = 2, indicating that there are two states, e.g., S0 = 0 and S1 = 1, and their quantities are 3 and 5, respectively.
[0121] Next, the processor 211 divides the quantity of each bit state by the total number of bits to obtain:
[0122] The state proportion of bit state S0 (0): 3 / 8 = 37.5%
[0123] The state proportion of bit state S1 (1): 5 / 8 = 62.5%
[0124] Next, the processor 211 obtains the randomization quality:
[0125] In this simple embodiment, the processor 211 can preliminarily determine the randomization quality by comparing the proportions of the two states. If the proportions of the two bit states are not significantly different, it is considered that the randomization quality is good. For example, if the difference between the proportions of the two states is less than a preset threshold value, it is determined that the proportions of the two states are not significantly different, and the randomization quality is good.
[0126] Example 2: Introduce a reference proportion value.
[0127] In this embodiment, the concept of a reference proportion value is introduced and used to evaluate the randomization quality.
[0128] The reference proportion value corresponding to a storage unit is 100% divided by the total number of corresponding bit states. For example, taking MLC (Multi-Level Cell) as an example, X = 2, N = 2 2 = 4, the reference proportion value is 100% / 4 = 25%.
[0129] Initially, the processor 211 obtains the bit values of the write data. Here, assume that the write data is "1001101110100011".
[0130] Next, the processor 211 obtains the state proportion of the N-bit states. In this example, N = 4, representing four bit states: 00, 01, 10, 11.
[0131] Next, the processor 211 divides the number of each bit state by the total number of bits, and can calculate:
[0132] Proportion of bit state S0 (00): 3 / 8 = 37.5%
[0133] Proportion of bit state S1 (01): 2 / 8 = 25%
[0134] Proportion of bit state S2 (10): 2 / 8 = 25%
[0135] Proportion of bit state S3 (11): 1 / 8 = 12.5%
[0136] Next, the processor 211 obtains the reference proportion value. Ideally, the state proportion of each of the four bit states should be equal, i.e. 100% / 4 = 25%.
[0137] Finally, the processor 211 obtains the randomization quality:
[0138] For example, the processor 211 compares the actual state proportions with the reference proportion value to evaluate the randomization quality. The randomization quality can be quantified using the average deviation or other statistical methods.
[0139] For example, the processor 211 can determine the randomization quality from the state proportions of each bit state and the reference proportion value via the following algorithm:
[0140] (1) Average deviation method
[0141] The processor 211 calculates the absolute deviation between each state proportion and the reference proportion value, and then takes the average:
[0142] |S0 deviation| = |37.5% - 25%| = 12.5%
[0143] |S1 deviation| = |25% - 25%| = 0%
[0144] |S2 deviation| = |25% - 25%| = 0%
[0145] |S3 deviation| = |12.5% - 25%| = 12.5%
[0146] Average deviation = (12.5% + 0% + 0% + 12.5%) / 4 = 6.25%
[0147] The processor 211 can set a threshold value, e.g., 5%. If the average deviation is less than or equal to the threshold value, the randomization quality is determined to be qualified; otherwise, it is determined to be unqualified.
[0148] (2) Maximum deviation method
[0149] The processor 211 finds the maximum value among all deviations:
[0150] Maximum deviation = max(12.5%, 0%, 0%, 12.5%) = 12.5%
[0151] The processor 211 can set a corresponding threshold value (also referred to as a first preset threshold value), e.g., 10%. If the maximum deviation is not greater than the threshold value, the randomization quality is determined to be qualified; otherwise, it is determined to be unqualified.
[0152] (3) Standard deviation method
[0153] The processor 211 calculates the standard deviation of the state proportions:
[0154] Average proportion (reference proportion value) = (37.5% + 25% + 25% + 12.5%) / 4 = 25%
[0155] Standard deviation = sqrt([(37.5% - 25%) 2 + (25% - 25%) 2 + (25% - 25%) 2 + (12.5% - 25%) 2 ] / 4)
[0156] ≈ 9.01%
[0157] The processor 211 can set a corresponding threshold value, e.g., 8%. If the standard deviation is less than or equal to the threshold value, the randomization quality is determined to be qualified; otherwise, it is determined to be unqualified.
[0158] (4) Entropy method
[0159] The processor 211 calculates the entropy value of the state distribution to measure randomness:
[0160] Entropy = -∑(Pi * log2(Pi))
[0161] = - (0.375 * log2(0.375) + 0.25 * log2(0.25) + 0.25 * log2(0.25) + 0.125 * log2(0.125))
[0162] ≈ 1.91
[0163] Maximum entropy (completely random state) = log2(N) = log2(4) = 2
[0164] Relative Entropy = Actual Entropy / Maximum Entropy = 1.91 / 2 = 0.955
[0165] The processor 211 can set a corresponding threshold, for example, 0.9. If the relative entropy is greater than or equal to the threshold, the randomization quality is determined to be qualified; otherwise, it is determined to be unqualified.
[0166] Through these different statistical methods, the processor 211 can comprehensively evaluate the quality of the randomization of each write data.
[0167] When the quality of the randomization of a write data is determined to be qualified, the processor 211 can take this write data as a target write data.
[0168] In an embodiment, when the processor 211 obtains a target write data, it does not need to perform randomization verification operations on other write data any more, so as to save system resources.
[0169] However, in another embodiment, the processor 211 can perform randomization verification operations on all write data, so as to find a write data with qualified and best (e.g., the maximum deviation value is the smallest) randomization quality as a target write data, thereby further improving the reliability and security of data storage of the storage device 20.
[0170] Please refer back to Figure 2 After obtaining the target write data, then in step S240, the processor 211 stores the target write data in a plurality of target storage units among the plurality of storage units of the rewritable non-volatile memory module 220. In more detail, the processor 211 corresponds the physical addresses of the plurality of target storage units to the target write data, and updates the corresponding mapping information after the target write data is programmed to the physical addresses. In addition, this process can involve the wear leveling algorithm of the flash memory controller, so as to ensure that the number of times of using the storage units is balanced, thereby prolonging the service life of the storage device.
[0171] On the other hand, the processor 211 generates and stores metadata related to the target write data, which are associated with subsequent read and recovery operations. In an embodiment, the metadata include one or more of the following:
[0172] a. Randomization algorithm identifier: used to identify the randomization algorithm used to generate the target write data, for subsequent de-randomization operations.
[0173] b. Data mapping table: records the correspondence between data blocks and physical storage unit addresses.
[0174] c. Error correction code (ECC): used to detect and correct possible bit errors.
[0175] d. Timestamp: records the time when the data is written, used for data version control and recovery.
[0176] e. Data length: records the length of the original data, used for subsequent de-randomization operation.
[0177] f. Checksum: used to verify the integrity of the data.
[0178] In one embodiment, when the storage controller 210 receives a read instruction from the host system 10, the processor 211 performs the following steps to recover the original data:
[0179] (1) Parse the read instruction: the processor 211 parses the read instruction from the host system 10 to determine the logical address range of the data that needs to be read.
[0180] (2) Address translation: the processor 211 uses the mapping table of logical to physical entities to translate the logical address to the corresponding physical address.
[0181] (3) Read metadata: the processor 211 first reads the metadata related to the target data. These metadata are usually stored in predefined special pages or blocks, containing:
[0182] a. Randomization algorithm identifier
[0183] b. Data mapping table
[0184] c. Error correction code (ECC)
[0185] d. Data length
[0186] e. Checksum
[0187] (4) Read randomized data: according to the data mapping table in the metadata, the processor 211 reads the randomized target write data from the corresponding physical address.
[0188] (5) Error checking and correction: the processor 211 uses the read ECC information to perform error checking on the data. If correctable errors are found, they are corrected. If uncorrectable errors are found, the data block is marked as error and other recovery mechanisms are attempted.
[0189] (6) Data integrity verification: in one embodiment, the processor 211 also uses the stored checksum to verify the integrity of the read data. If the verification fails, data recovery procedures may need to be initiated or an error reported to the host system.
[0190] (7) Determine the de-randomization algorithm: after obtaining the successfully decoded target write data, the processor 211 determines the de-randomization algorithm to be used according to the randomization algorithm identifier in the metadata.
[0191] (8) Perform de-randomization operation: The processor 211 performs a de-randomization operation on the read randomized data. This process is the inverse of the write-time randomization operation and can include:
[0192] a. Inverse shift operation
[0193] b. Inverse of XOR operation
[0194] c. Inverse permutation operation
[0195] d. Inverse operation using the same random seed
[0196] (9) Data length adjustment: In an embodiment, the processor 211 can also trim the de-randomized data to ensure that the recovered data length is consistent with the original data, according to the original data length recorded in the metadata.
[0197] (10) Data transmission: After obtaining the corresponding original data, the processor 211 transmits the recovered original data to the host system 10 through the connection interface circuit 230 to respond to the read instruction.
[0198] Through this detailed de-randomization process, the storage controller 210 can accurately recover the randomized target write data stored in the storage device 20 into the corresponding original data and securely transmit it to the host system 10. This process not only ensures the correct recovery of data, but also includes steps such as error detection, correction, and data integrity verification to improve the reliability and correctness of data reading. It should be noted that the randomization operation and the de-randomization operation can implement the randomization / de-randomization algorithms mentioned above via specific randomization circuitry and de-randomization circuitry. In addition, the randomization circuitry and the de-randomization circuitry can also be integrated into the same circuit unit.
[0199] Figure 5 Flowchart of the randomization verification operation shown according to an embodiment of the present application.
[0200] Referring to Figure 5 , the present embodiment describes a method for verifying the quality of write data randomization, suitable for a rewritable non-volatile memory module having a plurality of storage units. The method is performed by a processor of a storage controller and mainly includes the following steps:
[0201] Obtain bit values (step S510):
[0202] The processor obtains a plurality of bit values of the write data. Each bit value corresponds to one of N bit states, where N = 2 XX is the number of bits that each memory cell can store. For example, for MLC (Multi-Level Cell) flash memory, X = 2, N = 4, which means each memory cell can store 2 bits of data with 4 possible states.
[0203] Calculate state proportions (step S520):
[0204] The processor calculates N state proportions of N bits states of the written data according to the obtained multiple bit values. For example, for MLC flash memory, the possible states are 00, 01, 10, 11, and the processor calculates the proportion of each state in the written data.
[0205] Obtain reference proportion value (step S530):
[0206] The processor obtains a reference proportion value based on N bits states. Ideally, the proportion of each state should be equal, i.e. the reference proportion value is 1 / N. For example, for MLC flash memory, the reference proportion value is 25%.
[0207] Calculate deviation values (step S540):
[0208] The processor calculates N deviation values between N state proportions and the reference proportion value based on the multiple bit values. This step quantifies the degree of data randomization by comparing the actual state proportion with the ideal state proportion.
[0209] Determine the maximum deviation value (step S550):
[0210] The processor determines the maximum deviation value among N deviation values. This maximum deviation value represents the degree of deviation of data distribution from the ideal random state.
[0211] Judge the quality of randomization (steps S560, S570, S580):
[0212] The processor compares the maximum deviation value with a preset threshold:
[0213] a) If the maximum deviation value is not greater than the first preset threshold, it is determined that the quality of randomization of the written data is qualified (step S570).
[0214] b) If the maximum deviation value is greater than the first preset threshold, it is determined that the quality of randomization of the written data is unqualified (step S580).
[0215] In another embodiment, when the maximum deviation value is determined to be greater than the first preset threshold, the processor 211 can perform a further determination to determine the deviation degree of the overall state proportion. For example, if the maximum deviation value is greater than the first preset threshold, in addition to determining that the randomization quality is unqualified, the processor 211 can further determine whether the maximum deviation value is greater than a second preset threshold. If it is greater than the second preset threshold, one or more target deviation values (i.e., all deviation values greater than the first preset threshold are found as target deviation values) greater than the first preset threshold among the N deviation values are obtained. This step helps to identify particularly serious randomization problems.
[0216] Through this process, the processor 211 can comprehensively evaluate the randomization quality of the written data. This method not only considers the overall randomization degree, but also identifies abnormal distribution of specific bit states.
[0217] The advantages of this embodiment include:
[0218] Adaptability: It can be applied to different types of flash memory (SLC, MLC, TLC, QLC, etc.).
[0219] Accurate evaluation: By calculating specific deviation values, a quantitative evaluation of randomization quality is provided.
[0220] Multi-level judgment: Multiple thresholds are used to more finely classify randomization quality problems.
[0221] Problem localization: It can identify which specific state distribution has problems, which is beneficial for targeted optimization.
[0222] The following uses a complete embodiment to illustrate the randomization verification operation of the present application.
[0223] Assuming that TLC (Triple-Level Cell) flash memory is used, the number of preset bit states is 8 (N = 8), corresponding to S0 to S7. In an ideal case, the reference proportion value (P base ) of each state is 12.5%.
[0224] After reading all the memory cells, the processor 211 obtains the following actual state proportions (Px):
[0225] S0: 13.0%; S1: 11.0%; S2: 12.5%; S3: 13.2%; S4: 12.8%; S5: 11.9%; S6: 13.3%; S7: 12.3%
[0226] Next, the processor 211 calculates the deviation value (Δ) of each state, which is the absolute value of the difference between the actual proportion value (state proportion of each bit state) and the reference proportion value (i.e., Δ = |Px-Pbase
[0227] S0: | 13.0% - 12.5% | = 0.5%
[0228] S1: | 11.0% - 12.5% | = 1.5%
[0229] S2: | 12.5% - 12.5% | = 0%
[0230] S3: | 13.2% - 12.5% | = 0.7%
[0231] S4: | 12.8% - 12.5% | = 0.3%
[0232] S5: | 11.9% - 12.5% | = 0.6%
[0233] S6: | 13.3% - 12.5% | = 0.8%
[0234] S7: | 12.3% - 12.5% | = 0.2%
[0235] The processor 211 finds the maximum deviation value (Δmax): Δmax = 0.8% (corresponding to state S6)
[0236] Assuming the first preset threshold is 1%, then: 0.8% (Δmax) < 1% (first preset threshold).
[0237] Therefore, in this example, the processor 211 determines that the quality of the randomization of the written data is qualified via the randomization verification operation. This indicates that although there is a certain deviation between the actual distribution of each state and the ideal uniform distribution, the degree of deviation is within an acceptable range.
[0238] If the maximum deviation value exceeds the first preset threshold, the processor 211 will determine that the quality of the randomization is unqualified. For example, if the actual proportion of S1 is changed to 9%, its deviation value is 3.5%, which exceeds the first preset threshold of 1%, at which point the randomization will be determined to be unqualified (failed the randomization verification operation).
[0239] This rapid detection method can effectively identify states with abnormal distributions, providing a basis for subsequent data processing or hardware adjustment, thereby improving the reliability and performance of the flash memory.
[0240] In another embodiment, in the first randomization verification operation, the processor 211 not only determines whether the maximum deviation value exceeds the first preset threshold, but also introduces a second preset threshold for more detailed evaluation. This method can distinguish between minor randomization unqualification and serious circuit design problems. The following is a specific example to illustrate this advanced verification process:
[0241] Assume that the TLC flash memory is used, there are 1,000,000 memory cells, and 8-bit states (S0-S7). The reference percentage (P base ) is 12.5%. The first preset threshold is set to 1%, and the second preset threshold is set to 2%. After the processor 211 reads all the memory cells, the following actual state percentages (Px) are obtained: S0: 15.0%; S1: 9.0%; S2: 12.5%; S3: 10.2%; S4: 14.8%; S5: 15.9%; S6: 12.3%; and S7: 10.3%.
[0242] The processor 211 calculates the deviation value (Δ) of each bit state:
[0243] S0: |15.0%-12.5%| = 2.5%
[0244] S1: |9.0%-12.5%| = 3.5%
[0245] S2: |12.5%-12.5%| = 0%
[0246] S3: |10.2%-12.5%| = 2.3%
[0247] S4: |14.8%-12.5%| = 2.3%
[0248] S5: |15.9%-12.5%| = 3.4%
[0249] S6: |12.3%-12.5%| = 0.2%
[0250] S7: |10.3%-12.5%| = 2.2%
[0251] The processor 211 determines the maximum deviation value (Δmax): Δmax = 3.5% (corresponding to state S1)
[0252] Since 3.5% > 1% (the first preset threshold), the processor 211 determines that the randomization is not qualified. Then, the processor 211 continues to determine: 3.5% (Δmax) > 2% (the second preset threshold).
[0253] Because the maximum deviation value exceeds the second preset threshold, the processor 211 considers that this may represent a serious problem in the circuit design of the flash memory chip. In this case, the processor 211 obtains all the states that exceed the first preset threshold (1%): S0 (2.5%), S1 (3.5%), S3 (2.3%), S4 (2.3%), S5 (3.4%), and S7 (2.2%). The processor 211 marks these states as abnormal states for subsequent analysis and optimization.
[0254] In contrast, if the maximum deviation value is between the first and second preset thresholds, for example, Δmax=1.5%, the processor 211 will only obtain the state that currently exceeds the first preset threshold (S1).
[0255] This advanced verification method has the following advantages: it can quickly identify minor randomization unqualified cases; it can detect possible serious circuit design problems. When serious problems are found, more comprehensive abnormal state information is provided to facilitate in-depth analysis and targeted improvement. In addition, by distinguishing different degrees of randomization unqualified, corresponding processing strategies can be taken to improve the reliability and performance of the flash chip.
[0256] In an embodiment, when the processor 211 determines that the randomization of the write data is unqualified, further measures can be taken to assist subsequent circuit design optimization. Specifically, the processor 211 obtains the abnormal bit state corresponding to the maximum deviation value in the N-bit state; and records the abnormal bit state. In an embodiment, this record includes one or more of the following: record the type of the abnormal bit state; record the position distribution of the abnormal bit state in the write data; record the randomization operation type that leads to the abnormal bit state.
[0257] For example, assume that the write data corresponding to MLC is "11110000", the calculated state proportion is: 00:50%, 01:0%, 10:0%, 11:50%, and the maximum deviation value is 25%. Assuming that the first preset threshold is 5%, the randomization quality of the write data is determined to be unqualified.
[0258] The processor identifies that the states "00" and "11" are abnormal bit states because their deviation values (25%) are the largest.
[0259] Next, the processor records the following information:
[0260] (1) Abnormal bit state type: 00 and 11;
[0261] (2) Position distribution: 00 in the second half, 11 in the first half;
[0262] (3) Randomization operation type that leads to abnormality: for example, it may be due to a simple bit inversion operation.
[0263] It should be noted that the above examples of recording are related to the test of one threshold. However, the processor 211 can also record the corresponding abnormal bit states corresponding to the test of multiple thresholds. Specifically, after determining that the quality of the randomization of the write data is unqualified, if the maximum deviation value is not greater than the second preset threshold, the processor 211 obtains an abnormal bit state corresponding to the maximum deviation value among the N bit states, and records the abnormal bit state. On the other hand, if the maximum deviation value is greater than the second preset threshold, one or more abnormal bit states corresponding to one or more target deviation values among the N bit states are obtained, and the one or more abnormal bit states are recorded.
[0264] In addition, in some extreme examples, the quality of the randomization of all write data is unqualified. In an embodiment, the processor 211 can further adjust the plurality of randomization operations according to the abnormal bit states to regenerate a plurality of new write data; and perform the randomization verification operation on each new write data again to attempt to obtain the target write data, and then store the target write data to the plurality of target storage units. The adjustment includes: selecting or combining different randomization algorithms according to the type and distribution of abnormal bit states; adjusting the parameters of each randomization operation, such as the random sequence of the XOR operation, the shift amount of the shift operation, the permutation table of the permutation operation, etc.; increasing the complexity or strength of the randomization operation for the data part that frequently appears abnormally.
[0265] For example, after recording the information that the states "00" and "11" are abnormal bit states in the above example, the processor 211 can perform subsequent processing. For example:
[0266] (1) Adjust the randomization operation: the processor 211 can take the following adjustments:
[0267] Select a new randomization algorithm, such as introducing an adjusted random sequence of the XOR operation or block the data, and apply different randomization strategies to different blocks.
[0268] (2) Regenerate write data: the processor 211 regenerates a plurality of write data using the adjusted randomization operation.
[0269] (3) Perform randomization verification again: the processor 211 repeatedly performs the randomization verification operation on each newly generated write data until a qualified target write data is obtained.
[0270] (4) Store the target write data: the processor 211 stores the verified target write data into the plurality of target storage units
[0271] This method of dynamically adjusting randomization operations has significant technical efficacy. By analyzing abnormal bit states, the processor can selectively choose or combine different randomization algorithms, such as introducing bit shift operations or adjusting XOR sequences. Block processing of data further improves the flexibility and effectiveness of randomization. This adaptive method not only addresses specific randomization deficiencies, but also continuously optimizes data distribution, improving storage efficiency. The process of repeated verification and adjustment ensures that the data written finally has high-quality randomness, thereby prolonging the life of the storage device, improving overall performance and reliability, and reducing the risk of data hotspots and uneven wear.
[0272] The embodiment also provides a computer program product comprising computer readable code, or a non-volatile computer readable storage medium carrying computer readable code, when the computer readable code is executed in the processor of the storage device, the processor in the storage device performs the steps of the above memory test method. The computer program product can be specifically implemented by hardware, firmware, software or a combination thereof. In an optional embodiment, the computer program product is specifically embodied as a computer storage medium, and in another optional embodiment, the computer program product is specifically embodied as a software product, such as a software development kit (Software Development Kit, SDK) and the like.
[0273] The data writing method and its randomization verification operation presented by the application have significant technical efficacy. By performing multiple randomization operations on the written data and executing the corresponding verification process, this method can effectively improve the uniformity of data distribution in non-volatile memory. Specifically, this method quantifies the quality of data randomization by calculating the bit state proportion, comparing it with the reference proportion value, and determining the deviation value. A multi-level threshold judgment mechanism is introduced, which can not only identify unqualified randomization results, but also distinguish different degrees of randomization problems. Finally, the written data with qualified quality after randomization can also be obtained to store the original data. In particular, the adaptive adjustment mechanism of this method records the type, distribution position and randomization operation causing the abnormal bit state, so that the system can adjust the randomization strategy accordingly. For example, according to the abnormal state, a new randomization algorithm is selected, the XOR operation parameters are adjusted, or the data is processed in blocks. This dynamic optimization method ensures that even in the face of complex and variable data patterns, high-quality randomization results can be adaptively generated.
[0274] In addition, the iterative verification mechanism of the method further guarantees the quality of the randomized write data. By repeatedly performing the randomization operation and verification step until the target write data meeting the requirements is obtained, the method greatly improves the reliability and uniformity of the stored data. This not only optimizes the use efficiency of the storage unit, but also significantly prolongs the service life of the storage device, reduces the risk of data hotspot problems and uneven wear. In summary, the data write method and memory controller provided by the present application have significant advantages in improving data randomization quality, optimizing storage efficiency, prolonging device life, etc. It provides an efficient, reliable and adaptive solution for data storage management of non-volatile storage devices.
[0275] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A data write method for a rewritable nonvolatile memory module having a plurality of memory cells, characterized by, The method comprises: obtaining original data from a host system; performing a plurality of randomization operations on the original data to obtain a plurality of write data; performing a randomization verification operation on each write data before storing the plurality of write data to a plurality of storage units, wherein the randomization verification operation comprises: obtaining N state proportions of corresponding N bit states of the write data, wherein N is a multiple of 2; obtaining a reference proportion value based on the N bit states; and determining whether a maximum deviation value between the N state proportions and the reference proportion value is not greater than a preset threshold to determine whether the quality of the randomization of the write data is qualified; when it is determined that the quality of the randomization of a write data is qualified, taking the write data determined to be qualified as a target write data, and storing the target write data to a plurality of target storage units among the plurality of storage units.
2. The data write method of claim 1, wherein, Each randomization operation uses a different randomization algorithm to process the original data, wherein the different randomization algorithm comprises at least one of: an exclusive or operation, performing an exclusive or operation on the original data with a predefined different plurality of random sequences; a bit shift operation, performing a different plurality of cyclic bit shift or logical bit shift on the original data; a permutation operation, changing the order of bits in the original data according to a predefined different plurality of permutation tables; a dynamic random seed operation, generating a different plurality of random seeds based on system time, data address or other system variables, and using the plurality of random seeds and the original data to generate the plurality of write data; and a grouping operation, dividing the original data into a plurality of sub-blocks, and applying different exclusive or operations, bit shift operations, permutation operations, and dynamic random seed operations to the plurality of sub-blocks. The step of obtaining the N state proportions of the corresponding N bit states of the write data comprises:
3. The data write method of claim 1, wherein, obtaining the N state proportions of the corresponding N bit states of the write data according to the plurality of bit values. a plurality of bit values of the write data are obtained, each bit value corresponding to one of the N bit states, where N is 2 X and X is the number of bits that can be stored by one memory cell of each memory cell The step of performing the randomization verification operation on each write data further comprises:
4. The data write method of claim 3, wherein, obtaining N deviation values between the N state proportions and the reference proportion value based on the plurality of bit values; determining the maximum deviation value among the N deviation values; if the maximum deviation value is not greater than a first preset threshold, determining that the quality of the randomization of the write data is qualified; if the maximum deviation value is greater than the first preset threshold, determining that the quality of the randomization of the write data is unqualified. After determining that the quality of the randomization of the write data is unqualified, the method further comprises:
5. The data write method of claim 4, wherein, obtaining an abnormal bit state corresponding to the maximum deviation value among the N bit states; and recording the abnormal bit state. If the quality of the randomization of the plurality of write data is all unqualified, the method further comprises:
6. The data write method of claim 5, wherein, adjusting the plurality of randomization operations according to the abnormal bit state to regenerate a new plurality of write data; and performing the randomization verification operation on each new write data to attempt to obtain the target write data, and then storing the target write data to the plurality of target storage units.
7. The data write method of claim 3, wherein, The step of performing the randomization verification operation on each write data further comprises: obtaining N deviation values between the N state proportions and the reference proportion value based on the plurality of bit values; determining a maximum deviation value among the N deviation values; determining that the quality of the randomization of the write data is qualified if the maximum deviation value is not greater than a first preset threshold value; determining that the quality of the randomization of the write data is unqualified if the maximum deviation value is greater than the first preset threshold value, and determining whether the maximum deviation value is greater than a second preset threshold value, wherein if the maximum deviation value is greater than the second preset threshold value, obtaining one or more target deviation values greater than the first preset threshold value among the N deviation values.
8. The data write method of claim 7, wherein, After determining that the quality of the randomization of the write data is unqualified, the method further comprises: if the maximum deviation value is not greater than the second preset threshold value, obtaining an abnormal bit state corresponding to the maximum deviation value among the N bit states, and recording the abnormal bit state; and if the maximum deviation value is greater than the second preset threshold value, obtaining one or more abnormal bit states corresponding to the one or more target deviation values among the N bit states, and recording the one or more abnormal bit states.
9. A memory controller suitable for a storage device configured with a rewritable non-volatile memory module, wherein the storage device is electrically connected to a host system, characterized in that, The memory controller comprises: a memory interface control circuit electrically connected to the rewritable non-volatile memory module, wherein the rewritable non-volatile memory module has a plurality of storage units; and a processor electrically connected to the memory interface control circuit, wherein the processor is configured to: obtain original data from a host system; perform a plurality of randomization operations on the original data to obtain a plurality of write data; perform a randomization verification operation on each write data before storing the plurality of write data to the plurality of storage units, wherein the randomization verification operation comprises: obtaining N state proportions of corresponding N bit states of the write data, wherein N is a multiple of 2; obtaining a reference proportion value based on the N bit states; and determining whether a maximum deviation value between the N state proportions and the reference proportion value is not greater than a preset threshold value to determine the quality of the randomization of the write data; determine that the quality of the randomization of one write data is qualified, and store the write data determined to be qualified as target write data to a plurality of target storage units among the plurality of storage units.
10. The memory controller of claim 9, wherein, Each randomization operation uses a different randomization algorithm to process the original data, wherein the different randomization algorithms include at least one of: exclusive or operation, performing exclusive or operation on the original data and a plurality of predefined different random sequences; bit shift operation, performing a plurality of different cyclic bit shifts or logical bit shifts on the original data; a permutation operation, changing an order of bits in the original data according to a predefined different plurality of permutation tables; a dynamic random seed operation, generating a different plurality of random seeds based on system time, data address, or other system variables, and generating the plurality of write data with the plurality of random seeds and the original data; and a grouping operation, grouping the original data into a plurality of sub-blocks, and applying different ones of the exclusive-or operation, the bit shift operation, the permutation operation, and the dynamic random seed operation to the plurality of sub-blocks.
11. The memory controller of claim 9, wherein, The step of obtaining the N state proportions of the write data corresponding to the N bit states comprises: a plurality of bit values of the write data are obtained, each bit value corresponding to one of the N bit states, where N is 2 X and X is the number of bits that can be stored by one memory cell of each memory cell obtaining the N state proportions of the write data corresponding to the N bit states according to the plurality of bit values.
12. The memory controller of claim 11, wherein, The step of performing the randomization verification operation on each write data further comprises: obtaining N deviation values between the N state proportions and the reference proportion value based on the plurality of bit values; determining a maximum deviation value among the N deviation values; if the maximum deviation value is not greater than a first preset threshold, determining that the quality of the randomization of the write data is qualified; if the maximum deviation value is greater than the first preset threshold, determining that the quality of the randomization of the write data is unqualified.
13. The memory controller of claim 12, wherein, After determining that the quality of the randomization of the write data is unqualified, the processor is further configured to: obtain an abnormal bit state corresponding to the maximum deviation value among the N bit states; and record the abnormal bit state.
14. The memory controller of claim 13, wherein, If the qualities of the randomizations of the plurality of write data are all unqualified, the processor is further configured to: adjust the plurality of randomization operations according to the abnormal bit state to regenerate new plurality of write data; and perform the randomization verification operation on each new write data again to attempt to obtain the target write data, and then store the target write data to the plurality of target storage units.
15. The memory controller of claim 11, wherein, The step of performing the randomization verification operation on each write data further comprises: obtaining N deviation values between the N state proportions and the reference proportion value based on the plurality of bit values; determining a maximum deviation value among the N deviation values; if the maximum deviation value is not greater than a first preset threshold, determining that the quality of the randomization of the write data is qualified; if the maximum deviation value is greater than the first preset threshold, determining that the quality of the randomization of the write data is unqualified, and determining whether the maximum deviation value is greater than a second preset threshold, wherein if the maximum deviation value is greater than the second preset threshold, obtaining one or more target deviation values greater than the first preset threshold among the N deviation values.
16. The memory controller of claim 15, wherein, After determining that the quality of the randomization of the write data is unqualified, the processor is further configured to: if the maximum deviation value is not greater than the second preset threshold, obtaining an abnormal bit state corresponding to the maximum deviation value among the N bit states, and recording the abnormal bit state; and If the maximum deviation value is greater than the second preset threshold value, one or more abnormal bit states corresponding to the one or more target deviation values in the N bit states are obtained, and the one or more abnormal bit states are recorded.
Citation Information
Patent Citations
Memory device for internally performing read-verify operation, method of operating the same, and memory system including the same
CN105869677A
Memory management method and memory controller
CN110727390A