Data writing method and memory controller

By performing a variety of randomized operations and verification steps during the data writing process, the problem of uneven data distribution in the prior art is solved, the reliability and performance of the memory is improved, and the device life is extended.

CN119847447AActive Publication Date: 2025-04-18HEFEI KAIMENG TECHNOLOGY CO LTD

Patent Information

Application Number
CN202510064946.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-15
Publication Date
2025-04-18
Estimated Expiration
2045-01-15

AI Technical Summary

Technical Problem

The prior art is not effective in improving the reliability of data storage and reducing interference between storage units. Especially in high-density storage scenarios, uneven data distribution may lead to problems such as read interference and write interference, shortening the service life of storage devices.

Method used

By performing multiple randomization operations and randomizing the written data, it is ensured that the data written to the memory has good random distribution characteristics. The specific steps include obtaining the original data from the host system, performing multiple randomization operations to generate write data, and performing a randomized verification operation on each write data until a target write data with a qualified randomization quality is obtained.

Benefits of technology

It improves the reliability and performance of data storage, ensures the uniform distribution of data in memory, extends the service life of storage devices, and optimizes storage efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119847447A_ABST
    Figure CN119847447A_ABST
Patent Text Reader

Abstract

The invention provides a data writing method and a memory controller, which are suitable for a rewritable nonvolatile memory module with a plurality of memory units. The method comprises the following steps: firstly, obtaining original data from a host system; then, a plurality of randomization operations are performed on the original data to obtain a plurality of write-in data. Next, a first randomization verification operation is performed on each write data, by which target write data among the plurality of write data is acquired, where the randomization quality of the target write data is determined to be qualified. Finally, the target write data is stored in a plurality of target memory cells of the plurality of memory cells. Through multiple randomization operations and verification processes, the randomness and reliability of data storage are effectively improved, so that the overall performance and data security of a storage system are enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of semiconductor storage technology, and in particular to a data writing method for a rewritable non-volatile memory module and a memory controller using the method. Background Art

[0002] With the rapid development of information technology, non-volatile storage devices are increasingly 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, with the continuous improvement of storage density, data reliability and interference between storage units have become more and more prominent.

[0003] In order to improve the reliability of data storage and reduce the interference between cells, 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 data distribution to a certain extent, its effect is often unsatisfactory 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 randomization results. Directly writing data without verifying the quality of randomization may result in some data patterns being unevenly distributed in the memory, thus affecting storage performance and reliability. Especially in high-density storage scenarios, improper data distribution may lead to problems such as read interference and write interference, thereby shortening the service life of the storage device. Summary of the invention

[0005] The purpose of the present invention is to solve the above problems, to be able to perform multiple randomization operations and effectively verify the randomization quality to ensure that the data written into the memory has good random distribution characteristics, thereby improving the reliability and performance of the storage.

[0006] One or more embodiments of the present invention 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 target write data from the plurality of write data, wherein the randomization quality of the target write data is determined to be qualified; and storing the target write data in a plurality of target storage units among the plurality of storage units.

[0007] In one or more embodiments of the present invention, each randomization operation uses a different randomization algorithm to process the original data, wherein the different randomization algorithms include at least one of the following: an exclusive OR (XOR) operation, performing an exclusive OR operation on the original data with a predefined plurality of different random sequences; a shift operation, performing a different plurality of cyclic shifts or logical shifts on the original data; a permutation operation, changing the order of bits in the original data according to a predefined plurality of different 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, shift operations, permutation operations, and dynamic random seed operations to the plurality of sub-blocks.

[0008] In one or more embodiments of the present invention, the step of performing the randomization verification operation on each written data includes: obtaining multiple bit values ​​of the written data, each bit value corresponding to one of N bit states, where N is 2 X , and X is the number of bits that can be stored in a storage unit of each storage unit; according to the multiple bit values, obtaining N state proportions of the write data corresponding to the N bit states; according to the N state proportions, obtaining the randomization quality of the write data.

[0009] In one or more embodiments of the present invention, the step of performing the randomization verification operation on each write data further includes: obtaining a benchmark proportion value based on the N bit states; and obtaining the quality of the randomization of the write data based on the N state proportions and the benchmark proportion value.

[0010] In one or more embodiments of the present invention, the step of performing the randomization verification operation on each write data also includes: based on the multiple bit values, obtaining N deviation values ​​between the N state proportions and the baseline proportion value; determining the maximum deviation value among 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.

[0011] In one or more embodiments of the present invention, after determining that the quality of the randomization of the written data is unqualified, the method further includes: 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 invention, if the quality of the randomization of the multiple write data is unqualified, the method further includes: adjusting the multiple randomization operations according to the abnormal bit state to regenerate new multiple 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 multiple target storage units.

[0013] In one or more embodiments of the present invention, the step of performing the randomization verification operation on each write data also includes: based on the multiple bit values, obtaining N deviation values ​​between the N state proportions and the baseline proportion value; determining the maximum deviation value among 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 judging 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 ​​among the N deviation values ​​that are greater than the first preset threshold.

[0014] In one or more embodiments of the present invention, after determining that the quality of the randomization of the write data is unqualified, the method further includes: if the maximum deviation value is not greater than the second preset threshold, obtaining the 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 invention 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 includes: a memory interface control circuit for electrically connecting 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 the 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 target write data from 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 in a plurality of target storage units among the plurality of storage units.

[0016] Based on the above, the data writing method and memory controller provided by the present invention have significant advantages in improving data randomization quality, optimizing storage efficiency, and extending device life, etc. It provides an efficient, reliable, and adaptive solution for data storage management of non-volatile storage devices. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The accompanying drawings are included to provide a further understanding of the present invention and are incorporated in and constitute a part of this specification. The drawings illustrate embodiments of the present invention and together with the description serve to explain the principles of the present invention.

[0018] Figure 1 is a block diagram of a host system and a storage device according to an embodiment of the present invention;

[0019] Figure 2 is a flow chart of a data writing method according to an embodiment of the present invention;

[0020] Figure 3 is a schematic diagram of a randomization operation according to an embodiment of the present invention;

[0021] Figure 4 is 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 invention;

[0022] Figure 5 FIG. 4 is a flow chart of a randomized verification operation according to an embodiment of the present invention.

[0023] Description of Figure Numbers

[0024] 10: Host system

[0025] 20: Storage device

[0026] 211: First processor

[0027] 110: Second processor

[0028] 120: Host memory

[0029] 130: Data transmission 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: Connecting interface circuit

[0036] S210~S240: Process 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 lines

[0042] CSTR: Cell string

[0043] SL0~SL2:Sequential wiring

[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: Process steps of randomized verification operation DETAILED DESCRIPTION

[0051] Reference will now be made in detail to exemplary embodiments of the present invention, examples of which are illustrated in the accompanying drawings. Whenever possible, the same reference numerals are used in the drawings and the description to refer to the same or like parts.

[0052] Figure 1 FIG. 1 is a block diagram of a host system and a storage device according to an embodiment of the present invention. Figure 1, the 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), a host memory 120, and a data transfer interface circuit 130. In this embodiment, the processor 110 is coupled (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 using a system bus. In this embodiment, the processor 110, the host memory 120, and the data transfer interface circuit 130 may be disposed on a motherboard of the host system 10. In this embodiment, the original data is, for example, user data transmitted from the host system 10 to the storage device 20, or data that has not yet 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 called a first processor), a data management circuit 212, and a memory interface control circuit 213.

[0054] In this embodiment, the host system 10 is electrically connected to the storage device 20 through the data transmission interface circuit 130 and the connection interface circuit 230 of the storage device 20 to perform data access operations. 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 transmission interface circuit 130.

[0055] In this embodiment, the number of the data transmission interface circuit 130 can be one or more. Through the data transmission interface circuit 130, the motherboard can be electrically connected to the storage device 20 via a wired or wireless manner. 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 wireless fax (WiFi) memory storage device, a Bluetooth memory storage device or a low power consumption Bluetooth memory storage device (e.g., iBeacon) and other memory storage devices based on various wireless communication technologies. In addition, the motherboard 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, etc. through a system bus.

[0056] In this embodiment, the data transmission interface circuit 130 and the connection interface circuit 230 are interface circuits compatible with the high-speed peripheral component interconnect interface (Peripheral Component Interconnect Express, PCI Express) standard. In addition, the data transmission interface circuit 130 and the connection interface circuit 230 use the fast non-volatile memory interface standard (Non-Volatile Memory express, NVMe) communication protocol to transmit data.

[0057] Furthermore, in another embodiment, the connection interface circuit 230 and the memory controller 210 may be packaged in one chip, or the connection interface circuit 230 may be disposed outside a chip including 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 may be a dynamic random access memory (DRAM), a static random access memory (SRAM), etc. However, it should be understood that the present invention is not limited thereto, and the host memory 120 may also be other suitable memories.

[0059] The memory controller 210 is used to execute a plurality of logic gates or control instructions implemented in hardware or firmware and to 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 hardware with computing capabilities, which is used to control the overall operation of the memory controller 210. Specifically, the processor 211 is programmed by a plurality of control instructions / program codes, and when the storage device 20 operates, these control instructions / program codes are executed to perform operations such as writing, reading and erasing data. In addition, in this embodiment, the control instructions / program codes can be further executed to perform data writing operations, randomization verification operations or randomization operations to implement the data writing method provided by the present invention. The control instructions / program codes corresponding to the data writing method can be further implemented as a circuit unit in the form of hardware to implement the data writing method provided by the present invention.

[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 microprocessor, 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, but the present invention is not limited thereto.

[0062] In this 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 various components of the memory controller 210 can also be regarded as the 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 receive instructions from the processor 211 to transmit data. 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 to the rewritable non-volatile memory module 220 via the memory interface control circuit 213 (e.g., the write operation is performed according to the 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 via the memory interface control circuit 213 (the data can be read from one or more storage units in the one or more physical units), and the read data is written to the host system 10 (e.g., the host memory 120) via the connection interface circuit 230 (e.g., the read operation is performed according to the 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 receive instructions from the processor 211 and cooperate with the data management circuit 212 to perform a write (also called programming) operation, a read operation or an erase operation on the rewritable non-volatile memory module 220 .

[0065] In addition, the data to be written to the rewritable non-volatile memory module 220 will be 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 will transmit 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, these instruction sequences may include a write instruction sequence indicating writing data, a read instruction sequence indicating reading data, an erase instruction sequence indicating erasing data, and corresponding instruction sequences for indicating various memory operations. These instruction sequences may include one or more signals, or data on the bus. These signals or data may include instruction codes or program codes. For example, in the read instruction sequence, information such as the read identification code, memory address, and physical address will be 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 address of the logical unit (e.g., logical block, logical page) and the physical address (physical address) of the physical unit (e.g., physical erase unit / physical block, physical page) configured for the rewritable non-volatile memory module 220. In other words, the memory controller 210 can search for the physical unit mapped by a logical unit (e.g., search for the physical page mapped by a logical page; search for the physical address mapped by a logical address) through the logical to physical address mapping table (also called the logical to physical mapping table), and the memory controller 210 can search for the logical unit mapped by a physical unit (e.g., search for the logical page mapped by a physical page; search for the logical address mapped by a physical address) through the physical to logical address mapping table (also called the physical to logical mapping table).

[0067] In one 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 for managing the storage device 20 (e.g., various mapping tables, index tables, various information or data related to randomization operations and randomization verification operations), so that the processor 211 can quickly access the data, instructions or system data from the buffer memory 216. In one embodiment, the memory controller 210 can establish one or more write mapping tables in the buffer memory 214 to indicate the target physical address 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 buffer memory 214 can be configured inside and outside the memory controller 210.

[0068] The rewritable non-volatile memory module 220 is electrically connected to the memory controller 210 (memory interface control circuit 213 ) and is used to store user data sent by the host system 10 .

[0069] In the present embodiment, each memory grain (chip) of the multiple memory grains of the rewritable non-volatile memory module 220 has multiple planes, and each plane has multiple physical blocks. Each physical block includes multiple physical programming units (also called physical pages). Each physical page has multiple storage cells (also called physical bytes or bytes), and each storage cell corresponds to a physical address. The physical address is used to record the physical location of the data stored in the storage cell. It should be noted that the present invention is not limited to the size of each physical page and logical page.

[0070] Figure 2 FIG. 4 is a flow chart of a data writing method according to an embodiment of the present invention.

[0071] Please refer to Figure 2 In step S210, the memory controller 210 (processor 211) obtains original data from the host system 10. Next, in step S220, the processor 211 performs multiple randomization operations on the original data to obtain multiple write data.

[0072] In one 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 mode of the first bit value and the 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 presents 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 corresponding write data obtained into the buffer memory 214.

[0073] Figure 3 FIG. 1 is a schematic diagram of a randomization operation according to an embodiment of the present invention. For example, the randomization operation of the present invention can be further described by a specific example. Figure 3 As shown in FIG. 1 , the process of performing randomization operation on the original data is shown in FIG. 1 . In this example, two groups of original data OD1 and OD2 are considered, each group containing 8 bits.

[0074] OD1 consists of 8 consecutive "1"s (11111111), while OD2 consists of 8 consecutive "0"s (00000000). These two sets of data represent non-random distribution in extreme cases, where 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 in the storage device 20.

[0075] By performing the randomization operation, the corresponding write data WD1, WD2, WD3 and WD4 are obtained. Specifically:

[0076] After the (first) randomization operation A31, OD1 generates WD1 (01010101).

[0077] After another (second) randomization operation A32, OD1 generates WD2 (10101010).

[0078] After the (third) randomization operation A33, OD2 generates WD3 (10101010).

[0079] After another (fourth) randomization operation A34, OD2 generates WD4 (01010101).

[0080] From the results, it can be seen that no matter whether the original data is all "1" or all "0", the written data obtained after the randomization operation presents a pattern of "0" and "1" appearing evenly alternately. This pattern significantly changes the original distribution of the first bit value and the second bit value in the original data, making the arrangement of "0" and "1" in the written data present a more random distribution characteristic.

[0081] It is worth noting that although the written data in this example presents a regular alternating pattern, this is only for the purpose of simplifying the description. In practical applications, the result of the randomization operation usually produces a more complex and irregular bit distribution to ensure the security of data stored in the storage device.

[0082] Through this example, we can clearly see 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 can not only improve the uniformity of data storage, so that the storage unit will not cause write interference due to the uneven distribution of data bit values, but also enhance data security.

[0083] More specifically, in one embodiment, the process of performing multiple randomization operations on the original data may 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) predefines multiple sets of random sequences of different lengths and stores them in a lookup table. A random sequence of appropriate length is selected based on the size of the original data. If the length of the original data exceeds the random sequence, the random sequence is used cyclically. 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 type of write data.

[0085] (2) Shift operation: The system maintains a shift pool containing different circular shift and logical shift values. When performing a shift operation on the original data, a value is selected from the shift pool and the entire data block is shifted. For large data blocks, they can be split into fixed-size segments, each using a different shift amount, and then reassembled to generate the second type of written data.

[0086] (3) Permutation operation: The system predefines multiple permutation tables, each of which defines a different way of reordering bits. Select a permutation table and rearrange the bits in the original data in the order defined in the table. For large data blocks, they can be divided into fixed-size blocks, each using a different permutation table, and then reassembled to generate a third type of written data.

[0087] (4) Dynamic random seed operation: The system collects a variety of system variables as inputs for random seeds, including but not limited to: system time (including local time of the host system 10 or storage device 20), data address, temperature sensor reading, power supply voltage fluctuation value, operating frequency of the memory controller 210, number of recent data read and 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), remaining capacity of the current 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 the 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 by bit operations to generate a composite seed. Use this seed to initialize a pseudo-random number generator (such as a linear congruential generator or a Mersenne twister algorithm) to generate a random sequence. Then, use this random sequence to transform the original data (such as an XOR operation or bitwise addition) to generate the fourth type of write data.

[0088] (5) Grouping operation: The original data is divided into multiple sub-blocks. The size of each sub-block can be fixed (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 for combined application. For example:

[0089] The first sub-block may first be subjected to an XOR operation and then to a bit shift operation.

[0090] The second sub-block can be permuted first and then operated using a dynamic random seed.

[0091] The third sub-block can only perform dynamic random seed operations.

[0092] After all sub-blocks are processed, they are reassembled to form the fifth type of written data.

[0093] Through these five different randomization operations, the system generates five different write data. This diverse randomization strategy increases the randomness of the data, making the distribution of the bit states of the bit values ​​of the final generated write data more uniform.

[0094] Please go back Figure 2 Next, in step S230 , the processor 211 performs a randomization verification operation on each write data to obtain target write data from the plurality of write data, wherein the randomization quality of the target write data is determined to be qualified.

[0095] Before describing the details of the randomized verification operation, the three-dimensional circuit architecture of the plurality of memory cells of the rewritable non-volatile memory module 220 is described first, wherein the plurality of memory cells are considered to be arranged at the intersections 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 The schematic diagram of the three-dimensional circuit architecture of multiple storage units of a rewritable non-volatile memory module according to an embodiment of the present invention is shown. The structure includes multiple key components to form a complex three-dimensional storage array. Taking a NAND type rewritable non-volatile memory module as an example, the specific structure is as follows:

[0097] Word Line (WL): WL0, WL1, WL2 and WL3 are marked in the figure and arranged horizontally along the x-axis. There are multiple 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 the first reference line corresponding to the x-direction (also called the first direction).

[0098] Bit Line (BL): In the figure, it is marked as BL0, BL1, BL2, etc., and is arranged vertically along the y-axis direction. The word line can be regarded as the second reference line corresponding to the Y direction (also called the second direction).

[0099] Cell String (CSTR): is a physical structure that contains a series of vertically stacked memory cells with SST at the top and GST at the bottom. It represents a complete vertical NAND string in a three-dimensional memory array and is the basic building block in a 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 to form 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). The CSTR (Cell String) in the present invention refers to a complete vertical structure including a series of vertically stacked memory cells and a top SST and a 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 and used to control the source select transistor (SST).

[0102] Ground Select Line (GSL): Located at the bottom of the NAND string, it is used to control the ground select transistor (GST).

[0103] Common Source Line (CSL): Located at the bottom, it provides 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 and controlled by SSL.

[0106] Ground Select Transistor (GST): Located at the bottom of each NAND string and controlled by the GSL.

[0107] Simply put, in this three-dimensional structure, the benchmarks 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 these three baselines is set as a memory cell (marked 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 the storage density, allowing more memory cells to be accommodated in the same chip area. It should be noted that these three directions are perpendicular to each other.

[0112] In one embodiment, the processor 211 obtains multiple bit values ​​of each written data, and each of the multiple bit values ​​is one of the preset N bit states. In the present invention, the storage unit of the non-volatile storage device can be configured to store different numbers of bit data. The number of bits that each storage unit can store can vary according to specific application requirements and technical implementations, and can range from 1 bit to multiple bits. It is divided into multiple 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 storage devices to achieve different storage densities under the same physical structure, thereby achieving a balance between capacity, performance, and reliability.

[0114] Taking TLC (Triple-Level Cell) flash memory as an example, each storage cell can store 3 bits of information / data, corresponding to 8 bit states (N=8), usually recorded as S0, S1, S2, S3, S4, S5, S6 and S7. The processor 211 reads the voltage level of each storage cell and converts it into the corresponding bit state. For example, the voltage level of a storage cell may correspond to state S3.

[0115] The following uses multiple embodiments to illustrate the implementation of the randomized verification operation of the present invention.

[0116] Embodiment 1: Obtaining N state proportions corresponding to the N bit states of the write data.

[0117] For example, in one embodiment, assuming that the storage unit is SLC, that is, X=1, N=2 1 =2.

[0118] Initially, the processor 211 obtains multiple bit values ​​of the write data. Assume that the obtained write data is eight bits of "10110101".

[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, for example, S0=0 and S1=1, and their numbers are 3 and 5 respectively.

[0121] Next, the processor 211 divides the number of each bit state by the total number of bits to obtain:

[0122] The percentage of bit state S0(0): 3 / 8 = 37.5%

[0123] Bit state S1(1) state ratio: 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 much different, the randomization quality is considered to be good. For example, if the difference between the proportions of the two states is less than a preset threshold value, it can be determined that the proportions of the two states are not much different, and the randomization quality is good.

[0126] Embodiment 2: Introducing a benchmark ratio value.

[0127] In this embodiment, the concept of a benchmark ratio value is introduced and used to evaluate the randomization quality.

[0128] The base percentage value corresponding to a memory cell 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 base percentage is 100% / 4=25%.

[0129] Initially, the processor 211 obtains a plurality of bit values ​​of the write data. Here, it is assumed that the write data is "1001101110100011".

[0130] Next, the processor 211 obtains the state proportions of N bit states. In this example, N=4, indicating four bit states: 00, 01, 10, and 11.

[0131] Next, the processor 211 divides the number of each bit state by the total number of bits to obtain:

[0132] The percentage of bit state S0 (00): 3 / 8 = 37.5%

[0133] The percentage of bit state S1 (01): 2 / 8 = 25%

[0134] The percentage of bit state S2(10): 2 / 8 = 25%

[0135] The percentage of bit state S3 (11): 1 / 8 = 12.5%

[0136] Next, the processor 211 obtains a reference proportion value. Ideally, the state proportion of each of the four bit states should be equal, that is, 100% / 4=25%.

[0137] Finally, the processor 211 obtains the randomization quality:

[0138] For example, the processor 211 compares the actual state ratio with the reference ratio 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 may determine the randomization quality based on the state ratio of each bit state and the reference ratio value through the following algorithm:

[0140] (1) Average deviation method

[0141] The processor 211 calculates the absolute deviation between each state ratio and the reference ratio, and then takes the average value:

[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 may set a threshold value, such as 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] 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 may set a corresponding threshold (also called a first preset threshold), such as 10%. If the maximum deviation is not greater than the threshold, the randomization quality is determined to be qualified; otherwise, it is determined to be unqualified.

[0152] (3) Standard deviation method

[0153] Processor 211 calculates the standard deviation of the state proportions:

[0154] Average share (benchmark share) = (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 may set a corresponding threshold, such as 8%. If the standard deviation is less than or equal to the threshold, 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 the 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 may set a corresponding threshold, such as 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 randomization quality of each written data.

[0167] When determining that the randomization quality of a write data is acceptable, the processor 211 may use the write data as the target write data.

[0168] In one embodiment, after the processor 211 obtains a target write data, it is not necessary to perform random verification operations on other write data to save system resources.

[0169] However, in another embodiment, the processor 211 may perform a randomization verification operation on all write data to find the randomized write data with qualified and best quality (e.g., the smallest maximum deviation value) as the target write data, thereby further improving the reliability and security of data storage in the storage device 20.

[0170] Please go back Figure 2 . After acquiring the target write data, then, in step S240, the processor 211 stores the target write data in multiple target storage units among the multiple storage units of the rewritable non-volatile memory module 220. In more detail, the processor 211 corresponds the physical addresses of multiple target storage units to the target write data, and updates the corresponding mapping information after the target write data is programmed to the physical address. In addition, this process may involve the wear leveling algorithm of the flash memory controller to ensure that the number of times the storage units are used is balanced and the service life of the storage device is extended.

[0171] On the other hand, the processor 211 generates and stores metadata related to the target write data, which metadata is associated with subsequent read and restore operations. In one embodiment, the metadata includes one or more of the following:

[0172] a. Randomization algorithm identifier: used to identify the randomization algorithm used when generating 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 data is written, used for data version control and recovery.

[0176] e. Data length: records the length of the original data for subsequent de-randomization operations.

[0177] f. Checksum: used to verify data integrity.

[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 restore the original data:

[0179] (1) Parsing a read instruction: The processor 211 parses a read instruction from the host system 10 and determines a logical address range of data to be read.

[0180] (2) Address conversion: The processor 211 uses a logical-to-physical mapping table to convert a logical address into a corresponding physical address.

[0181] (3) Reading metadata: The processor 211 first reads metadata related to the target data. These metadata are usually stored in predefined special pages or blocks, including:

[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) Reading 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 a correctable error is found, it is corrected. If an uncorrectable error is found, the data block is marked as an error and other recovery mechanisms are attempted.

[0189] (6) Data integrity verification: In one embodiment, the processor 211 also verifies the integrity of the read data using the stored checksum. If the check fails, it may be necessary to start a data recovery program or report an error to the host system.

[0190] (7) Determining a de-randomization algorithm: After obtaining the target write data after successful decoding, the processor 211 determines the de-randomization algorithm to be used according to the randomization algorithm identifier in the metadata.

[0191] (8) Performing a de-randomization operation: The processor 211 performs a de-randomization operation on the randomized data read. This process is the reverse process of the randomization operation during writing, and may include:

[0192] a. Reverse displacement operation

[0193] b. The inverse operation of the XOR operation

[0194] c. Reverse permutation operation

[0195] d. Use the same random seed to perform the reverse operation

[0196] (9) Data length adjustment: In one embodiment, the processor 21 may further trim the de-randomized data according to the original data length recorded in the metadata to ensure that the length of the restored data is consistent with the original data.

[0197] (10) Data transmission: After acquiring the corresponding original data, the processor 211 transmits the restored original data to the host system 10 through the connection interface circuit 230 in response to the read instruction.

[0198] Through this detailed de-randomization process, the storage controller 210 can accurately restore the randomized target write data stored in the storage device 20 to the corresponding original data and safely transmit it to the host system 10. This process not only ensures the correct recovery of the 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 be implemented by a specific randomization circuit and a de-randomization circuit to implement the above-mentioned randomization / de-randomization algorithm. In addition, the randomization circuit and the de-randomization circuit can also be integrated into the same circuit unit.

[0199] Figure 5 FIG. 4 is a flow chart of a randomized verification operation according to an embodiment of the present invention.

[0200] Please refer to Figure 5 This embodiment describes a method for verifying the randomization quality of written data, which is applicable to a rewritable non-volatile memory module having multiple storage units. The method is executed by a processor of a storage controller and mainly includes the following steps:

[0201] Obtaining bit value (step S510):

[0202] The processor obtains multiple bit values ​​of the written data. Each bit value corresponds to one of N bit states, where N = 2 X, X is the number of bits that can be stored in each memory cell. For example, for MLC (Multi-Level Cell) flash memory, X=2, N=4, indicating that each memory cell can store 2 bits of data and has 4 possible states.

[0203] Calculate the state ratio (step S520):

[0204] The processor calculates the proportion of N states corresponding to the N bit states of the written data based on the obtained multiple bit values. For example, for MLC flash memory, the possible states are 00, 01, 10, and 11, and the processor calculates the proportion of each state in the written data.

[0205] Obtaining a reference ratio value (step S530):

[0206] The processor obtains a reference proportion value based on the N bit states. Ideally, the proportion of each state should be equal, that is, the reference proportion value is 1 / N. For example, for MLC flash memory, the reference proportion value is 25%.

[0207] Calculate the deviation value (step S540):

[0208] The processor calculates N deviation values ​​between the 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 a maximum deviation value among the N deviation values, which represents the degree to which the data distribution deviates from the ideal random state.

[0211] Determine 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 randomization quality 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 randomization quality of the written data is unqualified (step S580).

[0215] In another embodiment, when it is determined that the maximum deviation value is greater than the first preset threshold, the processor 211 may perform further judgment to determine the degree of deviation 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 will also determine whether the maximum deviation value is greater than the second preset threshold. If it is greater than the second preset threshold, one or more target deviation values ​​greater than the first preset threshold among the N deviation values ​​are obtained (that is, all deviation values ​​greater than the first preset threshold are found as target deviation values). 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 the abnormal distribution of specific bit states.

[0217] Advantages of this embodiment include:

[0218] Strong adaptability: can be applied to different types of flash memory (SLC, MLC, TLC, QLC, etc.).

[0219] Precise evaluation: Provides a quantitative assessment of the quality of randomization by calculating specific deviation values.

[0220] Multi-level judgment: Using multiple thresholds, randomization quality issues can be classified more finely.

[0221] Problem location: It can identify which specific states have distribution problems, which is conducive to targeted optimization.

[0222] The following further uses a complete embodiment to illustrate the randomized verification operation of the present invention.

[0223] Assuming that a TLC (Triple-Level Cell) flash memory is used, the preset number of bit states is 8 (N=8), corresponding to the 8 states S0 to S7. Ideally, the baseline proportion value (P base ) is 12.5%.

[0224] After reading all storage units, 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, that is, the absolute value of the difference between the actual proportion value (the state proportion of each bit state) and the reference proportion value (that is, Δ = |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 that the preset first threshold is 1%, then: 0.8%(Δmax)<1%(first preset threshold).

[0237] Therefore, in this example, the processor 211 determines that the quality of randomization of the written data is qualified through 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 randomization is unqualified. For example, if the actual proportion of S1 is changed to 9%, then its deviation value is 3.5%, which exceeds the first preset threshold of 1%, and the randomization will be determined to be unqualified (failed the randomization verification operation).

[0239] This rapid detection method can effectively identify the abnormal distribution status and provide 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 a more detailed evaluation. This method can distinguish between a minor randomization failure and a serious circuit design problem. The following is a specific example to illustrate this advanced verification process:

[0241] Assume that TLC flash memory is still used, with 1,000,000 storage cells and 8 bit states (S0-S7). 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 storage units, the following actual state proportions (Px) are obtained: S0: 15.0%; S1: 9.0%; S2: 12.5%; S3: 10.2%; S4: 14.8%; S5: 15.9%; S6: 12.3%; 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 unqualified. 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 believes that this may represent a serious problem in the circuit design of the flash memory chip. In this case, the processor 211 obtains all states that exceed the first preset threshold (1%): S0 (2.5%), S1 (3.5%), S3 (2.3%), S4 (2.3%), S5 (3.4%), 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 preset threshold and the second preset threshold, 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 failures; it can detect possible serious circuit design problems. When serious problems are found, it provides more comprehensive abnormal status information, which helps to conduct in-depth analysis and targeted improvements. In addition, by distinguishing different degrees of randomization failures, corresponding processing strategies can be adopted to improve the reliability and performance of flash memory chips.

[0256] In one embodiment, when the processor 211 determines that the randomization of the written data is unqualified, further measures can be taken to assist in the subsequent circuit design optimization. Specifically, the processor 211 obtains the abnormal bit state corresponding to the maximum deviation value in the N bit states; and records the abnormal bit state. In one embodiment, this record includes one or more of the following: recording the type of the abnormal bit state; recording the position distribution of the abnormal bit state in the written data; recording the type of randomization operation that causes the abnormal bit state.

[0257] For example, assuming that the write data of the corresponding MLC is "11110000", the calculated state ratios are: 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 judged to be unqualified.

[0258] The processor recognizes states "00" and "11" as abnormal bit states because their deviation values ​​(25%) are the largest.

[0259] Next, the processor records the following information:

[0260] (1) Abnormal bit state types: 00 and 11;

[0261] (2) Position distribution: 00 is in the second half, 11 is in the first half;

[0262] (3) The type of randomization operation that caused the exception: For example, it may be caused by a simple bit reversal operation.

[0263] It should be noted that the above-mentioned example of recording is about the inspection of a threshold value. However, corresponding to the inspection of the multi-stage threshold value, the processor 211 may also record the corresponding abnormal bit state. 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 value, the processor 211 obtains the abnormal bit state corresponding to the maximum deviation value in 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 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.

[0264] In addition, in some extreme examples, the quality of randomization of all written data is unqualified. In one embodiment, the processor 211 can further adjust the multiple randomization operations according to the abnormal bit state to regenerate multiple new written data; and perform the randomization verification operation on each new written data again to try to obtain the target written data, and then store the target written data in the multiple target storage units. The adjustment includes: selecting or combining different randomization algorithms according to the type and distribution of the abnormal bit state; adjusting the parameters of each randomization operation, such as the random sequence of the XOR operation, the displacement of the shift operation, the permutation table of the permutation operation, etc.; for the data part where abnormalities frequently occur, increase the complexity or intensity of the randomization operation.

[0265] For example, following the above example, after recording the relevant information that the states "00" and "11" are abnormal bit states, the processor 211 may perform subsequent processing. For example:

[0266] (1) Adjusting the randomization operation: The processor 211 may make the following adjustments:

[0267] Choose a new randomization algorithm, such as introducing a random sequence that adjusts the XOR operation or dividing the data into blocks and applying different randomization strategies to different blocks.

[0268] (2) Regenerating write data: The processor 211 regenerates a plurality of write data using the adjusted randomization operation.

[0269] (3) Execute randomized verification again: The processor 211 repeatedly executes the randomized verification operation on each newly generated write data until qualified target write data is obtained.

[0270] (4) Storing target write data: The processor 211 stores the verified target write data in multiple target storage units.

[0271] This method of dynamically adjusting randomization operations has significant technical benefits. By analyzing abnormal bit states, the processor can specifically select or combine different randomization algorithms, such as introducing shift operations or adjusting XOR sequences. Block processing of data further improves the flexibility and effectiveness of randomization. This adaptive method not only solves specific randomization problems, but also continuously optimizes data distribution and improves storage efficiency. The repeated verification and adjustment process ensures that the final written data has high-quality randomness, thereby extending the life of the storage device, improving overall performance and reliability, while reducing the risk of data hotspots and uneven wear.

[0272] This embodiment also provides a computer program product, including a computer readable code, or a non-volatile computer readable storage medium carrying the computer readable code, when the computer readable code runs in the processor of the storage device, the processor in the storage device executes the steps of the above-mentioned memory test method. The computer program product can be implemented in 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 randomized verification operation proposed by the present invention have significant technical effects. By performing multiple randomization operations on the written data and executing the corresponding verification process, the method can effectively improve the distribution uniformity of data in the non-volatile memory. Specifically, the method accurately quantifies the randomization quality of the data by calculating the bit state ratio, comparing with the benchmark ratio value, determining the deviation value and other steps. The introduction of a multi-level threshold judgment mechanism can not only identify unqualified randomization results, but also distinguish different degrees of randomization problems. Finally, the randomized written data with qualified quality can also be obtained to store the original data. In particular, the adaptive adjustment mechanism of the present method records the type, distribution position and randomization operation of the abnormal bit state, and the system can adjust the randomization strategy in a targeted manner. For example, a new randomization algorithm is selected according to the abnormal state, 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 changeable data patterns, high-quality randomization results can be adaptively generated.

[0274] In addition, the iterative verification mechanism of the present method further ensures the randomization quality of the written data. By repeatedly performing randomization operations and verification steps until the target written data that meets the requirements is obtained, the method greatly improves the reliability and uniformity of the stored data. This not only optimizes the utilization efficiency of the storage unit, but also significantly extends the service life of the storage device, reducing the risk of data hot spots and uneven wear. In summary, the data writing method and memory controller provided by the present invention have significant advantages in improving data randomization quality, optimizing storage efficiency, and extending device life. 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 invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A data writing method for a rewritable non-volatile memory module having a plurality of storage units, characterized in that: include: Get raw data from the host system; Performing multiple randomization operations on the original data to obtain multiple write data; performing a randomization verification operation on each write data to obtain target write data from the plurality of write data, wherein the randomization quality of the target write data is determined to be qualified; The target write data is stored in a plurality of target storage units among the plurality of storage units.

2. The data writing method according to claim 1, characterized in that: Each randomization operation processes the original data using a different randomization algorithm, wherein the different randomization algorithms include at least one of the following: XOR operation, performing XOR operation on the original data and a plurality of predefined different random sequences; A shift operation, performing a plurality of different circular shifts or logical shifts on the original data; A permutation operation, changing the order of bits in the original data according to a plurality of predefined different permutation tables; Dynamic random seed operation, generating multiple different random seeds based on system time, data address or other system variables, and using the multiple random seeds and the original data to generate the multiple write data; as well as A grouping operation is performed to divide the original data into a plurality of sub-blocks, and different XOR operations, shift operations, permutation operations, and dynamic random seed operations are applied to the plurality of sub-blocks.

3. The data writing method according to claim 1, characterized in that: The step of performing the randomization verification operation on each written data includes: Obtain multiple bit values ​​of the written data, each bit value corresponds to one of N bit states, where N is 2 X , and X is the number of bits that can be stored in one storage unit of each storage unit; According to the multiple bit values, obtaining N state proportions of the written data corresponding to the N bit states; The randomization quality of the written data is obtained according to the proportions of the N states.

4. The data writing method according to claim 3, characterized in that: The step of performing the randomization verification operation on each written data further includes: Based on the N bit states, obtaining a reference proportion value; and The quality of the randomization of the write data is obtained according to the N state proportions and the benchmark proportion value.

5. The data writing method according to claim 4, characterized in that: The step of performing the randomization verification operation on each written data further includes: Based on the multiple bit values, obtaining N deviation values ​​between the N state proportions and the reference proportion value; Determine 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 written data is qualified; If the maximum deviation value is greater than the first preset threshold, it is determined that the quality of the randomization of the write data is unqualified.

6. The data writing method according to claim 5, characterized in that: After determining that the quality of the randomization of the write data is unqualified, the method further includes: Obtaining an abnormal bit state corresponding to the maximum deviation value among the N bit states; and The abnormal bit state is recorded.

7. The data writing method according to claim 6, characterized in that: If the randomization qualities of the plurality of write data are all unqualified, the method further comprises: According to the abnormal bit state, adjusting the plurality of randomization operations to regenerate a plurality of new write data; and The randomized verification operation is performed again on each new write data to try to obtain the target write data, and then the target write data is stored in the plurality of target storage units.

8. The data writing method according to claim 4, characterized in that: The step of performing the randomization verification operation on each written data further includes: Based on the multiple bit values, obtaining N deviation values ​​between the N state proportions and the reference proportion value; Determine 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 written data is qualified; If the maximum deviation value is greater than the first preset threshold, it is determined that the quality of the randomization of the written data is unqualified, and it is determined whether the maximum deviation value is greater than a second preset threshold, If the maximum deviation value is greater than the second preset threshold, one or more target deviation values ​​greater than the first preset threshold among the N deviation values ​​are obtained.

9. The data writing method according to claim 8, characterized in that: After determining that the quality of the randomization of the write data is unqualified, the method further includes: 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, 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.

10. A memory controller, suitable for a storage device equipped 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, for electrically connecting 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: Get raw data from the host system; Performing multiple randomization operations on the original data to obtain multiple write data; performing a randomization verification operation on each write data to obtain target write data from the plurality of write data, wherein the randomization quality of the target write data is determined to be qualified; The target write data is stored in a plurality of target storage units among the plurality of storage units.

11. The memory controller according to claim 10, characterized in that: Each randomization operation processes the original data using a different randomization algorithm, wherein the different randomization algorithms include at least one of the following: XOR operation, performing XOR operation on the original data and a plurality of predefined different random sequences; A shift operation, performing a plurality of different circular shifts or logical shifts on the original data; A permutation operation, changing the order of bits in the original data according to a plurality of predefined different permutation tables; Dynamic random seed operation, generating multiple different random seeds based on system time, data address or other system variables, and using the multiple random seeds and the original data to generate the multiple write data; as well as A grouping operation is performed to divide the original data into a plurality of sub-blocks, and different XOR operations, shift operations, permutation operations, and dynamic random seed operations are applied to the plurality of sub-blocks.

12. The memory controller according to claim 10, wherein: The step of performing the randomization verification operation on each written data includes: Obtain multiple bit values ​​of the written data, each bit value corresponds to one of N bit states, where N is 2 X , and X is the number of bits that can be stored in one storage unit of each storage unit; According to the multiple bit values, obtaining N state proportions of the written data corresponding to the N bit states; The randomization quality of the written data is obtained according to the proportions of the N states.

13. The memory controller according to claim 12, wherein: The step of performing the randomization verification operation on each written data further includes: Based on the N bit states, obtaining a reference proportion value; and The quality of the randomization of the write data is obtained according to the N state proportions and the benchmark proportion value.

14. The memory controller according to claim 13, wherein: The step of performing the randomization verification operation on each written data further includes: Based on the multiple bit values, obtaining N deviation values ​​between the N state proportions and the reference proportion value; Determine 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 written data is qualified; If the maximum deviation value is greater than the first preset threshold, it is determined that the quality of the randomization of the write data is unqualified.

15. The memory controller according to claim 14, wherein: After determining that the quality of the randomization of the write data is unsatisfactory, the processor is further configured to: Obtaining an abnormal bit state corresponding to the maximum deviation value among the N bit states; and The abnormal bit state is recorded.

16. The memory controller according to claim 15, characterized in that: If the randomization qualities of the plurality of write data are all unqualified, the processor is further configured to: According to the abnormal bit state, adjusting the plurality of randomization operations to regenerate a plurality of new write data; and The randomized verification operation is performed again on each new write data to try to obtain the target write data, and then the target write data is stored in the plurality of target storage units.

17. The memory controller according to claim 13, wherein: The step of performing the randomization verification operation on each written data further includes: Based on the multiple bit values, obtaining N deviation values ​​between the N state proportions and the reference proportion value; Determine 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 written data is qualified; If the maximum deviation value is greater than the first preset threshold, it is determined that the quality of the randomization of the written data is unqualified, and it is determined whether the maximum deviation value is greater than a second preset threshold, If the maximum deviation value is greater than the second preset threshold, one or more target deviation values ​​greater than the first preset threshold among the N deviation values ​​are obtained.

18. The memory controller according to claim 17, wherein: After determining that the quality of the randomization of the write data is unsatisfactory, 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 in the N bit states, and recording the abnormal bit state; as well as If the maximum deviation value is greater than the second preset threshold, 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

  • OTP memory, data writing reading methods thereof and security chip

    CN107908359A

  • System and method to facilitate welding software as a service

    CN108027911A

  • Memory management method and memory controller

    CN110377538A

  • Memory management method and memory controller

    CN110727390A

Cited By

  • Verification method and verification device for randomization effect of flash memory device, and storage medium

    CN120510899A

  • Data writing method and memory controller

    WO2026152821A1