Solid state disk data inspection method, device and electronic equipment

By combining the relationship between the number of read/write operations of solid-state drives (SSDs) and preset thresholds with risk level assessment and dynamic adjustment, the problems of low efficiency and significant performance impact in SSD data inspection have been solved, achieving efficient and accurate risk data detection.

CN120371223BActive Publication Date: 2025-10-21CHENGDU BIWIN STORAGE TECHNOLOGY CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510855478.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-25
Publication Date
2025-10-21
Estimated Expiration
2045-06-25

AI Technical Summary

Technical Problem

Existing solid-state drive (SSD) data inspection methods, while avoiding the omission of risky data, suffer from low inspection efficiency and significant performance impact.

Method used

Based on the relationship between the read/write count of the solid-state drive and the preset threshold, a risk level assessment is adopted to distinguish between storage blocks for quick inspection or global inspection. The risk coefficient is calculated by combining the read/write count, error count, temperature and data storage time, and the inspection strategy is dynamically adjusted.

Benefits of technology

It achieves improved inspection efficiency and reduced impact on SSD performance while avoiding the omission of risky data. By dynamically adjusting the inspection strategy, it accurately locates high-risk storage blocks and optimizes resource utilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120371223B_ABST
    Figure CN120371223B_ABST
Patent Text Reader

Abstract

The application discloses a solid state disk data inspection method and device and electronic equipment, and risk level evaluation is performed on storage blocks of a solid state disk; whether the read-write times of the solid state disk are less than or equal to a preset first threshold value is judged, if yes, fast inspection is performed on all the storage blocks, otherwise whether the read-write times of the solid state disk are less than or equal to a preset second threshold value is judged, the preset second threshold value is greater than the preset first threshold value, if yes, fast inspection is performed on part of the storage blocks selected according to the risk level, if not, global inspection is performed on all the storage blocks. The application realizes balanced regulation and control of the possibility of missing risk data, the inspection efficiency and the influence on the performance of the hard disk, avoids missing risk data, improves the inspection efficiency and reduces the influence on the performance of the solid state disk.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of storage devices, and in particular to a solid-state hard disk data inspection method, device, and electronic equipment. Background Art

[0002] Solid-state drives (SSDs) offer advantages such as high speed, quiet operation, and shock resistance, making them widely used in today's storage landscape. Data inspection is a key feature of SSDs, which automatically checks the data stored on the drive. If a memory page error is detected that exceeds the error correction capability of the error correction code, or if the amount of invalid data in the inspection area reaches a set threshold, the data in that block will be garbage collected, moved, or marked as a bad block.

[0003] Generally speaking, the inspection of solid-state drives is divided into quick inspection and global inspection. The existing inspection method enables these two inspections at the same time from the beginning of the solid-state drive life cycle. Quick inspection is used during daily inspections. Although it has a fast inspection speed and less impact on the solid-state drive performance, it may have deviations due to the selection of memory pages based on random values, and it is easy to miss potential risk data; if global inspection is used to avoid missed inspections, it will lead to long inspection times, occupy a large amount of background resources, and have a greater impact on performance. In the long run, the existing method will inevitably reduce the inspection efficiency and solid-state drive performance in order to reduce the omission of risk data. Summary of the Invention

[0004] The technical problem to be solved by the present invention is to provide a solid-state hard disk data inspection method, device and electronic equipment, which can improve the inspection efficiency and reduce the impact on the solid-state hard disk performance while avoiding the omission of risk data.

[0005] In order to solve the above technical problems, the technical solution adopted by the present invention is:

[0006] The solid state drive data inspection method includes the following steps:

[0007] Perform risk level assessment on the storage blocks of solid-state drives;

[0008] Determine whether the number of read and write times of the solid-state hard disk is less than or equal to a preset first threshold, and if so, perform a quick inspection on all the storage blocks;

[0009] Otherwise, determine whether the number of read and write times of the solid-state hard disk is less than or equal to a preset second threshold, and the preset second threshold is greater than the preset first threshold. If so, select part of the storage blocks for quick inspection according to the risk level; if not, perform a global inspection on all the storage blocks.

[0010] In order to solve the above technical problems, another technical solution adopted by the present invention is:

[0011] A solid state hard drive data inspection device, comprising:

[0012] The storage management module is configured as follows:

[0013] Perform risk level assessment on the storage blocks of solid-state drives;

[0014] Determine whether the number of read and write times of the solid-state drive is less than or equal to a preset first threshold; if so, perform a quick inspection on all the storage blocks; otherwise, determine whether the number of read and write times of the solid-state drive is less than or equal to a preset second threshold, and the preset second threshold is greater than the preset first threshold;

[0015] If yes, a portion of the storage blocks are selected for quick inspection according to the risk level; if no, a global inspection is performed on all the storage blocks.

[0016] In order to solve the above technical problems, another technical solution adopted by the present invention is:

[0017] Electronic equipment, including:

[0018] a memory configured to store an executable program; and

[0019] At least one processor is configured to execute the program to perform the above-mentioned solid state drive data inspection method.

[0020] The beneficial effects of the present invention are: providing a solid-state hard disk data inspection method, device, and electronic device, wherein an inspection mode is selected based on the relationship between the number of read and write times of the solid-state hard disk and a preset first threshold and a preset second threshold. When the number of read and write times of the solid-state hard disk is less than the preset first threshold, it indicates that the solid-state hard disk is still in the early stage of use and each storage block is not prone to errors. Therefore, only a fast inspection with high efficiency and small performance impact is required. When the number of read and write times of the solid-state hard disk is greater than the preset first threshold and less than the preset second threshold, it indicates that the solid-state hard disk is in the middle stage of use and some storage blocks, especially those commonly used to store dynamic data, are more likely to have errors. Therefore, based on the risk level, some storage blocks can be targeted and quickly inspected, thereby reducing the impact on the hard disk performance and minimizing the omission of risk data. When the number of read and write times of the solid-state hard disk is greater than the preset second threshold, it indicates that the solid-state hard disk is in the middle and late stages of use and a large number of storage blocks may be prone to errors. Therefore, a global inspection is performed to avoid missing risk data. In this way, a balanced regulation of the possibility of missing risk data, inspection efficiency, and the impact on hard disk performance is achieved, thereby improving inspection efficiency and reducing the impact on solid-state hard disk performance while avoiding the omission of risk data. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 A schematic diagram of the steps of the solid state drive data inspection method of the present invention;

[0022] Figure 2 This is a flow chart of a solid-state hard drive data inspection method according to an embodiment of the present invention;

[0023] Figure 3 Schematic diagram of the inspection position changes during the global inspection process of the solid-state hard disk data inspection method according to an embodiment of the present invention;

[0024] Figure 4 This is a system block diagram of an electronic device involved in an embodiment of the present invention.

[0025] Description of labels:

[0026] 1. Electronic device; 2. Memory; 3. Processor. DETAILED DESCRIPTION

[0027] To illustrate the technical content, achieved objectives and effects of the present invention in detail, the following description is given in conjunction with the embodiments and accompanying drawings.

[0028] Please refer to Figures 1 to 3 , a solid state hard disk data inspection method includes the following steps:

[0029] Perform risk level assessment on the storage blocks of solid-state drives;

[0030] Determine whether the number of read and write times of the solid-state hard disk is less than or equal to a preset first threshold, and if so, perform a quick inspection on all the storage blocks;

[0031] Otherwise, determine whether the number of read and write times of the solid-state hard disk is less than or equal to a preset second threshold, and the preset second threshold is greater than the preset first threshold. If so, select part of the storage blocks for quick inspection according to the risk level; if not, perform a global inspection on all the storage blocks.

[0032] As can be seen from the above description, the beneficial effect of the present invention is that: the inspection method is selected based on the relationship between the number of read and write times of the solid-state drive and the preset first threshold and the preset second threshold. When the number of read and write times of the solid-state drive is less than the preset first threshold, it means that the solid-state drive is still in the early stage of use and the individual storage blocks are not prone to errors. Therefore, only a fast inspection with high efficiency and small performance impact is required. When the number of read and write times of the solid-state drive is greater than the preset first threshold but less than the preset second threshold, it means that the solid-state drive is in the middle stage of use and some storage blocks, especially those commonly used to store dynamic data, are more likely to have errors. Therefore, based on the risk level, some storage blocks can be targeted for fast inspection, reducing the impact on the hard disk performance while minimizing the omission of risk data. When the number of read and write times of the solid-state drive is greater than the preset second threshold, it means that the solid-state drive is in the middle and late stages of use and there may be more storage blocks that are prone to errors. Therefore, a global inspection is adopted to avoid missing risk data. In this way, a balanced regulation of the possibility of missing risk data, inspection efficiency, and the impact on hard disk performance is achieved, while avoiding the omission of risk data, improving inspection efficiency, and reducing the impact on solid-state drive performance.

[0033] Furthermore, the risk level assessment of the storage block of the solid state drive includes:

[0034] The risk level assessment is completed by calculating the risk coefficient of each storage block based on the number of read and write times, error count, temperature in the write state, and data storage time of the storage block. The higher the risk coefficient, the higher the risk level.

[0035] As can be seen from the above description, incorporating a storage block's read and write counts, error counts, temperature during write phase, and data storage time into the risk assessment makes the risk assessment of storage blocks more comprehensive and tailored to actual usage scenarios. The read and write counts directly reflect the frequency of use of a storage block; more frequently used storage blocks tend to have a higher probability of errors. The error count provides a visual representation of historical errors and effectively indicates potential risks. Excessively high temperatures during write phases accelerate storage media aging, affecting data storage stability. Prolonged data storage can also lead to data loss or corruption due to changes in storage media characteristics. By comprehensively considering these factors to calculate the risk factor, we can accurately identify storage blocks that pose a real risk.

[0036] Furthermore, the selecting of some of the storage blocks for rapid inspection according to the risk level is specifically as follows:

[0037] The storage blocks whose risk coefficient is greater than or equal to the preset coefficient value are selected for rapid inspection.

[0038] As can be seen from the above description, by setting a preset coefficient value to select storage blocks for rapid inspection, a clear and efficient screening standard is established for SSD data inspection. The preset coefficient value, as a quantitative threshold for measuring the risk level of storage blocks, can accurately demarcate storage areas requiring special attention, focusing limited inspection resources on truly high-risk storage blocks, avoiding unnecessary inspections of low-risk storage blocks, and significantly reducing redundant operations during the inspection process.

[0039] Furthermore, the global inspection of all the storage blocks is specifically performed as follows:

[0040] A global inspection is performed on all the storage blocks in descending order of the risk coefficients.

[0041] As can be seen from the above description, performing global inspections in descending risk order prioritizes high-risk storage blocks, minimizing the possibility of missing risky data. When the number of read and write cycles on an SSD exceeds the preset second threshold, the risk of errors in the drive's storage blocks generally increases. This inspection order allows for efficient use of inspection resources, prioritizing in-depth inspections of the most likely problem areas to promptly identify and address potential faults.

[0042] Furthermore, the risk coefficient of each storage block obtained by the calculation is specifically:

[0043] risk_score = a×PE + b×error_count + c×temperature + d×data_age;

[0044] Wherein, a, b, c, and d represent weights, PE represents the number of read and write times of the storage block, error_count represents the error count, temperature represents the temperature in the write state, and data_age represents the data storage time.

[0045] As can be seen from the above description, by assigning different weights to the number of read and write cycles, error count, temperature during write state, and data storage time, a weighted calculation can more flexibly and accurately reflect the impact of each factor on the risk of storage block errors. The dominant factors for storage block errors may vary for SSDs in different usage scenarios. For example, for drives operating in high-temperature environments, the temperature during write state may have a greater impact on error risk; while for enterprise-class drives with frequent read and write cycles, the number of read and write cycles may be a more critical risk indicator. By adjusting the weights, each factor can be assigned an influence commensurate with its importance based on the actual usage scenario and hardware characteristics, ensuring that the risk assessment results are more closely aligned with the drive's actual risk profile.

[0046] Furthermore, it also includes:

[0047] During the fast inspection or the global inspection, if an error is detected in the storage block, the risk factor of the erroneous storage block is updated and the inspection is continued.

[0048] As can be seen from the preceding description, during quick or global inspections, the risk factor of an errored storage block is updated in real time and continuously completed. This dynamically tracks changes in storage block risk and builds an adaptive risk monitoring system. Once a storage block error is detected, its risk factor is immediately updated, allowing subsequent inspections and data management policies to respond promptly, prioritizing the storage block and avoiding potential data loss due to delayed risk assessments.

[0049] Furthermore, it also includes:

[0050] The risk coefficients of all the storage blocks are stored in a non-volatile storage unit of the solid state drive, and the risk coefficients of all the storage blocks are updated according to a preset period.

[0051] As can be seen from the above description, storing the risk coefficient of a storage block in the non-volatile memory cells of the solid-state drive ensures that risk data is not lost in unexpected situations such as power outages, providing a stable and reliable data foundation for ongoing risk assessment and inspection strategy formulation. Furthermore, updating the risk coefficient of all storage blocks at a preset interval ensures that the risk coefficients are kept up to date with the real-time status changes of the storage blocks. As the risk status of a storage block evolves over time and with increased usage, regular updates capture these changes promptly, ensuring that the risk coefficients always reflect the most current risk level of the storage block.

[0052] Furthermore, it also includes:

[0053] According to the size of the risk coefficient, all the storage blocks are divided into high-risk storage blocks, medium-risk storage blocks and general-risk storage blocks.

[0054] As can be seen from the above description, combined with the risk factor updated at a preset period, the risk classification can be dynamically adjusted as the storage block status changes. For example, if a medium-risk storage block is upgraded to high risk due to an increase in read and write counts or abnormal temperature, the system can automatically adjust its inspection priority.

[0055] Furthermore, it also includes:

[0056] A structure is defined, and a risk storage block table having an array length equal to the number of super blocks of the solid state drive is set in the structure;

[0057] The number of the high-risk storage blocks, the number of the medium-risk storage blocks, and the number of the general-risk storage blocks are recorded in the risk storage block table.

[0058] As can be seen from the above description, the design of equal group length and number of super blocks enables the risk storage block table to be directly associated with the physical management unit (super block) of the hard disk, facilitating rapid indexing and access at the hardware level. The overall health status of the solid-state drive can be monitored in real time by the distribution of the number of high-, medium-, and general-risk storage blocks in the risk storage block table.

[0059] Furthermore, the global inspection of all the storage blocks also includes:

[0060] Determine whether the number of read and write times of the input and output ports of the solid-state hard disk in unit time is greater than or equal to a preset pressure value. If so, stop the global inspection and perform a quick inspection on the storage blocks that have not been inspected. Otherwise, continue the global inspection.

[0061] As can be seen from the above description, during the global inspection process, the inspection mode is dynamically switched based on the comparison result of the number of read and write times per unit time of the solid-state drive input and output ports with the preset pressure value, realizing the intelligent linkage between the inspection strategy and the hard disk load status. When the number of read and write times of the input and output ports reaches the preset pressure value, it means that the solid-state drive is under high load. If the global inspection is continued at this time, it may further increase the burden on the hard disk, resulting in a significant decline in read and write performance and even problems such as freezes and response delays. Stopping the global inspection in time and switching to fast inspection for the remaining storage blocks can not only effectively relieve the pressure on the hard disk and ensure the smooth reading and writing of key business, but also maximize the completion of the inspection task and reduce the risk of data omission.

[0062] A solid state hard drive data inspection device, comprising:

[0063] The storage management module is configured as follows:

[0064] Perform risk level assessment on the storage blocks of solid-state drives;

[0065] Determine whether the number of read and write times of the solid-state drive is less than or equal to a preset first threshold; if so, perform a quick inspection on all the storage blocks; otherwise, determine whether the number of read and write times of the solid-state drive is less than or equal to a preset second threshold, and the preset second threshold is greater than the preset first threshold;

[0066] If yes, a portion of the storage blocks are selected for quick inspection according to the risk level; if no, a global inspection is performed on all the storage blocks.

[0067] Example 1

[0068] A solid state drive data inspection method 100, such as Figure 1 As shown, the following steps are included:

[0069] In step 102, a risk level assessment is performed on a storage block of the solid state drive;

[0070] In this embodiment, the number of read and write times, error count, temperature in the write state, and data storage time of the storage block are obtained, and weights are set for the number of read and write times, error count, temperature in the write state, and data storage time. The number of read and write times, error count, temperature in the write state, and data storage time of the storage block are weighted to obtain a risk coefficient of the storage block. A higher risk coefficient indicates a higher risk level. The specific calculation of the risk coefficient risk_score is shown in the following expression:

[0071] risk_score = a×PE + b×error_count + c×temperature + d×data_age;

[0072] Where a, b, c, and d represent weights, PE represents the number of read and write operations for the storage block, error_count represents the error count, temperature represents the temperature during writing, and data_age represents the data storage age. The more times a storage block is read and written, the more errors it encounters. Writing at high temperatures and storing data for extended periods (cold data) can also lead to risky data.

[0073] Furthermore, the risk coefficients of all storage blocks are stored in the non-volatile storage unit of the solid-state drive, and the risk coefficients of all storage blocks are updated according to a preset period. Before storage, all storage blocks are divided into high-risk storage blocks, medium-risk storage blocks, and normal-risk storage blocks according to the size of the risk coefficient. Then, a structure (data_scrub_risk_table) is defined, and a risk storage block table (risk_table) with an array length equal to the number of super blocks in the solid-state drive is set within the structure. The number of high-risk storage blocks (high_risk_count), the number of medium-risk storage blocks (medium_risk_count), and the number of normal-risk storage blocks (normal_risk_count) are recorded in the risk storage block table.

[0074] In step 104, it is determined whether the number of read and write times PE of the solid-state drive is less than or equal to a preset first threshold (fastthreshold). If so, a fast inspection is performed on all storage blocks.

[0075] It is worth emphasizing that in the prior art, solid-state drives store data through NAND flash memory particles, and each storage block can be erased and written a limited number of times. The number of read and write times, especially the number of write times, directly determines the degree of wear of the flash memory particles and is one of the core indicators for measuring the aging of solid-state drives. Therefore, this embodiment uses a method of comparing the number of read and write times with a preset first threshold and a preset second threshold to reflect the changes in the usage time of the solid-state drive. In other equivalent embodiments, data such as the remaining life percentage, temperature, and power consumption can also be used to reflect the changes in the usage time of the solid-state drive.

[0076] In this embodiment, as the solid-state hard drive is used for an increasing period of time, its read and write times also increase continuously. The preset first threshold value adopts the read and write times corresponding to the solid-state hard drive in the early stage of use, while the preset second threshold value adopts the read and write times corresponding to the solid-state hard drive in the middle and late stages of use. By comparing the current read and write times with the preset first threshold value and the preset second threshold value, it can be indicated what period the solid-state hard drive is in and whether there are more storage blocks that are prone to errors.

[0077] In this embodiment, the fast inspection skips the complete verification of the storage block data and randomly selects storage blocks for inspection. Generally, the data integrity is judged by hash value comparison or metadata fast verification. During the inspection process, when a storage block error occurs, the error count of the erroneous storage block increases, so the risk storage block table is updated in time. After the fast inspection is completed, the risk storage block table is also updated based on the inspection results.

[0078] In step 106, otherwise, determine whether the number of read and write times PE of the solid-state hard disk is less than or equal to the preset second threshold (full threshold), and the preset second threshold is greater than the preset first threshold. If so, select some storage blocks for quick inspection according to the risk level; if not, perform a global inspection on all storage blocks.

[0079] In this embodiment, a storage block with a risk coefficient greater than or equal to a preset coefficient value is selected for rapid inspection. Figure 3 As shown, based on the size of the risk coefficient, different storage blocks can be divided into high-risk areas, medium-risk areas, and general-risk areas. The preset coefficient value is used as the watershed between the general-risk area and the medium-risk area. When the number of read and write times of the solid-state drive is greater than or equal to the preset first threshold and less than the preset second threshold, only the storage blocks in the high-risk and medium-risk areas are quickly inspected. During the inspection process, when a storage block error occurs, the error count of the erroneous storage block increases, so the risk storage block table is updated in a timely manner. After the quick inspection is completed, the risk storage block table is also updated based on the inspection results.

[0080] In this embodiment, when the number of read and write times of the solid-state drive is greater than or equal to a preset second threshold, a global inspection is performed on all storage blocks in descending order of risk factor. In light of the foregoing, the inspection prioritizes storage blocks in high-risk areas, then medium-risk areas, and finally general-risk areas.

[0081] And, as Figure 3 As shown, numbers 0 to 9 are used to represent different storage locations in the solid-state drive; all locations are set to storage blocks 1 to 10 in a one-to-one correspondence; during the global inspection process, if a storage block error occurs, for example, an error occurs in storage block 8 at position 7 in the figure, its risk factor on the risk storage block table is immediately updated, and the position of the storage block between the high-risk area, the medium-risk area or the general risk area is adjusted in time; then the inspection of storage block 9 at position 8 is continued.

[0082] Example 2

[0083] The solid state hard disk data inspection method, based on the above embodiment 1, is as follows Figure 2 As shown, the method flow includes:

[0084] In step 302 , the number of read and write times of the solid state drive is obtained, and then step 304 is executed.

[0085] In step 304, it is determined whether the number of read and write times of the solid-state drive is greater than a second threshold value. If so, it means that the NAND flash memory of the solid-state drive has experienced a large number of write / erase times, its electronic retention ability has decreased, and the probability of bad blocks is high, and then step 306 is executed. If not, step 310 is executed.

[0086] In step 306, a global inspection is performed according to the index of the risk storage block table; at the same time, step 308 is executed during the global inspection process to determine whether the number of read and write times of the input and output ports of the solid-state drive per unit time, that is, the I / O pressure value, is greater than or equal to the preset pressure value. If so, the global inspection is stopped and a quick inspection is performed on the storage blocks that have not been inspected. Otherwise, the global inspection is continued until the global inspection result is obtained.

[0087] In step 310, under the premise that the number of read and write times of the solid-state hard disk is less than the second threshold, it is determined whether the number of read and write times of the solid-state hard disk is greater than the first threshold. The first threshold is much smaller than the second threshold. If the number of read and write times of the solid-state hard disk is greater than the first preset number, it means that the NAND flash memory of the solid-state hard disk has experienced a certain number of write / erase times; some storage blocks, especially those commonly used to store dynamic data, have a higher risk of error, so step 312 is executed. Otherwise, only random storage blocks need to be inspected until a quick inspection result is obtained.

[0088] In step 312, the risk storage block table is read, and only storage blocks in high-risk areas and medium-risk areas are quickly inspected to obtain a quick inspection result.

[0089] In step 314, the global inspection result or the fast inspection result obtained above is used to update the risk storage block table.

[0090] Furthermore, in step 316, an update cycle is set, and the risk storage block table is automatically updated at intervals to ensure the validity of the recorded data.

[0091] Example 3

[0092] A solid state hard drive data inspection device, comprising:

[0093] The storage management module is configured as follows:

[0094] Perform risk level assessment on the storage blocks of solid-state drives;

[0095] Determine whether the number of read and write times of the solid-state drive is less than or equal to a preset first threshold; if so, perform a quick inspection on all storage blocks; otherwise, determine whether the number of read and write times of the solid-state drive is less than or equal to a preset second threshold, and the preset second threshold is greater than the preset first threshold;

[0096] If yes, some storage blocks are selected for quick inspection according to the risk level; if no, all storage blocks are inspected globally.

[0097] Example 4

[0098] Electronic device 1, such as Figure 4 As shown, it includes: a memory 2 configured to store an executable program; and at least one processor 3 configured to execute the program to perform the solid state hard disk data inspection method of embodiment 1.

[0099] In summary, the present invention provides a solid-state hard disk data inspection method, device and electronic device, which selects the inspection method according to the relationship between the number of read and write times of the solid-state hard disk and the preset first threshold and the preset second threshold. When the number of read and write times of the solid-state hard disk is less than the preset first threshold, it means that the solid-state hard disk is still in the early stage of use, and each storage block is not prone to errors. Therefore, only a fast inspection with high efficiency and small performance impact is required. When the number of read and write times of the solid-state hard disk is greater than the preset first threshold and less than the preset second threshold, it means that the solid-state hard disk is in the middle stage of use, and some storage blocks, especially storage blocks commonly used to store dynamic data, are more likely to make errors. Therefore, combined with the risk level assessment, some storage blocks can be selected in a targeted manner. Rapid detection minimizes the impact on drive performance while minimizing the omission of risky data. When the SSD's read and write count exceeds a preset second threshold, it indicates the drive is in its later stages of use and may have a high number of error-prone storage blocks. Therefore, a global inspection is performed to avoid missing risky data. This approach balances the likelihood of missing risky data, inspection efficiency, and the impact on drive performance, improving inspection efficiency and minimizing the impact on SSD performance while preventing the omission of risky data. Risk assessment incorporates the block's read and write count, error count, temperature during write operation, and data storage time, making the risk assessment more comprehensive and tailored to actual usage scenarios. The read and write count directly reflects the frequency of use of a storage block; more frequently used storage blocks tend to have a higher probability of error. The error count provides a visual representation of historical errors and effectively indicates potential risks. Excessively high temperatures during write operation accelerate storage media aging, affecting data storage stability. Long-term data storage can also lead to data loss or corruption due to changes in storage media characteristics. By comprehensively considering these factors to calculate the risk factor, the truly high-risk storage blocks can be accurately identified.

[0100] In the above embodiments provided in the present application, it should be understood that the disclosed methods, devices, and electronic devices can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the modules is merely a logical function division. In actual implementation, there may be other division methods, such as multiple components or modules can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices, components, or modules, which can be electrical, mechanical, or other forms.

[0101] The components described as separate parts may or may not be physically separate, and the components shown as components may or may not be physical modules, that is, they may be located in one place or distributed across multiple network modules. Some or all of these components may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0102] In addition, the functional modules in various embodiments of the present invention may be integrated into a single processing module, or each component may exist physically separately, or two or more modules may be integrated into a single module. The aforementioned integrated modules may be implemented in the form of hardware or software functional modules.

[0103] If the integrated module is implemented as a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the portion 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 for causing a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes various media that can store program code, such as a USB flash drive, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0104] It should be noted that for the aforementioned method embodiments, for ease of description, they are all expressed as a series of action combinations. However, those skilled in the art should be aware that the present invention is not limited by the order of the actions described, because according to the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.

[0105] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0106] The above descriptions are merely embodiments of the present invention and are not intended to limit the scope of the present invention. Any equivalent transformations made using the contents of the present invention's description and drawings, or directly or indirectly applied in related technical fields, are also included in the scope of the present invention's patent protection.

Claims

1. A solid state hard drive data inspection method, characterized in that: The steps include: Perform risk level assessment on the storage blocks of solid-state drives; Determine whether the number of read and write times of the solid-state hard disk is less than or equal to a preset first threshold, and if so, perform a quick inspection on all the storage blocks; Otherwise, determining whether the number of read and write times of the solid-state drive is less than or equal to a preset second threshold, and whether the second threshold is greater than the first threshold; if so, performing a quick inspection on some of the storage blocks according to the risk level; if not, performing a global inspection on all the storage blocks; The risk level assessment of the storage block of the solid state drive includes: The risk level assessment is completed by calculating the risk coefficient of each storage block based on the number of read and write times, error count, temperature in the write state, and data storage time of the storage block. The higher the risk coefficient, the higher the risk level.

2. The solid state drive data inspection method according to claim 1, wherein: The method of selecting a portion of the storage blocks for rapid inspection according to the risk level is specifically as follows: The storage blocks whose risk coefficient is greater than or equal to the preset coefficient value are selected for rapid inspection.

3. The solid state drive data inspection method according to claim 1, wherein: The global inspection of all the storage blocks is specifically performed as follows: A global inspection is performed on all the storage blocks in descending order of the risk coefficients.

4. The solid state drive data inspection method according to claim 1, wherein: The risk coefficient of each storage block obtained by the calculation is specifically: risk_score = a×PE + b×error_count + c×temperature + d×data_age; Wherein, a, b, c, and d represent weights, PE represents the number of read and write times of the storage block, error_count represents the error count, temperature represents the temperature in the write state, and data_age represents the data storage time.

5. The solid state hard disk data inspection method according to claim 1, characterized in that: Also includes: During the fast inspection or the global inspection, if an error is detected in the storage block, the risk factor of the erroneous storage block is updated and the inspection is continued.

6. The solid state hard disk data inspection method according to claim 1, characterized in that: Also includes: The risk coefficients of all the storage blocks are stored in a non-volatile storage unit of the solid state drive, and the risk coefficients of all the storage blocks are updated according to a preset period.

7. The solid state drive data inspection method according to claim 1, wherein: Also includes: According to the size of the risk coefficient, all the storage blocks are divided into high-risk storage blocks, medium-risk storage blocks and general-risk storage blocks.

8. The solid state hard disk data inspection method according to claim 7, characterized in that: Also includes: A structure is defined, and a risk storage block table having an array length equal to the number of super blocks of the solid state drive is set in the structure; The number of the high-risk storage blocks, the number of the medium-risk storage blocks, and the number of the general-risk storage blocks are recorded in the risk storage block table.

9. The solid state hard disk data inspection method according to claim 1, characterized in that: The global inspection of all the storage blocks also includes: Determine whether the number of read and write times of the input and output ports of the solid state drive in unit time is greater than or equal to a preset pressure value. If so, stop the global inspection and perform a quick inspection on the storage blocks that have not been inspected.

10. A solid state hard disk data inspection device, characterized in that: include: The storage management module is configured as follows: Perform risk level assessment on the storage blocks of solid-state drives; Determine whether the number of read and write times of the solid-state drive is less than or equal to a preset first threshold; if so, perform a quick inspection on all the storage blocks; otherwise, determine whether the number of read and write times of the solid-state drive is less than or equal to a preset second threshold, and the preset second threshold is greater than the preset first threshold; If yes, then select some of the storage blocks for quick inspection according to the risk level; if no, then perform a global inspection on all the storage blocks; The risk level assessment of the storage block of the solid state drive includes: The risk level assessment is completed by calculating the risk coefficient of each storage block based on the number of read and write times, error count, temperature in the write state, and data storage time of the storage block. The higher the risk coefficient, the higher the risk level.

11. An electronic device, characterized in that include: a memory configured to store an executable program; as well as At least one processor is configured to execute the program to perform the solid state drive data inspection method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Method, device and system for inspecting data in storage device

    CN103049713A

  • Solid state disk data inspection method and device

    CN114356238A

  • Hard disk scanning method and server

    CN119668951A