Hard disk test method, device, storage medium, and program product
By writing multiple data into the hard disk and simulating the reset operation, the shortcomings of the existing hard disk performance stability test under ideal conditions are solved, a test closer to the actual application scenario is achieved, and the reliability and efficiency of the test results are improved.
Patent Information
- Application Number
- CN202511055554.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-30
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2045-07-30
AI Technical Summary
Existing hard drive performance stability testing methods are mostly conducted under ideal conditions, which are difficult to reflect the hard drive performance stability in actual application scenarios, especially in abnormal situations where frequent reset operations may cause hardware or system failures.
Based on the hard drive's application scenario, multiple data are written to the storage space. When the valid data storage address cannot be determined, a reset operation is simulated. A scheduled deletion operation is used to trigger the reset, determine the performance stability index value, and test the hard drive's stability in actual application scenarios.
The reference value of hard drive performance stability testing is improved, which can better evaluate the reliability and stability of hard drives under reset operations, reduce testing costs and improve testing efficiency.
Smart Images

Figure CN120560918B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data storage, and more particularly to a hard disk testing method, device, storage medium and program product. BACKGROUND
[0002] The reset operation is an operation for restoring the solid state disk to a specific initial state, which is equivalent to uninstalling and then loading the driver. The performance stability of the hard disk determines whether the hard disk can be stably restored to a usable state and whether additional hardware or system failures are caused in the case of encountering the reset operation. However, the related hard disk performance stability testing method is mostly tested in an ideal state, which is difficult to reflect the hard disk performance stability in the actual application scenario. SUMMARY
[0003] In view of the above problems, the present application provides a hard disk testing method, device, storage medium and program product.
[0004] According to a first aspect of the present application, a hard disk testing method is provided, comprising: writing a plurality of data into a storage space in a to-be-tested hard disk according to an application scenario of the to-be-tested hard disk; in a case where a storage address of valid data in the plurality of data cannot be determined according to storage mapping information, performing a predetermined number of times of reset operations on the to-be-tested hard disk, a starting time of the reset operation being determined according to a time of performing a predetermined deletion operation on invalid data in the plurality of data; determining an index value of the to-be-tested hard disk for a predetermined test index; and determining a performance stability of the to-be-tested hard disk according to the index value.
[0005] A second aspect of the present application further provides a computer program product, comprising a computer program or instructions, which, when executed by a processor, implement the steps of the above method.
[0006] A third aspect of the present application provides an electronic device, comprising: one or more processors; a memory for storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the above method.
[0007] A fourth aspect of the present application further provides a computer-readable storage medium having stored thereon a computer program or instructions, which, when executed by a processor, implement the steps of the above method. BRIEF DESCRIPTION OF DRAWINGS
[0008] The above content of the present application and other purposes, features and advantages will be more apparent through the following description of the embodiments of the present application with reference to the accompanying drawings, in which:
[0009] Figure 1An application scenario diagram of the hard disk testing method, device, storage medium and program product according to an embodiment of the present application is shown.
[0010] Figure 2 A flowchart of the hard disk testing method according to an embodiment of the present application is shown.
[0011] Figure 3 A schematic diagram of a simplified model of a solid state disk according to an embodiment of the present application is shown.
[0012] Figure 4 A schematic diagram of writing data into a solid state disk according to an embodiment of the present application is shown.
[0013] Figure 5 A schematic diagram of writing data into a solid state disk according to another embodiment of the present application is shown.
[0014] Figure 6 A schematic diagram of writing second data into a predetermined storage sub-space in a storage space according to an embodiment of the present application is shown.
[0015] Figure 7 A schematic diagram of writing second data into a predetermined storage sub-space in a storage space according to another embodiment of the present application is shown.
[0016] Figure 8 A flowchart of the hard disk testing method according to another embodiment of the present application is shown.
[0017] Figure 9 A structural block diagram of the hard disk testing device according to an embodiment of the present application is shown.
[0018] Figure 10 A block diagram of an electronic device suitable for implementing the hard disk testing method according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0019] Hereinafter, embodiments of the present application will be described with reference to the accompanying drawings. It is to be understood, however, that the description is merely exemplary and is not intended to limit the scope of the present application. In the following detailed description of the embodiments of the present application, numerous specific details are set forth in order to provide a thorough understanding of the embodiments of the present application. However, it would be apparent to those skilled in the art that the embodiments of the present application can be practiced without these specific details. In other instances, well-known structures and functions have been described in detail in order to avoid obscuring aspects of the present application.
[0020] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of the present application. As used herein, the term "includes" and "including" means the existence of the features, steps, operations and / or components, but does not exclude the existence or addition of one or more other features, steps, operations or components.
[0021] All terms used herein, including technical and scientific terms, have the meanings commonly understood by one of ordinary skill in the art, unless otherwise defined. It should be further noted that the use of any terms herein should not be interpreted to imply any limitation on the scope of the specification unless otherwise explicitly stated.
[0022] In the case of using expressions similar to "at least one of A, B, and C, etc.", it should generally be interpreted that the meaning of the expression is at least one of A, B, and C, etc. (for example, "a system having at least one of A, B, and C" should include but not be limited to a system having A alone, a system having B alone, a system having C alone, a system having both A and B, a system having both A and C, a system having both B and C, and / or a system having A, B, and C, etc.).
[0023] For a solid state drive (SSD), for example, for a non-volatile memory express (NVMe) SSD, a reset operation is an operation for restoring the solid state drive to a specific initial state, which is equivalent to unloading and then loading the driver. The reset operation is usually triggered in abnormal situations, for example: in the scenario of using the solid state drive to store or cache data, the solid state drive may be frequently triggered to reset due to machine failure (such as frequent restarts without reason) or application exception when deploying services, or when encountering a large pressure load in the process of executing services, the solid state drive resource is tight, which may cause the solid state drive to timeout, at this time, the host will actively issue a reset operation to make the solid state drive reset, further, if the service pressure is always high, the host will also issue a reset operation for the solid state drive when detecting that the solid state drive has timed out for a certain period of time.
[0024] The performance stability of the hard disk itself can affect whether the business of the hard disk can recover from the exception. If the performance stability of the hard disk is low, the reset operation may cause the unloaded driver to fail to load normally, or the hard disk may not be recognized normally after the server restarts, even leading to a downtime.
[0025] The related test methods for testing the performance stability of the hard disk include test methods including input / output (IO) operations and test methods not including input / output operations.
[0026] For the test method with input / output operation, the hard disk can use the benchmark test tool to issue a reset command to the hard disk at a certain period while sequentially writing or randomly writing to the hard disk, so as to unload the hard disk drive, reload the hard disk drive, and monitor the solid state disk for a long time to test the performance stability of the solid state disk under the reset operation.
[0027] For the test method without input / output operation, the hard disk uses the benchmark test tool to sequentially write or randomly write to the hard disk, and then no longer issues a read / write command. Correspondingly, a reset command is issued to the hard disk at a certain period to unload the hard disk drive, reload the hard disk drive, and monitor the solid state disk for a long time to verify the performance stability of the solid state disk under the reset operation.
[0028] However, the above test methods are mostly tested in ideal state, which is difficult to reflect the hard disk performance stability in actual application scenarios. For example, in the actual application scenario of the solid state disk, the hard disk mostly stores actual business data (such as database files, logs, documents, etc.), rather than temporary test data generated by the test tool. The structure, distribution, and access history of the actual business data are essentially different from the random / sequential write test data of the test tool (for example, the actual business data may have the characteristics of frequent overwrite, fragmentation, long-term static, etc.). Moreover, in the actual application scenario, the solid state disk may face unexpected power failure, device restart, and the like.
[0029] Therefore, embodiments of the present application provide a hard disk test method, which comprises: writing a plurality of data into a storage space in a to-be-tested hard disk according to an application scenario of the to-be-tested hard disk; in a case where a storage address of valid data in the plurality of data cannot be determined according to storage mapping information, performing a predetermined number of reset operations on the to-be-tested hard disk, a starting time of the reset operation being determined according to a predetermined deletion operation execution time for invalid data in the plurality of data; determining an index value of the to-be-tested hard disk for a predetermined test index; and determining a performance stability of the to-be-tested hard disk according to the index value.
[0030] Figure 1 An application scenario diagram of the hard disk test method, device, storage medium, and program product according to embodiments of the present application is shown.
[0031] As shown in Figure 1 The application scenario 100 according to this embodiment can include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 is a medium for providing a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 can include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.
[0032] The user can use the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 through the network 104 to receive or send messages, etc. Various communication client applications can be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103.
[0033] The first terminal device 101, the second terminal device 102, and the third terminal device 103 can be various electronic devices with display screens and supporting web browsing, including but not limited to smartphones, tablet computers, laptop computers, desktop computers, and the like.
[0034] The server 105 can be a server providing various services, such as a background management server supporting a website browsed by the user using the first terminal device 101, the second terminal device 102, and the third terminal device 103 (only as an example). The background management server can analyze and process received user requests and the like, and feed back the processing results (such as a webpage, information, or data, etc. obtained or generated according to the user request) to the terminal device.
[0035] For example, in the case of testing a hard disk in the server, the user can initiate a test instruction through any one of the first terminal device 101, the second terminal device 102, and the third terminal device 103, and in response to the test instruction, the server 105 can perform a test on the hard disk, for example, can be: according to the application scenario of the hard disk to be tested, write a plurality of data to the storage space in the hard disk to be tested; in the case where the storage address of the valid data in the plurality of data cannot be determined according to the storage mapping information, performing a predetermined number of reset operations on the hard disk to be tested, the starting time of the reset operation is determined according to the time of performing a predetermined deletion operation for invalid data in the plurality of data; determining the index value of the hard disk to be tested for a predetermined test index; determining the performance stability of the hard disk to be tested according to the index value.
[0036] It should be understood that Figure 1 the number of terminal devices, networks, and servers in may be any number according to the needs of implementation.
[0037] The following will describe the hard disk test method according to the embodiments of the present application based on the scenario described in Figure 1 . Figures 2-8 .
[0038] Figure 2 A flowchart of the hard disk test method according to the embodiments of the present application is shown.
[0039] As Figure 2As shown, the hard disk test of the embodiment includes operation S210~operation S240.
[0040] In operation S210, according to the application scenario of the hard disk to be tested, a plurality of data are written into the storage space in the hard disk to be tested.
[0041] In actual application scenarios, a hard disk (such as a solid state disk) is usually not run as an empty disk, but stores user's business data (such as database files, logs, cache data, etc.). Therefore, in order to make the test process more consistent with the actual application scenario, a plurality of data can be written into the storage space in the hard disk to be tested before the test is performed.
[0042] The plurality of data can include valid data and invalid data. The valid data can include data that needs to be retained for the solid state disk at present, which corresponds to the logical address written by the user through the host and not deleted or overwritten. The invalid data can include old data that needs not to be retained and is discarded by the user, for example, in the case where the user deletes a file or overwrites the old data with new data, the corresponding data becomes invalid.
[0043] In operation S220, in a case where the storage address of the valid data in the plurality of data cannot be determined according to the storage mapping information, a predetermined number of reset operations are performed on the hard disk to be tested. The starting time of the reset operation is determined according to the execution time of the predetermined deletion operation for the invalid data in the plurality of data.
[0044] In the actual use process of the hard disk, a predetermined deletion operation is often performed. The predetermined deletion operation can include deleting invalid data and releasing storage space. The predetermined deletion operation specifically includes, for example, a garbage collection (GC) operation. The garbage collection operation can be used to recycle invalid old data pages, write valid data in the to-be-recycled block into a new block, and then erase the invalid block to realize the recycling of the storage space. For a solid state disk, the flash memory cannot be directly overwritten, and must be erased before writing. For example, when there is a large amount of invalid data (such as deleted or overwritten old data) in the solid state disk, the valid data needs to be migrated to a new storage unit through the predetermined deletion operation, and the old storage unit containing invalid data needs to be erased to release the writable space.
[0045] The storage mapping information can represent a mapping relationship between valid data and its storage location. The related test method is usually tested under the ideal state that the storage address of the valid data can be determined according to the storage mapping information. When the deletion operation is performed, only the position of the valid data is directly determined according to the storage mapping information. However, in actual application scenarios, there may be a case that the storage address of the valid data cannot be determined according to the storage mapping information, for example, power failure may cause the storage mapping information to be lost, so that the position of the valid data cannot be determined based on the storage mapping information. By performing the reset operation in the case that the storage address of the valid data in the plurality of data cannot be determined according to the storage mapping information, the loss of the storage mapping information in the actual application scenario can be simulated, so that the test scenario is more consistent with the actual application scenario. For example, the entire server can be powered off and powered on, and accordingly all the hard disks to be tested on the server will be powered off and powered on, so that the storage mapping information is at least partially lost, so that the storage address of the valid data in the plurality of data cannot be determined according to the storage mapping information.
[0046] The reset operation can simulate a sudden abnormality (such as power failure, system failure, etc.) in the actual application environment, forcibly trigger the fault tolerance and recovery mechanism of the hard disk, and then verify the data security, recovery capability and long-term stability in extreme scenarios.
[0047] In actual application scenarios, the reset operation occurs frequently, for example, the server room may be frequently reset due to power fluctuations, cluster scheduling failures, etc., or reset due to user misoperation (such as frequent forced restart), system crash, etc. The reset operation may affect the data security, recovery capability and long-term stability of the hard disk, for example, the reset operation may interrupt the data interaction process, causing data loss or confusion, or affecting the data recovery speed. By performing the reset operation, it can be tested whether the hard disk can guarantee that the data is not lost, the equipment is not damaged, and the performance stability is maintained when encountering power failure and other sudden situations.
[0048] Optionally, the number of times of performing the reset operation can be set according to actual needs, for example, it can be set according to the application scenario of the hard disk to be tested. For example, when the hard disk to be tested is applied to a consumer scenario (such as a computer for ordinary users), the possibility of encountering a reset in the consumer scenario is relatively low, such as several times a year, so a lower frequency reset test can be set, such as a reset test with an execution frequency lower than a preset frequency threshold, for example, in the case of setting several hundred resets, it can usually cover the risk of use for several years. In the server scenario, the server room may occur tens of resets per month due to power fluctuations and other reasons, so a higher frequency reset test can be set, such as a reset test with an execution frequency greater than or equal to a preset frequency threshold, for example, several thousand resets are set.
[0049] Optionally, the reset operation can be performed in the process of performing the scheduled deletion operation, and the time point of performing the scheduled deletion operation can include time points at which the scheduled deletion operation is performed to different degrees. The starting time points of the scheduled number of reset operations can be different to correspond to the time points at which the scheduled deletion operation is performed to different degrees, so that the test process covers different degrees of the scheduled deletion operation, for example, can cover a plurality of cases such as encountering a reset operation when the storage unit has not moved data, or encountering a reset operation when the storage unit has moved data, and the like, so as to perform more comprehensive testing. After the storage mapping information is at least partially lost, a waiting time can be randomly determined before each reset operation is performed, and the reset operation is started after the waiting time is reached, so that the plurality of reset operations can correspond to the time points at which the scheduled deletion operation is performed to different degrees.
[0050] For example, the solid state disk is performing a scheduled deletion operation before power-off, and after recovery of power-on, the scheduled deletion operation is continued. A waiting time can be randomly selected, and the reset operation is performed after the waiting time is reached, so that the time point of performing the reset operation can cover the time points at which the scheduled deletion operation is performed to different degrees.
[0051] In operation S230, it is determined that the indicator value of the to-be-tested hard disk for the scheduled test indicator.
[0052] In operation S240, the performance stability of the to-be-tested hard disk is determined according to the indicator value.
[0053] Optionally, the scheduled test indicator can be used to evaluate the performance stability of the to-be-tested hard disk after performing the reset test, and the scheduled test indicator can include one or more, for example, including a data consistency indicator, a data integrity indicator, and the like. The scheduled test indicator can correspond to a preset indicator threshold, and in the case where the scheduled test indicator includes a plurality of indicators, each scheduled test indicator can correspond to a respective preset indicator threshold. The indicator value and the preset indicator threshold corresponding to the indicator value can be compared to determine whether the performance stability of the to-be-tested hard disk meets the standard, for example, in the case where the scheduled test indicator includes an error count indicator, the preset indicator threshold can be set to 0, and in the case where the indicator value of the to-be-tested hard disk for the error count indicator is still 0 after performing the scheduled number of reset operations on the to-be-tested hard disk, it indicates that the to-be-tested hard disk is relatively stable.
[0054] According to an embodiment of the present application, the application scenario of the hard disk to be tested is determined, and a plurality of data is written into the storage space in the hard disk to be tested. In the case where the storage address of the valid data in the plurality of data cannot be determined according to the storage mapping information, a predetermined number of reset operations are performed on the hard disk to be tested, and the starting time of the reset operation is determined according to the time when the predetermined deletion operation for the invalid data in the plurality of data is performed, so that the test scenario is more consistent with the actual use scenario of the hard disk, the test result is more referable, and the verification of the garbage collection strategy can be strengthened to ensure the reliability and stability of the hard disk when the hard disk frequently performs the reset operation. In addition, the test process can utilize the existing server environment and can be automated, thereby saving manpower, improving efficiency, and reducing test cost.
[0055] According to an embodiment of the present application, the application scenario of the hard disk to be tested is determined, and a plurality of data is written into the storage space in the hard disk to be tested. In the case where the storage address of the valid data in the plurality of data cannot be determined according to the storage mapping information, a predetermined number of reset operations are performed on the hard disk to be tested, and the starting time of the reset operation is determined according to the time when the predetermined deletion operation for the invalid data in the plurality of data is performed, so that the test scenario is more consistent with the actual use scenario of the hard disk, the test result is more referable, and the verification of the garbage collection strategy can be strengthened to ensure the reliability and stability of the hard disk when the hard disk frequently performs the reset operation. In addition, the test process can utilize the existing server environment and can be automated, thereby saving manpower, improving efficiency, and reducing test cost.
[0056] Since the actual physical structure of the solid state disk is relatively complex, for example, the solid state disk may actually have 8-16 channels, and each channel corresponds to dozens of flash memory blocks. In order to facilitate the description of the process of writing data, a simplified model of the solid state disk is described.
[0057] Figure 3 A schematic diagram of a simplified model of a solid state disk according to an embodiment of the present application is shown.
[0058] For example Figure 3 As shown, the simplified model of the solid state disk includes four channels, channel 0, channel 1, channel 2, and channel 3, each channel has six flash memory blocks, block 0, block 1, block 2, block 3, block 4, and block 5, a total of 24 flash memory blocks. Among them, each flash memory block has 9 small squares, and each small square corresponds to a logical page. Among the 24 flash memory blocks, it is assumed that the size of 20 flash memory blocks is the capacity of the solid state disk (as shown by the upper dashed box in the figure), that is, the size of the solid state disk seen by the host end, and the other 4 flash memory blocks are the reserved space exceeding the capacity of the solid state disk (as shown by the lower dashed box in the figure).
[0059] Figure 4 A schematic diagram of writing data into a solid state disk according to an embodiment of the present application is shown.
[0060] Figure 5 A schematic diagram of writing data into a solid state disk according to another embodiment of the present application is shown.
[0061] like Figure 4 As shown, four logical pages can be written sequentially. For example, the first data can be written sequentially on different channels, such as writing data to logical page 1 in channel 0, logical page 2 in channel 1, logical page 3 in channel 2, and logical page 4 in channel 3. Compared with writing through only a single channel, the underlying parallelism can be increased, improving write performance. This process can be implemented within the solid-state drive.
[0062] like Figure 5 As shown, data can continue to be written sequentially to the solid-state drive, for example, the first data can be written, until the entire solid-state drive capacity is full, thereby simulating the "long-term continuous writing of data" operation of the solid-state drive in an actual scenario.
[0063] Because all flash memory blocks inside the solid-state drive are free blocks before writing data, the sequential write commands issued in this case will write data into these free blocks in sequence, and no data will be overwritten or deleted, so all written data is valid data.
[0064] If all physical blocks of a solid-state drive are filled with valid data (i.e., there are no free blocks), continuing to write new data will result in invalid data. For example, if the second data includes data that is being written to a predetermined storage subspace, and if the storage space is full, continuing to write data to the predetermined storage subspace will cause the first data originally stored in the predetermined storage subspace (i.e., the first target data) to become invalid data.
[0065] Figure 6 A schematic diagram of writing second data into a predetermined storage subspace in a storage space according to an embodiment of the present application is shown.
[0066] like Figure 6 As shown, the reserved storage subspace may include logical pages 1 to 24 in the SSD capacity. If the SSD capacity is full, if the second data continues to be written sequentially to logical pages 1 to 24, since the SSD cannot overwrite, the second data will be written to the reserved space, and the data in the original location of logical pages 1 to 24 will be changed from a valid state to an invalid state, becoming invalid data.
[0067] Furthermore, when the amount of data written by the host is less than a complete flash block, the flash block is in an unstable state, so the flash block can be filled with data within a specific time (such as 2 hours, which can also be set according to actual needs). For example, the solid-state drive can be left idle for a period of time to allow the flash block to be filled. Figure 6 In the scenario of , most of the front of the flash memory block is invalid data, and the back is valid data.
[0068] Figure 7 A schematic diagram of writing second data into a predetermined storage subspace in a storage space according to another embodiment of the present application is shown.
[0069] The reserved storage subspace may also include logical pages 49 to 72 in the solid-state drive capacity. For example, after the solid-state drive is filled with data sequentially, if the second data is sequentially written into logical pages 49 to 72, the second data will be written into the reserved space because the solid-state drive cannot overwrite. The first data (i.e., the first target data) originally stored in logical pages 49 to 72 will be converted into invalid data. Accordingly, the solid-state drive may be left idle for a period of time to fill the flash memory block. Figure 7 In the scenario of , most of the back of the flash memory block is invalid data, and the front is valid data.
[0070] Figure 8 A flow chart of a hard disk testing method according to another embodiment of the present application is shown.
[0071] like Figure 8 As shown, the hard disk test of this embodiment includes operations S810 to S850.
[0072] In operation S810 , the storage space of the hard disk to be tested is filled with data.
[0073] In operation S820, address information corresponding to the predetermined storage subspace is determined.
[0074] In operation S830, second data is written to a predetermined storage subspace according to the address information.
[0075] In operation S840, the hard disk to be tested is left to stand for a period of time. For example, the hard disk to be tested can be left to stand for a period of time to allow the hard disk to be tested to complete the operation of filling data.
[0076] In operation S850, it is determined whether the hard disk under test has executed a predetermined deletion operation. If it is determined that the hard disk under test has begun executing the predetermined deletion operation, the operation of writing the second data may be terminated. If it is determined that the hard disk under test has not yet begun executing the predetermined deletion operation, operations such as determining the address information and writing the second data may be continued to trigger the predetermined deletion operation.
[0077] According to an embodiment of the present application, based on the application scenario of the hard disk to be tested, writing the second data to a predetermined storage subspace in the storage space includes: determining address information corresponding to the predetermined storage subspace based on the application scenario; and writing the second data to the predetermined storage subspace based on the address information.
[0078] The address information can represent a position in the storage space from which data is written. For example, an offset parameter can be determined according to an actual application scenario, where the offset parameter is used to specify a position in the storage space from which data is written. For example, if the offset parameter is equal to 100 MB, it can mean that data is written from the 100th MB of the solid state disk.
[0079] Further, a suitable data size parameter can also be set according to the application scenario, where the data size parameter is used to represent the total amount of data written. For example, if the data size parameter is 50 MB, it means that the total capacity of the data written this time is 50 MB.
[0080] For example, a benchmarking tool can be used to sequentially fill the storage space of the solid state disk, and then a suitable offset parameter and data size parameter are selected to continue writing data to the solid state disk, so that invalid data is generated at different positions in the storage space, and the data filling condition of the solid state disk is more matched to the actual application scenario.
[0081] According to an embodiment of the present application, the address information corresponding to the predetermined storage sub-space is determined according to the application scenario, including: in the case where the application scenario includes persistent storage data, the address information includes first address information corresponding to a starting region of the storage space.
[0082] In the case where data is stored in logical order, data written first is usually in the front region of the storage space, and data written later is usually in the rear region of the storage space. In the case of persistent storage data, data is usually valid for a long time and has a low update frequency. When some old data needs to be updated, new data will preferentially overwrite the logical position of the old data, causing the front region of the storage space to be prone to invalid data. Therefore, in the case where the application scenario of the to-be-tested hard disk is used for persistent storage data, the first address information of the starting region of the storage space, i.e., the first address information of the starting region, can be used as the address information corresponding to the predetermined storage sub-space. For example, for application scenarios such as databases and file servers, the address information can include first address information corresponding to the starting region of the storage space.
[0083] According to an embodiment of the present application, the address information corresponding to the predetermined storage sub-space is determined according to the application scenario, including: in the case where the application scenario includes real-time cache data, the address information includes second address information corresponding to a terminal region of the storage space.
[0084] In the scenario of real-time cache data, the data is usually valid for a short period of time and has a high update frequency. In this case, new data is continuously written to the rear, occupying new logical addresses. In the case where the storage space has been written full, the new data can directly overwrite the old data stored at the last position, causing the old data behind to become invalid data. Therefore, in the case where the application scenario of the to-be-tested hard disk is used for real-time cache data, the rear area of the storage space, i.e., the second address information corresponding to the termination area of the storage space, can be used as the address information corresponding to the predetermined storage sub-space.
[0085] According to the invalid data distribution characteristics of different application scenarios, the address information is set correspondingly, which can make the test scenario closer to the real scenario, so as to accurately evaluate the performance stability of the solid state disk in actual application.
[0086] According to an embodiment of the present application, the hard disk testing method further comprises: performing a forced interruption operation on the to-be-tested hard disk, so that the storage address of the valid data in the storage mapping information is at least partially lost, wherein in the case where the storage mapping information is at least partially lost, the storage address of the valid data in the plurality of data cannot be determined according to the storage mapping information.
[0087] The forced interruption operation can include forcibly terminating the normal operation of the solid state disk by external force. The forced interruption operation will cause the storage mapping information of the solid state disk to fail to be normally saved or to be directly destroyed. Specifically, the storage mapping information of the solid state disk is usually temporarily stored in the cache and is periodically synchronized to the permanent storage area of the flash memory. The forced interruption will break this process. For example, if the interruption occurs after the mapping information is updated but before it is synchronized to the permanent storage (such as suddenly powering off while modifying a mapping relationship), the latest mapping information in the cache will be lost, and only the old version before the interruption will be retained, thereby causing the storage mapping information to be at least partially lost, such as causing the mapping relationship of a certain segment of logical addresses to be lost, or causing the structure of the entire storage mapping information to be destroyed.
[0088] Since the storage mapping information is the only basis for the solid state disk to identify valid data, in the normal case, the solid state disk needs to quickly locate the valid data through the storage mapping information. If the storage mapping information is at least partially lost or invalid, the solid state disk cannot determine the storage address of the valid data according to the storage mapping information.
[0089] According to an embodiment of the present application, the forced interruption operation includes at least one of the following: a power-off operation, a firmware reset operation, and a data erasing operation.
[0090] By performing the power-off operation, a situation that a solid state disk is suddenly powered off due to power failure or accidental plugging in an actual application scenario can be simulated. Specifically, since the storage mapping information of the solid state disk is usually temporarily stored in the cache and periodically synchronized to the permanent storage area of the flash memory, after the power-off operation is performed, the latest mapping information in the cache that has not been synchronized will be directly lost, and if the power-off is at the process of writing the storage mapping information to the flash memory, the stored mapping information in the flash memory can be destroyed.
[0091] The firmware reset operation can include forcibly restarting the hard disk firmware by a software command or a hardware signal, which can cause a forced interruption at a logical level of the hard disk. The firmware running interruption can cause the updating task of the storage mapping information being processed to be abnormally terminated (for example, only half of a mapping relationship is updated), or part of the mapping information cache temporarily stored in the firmware memory can be emptied, which can cause this part of information to be lost if not written to the flash memory in time. By performing the firmware reset operation, a drive restart, controller reset, and the like in an actual application scenario can be simulated, so as to test the mapping information integrity of the hard disk when abnormally recovering at a logical level.
[0092] The data erasing operation can also cause the storage mapping information to be lost. The data erasing operation can include performing a quick erasing or targeted erasing of the metadata area, so that the area where the storage mapping information is stored is directly deleted or destroyed, thereby causing the storage address of the valid data in the plurality of data to be unable to be determined according to the storage mapping information. The data erasing operation can simulate extreme situations such as accidental erasing and malicious destruction of metadata in an actual application scenario, and test the recovery capability of the hard disk after the core metadata is directly destroyed.
[0093] In an actual application scenario, unexpected power-off, hardware failure, and the like can occur, and related test methods are usually performed in an ideal state where the storage mapping information is complete. Compared with the related test methods, by forcibly interrupting the operation so that the storage address of the valid data in the storage mapping information is at least partially lost, a process that the storage mapping information of the hard disk can be damaged due to unexpected situations such as power-off in an actual application scenario can be simulated, so that it can be evaluated whether the hard disk can re-identify the valid data through its own mechanism (such as full flash memory scanning, checksum verification) when the valid data cannot be found according to the storage mapping information, and whether the data identification will be confused (such as deleting valid data by mistake, regarding invalid data as valid data) due to frequent reset operations when the storage address of the valid data in the plurality of data cannot be determined according to the storage mapping information; in addition, it can be evaluated whether the pre-deletion operation will be stuck due to low full scanning efficiency or the data of the entire block will be lost due to a judgment error when there is no storage mapping information guidance, and thus the test process can be consistent with the actual application scenario, and the referenceability of the test result is higher.
[0094] According to an embodiment of the present application, the predetermined deletion operation comprises: reading the plurality of data in the storage space one by one; identifying the invalid data in the plurality of data one by one; and performing a cleaning operation on the invalid data.
[0095] After the storage address of the valid data in the storage mapping information is at least partially lost by the forced interruption operation, the storage location of the valid data can no longer be determined based on the storage mapping information, and thus when the predetermined deletion operation is performed, all information in the flash memory block needs to be read out and it is determined which is valid data and which is invalid data, for example: the plurality of data in the storage space can be read one by one, such as reading the data in the physical flash memory one by one flash memory block or one by one logical page; then the invalid data in the plurality of data is identified one by one through the logical block address tag carried by the data, wherein in the case where the logical block address tag has been overwritten by new data, the data in the current physical page is invalid data; then the identified valid data is moved to a new free space, and the old space containing the invalid data is erased, thereby releasing the storage space occupied by the invalid data, while protecting the valid data from being lost.
[0096] In the case where the storage mapping information is invalid, when the predetermined deletion operation is performed, the data needs to be read one by one and it is determined whether the data is valid, which will cause the speed of the predetermined deletion operation to be slow and resources to be occupied, at this time, if the reset action occurs frequently, the reliability requirement of the hard disk is higher, thereby the performance stability of the hard disk under the condition of invalid storage mapping information and frequent reset can be tested, the test scenario is more practical, and the reference degree of the test result is higher.
[0097] According to an embodiment of the present application, the predetermined test index comprises at least one of the following: a data validity index, an operation performance stability index, and a storage space performance index.
[0098] The predetermined test index can be used to evaluate the performance stability of the hard disk to be tested, for example: the data validity index can be used to evaluate whether the hard disk can protect valid data, for example: the data validity index can specifically include a data consistency index and a data integrity index, the data consistency index can represent whether the logical relationship of the valid data in the hard disk can still be correct after the storage mapping information is lost and the reset is frequent, for example: whether the contents before and after a file are in order, whether the fields of a database record correspond; the data integrity index can represent whether the valid data is tampered with or damaged, for example: whether there is garbled code, etc.
[0099] The operation performance stability index can specifically include a parallel write efficiency index and a read-write performance index. The parallel write efficiency index can represent whether the multi-channel parallel write capability of the hard disk is reduced in the case of loss of the storage mapping information and frequent resets. The read-write performance index can represent whether the read-write delay and the continuous write throughput are stable when the hard disk reconstructs the mapping through full-scan after the loss of the storage mapping information. For example, the read-write times per second and the throughput curve before and after power failure can be constructed, and the read-write performance index can be evaluated by whether the curve shows a cliff-like drop or frequent fluctuations.
[0100] The storage space performance index can also be used to evaluate whether the hard disk will crash in the case of long-term use. For example, if the number of bad blocks increases after a predetermined number of reset operations are performed, or if the reserved reserved space is excessively consumed (e.g., the reserved space rapidly decreases), it indicates that the hard disk is difficult to cope with long-term wear and tear, and accordingly, the hard disk can have a low index value for the storage space performance index.
[0101] Through the data validity index, the operation performance stability index, and the storage space performance index, the performance stability of the hard disk to be tested can be evaluated from multiple dimensions and more comprehensively.
[0102] According to an embodiment of the present application, the hard disk testing method further includes: obtaining a plurality of candidate hard disks for testing; performing initial state testing on the plurality of candidate hard disks based on a preset initial testing index, determining the index value of the plurality of candidate hard disks for the preset initial testing index, and obtaining an initial testing result; and in the case where the initial state testing result represents that the initial state of the candidate hard disk is normal, taking the candidate hard disk as the hard disk to be tested.
[0103] For example, a solid state disk can be installed in a server according to the maximum support quantity or the maximum capacity upper limit of the hardware design of the server, so that the storage configuration of the server reaches a saturated state. The candidate hard disk can include all solid state disks installed on the server.
[0104] Before testing the performance reliability, the candidate hard disk can be subjected to initial state testing to determine whether the candidate hard disk itself has an abnormality. If the hard disk itself has an abnormality (e.g., has bad blocks out of the factory, or is aged due to long running time) before testing the performance reliability, in the case where the test result of the performance reliability test is abnormal, it can be caused by the abnormality of the hard disk itself rather than the case where the predetermined number of reset operations are performed on the hard disk to be tested without determining the storage addresses of the valid data in the plurality of data according to the storage mapping information, and thus the accurate cause of the abnormal test result cannot be determined.
[0105] The initial test result can include an index value of the candidate hard disk for a preset initial test index. In a case where the initial state test result indicates that the initial state of the candidate hard disk is normal, it is indicated that the candidate hard disk itself does not have an abnormality, and therefore the candidate hard disk can be used as the to-be-tested hard disk.
[0106] According to an embodiment of the present application, the preset initial test index includes at least one of a read-write performance index, an abnormal event index, and a running stability index.
[0107] Optionally, the read-write performance index can specifically include a read-only index and a bandwidth rate index. The read-write performance index can evaluate the basic read-write function and efficiency of the hard disk. For example, if the hard disk enters a read-only mode, it means that the write operation cannot be performed, but the test process needs to perform an operation such as data migration that depends on the write function. Therefore, the candidate hard disk in the read-only mode can be excluded. In a case where the bandwidth rate is low, it is indicated that the hard disk itself may have some problems. If the hard disk with a low bandwidth rate is used as the to-be-tested hard disk, it is difficult to determine whether the low bandwidth rate is caused by the hard disk itself or the test process when the performance stability test result indicates that the bandwidth rate of the hard disk is low. Therefore, the candidate hard disk with a bandwidth rate lower than a preset bandwidth rate threshold can be excluded in advance. The preset bandwidth rate threshold can be set according to actual conditions.
[0108] The abnormal event index can evaluate whether the hard disk has a potential hardware or firmware defect. For example, in a case where the error count is greater than zero, it is indicated that the hard disk has a hardware defect (such as a flash memory particle defect or a controller failure) in the process of manufacturing or transportation. If the hard disk with the hardware defect is used for subsequent tests, the defect may be amplified in subsequent tests such as forced interruption and frequent reset, such as a sharp increase in the error count, so that it is difficult to distinguish whether the problem is caused by the test operation or the defect of the hard disk itself, and the test result loses reference significance.
[0109] The running stability index can evaluate the historical wear and use intensity of the hard disk, which can specifically include a read-write data volume index and a running time index. In a case where the read-write data volume has reached or approached an upper limit, or in a case where the running time is long (such as longer than a running time threshold set according to actual needs), it is indicated that the aging degree of the hard disk itself is high, which can interfere with subsequent tests, so that it is difficult to distinguish whether the problem is caused by the test operation or the aging of the hard disk itself.
[0110] According to an embodiment of the present application, the reset operation includes at least one of interrupting a current task, releasing a temporary resource, and resetting to an initial state of the hard disk.
[0111] By interrupting the current task, all tasks being executed can be forcibly terminated, such as forcibly terminating a scheduled deletion operation in progress, etc. During the running of the hard disk, various temporary resources are occupied, and the temporary resources can be released by a reset operation, such as releasing cache resources, lock resources (some storage units are locked during task execution to prevent concurrent operation conflicts), etc. The initial state of the hard disk can include a working state in which the hard disk can be normally recognized by the host and receive instructions, and resetting to the initial state of the hard disk can include abandoning the current unfinished task, such as abandoning data moving, flash block erasing, etc. operations being executed before the reset; and restoring the basic response capability, such as the hard disk must be re-recognized by the host after the reset.
[0112] By frequently interrupting the current task, it can be tested whether the hard disk has a state inconsistency problem after task interruption; by frequently releasing temporary resources, it can be tested whether the resource release of the hard disk is complete and whether there are small residues (such as 1 byte of cache not released), etc. By frequently resetting to the initial state of the hard disk, the consistency of the hard disk state reset and the hardware compatibility can be verified, and thus the performance stability of the hard disk in multiple dimensions can be comprehensively tested.
[0113] Based on the above hard disk testing method, the application further provides a hard disk testing device. The following will be described in detail in combination with Figure 9 the device.
[0114] Figure 9 The structure block diagram of the hard disk testing device according to the embodiment of the application is shown.
[0115] As Figure 9 shown, the hard disk testing device 900 of the embodiment includes a writing module 910, a reset module 920, a first determining module 930, and a second determining module 940.
[0116] The writing module 910 is configured to write a plurality of data into a storage space in a hard disk to be tested according to an application scenario of the hard disk to be tested. In an embodiment, the writing module 910 can be configured to perform the operation S210 described above, and details are not repeated here.
[0117] The reset module 920 is configured to perform a predetermined number of reset operations on the hard disk to be tested in a case where the storage address of the valid data in the plurality of data cannot be determined according to the storage mapping information, and the starting time of the reset operation is determined according to the execution time of the scheduled deletion operation for the invalid data in the plurality of data. In an embodiment, the reset module 920 can be configured to perform the operation S220 described above, and details are not repeated here.
[0118] The first determining module 930 is configured to determine the index value of the to-be-tested hard disk for the predetermined test index. In an embodiment, the first determining module 930 can be configured to perform the operation S230 described above, and details are not repeated here.
[0119] The second determining module 940 is configured to determine the performance stability of the to-be-tested hard disk according to the index value. In an embodiment, the second determining module 940 can be configured to perform the operation S240 described above, and details are not repeated here.
[0120] According to an embodiment of the present application, the writing module comprises a first writing sub-module and a second writing sub-module.
[0121] The first writing sub-module is configured to write the first data into the storage space until the storage space reaches a full state and the first data is temporarily in a valid state and temporarily belongs to valid data. The second writing sub-module is configured to write the second data into a predetermined storage sub-space in the storage space according to the application scenario of the to-be-tested hard disk, so that the first target data in the predetermined storage sub-space is changed from the valid state to the invalid state, wherein the first target data changed to the invalid state belongs to invalid data.
[0122] According to an embodiment of the present application, the second writing sub-module comprises a determining unit and a writing unit.
[0123] The determining unit is configured to determine the address information corresponding to the predetermined storage sub-space according to the application scenario. The writing unit is configured to write the second data into the predetermined storage sub-space according to the address information.
[0124] According to an embodiment of the present application, the hard disk testing device further comprises an interrupting module configured to perform a forced interrupting operation on the to-be-tested hard disk, so that the storage address of the valid data in the storage mapping information is at least partially lost, wherein in the case that the storage mapping information is at least partially lost, the storage address of the valid data in the plurality of data cannot be determined according to the storage mapping information.
[0125] According to an embodiment of the present application, the determining unit comprises a first determining sub-unit and a second determining sub-unit.
[0126] The first determining sub-unit is configured to determine that the address information comprises the first address information corresponding to the starting region of the storage space in the case that the application scenario comprises persistent storage data. The second determining sub-unit is configured to determine that the address information comprises the second address information corresponding to the ending region of the storage space in the case that the application scenario comprises real-time cache data.
[0127] According to an embodiment of the present application, the hard disk testing device further comprises an obtaining module and an initial state testing module.
[0128] The acquisition module is configured to acquire a plurality of candidate hard disks for testing; the initial state testing module is configured to perform initial state testing on the plurality of candidate hard disks based on a preset initial testing index, determine index values of the plurality of candidate hard disks for the preset initial testing index, and obtain an initial testing result; and in a case where the initial state testing result indicates that the initial state of the candidate hard disk is normal, the candidate hard disk is taken as a hard disk to be tested.
[0129] According to an embodiment of the present application, the hard disk testing device further comprises a predetermined deletion module, which comprises a reading sub-module, an identifying sub-module, and a cleaning operation sub-module.
[0130] The reading sub-module is configured to read the plurality of data in the storage space one by one; the identifying sub-module is configured to identify the invalid data in the plurality of data one by one; and the cleaning operation sub-module is configured to perform a cleaning operation on the invalid data.
[0131] According to an embodiment of the present application, the reset operation comprises at least one of interrupting a current task, releasing a temporary resource, and resetting to an initial state of the hard disk.
[0132] According to an embodiment of the present application, any of the write module 910, the reset module 920, the first determination module 930, and the second determination module 940 can be combined in one module for implementation, or any of the modules can be split into multiple modules. Alternatively, at least part of the function of one or more of the modules can be combined with at least part of the function of the other modules, and implemented in one module. According to an embodiment of the present application, at least one of the write module 910, the reset module 920, the first determination module 930, and the second determination module 940 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on chip, a system on board, a system on package, an application specific integrated circuit (ASIC), or any other reasonable manner of integrating or packaging a circuit, etc. hardware or firmware, or in any one of software, hardware, and firmware or in an appropriate combination of any of them. Alternatively, at least one of the write module 910, the reset module 920, the first determination module 930, and the second determination module 940 can be at least partially implemented as a computer program module that can perform corresponding functions when the computer program module is run.
[0133] Figure 10 A block diagram of an electronic device suitable for implementing the hard disk testing method according to an embodiment of the present application is shown.
[0134] As Figure 10As shown, the electronic device 1000 according to an embodiment of the present application includes a processor 1001, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage unit 1008 into a random access memory (RAM) 1003. The processor 1001 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 1001 may also include onboard memory for caching purposes. The processor 1001 may include a single processing unit or multiple processing units for performing different actions of the method flow according to the embodiment of the present application.
[0135] Various programs and data required for the operation of the electronic device 1000 are stored in the RAM 1003. The processor 1001, the ROM 1002, and the RAM 1003 are connected to each other via a bus 1004. The processor 1001 performs various operations of the method flow according to the embodiment of the present application by executing the programs in the ROM 1002 and / or the RAM 1003. It should be noted that the program can also be stored in one or more memories other than the ROM 1002 and the RAM 1003. The processor 1001 can also perform various operations of the method flow according to the embodiment of the present application by executing the programs stored in the one or more memories.
[0136] According to an embodiment of the present application, electronic device 1000 may further include an input / output (I / O) interface 1005, which is also connected to bus 1004. Electronic device 1000 may also include one or more of the following components connected to I / O interface 1005: an input section 1006 including a keyboard, mouse, etc.; an output section 1007 including devices such as a cathode ray tube (CRT), liquid crystal display (LCD), and speakers; a storage section 1008 including a hard disk; and a communication section 1009 including a network interface card such as a LAN card or modem. Communication section 1009 performs communication processing via a network such as the Internet. A drive 1010 is also connected to I / O interface 1005 as needed. Removable media 1011, such as a magnetic disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed in drive 1010 as needed, so that computer programs read from the removable media can be installed into storage section 1008 as needed.
[0137] The application further provides a computer readable storage medium, which can be included in the device / apparatus / system described in the above embodiments, or can exist independently without being assembled into the device / apparatus / system. The computer readable storage medium carries one or more programs, which, when executed, implement the method according to the embodiments of the application.
[0138] According to the embodiments of the application, the computer readable storage medium can be a non-volatile computer readable storage medium, which can include, but is not limited to, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any appropriate combination thereof. In this application, a computer readable storage medium can be any tangible medium that contains or stores a program for use by or in connection with an instruction execution system, apparatus, or device. For example, in the embodiments of the application, a computer readable storage medium can include one or more of the above-described ROM 1002 and / or RAM 1003 and / or one or more memories other than the ROM 1002 and the RAM 1003.
[0139] The embodiments of the application also include a computer program product, which includes a computer program containing program codes for executing the methods shown in the flowcharts. When the computer program product is run in a computer system, the program codes are used to make the computer system implement the methods provided by the embodiments of the application.
[0140] The above functions defined in the system / apparatus of the embodiments of the application are performed when the computer program is executed by the processor 1001. According to the embodiments of the application, the above-described system, apparatus, module, unit, etc. can be implemented by computer program modules.
[0141] In one embodiment, the computer program can rely on a tangible storage medium such as an optical storage device, a magnetic storage device, etc. In another embodiment, the computer program can also be transmitted, distributed, and downloaded in the form of a signal on a network medium, and be downloaded and installed through the communication part 1009 and / or installed from the detachable medium 1011. The program codes contained in the computer program can be transmitted by any appropriate network medium, including but not limited to wireless, wired, etc., or any appropriate combination thereof.
[0142] In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 1009, and / or installed from the removable medium 1011. When the computer program is executed by the processor 1001, the above-mentioned functions defined in the system of the embodiment of the present application are performed. According to the embodiment of the present application, the systems, devices, means, modules, units, etc. described above can be implemented by computer program modules.
[0143] According to an embodiment of the present application, the program code for executing the computer program provided by the embodiment of the present application can be written in any combination of one or more programming languages. Specifically, these computer programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, languages such as Java, C++, Python, "C" or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect via the Internet).
[0144] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the above-mentioned module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of the boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0145] Those skilled in the art will appreciate that the features described in the various embodiments of this application may be combined and / or coupled in various ways, even if such combinations or couplings are not explicitly described in this application. In particular, the features described in the various embodiments of this application may be combined and / or coupled in various ways without departing from the spirit and teachings of this application. All such combinations and / or couplings fall within the scope of this application.
[0146] The embodiments of the application have been described above. However, these embodiments are merely meant to be illustrative, and not meant to limit the scope of the application. Although each of the embodiments has been described above, this does not mean that measures in each of the embodiments cannot be advantageously used in combination. Various substitutions and modifications can be made by those skilled in the art without departing from the scope of the application, and these substitutions and modifications should all fall within the scope of the application.
Claims
1. A hard disk testing method, characterized in that: The method comprises: Writing first data into the storage space of the hard disk to be tested until the storage space is full, wherein the first data is temporarily in a valid state and is temporarily valid data; Determine, according to an application scenario of the hard disk to be tested, address information corresponding to a predetermined storage subspace in the storage space, and write second data to the predetermined storage subspace according to the address information, so that first target data in the predetermined storage subspace is changed from the valid state to the invalid state, wherein the first target data changed to the invalid state is invalid data, wherein the application scenario includes one of the following: a scenario in which the hard disk to be tested is used for persistent data storage, and a scenario in which the hard disk to be tested is used for real-time data caching; In the case that the storage address of the valid data cannot be determined according to the storage mapping information, performing a predetermined number of reset operations on the hard disk to be tested, wherein the starting time of the reset operation is determined according to the execution time of the predetermined deletion operation for the invalid data among the multiple data, wherein the predetermined deletion operation execution time includes the time when the predetermined deletion operation reaches different progress; Determining an indicator value of the hard disk to be tested for a predetermined test indicator; The performance stability of the hard disk to be tested is determined according to the indicator value.
2. The method according to claim 1, characterized in that The determining, according to the application scenario, address information corresponding to the predetermined storage subspace includes: In a case where the application scenario includes persistent storage of data, it is determined that the address information includes first address information corresponding to a starting area of the storage space.
3. The method according to claim 2, characterized in that The determining, according to the application scenario, address information corresponding to the predetermined storage subspace includes: In a case where the application scenario includes real-time cache data, it is determined that the address information includes second address information corresponding to a termination area of the storage space.
4. The method according to claim 1, wherein The method further comprises: A forced interrupt operation is performed on the hard disk to be tested so that the storage addresses of the valid data in the storage mapping information are at least partially lost, wherein when the storage mapping information is at least partially lost, the storage addresses of the valid data in the multiple data cannot be determined based on the storage mapping information.
5. The method according to claim 4, characterized in that The forced interruption operation includes at least one of the following: a power-off operation, a firmware reset operation, and a data erasing operation.
6. The method according to claim 1, characterized in that The predetermined test indicator includes at least one of the following: a data validity indicator, an operation performance stability indicator, and a storage space performance indicator.
7. The method according to claim 1, characterized in that The method further comprises: Obtain multiple candidate hard drives for testing; Performing an initial status test on the multiple candidate hard disks based on a preset initial test indicator, determining indicator values of the multiple candidate hard disks for the preset initial test indicator, and obtaining an initial test result; When the initial state test result indicates that the initial state of the candidate hard disk is normal, the candidate hard disk is used as the hard disk to be tested.
8. The method according to claim 7, characterized in that The preset initial test indicators include at least one of the following: a read / write performance indicator, an abnormal event indicator, and an operation stability indicator.
9. The method according to claim 1, characterized in that The scheduled deletion operation includes: Reading the plurality of data in the storage space one by one; Identifying invalid data from the plurality of data one by one; A cleaning operation is performed on the invalid data.
10. The method according to claim 1, characterized in that The reset operation includes at least one of the following: interrupting the current task, releasing temporary resources, and resetting the hard disk to an initial state.
11. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instruction is executed by a processor, the steps of the method according to any one of claims 1 to 10 are implemented.
12. An electronic device comprising: one or more processors; a memory for storing one or more computer programs, It is characterized in that the one or more processors execute the one or more computer programs to implement the steps of the method according to any one of claims 1 to 10.
13. A computer-readable storage medium having a computer program or instruction stored thereon, characterized in that: When the computer program or instruction is executed by a processor, the steps of the method according to any one of claims 1 to 10 are implemented.
Citation Information
Patent Citations
Method and device for testing reset capability of NVME SSD controller, computer equipment and storage medium
CN115657828A
Solid state disk performance fluctuation test method, device and equipment and storage medium
CN120236639A