Solid state disk data inspection method and device and electronic equipment
By combining rapid inspection, partial inspection and global inspection based on the relationship between the number of read and write times of the solid-state drive and the preset threshold value, combined with risk level assessment, the combination of rapid inspection, partial inspection and global inspection is solved, and efficient and accurate risk data inspection is achieved.
Patent Information
- Application Number
- CN202510855478.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-25
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2045-06-25
AI Technical Summary
While avoiding the omission of risk data, the existing solid-state drive inspection methods cannot take into account inspection efficiency and impact on hard disk performance, resulting in inefficiency or excessive performance loss.
According to the relationship between the number of read and write times of the solid-state drive and the preset threshold, a risk level assessment is carried out, and the inspection strategy is selected in a targeted manner through a combination of rapid inspection, partial inspection and global inspection.
It realizes that while avoiding the omission of risk data, it improves inspection efficiency and reduces the impact on solid-state drive performance. By comprehensively considering factors such as read and write times, error count, temperature and data storage time, it accurately locates high-risk storage blocks for inspection.
Smart Images

Figure CN120371223A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of storage devices, and particularly to a method and device for data patrol inspection of a solid-state drive and an electronic device. Background Art
[0002] Solid-state drives have advantages such as high speed, quietness, and earthquake resistance, and are widely used in today's storage field. Data patrol inspection is an important function of solid-state drives. It can spontaneously check the data in the solid-state drive. If it is found that the number of memory page errors exceeds the error correction ability of the error correction code or the invalid data in the patrol inspection area reaches a set threshold, the data in the block will be garbage collected, the data will be moved or marked as a bad block.
[0003] Generally, the patrol inspection of a solid-state drive is divided into quick detection and global detection. The existing patrol inspection methods enable these two detections simultaneously from the beginning of the life cycle of the solid-state drive. Quick detection is used during daily patrol inspection. Although it has a fast patrol inspection speed and little impact on the performance of the solid-state drive, there may be deviations because memory pages are selected based on random values, and potential risk data is easily missed. If global detection is used to avoid missed detections, it will result in a long patrol inspection time, occupy a large amount of background resources, and have a greater impact on performance. Over time, in order to reduce the omission of risk data, the existing methods inevitably reduce the patrol inspection efficiency and the performance of the solid-state drive. Summary of the Invention
[0004] The technical problem to be solved by the present invention is to provide a method and device for data patrol inspection of a solid-state drive and an electronic device, which can improve the patrol inspection efficiency and reduce the impact on the performance of the solid-state drive while avoiding the omission of risk data.
[0005] In order to solve the above technical problem, the technical solution adopted by the present invention is as follows: A method for data patrol inspection of a solid-state drive, comprising the following steps: Evaluating the risk level of the storage blocks of the solid-state drive; Judging whether the read / write times of the solid-state drive are less than or equal to a preset first threshold. If so, performing quick patrol inspection on all the storage blocks; Otherwise, judging whether the read / write times of the solid-state drive are less than or equal to a preset second threshold, where the preset second threshold is greater than the preset first threshold. If so, performing quick patrol inspection on some of the storage blocks according to the risk level. If not, performing global patrol inspection on all the storage blocks. In order to solve the above technical problem, another technical solution adopted by the present invention is as follows: A device for data patrol inspection of a solid-state drive, comprising: A storage management module, configured to: Evaluate the risk level of the storage blocks of the solid-state drive; Determine whether the read / write count 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 read / write count of the solid-state drive is less than or equal to a preset second threshold, where the preset second threshold is greater than the preset first threshold; If so, select some of the storage blocks for quick inspection according to the risk level. If not, perform a global inspection on all the storage blocks.
[0006] To solve the above technical problems, another technical solution adopted by the present invention is: An electronic device, including: A memory configured to store an executable program; and At least one processor configured to execute the program to perform the above-mentioned solid-state drive data inspection method.
[0007] The beneficial effects of the present invention are as follows: There are provided a solid-state drive data inspection method, device and electronic device. According to the magnitude relationship between the read / write count of the solid-state drive and the preset first threshold and the preset second threshold, the inspection method is selected. When the read / write count of the solid-state drive is less than the preset first threshold, it indicates that the solid-state drive is still in the early stage of use, and each storage block is not likely to go wrong easily. Therefore, only a quick inspection with high efficiency and little impact on performance is needed. When the read / write count of the solid-state drive is greater than the preset first threshold and less than the preset second threshold, it indicates that the solid-state drive is in the middle stage of use, and some storage blocks, especially those often used to store dynamic data, are more likely to go wrong. Therefore, some storage blocks can be selectively selected for quick detection in combination with the risk level, reducing the impact on the hard disk performance while avoiding missing risk data as much as possible; when the read / write count of the solid-state drive is greater than the preset second threshold, it indicates that the solid-state drive is in the middle and late stages of use, and many storage blocks may be 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 the hard disk performance is achieved. While avoiding missing risk data, the inspection efficiency is improved and the impact on the performance of the solid-state drive is reduced. Description of the Drawings
[0008] Figure 1 It is a schematic diagram of the steps of the solid-state drive data inspection method of the present invention; Figure 2 It is a flowchart of the solid-state drive data inspection method according to an embodiment of the present invention; Figure 3 It is a schematic diagram of the change of the inspection position during the global inspection of the solid-state drive data inspection method according to an embodiment of the present invention; Figure 4 It is a system block diagram of the electronic device according to an embodiment of the present invention.
[0009] Label description: 1. Electronic device; 2. Memory; 3. Processor. Specific implementation
[0010] To describe the technical content, achieved objectives and effects of the present invention in detail, the following is described in conjunction with the embodiments and accompanied by the drawings.
[0011] Please refer to Figures 1 to 3 , the solid-state drive data patrol inspection method, including the following steps: Perform a risk level assessment on the storage blocks of the solid-state drive; Judge whether the read / write times of the solid-state drive are less than or equal to a preset first threshold. If so, perform a quick patrol inspection on all the storage blocks; Otherwise, judge whether the read / write times of the solid-state drive are less than or equal to a preset second threshold, and the preset second threshold is greater than the preset first threshold. If so, select some of the storage blocks for quick patrol inspection according to the risk level. If not, perform a global patrol inspection on all the storage blocks. As can be seen from the above description, the beneficial effect of the present invention is that: according to the size relationship between the read / write times of the solid-state drive and the preset first threshold and the preset second threshold, the patrol inspection method is selected. When the read / write times of the solid-state drive are less than the preset first threshold, it means that the solid-state drive is still in the early stage of use, and each storage block is not likely to make mistakes easily. Therefore, only a quick patrol inspection with high efficiency and little impact on performance is needed. When the read / write times of the solid-state drive are greater than the preset first threshold and 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 often used to store dynamic data, are more likely to make mistakes. Therefore, combined with the risk level, some of the storage blocks can be selected for quick detection, reducing the impact on the hard disk performance while trying to avoid missing risk data; when the read / write times of the solid-state drive are greater than the preset second threshold, it means that the solid-state drive is in the middle and late stages of use, and many storage blocks may be prone to errors. Therefore, a global patrol inspection is adopted to avoid missing risk data; in this way, the balance control of the possibility of missing risk data, the patrol inspection efficiency and the impact on the hard disk performance is realized. While avoiding missing risk data, the patrol inspection efficiency is improved and the impact on the performance of the solid-state drive is reduced.
[0012] Further, the risk level assessment of the storage blocks of the solid-state drive includes: Calculate the risk coefficient of each storage block according to the read / write times, error count, temperature in the write state and data storage time of the storage block to complete the risk level assessment. The higher the risk coefficient, the higher the risk level.
[0013] As can be seen from the above description, incorporating the read / write count, error count, temperature in the write state, and data storage time of the storage block into the risk level assessment makes the risk judgment of the storage block more comprehensive and in line with the actual usage scenario. The read / write count directly reflects the usage frequency of the storage block. The higher the usage frequency of the storage block, the higher the probability of errors. The error count is an intuitive manifestation of historical error situations and can effectively prompt potential risks. Excessive temperature in the write state accelerates the aging of the storage medium and affects the stability of data storage. If the data storage time is too long, data loss or damage may also occur due to changes in the characteristics of the storage medium. By comprehensively considering these factors to calculate the risk coefficient, high-risk storage blocks can be accurately located.
[0014] Further, the specific operation of selecting some of the storage blocks for rapid inspection according to the risk level is as follows: Select the storage blocks with a risk coefficient greater than or equal to the preset coefficient value for rapid inspection.
[0015] As can be seen from the above description, by setting the preset coefficient value to select storage blocks for rapid inspection, a clear and efficient screening standard is established for the data inspection work of the solid-state drive. The preset coefficient value, as a quantitative threshold for measuring the risk level of the storage block, can accurately divide the storage areas that need to be focused on, concentrate limited inspection resources on the truly high-risk storage blocks, avoid unnecessary detection of low-risk storage blocks, and greatly reduce redundant operations during the inspection process.
[0016] Further, the specific operation of globally inspecting all the storage blocks is as follows: Globally inspect all the storage blocks in descending order of the risk coefficient.
[0017] As can be seen from the above description, globally inspecting in descending order of the risk coefficient can give priority to checking the storage blocks with higher risks and minimize the possibility of missing risk data. When the read / write count of the solid-state drive is greater than the preset second threshold, the error risk of the storage blocks in the hard disk generally increases. This inspection order can make efficient use of detection resources, first deeply check the areas most likely to have problems, and timely discover and handle potential faults.
[0018] Further, the specific operation of calculating the risk coefficient of each storage block is as follows: risk_score = a×PE + b×error_count + c×temperature + d×data_age; Among them, a, b, c, and d represent weights, PE represents the read / 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.
[0019] As can be seen from the above description, by setting different weights for the read / write times, error count, temperature in the write state, and data storage time for weighted calculation, it is possible to more flexibly and accurately reflect the influence degree of each factor on the error risk of the storage block. For solid-state drives in different usage scenarios, the dominant factors causing storage block errors may vary. For example, for a hard drive operating in a high-temperature environment, the temperature in the write state may have a greater impact on the error risk; while for an enterprise-level hard drive with frequent read / writes, the read / write times may be a more critical risk indicator. By adjusting the weights, according to the actual usage scenario and hardware characteristics, an influence matching its importance can be assigned to each factor, making the risk assessment result more in line with the true risk situation of the hard drive.
[0020] Furthermore, it also includes: During the quick inspection or the global inspection, if an error is detected in the storage block, update the risk coefficient of the faulty storage block and continue to complete the inspection.
[0021] As can be seen from the above description, during the quick inspection or the global inspection, by updating the risk coefficient of the faulty storage block in real time and continuously completing the inspection, the risk changes of the storage block can be dynamically tracked, and an adaptive risk monitoring system can be constructed. Once an error in the storage block is discovered, immediately updating its risk coefficient allows subsequent inspections and data management strategies to respond in a timely manner, bringing the storage block into a higher-priority attention range, and avoiding potential data loss caused by lagging risk assessment.
[0022] Furthermore, it also includes: Store the risk coefficients of all the storage blocks in the non-volatile storage unit of the solid-state drive, and update the risk coefficients of all the storage blocks according to a preset period.
[0023] As can be seen from the above description, storing the risk coefficients of the storage blocks in the non-volatile storage unit of the solid-state drive can ensure that the risk data is not lost in case of power failure or other accidents, providing a stable and reliable data basis for continuous risk assessment and inspection strategy formulation. At the same time, updating the risk coefficients of all storage blocks according to a preset period can closely follow the real-time state changes of the storage blocks. As time goes by and the usage frequency increases, the risk situation of the storage blocks will continuously evolve. Regular updates can timely capture these changes, making the risk coefficients always reflect the latest risk degree of the storage blocks.
[0024] Furthermore, it 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.
[0025] From the above description, it can be seen that, combined with the risk coefficient updated at a preset period, the risk level classification can be dynamically adjusted as the storage block status changes. For example, when a medium-risk storage block is upgraded to high risk due to an increase in the number of read and write times or abnormal temperature, the system can automatically adjust its inspection priority.
[0026] Furthermore, it 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.
[0027] From the above description, we can see that the design of group length being equal to the 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, which is convenient for fast indexing and access at the hardware layer; through the distribution of the number of high, medium and general risk storage blocks in the risk storage block table, the overall health status of the solid-state drive can be understood in real time.
[0028] Furthermore, 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 a 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.
[0029] From the above description, it can be seen that 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 SSD input and output ports and the preset pressure value, realizing the intelligent linkage between the inspection strategy and the hard disk load condition. When the number of read and write times of the input and output ports reaches the preset pressure value, it means that the SSD is in a high-load working state. If the global inspection is continued at this time, it may further increase the burden on the hard disk, resulting in a significant decrease 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 businesses, but also complete the inspection tasks to the maximum extent and reduce the risk of data omissions.
[0030] The solid state hard disk data inspection device comprises: The storage management module is configured as follows: Perform risk level assessment on the storage blocks of the solid state drive; Determine whether the read / write count 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 read / write count of the solid-state drive is less than or equal to a preset second threshold, where the preset second threshold is greater than the preset first threshold; If so, select some of the storage blocks for quick inspection according to the risk level. If not, perform a global inspection on all the storage blocks.
[0031] Embodiment 1 A solid-state drive data inspection method 100, as Figure 1 shown, includes the following steps: In step 102, perform a risk level assessment on the storage blocks of the solid-state drive; In this embodiment, obtain the read / write count, error count, temperature in the write state, and data storage time of the storage block, set weights for the read / write count, error count, temperature in the write state, and data storage time one by one, and perform weighting on the read / write count, error count, temperature in the write state, and data storage time of the storage block to obtain the risk coefficient of the storage block. The higher the risk coefficient, the higher the risk level; the calculation of the risk coefficient risk_score is specifically shown in the following expression: risk_score = a×PE + b×error_count + c×temperature + d×data_age; where a, b, c, and d represent weights, PE represents the read / write count 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. The more the read / write count of the storage block, the more the error count appears. Writing at high temperature and storing for too long (cold data) will both cause the generation of risk data.
[0032] Moreover, store the risk coefficients of all storage blocks in the non-volatile storage unit of the solid-state drive, and update the risk coefficients of all storage blocks according to a preset period. Before storage, divide all storage blocks into high-risk storage blocks, medium-risk storage blocks, and general-risk storage blocks according to the size of the risk coefficient; then define a structure (data_scrub_risk_table), and set a risk storage block table (risk_table) with an array length equal to the number of super blocks of the solid-state drive in the structure body; record the number of high-risk storage blocks (high_risk_count), the number of medium-risk storage blocks (medium_risk_count), and the number of general-risk storage blocks (normal_risk_count) in the risk storage block table.
[0033] In step 104, it is determined whether the program / erase (PE) count of the solid-state drive is less than or equal to a preset first threshold (fast threshold). If so, a quick inspection is performed on all storage blocks. It should be emphasized that in the prior art, a solid-state drive stores data through NAND flash memory particles, and the number of times each storage block can be erased and written is limited. The program / erase count, especially the write count, directly determines the degree of wear of the flash memory particles and is one of the core indicators for measuring the aging of a solid-state drive. Therefore, in this embodiment, the program / erase count is compared with the preset first threshold and the preset second threshold to reflect the change in the usage duration 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 change in the usage duration of the solid-state drive.
[0034] In this embodiment, as the usage time of the solid-state drive increases, its program / erase count also increases continuously. The preset first threshold uses the program / erase count corresponding to the early stage of the solid-state drive's use, while the preset second threshold uses the program / erase count corresponding to the middle and late stages of the solid-state drive's use. By comparing the current program / erase count with the preset first threshold and the preset second threshold, it can be indicated which stage the solid-state drive is in and whether there are many storage blocks prone to errors.
[0035] In this embodiment, the quick inspection skips the complete verification of the data in the storage blocks and randomly selects storage blocks for inspection. Generally, the data integrity is judged by comparing hash values or quickly verifying metadata. During the inspection process, when a storage block encounters an error, it means that the error count of the faulty 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 once in combination with the inspection results.
[0036] In step 106, otherwise, it is determined whether the program / erase (PE) count of the solid-state drive is less than or equal to a preset second threshold (full threshold). The preset second threshold is greater than the preset first threshold. If so, some storage blocks are selected for quick inspection according to the risk level. If not, a global inspection is performed on all storage blocks. In this embodiment, the storage blocks with a risk coefficient greater than or equal to a preset coefficient value are selected for quick inspection. Combining Figure 3As shown, different storage blocks can be divided into a high-risk area, a medium-risk area, and a general-risk area according to the magnitude of the risk coefficient; the preset coefficient value is used as the watershed between the general-risk area and the medium-risk area. When the read / write count 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 area and the medium-risk area are quickly inspected. During the inspection process, when a storage block fails, it means that the error count of the failed 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 once in combination with the inspection results.
[0037] In this embodiment, when the read / write count of the solid-state drive is greater than or equal to the preset second threshold, all storage blocks are globally inspected in descending order of the risk coefficient. Combining the foregoing content, that is, the storage blocks in the high-risk area are inspected first, then the storage blocks in the medium-risk area are inspected, and finally the storage blocks in the general-risk area are inspected.
[0038] And, as Figure 3 shown, the numbers 0 to 9 are used to represent different storage locations in the solid-state drive; all locations are correspondingly set with storage block No. 1 to storage block No. 10; during the global inspection process, if a storage block fails, for example, the No. 8 storage block at position 7 in the figure fails, then the risk coefficient of it on the risk storage block table is immediately updated, and the position that the storage block should be in among the high-risk area, the medium-risk area, or the general-risk area is adjusted in a timely manner; then the inspection of the No. 9 storage block at position 8 is continued.
[0039] Embodiment 2 The solid-state drive data inspection method, on the basis of the above Embodiment 1, as Figure 2 shown, its method flow includes: In step 302, obtain the read / write count of the solid-state drive, and then execute step 304.
[0040] In step 304, determine whether the read / write count of the solid-state drive is greater than the second threshold. If so, it means that the NAND flash memory of the solid-state drive has experienced a relatively large number of write / erase operations, and its electron holding ability has decreased, and the probability of bad blocks appearing is relatively high. Then execute step 306. If not, execute step 310.
[0041] In step 306, perform a global inspection according to the risk storage block table index; at the same time, during the global inspection process, execute step 308 to determine whether the read / write count of the input / output port of the solid-state drive within a unit time, that is, the I / O pressure value, is greater than or equal to the preset pressure value. If so, stop the global inspection and perform a quick inspection on the storage blocks that have not been inspected yet. Otherwise, continue the global inspection until the global inspection result is obtained.
[0042] In step 310, on the premise that the read / write count of the solid-state drive is less than the second threshold, it is determined whether the read / write count of the solid-state drive is greater than the first threshold, where the first threshold is much smaller than the second threshold. If the read / write count of the solid-state drive is greater than the first threshold, it indicates that the NAND flash memory of the solid-state drive has experienced a certain number of write / erase operations; the risk of error in some storage blocks, especially those often used to store dynamic data, is relatively high. Therefore, step 312 is executed. Otherwise, only randomly select storage blocks for inspection until a quick inspection result is obtained.
[0043] In step 312, read the risk storage block table, and only quickly inspect the storage blocks in the high-risk area and the medium-risk area to obtain a quick inspection result.
[0044] In step 314, use the global inspection result or the quick inspection result obtained above to update the risk storage block table.
[0045] Moreover, in step 316, set an update period, and automatically update the risk storage block table at regular intervals to ensure the validity of the recorded data.
[0046] Embodiment III A solid-state drive data inspection device includes: A storage management module configured to: Evaluate the risk level of the storage blocks of the solid-state drive; Determine whether the read / write count of the solid-state drive is less than or equal to a preset first threshold. If so, quickly inspect all storage blocks. Otherwise, determine whether the read / write count of the solid-state drive is less than or equal to a preset second threshold, where 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.
[0047] Embodiment IV An electronic device 1, as Figure 4 shown, 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 drive data inspection method of Embodiment I.
[0048] In summary, the solid-state drive data inspection method, device, and electronic device provided by the present invention select the inspection method according to the relationship between the read / write count of the solid-state drive and the preset first threshold and the preset second threshold. When the read / write count of the solid-state drive is less than the preset first threshold, it indicates that the solid-state drive is still in the early stage of use, and each storage block is not likely to make mistakes easily. Therefore, only a fast inspection with high efficiency and little impact on performance is needed. When the read / write count of the solid-state drive is greater than the preset first threshold and less than the preset second threshold, it indicates that the solid-state drive is in the middle stage of use, and some storage blocks, especially those often used to store dynamic data, are more likely to make mistakes. Therefore, by combining risk level assessment, some storage blocks can be selectively selected for fast detection, reducing the impact on the hard disk performance while trying to avoid missing risk data. When the read / write count of the solid-state drive is greater than the preset second threshold, it indicates that the solid-state drive is in the middle and late stage of use, and many storage blocks may be prone to errors. Therefore, a global inspection is adopted to avoid missing risk data. In this way, the balance control of the possibility of missing risk data, inspection efficiency, and the impact on the solid-state drive performance is achieved. While avoiding missing risk data, the inspection efficiency is improved, and the impact on the solid-state drive performance is reduced. When performing risk level assessment, the read / write count, error count, temperature in the write state, and data storage time of the storage block are incorporated into the risk level assessment, making the risk judgment of the storage block more comprehensive and in line with the actual use scenario. The read / write count directly reflects the usage frequency of the storage block. The higher the usage frequency of the storage block, the higher the probability of errors. The error count is an intuitive reflection of the historical error situation and can effectively prompt potential risks. Excessive temperature in the write state will accelerate the aging of the storage medium and affect the data storage stability. If the data storage time is too long, data loss or damage may also occur due to changes in the characteristics of the storage medium. By comprehensively considering these factors to calculate the risk coefficient, the storage blocks with truly high risks can be accurately located.
[0049] In the above embodiments provided by 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 only illustrative. For example, the division of the modules is only for logical function division. In actual implementation, there may be other division methods. For example, 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 displayed or discussed coupling or direct coupling or communication connection to each other can be through some interfaces. The indirect coupling or communication connection of the device or component or module can be in an electrical, mechanical, or other form.
[0050] The components described as separation components may or may not be physically separated. The components shown as components may or may not be physical modules, that is, they may be located in one place or distributed to multiple network modules. Some or all of the components can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0051] In addition, in each embodiment of the present invention, the functional modules can be integrated in a processing module, or each component can exist physically alone, or two or more modules can be integrated in one module. The above-mentioned integrated modules can be implemented in the form of hardware or in the form of software functional modules.
[0052] If the integrated module is implemented in the form of 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, 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. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs that can store program codes.
[0053] It should be noted that for the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should know that the present invention is not limited by the described action sequence, because according to the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the present invention.
[0054] In the above embodiments, the descriptions of each embodiment have their own emphases. For the parts not detailed in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0055] The above are only the embodiments of the present invention, and do not limit the patent scope of the present invention accordingly. Any equivalent transformation made by using the content of the specification and drawings of the present invention, or directly or indirectly applied in the relevant technical fields, shall be equally included in the patent protection scope of the present invention.
Claims
1. A method for data patrol inspection of a solid-state drive, characterized in that, Including the following steps: Performing a risk level assessment on the storage blocks of the solid state drive; Determining whether the read / write times of the solid state drive are less than or equal to a preset first threshold. If so, performing a quick inspection on all the storage blocks; Otherwise, determining whether the read / write times of the solid state drive are less than or equal to a preset second threshold, where the second threshold is greater than the first threshold. If so, selecting some of the storage blocks for quick inspection according to the risk level. If not, performing a global inspection on all the storage blocks.
2. The method for data patrol inspection of a solid state drive according to claim 1, wherein The performing a risk level assessment on the storage blocks of the solid state drive includes: Calculating a risk coefficient for each storage block based on the read / write times, error count, temperature in the write state, and data storage time of the storage block to complete the risk level assessment. The higher the risk coefficient, the higher the risk level.
3. The method for data patrol inspection of the solid state drive according to claim 2, wherein The specifically selecting some of the storage blocks for quick inspection according to the result of the risk assessment is: Selecting the storage blocks with a risk coefficient greater than or equal to a preset coefficient value for quick inspection.
4. The method for data patrol inspection of the solid state drive according to claim 2, wherein The specifically performing a global inspection on all the storage blocks is: Performing a global inspection on all the storage blocks in descending order of the risk coefficient.
5. The method for data patrol inspection of a solid state drive according to claim 2, wherein The specifically calculating the risk coefficient for each storage block is: risk_score = a×PE + b×error_count + c×temperature + d×data_age; Where a, b, c, and d represent weights, PE represents the read / 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.
6. The method for data patrol inspection of the solid state drive according to claim 2, wherein, It further includes: During the quick inspection or the global inspection, if an error is detected in the storage block, updating the risk coefficient of the faulty storage block and continuing to complete the inspection.
7. The method for data patrol inspection of the solid state drive according to claim 2, wherein It further includes: Storing the risk coefficients of all the storage blocks in the non-volatile storage unit of the solid state drive and updating the risk coefficients of all the storage blocks at a preset period.
8. The method for data patrol inspection of the solid state drive according to claim 2, wherein It further includes: Dividing all the storage blocks into high-risk storage blocks, medium-risk storage blocks, and general-risk storage blocks according to the magnitude of the risk coefficient.
9. The method for data patrol inspection of the solid state drive according to claim 8, wherein It further includes: Defining a structure and setting a risk storage block table with an array length equal to the number of super blocks of the solid state drive within the structure; Recording the number of high-risk storage blocks, the number of medium-risk storage blocks, and the number of general-risk storage blocks in the risk storage block table.
10. The method for data patrol inspection of the solid state drive according to claim 1, wherein During the performing a global inspection on all the storage blocks, it further includes: Determining whether the read / write times of the input / output port of the solid state drive within a unit time are greater than or equal to a preset pressure value. If so, stopping the global inspection and performing a quick inspection on the storage blocks that have not been inspected yet.
11. Solid State Drive Data Patrol Inspection Device, characterized in that, Including: A storage management module, configured to: Perform a risk level assessment on the storage blocks of the solid state drive; Determine whether the read / write count 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 read / write count of the solid-state drive is less than or equal to a preset second threshold, where the preset second threshold is greater than the preset first threshold; If so, select some of the storage blocks for quick inspection according to the risk level. If not, perform a global inspection on all the storage blocks.
12. An electronic device, characterized in that, Comprising: A memory configured to store an executable program; And At least one processor configured to execute the program to perform the solid-state drive data inspection method according to any one of claims 1 to 10.
Citation Information
Patent Citations
Method, device and system for inspecting data in storage device
CN103049713A
Solid state disk data inspection method and device
CN114356238A
Method and device for performing data inspection on solid state disk partition, computer equipment and storage medium
CN115048055A
Hard disk scanning method and device
CN115857793A
Bad block management method and system for industrial-grade solid state disk, medium and product
CN118312109A