A method, system, device, and storage medium for stress testing of a system hard disk.

By performing read/write stress tests on the mounted partitions of the system hard drive, the problem of hard drive stress testing that cannot cover the system partition in existing technologies is solved, thus exposing early hard drive failures and improving system stability.

CN117033099BActive Publication Date: 2026-06-30INSPUR SUZHOU INTELLIGENT TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
INSPUR SUZHOU INTELLIGENT TECH CO LTD
Filing Date
2023-07-21
Publication Date
2026-06-30

AI Technical Summary

Technical Problem

Current technology cannot perform hard drive stress tests on system partitions, which leads to potential hard drive failures and fails to effectively improve hard drive reliability and data security.

Method used

By collecting the mounted partition information of the system hard drive, calculating the available capacity and test duration of each mounted partition, performing read and write stress tests, generating test reports, clearing test files, and overwriting the hard drive stress test of the system partition.

Benefits of technology

It implements hard drive stress testing on system partitions, which can expose hard drive failures at an early stage, reduce client quality issues, and prevent system crashes caused by hard drive read/write operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117033099B_ABST
    Figure CN117033099B_ABST
Patent Text Reader

Abstract

This invention proposes a method, system, device, and readable storage medium for stress testing of a system hard drive. The method includes: collecting data on the mounted partitions of the hard drive; collecting the available capacity of each mounted partition; calculating the test duration for each partition based on the set test duration and the available capacity of each partition; performing stress tests on each partition sequentially according to the test duration; and generating logs and deleting files generated during the test after the test. Specifically, during stress testing of each partition, a method of cyclically generating files of fixed / random sizes in the corresponding partition's iotest directory is used for read / write stress testing until the time expires or the partition capacity is exhausted, at which point the test ends. This invention achieves comprehensive hard drive stress testing covering the entire system partition by creating files on each partition of the system hard drive and performing file read / write tests. This can expose early hard drive failures through stress testing, effectively reducing client-side quality issues.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and more specifically to a method, system, apparatus, and storage medium for stress testing a system hard disk. Background Technology

[0002] Server system hard drives, as the name suggests, are the hard drives used on a server. If the server is the core of network data, then the server system hard drive is the data warehouse of that core, where all software and user data are stored. The data stored on the server's hard drive is the most valuable, therefore, the reliability of the hard drive is extremely important.

[0003] Currently, with the diversification of hard drives and operating systems, certain types of hard drives and operating systems exhibit gaps in compatibility and stability, leading to potential failures of client hard drives. Therefore, to improve the reliability of computer hard drives and data security, and to ensure the normal operation of computer equipment, it is necessary to perform regular stress tests on hard drives.

[0004] The following methods are mainly used in related technologies for hard drive stress testing.

[0005] 1. Perform stress testing on the entire disk (excluding the operating system disk) under a Linux system. This testing method cannot cover the system disk and cannot achieve full disk stress testing.

[0006] 2. If the current device has only a single hard drive, first partition the sectors excluding the system partition, and then perform a stress test on that partition. This testing method can only perform stress tests on sectors other than the system partition and still cannot cover the system partition.

[0007] 3. Perform read stress tests on existing data sectors within the partition. This test method can only perform read stress tests on partitions with existing data.

[0008] It is clear that how to perform hard drive stress testing on the system partition is a problem that we urgently need to solve. Summary of the Invention

[0009] To address the above problems, the present invention aims to provide a system, device, and storage medium for stress testing of a system hard drive. By creating files on each partition of the system hard drive and performing file read / write tests, stress testing of the hard drive covering the entire system partition is achieved. This stress test can expose early hard drive failures and effectively reduce quality issues on the client side.

[0010] To achieve the above objectives, the present invention employs the following technical solution:

[0011] In a first aspect, the present invention discloses a stress testing method for a system hard disk, comprising:

[0012] Collect the mounted partition information of the system hard drive;

[0013] Obtain the available capacity of each mounted partition based on the mounted partition information;

[0014] Set the total test duration, calculate the test duration for each mounted partition based on the available capacity of each mounted partition, and perform read / write stress tests on each mounted partition based on the test duration for each mounted partition.

[0015] After the test is completed, a test report is generated and the files generated by the test are deleted.

[0016] Furthermore, the mounted partition information of the hard drive in the acquisition system includes:

[0017] Get the list of mounted partitions on the system hard drive;

[0018] Determine the mount directory for each mount partition based on the mount partition name in the mount partition list.

[0019] Furthermore, obtaining the available capacity of each mounted partition based on the mounted partition information includes: determining the available capacity of each mounted partition based on the mounted partition name in the mounted partition list;

[0020] The total available capacity of the system hard drive is calculated based on the available capacity of each mounted partition.

[0021] Furthermore, the setting of the total test duration, which calculates the test duration for each mounted partition based on the available capacity of each mounted partition, includes:

[0022] Set the total test duration T;

[0023] The allocated capacity S per unit time is calculated using the formula S = S0 / T; where S0 is the total available capacity of the system hard disk.

[0024] The test duration for each mounted partition is calculated using the formula Tn = Rn / S; where Tn is the test duration for the nth mounted partition and Rn is the available capacity of the nth mounted partition.

[0025] Furthermore, the step of performing read / write stress tests on each mounted partition based on the test duration of each mounted partition includes:

[0026] Set the minimum time for read / write stress testing;

[0027] Start the read / write stress test tool, create test files in the mounted directory and perform read and write operations in a loop; the read / write stress test ends when the test duration reaches the test duration of the mounted partition or when the available space of the currently tested mounted partition is less than the size of the test file.

[0028] Furthermore, after the test is completed, a test report is generated and the files generated by the test are cleared, including: when the read and write pressure test of all mounted partitions is completed, a test log is generated;

[0029] Delete all test files to restore the available capacity of all mounted partitions;

[0030] Check system logs and hard drive self-monitoring analysis and technical reports;

[0031] When the hard drive's self-monitoring analysis and technical report contains warnings, errors, or fault status information, the corresponding ID attribute items are recorded and a test report is generated.

[0032] Furthermore, the step of creating test files in a loop under the mount directory and performing read and write operations includes: randomly creating test files of size 10-200M under the mount directory and performing read and write operations.

[0033] Secondly, the present invention also discloses a stress testing system for a system hard drive, comprising:

[0034] Partition information acquisition unit, configured to acquire mounted partition information of the system hard drive;

[0035] The partition capacity confirmation unit is configured to obtain the available capacity of each mounted partition based on the mounted partition information; the partition test duration calculation unit is configured to set the total test duration and calculate the test duration of each mounted partition based on the available capacity of each mounted partition.

[0036] The loop test unit is configured to perform read / write stress tests on each mounted partition based on the test duration of each mounted partition.

[0037] The recording unit is configured to generate a test report and clear the files generated during the test after the test is completed.

[0038] Furthermore, the partition information acquisition unit is specifically used to: obtain a list of mounted partitions of the system hard disk; and determine the mount directory of each mounted partition based on the mounted partition name in the mounted partition list.

[0039] Furthermore, the partition capacity confirmation unit is specifically used to: determine the available capacity of each mounted partition based on the mounted partition name in the mounted partition list; and calculate the total available capacity of the system hard disk based on the available capacity of each mounted partition.

[0040] Furthermore, the partition test duration calculation unit is specifically used for: setting the total test duration T; calculating the allocated capacity S per unit time according to the formula S = S0 / T; where S0 is the total available capacity of the system hard disk; and calculating the test duration of each mounted partition according to the formula Tn = Rn / S; where Tn is the test duration of the nth mounted partition and Rn is the available capacity of the nth mounted partition.

[0041] Furthermore, the loop test unit is specifically used for: setting the minimum time for the read / write stress test; starting the read / write stress test tool, creating test files in the mount directory and performing read / write operations in a loop; and ending the read / write stress test when the test duration reaches the test duration of the mount partition or when the available space of the mount partition being tested is less than the size of the test file.

[0042] Furthermore, the recording unit is specifically used for: generating a test log after the read / write stress test of all mounted partitions is completed; deleting all test files to restore the available capacity of all mounted partitions; checking the system log and the hard drive's self-monitoring analysis and technical report; and recording the corresponding ID attribute items and generating a test report when there are warning, error, or fault status information in the hard drive's self-monitoring analysis and technical report.

[0043] Thirdly, the present invention also discloses a stress testing device for a system hard disk, comprising:

[0044] Memory, used to store stress test programs for the system hard drive;

[0045] A processor, used to implement the steps of the system hard disk stress testing method as described above when executing the stress testing program for the system hard disk.

[0046] Fourthly, the present invention also discloses a readable storage medium storing a stress testing program for a system hard disk, wherein when the stress testing program for the system hard disk is executed by a processor, it implements the steps of the stress testing method for the system hard disk as described in any of the above.

[0047] Compared with existing technologies, the advantages of this invention are as follows: This invention discloses a method, system, device, and readable storage medium for stress testing of a system hard drive. First, it collects data on the mounted partitions of the hard drive and the available capacity of each mounted partition. Then, it calculates the test duration for each partition based on the set test duration and the available capacity of each partition. Subsequently, it performs stress tests on each partition sequentially according to the test duration, and generates logs and deletes the files generated during the test after completion. Specifically, during the stress test on each partition, it uses a method of cyclically generating fixed / random (10-200M) size files in the corresponding partition's iotest directory to perform read / write stress tests until the time expires or the partition capacity is exhausted, at which point the test ends.

[0048] This invention performs stress testing on the system hard drive by creating and reading / writing files on each mounted partition. This method achieves the purpose of testing the hard drive and prevents system crashes caused by hard drive read / write operations through fragmentation. It covers a larger hard drive space and divides the test area more finely, which can expose early hard drive failures through stress testing, thereby effectively reducing client-side quality issues.

[0049] Therefore, it is evident that the present invention has outstanding substantive features and significant progress compared with the prior art, and the beneficial effects of its implementation are also obvious. Attached Figure Description

[0050] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0051] Figure 1 This is a flowchart of a system hard disk stress testing method according to a specific embodiment of the present invention.

[0052] Figure 2 This is a flowchart of another system hard disk stress testing method in a specific embodiment of the present invention.

[0053] Figure 3 This is a system structure diagram of a system hard disk stress testing system according to a specific embodiment of the present invention.

[0054] Figure 4 This is a schematic diagram of the structure of a system hard disk stress testing device according to a specific embodiment of the present invention.

[0055] In the diagram, 1 is the partition information acquisition unit; 2 is the partition capacity confirmation unit; 3 is the partition test duration calculation unit; 4 is the loop test unit; 5 is the recording unit; 101 is the processor; 102 is the memory; 103 is the input interface; 104 is the output interface; 105 is the communication unit; 106 is the keyboard; 107 is the display; and 108 is the mouse. Detailed Implementation

[0056] The core of this invention is to provide a stress testing method for system hard drives. Related technologies mainly employ three methods for hard drive stress testing: one is a full disk test (excluding the operating system disk), which cannot achieve full disk stress testing; another is a stress test on the non-system sectors of a single disk, which cannot cover system partitions; and the third is a read stress test on existing data sectors within a partition, which can only perform read stress tests on existing data partitions.

[0057] The system hard drive stress testing method provided by this invention first collects the mounted partition information of the system hard drive and obtains the available capacity of each mounted partition based on the mounted partition information; then, it sets the total test duration and calculates the test duration for each mounted partition based on the available capacity of each mounted partition; at this time, it performs read / write stress tests on each mounted partition according to the test duration of each mounted partition; after the test is completed, it generates a test report and deletes the files generated by the test. Therefore, this invention achieves the purpose of hard drive testing by creating and reading / writing files on each mounted partition, while also preventing system crashes caused by hard drive read / write operations through fragmentation, thus realizing hard drive stress testing covering the system partition.

[0058] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein in the description of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention.

[0059] The key terms used in this invention will be explained below.

[0060] Hard Drive SMART Information: SMART, short for "Self-Monitoring Analysis and Reporting Technology," is an automatic hard drive status detection and early warning system and standard. It monitors and records the operation of hard drive hardware components such as read / write heads, platters, motors, and circuitry using internal hardware monitoring commands, comparing the data with preset safety values ​​set by the manufacturer. If the monitored status is approaching or has exceeded the preset safety range, the host computer's monitoring hardware or software can automatically warn the user and perform minor automatic repairs to proactively protect hard drive data. Except for some very early hard drives, most hard drives now come equipped with this technology.

[0061] To enable those skilled in the art to better understand the present invention, the invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. Obviously, the described embodiments are merely some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0062] See Figure 1 As shown, the present invention provides a stress testing method for a system hard drive, comprising the following steps:

[0063] S101: Collects mounted partition information of the system hard drive.

[0064] The purpose of this step is to collect the correspondence between the system partition list and the mount directory. Specifically, first, obtain the system hard disk's mount partition list (partition_list); then, determine the mount directory for each mount partition based on the mount partition name (partition_name) in the partition list (partition_list).

[0065] S102: Obtain the available capacity of each mounted partition based on the mounted partition information.

[0066] The purpose of this step is to determine the correspondence between the system partition list and the available space of the mounted partitions. Specifically, first, based on the names of the mounted partitions in the partition list, the available capacity `partition_free_size` of each mounted partition is determined; then, the total available capacity of the system hard disk is calculated based on the available capacity of each mounted partition. In a specific implementation, the total available capacity of the system hard disk is calculated by summing the available capacities of all mounted partitions.

[0067] S103: Set the total test duration and calculate the test duration for each mounted partition based on the available capacity of each mounted partition.

[0068] In a specific implementation, the total test duration T is first set; then, the allocated capacity S per unit time is calculated according to the formula S = S0 / T, where S0 is the total available capacity of the system hard disk. Finally, the test duration for each mounted partition is calculated according to the formula Tn = Rn / S, where Tn is the test duration of the nth mounted partition and Rn is the available capacity of the nth mounted partition.

[0069] S104: Perform read / write stress tests on each mounted partition based on the test duration of each mounted partition.

[0070] In the specific implementation, firstly, to prevent the test from failing to start due to an insufficiently small mounted partition, a minimum time for the read / write stress test is set. Then, each mounted partition is tested by iterating through the partition list. During the test, the read / write stress test tool is started, and test files are created and read / write operations are performed in a loop within the mounted directory; these test files are randomly generated and range in size from 10-200MB. The read / write stress test ends when the test duration reaches the maximum duration of the mounted partition or when the available space of the currently tested mounted partition is less than the size of the test file. Additionally, if the test duration of the mounted partition is less than the minimum time for the read / write stress test, the minimum time is used as the test duration for that partition. The minimum time for the read / write stress test can be set with reference to the size of the mounted partition, and the minimum time should be less than the total duration of 50 read / write operations.

[0071] S105: After the test is completed, generate a test report and delete the files generated by the test.

[0072] In a specific implementation, after the read / write stress test of all mounted partitions is completed, a test log is generated. Simultaneously, all test files are deleted to restore the available capacity of all mounted partitions. At this point, the system log and the hard drive's self-monitoring analysis and technical report (hard drive Smart information) are checked; if warnings, errors, or fault status information are found in the hard drive's self-monitoring analysis and technical report (hard drive Smart information), the corresponding ID attribute items are recorded, and a test report is generated.

[0073] This invention provides a stress testing method for system hard drives. By creating files on each partition of the system hard drive and performing file read and write tests, a stress test covering the entire system partition is achieved. This stress test can expose early hard drive failures and effectively reduce quality issues on the client side.

[0074] See Figure 2 As shown, the present invention also discloses a stress testing method for a system hard drive, comprising the following steps:

[0075] S201: Set initial parameters.

[0076] This step includes:

[0077] 1. Parse input parameters. Supported parameters include -t run_time, -m min_time, -sfile_size, and -aauto. As an example, this is the total test duration, run_time, which can be adjusted according to your needs.

[0078] 2. Initialize variables. This includes setting the size of the test file and the minimum runtime for the partition test.

[0079] S202: The correspondence between the system partition list and the mount directory.

[0080] First, obtain the system's mounted partition list (partition_list), and then determine the mount directory for each mounted partition based on the partition_list.

[0081] S203: Collect the system partition list and the correspondence between the partitions and the available space.

[0082] Specifically, based on the partition name (partition_name) in the partition list (partition_list), the available capacity of each mounted partition is obtained using the command partitionSizeDict{partition_name,partition_free_size}.

[0083] S204: Calculate and set the running time for each partition.

[0084] First, the available capacity of each mounted partition is summed to calculate the total available capacity of the hard drive. Then, the capacity allocated per unit time is calculated by dividing the total available capacity of the hard drive by the total test duration (run_time). Finally, the test duration allocated to each partition is calculated by dividing the available capacity of each mounted partition by the capacity allocated per unit time. After the calculation is complete, the test duration is allocated to each mounted partition using the command `partRunTimeDict:{partition_name,jobtime}`. It is important to note that to prevent small partitions from not being tested due to an excessively large hard drive, the minimum runtime for partition testing needs to be set appropriately in step S201.

[0085] S205: Perform read / write stress tests on each partition by cyclically creating files of fixed or random sizes within a runtime range or available space range.

[0086] During testing, read / write stress tests for each mounted partition can be started by looping through each mounted partition in partition_list.

[0087] When running a stress test, if a `file_size` value is specified for the test files, test files of size `file_size` are created and read / written repeatedly in the corresponding partition's mount directory ` / iotest` until the test duration for the mounted partition is reached or the available space on the partition is less than `file_size`. If no `file_size` value is specified, test files of 10-200MB are created and read / written repeatedly in the corresponding partition's mount directory ` / iotest` until the test duration for the mounted partition is reached or the available space on the partition is less than `file_size`. Using the condition that the available space on the partition is less than `file_size` as the criterion for terminating the test effectively prevents system crashes caused by the hard drive becoming full due to an excessively long test duration.

[0088] S206: Check the system log and hard drive Smart log for any abnormalities.

[0089] In a specific implementation, the system log and the hard disk Smart log are checked; when there are warning, error or fault status information in the hard disk Smart log, the corresponding ID attribute item is recorded and the corresponding abnormal information is recorded.

[0090] S207: Delete the test file to restore the available capacity of the partition and generate a test log.

[0091] In this specific implementation, all test files are deleted, thereby restoring the available capacity of all mounted partitions. Simultaneously, a test log is generated based on the recorded anomaly information.

[0092] This invention provides a stress testing method for system hard drives. By creating and reading / writing files on each mounted partition, the system hard drive is stress tested. This method achieves the purpose of testing the hard drive and prevents system crashes caused by hard drive read / write operations through fragmentation. It covers a larger hard drive space and divides the test area more finely, which can expose early hard drive failures through stress testing, thereby effectively reducing client-side quality issues.

[0093] See Figure 3 As shown, the present invention also discloses a system hard disk stress testing system, including: a partition information acquisition unit 1, a partition capacity confirmation unit 2, a partition test duration calculation unit 3, a loop test unit 4, and a recording unit 5.

[0094] Partition information acquisition unit 1 is configured to acquire mounted partition information of the system hard drive.

[0095] In a specific implementation, the partition information acquisition unit 1 is specifically used to: obtain a list of mounted partitions of the system hard disk; and determine the mount directory of each mounted partition based on the mounted partition name in the mounted partition list.

[0096] Partition capacity confirmation unit 2 is configured to obtain the available capacity of each mounted partition based on the mounted partition information.

[0097] In a specific implementation, the partition capacity confirmation unit 2 is specifically used to: determine the available capacity of each mounted partition based on the mounted partition name in the mounted partition list; and calculate the total available capacity of the system hard disk based on the available capacity of each mounted partition.

[0098] Partition test duration calculation unit 3 is configured to set the total test duration and calculate the test duration for each mounted partition based on the available capacity of each mounted partition.

[0099] In a specific implementation, the partition test duration calculation unit 3 is specifically used for: setting the total test duration T; calculating the allocated capacity S per unit time according to the formula S = S0 / T; where S0 is the total available capacity of the system hard disk; and calculating the test duration of each mounted partition according to the formula Tn = Rn / S; where Tn is the test duration of the nth mounted partition and Rn is the available capacity of the nth mounted partition.

[0100] Loop test unit 4 is configured to perform read / write stress tests in each mounted partition based on the test duration of each mounted partition.

[0101] In a specific implementation, the loop test unit 4 is specifically used to: set the minimum time for the read / write stress test; start the read / write stress test tool, create test files in the mount directory and perform read / write operations in a loop; when the test duration reaches the test duration of the mount partition or the available space of the mount partition being tested is less than the size of the test file, the read / write stress test ends.

[0102] Recording unit 5 is configured to generate a test report and clear the files generated during the test after the test is completed.

[0103] In a specific implementation, the recording unit 5 is specifically used for: generating a test log after the read / write stress test of all mounted partitions is completed; deleting all test files to restore the available capacity of all mounted partitions; checking the system log and the hard drive's self-monitoring analysis and technical report; and recording the corresponding ID attribute items and generating a test report when there are warning, error, or fault status information in the hard drive's self-monitoring analysis and technical report.

[0104] Therefore, this invention provides a system hard drive stress testing system. By creating files on each partition of the system hard drive and performing file read and write tests, it achieves hard drive stress testing covering the system partitions. This stress test can expose early hard drive failures and effectively reduce client-side quality issues.

[0105] See Figure 4 As shown, the present invention also discloses a system hard disk stress testing device, including a processor 101 and a memory 102; wherein, when the processor 101 executes the system hard disk stress testing program stored in the memory, it performs the following steps:

[0106] 1. Collect the mounted partition information of the system hard drive.

[0107] 2. Obtain the available capacity of each mounted partition based on the mounted partition information.

[0108] 3. Set the total test duration and calculate the test duration for each mounted partition based on the available capacity of each mounted partition.

[0109] 4. Perform read / write stress tests on each mounted partition according to the test duration of each mounted partition.

[0110] 5. After the test is completed, generate a test report and delete the files generated by the test.

[0111] The stress testing device for the system hard drive provided in this embodiment may include, but is not limited to, smartphones, tablets, laptops, or desktop computers.

[0112] The processor 101 may include one or more processing cores, such as a quad-core processor or an octa-core processor. The processor 101 may be implemented using at least one hardware form selected from Digital Signal Processor (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). The processor 101 may also include a main processor and a coprocessor. The main processor, also known as the Central Processing Unit (CPU), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor 101 may integrate a Graphics Processing Unit (GPU), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, the processor 101 may also include an Artificial Intelligence (AI) processor, which handles computational operations related to machine learning.

[0113] The memory 102 may include one or more computer-readable storage media, which may be non-transitory. The memory 102 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In this embodiment, the memory 102 is used to store at least the following computer program, which, after being loaded and executed by the processor 101, is capable of implementing the relevant steps of the system hard disk stress testing method disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory 102 may also include operating systems and data, and the storage method may be temporary or permanent storage. The operating system may include Windows, Unix, Linux, etc. The data may include, but is not limited to, the data involved in the aforementioned system hard disk stress testing method.

[0114] In a specific implementation, when the processor 101 executes the computer program stored in the memory 102, it may specifically implement the following steps: obtain the list of mounted partitions of the system hard disk; determine the mount directory of each mounted partition according to the name of the mounted partition in the list of mounted partitions.

[0115] In a specific implementation, when the processor 101 executes the computer program stored in the memory 102, it may specifically implement the following steps: determine the available capacity of each mounted partition according to the mounted partition name in the mounted partition list; calculate the total available capacity of the system hard disk according to the available capacity of each mounted partition.

[0116] In a specific implementation, when the processor 101 executes the computer program stored in the memory 102, it can specifically implement the following steps: setting the total test duration T; calculating the allocated capacity S per unit time according to the formula S = S0 / T; where S0 is the total available capacity of the system hard disk; calculating the test duration of each mounted partition according to the formula Tn = Rn / S; where Tn is the test duration of the nth mounted partition and Rn is the available capacity of the nth mounted partition.

[0117] In a specific implementation, when the processor 101 executes the computer program stored in the memory 102, it can specifically implement the following steps: setting the minimum time for the read / write stress test; starting the read / write stress test tool, creating test files in the mounted directory and performing read / write operations in a loop; when the test duration reaches the test duration of the mounted partition or the available space of the currently tested mounted partition is less than the size of the test file, the read / write stress test ends.

[0118] In a specific implementation, when the processor 101 executes the computer program stored in the memory 102, it can specifically implement the following steps: after the read / write stress test of all mounted partitions is completed, a test log is generated; all test files are deleted to restore the available capacity of all mounted partitions; the system log and the hard disk's self-monitoring analysis and technical report are checked; when there are warning, error or fault status information in the hard disk's self-monitoring analysis and technical report, the corresponding ID attribute item is recorded and a test report is generated.

[0119] Furthermore, the stress testing device for the system hard drive in this embodiment may also include:

[0120] Input interface 103 is used to acquire stress test programs imported from external systems and save the acquired stress test programs to the memory 102. It can also be used to acquire various instructions and parameters transmitted from external terminal devices and transmit them to the processor 101, so that the processor 101 can perform corresponding processing using these instructions and parameters. In this embodiment, input interface 103 may specifically include, but is not limited to, a USB interface, a serial interface, a voice input interface, a fingerprint input interface, a hard disk read interface, etc.

[0121] The output interface 104 is used to output various data generated by the processor 101 to a connected terminal device, so that other terminal devices connected to the output interface can obtain the various data generated by the processor 101. In this embodiment, the output interface 104 may specifically include, but is not limited to, a USB interface, a serial interface, etc.

[0122] The communication unit 105 is used to establish a remote communication connection between the server-running business optimization configuration device and the external server, so that the system hard disk stress testing device can mount the image file to the external server. In this embodiment, the communication unit 105 may specifically include, but is not limited to, a remote communication unit based on wireless communication technology or wired communication technology.

[0123] Keyboard 106 is used to acquire various parameter data or commands input by the user through real-time keystrokes.

[0124] Display 107 is used to display relevant information about the stress test process of the running system hard disk in real time.

[0125] Mouse 108 can be used to assist users in inputting data and simplifying user operations.

[0126] This invention also discloses a readable storage medium, which includes random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable hard disk, CD-ROM, or any other form of storage medium known in the art. The readable storage medium stores a stress test program for the system hard disk, which, when executed by a processor, performs the following steps:

[0127] 1. Collect the mounted partition information of the system hard drive.

[0128] 2. Obtain the available capacity of each mounted partition based on the mounted partition information.

[0129] 3. Set the total test duration and calculate the test duration for each mounted partition based on the available capacity of each mounted partition.

[0130] 4. Perform read / write stress tests on each mounted partition according to the test duration of each mounted partition.

[0131] 5. After the test is completed, generate a test report and delete the files generated by the test.

[0132] In summary, this invention enables hard drive stress testing covering system partitions, which can expose early hard drive failures and effectively reduce client-side quality issues.

[0133] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. The methods disclosed in the embodiments are described simply because they correspond to the systems disclosed in the embodiments; relevant details can be found in the method section.

[0134] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0135] In the embodiments provided by this invention, it should be understood that the disclosed systems, methods, and approaches can be implemented in other ways. For example, the system embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between systems or units may be electrical, mechanical, or other forms.

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

[0137] In addition, the functional modules in the various embodiments of the present invention can be integrated into one processing unit, or each module can exist physically separately, or two or more modules can be integrated into one unit.

[0138] Similarly, in the various embodiments of the present invention, each processing unit can be integrated into a functional module, or each processing unit can exist physically, or two or more processing units can be integrated into a functional module.

[0139] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.

[0140] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0141] The stress testing method, system, apparatus, and readable storage medium for the system hard disk provided by this invention have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this invention. The descriptions of the embodiments above are merely for the purpose of helping to understand the method and core ideas of this invention. It should be noted that those skilled in the art can make various improvements and modifications to this invention without departing from its principles, and these improvements and modifications also fall within the protection scope of the claims of this invention.

Claims

1. A method for stress testing a system hard disk, characterized in that, include: Collect the mounted partition information of the system hard drive; Obtain the available capacity of each mounted partition based on the mounted partition information; Set the total test duration, and calculate the test duration for each mounted partition based on the available capacity of each mounted partition; Perform read / write stress tests on each mounted partition based on the test duration of each mounted partition; After the test is completed, generate a test report and delete the files generated by the test; The total test duration is set by calculating the test duration for each mounted partition based on the available capacity of each mounted partition, including: Set the total test duration T; The allocated capacity S per unit time is calculated using the formula S=S0 / T; where S0 is the total available capacity of the system hard disk. The test duration for each mounted partition is calculated using the formula Tn=Rn / S; where Tn is the test duration for the nth mounted partition and Rn is the available capacity of the nth mounted partition.

2. The system hard disk stress testing method according to claim 1, characterized in that, The mounted partition information of the hard drive of the acquisition system includes: Get the list of mounted partitions on the system hard drive; Determine the mount directory for each mount partition based on the mount partition name in the mount partition list.

3. The system hard disk stress testing method according to claim 2, characterized in that, The step of obtaining the available capacity of each mounted partition based on the mounted partition information includes: Determine the available capacity of each mounted partition based on the mounted partition name in the mounted partition list; The total available capacity of the system hard drive is calculated based on the available capacity of each mounted partition.

4. The system hard disk stress testing method according to claim 1, characterized in that, The process of performing read / write stress tests on each mounted partition, based on the test duration of each partition, includes: Set the minimum time for read / write stress testing; Start the read / write stress test tool, create test files in the mounted directory and perform read / write operations in a loop; The read / write stress test ends when the test duration reaches the maximum duration of the mounted partition or when the available space of the currently tested mounted partition is less than the size of the test file.

5. The system hard disk stress testing method according to claim 4, characterized in that, After the test is completed, a test report is generated and the files generated by the test are deleted, including: Once the read / write stress test of all mounted partitions is complete, a test log will be generated. Delete all test files to restore the available capacity of all mounted partitions; Check system logs and hard drive self-monitoring analysis and technical reports; When the hard drive's self-monitoring analysis and technical report contains warnings, errors, or fault status information, the corresponding ID attribute items are recorded and a test report is generated.

6. The system hard disk stress testing method according to claim 4, characterized in that, The step of creating test files in a loop within the mounted directory and performing read and write operations includes: Randomly create test files ranging from 10 to 200 MB in size in the mounted directory and perform read and write operations on them.

7. A stress testing system for a system hard disk, characterized in that, include: Partition information acquisition unit, configured to acquire mounted partition information of the system hard drive; The partition capacity confirmation unit is configured to obtain the available capacity of each mounted partition based on the mounted partition information. The partition test duration calculation unit is configured to set the total test duration and calculate the test duration for each mounted partition based on the available capacity of each mounted partition. The loop test unit is configured to perform read / write stress tests on each mounted partition based on the test duration of each mounted partition. The recording unit is configured to generate a test report and clear the files generated during the test after the test is completed. The partition test duration calculation unit is specifically used for: Set the total test duration T; The allocated capacity S per unit time is calculated using the formula S=S0 / T; where S0 is the total available capacity of the system hard disk. The test duration for each mounted partition is calculated using the formula Tn=Rn / S; where Tn is the test duration for the nth mounted partition and Rn is the available capacity of the nth mounted partition.

8. A stress testing device for a system hard disk, characterized in that, include: Memory, used to store stress test programs for the system hard drive; A processor, configured to implement the steps of the system hard disk stress testing method as claimed in any one of claims 1 to 6 when executing the stress testing program for the system hard disk.

9. A readable storage medium, characterized in that: The readable storage medium stores a stress test program for the system hard disk, which, when executed by a processor, implements the steps of the stress test method for the system hard disk as described in any one of claims 1 to 6.