SSD data scanning optimization method and device, computer device, and storage medium

By grouping SSD physical blocks by erase count and sorting them by data retention time, scanning is performed only on groups with weak data, thus solving the problems of high power consumption and performance impact in existing technologies and achieving reduced power consumption and improved performance.

CN115543183BActive Publication Date: 2026-06-16SUZHOU UNIONMEMORY INFORMATION SYST LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SUZHOU UNIONMEMORY INFORMATION SYST LTD
Filing Date
2022-03-11
Publication Date
2026-06-16

AI Technical Summary

Technical Problem

Existing SSDs consume high power and impact performance during periodic data scanning, mainly due to frequent full-disk scans leading to increased NAND bandwidth usage and power consumption.

Method used

The physical blocks of the SSD are grouped by the number of erases and sorted by the data retention time. Only the groups with weak data are scanned, and the scan of the groups without weak data is ended early, reducing the number of full disk scans.

🎯Benefits of technology

It effectively reduced the amount of data scanned in the background, reduced power consumption, and improved command response performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115543183B_ABST
    Figure CN115543183B_ABST
Patent Text Reader

Abstract

The present application relates to a SSD data scanning optimization method, device, computer equipment and storage medium, the method comprises: judging whether the SSD triggers data scanning;If data scanning is triggered, the physical block containing valid data is divided into several groups according to the number of erasures;The physical block in each group is sorted from long to short according to the physical block data retention time;Select any one of the sorted groups;Scan each physical page data in the physical block in the group according to the physical block sorting;Judge whether the physical page data exists weak data;If there is weak data, the valid data in the physical block is moved to a new physical block;Judge whether the physical block in the group is scanned;If scanning is completed, judge whether all groups are scanned;If all groups are scanned, the SSD data scanning is completed.The present application can effectively reduce the data volume of background data scanning, reduce power consumption and improve command response performance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of SSD data scanning technology, and in particular to SSD data scanning optimization methods, apparatus, computer equipment, and storage media. Background Technology

[0002] Solid-state drives (SSDs) are widely used in various applications and are gradually replacing traditional HDDs in the PC market, providing users with a better experience in terms of reliability and performance. SSDs use NAND flash memory as the storage medium, where different voltage states of cells represent specific values ​​(0 / 1). Due to the characteristics of NAND, electrons can leak from the cells after programming and prolonged storage, leading to data errors. To combat this error, SSDs typically periodically scan the entire disk during operation to check for data nearing corruption; if any is found, the data is refreshed and written to new physical pages. However, frequent background data scanning increases SSD power consumption and also affects the SSD's responsiveness to the host. Summary of the Invention

[0003] The purpose of this invention is to overcome the shortcomings of the prior art and provide an SSD data scanning optimization method, apparatus, computer equipment, and storage medium.

[0004] To solve the above-mentioned technical problems, the present invention adopts the following technical solution:

[0005] Firstly, this embodiment provides an SSD data scanning optimization method, including the following steps:

[0006] Determine if the SSD has triggered a data scan;

[0007] If a data scan is triggered, the physical blocks containing valid data will be divided into several groups according to the number of erases.

[0008] Within each group, physical blocks are sorted from longest to shortest physical block data retention time;

[0009] Select any one of the sorted groups;

[0010] Scan the data of each physical page within the physical block of the group, sorted by physical block.

[0011] Determine whether the physical page data contains weak data;

[0012] If weak data exists, the valid data in that physical block will be moved to a new physical block.

[0013] Determine whether the physical blocks within the group have been scanned completely;

[0014] If the scan is complete, determine whether all groups have finished scanning data;

[0015] Once all group data has been scanned, the SSD data scan is complete.

[0016] The further technical solution is as follows: before determining whether the SSD has triggered a data scan step, it also includes: periodically checking for data scan triggering.

[0017] The further technical solution is as follows: after the step of determining whether there is weak data in the physical page data, it also includes: if there is no weak data, then end the current group scan, and then jump to execute "determine whether all groups have completed data scanning".

[0018] The further technical solution is as follows: after the step of determining whether all groups have completed data scanning if the scanning is completed, it also includes: if the data scanning is not completed, select the next group that has been sorted, and then return to execute "scanning the data of each physical page in the physical block by sorting by physical block within the group".

[0019] Secondly, this embodiment provides an SSD data scanning optimization device, including: a first judgment unit, a grouping unit, a sorting unit, a selection unit, a scanning unit, a second judgment unit, a moving unit, a third judgment unit, a fourth judgment unit, and an ending unit;

[0020] The first determination unit is used to determine whether the SSD has triggered a data scan;

[0021] The grouping unit is used to divide physical blocks containing valid data into several groups according to the number of erasures if a data scan is triggered.

[0022] The sorting unit is used to sort the physical blocks within each group according to the physical block data retention time from longest to shortest.

[0023] The selection unit is used to select any one of the groups that has been sorted.

[0024] The scanning unit is used to scan the data of each physical page within the physical block in the group, sorted by physical block.

[0025] The second determination unit is used to determine whether weak data exists in the physical page data;

[0026] The transfer unit is used to transfer the valid data in the physical block to a new physical block if weak data exists.

[0027] The third judgment unit is used to determine whether the physical blocks in the group have been scanned.

[0028] The fourth judgment unit is used to determine whether all groups have completed data scanning;

[0029] The termination unit is used to terminate the SSD data scan if all grouped data scans are completed.

[0030] Its further technical solution includes: an inspection unit for periodically checking data scan triggers.

[0031] The further technical solution includes: an end jump unit, which is used to end the current group scan if there is no weak data, and then jump to execute "determine whether all groups have completed data scanning".

[0032] The further technical solution includes: a selection return unit, used to select the next sorted group if the data scanning is not completed, and then return to execute "scanning the physical page data in each physical block by physical block sorting within the group".

[0033] Thirdly, this embodiment provides a computer device, which includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, it implements the SSD data scanning optimization method as described above.

[0034] Fourthly, this embodiment provides a storage medium storing a computer program, the computer program including program instructions, which, when executed by a processor, can implement the SSD data scanning optimization method described above.

[0035] The beneficial effects of this invention compared with the prior art are as follows: For each group, physical block scanning is performed from long to short data retention time. If a physical block is encountered in the middle without any weak data, the scanning of that group is ended, and then the next group is scanned. Based on this, the amount of data scanned in the background can be effectively reduced, power consumption is greatly reduced, and command response performance is improved.

[0036] The present invention will be further described below with reference to the accompanying drawings and specific embodiments. Attached Figure Description

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

[0038] Figure 1 This is a schematic diagram of a typical existing SSD configuration;

[0039] Figure 2This is a schematic diagram of the cell voltage distribution in SSD multi-bit storage mode;

[0040] Figure 3 A schematic diagram showing the distribution of cell voltage offset after NAND data has been written and stored for a long time.

[0041] Figure 4 A flowchart illustrating the SSD data scanning optimization method provided in an embodiment of the present invention;

[0042] Figure 5 This is a schematic diagram illustrating an application scenario of the SSD data scanning optimization method provided in this embodiment of the invention.

[0043] Figure 6 A schematic block diagram of an SSD data scanning optimization device provided in an embodiment of the present invention;

[0044] Figure 7 A schematic block diagram of a computer device provided for an embodiment of the present invention. Detailed Implementation

[0045] 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.

[0046] 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.

[0047] 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.

[0048] 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.

[0049] Please see Figure 1 As shown, a typical SSD consists of:

[0050] DIE, a cell that can independently and concurrently perform internal NAND operations;

[0051] A block, or physical block, is an independently erasable cell within a NAND array. Once data is written to each physical location within a block, the entire block must be erased before the next write operation.

[0052] Page, physical page, programming unit.

[0053] Please see Figure 2 As shown, the cell voltage distribution of the SSD in multi-bit storage mode;

[0054] NAND data storage relies on different cell states: In multi-bit storage mode, each cell corresponds to 4 bits, which can be programmed as 0 / 1 respectively. These bits can be combined to represent 16 values, such as 1111, 1110, 1100…0000, and these 16 values ​​can be associated with different voltage distributions. At this time, fifteen preset reference voltages (Vref_1,…Vref_15) are needed to determine 0 / 1. Due to the small intervals between the voltage distributions, errors are more likely to occur.

[0055] Please see Figure 3 As shown, when NAND is stored for a long time: after long-term storage, due to electron leakage, the voltage on the right side will shift to the left; in the multi-bit storage mode (QLC), since there are sixteen voltage intervals and the window of each interval is very narrow, the left shift will cause some voltages to cross the reference voltage / overlap with the adjacent voltage distribution. Once this scenario occurs, the reference voltage will make an incorrect judgment when making voltage comparison, and thus return incorrect data.

[0056] To combat this scenario, SSDs typically perform periodic full disk scans to check if the number of erroneous bits exceeds a threshold (e.g., 100 bits / 1KB). If so, the corresponding data is considered weak and is in a state of impending failure. In this case, the valid data in such physical blocks is rewritten to new physical blocks. Because the data is rewritten, the voltage offset effect caused by the previously accumulated data retention is eliminated.

[0057] The existing implementation process requires periodic full disk scanning, which necessitates a large number of NAND reads. This consumes NAND bandwidth, resulting in low host command response performance and high power consumption.

[0058] Please see Figure 4 The specific embodiment shown in this invention discloses an SSD data scanning optimization method, comprising the following steps:

[0059] S1, determine whether the SSD has triggered a data scan;

[0060] Before step S1, there is step S0, which periodically checks the data scan trigger.

[0061] If no data scan is triggered, the process returns to step S0 to periodically check for data scan triggering.

[0062] Here, periodicity refers to an empirical value or a manufacturer-defined value (such as 1 hour).

[0063] In step S1, the condition for triggering a data scan is that the time interval between the last data scan and the trigger time exceeds a specific threshold.

[0064] Furthermore, in this embodiment, the specific threshold is 120H or 240H, etc.

[0065] S2, if a data scan is triggered, the physical blocks containing valid data are divided into several groups according to the number of erases;

[0066] In this embodiment, valid data refers to the data last written by the host for a specific address (such as LBA0).

[0067] The term "divided into several groups" refers to the fact that each physical block maintains its erase / write count (PE) within the SSD. Grouping means putting physical blocks with the same PE into a group. There is no specified number of physical blocks in each group; the division can be based on the actual distribution of PEs.

[0068] S3, sort the physical blocks within each group according to the physical block data retention time from longest to shortest;

[0069] S4, select any one of the sorted groups;

[0070] S5, Scan the data of each physical page in the physical block within the group, sorted by physical block;

[0071] S6, determine whether there is weak data in the physical page data;

[0072] S7. If no weak data is found, end the current group scan and then proceed to step S10.

[0073] S8. If weak data exists, move the valid data in the physical block to a new physical block.

[0074] Among these, under the same number of erase cycles (PE), the data with a longer retention time has no weak data, therefore the data with a shorter retention time must be correct. A new physical block refers to a blank physical block, which does not contain any data and is not within any of the above-mentioned groups.

[0075] S9, determine whether the physical blocks in the group have been scanned; if not, return to step S5.

[0076] S10, If the scan is complete, determine whether all groups have completed data scanning;

[0077] S11, If ​​the data scan is not complete, select the next group that has been sorted and then return to execute step S5;

[0078] S12, if all group data scanning is completed, the SSD data scanning ends.

[0079] The term "weak data" refers to data within a physical block that is considered weak when the number of erroneous bits exceeds a threshold. Specifically, the threshold is 100 bits per 1KB.

[0080] Please see Figure 5 The diagram illustrates the application scenarios of the SSD data scanning optimization method.

[0081] During SSD operation, a periodic check is performed to determine if a data scan has been triggered. Once triggered, physical blocks containing valid data are grouped according to their Physical Block Erasure (PE) count, resulting in N groups: PE_Group_0, PE_Group_1, ..., PE_Group_N-1. Due to the SSD's disk-wide wear leveling algorithm, the PE differences between physical blocks are not significant, typically N=64. Physical blocks within the same group are sorted by their data retention time (the time difference between the data write time and the current time), from longest to shortest, and each group is scanned sequentially. Within each group, physical blocks are scanned from longest to shortest data retention time. When a physical block has no weak data, the remaining physical blocks in the same group have shorter data retention times, so no error occurs, and the scan of the current group can be terminated early. This process continues until all groups are processed.

[0082] In this invention, by sorting scans within groups and terminating scans early, the number of NAND physical blocks actually scanned can be significantly reduced, thereby lowering power consumption and improving command response performance. In the illustration, shaded squares represent blocks containing weak data, while unshaded squares represent blocks without weak data. Therefore, PE_Group_0 only needs to scan 3 physical blocks (2 containing weak data, 1 without weak data); PE_Group_1 only needs to scan 2 physical blocks, PE_Group_2 only needs to scan 1 physical block, PE_Group_3 only needs to scan 3 physical blocks… PE_Group_N-1 only needs to scan 4 physical blocks.

[0083] This invention addresses the shortcomings of existing SSD data scanning. Based on the direct correlation between the probability of NAND errors and the Pre-Execution Pattern (PE) and data retention time, physical blocks are first grouped by PE during runtime, and then sorted by data retention time within each group. When a periodic data scan is triggered, physical blocks in each PE group are scanned from longest to shortest data retention time. If a physical block is found to have no weak data, the scan for that group ends, and the next group is scanned. This effectively reduces the amount of data scanned in the background, significantly reduces power consumption, and improves command response performance.

[0084] Please see Figure 6 As shown, the present invention also discloses an SSD data scanning optimization device, including: a first judgment unit 10, a grouping unit 20, a sorting unit 30, a selection unit 40, a scanning unit 50, a second judgment unit 60, a moving unit 80, a third judgment unit 90, a fourth judgment unit 100, and an ending unit 120.

[0085] The first judgment unit 10 is used to determine whether the SSD has triggered a data scan;

[0086] The grouping unit 20 is used to divide the physical block containing valid data into several groups according to the number of erasures if a data scan is triggered.

[0087] The sorting unit 30 is used to sort the physical blocks within each group according to the physical block data retention time from longest to shortest.

[0088] The selection unit 40 is used to select any one of the groups that has been sorted.

[0089] The scanning unit 50 is used to scan the data of each physical page in the physical block within the group, sorted by physical block.

[0090] The second determination unit 60 is used to determine whether there is weak data in the physical page data;

[0091] The transfer unit 80 is used to transfer the valid data in the physical block to a new physical block if weak data exists.

[0092] The third judgment unit 90 is used to determine whether the physical blocks in the group have been scanned.

[0093] The fourth judgment unit 100 is used to determine whether all groups have completed data scanning;

[0094] The termination unit 120 is used to terminate the SSD data scan if all grouped data scans are completed.

[0095] The device also includes an inspection unit 00, which is used to periodically check data scan triggers.

[0096] The device also includes an end jump unit 70, which is used to end the current group scan if there is no weak data, and then jump to execute "determine whether all groups have completed data scanning".

[0097] The device further includes a selection return unit 110, which is used to select the next sorted group if the data scanning is not completed, and then return to perform "scanning the data of each physical page in the physical block by sorting by physical block within the group".

[0098] It should be noted that those skilled in the art can clearly understand that the specific implementation process of the above-mentioned SSD data scanning optimization device and each unit can be referred to the corresponding description in the foregoing method embodiments. For the sake of convenience and brevity, it will not be repeated here.

[0099] The aforementioned SSD data scanning optimization device can be implemented as a computer program, which can perform tasks such as... Figure 7 It runs on the computer device shown.

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

[0101] See Figure 7 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.

[0102] The non-volatile storage medium 503 may store an operating system 5031 and a computer program 5032. The computer program 5032 includes program instructions that, when executed, cause the processor 502 to perform an SSD data scanning optimization method.

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

[0104] 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 an SSD data scanning optimization method.

[0105] This network interface 505 is used for network communication with other devices. Those skilled in the art will understand that... Figure 7 The structure shown 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. The specific computer device 500 may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0106] The processor 502 is used to run a computer program 5032 stored in the memory to perform the following steps:

[0107] Step S1: Determine if the SSD has triggered a data scan;

[0108] Step S2: If a data scan is triggered, the physical blocks containing valid data are divided into several groups according to the number of erases.

[0109] Step S3: Sort the physical blocks within each group according to the data retention time of the physical blocks from longest to shortest.

[0110] Step S4: Select any one of the sorted groups;

[0111] Step S5: Scan the data of each physical page within the physical block of the group, sorted by physical block.

[0112] Step S6: Determine whether there is weak data in the physical page data;

[0113] Step S7: If no weak data is found, end the current group scan and then proceed to step S10.

[0114] Step S8: If weak data exists, move the valid data in the physical block to a new physical block.

[0115] Step S9: Determine whether the physical blocks in the group have been scanned completely; if not, return to step S5.

[0116] Step S10: If the scanning is complete, determine whether all groups have completed data scanning.

[0117] Step S11: If the data scan is not complete, select the next group that has been sorted and then return to execute step S5.

[0118] Step S12: If all grouped data scanning is completed, the SSD data scanning ends.

[0119] 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.

[0120] 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 includes program instructions and can be stored in a storage medium, which is a computer-readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the process steps of the embodiments of the above methods.

[0121] 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, wherein the computer program includes program instructions that, when executed by a processor, can implement the above-described SSD data scanning optimization method. The storage medium stores a computer program, which includes program instructions that, when executed by a processor, can implement the above-described method. The program instructions include the following steps:

[0122] Step S1: Determine if the SSD has triggered a data scan;

[0123] Step S2: If a data scan is triggered, the physical blocks containing valid data are divided into several groups according to the number of erases.

[0124] Step S3: Sort the physical blocks within each group according to the data retention time of the physical blocks from longest to shortest.

[0125] Step S4: Select any one of the sorted groups;

[0126] Step S5: Scan the data of each physical page within the physical block of the group, sorted by physical block.

[0127] Step S6: Determine whether there is weak data in the physical page data;

[0128] Step S7: If no weak data is found, end the current group scan and then proceed to step S10.

[0129] Step S8: If weak data exists, move the valid data in the physical block to a new physical block.

[0130] Step S9: Determine whether the physical blocks in the group have been scanned completely; if not, return to step S5.

[0131] Step S10: If the scanning is complete, determine whether all groups have completed data scanning.

[0132] Step S11: If the data scan is not complete, select the next group that has been sorted and then return to execute step S5.

[0133] Step S12: If all grouped data scanning is completed, the SSD data scanning ends.

[0134] In one embodiment, before determining whether the SSD has triggered a data scan, the method further includes: step S0, periodically checking for data scan triggering.

[0135] The storage medium can be any computer-readable storage medium capable of storing program code, such as a USB flash drive, portable hard drive, read-only memory (ROM), magnetic disk, or optical disk.

[0136] 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.

[0137] 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.

[0138] 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.

[0139] 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.

[0140] The above embodiments are preferred implementations of the present invention. In addition, the present invention can be implemented in other ways. Any obvious substitutions without departing from the concept of the present technical solution are within the protection scope of the present invention.

Claims

1. An SSD data scanning optimization method, characterized in that, Includes the following steps: Determine if the SSD has triggered a data scan; If a data scan is triggered, the physical blocks containing valid data will be divided into several groups according to the number of erases. Within each group, physical blocks are sorted from longest to shortest physical block data retention time; Select any one of the sorted groups; Scan the data of each physical page within the physical block of the group, sorted by physical block. Determine whether the physical page data contains weak data; If weak data exists, the valid data in that physical block will be moved to a new physical block. Determine whether the physical blocks within the group have been scanned completely; If the scan is complete, determine whether all groups have finished scanning data; Once all group data has been scanned, the SSD data scan is complete. Specifically, during SSD operation, a periodic check is performed to determine if a data scan has been triggered. Once a data scan is triggered, the physical blocks containing valid data are grouped according to their write / erase counts, resulting in N groups. Due to the SSD's full-disk wear leveling algorithm, the write / erase count differences between physical blocks are not significant. Physical blocks within the same group are arranged from longest to shortest based on their data retention time (the time difference between the data write time and the current time). Each group is scanned sequentially. When scanning individual physical blocks within a group, the scan proceeds from longest to shortest data retention time. If a physical block has no weak data, the remaining physical blocks in the same group have even shorter data retention times, so no error occurs, and the scan of the current group can be terminated early. This process is repeated until all groups have been processed.

2. The SSD data scanning optimization method according to claim 1, characterized in that, After the step of determining whether the physical page data contains weak data, the method further includes: if no weak data is found, ending the current group scan and then jumping to execute "determining whether all groups have completed data scanning".

3. The SSD data scanning optimization method according to claim 1, characterized in that, After determining whether all groups have completed data scanning if the scan is complete, the method further includes: if the data scan is not complete, selecting the next group that has been sorted, and then returning to execute "scanning the data of each physical page in the physical block according to the physical block sorting in the group".

4. An SSD data scanning optimization device, characterized in that, include: First judgment unit, grouping unit, sorting unit, selection unit, scanning unit, second judgment unit, moving unit, third judgment unit, fourth judgment unit and end unit; The first determination unit is used to determine whether the SSD has triggered a data scan; The grouping unit is used to divide physical blocks containing valid data into several groups according to the number of erasures if a data scan is triggered. The sorting unit is used to sort the physical blocks within each group according to the physical block data retention time from longest to shortest. The selection unit is used to select any one of the groups that has been sorted. The scanning unit is used to scan the data of each physical page within the physical block in the group, sorted by physical block. The second determination unit is used to determine whether weak data exists in the physical page data; The transfer unit is used to transfer the valid data in the physical block to a new physical block if weak data exists. The third judgment unit is used to determine whether the physical blocks in the group have been scanned. The fourth judgment unit is used to determine whether all groups have completed data scanning; The termination unit is used to terminate the SSD data scan if all grouped data scans are completed. Specifically, during SSD operation, a periodic check is performed to determine if a data scan has been triggered. Once a data scan is triggered, the physical blocks containing valid data are grouped according to their write / erase counts, resulting in N groups. Due to the SSD's full-disk wear leveling algorithm, the write / erase count differences between physical blocks are not significant. Physical blocks within the same group are arranged from longest to shortest based on their data retention time (the time difference between the data write time and the current time). Each group is scanned sequentially. When scanning individual physical blocks within a group, the scan proceeds from longest to shortest data retention time. If a physical block has no weak data, the remaining physical blocks in the same group have even shorter data retention times, so no error occurs, and the scan of the current group can be terminated early. This process is repeated until all groups have been processed.

5. The SSD data scanning optimization device according to claim 4, characterized in that, Also includes: The end jump unit is used to end the current group scan if no weak data exists, and then jump to execute "determine whether all groups have completed data scanning".

6. The SSD data scanning optimization device according to claim 4, characterized in that, Also includes: The select return unit is used to select the next sorted group if the data scan is not complete, and then return to execute "scanning the data of each physical page in the physical block by sorting by physical block within the group".

7. A computer device, characterized in that, The computer device includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, it implements the SSD data scanning optimization method as described in any one of claims 1-3.

8. A storage medium, characterized in that, The storage medium stores a computer program, which includes program instructions that, when executed by a processor, can implement the SSD data scanning optimization method as described in any one of claims 1-3.