Solid state disk detection method, device, electronic equipment, medium and product

By acquiring the write/erase cycles and nominal durability of single-level and multi-level storage units, calculating the product of wear ratio and write/erase cycles, and dynamically adjusting the detection standards, the problem of low detection accuracy of solid-state drives is solved, enabling accurate identification of anomalies in single-level storage units and extending their lifespan.

CN120895086BActive Publication Date: 2025-12-09INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511409171.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-29
Publication Date
2025-12-09
Estimated Expiration
2045-09-29

AI Technical Summary

Technical Problem

In existing technologies, the detection accuracy of solid-state drives (SSDs) is low, and they cannot identify hard drive damage caused by excessive use of single-level storage units due to abnormal operation.

Method used

By obtaining the number of erase/write cycles and nominal durability of single-level and multi-level memory cells, the product of the current wear ratio and the number of erase/write cycles is calculated to dynamically determine the test results and improve the accuracy of the test.

Benefits of technology

It enables dynamic adjustment of detection standards based on real-time usage, accurately identifies anomalies in single-level storage units, extends hard drive lifespan, and improves detection accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120895086B_ABST
    Figure CN120895086B_ABST
Patent Text Reader

Abstract

The application discloses a solid state disk detection method and device, electronic equipment, medium and product, and relates to the technical field of solid state disks. According to real-time usage of a first storage unit and a second storage unit and real-time working information of a to-be-detected hard disk, a current wear ratio that is adaptive is dynamically determined, and according to the current wear ratio as a reference, detection accuracy can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of solid state disks, and particularly relates to a detection method and device of a solid state disk, an electronic device, a medium and a product. BACKGROUND

[0002] With the development of flash memory technology, in order to balance performance, capacity and cost, solid state disks using a mixed architecture of single-level storage units and multi-level storage units are widely used for data storage. In order to improve the working stability of the solid state disk, the solid state disk needs to be detected regularly.

[0003] In the related art, the solid state disk is detected by fixed detection items, and there is a problem of low detection accuracy. SUMMARY

[0004] The present application provides a detection method and device of a solid state disk, an electronic device, a medium and a product, to at least solve the problem of low detection accuracy in the related art.

[0005] The present application provides a detection method of a solid state disk, comprising: receiving a hard disk detection request, the hard disk detection request comprising a hard disk identifier;

[0006] According to the hard disk detection request, a to-be-detected hard disk corresponding to the hard disk identifier is determined, the to-be-detected hard disk comprising a first storage unit and a second storage unit;

[0007] The first erase-write number of the first storage unit and the second erase-write number of the second storage unit are obtained through a target command line interface operation tool of the to-be-detected hard disk, the nominal endurance of the first storage unit being greater than the nominal endurance of the second storage unit;

[0008] The working information of the to-be-detected hard disk is determined, and the current wear ratio between the first storage unit and the second storage unit is determined according to the working information;

[0009] The product of the current wear ratio and the second erase-write number is calculated to obtain a first number threshold;

[0010] The detection result of the first storage unit of the to-be-detected hard disk is determined according to the first erase-write number and the first number threshold.

[0011] The present application also provides a detection device of a solid state disk, comprising: a receiving module, configured to receive a hard disk detection request, the hard disk detection request comprising a hard disk identifier;

[0012] A determination module is configured to determine a to-be-detected hard disk corresponding to the hard disk identifier according to the hard disk detection request, the to-be-detected hard disk comprising a first storage unit and a second storage unit;

[0013] The acquisition module is configured to acquire the first erase-write times of the first storage unit and the second erase-write times of the second storage unit through a target command line interface operation tool of the hard disk to be detected, and the nominal endurance of the first storage unit is greater than the nominal endurance of the second storage unit.

[0014] The analysis module is configured to determine working information of the hard disk to be detected, and determine a current wear ratio between the first storage unit and the second storage unit according to the working information.

[0015] The calculation module is configured to calculate a product of the current wear ratio and the second erase-write times to obtain a first times threshold.

[0016] The detection module is configured to determine a detection result of the first storage unit of the hard disk to be detected according to the first erase-write times and the first times threshold.

[0017] The application further provides an electronic device, including a memory configured to store a computer program, and a processor configured to execute the computer program to implement the steps of the detection method of the solid state disk.

[0018] The application further provides a nonvolatile computer readable storage medium, and the nonvolatile computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the steps of the detection method of the solid state disk.

[0019] The application further provides a computer program product, including a computer program, and the computer program is executed by a processor to implement the steps of the detection method of the solid state disk.

[0020] According to the real-time usage of the first storage unit and the second storage unit and the real-time working information of the hard disk to be detected, the application dynamically determines an adaptive current wear ratio, and the detection accuracy can be improved by taking the current wear ratio as a reference. BRIEF DESCRIPTION OF DRAWINGS

[0021] In order to more clearly illustrate the embodiments of the application, the drawings needed in the embodiments will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the application, and other drawings can be obtained by those skilled in the art without creative labor.

[0022] Figure 1 A hardware architecture schematic diagram of the detection method of the solid state disk provided by the embodiments of the application;

[0023] Figure 2 A flowchart schematic diagram of the detection method of the solid state disk provided by the embodiments of the application;

[0024] Figure 3 FIG. 1 is a flowchart of another method for detecting a solid state disk according to an embodiment of the present application;

[0025] Figure 4 FIG. 2 is a schematic diagram of obtaining the number of erasing times according to an embodiment of the present application;

[0026] Figure 5 FIG. 3 is a schematic diagram of determining the detection result according to an embodiment of the present application;

[0027] Figure 6 FIG. 4 is a schematic diagram of determining the backup strategy according to an embodiment of the present application;

[0028] Figure 7 FIG. 5 is a structural schematic diagram of a detection device for a solid state disk according to an embodiment of the present application;

[0029] Figure 8 FIG. 6 is a structural schematic diagram of another detection device for a solid state disk according to an embodiment of the present application;

[0030] Figure 9 FIG. 7 is a structural schematic diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0031] The technical solutions in the embodiments of the present application will be clearly and completely described with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, any other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the present application.

[0032] It should be noted that, in the description of the present application, the terms “comprise”, “contain” or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device comprising a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or device. The terms “first”, “second” and the like in the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence.

[0033] For example, with the development of NAND flash memory technology, more data can be stored in a unit area to improve the storage density of data. On this basis, a solid state disk with a mixed architecture of single-level storage units and multi-level storage units can effectively improve the storage performance.

[0034] Specifically, in the hybrid architecture, a single-level storage unit only stores 1-bit data, and can only represent 2 voltage states: charged or uncharged. When in use, since only the voltage state needs to be adjusted to a target level, the charging process is direct and fast. Therefore, the single-level storage unit has extremely fast write speed and higher durability. The most critical and frequently accessed data can be stored in the more reliable single-level storage unit, greatly improving the stability and reliability of the solid state disk.

[0035] A multi-level storage unit can store multiple bits of data, which increases the overall capacity of the solid state disk and allows more data to be stored. A multi-level storage unit needs to accurately represent multiple (n) voltage states. When in use, the voltage state needs to be accurately adjusted to one of the multiple target levels, so the charging process is slower. In addition, the multiple target levels are closely adjacent, and in order to maintain the accuracy of the adjusted voltage state, multiple verification-pulse operations are required during adjustment. This increases the number of tunneling times and the pressure on the oxide layer, so the lifespan of the multi-level storage unit is relatively lower than that of the single-level storage unit.

[0036] The basic storage array of the NAND flash memory is composed of multiple floating gate metal-oxide-semiconductor field-effect transistor (MOSFET) transistors connected in series in the topology of an AND gate. This series structure has the characteristics of high density and low cost.

[0037] In order to enable those skilled in the art to better understand the application scheme, the application will be further described in detail below in combination with the drawings and specific embodiments.

[0038] In combination with the specific hardware architecture on which the detection method of the solid state disk is executed, the specific hardware architecture is described here. Referring to Figure 1 , Figure 1 is a schematic diagram of the hardware architecture of the detection method of the solid state disk. The solid state disk includes single-level storage units and multi-level storage units, and the single-level storage units and the multi-level storage units work together to realize data storage of the solid state disk.

[0039] In the related art, based on the consideration that the lifespan of the single-level storage unit is longer than that of the multi-level storage unit, only the multi-level storage units of the solid state disk are detected, and whether the multi-level storage units are abnormal is used to determine the detection result of the whole solid state disk.

[0040] ​However, when the single-level storage unit is excessively used due to abnormal operation, the single-level storage unit reaches the service life earlier than the multi-level storage unit. The detection method in the related art cannot detect this case, resulting in misjudgment of the abnormal solid state disk as a normal solid state disk, and a problem of low detection accuracy.

[0041] Figure 2 A flowchart of a detection method of a solid state disk provided by an embodiment of the present application is shown in FIG. 1, and the embodiment of the present application provides a detection method of a solid state disk, which is described in detail as follows. Figure 2

[0042] S201, receiving a hard disk detection request, the hard disk detection request including a hard disk identifier.

[0043] For example, the hard disk detection request is used to trigger detection of the solid state disk to determine whether the solid state disk is damaged.

[0044] For example, the hard disk identifier is a unique identifier, and the hard disk identifier is used to accurately determine the unique corresponding solid state disk.

[0045] In the present application, the scheme is for a solid state disk with a mixed architecture of single-level storage units and multi-level storage units.

[0046] For example, one single-level cell (SLC) stores one bit of data. The multi-level storage unit can be a triple-level cell (TLC) or a quad-level cell (QLC), etc. One multi-level storage unit can store data with a number of bits corresponding to the number of levels.

[0047] For example, the hard disk identifier includes at least one of the following: a hard disk serial number, a hard disk identification code, etc.

[0048] S202, according to the hard disk detection request, determining a to-be-detected hard disk corresponding to the hard disk identifier, the to-be-detected hard disk including a first storage unit and a second storage unit.

[0049] For example, the to-be-detected hard disk is a solid state disk that needs to be detected.

[0050] For example, the first storage unit is a single-level storage unit, and the second storage unit is a multi-level storage unit.

[0051] Optionally, the first storage unit and the second storage unit of the to-be-detected hard disk are determined by reading information of the to-be-detected hard disk or querying a technical manual according to a model of the to-be-detected hard disk.

[0052] ​S203, acquire the first erase-write times of the first storage unit and the second erase-write times of the second storage unit through a target command line interface operation tool of the to-be-detected hard disk, the nominal endurance of the first storage unit is greater than the nominal endurance of the second storage unit.

[0053] Exemplarily, the command line interface (CLI) is a way of operating software by inputting text instructions. The target command line interface operation tool is a tool matched with the to-be-detected hard disk, which can send specific instructions to the CLI of the to-be-detected hard disk to operate the to-be-detected hard disk. In this application, the instructions are sent to the CLI through the operation tool to read the erase-write times data of the to-be-detected hard disk.

[0054] Exemplarily, the first erase-write times are the current erase-write times of the first storage unit. The second erase-write times are the current erase-write times of the second storage unit.

[0055] Exemplarily, the nominal endurance of the storage unit is the upper limit of the erase-write times of the storage unit. When the actual erase-write times reaches the upper limit of the erase-write times, the storage unit reaches the life. At this time, if the solid state disk continues to be used, it may cause data loss or damage of the solid state disk.

[0056] In actual application, the voltage state of the single-level storage unit is less, the tunneling times and the oxide layer pressure of the single-level storage unit are small, and therefore the nominal endurance of the single-level storage unit is high. Similarly, the nominal endurance of the multi-level storage unit is low.

[0057] In related technologies, the detection of the storage unit of the solid state disk only detects whether the actual erase-write times of the multi-level storage unit reaches the upper limit of the erase-write times. However, abnormal operation of the solid state disk may cause the actual erase-write times of the single-level storage unit to reach the upper limit of the times before the multi-level storage unit. The related technologies cannot identify this situation, resulting in the problem of low detection accuracy of the solid state hardware.

[0058] S204, determine the working information of the to-be-detected hard disk, and determine the current wear ratio between the first storage unit and the second storage unit according to the working information.

[0059] Exemplarily, the working information is used to represent the actual working condition of the to-be-detected hard disk. According to the actual working condition, the current wear ratio matching the current state of the to-be-detected hard disk is dynamically determined.

[0060] In combination with a scene example, it can be determined through the actual working condition whether the to-be-detected hard disk is operated abnormally or the degree of abnormality, so as to dynamically determine the matching current wear ratio.

[0061] Exemplarily, the influence of the erasing and writing times of the first storage unit on the service life of the solid state disk is different from the influence of the erasing and writing times of the second storage unit on the service life of the solid state disk, and the current wear ratio is used to associate the erasing and writing times of the first storage unit and the erasing and writing times of the second storage unit.

[0062] In combination with a scene example, it is exemplarily assumed that the upper limit of the erasing and writing times of the first storage unit is 10000 and the upper limit of the erasing and writing times of the second storage unit is 1000. If the first erasing and writing times is 500 and the second erasing and writing times is 10, although the value of the first erasing and writing times from the upper limit of the erasing and writing times of the first storage unit is greater than the value of the second erasing and writing times from the upper limit of the erasing and writing times of the second storage unit, the growth rate of the first erasing and writing times is greater than the growth rate of the second erasing and writing times. The first storage unit may reach the service life before the second storage unit. The first erasing and writing times and the second erasing and writing times are converted by the current wear ratio to accurately determine whether the first storage unit reaches the service life before the second storage unit.

[0063] S205, the product of the current wear ratio and the second erasing and writing times is calculated to obtain a first times threshold.

[0064] Exemplarily, the first times threshold represents the theoretical safe upper limit of the erasing and writing times of the first storage unit corresponding to the second erasing and writing times, so as to accurately determine that the first erasing and writing times is normal rather than a single determination according to the upper limit of the erasing and writing times.

[0065] In combination with a scene example, the first times threshold represents the value of the first erasing and writing times when the growth rates of the first erasing and writing times and the second erasing and writing times correspond to each other under the current second erasing and writing times. In combination with a scene example, it is exemplarily assumed that the upper limit of the erasing and writing times of the first storage unit is 10000 and the upper limit of the erasing and writing times of the second storage unit is 1000. If the second erasing and writing times is 20, when the first erasing and writing times is 200, the growth rates of the first erasing and writing times and the second erasing and writing times correspond to each other, that is, the first times threshold is 200.

[0066] In actual use, the nominal durability changes, the current wear ratio calculated in real time according to the working information can reflect the actual state of the solid state disk, so as to accurately determine whether the growth rate of the first erasing and writing times exceeds the second erasing and writing times, thereby improving the accuracy of detection.

[0067] S206, according to the first erasing and writing times and the first times threshold, the detection result of the first storage unit of the to-be-detected hard disk is determined.

[0068] Exemplarily, by comparing the first erasing and writing times and the first times threshold, it is determined whether the growth rate of the current first erasing and writing times will cause the first storage unit to reach the service life before the second storage unit. According to the storage unit that reaches the service life first, it is determined whether the solid state disk has an abnormality.

[0069] With the scene example, according to the design of the solid state disk, the second storage unit normally reaches the life first. If the first erase count is greater than or equal to the first threshold, it indicates that the first storage unit is abnormal. By identifying and processing the abnormality, the overall life of the to-be-detected hard disk can be effectively prolonged.

[0070] The detection method of the solid state disk provided by the embodiment of the application receives a hard disk detection request, the hard disk detection request comprising a hard disk identifier; according to the hard disk detection request, a to-be-detected hard disk corresponding to the hard disk identifier is determined, the to-be-detected hard disk comprising a first storage unit and a second storage unit; through a target command line interface operation tool of the to-be-detected hard disk, a first erase count of the first storage unit and a second erase count of the second storage unit are obtained, a nominal endurance of the first storage unit being greater than a nominal endurance of the second storage unit; working information of the to-be-detected hard disk is determined, and a current wear ratio between the first storage unit and the second storage unit is determined according to the working information; a product of the current wear ratio and the second erase count is calculated to obtain a first threshold; and a detection result of the first storage unit of the to-be-detected hard disk is determined according to the first erase count and the first threshold. According to the real-time use of the first storage unit and the second storage unit and the real-time working information of the to-be-detected hard disk, the above scheme dynamically determines the current wear ratio that is suitable for adaptation, and the detection accuracy can be improved by taking the current wear ratio as a reference.

[0071] On the basis of any one of the above embodiments, the following will be described in combination with Figure 3 The detailed process of the detection of the solid state disk is described.

[0072] Figure 3 The flowchart of another detection method of the solid state disk provided by the embodiment of the application is shown. As shown in the figure, the method comprises the following steps. Figure 3

[0073] S301, receiving a hard disk detection request, the hard disk detection request comprising a hard disk identifier.

[0074] It should be noted that the execution process of S301 is described in S201, which will not be repeated here.

[0075] S302, according to the hard disk detection request, determining a to-be-detected hard disk corresponding to the hard disk identifier, the to-be-detected hard disk comprising a first storage unit and a second storage unit.

[0076] It should be noted that the execution process of S302 is described in S202, which will not be repeated here.

[0077] S303, according to the hard disk identifier, determining a target command line interface operation tool corresponding to the to-be-detected hard disk.

[0078] ​Exemplarily, each type of solid state disk corresponds to a command line interface operation tool, and the private information of the solid state disk can be read only through the corresponding command line interface operation tool, so as to improve the security of the solid state disk. The target command line interface operation tool is a command line interface operation tool dedicated to the to-be-detected hard disk.

[0079] Optionally, a mapping relationship between the hard disk identifier and the command line interface operation tool is preconfigured, and the target command line interface operation tool corresponding to the to-be-detected hard disk is determined through the mapping relationship.

[0080] S304, a read instruction is sent to the to-be-detected hard disk through the target command line interface operation tool, so as to obtain log information of the to-be-detected hard disk.

[0081] Exemplarily, the target command line interface operation tool serves as a communication agent, and sends one or more vendor-specific instructions to the controller of the to-be-detected hard disk through an interface provided by the operating system kernel.

[0082] Optionally, the instructions are non-public and self-defined by the hard disk vendor, and the function code and parameter format thereof are preconfigured.

[0083] Exemplarily, after the instructions are received by the firmware of the to-be-detected hard disk, a corresponding internal function is executed, the requested data is read from the management area of the flash memory, and the log information encapsulated into a specific data packet structure is output.

[0084] Optionally, the log information is original and structured binary data stream, which is temporarily stored in the memory through encryption. The content in the log information can be read through a password, so as to improve the security.

[0085] S305, determining a first erase-write number and a second erase-write number from the log information.

[0086] Optionally, the starting positions of the first erase-write number and the second erase-write number in the log information are determined through a preset positioning offset, and the first erase-write number and the second erase-write number are read through the starting positions.

[0087] Next, the embodiments of the present application will be described in detail in combination with Figure 4 The erase-write number is described.

[0088] Figure 4 The schematic diagram for obtaining the erase-write number provided by the embodiments of the present application is shown in FIG. 1. As shown in FIG. 1, the to-be-detected hard disk 100 is connected to the host computer 200 through the interface 300, and the target command line interface operation tool 400 is used to send the read instruction to the to-be-detected hard disk 100. Figure 4As shown, the user or program provides a logical disk symbol at the operating system level to specify the hard disk to be detected. The disk symbol is an access entry assigned by the operating system for each solid state disk. The disk symbol assigned by the operating system is converted into the unique physical address of the hard disk to be detected on the hardware bus. Through the target command line interface operation tool, specific instructions are sent to the hard disk to be detected, instructing it to output detailed log information maintained internally. According to the pre-configured binary data structure definition, the obtained log information is decoded to extract the erase count of each storage unit.

[0089] A feasible implementation can determine the first erase count and the second erase count by the following method, including: determining a plurality of first storage blocks of the first storage unit and a plurality of first erase records corresponding to the plurality of first storage blocks from the log information; according to a statistical method, the plurality of first erase records are statistically processed to obtain the first erase count; and determining the second erase count from the log information.

[0090] The hard disk detection request further includes a statistical method.

[0091] For example, the storage unit is composed of a plurality of storage blocks. The log information includes entries of each storage block, and the entries include usage information of the storage block. A plurality of erase counts corresponding to a plurality of storage blocks are obtained from the log information. According to a statistical method, the plurality of erase counts are statistically processed to obtain the erase count.

[0092] Optionally, the first erase count and the second erase count are obtained by the same method.

[0093] Optionally, the statistical method includes at least one of the following: minimum value, maximum value, or arithmetic mean value.

[0094] In this feasible implementation, through a plurality of dimensional statistical methods, the application scenario can be switched according to the actual application scenario to match the application scenario, thereby improving the accuracy of detection.

[0095] S306, according to the hard disk identifier and the preset first mapping relationship, determining the wear ratio reference value of the hard disk to be detected.

[0096] For example, the wear ratio reference value is the reference value initially set before the solid state disk is shipped, and the wear ratio reference value is the wear ratio in an ideal situation.

[0097] With the example of the scene, taking the upper limit of the erase-write times of the first storage unit as 10000 and the upper limit of the erase-write times of the second storage unit as 1000 as an example. The wear ratio reference value is the ratio of the upper limit of the erase-write times, that is, the first storage unit: the second storage unit = 10:1. 10:1 indicates that, in an ideal case, when the first erase-write times is less than 10 times the second erase-write times, the first storage unit is not over-worn, and the second storage unit reaches the life before the first storage unit. Otherwise, it is considered that the first storage unit is over-worn.

[0098] S307, according to the working scene and the working load, the wear ratio increment is determined.

[0099] Exemplarily, the dynamically determined wear ratio increment represents the change amount of the current wear ratio relative to the wear ratio reference value.

[0100] With the example of the scene, during the use of the hard disk to be detected, the upper limit of the erase-write times of the first storage unit and the upper limit of the erase-write times of the second storage unit will change, resulting in the need to adjust the wear ratio reference value to adapt to the actual application scene, and the wear ratio increment is the adjusted value.

[0101] A feasible implementation manner can determine the wear ratio increment by the following method, comprising: determining a prediction model of the wear ratio increment, the prediction model being trained according to a plurality of sample working information of a plurality of sample hard disks, the plurality of sample hard disks being of the same model as the hard disk to be detected; inputting the working scene and the working load into the prediction model to obtain the wear ratio increment.

[0102] Exemplarily, the first storage unit is used for being usually used as a cache or storing key metadata (such as the L2P mapping table of FTL). The characteristics of these data are frequently, small amount, and randomly updated. The second storage unit is used for storing large-capacity data. If the hard disk to be detected is mainly used as a cache in any application scene, the growth rate of the first erase-write times is larger. At the same time, excessively frequent read-write will also affect the upper limit of the erase-write times of the first storage unit. Further, it causes the change of the wear ratio reference value.

[0103] Exemplarily, the working load can also represent the frequency of read-write, so as to determine the influence of the read-write operation on the upper limit of the erase-write times of the first storage unit and the upper limit of the erase-write times of the second storage unit, and further determine the wear ratio increment.

[0104] Exemplarily, in the training process of the prediction model of the wear ratio increment, the abstract mapping relationship between the working scene and the working load and the wear ratio increment is learned according to the working information of the sample hard disk. In the use process of the prediction model, the wear ratio increment of the hard disk to be detected is predicted according to the abstract mapping relationship.

[0105] In this feasible implementation, the wear ratio increment is dynamically predicted based on the actual working scenario and workload of the hard drive under test, so that the detection of the solid-state drive conforms to the actual scenario, thereby improving the accuracy of the detection.

[0106] S308. Determine the current wear ratio based on the wear ratio baseline value and the wear ratio increment.

[0107] Optionally, the current wear ratio can be determined by the sum of the wear ratio baseline value and the wear ratio increment.

[0108] Optionally, the wear ratio increment can be positive or negative.

[0109] Based on the above implementation methods, the current wear ratio is determined according to the actual scenario, thereby improving the accuracy of detection.

[0110] S309. Calculate the product of the current wear ratio and the second number of erase / write cycles to obtain the first data threshold.

[0111] It should be noted that the execution process of S309 is the same as that of S205, and will not be repeated here.

[0112] S310. Determine the detection result of the first storage unit of the hard disk to be tested based on the first number of erase / write cycles and the first number threshold.

[0113] One feasible implementation is that if the first number of erase / write cycles is greater than or equal to the threshold of the first number of cycles, the detection result is determined to be that the first storage unit is abnormal; if the first number of erase / write cycles is less than the threshold of the first number of cycles, the detection result is determined to be that the first storage unit is normal.

[0114] Below, in conjunction with Figure 5 Explain the confirmed test results.

[0115] Figure 5 This is a schematic diagram illustrating the determination of detection results provided in an embodiment of this application. For example... Figure 5 As shown, first, the first number of erase / write cycles A and the first count threshold B are determined. If A ≥ B, the growth rate of the first memory cell is too high, indicating that the first memory cell is abnormal. Conversely, if A ≥ B, the growth rate of the first memory cell is within the expected range, indicating that the first memory cell is normal.

[0116] With the example of the scenario, by comparing the first number of erase / write cycles with the first number threshold, the detection result of the first storage unit in the current application scenario can be dynamically determined.

[0117] In this feasible implementation, by dynamically determining the detection result of the first storage unit in the current application scenario, the detection result can accurately reflect the actual state of the hard drive to be tested, thereby improving the detection accuracy.

[0118] In an example, if the detection result is that the first storage unit is abnormal, the detection of the solid state disk further includes: determining current storage data of the first storage unit, determining a first available space of the second storage unit; determining a backup disk corresponding to the to-be-detected disk, and determining a second available space of the backup disk; determining to-be-backed-up data and a data capacity corresponding to the to-be-backed-up data from the current storage data; determining a backup strategy according to the data capacity, the first available space, and the second available space, the backup strategy being to backup the to-be-backed-up data in the second storage unit and / or to backup the to-be-backed-up data in the backup disk; executing the backup strategy to perform backup processing on the to-be-backed-up data, and generating a backup state signal, the backup state signal being used to indicate whether the backup is successful and a backup location; and sending the backup state signal to a host computer connected to the to-be-detected disk.

[0119] In an example, the current storage data is data currently stored in the first storage unit, and when the detection result is that the first storage unit is abnormal, the to-be-backed-up data is used to cope with the data loss caused by the first storage unit.

[0120] In an example, the backup disk is a disk independent of the to-be-detected disk and establishing a data transmission connection with the to-be-detected disk, and is used to backup data in the to-be-detected disk.

[0121] In an example, the first available space is a space in the second storage unit available for storing the to-be-backed-up data, and the second available space is a space in the backup disk available for storing the to-be-backed-up data.

[0122] In an example, if the first available space and the second available space are both greater than the data capacity, the backup strategy is determined to be to backup the to-be-backed-up data in the second storage unit or to backup the to-be-backed-up data in the backup disk. If only one of the first available space and the second available space is greater than the data capacity, the device corresponding to the available space greater than the data capacity is used as a device for storing the to-be-backed-up data. If the first available space and the second available space are both less than the data capacity, the second storage unit and the backup disk are used to store part of the to-be-backed-up data respectively.

[0123] In an example, the backup state signal is used to make the host computer clear the current backup state, so that the host computer can accurately perform the repair work of the first storage unit.

[0124] In the following, the embodiments of the present application are described in combination with Figure 6 The backup strategy is described.

[0125] Figure 6 A schematic diagram for determining the backup strategy is provided for the embodiments of the present application. As shown in FIG. 4, the backup strategy is determined according to the data capacity, the first available space, and the second available space. Figure 6As shown, the to-be-backed-up data needing to be backed up is determined from the first storage unit. The first available space is determined from the second storage unit. The second available space is determined from the backup hard disk. According to the data capacity of the to-be-backed-up data, the first available space, and the second available space, the backup strategy that the to-be-backed-up data can be completely backed up is determined.

[0126] Optionally, before the backup strategy is executed, the first check code of the to-be-backed-up data is generated. After the backup strategy is executed, the second check code of the to-be-backed-up data in the second storage unit and / or the backup hard disk is generated. The integrity of the backup is determined by comparing the first check code and the second check code. If the first check code and the second check code are different, the backup process is re-executed until the first check code and the second check code are the same.

[0127] In this feasible implementation manner, by dynamically determining the backup strategy, it can be ensured that the capacity of the second storage unit and / or the backup hard disk is sufficient to store the to-be-backed-up data, thereby improving the reliability of the backup.

[0128] In a feasible implementation manner, if the detection result is that the first storage unit is abnormal, the detection of the solid state disk further includes: generating an alarm information according to the hard disk identifier, the first number of erasing times, and the storage unit type of the first storage unit; and sending the alarm information to the upper computer connected to the to-be-detected hard disk.

[0129] Illustratively, the alarm information is used to make the upper computer clear the severity of the abnormality of the first storage unit, so that the upper computer takes targeted measures.

[0130] Specifically, the hard disk identifier is used to indicate which solid state disk has an abnormality. The first number of erasing times directly indicates the remaining life of the solid state disk. The storage unit type clearly indicates which storage unit is abnormal.

[0131] In this feasible implementation manner, by using multiple types of information, the specific information of the abnormality can be accurately indicated, thereby improving the accuracy of the alarm.

[0132] In a feasible implementation manner, the alarm information can be generated by the following method, including: determining the difference between the first number of erasing times and the first number threshold; determining the proportion of the difference in the first number threshold; determining the health index of the to-be-detected hard disk according to the proportion and a preset second mapping relationship; and generating the alarm information according to the hard disk identifier, the health index, and the storage unit type of the first storage unit.

[0133] Illustratively, the preconfigured second mapping relationship is used to quantify the proportion into the health index.

[0134] In combination with the scene example, the proportion of 10% or 30% corresponds to different abnormal severity. The abnormal severity can be accurately quantified through different health indexes.

[0135] In the feasible implementation manner, the degree of abnormality is accurately quantified through the health index, so that the targeted repair strategy is accurately determined, and the reliability of data storage is improved.

[0136] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be realized by means of software and the necessary general hardware platform, of course, it can also be realized by hardware, but in many cases, the former is a better implementation manner.

[0137] Figure 7 The structural schematic diagram of the solid state disk detection device provided by the embodiment of the application is shown in the figure. Figure 7 As shown in the figure, the embodiment of the application further provides a solid state disk detection device, and the solid state disk detection device 70 can include a receiving module 71, a determining module 72, an obtaining module 73, an analyzing module 74, a calculating module 75, and a detection module 76.

[0138] The receiving module 71 is configured to receive a hard disk detection request, and the hard disk detection request includes a hard disk identifier.

[0139] The determining module 72 is configured to determine a to-be-detected hard disk corresponding to the hard disk identifier according to the hard disk detection request, and the to-be-detected hard disk includes a first storage unit and a second storage unit.

[0140] The obtaining module 73 is configured to obtain a first number of erasing and writing times of the first storage unit and a second number of erasing and writing times of the second storage unit through a target command line interface operation tool of the to-be-detected hard disk, and a nominal endurance of the first storage unit is greater than a nominal endurance of the second storage unit.

[0141] The analyzing module 74 is configured to determine working information of the to-be-detected hard disk, and determine a current wear ratio between the first storage unit and the second storage unit according to the working information.

[0142] The calculating module 75 is configured to calculate a product of the current wear ratio and the second number of erasing and writing times to obtain a first number threshold.

[0143] The detection module 76 is configured to determine a detection result of the first storage unit of the to-be-detected hard disk according to the first number of erasing and writing times and the first number threshold.

[0144] Optionally, the receiving module 71 can execute S201 in the embodiment. Figure 2

[0145] Optionally, the determining module 72 can execute S202 in the embodiment. Figure 2 ​S202 in the embodiment.

[0146] Optionally, the acquisition module 73 can perform Figure 2 S203 in the embodiment.

[0147] Optionally, the analysis module 74 can perform Figure 2 S204 in the embodiment.

[0148] Optionally, the calculation module 75 can perform Figure 2 S205 in the embodiment.

[0149] Optionally, the detection module 76 can perform Figure 2 S206 in the embodiment.

[0150] It should be noted that the detection device of the solid state disk shown in the embodiments of the present application can perform the technical solutions shown in the above method embodiments, and the implementation principles and beneficial effects are similar, which will not be repeated here.

[0151] In a possible implementation, the acquisition module 73 is specifically configured to:

[0152] According to the hard disk identifier, determine the target command line interface operation tool corresponding to the to-be-detected hard disk;

[0153] Send a read instruction to the to-be-detected hard disk through the target command line interface operation tool to obtain log information of the to-be-detected hard disk;

[0154] Determine the first erase-write number and the second erase-write number from the log information.

[0155] In a possible implementation, the hard disk detection request further includes a statistical method; the acquisition module 73 is specifically configured to:

[0156] Determine a plurality of first storage blocks of the first storage unit and a plurality of first erase-write records corresponding to the plurality of first storage blocks from the log information;

[0157] According to the statistical method, statistically process the plurality of first erase-write records to obtain the first erase-write number;

[0158] Determine the second erase-write number from the log information.

[0159] In a possible implementation, the analysis module 74 is specifically configured to:

[0160] According to the hard disk identifier and the preset first mapping relationship, determine a wear ratio reference value of the to-be-detected hard disk;

[0161] According to the working scenario and the working load, determine a wear ratio increment;

[0162] The current wear ratio is determined according to the wear ratio reference value and the wear ratio increment.

[0163] In a possible implementation, the analysis module 74 is specifically configured to:

[0164] The prediction model for determining the wear ratio increment is trained according to the plurality of sample working information of the plurality of sample hard disks, and the plurality of sample hard disks are of the same type as the to-be-detected hard disk.

[0165] The working scenario and the working load are input into the prediction model to obtain the wear ratio increment.

[0166] Figure 8 Another structural schematic diagram of a solid state disk detection device provided by an embodiment of the present application is provided. Figure 7 Based on the embodiment shown in Figure 8 The solid state disk detection device 70 further includes a judgment module 77, a backup module 78, and an alarm module 79.

[0167] The judgment module 77 is configured to:

[0168] If the first number of erasing and writing is greater than or equal to the first number threshold, it is determined that the detection result is that the first storage unit is abnormal.

[0169] If the first number of erasing and writing is less than the first number threshold, it is determined that the detection result is that the first storage unit is normal.

[0170] The backup module 78 is configured to:

[0171] Determine the current storage data of the first storage unit and determine the first available space of the second storage unit.

[0172] Determine the backup hard disk corresponding to the to-be-detected hard disk and determine the second available space of the backup hard disk.

[0173] From the current storage data, determine the to-be-backed-up data and the data capacity corresponding to the to-be-backed-up data.

[0174] According to the data capacity, the first available space, and the second available space, determine a backup strategy, the backup strategy being to backup the to-be-backed-up data in the second storage unit and / or to backup the to-be-backed-up data in the backup hard disk.

[0175] Execute the backup strategy to perform backup processing on the to-be-backed-up data, and generate a backup state signal, the backup state signal being used to indicate whether the backup is successful and a backup location.

[0176] Send the backup state signal to a host computer connected to the to-be-detected hard disk.

[0177] The alarm module 79 is configured to:

[0178] generate the alarm information according to the hard disk identifier, the health index, and the storage unit type of the first storage unit.

[0179] send the alarm information to the host computer connected to the hard disk to be detected.

[0180] In a possible implementation, the alarm module 79 is specifically configured to:

[0181] determine a difference between the first number of erasing and the first number threshold;

[0182] determine a proportion of the difference in the first number threshold;

[0183] determine the health index of the hard disk to be detected according to the proportion and a preset second mapping relationship;

[0184] generate the alarm information according to the hard disk identifier, the health index, and the storage unit type of the first storage unit.

[0185] The features of the embodiments of the detection device of the solid state disk can be referred to the related descriptions of the embodiments of the detection method of the solid state disk, which will not be repeated here.

[0186] Figure 9 The structure schematic diagram of the electronic device provided in the present application is shown in FIG. 1. As shown in FIG. 1, the electronic device 90 provided in the present embodiment includes at least one processor 901 and a memory 902. Optionally, the electronic device 90 further includes a communication component 903. The processor 901, the memory 902 and the communication component 903 are connected through a bus. Figure 9

[0187] In the specific implementation process, the at least one processor 901 executes the computer execution instructions stored in the memory 902, so that the at least one processor 901 executes the above-mentioned embodiments of the detection method of the solid state disk.

[0188] The specific implementation process of the processor 901 can be referred to the above-mentioned method embodiments, which has similar implementation principles and technical effects, and will not be repeated here in the present embodiment.

[0189] ​In the above embodiments, it should be understood that the processor can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), etc. The general-purpose processor can be a microprocessor or any conventional processor, etc. The steps of the method disclosed in the application can be directly embodied as hardware processor execution, or executed by a combination of hardware and software modules in the processor.

[0190] The memory can include a random access memory (RAM), and can also include a non-volatile memory (NVM), such as at least one disk memory.

[0191] The bus can be an industry standard architecture (ISA) bus, a peripheral component (PCI) bus, an extended industry standard architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application does not limit to only one bus or one type of bus.

[0192] The embodiments of the present application also provide a non-volatile computer readable storage medium, which stores a computer program, and the computer program is configured to execute the steps in any of the above-mentioned solid state disk detection method embodiments when running.

[0193] In an example embodiment, the above-mentioned non-volatile computer readable storage medium can include, but is not limited to: a U disk, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and various media that can store computer programs.

[0194] The embodiments of the present application also provide a computer program product, which includes a computer program, and the computer program is executed by a processor to implement the steps in any of the above-mentioned solid state disk detection method embodiments.

[0195] Embodiments of this application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in any of the above-described solid-state drive detection method embodiments.

[0196] Those skilled in the art will further 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 implementation should not be considered beyond the scope of this application.

[0197] The present application provides a detailed description of a solid-state drive (SSD) testing method, apparatus, electronic device, medium, and product. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of these embodiments are only intended to aid in understanding the method and core concepts of this application. It should be noted that those skilled in the art can make various improvements and modifications to this application without departing from its principles, and these improvements and modifications also fall within the scope of protection of the claims.

Claims

1. A method for detecting a solid state drive, characterized by, The method comprises the following steps: receiving a hard disk detection request, wherein the hard disk detection request comprises a hard disk identifier; determining a to-be-detected hard disk corresponding to the hard disk identifier according to the hard disk detection request, wherein the to-be-detected hard disk comprises a first storage unit and a second storage unit; obtaining a first erase-write number of the first storage unit and a second erase-write number of the second storage unit through a target command line interface operation tool of the to-be-detected hard disk, wherein a nominal endurance of the first storage unit is greater than a nominal endurance of the second storage unit; determining working information of the to-be-detected hard disk, and determining a current wear ratio between the first storage unit and the second storage unit according to the working information; wherein the working information comprises a working scenario and a working load; determining the current wear ratio between the first storage unit and the second storage unit according to the working information comprises: determining a wear ratio reference value of the to-be-detected hard disk according to the hard disk identifier and a preset first mapping relationship; determining a wear ratio increment according to the working scenario and the working load; and determining the current wear ratio according to the wear ratio reference value and the wear ratio increment; wherein determining the wear ratio increment according to the working scenario and the working load comprises: determining a prediction model of the wear ratio increment, wherein the prediction model is trained according to a plurality of sample working information of a plurality of sample hard disks, and the plurality of sample hard disks have the same type as the to-be-detected hard disk; and inputting the working scenario and the working load into the prediction model to obtain the wear ratio increment; calculating a product of the current wear ratio and the second erase-write number to obtain a first number threshold; determining a detection result of the first storage unit of the to-be-detected hard disk according to the first erase-write number and the first number threshold.

2. The method of claim 1, wherein, obtaining the first erase-write number of the first storage unit and the second erase-write number of the second storage unit through the target command line interface operation tool of the to-be-detected hard disk comprises: determining a target command line interface operation tool corresponding to the to-be-detected hard disk according to the hard disk identifier; sending a reading instruction to the to-be-detected hard disk through the target command line interface operation tool to obtain log information of the to-be-detected hard disk; determining the first erase-write number and the second erase-write number from the log information.

3. The method of claim 2, wherein, The hard disk detection request further comprises a statistical method; determining the first erase-write number and the second erase-write number from the log information comprises: determining a plurality of first storage blocks of the first storage unit and a plurality of first erase-write records corresponding to the plurality of first storage blocks from the log information; statistically processing the plurality of first erase-write records according to the statistical method to obtain the first erase-write number; determining the second erase-write number from the log information.

4. The method of claim 1-3, wherein, determining the detection result of the first storage unit of the to-be-detected hard disk according to the first erase-write number and the first number threshold comprises: if the first erase-write number is greater than or equal to the first number threshold, determining that the detection result is that the first storage unit is abnormal. If the first number of erasing and writing is less than the first threshold, it is determined that the detection result is that the first storage unit is normal.

5. The method of claim 4, wherein, If the detection result is that the first storage unit is abnormal, the method further comprises: determining current storage data of the first storage unit, and determining a first available space of the second storage unit; determining a backup hard disk corresponding to the hard disk to be detected, and determining a second available space of the backup hard disk; from the current storage data, determining data to be backed up, and a data capacity corresponding to the data to be backed up; determining a backup strategy according to the data capacity, the first available space, and the second available space, the backup strategy being to backup the data to be backed up in the second storage unit, and / or to backup the data to be backed up in the backup hard disk; performing the backup strategy to backup the data to be backed up, and generating a backup state signal, the backup state signal being used to indicate whether the backup is successful and a backup position; sending the backup state signal to a host computer connected to the hard disk to be detected.

6. The method of claim 4, wherein, If the detection result is that the first storage unit is abnormal, the method further comprises: generating an alarm information according to the hard disk identifier, the first number of erasing and writing, and a storage unit type of the first storage unit; sending the alarm information to the host computer connected to the hard disk to be detected.

7. The method of claim 6, wherein, Generating an alarm information according to the hard disk identifier, the first number of erasing and writing, and a storage unit type of the first storage unit comprises: determining a difference between the first number of erasing and writing and the first threshold; determining a proportion of the difference in the first threshold; determining a health index of the hard disk to be detected according to the proportion and a preset second mapping relationship; generating the alarm information according to the hard disk identifier, the health index, and the storage unit type of the first storage unit.

8. An electronic device, comprising: Comprise: a memory for storing a computer program; a processor for executing the computer program to implement the steps of the detection method of the solid state disk according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Method for selecting garbage collection target block, and solid state disk

    CN108628758A

  • Solid state disk life test method and system, electronic equipment and storage medium

    CN116580753A