Hard disk test method and device, storage medium and program product
By writing multiple data in the hard disk and simulating reset operations, the shortcomings of hard disk performance stability testing in the prior art are solved in the ideal state, and more accurate performance evaluation and data security verification are achieved.
Patent Information
- Application Number
- CN202511055554.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-30
- Publication Date
- 2025-08-29
- Estimated Expiration
- 2045-07-30
AI Technical Summary
The existing hard disk performance stability testing methods are mostly carried out under ideal conditions, which is difficult to reflect the hard disk performance stability in actual application scenarios, especially in the case of frequent reset operations, which may lead to hardware or system failures.
According to the application scenario of the hard disk, multiple data are written to the storage space, and the reset operation is simulated when the valid data storage address cannot be determined. Reset is triggered by a predetermined deletion operation to determine the performance stability indicators.
The test results are more in line with practical application scenarios, and can evaluate the performance stability and data security of the hard disk under reset operation, and improve the reference and efficiency of the test.
Smart Images

Figure CN120560918A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data storage technology, and more specifically to a hard disk testing method, device, storage medium, and program product. Background Art
[0002] A reset operation restores a solid-state drive to a specific initial state, equivalent to uninstalling and then reloading the driver. A hard drive's performance stability determines whether it can recover reliably and safely after a reset without causing additional hardware or system failures. However, most hard drive performance stability testing methods are conducted under ideal conditions and are difficult to reflect in real-world scenarios. Summary of the Invention
[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 the first aspect of the present application, a hard disk testing method is provided, comprising: writing multiple data to the storage space in the hard disk to be tested according to the application scenario of the hard disk to be tested; in a case where the storage address of valid data among the multiple data cannot be determined according to the storage mapping information, performing a predetermined number of reset operations on the hard disk to be tested, and the starting time of the reset operation is determined according to the execution time of a predetermined deletion operation for invalid data among the multiple data; determining the index value of the hard disk to be tested for a predetermined test index; and determining the performance stability of the hard disk to be tested according to the index value.
[0005] The second aspect of the present application further provides a computer program product, comprising a computer program or instructions, which implement the steps of the above method when the computer program or instructions are executed by a processor.
[0006] The 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] The fourth aspect of the present application further provides a computer-readable storage medium having a computer program or instructions stored thereon, which implements the steps of the above method when the computer program or instructions are executed by a processor. BRIEF DESCRIPTION OF THE DRAWINGS
[0008] The above contents and other objects, features and advantages of the present application will become more apparent through the following description of the embodiments of the present application with reference to the accompanying drawings, in which:
[0009] Figure 1The following diagram shows an application scenario of a hard disk testing method, device, storage medium, and program product according to an embodiment of the present application.
[0010] Figure 2 A flow chart of a 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 drive according to an embodiment of the present application is shown.
[0012] Figure 4 A schematic diagram of writing data into a solid state drive according to an embodiment of the present application is shown.
[0013] Figure 5 A schematic diagram of writing data into a solid state drive according to another embodiment of the present application is shown.
[0014] 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.
[0015] 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.
[0016] Figure 8 A flow chart of a hard disk testing method according to another embodiment of the present application is shown.
[0017] Figure 9 The figure shows a structural block diagram of a hard disk testing device according to an embodiment of the present application.
[0018] Figure 10 A block diagram of an electronic device suitable for implementing a 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. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present application. In the detailed description below, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present application. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessarily confusing the concepts of the present application.
[0020] The terms used herein are only for describing specific embodiments and are not intended to limit the present application. The terms "comprise," "include," etc. used herein indicate the presence of features, steps, operations, and / or components, but do not exclude the presence 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 those skilled in the art unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.
[0022] When expressions such as "at least one of A, B, and C, etc." are used, they should generally be interpreted in accordance with the meaning commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).
[0023] For Solid State Drives (SSDs), such as Non-Volatile Memory Express (NVMe SSDs), a reset operation is an operation used to restore the SSD to a specific initial state, which is equivalent to unloading and then reloading the driver. The reset operation is usually triggered under abnormal circumstances. For example, in a scenario where an SSD is used to store or cache data, the SSD may be frequently reset due to machine failure (such as frequent restarts without reason) or application abnormalities during business deployment. Alternatively, when a large pressure load is encountered during business execution, the SSD may time out due to insufficient SSD resources. At this time, the host will actively issue a reset operation to reset the SSD. Furthermore, if the business pressure remains high, the host will also issue a reset operation for the SSD if it detects that the SSD has timed out for a certain period of time.
[0024] The performance stability of the hard drive itself can affect the ability of hard drive services to recover from anomalies. If the hard drive's performance stability is low, a reset operation may prevent the driver from being properly loaded after uninstallation, or the hard drive may not be properly recognized after a server restart, even causing a server crash.
[0025] Related methods for testing hard disk performance stability include testing methods that include input / output (IO) operations and testing methods that do not include IO operations.
[0026] For testing methods involving input / output operations, the hard drive can utilize a benchmark test tool to issue a reset command to the hard drive at regular intervals while performing sequential or random writes to the hard drive. This allows the hard drive to be unloaded and then reloaded. The hard drive can then be monitored for a long period of time to test the performance stability of the solid-state drive under reset operations.
[0027] For test methods that do not include input / output operations, the hard disk uses a benchmark test tool to perform sequential or random writes on the hard disk first, and then no read or write commands are issued. Accordingly, at regular intervals, a reset command is issued to the hard disk to unload the hard disk drive, and then the hard disk drive is reloaded. The solid-state drive is monitored for a long time to verify its performance stability under the reset operation.
[0028] However, the above-mentioned testing methods are mostly conducted under ideal conditions, which are difficult to reflect the performance stability of hard disks in actual application scenarios. For example, in the actual application scenarios of solid-state drives, most of the data stored in the hard disk is actual business data (such as database files, logs, documents, etc.), rather than temporary test data generated by testing tools. The structure, distribution, and access history of actual business data are essentially different from the random / sequential write test data of the testing tools (for example, actual business data may have characteristics such as frequent overwriting, fragmentation, and long-term static status); and, in actual application scenarios, solid-state drives may face unexpected power outages, device restarts, etc.
[0029] In view of this, an embodiment of the present application provides a hard disk testing method, including: writing multiple data to the storage space in the hard disk to be tested according to the application scenario of the hard disk to be tested; in the case that the storage address of the valid data among the multiple data cannot be determined according to the storage mapping information, performing a predetermined number of reset operations on the hard disk to be tested, and 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; determining the index value of the hard disk to be tested for the predetermined test index; and determining the performance stability of the hard disk to be tested according to the index value.
[0030] Figure 1 The following diagram shows an application scenario of a hard disk testing method, device, storage medium, and program product according to an embodiment of the present application.
[0031] like Figure 1 As shown, the application scenario 100 according to this embodiment may 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 used as 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 may include various connection types, such as wired or wireless communication links or optical fiber cables.
[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 via 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 may be various electronic devices having display screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.
[0034] The server 105 may be a server that provides various services, such as a background management server (for example only) that supports websites browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 103. The background management server may analyze and process received data such as user requests, and feed back processing results (e.g., web pages, information, or data obtained or generated based on user requests) to the terminal devices.
[0035] For example, when it is necessary to test the 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. In response to the above test instruction, the server 105 can perform a test on the hard disk, for example: according to the application scenario of the hard disk to be tested, multiple data are written to the storage space in the hard disk to be tested; when the storage address of the valid data among the multiple 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 execution time of the predetermined deletion operation for the invalid data among the multiple data; the index value of the hard disk to be tested for the predetermined test index is determined; and the performance stability of the hard disk to be tested is determined according to the index value.
[0036] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is merely illustrative. Any number of terminal devices, networks and servers may be provided as required.
[0037] The following will be based on Figure 1 The scene described by Figures 2 to 8 The hard disk testing method according to the embodiment of the present application is described in detail.
[0038] Figure 2 A flow chart of a hard disk testing method according to an embodiment of the present application is shown.
[0039] like Figure 2As shown, the hard disk test of this embodiment includes operations S210 to S240.
[0040] In operation S210 , a plurality of data are written into a storage space of the hard disk to be tested according to an application scenario of the hard disk to be tested.
[0041] In actual application scenarios, hard disks (such as solid-state drives) are usually not running empty, but instead store user business data (such as database files, logs, cache data, etc.). Therefore, to make the testing process more in line with actual application scenarios, you can write multiple data to the storage space of the hard disk to be tested before executing the test.
[0042] The multiple data may include valid data and invalid data. The valid data may include data that currently needs to be retained for the solid-state drive, which corresponds to the logical address written by the user through the host and has not been deleted or overwritten. The invalid data may include old data that does not need to be retained and has been discarded by the user. For example, if the user deletes a file or overwrites old data with new data, the corresponding data will become invalid.
[0043] In operation S220, if the storage address of the valid data among the multiple 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 execution time of the predetermined deletion operation for the invalid data among the multiple data.
[0044] During the actual use of hard drives, scheduled deletion operations are often performed. Scheduled deletion operations can include deleting invalid data and freeing up storage space. Specific examples of scheduled deletion operations include garbage collection (GC) operations. Garbage collection operations can be used to recycle invalid old data pages, write valid data in the blocks to be recycled to new blocks, and then erase the invalid blocks to achieve recycling of storage space. For solid-state drives, their flash memory particles cannot be directly overwritten and written to; they must first be erased and then written to. For example, when a large amount of invalid data (such as old data that has been deleted or overwritten) exists in the solid-state drive, it is necessary to migrate the valid data to new storage units through scheduled deletion operations, and then erase the old storage units containing the invalid data to free up writable space.
[0045] Storage mapping information can characterize the mapping relationship between valid data and its storage location. The relevant test method is usually tested under the ideal state that the storage address of valid data can be determined based on the storage mapping information. When performing the deletion operation, it is only necessary to directly determine the location of the valid data based on the storage mapping information. However, in actual application scenarios, there may be situations where the storage address of valid data cannot be determined based on the storage mapping information. For example, a power outage may cause the storage mapping information to be lost, resulting in the inability to determine the location of the valid data based on the storage mapping information. By performing a reset operation when the storage address of valid data among multiple data cannot be determined based on the storage mapping information, the situation where the storage mapping information is lost in the actual application scenario can be simulated, making the test scenario more in line with the actual application scenario. For example, the entire server can be powered on and off, and accordingly all the hard disks to be tested on the server will be powered on and off, causing the storage mapping information to be at least partially lost, so that the storage address of valid data among multiple data cannot be determined based on the storage mapping information.
[0046] The reset operation can simulate sudden abnormalities in actual application environments (such as power outages and system failures), forcibly triggering the hard drive's fault tolerance and recovery mechanisms, and thus verifying data security, recovery capabilities, and long-term stability in extreme scenarios.
[0047] In real-world applications, reset operations are common. For example, server rooms may experience frequent resets due to power fluctuations, cluster scheduling failures, or user errors (such as frequent forced restarts) or system crashes. These resets can impact the hard drive's data security, recovery capabilities, and long-term stability. For example, a reset can interrupt data exchange, causing data loss or corruption, or slowing down data recovery. Performing a reset test ensures that the hard drive can maintain stable performance, preventing data loss and damage, even in the event of a power outage or other unexpected situation.
[0048] Optionally, the number of reset operations performed can be set based on actual needs, for example, based on the application scenario of the hard drive under test. For example, when the hard drive under test is used in a consumer scenario (such as a computer for ordinary users), the likelihood of encountering resets in consumer scenarios is relatively low, such as a few times a year. Therefore, a lower frequency reset test can be set, such as a reset test with a frequency lower than a preset frequency threshold. For example, setting a reset frequency of hundreds of times can generally cover the risk of several years of use. In a server scenario, the computer room may experience dozens of resets per month due to power fluctuations and other reasons. Therefore, a higher frequency reset test can be set, such as a reset test with a frequency greater than or equal to a preset frequency threshold, such as thousands of resets.
[0049] Optionally, a reset operation can be performed during the execution of a scheduled deletion operation, and the execution time of the scheduled deletion operation can include the time when the scheduled deletion operation is executed to different progress. The starting time of the predetermined number of reset operations can be different to correspond to the time when the scheduled deletion operation is executed to different progress, so that the test process covers different progress of the scheduled deletion operation. For example, it can cover multiple situations such as encountering a reset operation before the storage unit has completed the data migration, or encountering a reset operation after the storage unit has completed the data migration, so as to conduct a more comprehensive test. After the storage mapping information is at least partially lost, a waiting time can be randomly determined before each reset operation is executed, and the reset operation is started after the waiting time is reached, so that multiple reset operations can correspond to the time when the scheduled deletion operation is executed to different progress.
[0050] For example, the solid-state drive is executing a scheduled deletion operation before power is turned off, and will continue the scheduled deletion operation after power is restored. A waiting time can be randomly selected, and a reset operation can be performed after the waiting time is reached, so that the time when the reset operation is executed can cover the time when the scheduled deletion operation is executed at a different progress.
[0051] In operation S230 , an indicator value of the hard disk to be tested for a predetermined test indicator is determined.
[0052] In operation S240 , the performance stability of the hard disk to be tested is determined according to the index value.
[0053] Optionally, predetermined test indicators can be used to evaluate the performance stability of the hard disk under test after performing a reset test. The predetermined test indicators may include one or more, such as a data consistency indicator, a data integrity indicator, etc. The predetermined test indicators may correspond to preset indicator thresholds. If the predetermined test indicators include multiple, each predetermined test indicator may correspond to its own preset indicator threshold. The indicator value may be compared with the preset indicator threshold corresponding to the indicator value to determine whether the performance stability of the hard disk under test meets the standard. For example, if the predetermined test indicator includes an error count indicator, the preset indicator threshold may be set to 0. If the indicator value of the error count indicator of the hard disk under test is still 0 after performing a predetermined number of reset operations on the hard disk under test, it indicates that the hard disk under test is relatively stable.
[0054] According to an embodiment of the present application, based on the application scenario of the hard disk to be tested, multiple data are written to the storage space of the hard disk to be tested. If the storage address of the valid data among the multiple data cannot be determined based on 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 based on the execution time of the predetermined deletion operation for the invalid data among the multiple data. This can make the test scenario more consistent with the actual use scenario of the hard disk, make the test results more referenceable, and strengthen the verification of the garbage collection strategy to ensure the reliability and stability of the hard disk when the hard disk frequently performs reset operations. In addition, the test process can utilize the existing server environment and can be automated, thereby saving manpower, improving efficiency, and reducing testing costs.
[0055] According to an embodiment of the present application, based on the application scenario of the hard disk to be tested, writing multiple data to the storage space in the hard disk to be tested includes: writing first data to the storage space until the storage space reaches a full state, wherein the first data is temporarily in a valid state and temporarily belongs to valid data; based on the application scenario of the hard disk to be tested, writing second data to a predetermined storage subspace in the storage space, so that the first target data in the predetermined storage subspace is changed from a valid state to an invalid state, wherein the first target data changed to an invalid state belongs to invalid data.
[0056] Since the actual physical structure of a solid-state drive is relatively complex, for example, a solid-state drive may have 8-16 channels, each channel corresponding to dozens of flash memory blocks. In order to facilitate the description of the data writing process, a simplified model of the solid-state drive is used for description.
[0057] Figure 3 A schematic diagram of a simplified model of a solid-state drive according to an embodiment of the present application is shown.
[0058] For example Figure 3 As shown in the figure, the simplified SSD model consists of four channels: Channel 0, Channel 1, Channel 2, and Channel 3. Each channel has six flash blocks: Block 0, Block 1, Block 2, Block 3, Block 4, and Block 5, for a total of 24 flash blocks. Each flash block contains nine small blocks, each corresponding to a logical page. Of the 24 flash blocks, 20 are assumed to be the SSD capacity (indicated by the upper dashed box in the figure), i.e., the size of the SSD as seen by the host. The remaining four flash blocks are reserved space exceeding the SSD capacity (indicated by the lower dashed box in the figure).
[0059] Figure 4 A schematic diagram of writing data into a solid state drive according to an embodiment of the present application is shown.
[0060] Figure 5 A schematic diagram of writing data into a solid state drive 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 indicate the storage location where data is written. For example, the offset parameter can be determined based on the actual application scenario. The offset parameter specifies the storage location where data is written. For example, an offset parameter equal to 100MB indicates that data is written starting at the 100MB position on the SSD.
[0079] Furthermore, an appropriate data size parameter may be set according to the application scenario. The data size parameter is used to represent the total amount of data written. For example, a data size parameter of 50MB indicates that the total capacity of the data written this time is 50MB.
[0080] For example, you can use a benchmark tool to fill the storage space of a solid-state drive in sequence, then select appropriate offset parameters and data size parameters to continue writing data to the solid-state drive, so that invalid data is generated at different locations in the storage space, so that the data filling situation of the solid-state drive is more in line with the actual application scenario.
[0081] According to an embodiment of the present application, determining address information corresponding to a predetermined storage subspace according to an application scenario includes: when the application scenario includes persistent storage of data, determining that the address information includes first address information corresponding to a starting area of the storage space.
[0082] When data is stored in a logical order, the data written first is usually in the front area of the storage space, and the data written later is usually in the back area of the storage space. In the case of persistent data storage, the data is usually valid for a long time and is updated less frequently. When an old piece of data needs to be updated, the new data will preferentially overwrite the logical location of the old data, resulting in invalid data being easily generated in the front area of the storage space. Therefore, when it is determined that the application scenario of the hard disk to be tested is for persistent data storage, the first address information of the front area of the storage space, that is, the starting area, can be used as the address information corresponding to the predetermined storage subspace. For example, for application scenarios such as databases and file servers, it can be determined that the address information includes the first address information corresponding to the starting area of the storage space.
[0083] According to an embodiment of the present application, determining address information corresponding to a predetermined storage subspace according to an application scenario includes: when the application scenario includes real-time cache data, determining that the address information includes second address information corresponding to a termination area of the storage space.
[0084] In real-time data caching scenarios, data is typically short-lived and frequently updated. In this scenario, new data is continuously written to the back of the storage space, occupying new logical addresses. If the storage space is full, the new data may directly overwrite the older data stored at the end, rendering the older data invalid. Therefore, if the hard drive under test is used for real-time data caching, the second address information corresponding to the later area of the storage space, i.e., the end area of the storage space, can be used as the address information corresponding to the predetermined storage subspace.
[0085] By setting address information accordingly based on the invalid data distribution characteristics of different application scenarios, the test scenarios can be made closer to real scenarios, thereby accurately evaluating the performance stability of solid-state drives in actual applications.
[0086] According to an embodiment of the present application, the hard disk testing method also includes: performing a forced interrupt operation on the hard disk to be tested so that the storage address of the valid data in the storage mapping information is at least partially lost, wherein, when the storage mapping information is at least partially lost, the storage address of the valid data in the multiple data cannot be determined based on the storage mapping information.
[0087] A forced interruption operation may include forcibly terminating the normal operation of the solid-state drive through external force. A forced interruption operation may cause the storage mapping information of the solid-state drive to fail to be saved normally or to be directly destroyed. Specifically, the storage mapping information of the solid-state drive is usually temporarily stored in the cache and regularly synchronized to the permanent storage area of the flash memory. A forced interruption will disrupt this process. For example, if the interruption occurs after the mapping information is updated but not synchronized to the permanent storage (such as a sudden power outage when a mapping relationship is being modified), the latest mapping information in the cache will be lost, and only the old version before the interruption will be retained. This will cause at least partial loss of the storage mapping information, such as the loss of the mapping relationship of a certain logical address, or the destruction of the structure of the entire storage mapping information.
[0088] Since storage mapping information is the only basis for the SSD to identify valid data, under normal circumstances, the SSD needs to quickly locate valid data through the storage mapping information. If the storage mapping information is at least partially lost or invalid, the SSD will be unable to determine the storage address of the valid data based on 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 erasure operation.
[0090] By performing a power-off operation, we can simulate the situation in actual application scenarios where the SSD power supply is suddenly cut off due to a power failure or accidental plugging and unplugging. Specifically, because the SSD's storage mapping information is usually temporarily stored in the cache and regularly synchronized to the permanent storage area of the flash memory, after performing a power-off operation, the latest unsynchronized mapping information in the cache will be directly lost. Moreover, if the storage mapping information is in the process of being written to the flash memory when the power is cut off, the mapping information already stored in the flash memory may be destroyed.
[0091] A firmware reset operation can include forcibly restarting the hard drive firmware through software commands or hardware signals, which can cause a forced interruption at the hard drive's logical level. A firmware interruption can cause the ongoing storage mapping information update task to be abnormally terminated (for example, only half of a mapping relationship is updated), or some mapping information cache temporarily stored in the firmware memory may be cleared. If this information is not written to the flash memory in a timely manner, it will result in the loss of this information. By performing a firmware reset operation, you can simulate actual application scenarios such as drive restarts and controller resets, thereby testing the integrity of the mapping information when the hard drive recovers from an abnormal recovery at the logical level.
[0092] Data erasure operations can also cause the loss of storage mapping information. Data erasure operations can include performing a quick erase or targeted erasure of metadata areas, directly deleting or destroying the area containing storage mapping information. This can make it impossible to determine the storage address of valid data within multiple data sets based on the storage mapping information. Data erasure operations can simulate extreme situations in real-world applications, such as accidental erasure and malicious metadata destruction, to test the drive's ability to recover from direct damage to core metadata.
[0093] In actual application scenarios, unexpected power outages, hardware failures, and other situations may occur. Relevant testing methods are usually performed under the ideal state of complete storage mapping information. Compared with relevant testing methods, by forcing the interrupt operation to cause at least partial loss of the storage address of valid data in the storage mapping information, it can simulate the process in which the storage mapping information of the hard disk may be damaged due to unexpected situations such as power outages in actual application scenarios. Therefore, it can be evaluated whether the hard disk can re-identify valid data through its own mechanisms (such as all-flash scanning and checksum verification) when it cannot find valid data through the storage mapping information. It can also be evaluated whether frequent reset operations will cause data recognition confusion (such as accidental deletion of valid data or mistaking invalid data for valid data) when the storage address of valid data among multiple data cannot be determined based on the storage mapping information. In addition, it can also be evaluated whether the scheduled deletion operation will be stuck due to excessively low full-volume scanning efficiency when there is no storage mapping information guidance, or even cause the loss of data in the entire block due to misjudgment. Therefore, the testing process can be tailored to actual application scenarios, and the test results are more reliable.
[0094] According to an embodiment of the present application, the predetermined deletion operation includes: reading multiple data in the storage space one by one; identifying invalid data in the multiple data one by one; and performing a cleaning operation on the invalid data.
[0095] After the storage address of valid data in the storage mapping information is at least partially lost due to a forced interruption operation, the storage location of the valid data can no longer be determined based on the storage mapping information. Therefore, when performing a predetermined deletion operation, it is necessary to read out all the information in the flash memory block and determine which is valid data and which is invalid data. For example, multiple data in the storage space can be read one by one, such as reading the data in the physical flash memory one by one, or one logical page at a time; then, invalid data in the multiple data can be identified one by one through the logical block address tag of the data itself, wherein, when 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 then 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] When the storage mapping information fails, the scheduled deletion operation needs to read the data one by one and determine whether the data is valid. This will slow down the scheduled deletion operation and occupy resources. At this time, if the reset action occurs frequently, the reliability requirements for the hard disk are higher. Therefore, the performance stability of the hard disk can be tested in the case of storage mapping information failure and frequent reset. The test scenario is more realistic and the test results are more referenceable.
[0097] According to an embodiment of the present application, 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.
[0098] Predetermined test indicators can be used to evaluate the performance stability of the hard disk to be tested. For example, the data validity indicator can be used to evaluate whether the hard disk can protect valid data. For example, the data validity indicator can specifically include data consistency indicator, data integrity indicator, etc. The data consistency indicator can indicate whether the logical relationship of the valid data in the hard disk can still remain correct after the storage mapping information is lost and frequently reset, such as whether the front and back contents of the file are consistent in order and whether the fields of the database record correspond; the data integrity indicator can indicate whether the valid data has not been tampered with or damaged, such as whether garbled characters appear.
[0099] Operational performance stability indicators can also be used to evaluate whether the hard disk can maintain basic performance in extreme scenarios such as loss of storage mapping information and frequent resets. Operational performance stability indicators can specifically include parallel write efficiency indicators, read-write performance indicators, etc. Among them, the parallel write efficiency indicator can indicate whether the multi-channel parallel write capability of the hard disk is reduced when the storage mapping information is lost and frequently reset. The read-write performance indicators can indicate whether the read and write delays and continuous write throughput are stable when the hard disk reconstructs the mapping through a full scan after the storage mapping information is lost. For example, the number of reads and writes per second and the throughput curve before and after the power outage can be constructed, and the read-write performance indicators can be evaluated by whether the curve shows a cliff-like drop or frequent fluctuations.
[0100] You can also use the storage space performance index to assess whether a hard drive will crash under long-term use. For example, if the number of bad blocks increases after a predetermined number of reset operations, or if the reserved headroom is overconsumed (such as a rapid decrease in headroom), this indicates that the hard drive is struggling to cope with long-term wear and tear. Accordingly, the hard drive's index value for the storage space performance index may be low.
[0101] Through indicators such as data validity index, operation performance stability index, storage space performance index, etc., the performance stability of the hard drive to be tested can be evaluated comprehensively from multiple dimensions.
[0102] According to an embodiment of the present application, the hard disk testing method also includes: obtaining multiple candidate hard disks for testing; performing initial state tests on the multiple candidate hard disks based on preset initial test indicators, determining the index values of the multiple candidate hard disks for the preset initial test indicators, and obtaining initial test results; when the initial state test results indicate that the initial state of the candidate hard disk is normal, the candidate hard disk is used as the hard disk to be tested.
[0103] For example, you can install solid-state drives in a server according to the maximum supported number or maximum capacity limit of its hardware design to saturate the server's storage configuration. Candidate drives can include all solid-state drives installed in the server.
[0104] Before testing performance reliability, you can first perform an initial status test on the candidate hard drive to determine whether the candidate hard drive itself has any abnormalities. If the hard drive itself already has an abnormality during the performance reliability test (e.g., bad blocks from the factory, or aging due to excessive operation), then if the performance reliability test results are abnormal, it is likely caused by the abnormality of the hard drive itself, rather than the result of performing a predetermined number of reset operations on the tested hard drive without being able to determine the storage address of valid data among multiple data items based on the storage mapping information. Consequently, it is impossible to determine the exact cause of the abnormal test result.
[0105] The initial test result may include the index value of the candidate hard disk for the preset initial test index. If the initial state test result indicates that the initial state of the candidate hard disk is normal, it means that the candidate hard disk itself has no abnormality, so the candidate hard disk can be used as the hard disk to be tested.
[0106] According to an embodiment of the present application, 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.
[0107] Optionally, the read-write performance indicators may specifically include read-only indicators, bandwidth rate indicators, etc. The read-write performance indicators can evaluate the basic read-write functions and efficiency of the hard disk. For example, if the hard disk enters read-only mode, it means that write operations cannot be performed, but the test process needs to perform operations that rely on the write function, such as data movement. Therefore, candidate hard disks in read-only mode can be excluded; when the bandwidth rate is low, it means that the hard disk itself may have certain problems. If a hard disk with a low bandwidth rate is used as the hard disk to be tested, when the performance stability test result indicates that the bandwidth rate of the hard disk is low, it is difficult to determine whether it is caused by a problem with the hard disk itself or by the test process. Therefore, candidate hard disks with bandwidth rates 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] Abnormal event indicators can assess whether the hard drive has potential hardware or firmware defects. For example, if the error count is greater than zero, it indicates that the hard drive has hardware defects (such as flash memory chip defects or controller failures) before leaving the factory or during transportation. If such a hard drive with hardware defects is used in subsequent tests, the errors caused by the defects may be amplified during subsequent forced interruptions and frequent resets, such as causing a sudden increase in the error count. This makes it difficult to distinguish whether the problem is caused by the test operation or the hard drive defect itself, making the test results meaningless.
[0109] Operational stability metrics assess the drive's historical wear and usage intensity, including metrics such as read / write data volume and runtime. If the read / write data volume is approaching or reaching the upper limit, or if the runtime is prolonged (for example, exceeding the runtime threshold set based on actual needs), the drive is experiencing significant aging. This aging may interfere with subsequent testing, making it difficult to distinguish between issues caused by testing and drive aging.
[0110] According to an embodiment of the present application, the reset operation includes at least one of the following: interrupting the current task, releasing temporary resources, and resetting to the initial state of the hard disk.
[0111] By interrupting the current task, you can forcefully terminate all tasks being executed, such as forcibly terminating an ongoing scheduled deletion operation. A hard disk will occupy a variety of temporary resources during operation, and a reset operation can release temporary resources, such as cache resources and lock resources (certain storage units will be locked when task execution is possible to prevent concurrent operation conflicts). The initial state of the hard disk may include a working state in which the hard disk can be normally identified by the host and receive instructions. Resetting to the initial state of the hard disk may include: abandoning currently unfinished tasks, such as abandoning data movement and flash block erasing operations that were being executed before the reset; and restoring basic responsiveness, such as the hard disk must be re-identifiable by the host after the reset.
[0112] By frequently interrupting the current task, you can test whether the hard disk has inconsistent state after the task is interrupted. By frequently releasing temporary resources, you can test whether the hard disk resources are released completely and whether there are any minor residual problems (such as 1 byte of unreleased cache). By frequently resetting the hard disk to its initial state, you can verify the consistency of the hard disk state reset and the hardware compatibility. In this way, you can comprehensively test the performance stability of the hard disk in multiple dimensions.
[0113] Based on the above hard disk testing method, this application also provides a hard disk testing device. Figure 9 The device is described in detail.
[0114] Figure 9 The figure shows a structural block diagram of a hard disk testing device according to an embodiment of the present application.
[0115] like Figure 9 As shown, the hard disk testing device 900 of this embodiment includes a writing module 910 , a resetting module 920 , a first determining module 930 and a second determining module 940 .
[0116] The writing module 910 is used to write a plurality of data into the storage space of the hard disk to be tested according to the application scenario of the hard disk to be tested. In one embodiment, the writing module 910 can be used to perform the operation S210 described above, which will not be repeated here.
[0117] Reset module 920 is configured to, if the storage address of valid data among the multiple data cannot be determined based on the storage mapping information, perform a predetermined number of reset operations on the hard disk under test. The reset operations are initiated based on the scheduled execution time of the deletion operation for invalid data among the multiple data. In one embodiment, reset module 920 may be configured to perform operation S220 described above, which will not be further described here.
[0118] The first determination module 930 is used to determine the index value of the hard disk to be tested for the predetermined test index. In one embodiment, the first determination module 930 can be used to perform the operation S230 described above, which will not be repeated here.
[0119] The second determination module 940 is used to determine the performance stability of the hard disk to be tested according to the indicator value. In one embodiment, the second determination module 940 can be used to perform the operation S240 described above, which will not be repeated here.
[0120] According to an embodiment of the present application, the writing module includes a first writing sub-module and a second writing sub-module.
[0121] The first write submodule is used to write first data into the storage space until the storage space is full and the first data is temporarily in a valid state and temporarily belongs to valid data; the second write submodule is used to write second data into a predetermined storage subspace in the storage space according to the application scenario of the hard disk to be tested, so that the first target data in the predetermined storage subspace is changed from a valid state to an invalid state, wherein the first target data changed to an invalid state belongs to invalid data.
[0122] According to an embodiment of the present application, the second writing submodule includes a determining unit and a writing unit.
[0123] The determining unit is used to determine address information corresponding to the predetermined storage subspace according to the application scenario; and the writing unit is used to write the second data into the predetermined storage subspace according to the address information.
[0124] According to an embodiment of the present application, the hard disk testing device also includes an interrupt module, which is used to perform a forced interrupt operation on the hard disk to be tested, so that the storage address of the valid data in the storage mapping information is at least partially lost, wherein, when the storage mapping information is at least partially lost, the storage address of the valid data in the multiple data cannot be determined based on the storage mapping information.
[0125] According to an embodiment of the present application, the determining unit includes a first determining subunit and a second determining subunit.
[0126] The first determining subunit is configured to determine, when the application scenario includes persistent storage of data, that the address information includes first address information corresponding to a starting area of the storage space. The second determining subunit is configured to determine, when the application scenario includes real-time cached data, that the address information includes second address information corresponding to an ending area of the storage space.
[0127] According to an embodiment of the present application, the hard disk testing device further includes an acquisition module and an initial state testing module.
[0128] The acquisition module is used to obtain multiple candidate hard disks for testing; the initial state test module is used to perform initial state tests on multiple candidate hard disks based on preset initial test indicators, determine the indicator values of multiple candidate hard disks for the preset initial test indicators, and obtain initial test results; when the initial state test results indicate that the initial state of the candidate hard disk is normal, the candidate hard disk is used as the hard disk to be tested.
[0129] According to an embodiment of the present application, the hard disk testing device further includes a predetermined deletion module, which includes a reading submodule, an identification submodule, and a cleaning operation submodule.
[0130] The reading submodule is used to read multiple data in the storage space one by one; the identifying submodule is used to identify invalid data in the multiple data one by one; and the cleaning operation submodule is used to perform a cleaning operation on the invalid data.
[0131] According to an embodiment of the present application, the reset operation includes at least one of the following: interrupting the current task, releasing temporary resources, and resetting to the initial state of the hard disk.
[0132] According to embodiments of the present application, any multiple modules among the write module 910, reset module 920, first determination module 930, and second determination module 940 may be combined into a single module, or any one of these modules may be split into multiple modules. Alternatively, at least part of the functionality of one or more of these modules may be combined with at least part of the functionality of other modules and implemented in a single module. According to embodiments of the present application, at least one of the write module 910, reset module 920, first determination module 930, and second determination module 940 may 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 a chip, a system on a substrate, a system on a package, an application-specific integrated circuit (ASIC), or may be implemented in hardware or firmware through any other reasonable means of circuit integration or packaging, or may be implemented in any one of the three implementation methods of software, hardware, and firmware, or in any appropriate combination of any of these. Alternatively, at least one of the writing module 910 , the resetting module 920 , the first determining module 930 , and the second determining module 940 may be at least partially implemented as a computer program module, which may perform corresponding functions when executed.
[0133] Figure 10 A block diagram of an electronic device suitable for implementing a hard disk testing method according to an embodiment of the present application is shown.
[0134] like 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] This application also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments, or may exist independently and not be incorporated into the device / apparatus / system. The computer-readable storage medium carries one or more programs, and when the one or more programs are executed, the method according to the embodiments of this application is implemented.
[0138] According to an embodiment of the present application, a computer-readable storage medium may be a non-volatile computer-readable storage medium, and may include, for example, but not limited to: a portable computer disk, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present application, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, according to an embodiment of the present application, a computer-readable storage medium may include the ROM 1002 and / or RAM 1003 described above and / or one or more memories other than ROM 1002 and RAM 1003.
[0139] The embodiments of the present application also include a computer program product, which includes a computer program containing program code for executing the method shown in the flowchart. When the computer program product is run in a computer system, the program code is used to enable the computer system to implement the method provided in the embodiments of the present application.
[0140] The computer program executes the above functions defined in the system / device of the embodiment of the present application when the computer program is executed by the processor 1001. According to the embodiment of the present application, the system, device, module, unit, etc. described above can be implemented by a computer program module.
[0141] In one embodiment, the computer program may be stored on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may be transmitted and distributed in the form of a signal on a network medium, downloaded and installed via the communication portion 1009, and / or installed from the removable medium 1011. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to wireless, wired, or any suitable 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 present application have been described above. However, these embodiments are for illustrative purposes only and are not intended to limit the scope of the present application. Although each embodiment has been described separately above, this does not mean that the measures in each embodiment cannot be advantageously used in combination. Without departing from the scope of the present application, those skilled in the art may make various substitutions and modifications, and these substitutions and modifications should all fall within the scope of the present application.
Claims
1. A hard disk testing method, characterized in that: The method comprises: Writing a plurality of data into the storage space of the hard disk to be tested according to the application scenario of the hard disk to be tested; If the storage address of the valid data among 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, 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 plurality of data; 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 step of writing a plurality of data into the storage space of the hard disk to be tested according to the application scenario of the hard disk to be tested comprises: Writing first data into the storage space until the storage space is full, wherein the first data is temporarily in a valid state and is temporarily valid data; According to the application scenario of the hard disk to be tested, second data is written to a predetermined storage subspace in the storage space so that the first target data in the predetermined storage subspace is changed from a valid state to an invalid state, wherein the first target data changed to the invalid state belongs to the invalid data.
3. The method according to claim 2, characterized in that The step of writing the second data into a predetermined storage subspace in the storage space according to an application scenario of the hard disk to be tested includes: Determining address information corresponding to the predetermined storage subspace according to the application scenario; The second data is written into the predetermined storage subspace according to the address information.
4. The method according to claim 3, 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.
5. The method according to claim 3, 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.
6. The method according to claim 1, characterized in that 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.
7. The method according to claim 6, 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.
8. 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.
9. 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.
10. The method according to claim 9, 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.
11. The method according to claim 1, wherein 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.
12. 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.
13. 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 12 are implemented.
14. 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 12.
15. A computer-readable storage medium having a computer program or instruction stored thereon, characterized in that: When the computer program or instructions are executed by a processor, the steps of the method according to any one of claims 1 to 12 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 pre-embedded test method, device and equipment based on Emulator simulation platform and medium
CN117992294A
Chip testing method, device and equipment based on hardware accelerator and medium
CN119065912A
Solid state disk performance fluctuation test method, device and equipment and storage medium
CN120236639A
Read and write test method and apparatus, computer storage medium, and electronic device
WO2023035413A1