Log data storage method and device of SSD, medium and SSD equipment

By employing SLC mode and multi-plane alternating storage in SSDs, the write lifespan and durability issues in log data storage are resolved, improving storage efficiency and reliability, extending the lifespan of NAND blocks, and reducing power consumption.

CN120872244BActive Publication Date: 2026-04-14ZIGUANG FLASH CORE TECHNOLOGY (CHENGDU) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ZIGUANG FLASH CORE TECHNOLOGY (CHENGDU) CO LTD
Filing Date
2025-07-17
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

Existing SSD technology suffers from write lifespan and durability issues when storing log data, especially the rapid wear of NAND blocks, which makes system logs prone to loss and affects SSD performance and reliability.

Method used

Using SLC mode and multi-Plane operation instructions, three groups of NAND blocks are allocated for cyclical alternation storage to ensure that log data and backup data are stored on different physical pages of different Planes, and are rotated after being filled. Error correction code (ECC) is used for encoding and signing.

Benefits of technology

It improves the storage efficiency and reliability of SSDs, reduces the system log loss rate, extends the lifespan of NAND blocks, and reduces power consumption and costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120872244B_ABST
    Figure CN120872244B_ABST
Patent Text Reader

Abstract

The application provides a log data storage method and device of an SSD, a medium and an SSD equipment, and the method comprises the following steps: allocating three groups of NAND blocks, switching to an SLC mode, each group being composed of blocks distributed on at least two planes of one die, selecting a storage NAND block group and a backup NAND block group, and writing part of invalid data on the storage NAND block group from a starting page; when a log storage event is triggered, writing log data from a page after the invalid data to the storage NAND block group, writing the backup NAND block group from the starting page, and storing the log data and the backup data on different physical pages of different planes; when the storage NAND block group is full, moving valid log data in the storage NAND block group to a redundant NAND block group and the backup NAND block group; and cyclically and alternatively switching the functions of the three groups of NAND blocks. The application improves the service life and the fault tolerance of the SSD.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data storage technology, and in particular to a method, apparatus, medium, and SSD device for storing log data of an SSD. Background Technology

[0002] Solid-state drives (SSDs), as a core technology for modern data storage, have experienced explosive growth in recent years. Driven by factors such as digital transformation, the development of artificial intelligence, and the widespread adoption of cloud computing, they are comprehensively replacing traditional hard disk drives (HDDs) and are widely used in various fields including finance, telecommunications, healthcare, manufacturing, and government. From a technical perspective, SSDs have achieved significant breakthroughs in NAND flash memory stacking layers, interface speed, and capacity density, realizing a qualitative leap in performance, capacity, and reliability. Despite these significant advancements, SSD technology still faces several technical challenges on its path to widespread adoption, primarily concerning write endurance and durability, performance consistency at high capacities, data security and encryption challenges, and heat dissipation and power consumption management. Especially for management data, such as firmware logs, which record important events and information during system operation, analyzing read and write performance data in the logs can assess SSD read and write speeds and IOPS (input / output operations per second), thereby optimizing system performance. Error messages and status reports in the logs help quickly locate and resolve hardware failures, reducing system downtime. By analyzing the write / erase cycles of NAND blocks, the remaining lifespan of an SSD can be predicted, allowing for timely maintenance or replacement. Therefore, system logs are a crucial component of a high-quality SSD product. Since the number of NAND blocks storing logs is relatively small, they often have higher write volumes and fault tolerance requirements compared to user data. As the number of NAND flash memory stacking layers increases, write lifespan and durability become particularly critical.

[0003] To address the aforementioned issues, existing technologies have proposed the following solutions: 1. Reserve a DRAM block as a system log cache. When the system log cache reaches a preset threshold, the log is written to DAND for permanent storage. While this reduces the number of system log storage cycles and decreases wear on the log NAND block, due to the characteristics of NAND chips, the read data is not always entirely accurate. Uncorrectable errors can lead to the loss of this log content. To prevent system log loss during power outages, all system logs need to be written to NAND, requiring more time and power, especially increasing the need for capacitors during sudden power failures, thus increasing costs. 2. Employ encoding compression, using numeric IDs instead of strings. When system logs are generated, they are converted into a series of numbers and stored in NAND. Since the NAND stores replaced numeric codes, it is still susceptible to data loss due to NAND errors. Furthermore, when real-time system log viewing is required, the CPU needs to participate in the decryption process, which can impact SSD read / write performance. Moreover, the existing solutions described above all perform read, write, and erase operations in the default NAND mode when storing system logs. However, for a single NAND block, the storage frequency of system logs is much higher than that of user data. This causes the NAND blocks allocated to system logs to reach the end of their lifespan prematurely, affecting the operation of the solid-state drive. Summary of the Invention

[0004] In order to solve the above-mentioned technical problems, or at least partially solve the above-mentioned technical problems, the present invention provides a method, apparatus, medium and SSD device for storing log data of SSD.

[0005] In one aspect, the present invention provides a method for storing log data in an SSD, the method comprising:

[0006] Allocate 3 groups of NAND blocks and switch the 3 groups of NAND blocks to SLC mode. Each NAND block group consists of NAND blocks distributed on at least two planes on one die. Each group of NAND blocks is used in a loop as a storage NAND block group for log data storage, a backup NAND block group for log data backup, and a redundant NAND block group to alternately store log data. Select the initial storage NAND block group and the initial backup NAND block group, and write some invalid data on the initial storage NAND block group starting from the start page.

[0007] When a log storage event is triggered, the log data generated by the log storage event is written to the initial storage NAND block group starting from the physical page after the invalid data, and the log data is written to the initial backup NAND block group starting from the start page for data backup, so that the log data and the backup data of the log data are stored on different physical pages of different planes respectively;

[0008] When the initial storage NAND block group is full, the valid log data is extracted from the initial storage NAND block group and moved to the current redundant NAND block group and the backup NAND block group respectively.

[0009] The functions of the three NAND blocks are switched cyclically. In a new cycle, the backup NAND block group of the previous cycle is used as the storage NAND block group of the current cycle, the backup data already written in the backup NAND block group of the previous cycle is treated as invalid data, the redundant NAND block group of the previous cycle is used as the backup NAND block group of the current cycle, and the storage NAND block group of the previous cycle is used as the redundant NAND block group of the current cycle.

[0010] Furthermore, the three sets of NAND blocks are distributed across three different dies.

[0011] Furthermore, the NAND blocks in each NAND block group are distributed in the same position on the corresponding plane, or the NAND blocks in all three NAND block groups are distributed in the same position on the corresponding plane.

[0012] Furthermore, the step of writing partially invalid data on the initial storage NAND block group, starting from the first page, includes:

[0013] Determine the total number of physical pages in each NAND block within the initial storage NAND block group;

[0014] Write invalid data into the first half of the physical pages of the NAND block, starting from the first page of the NAND block, on the initial storage NAND block group.

[0015] Furthermore, the method also includes:

[0016] During the initialization phase of the solid-state drive or after the cyclic switching operation of the functions of the three groups of NAND blocks, the identification information of the NAND blocks currently used as backup NAND block groups, storage NAND block groups, and redundant NAND block groups is recorded in the preset management block used for storage management data.

[0017] Furthermore, the method also includes:

[0018] When a log storage event is triggered, the storage NAND block group, backup NAND block group, and redundant NAND block group for the current cycle are determined by searching the preset management block.

[0019] Furthermore, the method also includes:

[0020] Error correction code (ECC) is used to encode and sign the log data.

[0021] Furthermore, the method also includes:

[0022] During the initialization phase of the solid-state drive, an erase command is executed on the three groups of NAND blocks in SLC mode.

[0023] In another aspect, the present invention provides an SSD log data storage device, the device comprising:

[0024] The configuration module is used to allocate 3 groups of NAND blocks, switch the 3 groups of NAND blocks to SLC mode. Each NAND block group consists of NAND blocks distributed on at least two planes on one die. Each group of NAND blocks is used in a loop as a storage NAND block group for log data storage, a backup NAND block group for log data backup, and a redundant NAND block group to alternately store log data. The initial storage NAND block group and the initial backup NAND block group are selected, and some invalid data is written to the initial storage NAND block group starting from the start page.

[0025] The data operation module is used to write the log data generated by the log storage event to the initial storage NAND block group starting from the physical page after the invalid data when the log storage event is triggered, and to write the log data to the initial backup NAND block group starting from the start page for data backup, so that the log data and the backup data of the log data are stored on different physical pages of different planes respectively.

[0026] The data operation module is also used to extract valid log data from the initial storage NAND block group when the initial storage NAND block group is full, and to move the valid log data to the current redundant NAND block group and the backup NAND block group respectively.

[0027] The switching module is used to cyclically switch the functions of the three NAND blocks. In a new cycle, the backup NAND block group of the previous cycle is used as the storage NAND block group of the current cycle, the backup data already written in the backup NAND block group of the previous cycle is treated as invalid data, the redundant NAND block group of the previous cycle is used as the backup NAND block group of the current cycle, and the storage NAND block group of the previous cycle is used as the redundant NAND block group of the current cycle.

[0028] Furthermore, the data operation module is also used to record the identification information of the NAND blocks currently used as backup NAND block group, storage NAND block group and redundant NAND block group in the preset management block used for storage management data during the initialization phase of the solid-state drive or after the cyclic switching operation of the functions of the three groups of NAND blocks;

[0029] The data operation module is also used to determine the storage NAND block group, backup NAND block group and redundant NAND block group for the current cycle by searching the preset management block when a log storage event is triggered.

[0030] In another aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon that, when executed by a processor, implements the steps of any of the methods described above.

[0031] In another aspect, the present invention provides an SSD device including a flash memory controller, the flash memory controller including a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor executes the program to implement the steps of the above-described method.

[0032] The SSD log data storage method, apparatus, medium, and SSD device provided by this invention employ SLC mode to access NAND when storing log data, utilize multi-plane operation instructions to improve storage efficiency, and employ a multi-group alternating log storage scheme. When the storage NAND block group for the current cycle is full, it is immediately swapped with the backup NAND block group and redundant NAND block group, reducing the latency time when storing system logs and always ensuring that two copies of system log data exist. Moreover, this invention adopts an alternating writing method within the group to NAND, that is, always keeping the original data written to the later physical pages of the NAND block, while the backup data is written to the earlier physical pages of the NAND block. This ensures that the original data and backup data are stored on different physical page numbers in different NAND block groups, improving fault tolerance and reducing the system log loss rate.

[0033] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, and in order to make the above and other objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description

[0034] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:

[0035] Figure 1 This is a flowchart of an SSD log data storage method according to an embodiment of the present invention;

[0036] Figure 2 This is a schematic diagram of the state of the three groups of NAND blocks in an embodiment of the present invention. Figure 1 ;

[0037] Figure 3 This is a schematic diagram of the state of the three groups of NAND blocks in an embodiment of the present invention. Figure 2 ;

[0038] Figure 4 This is a schematic diagram of the state of the three groups of NAND blocks in an embodiment of the present invention. Figure 3

[0039] Figure 5 This is a schematic diagram of the state of the three groups of NAND blocks in an embodiment of the present invention. Figure 4 ;

[0040] Figure 6 This is a flowchart illustrating the implementation of an SSD log data storage method according to a specific embodiment of the present invention.

[0041] Figure 7 This is a schematic diagram of the structure of the SSD log data storage device in an embodiment of the present invention;

[0042] Figure 8 This is a schematic diagram of the structure of an SSD device in an embodiment of the present invention. Detailed Implementation

[0043] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.

[0044] Those skilled in the art will understand that, unless specifically stated otherwise, the singular forms “a,” “an,” “the,” and “the” used herein may also include the plural forms. It should be further understood that the term “comprising” as used in this specification means the presence of the stated features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.

[0045] It will be understood by those skilled in the art that, unless otherwise defined, all terms used herein (including technical and scientific terms) have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. It should also be understood that terms such as those defined in general dictionaries should be understood to have the meaning consistent with their meaning in the context of the prior art, and should not be interpreted in an idealized or overly formal sense unless specifically defined.

[0046] Before introducing the SSD log data storage method of this invention, let's briefly introduce the technical terms used in this invention:

[0047] NAND flash memory: also known as NAND Flash, is a non-volatile random access storage medium based on Flash storage technology.

[0048] Plane: In NAND flash memory chips, the planar structure is an organization of a large number of storage blocks, primarily used to improve the parallelism of data storage and management. It is part of the internal logical structure of the flash memory chip and, together with NAND Blocks and NAND Pages, constitutes the basic storage unit of flash memory.

[0049] NAND block: A collection of contiguous physical pages in NAND flash memory, which are logically considered as a whole. The NAND block is the smallest unit of erasure.

[0050] NAND Page: The smallest unit used to store data in NAND flash memory, which allows data to be read and written in units of pages.

[0051] Firmware: Firmware is the program within a chip that drives the chip to work. The firmware in an SSD is developed in depth based on the characteristics of NandFlash and the usage scenarios of SSDs. It contains many algorithms and the firmware development process is complex. The entire firmware in an SSD ensures the normal and stable operation of the SSD.

[0052] Figure 1 A flowchart illustrating an SSD log data storage method according to an embodiment of the present invention is shown. (Refer to...) Figure 1 The SSD log data storage method of this invention specifically includes the following steps:

[0053] S11. Allocate 3 groups of NAND blocks and switch the 3 groups of NAND blocks to SLC mode. Each NAND block group consists of NAND blocks distributed on at least two planes of a die. Each group of NAND blocks is used cyclically as a storage NAND block group for log data storage, a backup NAND block group for log data backup, and a redundant NAND block group to alternately store log data. Select an initial storage NAND block group and an initial backup NAND block group, and write some invalid data to the initial storage NAND block group starting from the first page. In an optional embodiment, the NAND block group proposed in this invention can be a NAND block group composed of one block taken from each plane of a die.

[0054] In this embodiment, during the SSD initialization phase, three groups of NAND blocks are pre-allocated as a storage NAND block group, a backup NAND block group, and a redundant NAND block group. Each group of NAND blocks performs cyclical alternation of storage and backup of log data, reducing the number of NAND blocks required for system log storage and improving the overall lifespan and performance of the SSD. Optionally, each NAND block group can consist of one NAND block selected from each of the six planes located on the same die. This invention employs multi-plane operation instructions for parallel NAND block operations to improve storage efficiency.

[0055] S12. When a log storage event is triggered, the log data generated by the log storage event is written to the initial storage NAND block group starting from the physical page after the invalid data, and the log data is written to the initial backup NAND block group starting from the start page for data backup, so that the log data and the backup data of the log data are stored on different physical pages of different planes.

[0056] In this embodiment, by writing some invalid data in advance from the starting page on the initial storage NAND block group, it can be ensured that the original data and backup data are stored on different NAND page numbers in different groups during the log data storage process. This prevents the situation where NAND performs poorly on the same page of different blocks at the same time due to physical characteristics, thereby improving fault tolerance and reducing the system log loss rate.

[0057] S13. When the initial storage NAND block group is full, extract the valid log data from the initial storage NAND block group and move the valid log data to the current redundant NAND block group and the backup NAND block group respectively.

[0058] Specifically, there is a lot of redundant data in the log data written to the storage NAND blocks. Therefore, when the initial storage NAND block group is full and a cyclic switch of the block group is required, the valid log data needs to be extracted from the storage NAND block group in advance before the cyclic switch is performed to reduce storage space occupation. The valid log data is written to the current redundant NAND block group starting from the start page, and the valid log data continues to be written to the current backup NAND block group starting from the physical page after the already written backup data.

[0059] S14. Cyclicly switch the functions of the three NAND blocks. In the new cycle, the backup NAND block group of the previous cycle is used as the storage NAND block group of the current cycle. The backup data already written in the backup NAND block group of the previous cycle is treated as invalid data. The redundant NAND block group of the previous cycle is used as the backup NAND block group of the current cycle, and the storage NAND block group of the previous cycle is used as the redundant NAND block group of the current cycle.

[0060] Furthermore, in order to avoid an imbalance in the number of NAND blocks on the die after allocating 3 sets of NAND blocks, in this embodiment of the invention, the 3 sets of NAND blocks can be distributed on 3 different dies, with each die contributing one set of NAND blocks.

[0061] Furthermore, in order to facilitate the management and recording of NAND flash memory and avoid affecting the allocation of other flash memory space due to the misalignment of these NAND blocks, in this embodiment of the invention, the NAND blocks in each NAND block group are distributed in the same position on the corresponding plane, or the NAND blocks in the three NAND block groups are distributed in the same position on the corresponding plane.

[0062] Furthermore, in a new cycle, after the current storage NAND block group is full, an erase command needs to be executed on the redundant NAND block group of the current cycle (i.e., the storage NAND block that was full of data in the previous cycle) in SLC mode. Then, valid log data is extracted from the current storage NAND block group and moved to the redundant NAND block group and the backup NAND block group of the current cycle, respectively.

[0063] Furthermore, during the initialization phase of the solid-state drive (SSD), it is necessary to pre-execute erase commands on the three sets of NAND blocks in SLC mode. This mode involves more read, write, and erase operations, resulting in a longer lifespan, shorter NAND programming time, and lower power consumption. The NAND in this mode has a stronger ability to store data, making it more stable and improving fault tolerance.

[0064] In this embodiment of the invention, when an event requiring log storage occurs, such as a user command error, entering low-power mode, or a firmware error, the firmware switches the pre-allocated three groups of NAND blocks to SLC mode. This mode involves more read / write / erase cycles, resulting in a longer lifespan, shorter NAND programming time, and lower power consumption. The NAND's data storage capacity is stronger in this mode, making it more stable and improving fault tolerance. To further enhance data storage capacity and fault tolerance, a multi-plane alternating backup storage scheme is adopted. This scheme adds a backup data layer. If the first data fails, data can be read from the backup NAND. The original data and backup data are located on different pages of different planes, preventing the simultaneous poor performance of NAND on the same page of different blocks due to physical characteristics. Simultaneously, the use of multiple groups of multiple planes in rotation increases both lifespan and fault tolerance, ensuring that log files can be successfully read from the NAND regardless of the SSD's end-of-life or under harsh conditions such as high / low temperatures and high / low voltage. Compared to existing technologies, this solution does not require storing large amounts of data in DRAM, reducing DRAM overhead. Furthermore, it reduces NAND write operations during power outages, thereby reducing power consumption, the number of capacitors, and cost savings.

[0065] The SSD log data storage method provided by this invention uses SLC mode to access NAND flash memory when storing log data, employs multi-plane operation instructions to improve storage efficiency, and utilizes a multi-group, alternating log storage scheme. When the current cycle's storage NAND block group is full, it immediately swaps with the backup NAND block group and redundant NAND block group, reducing latency when storing system logs and ensuring that two copies of system log data always exist. Furthermore, this invention uses an intra-group, alternating writing method to NAND flash memory, meaning that original data is always written to the later physical pages of the NAND block, while backup data is written to the earlier physical pages. This ensures that original and backup data are stored on different physical page numbers in different NAND block groups, improving fault tolerance and reducing system log loss rate.

[0066] In this embodiment of the invention, during the initialization phase of the solid-state drive or after a cyclic switching operation on the functions of the three NAND blocks, the method further includes recording the identification information of the NAND blocks currently used as backup NAND block groups, storage NAND block groups, and redundant NAND block groups in a preset management block used for storing management data. Specifically, the physical block number corresponding to the NAND block can be recorded as the identification information, such as 0, 1, 2, 3...

[0067] Furthermore, when a log storage event is triggered, the storage NAND block group, backup NAND block group, and redundant NAND block group for the current cycle are determined by searching the preset management block.

[0068] In this embodiment of the invention, the method further includes recording the specific storage address of valid log data for each log storage event in a preset management block used for storing management data. Specifically, when an event requiring log storage occurs, such as a power outage, the power outage count information in the log is updated each time a power outage occurs, generating new log information. The system records the latest updated power outage count information as valid log data and its specific storage address. Furthermore, when the NAND block group is full, valid log data can be extracted from the NAND block group by searching the preset management block.

[0069] In this embodiment of the invention, the method further includes: encoding and signing the log data using Error Correction Code (ECC).

[0070] In this embodiment, when the log data is stored in the NAND flash memory, the data stream is encoded and signed by the ECC module to ensure that error correction and signature verification can be performed when reading system log information from the NAND flash memory, thus ensuring the correctness of the data.

[0071] In an optional embodiment of the present invention, writing partial invalid data on the initial storage NAND block group, starting from the first page, includes:

[0072] Determine the total number of physical pages in each NAND block within the initial storage NAND block group;

[0073] Write invalid data into the first half of the physical pages of the NAND block, starting from the first page of the NAND block, on the initial storage NAND block group.

[0074] The technical solution of the present invention will be explained and illustrated below through a specific embodiment:

[0075] 1. During the initialization phase of the solid-state drive (SSD), three groups of NAND blocks are allocated, each consisting of six planes. These blocks are then erased in SLC mode, with half a page of invalid data written to the blocks in group 1, starting from page 0. This embodiment uses multi-plane operation instructions to operate on the NAND blocks. The states of the three groups of NAND blocks at this time are as follows: Figure 2 As shown, group 1 is the storage NAND block group, group 2 is the backup NAND block group, and group 3 is the redundant NAND block group. Figure 2 The example shown illustrates how each NAND block group consists of one NAND block selected from each of the six planes located on the same die.

[0076] 2. When an event triggering the need to store log data occurs, Group 1 begins writing log data starting from half of the page number, and Group 2 begins writing log data starting from page 0 for backup. The data in Groups 1 and 2 is identical, serving as backups for each other. At this time, the states of the three NAND blocks are as follows: Figure 3 As shown.

[0077] 3. After Group 1 is filled with the entire NAND block, first erase Group 3 in SLC mode, then move the valid log data from Group 1 to Group 3 and Group 2. Swap the group numbers: Group 2 becomes Group 1, Group 3 becomes Group 2, and Group 1 becomes Group 3. At this point, the states of the three NAND blocks are as follows: Figure 4 As shown.

[0078] 4. When the log storage event is triggered again, the log will be stored in the lower half of new group 1 and the upper half of new group 2. Thus, these three groups of NAND blocks form a circular log storage scheme according to this rule. At this time, the states of the three groups of NAND blocks are as follows: Figure 5 As shown.

[0079] Figure 6 A flowchart illustrating the implementation of the technical solution provided in this specific embodiment is shown.

[0080] In this embodiment of the invention, when storing log data, SLC mode is used to access NAND flash memory, and multi-plane operation instructions are used to improve storage efficiency. Simultaneously, a method of rotating writes to multiple NAND blocks is used to store system logs. When a NAND block is full, it is immediately swapped with the next NAND block group, reducing latency and ensuring that two copies of the system log are always present. An alternating write method within a group is used, meaning that the original data is always written to the last 50% of the NAND block, while backup data is written to the first 50% of the NAND block. This ensures that the original and backup data are stored on different NAND page numbers in different groups, improving fault tolerance and reducing the system log loss rate.

[0081] The SSD log data storage method provided by this invention can quickly store logs, improve SSD read and write performance, enhance data security and reliability, and provide better error correction capabilities. It increases the number of erase / write cycles of the NAND blocks used for storing log files, uses fewer NAND blocks, saves SSD space, thereby extending the overall disk lifespan and reducing power consumption during power outages.

[0082] For the sake of simplicity, the method embodiments are described as a series of actions. However, those skilled in the art should understand that the embodiments of the present invention are not limited to the described order of actions, because according to the embodiments of the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions involved are not necessarily essential to the embodiments of the present invention.

[0083] Figure 7 The diagram illustrates the structure of an SSD log data storage device according to an embodiment of the present invention. (Refer to...) Figure 7 The SSD log data storage device of this embodiment specifically includes a configuration module 701, a data operation module 702, and a switching module 703, wherein:

[0084] The configuration module 701 is used to allocate 3 groups of NAND blocks, switch the 3 groups of NAND blocks to SLC mode, each NAND block group consists of NAND blocks distributed on at least two planes on one die, and each group of NAND blocks is used in a loop as a storage NAND block group for log data storage, a backup NAND block group for log data backup and a redundant NAND block group to alternately store log data, select an initial storage NAND block group and an initial backup NAND block group, and write some invalid data on the initial storage NAND block group starting from the start page;

[0085] The data operation module 702 is used to write the log data generated by the log storage event to the initial storage NAND block group starting from the physical page after the invalid data when the log storage event is triggered, and to write the log data to the initial backup NAND block group starting from the start page for data backup, so that the log data and the backup data of the log data are stored on different physical pages of different planes respectively.

[0086] The data operation module 702 is also used to extract valid log data from the initial storage NAND block group when the initial storage NAND block group is full, and to move the valid log data to the current redundant NAND block group and the backup NAND block group respectively.

[0087] The switching module 703 is used to cyclically switch the functions of the three NAND blocks. In a new cycle, the backup NAND block group of the previous cycle is used as the storage NAND block group of the current cycle, the backup data already written in the backup NAND block group of the previous cycle is treated as invalid data, the redundant NAND block group of the previous cycle is used as the backup NAND block group of the current cycle, and the storage NAND block group of the previous cycle is used as the redundant NAND block group of the current cycle.

[0088] In this embodiment of the invention, the data operation module 702 is further configured to record the identification information of the NAND blocks currently used as backup NAND block group, storage NAND block group and redundant NAND block group in a preset management block for storing management data during the initialization phase of the solid-state drive or after the cyclic switching operation of the functions of the three groups of NAND blocks.

[0089] The data operation module 702 is also used to determine the storage NAND block group, backup NAND block group and redundant NAND block group of the current cycle by searching the preset management block when a log storage event is triggered.

[0090] In this embodiment of the invention, the device further includes an error correction module (not shown in the accompanying drawings). The error correction module is used to encode and sign the log data using an error correction code (ECC). Specifically, before writing log data generated by log storage events to the initial storage NAND block group starting from the physical page after invalid data, and before writing log data to the initial backup NAND block group starting from the start page for data backup, the log data is encoded and signed using an error correction code (ECC).

[0091] In this embodiment of the invention, the data operation module 702 is further configured to execute an erase command on the three groups of NAND blocks in SLC mode during the initialization phase of the solid-state drive.

[0092] As the device embodiment is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be found in the description of the method embodiment.

[0093] Furthermore, embodiments of the present invention also provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described above.

[0094] Furthermore, embodiments of the present invention also provide an SSD device, which includes a flash memory controller. The flash memory controller includes a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the method described above. For example... Figure 1 Steps S11 to S14 are shown. Alternatively, when the processor executes the computer program, it implements the functions of each module / unit in the above-described SSD log data storage device embodiment, for example... Figure 7 The configuration module 701, data operation module 702, and switching module 703 are shown.

[0095] In one specific embodiment, the SSD device is as follows: Figure 8As shown, it includes a host interface controller, a processor, a bus controller, a memory buffer, a DMA module, a DRAM controller, DRAM, a flash memory controller, an ECC module, and NAND flash memory, wherein:

[0096] ①The host interface controller is responsible for interacting with the host, such as receiving host commands, responding to commands, and transmitting data.

[0097] ② The processor has an instruction cache and a data cache. The instruction cache's main function is to cache instructions that the processor is about to execute, while the data cache is used to cache data that the processor is about to read or write. After receiving and parsing the host commands, the processor distributes the tasks to other modules through the bus controller and collects the results from each module, summarizing them for the host interface controller.

[0098] ③ The bus controller is responsible for managing and configuring the bus, including bus initialization, operating mode selection, and timing control. It identifies and decodes address information from the CPU, converting it into corresponding access commands for the device or memory unit. Based on instructions or commands, it transfers data from one device to another, implementing data read and write operations.

[0099] ④ The memory buffer is used when the processing speeds at both ends of the system are balanced (from a long-term perspective). Its introduction is to reduce the impact of burst I / O in the short term and to play a role in traffic shaping.

[0100] ⑤ The DMA module is used to provide high-speed data transfer between peripherals and memory or between memory devices without CPU intervention. Data can be moved quickly through DMA, which saves CPU resources for other operations.

[0101] ⑥ The DRAM controller is mainly used to quickly access DRAM, including multiple reads and writes, as well as some acceleration engines, to achieve fast access to the DRAM hardware module, thereby freeing up CPU resources.

[0102] ⑦DRAM is a peripheral data storage space, mainly used to store user data, the mapping relationship between logical addresses and NAND physical addresses, and the management data of the SSD itself.

[0103] ⑧ The flash memory controller is a key component that manages the data stored in flash memory and communicates with computers or electronic devices. When the host or device needs to read or write data, the flash memory controller is responsible for formulating read / write strategies, determining how to operate the NAND flash, organizing data transfer, translating logical addresses to physical addresses, combining NAND instructions, and then sending them to the NAND flash via the ONFI bus. Flash memory has a limited number of erase / write cycles. The flash memory controller uses wear leveling technology to evenly distribute write operations, extending the lifespan of the flash memory. The flash memory controller also performs defragmentation, marking old cells and performing garbage collection (GC) to improve read / write efficiency.

[0104] ⑨ The ECC module is primarily responsible for signing and verifying multiple data entries. When data is written, the ECC module calculates the data and generates an ECC signature. Generally, this step is very fast and therefore does not significantly impact the overall SSD performance. ECC signatures are typically stored in the SA area at the back of the NAND page. When data is read from the NAND, the ECC module reads the ECC signature and compares it to check for errors. If the received data contains erroneous bits, the generated ECC algorithm is used to correct the detected errors.

[0105] ⑩ NAND flash memory is a medium used to store data.

[0106] The technical solution of this invention is to store the executable program on the NAND flash memory in the form of ⑩. When the solid-state drive is powered on, the flash memory controller ⑧ is responsible for sending a read NAND command to the NAND flash memory in ⑩ to put the executable program into the processor ② and run it there. During this period, the data will be corrected by the ECC module in device ⑨ to ensure the correctness of the data. When system log data is generated and triggers a log storage event, the executable program in processor ② will start. The log is temporarily stored in memory buffer ④ via bus controller ③. When the number of system log updates in memory buffer ④ reaches a threshold, or when the generated log needs to be stored immediately, processor ② controls DMA module ⑤ and DRAM controller ⑥ via bus controller ③ to move data from memory buffer ④ to DRAM ⑦. Simultaneously, based on the current status of the three NAND blocks in the SSD, it determines how to store the log data in NAND flash memory ⑩. Then, it notifies flash memory controller ⑧ via bus controller ③. Flash memory controller ⑧ is responsible for converting logical addresses to NAND physical addresses, organizing NAND instructions, and sending the system log data from DRAM ⑦ to NAND flash memory ⑩. The data stream passes through ECC module ⑨ for signature verification to ensure error correction and signature verification when reading system log data from NAND flash memory ⑩. This completes one flushing of system log data to NAND flash memory.

[0107] This embodiment provides an SSD log data storage method, apparatus, medium, and SSD device. By switching the three sets of NAND blocks used for log data storage to SLC mode, this mode allows for more read / write / erase cycles and a longer lifespan, solving the lifespan problem of NAND blocks used for storing log files. By cyclically alternating the storage of the three sets of NAND blocks, the number of NAND blocks required for system logs is reduced, improving the overall lifespan and performance of the SSD and shortening read / write / erase times, thereby increasing NAND access efficiency. Furthermore, by employing a multi-plane alternating backup storage scheme, not only is an additional backup data provided, but data can also be read from the backup NAND if the first data is corrupted. Since the original data and backup data reside on different pages of different planes, fault tolerance is improved. This scheme eliminates the need to store large amounts of data in DRAM, reducing DRAM overhead and space usage. In the event of a power outage, it reduces NAND write operations, lowering power consumption, reducing capacitor usage, and lowering costs.

[0108] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0109] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0110] Furthermore, those skilled in the art will understand that although some embodiments herein include certain features included in other embodiments but not others, combinations of features from different embodiments are intended to be within the scope of the invention and form different embodiments. For example, any of the claimed embodiments can be used in any combination.

[0111] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for storing log data on an SSD, characterized in that, The method includes: Allocate 3 groups of NAND blocks and switch the 3 groups of NAND blocks to SLC mode. Each NAND block group consists of NAND blocks distributed on at least two planes on one die. Each group of NAND blocks is used in a loop as a storage NAND block group for log data storage, a backup NAND block group for log data backup, and a redundant NAND block group to alternately store log data. Select the initial storage NAND block group and the initial backup NAND block group, and write some invalid data on the initial storage NAND block group starting from the start page. When a log storage event is triggered, the log data generated by the log storage event is written to the initial storage NAND block group starting from the physical page after the invalid data, and the log data is written to the initial backup NAND block group starting from the start page for data backup, so that the log data and the backup data of the log data are stored on different physical pages of different planes respectively; When the initial storage NAND block group is full, the valid log data is extracted from the initial storage NAND block group and moved to the current redundant NAND block group and backup NAND block group respectively. The functions of the three NAND blocks are switched cyclically. In a new cycle, the backup NAND block group of the previous cycle is used as the storage NAND block group of the current cycle, the backup data already written in the backup NAND block group of the previous cycle is treated as invalid data, the redundant NAND block group of the previous cycle is used as the backup NAND block group of the current cycle, and the storage NAND block group of the previous cycle is used as the redundant NAND block group of the current cycle.

2. The method according to claim 1, characterized in that, The three sets of NAND blocks are distributed across three different dies.

3. The method according to claim 1, characterized in that, The NAND blocks in each NAND block group are distributed in the same position on the corresponding plane, or the NAND blocks in all three NAND block groups are distributed in the same position on the corresponding plane.

4. The method according to claim 1, characterized in that, Write a portion of invalid data, starting from the first page, on the initial storage NAND block group, including: Determine the total number of physical pages in each NAND block within the initial storage NAND block group; Write invalid data into the first half of the physical pages of the NAND block, starting from the first page of the NAND block, on the initial storage NAND block group.

5. The method according to claim 1, characterized in that, The method further includes: During the initialization phase of the solid-state drive or after the cyclic switching operation of the functions of the three groups of NAND blocks, the identification information of the NAND blocks currently used as backup NAND block groups, storage NAND block groups, and redundant NAND block groups is recorded in the preset management block used for storage management data.

6. The method according to claim 5, characterized in that, The method further includes: When a log storage event is triggered, the storage NAND block group, backup NAND block group, and redundant NAND block group for the current cycle are determined by searching the preset management block.

7. A log data storage device for an SSD, characterized in that, The device includes: The configuration module is used to allocate 3 groups of NAND blocks, switch the 3 groups of NAND blocks to SLC mode. Each NAND block group consists of NAND blocks distributed on at least two planes on one die. Each group of NAND blocks is used in a loop as a storage NAND block group for log data storage, a backup NAND block group for log data backup, and a redundant NAND block group to alternately store log data. The initial storage NAND block group and the initial backup NAND block group are selected, and some invalid data is written to the initial storage NAND block group starting from the start page. The data operation module is used to write the log data generated by the log storage event to the initial storage NAND block group starting from the physical page after the invalid data when the log storage event is triggered, and to write the log data to the initial backup NAND block group starting from the start page for data backup, so that the log data and the backup data of the log data are stored on different physical pages of different planes respectively. The data operation module is also used to extract valid log data from the initial storage NAND block group when the initial storage NAND block group is full, and to move the valid log data to the current redundant NAND block group and the backup NAND block group respectively. The switching module is used to cyclically switch the functions of the three NAND blocks. In a new cycle, the backup NAND block group of the previous cycle is used as the storage NAND block group of the current cycle, the backup data already written in the backup NAND block group of the previous cycle is treated as invalid data, the redundant NAND block group of the previous cycle is used as the backup NAND block group of the current cycle, and the storage NAND block group of the previous cycle is used as the redundant NAND block group of the current cycle.

8. The apparatus according to claim 7, characterized in that, The data operation module is also used to record the identification information of the NAND blocks currently used as backup NAND block group, storage NAND block group and redundant NAND block group in the preset management block used for storage management data during the initialization phase of the solid-state drive or after the cyclic switching operation of the functions of the three groups of NAND blocks; The data operation module is also used to determine the storage NAND block group, backup NAND block group and redundant NAND block group for the current cycle by searching the preset management block when a log storage event is triggered.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1-6.

10. An SSD device, characterized in that, The SSD device includes a flash memory controller, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the method as described in any one of claims 1-6.

Citation Information

Patent Citations

  • SSD log dynamic backup recovery method and device and computer equipment

    CN111581024A

  • Storage device and storage method

    CN119271123A