Weak Page protection method and device based on NAND storage, equipment and medium

By dynamically deciding to enable weak page protection strategies in NAND storage devices, distinguishing between weak and non-weak pages, and employing differentiated data storage modes and ECC protection strengths, the problem of uncorrectable weak page errors in NAND storage devices is solved, ensuring the data integrity of the device.

CN121597478APending Publication Date: 2026-03-03SUZHOU UNIONMEMORY INFORMATION SYST LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511847921.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-09
Publication Date
2026-03-03

AI Technical Summary

Technical Problem

Existing technologies in NAND storage devices cannot implement differentiated error protection mechanisms for physical pages with different reliability characteristics within a block. This makes it easy for weak pages to suffer uncorrectable errors during data storage, affecting the overall data integrity of the device.

Method used

In NAND storage devices, dynamic decisions are made on whether to enable weak page protection strategies. Weak pages and non-weak pages in physical blocks are distinguished by weak page bitmaps. Different data storage modes and ECC protection strengths are used for writing, and corresponding decoding strategies are used during the reading process.

Benefits of technology

This effectively avoids uncorrectable errors caused by weak pages during data storage, ensuring the overall data integrity of the device.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121597478A_ABST
    Figure CN121597478A_ABST
Patent Text Reader

Abstract

The invention discloses a Weak Page protection method and device based on NAND storage, equipment and a medium, and relates to the technical field of solid state disks, and the method comprises the following steps: when data is written into a physical block of NAND storage equipment, dynamically deciding whether to start a weak page protection strategy for the physical block based on the current state of the NAND storage equipment, and recording a writing strategy of the physical block; if the weak page protection strategy is started, querying a preset weak page bitmap in a data writing process, writing a non-weak page by adopting a first data storage mode and a first ECC protection intensity, and writing a weak page by adopting a second data storage mode and a second ECC protection intensity; and in a data reading process, determining a data storage mode and ECC protection strength corresponding to the physical page according to the write-in strategy and the weak page bitmap, and performing data reading by adopting a corresponding ECC decoding strategy. According to the method, uncorrectable errors of the weak page in the data storage process can be effectively avoided, and the overall data integrity of equipment is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of solid-state drive technology, and in particular to a method, apparatus, device, and medium for Weak Page Protection based on NAND storage. Background Technology

[0002] NAND flash memory has become the core medium for storage devices such as solid-state drives (SSDs) and UFS. Its basic structure consists of multiple independently operable wafers, each containing multiple physical blocks as the smallest erase unit. Each physical block is further divided into multiple physical pages as the smallest read / write unit. To ensure data reliability, existing technologies typically apply a uniform error checking and correction mechanism to user data at the physical page level. This can be achieved through methods such as using fixed-strength ECC encoding and constructing RAID-like redundancy protection strategies among multiple physical pages to address the increasing error risk associated with the miniaturization of storage units and their deterioration in lifespan.

[0003] However, as NAND manufacturing processes continue to evolve, the physical characteristics of storage cells fluctuate more significantly, leading to substantial differences in quality and reliability between different physical pages within the same physical block. Some physical pages, due to manufacturing process variations or structural weaknesses, exhibit a higher raw bit error rate, making them more prone to data errors during actual use. Although current solutions employ the same ECC error correction capability configuration for all pages within a block, the number of error bits in weak pages may exceed the preset ECC error correction threshold under certain conditions. This makes it difficult for traditional indiscriminate data protection mechanisms to cover the reliability requirements of all pages, creating a risk point for data corruption at weak pages and hindering further improvements in the overall reliability of NAND storage devices. Summary of the Invention

[0004] This invention provides a method, apparatus, device, and medium for Weak Page Protection based on NAND storage. The technical problem it aims to solve is that in NAND storage devices that adopt a unified data protection strategy, due to the inability to implement differentiated error protection mechanisms for physical pages with different reliability characteristics within a block, weak pages with poor reliability are prone to uncorrectable errors during data storage, thereby affecting the overall data integrity of the device.

[0005] In a first aspect, embodiments of the present invention provide a Weak Page Protection Method based on NAND storage, comprising: When writing data to a physical block of a NAND storage device, a dynamic decision is made based on the current state of the NAND storage device as to whether to enable a weak page protection policy for the physical block, and the writing policy of the physical block is recorded. If the weak page protection policy is enabled, during the data writing process, query the preset weak page bitmap, and write the non-weak pages in the physical block using the first data storage mode and the first ECC protection strength, and write the weak pages in the physical block using the second data storage mode and the second ECC protection strength. Among them, the second ECC protection strength is higher than the first ECC protection strength, and the user data storage capacity in the second data storage mode is lower than that in the first data storage mode; During the data reading process, according to the writing policy of the physical block and the weak page bitmap, determine the data storage mode and the ECC protection strength corresponding to the physical pages of the physical block, and use the corresponding ECC decoding strategy for data reading.

[0006] A further technical solution thereof is that the creation process of the weak page bitmap includes the following steps: By performing a reliability test on the NAND medium of the NAND storage device, obtain the number of error bits of each physical page of the NAND storage device; Mark the physical pages with the number of error bits exceeding the preset threshold as weak pages; Based on the marking result, generate and store the weak page bitmap corresponding to each physical block.

[0007] A further technical solution thereof is that the current state includes the service life of the NAND storage device and / or the size of the available reserved space; the dynamic decision on whether to enable the weak page protection policy for the physical block based on the current state of the NAND storage device includes: If the service life of the NAND storage device is less than the preset service life threshold and / or the available reserved space is greater than the preset available reserved space threshold, decide to enable the weak page protection policy.

[0008] A further technical solution thereof is that the first data storage mode is to store the user data of N logical page addresses in one physical page and generate the ECC check data of the first capacity correspondingly; The second data storage mode is to store the user data of M logical page addresses in one physical page and generate the ECC check data of the second capacity correspondingly, where M < N, and the second capacity is greater than the first capacity.

[0009] A further technical solution thereof is that N = 4 and M = 3.

[0010] A further technical solution thereof is that the determination of the data storage mode and the ECC protection strength corresponding to the physical pages of the physical block according to the writing policy of the physical block and the weak page bitmap includes: Obtain the logical address of the target data according to the host read command; Query the mapping table from logical address to physical address to determine the physical block and physical page corresponding to the storage of the target data; Query the write strategy of the physical block corresponding to the target data; If the write policy is to enable weak page protection, the weak page bitmap is queried to determine whether the physical page corresponding to the target data is a weak page, and the data storage mode and ECC protection strength of the physical page corresponding to the target data are determined based on the determination result.

[0011] A further technical solution is that the method further includes: Upon power-up, the weak page bitmap and the recorded write strategy of the physical block are loaded into memory for querying during read and write operations.

[0012] Secondly, embodiments of the present invention also provide a NAND-based Weak Page Protection Device, which includes a unit for performing the above-described method.

[0013] Thirdly, embodiments of the present invention also provide a computer device, which includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the above-described method.

[0014] Fourthly, embodiments of the present invention also provide a computer-readable storage medium storing a computer program that, when executed by a processor, can implement the above-described method.

[0015] This invention provides a method, apparatus, device, and medium for weak page protection based on NAND storage. The method includes: when writing data to a physical block of a NAND storage device, dynamically deciding whether to enable a weak page protection strategy for the physical block based on the current state of the NAND storage device, and recording the write strategy of the physical block; if the weak page protection strategy is enabled, during the data writing process, querying a preset weak page bitmap, writing non-weak pages in the physical block using a first data storage mode and a first ECC protection strength, and writing weak pages in the physical block using a second data storage mode and a second ECC protection strength, wherein the second ECC protection strength is higher than the first ECC protection strength, and the user data storage capacity under the second data storage mode is lower than that under the first data storage mode; during the data reading process, determining the data storage mode and ECC protection strength corresponding to the physical pages of the physical block according to the write strategy of the physical block and the weak page bitmap, and using the corresponding ECC decoding strategy for data reading. This invention, by employing differentiated protection strategies, can effectively avoid uncorrectable errors easily occurring in weak pages with poor reliability during data storage, thereby ensuring the overall data integrity of the device. Attached Figure Description

[0016] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0017] Figure 1 A flowchart illustrating a NAND-based Weak Page Protection method provided in an embodiment of the present invention; Figure 2 This is a schematic block diagram of a computer device provided in an embodiment of the present invention. Detailed Implementation

[0018] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0019] It should be understood that, when used in this specification and the appended claims, the terms "comprising" and "including" indicate the presence of the described features, integrals, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.

[0020] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the invention. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.

[0021] It should also be further understood that the term "and / or" as used in this specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0022] As used in this specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if [described condition or event] is detected" may be interpreted, depending on the context, as "once determined," "in response to determination," "once [described condition or event] is detected," or "in response to detection of [described condition or event]."

[0023] Please see Figure 1 This invention provides a Weak Page Protection Method based on NAND storage, which includes the following steps: S1, when writing data to a physical block of a NAND storage device, dynamically decide whether to enable a weak page protection strategy for the physical block based on the current state of the NAND storage device, and record the writing strategy of the physical block.

[0024] In practice, traditional methods apply the same ECC protection strength to all physical pages, which can lead to overprotection of high-reliability, non-weak pages while underprotecting low-reliability, weak pages. This embodiment dynamically decides whether to enable a weak page protection strategy based on the current device state during writing, making the protection measures flexible and adaptable to the actual operating conditions of the device, rather than being fixed. Simultaneously, the writing strategy of the physical blocks is accurately recorded.

[0025] In some preferred embodiments, the current state includes the lifespan of the NAND storage device and / or the size of the available reserved space (OP space). The above step "dynamically decide whether to enable the weak page protection strategy for the physical block based on the current state of the NAND storage device" specifically includes the following steps: if the lifespan of the NAND storage device is less than a preset lifespan threshold and / or the available reserved space is greater than a preset available reserved space threshold, decide to enable the weak page protection strategy; otherwise, decide not to enable the weak page protection strategy.

[0026] In practice, this decision-making logic closely links the activation of weak page protection strategies to the specific stage of the device's lifespan: protection is activated in the early stages of the device's lifespan (shorter service life) or when there is sufficient available reserved space. Specifically, in the early stages of the device's lifespan, the wear and tear on the storage media itself is relatively minor, and overall reliability is high. Activating enhanced protection at this time can serve as a preventative measure, maximizing the high-reliability runtime of the device and providing users with a more stable initial experience. When there is sufficient available reserved space, it means that the device has enough redundant resources (i.e., OP space) to cover the storage capacity overhead caused by adopting a secondary data storage mode (storing less user data), thus avoiding immediate user space shortages due to the activation of protection. Conversely, when the device's lifespan is long (near the end of its lifespan) or when available reserved space is scarce, the decision is not to activate the protection strategy. At the end of the lifespan, the media wear is severe, and there may be a generally high error rate. At this time, if enhanced protection is still applied to some weak pages, its marginal benefit diminishes, while the cost (occupying valuable space) is high. It is better to use resources for global garbage collection and bad block management. When space is limited, prioritizing the available capacity for users becomes a more urgent need. Therefore, temporarily disabling enhanced protection to maintain sufficient storage space is a more reasonable choice.

[0027] In some preferred embodiments, the write strategy of the physical block includes a first mode and a second mode; wherein, the first mode indicates that weak page protection is not enabled, and all physical pages in the physical block are protected by the first data storage mode and the first ECC protection strength; the second mode indicates that weak page protection is enabled, and the non-weak pages in the physical block are protected by the first data storage mode and the first ECC protection strength, while the weak pages in the physical block are protected by the second data storage mode and the second ECC protection strength.

[0028] In specific implementation, the first mode (protection not enabled) corresponds to the traditional and homogenized processing method, that is, for all physical pages within the entire physical block, regardless of their inherent reliability, a unified first data storage mode and first ECC protection strength are adopted. This mode simplifies management and is applicable to scenarios with low reliability requirements or tight system resources. The second mode (protection enabled) represents the core innovation of the present invention. It defines the rules for differential processing of pages within the block: for non-weak pages, the processing method of the first mode is followed to maintain efficiency, while for weak pages, the second data storage mode and second ECC protection strength are switched to provide enhanced protection. This clear mode division makes it possible to completely determine all subsequent data layouts and ECC strategies of the block by simply specifying a mode identifier (such as 0 or 1) when allocating a physical block, greatly simplifying the control logic.

[0029] S2, if the weak page protection policy is enabled, during the data writing process, query the preset weak page bitmap, write the non-weak pages in the physical block using the first data storage mode and first ECC protection strength, and write the weak pages in the physical block using the second data storage mode and second ECC protection strength, where the second ECC protection strength is higher than the first ECC protection strength, and the user data storage capacity in the second data storage mode is lower than that in the first data storage mode.

[0030] In specific implementation, after the decision to enable the protection policy, the solution further makes a precise distinction based on the preset weak page bitmap: maintain the original first data storage mode and first ECC protection strength for non-weak pages to ensure storage efficiency; while for the identified weak pages, enable the second data storage mode and stronger second ECC protection strength. The key design here is that the second data storage mode sacrifices part of the user data storage capacity (that is, stores less user data) to exchange for sufficient space to store more powerful ECC check data, which is equivalent to redistributing the limited storage resources from "data volume" to "data insurance", thus directly and effectively enhancing the anti-risk ability of the weakest link.

[0031] In some preferred embodiments, the first data storage mode is to store user data of N logical page addresses in one physical page and generate ECC check data of the first capacity correspondingly; the second data storage mode is to store user data of M logical page addresses in one physical page and generate ECC check data of the second capacity correspondingly, where M < N, and the second capacity is greater than the first capacity. For example, N = 4, M = 3, and the present invention does not specifically limit.

[0032] In specific implementation, the first data storage mode (storing N LPAs) represents the conventional mode, which pursues higher storage density and efficiency. For this purpose, it is equipped with moderate ECC check data (the first capacity), and its protection ability is sufficient to cope with the error rates of most ordinary physical pages. The second data storage mode (storing M LPAs, and M < N) represents the protection-priority mode. By reducing the amount of user data stored (from N to M), it creates extra space within the physical page. This part of the space is used to store a larger amount of ECC check data (the second capacity). According to information theory and the principle of error-correcting coding, under the same coding algorithm, the length of the check data directly determines its error-correcting ability; the more check bits, the higher the number of error bits that can be detected and corrected. Therefore, this "design of trading space for reliability" enables the second ECC protection strength to be substantially higher than the first ECC protection strength. For example, the first ECC that could originally only correct t errors may be upgraded to a second ECC that can correct 2t or even more errors. This effect is direct and quantifiable, ensuring that those physical pages marked as weak pages with a high original error rate can obtain a significantly enhanced error resistance ability that matches their risk level, thereby minimizing the probability of data corruption.

[0033] In some preferred embodiments, the process of creating the weak-page bitmap includes the following steps: obtaining the number of error bits of each physical page of the NAND storage device by performing a reliability test on the NAND medium of the NAND storage device; marking the physical pages whose number of error bits exceeds a preset threshold as weak pages; generating and storing the weak-page bitmap corresponding to each physical block based on the marking result.

[0034] In specific implementation, by performing an active and systematic reliability test on the NAND medium before the NAND storage device leaves the factory, the key reliability parameter of the number of error bits of each physical page under actual stress conditions can be obtained. This step is equivalent to giving a comprehensive "physical examination" and "inventory" of all storage units before the device is put into use, so as to objectively identify those weak pages with congenital deficiencies or potential defects. Subsequently, marking the physical pages whose number of error bits exceeds the preset threshold as weak pages, this quantitative screening process ensures the accuracy and objectivity of the identification, avoiding subjective speculation, and providing a reliable target object for subsequent differential processing. Generating and storing the weak-page bitmap corresponding to each physical block based on the marking result is the systematic collation and solidification of the identification information. This weak-page bitmap is like a high-precision "risk map", clearly marking all the weak points that need to be focused on in the entire storage medium. Without this pre-prepared weak-page bitmap, subsequent dynamic decision-making and differential protection will lose their basis and cannot achieve precise measures.

[0035] S3. During the data reading process, based on the write strategy of the physical block and the weak page bitmap, the data storage mode and ECC protection strength corresponding to the physical page of the physical block are determined, and the corresponding ECC decoding strategy is used to read the data.

[0036] In practice, during the data reading phase, it is required to backtrack and match the protection mode used during writing based on the write strategy and weak page bitmap, and then use the corresponding ECC decoding strategy for data reading. This mechanism ensures the consistency of the entire data path and avoids error correction failures caused by mismatched read and write strategies.

[0037] In some preferred embodiments, the above step "determining the data storage mode and ECC protection strength corresponding to the physical page of the physical block according to the write policy of the physical block and the weak page bitmap" specifically includes the following steps: obtaining the logical address of the target data according to the host read command; querying the mapping table from logical address to physical address to determine the physical block and physical page corresponding to the target data; querying the write policy of the physical block corresponding to the target data; if the write policy is to enable weak page protection, querying the weak page bitmap to determine whether the physical page corresponding to the target data is a weak page, and determining the data storage mode and ECC protection strength of the physical page corresponding to the target data according to the determination result.

[0038] In practice, the logical address of the target data is obtained based on the host read command; this is the starting point for all read operations. Next, the mapping table from logical address to physical address is queried to convert the logical access request into a location for the specific physical storage (physical block and physical page). This is a standard step in NAND storage management, ensuring correct addressing. The core improvement lies in the subsequent step: querying the write policy corresponding to the target physical block. This step is crucial in determining subsequent branches, as it confirms the write policy for that physical block during writing. If the write policy disables weak page protection, the default decoding policy can be used uniformly, ensuring read efficiency. If the write policy enables weak page protection, the process is further activated, identifying the physical page by querying the weak page bitmap. This identification is critical because it ultimately determines whether to call the standard decoder corresponding to the first data storage mode / first ECC protection strength or the enhanced decoder corresponding to the second data storage mode / second ECC protection strength. If this step is missing, or the step order is incorrect, it may lead to the misuse of the standard decoder for weak page data without error correction, or the misuse of the enhanced decoder for non-weak page data, resulting in wasted resources.

[0039] In some preferred embodiments, the method further includes the following steps: upon power-on, loading the weak page bitmap and the recorded write strategy of the physical block into memory for querying during read and write operations.

[0040] In practical implementation, the weak page bitmap and write policy table are the core data structures and decision-making basis for the differentiated management of this invention. Their existence enables the system to query the history and attributes of each physical block and physical page. If this critical data is stored only in the slower NAND flash memory, each read / write operation requires an additional query to the NAND to obtain policy information, which will introduce significant access latency and severely affect the performance of the storage device, especially for random read / write and small data packet operations. By loading this metadata into the extremely fast random access memory at power-on, the system can directly perform fast table lookup operations in memory when processing host read / write commands. This means that the decision-making process of determining whether a physical block is protected or whether a physical page is a weak page adds almost no additional I / O overhead or time latency. This design allows the protection mechanism of this invention to be seamlessly integrated into the firmware process of the storage device, which is transparent and imperceptible to the user, without sacrificing the speed performance of the device due to the introduction of complex reliability management.

[0041] This invention proposes a weak page protection method based on NAND storage, comprising: when writing data to a physical block of a NAND storage device, dynamically deciding whether to enable a weak page protection strategy for the physical block based on the current state of the NAND storage device, and recording the writing strategy of the physical block; if the weak page protection strategy is enabled, during the data writing process, querying a preset weak page bitmap, writing non-weak pages in the physical block using a first data storage mode and a first ECC protection strength, and writing weak pages in the physical block using a second data storage mode and a second ECC protection strength, wherein the second ECC protection strength is higher than the first ECC protection strength, and the user data storage capacity under the second data storage mode is lower than that under the first data storage mode; during the data reading process, determining the data storage mode and ECC protection strength corresponding to the physical pages of the physical block according to the writing strategy of the physical block and the weak page bitmap, and using the corresponding ECC decoding strategy for data reading. This invention, by employing differentiated protection strategies, can effectively avoid uncorrectable errors easily occurring in weak pages with poor reliability during data storage, thereby ensuring the overall data integrity of the device.

[0042] Corresponding to the above-described NAND-based weak page protection method, this invention also provides a NAND-based weak page protection device. This NAND-based weak page protection device includes a unit for executing the above-described NAND-based weak page protection method, and can be configured in terminals such as desktop computers, tablet computers, and laptops. Specifically, the NAND-based weak page protection device includes: When writing data to a physical block of a NAND storage device, a dynamic decision is made based on the current state of the NAND storage device as to whether to enable a weak page protection policy for the physical block, and the writing policy of the physical block is recorded. If the weak page protection strategy is enabled, during the data writing process, the preset weak page bitmap is queried, and the non-weak pages in the physical block are written using the first data storage mode and the first ECC protection strength, and the weak pages in the physical block are written using the second data storage mode and the second ECC protection strength. The second ECC protection strength is higher than the first ECC protection strength, and the user data storage capacity under the second data storage mode is lower than that under the first data storage mode. During the data reading process, the data storage mode and ECC protection strength corresponding to the physical page of the physical block are determined according to the write strategy of the physical block and the weak page bitmap, and the corresponding ECC decoding strategy is used to read the data.

[0043] In some preferred embodiments, the process of creating the weak page bitmap includes the following steps: The number of error bits in each physical page of the NAND storage device is obtained by performing a reliability test on the NAND medium of the NAND storage device. Physical pages with more than a preset threshold of error bits are marked as weak pages; Based on the marking results, the weak page bitmap corresponding to each physical block is generated and stored.

[0044] In some preferred embodiments, the current state includes the lifespan of the NAND storage device and / or the size of the available reserved space; the dynamic decision on whether to enable a weak page protection strategy for the physical block based on the current state of the NAND storage device includes: If the lifespan of the NAND storage device is less than a preset lifespan threshold and / or the available reserved space is greater than a preset available reserved space threshold, the weak page protection strategy will be activated.

[0045] In some preferred embodiments, the first data storage mode is to store user data of N logical page addresses in one physical page, and correspondingly generate ECC check data of a first capacity; The second data storage mode is to store user data of M logical page addresses in one physical page, and correspondingly generate ECC check data of a second capacity, where M < N, and the second capacity is greater than the first capacity.

[0046] In some preferred embodiments, N = 4 and M = 3.

[0047] In some preferred embodiments, determining the data storage mode and ECC protection strength corresponding to the physical page of the physical block according to the write policy of the physical block and the weak page bitmap includes: Obtaining the logical address of the target data according to the host read command; Querying the mapping table from the logical address to the physical address to determine the physical block and physical page storing the target data; Querying the write policy of the physical block corresponding to the target data; If the write policy is to enable weak page protection, querying the weak page bitmap to determine whether the physical page corresponding to the target data is a weak page, and determining the data storage mode and ECC protection strength corresponding to the physical page of the target data according to the judgment result.

[0048] In some preferred embodiments, the method further includes: When powering on, loading the weak page bitmap and the recorded write policy of the physical block into the memory for query during read and write operations.

[0049] It should be noted that those skilled in the art can clearly understand that the specific implementation processes of the above Weak Page protection device based on NAND storage and each unit can refer to the corresponding descriptions in the foregoing method embodiments. For the sake of convenience and brevity of description, they will not be elaborated here.

[0050] The above Weak Page protection device based on NAND storage can be implemented in the form of a computer program, and this computer program can run on a computer device as shown in Figure 2 shown.

[0051] Please refer to Figure 2 , Figure 2This is a schematic block diagram of a computer device provided in an embodiment of this application. The computer device 500 can be a terminal or a server. The terminal can be an electronic device with communication functions, such as a smartphone, tablet, laptop, desktop computer, personal digital assistant, or wearable device. The server can be a standalone server or a server cluster composed of multiple servers.

[0052] The computer device 500 includes a processor 502, a memory, and a network interface 505 connected via a system bus 501. The memory may include a non-volatile storage medium 503 and internal memory 504.

[0053] The non-volatile storage medium 503 may store an operating system 5031 and a computer program 5032. When the computer program 5032 is executed, it causes the processor 502 to perform a NAND-based weak page protection method.

[0054] The processor 502 provides computing and control capabilities to support the operation of the entire computer device 500.

[0055] The internal memory 504 provides an environment for the execution of the computer program 5032 in the non-volatile storage medium 503. When the computer program 5032 is executed by the processor 502, the processor 502 can execute a NAND storage-based WeakPage protection method.

[0056] The network interface 505 is used for network communication with other devices. Those skilled in the art will understand that the above structure is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device 500 to which the present application is applied. A specific computer device 500 may include more or fewer components than shown in the figures, or combine certain components, or have different component arrangements.

[0057] The processor 502 is used to run a computer program 5032 stored in the memory to perform the following steps: When writing data to a physical block of a NAND storage device, a dynamic decision is made based on the current state of the NAND storage device as to whether to enable a weak page protection policy for the physical block, and the writing policy of the physical block is recorded. If the weak page protection policy is enabled, during the data writing process, query the preset weak page bitmap, and write the non-weak pages in the physical block using the first data storage mode and the first ECC protection strength, and write the weak pages in the physical block using the second data storage mode and the second ECC protection strength, where the second ECC protection strength is higher than the first ECC protection strength, and the user data storage capacity in the second data storage mode is lower than that in the first data storage mode; During the data reading process, according to the writing strategy of the physical block and the weak page bitmap, determine the data storage mode and the ECC protection strength corresponding to the physical pages of the physical block, and perform data reading using the corresponding ECC decoding strategy.

[0058] In some preferred embodiments, the creation process of the weak page bitmap includes the following steps: Obtain the error bit count of each physical page of the NAND storage device by performing a reliability test on the NAND medium of the NAND storage device; Mark the physical pages with the error bit count exceeding the preset threshold as weak pages; Based on the marking result, generate and store the weak page bitmap corresponding to each physical block.

[0059] In some preferred embodiments, the current state includes the service life of the NAND storage device and / or the size of the available reserved space; the dynamically determining whether to enable the weak page protection policy for the physical block based on the current state of the NAND storage device includes: If the service life of the NAND storage device is less than the preset service life threshold and / or the available reserved space is greater than the preset available reserved space threshold, decide to enable the weak page protection policy.

[0060] In some preferred embodiments, the first data storage mode is to store user data of N logical page addresses in one physical page, and correspondingly generate ECC check data of the first capacity; The second data storage mode is to store user data of M logical page addresses in one physical page, and correspondingly generate ECC check data of the second capacity, where M < N, and the second capacity is greater than the first capacity.

[0061] In some preferred embodiments, N = 4 and M = 3.

[0062] In some preferred embodiments, the determining the data storage mode and the ECC protection strength corresponding to the physical pages of the physical block according to the writing strategy of the physical block and the weak page bitmap includes: Obtain the logical address of the target data according to the host read command; Query the mapping table from logical address to physical address to determine the physical block and physical page corresponding to the storage of the target data; Query the write strategy of the physical block corresponding to the target data; If the write policy is to enable weak page protection, the weak page bitmap is queried to determine whether the physical page corresponding to the target data is a weak page, and the data storage mode and ECC protection strength of the physical page corresponding to the target data are determined based on the determination result.

[0063] In some preferred embodiments, the method further includes: Upon power-up, the weak page bitmap and the recorded write strategy of the physical block are loaded into memory for querying during read and write operations.

[0064] It should be understood that in the embodiments of this application, the processor 502 may be a central processing unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.

[0065] It will be understood by those skilled in the art that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program may be stored in a storage medium, which is a computer-readable storage medium. The computer program is executed by at least one processor in the computer system to implement the process steps of the embodiments of the above methods.

[0066] Therefore, the present invention also provides a storage medium. This storage medium can be a computer-readable storage medium. The storage medium stores a computer program. When executed by a processor, the computer program causes the processor to perform the following steps: When writing data to a physical block of a NAND storage device, a dynamic decision is made based on the current state of the NAND storage device as to whether to enable a weak page protection policy for the physical block, and the writing policy of the physical block is recorded. If the weak page protection policy is enabled, during the data writing process, query the preset weak page bitmap, and write the non-weak pages in the physical block using the first data storage mode and the first ECC protection strength, and write the weak pages in the physical block using the second data storage mode and the second ECC protection strength, where the second ECC protection strength is higher than the first ECC protection strength, and the user data storage capacity in the second data storage mode is lower than that in the first data storage mode; During the data reading process, according to the writing policy of the physical block and the weak page bitmap, determine the data storage mode and the ECC protection strength corresponding to the physical pages of the physical block, and perform data reading using the corresponding ECC decoding policy.

[0067] In some preferred embodiments, the creation process of the weak page bitmap includes the following steps: Obtain the error bit count of each physical page of the NAND storage device by performing a reliability test on the NAND medium of the NAND storage device; Mark the physical pages with the error bit count exceeding the preset threshold as weak pages; Based on the marking result, generate and store the weak page bitmap corresponding to each physical block.

[0068] In some preferred embodiments, the current state includes the service life of the NAND storage device and / or the size of the available reserved space; the dynamic decision on whether to enable the weak page protection policy for the physical block based on the current state of the NAND storage device includes: If the service life of the NAND storage device is less than the preset service life threshold and / or the available reserved space is greater than the preset available reserved space threshold, decide to enable the weak page protection policy.

[0069] In some preferred embodiments, the first data storage mode is to store the user data of N logical page addresses in one physical page and generate the ECC check data of the first capacity correspondingly; The second data storage mode is to store the user data of M logical page addresses in one physical page and generate the ECC check data of the second capacity correspondingly, where M < N, and the second capacity is greater than the first capacity.

[0070] In some preferred embodiments, N = 4 and M = 3.

[0071] In some preferred embodiments, the determination of the data storage mode and the ECC protection strength corresponding to the physical pages of the physical block according to the writing policy of the physical block and the weak page bitmap includes: Obtain the logical address of the target data according to the host read command; Query the mapping table from logical address to physical address to determine the physical block and physical page corresponding to the storage of the target data; Query the write strategy of the physical block corresponding to the target data; If the write policy is to enable weak page protection, the weak page bitmap is queried to determine whether the physical page corresponding to the target data is a weak page, and the data storage mode and ECC protection strength of the physical page corresponding to the target data are determined based on the determination result.

[0072] In some preferred embodiments, the method further includes: Upon power-up, the weak page bitmap and the recorded write strategy of the physical block are loaded into memory for querying during read and write operations.

[0073] The storage medium is a physical, non-transient storage medium, such as a USB flash drive, external hard drive, read-only memory (ROM), magnetic disk, or optical disk, or any other physical storage medium capable of storing program code. The computer-readable storage medium can be non-volatile or volatile.

[0074] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0075] In the several embodiments provided by this invention, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For example, the division of each unit is merely a logical functional division, and there may be other division methods in actual implementation. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed.

[0076] The steps in the method of this invention can be adjusted, merged, or reduced in order according to actual needs. The units in the device of this invention can be merged, divided, or reduced according to actual needs. Furthermore, the functional units in the various embodiments of this invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0077] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a terminal, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention.

[0078] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.

[0079] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Since these modifications and variations fall within the scope of the claims and their equivalents, this invention also intends to include these modifications and variations.

[0080] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and these modifications or substitutions should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A Weak Page Protection Method Based on NAND Storage, characterized in that, including: When writing data to a physical block of a NAND storage device, dynamically determine whether to enable a weak page protection policy for the physical block based on the current state of the NAND storage device, and record the write policy of the physical block; If the weak page protection policy is enabled, during the data writing process, query a preset weak page bitmap, write the non-weak pages in the physical block using a first data storage mode and a first ECC protection strength, and write the weak pages in the physical block using a second data storage mode and a second ECC protection strength, where the second ECC protection strength is higher than the first ECC protection strength, and the user data storage capacity in the second data storage mode is lower than that in the first data storage mode; During the data reading process, according to the write policy of the physical block and the weak page bitmap, determine the data storage mode and ECC protection strength corresponding to the physical page of the physical block, and perform data reading using the corresponding ECC decoding policy.

2. The Weak Page Protection Method Based on NAND Storage according to claim 1, characterized in that, The creation process of the weak page bitmap includes the following steps: Obtain the error bit count of each physical page of the NAND storage device by performing a reliability test on the NAND medium of the NAND storage device; Mark the physical pages with error bit counts exceeding a preset threshold as weak pages; Based on the marking results, generate and store the weak page bitmap corresponding to each physical block.

3. The NAND-based Weak Page Protection Method according to claim 1, characterized in that, The current state includes the service life of the NAND storage device and / or the size of the available reserved space; The dynamically determining whether to enable the weak page protection policy for the physical block based on the current state of the NAND storage device includes: If the service life of the NAND storage device is less than a preset service life threshold and / or the available reserved space is greater than a preset available reserved space threshold, decide to enable the weak page protection policy.

4. The Weak Page Protection Method Based on NAND Storage according to claim 1, characterized in that, The first data storage mode is to store user data of N logical page addresses in one physical page and generate ECC check data of a first capacity correspondingly; The second data storage mode is to store user data of M logical page addresses in one physical page and generate ECC check data of a second capacity correspondingly, where M < N, and the second capacity is greater than the first capacity.

5. The NAND-based Weak Page Protection Method according to claim 4, characterized in that, N = 4 and M = 3.

6. The NAND-based Weak Page Protection Method according to claim 1, characterized in that, The determining the data storage mode and ECC protection strength corresponding to the physical page of the physical block according to the write policy of the physical block and the weak page bitmap includes: Obtain the logical address of the target data according to the host read command; Query the mapping table from logical address to physical address to determine the physical block and physical page storing the target data; Query the write policy of the physical block corresponding to the target data; If the write policy is to enable weak page protection, query the weak page bitmap to determine whether the physical page corresponding to the target data is a weak page, and determine the data storage mode and ECC protection strength of the physical page corresponding to the target data according to the judgment result.

7. The NAND-based Weak Page Protection Method according to claim 2, characterized in that, The method further includes: When powering on, load the weak page bitmap and the recorded write policy of the physical block into the memory for query during read and write operations.

8. A Weak Page Protection Device Based on NAND Storage, characterized in that, Includes a unit for performing the method as described in any one of claims 1-7.

9. A computer device, characterized in that, The computer device includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the method as described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The storage medium stores a computer program that, when executed by a processor, can implement the method as described in any one of claims 1-7.