A mobile hard disk aging test automation test method and system

An automated testing script written in Python solved the problems of short testing time and inaccurate results in portable hard drive aging tests, enabling long-term operation and process monitoring of the hard drive, thus improving the accuracy and reliability of the test results.

CN109213644BActive Publication Date: 2025-01-14SHENZHEN KINGSPEC ELECTRONICS TECH
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN201810743601.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2018-07-09
Publication Date
2025-01-14
Estimated Expiration
2038-07-09

AI Technical Summary

Technical Problem

Existing methods for testing the aging of portable hard drives have short testing times, inaccurate results, and cannot effectively record the testing process.

Method used

It employs Python-based automated test scripts to achieve long-term continuous operation of the hard drive by setting the runtime of the test scripts, and records and monitors the test process, including file creation, deletion, and periodic checks on the hard drive status.

Benefits of technology

This enables the hard drive to run continuously for extended periods, improving the accuracy and reliability of test results and allowing for the timely detection of problems during the testing process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN109213644B_ABST
    Figure CN109213644B_ABST
Patent Text Reader

Abstract

The present invention discloses an automated test method and system for mobile hard disk aging test, the method comprising: obtaining information of the mobile hard disk to be tested; executing the test script according to the preset script running time; and calculating the execution result of the test script. The method eliminates manual detection, improves the test efficiency, and realizes the long-term continuous operation of the hard disk, and records and monitors the test process, and the test result has high accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of hard disks, and more specifically, relates to an automated testing method and system for mobile hard disk aging testing. Background Art

[0002] For mechanical keyboards, since they use electromagnetic induction when reading and writing, there is no contact between the magnetic head and the disk surface, and there is no friction loss problem, so there is basically no limit to the number of read and write times, but because its mechanical structure itself uses motors and other components, it still has a service life. For solid-state drives, depending on the type of flash memory chip, the shortest service life can reach 5-10 years.

[0003] Mobile hard disks will age and have a limited service life. In order to help users know their aging degree and predict their service life, mobile hard disk aging tests can be performed. Existing mobile hard disk aging tests mainly achieve long-term operation of the hard disk by copying and transferring large files, but the test time for copying and reading and writing files is limited, and the test process cannot be effectively recorded.

[0004] The patent with publication number CN107832176A discloses a method and system for automatic hard disk stress testing under Windows, the method comprising: entering the hard disk stress testing software; using the autoit tool to send commands to the operating system to automatically set the test parameters for the hard disk stress testing software; and performing hard disk stress testing according to the set test parameters. The system comprises: an import module, a test parameter automatic setting module, and a hard disk stress testing module. The test method and system in the present application can realize automatic setting of the test parameters in the hard disk stress testing software, with a high degree of automation. For hard disk stress testing with more CPU threads, a lot of time and manpower can be saved, thereby greatly improving the test efficiency. However, this method cannot effectively record the test process, and the test time is short, and the accuracy of the test results is low.

[0005] Compared with the prior art, the present invention writes automated test scripts based on Python and realizes long-term continuous operation of the hard disk by presetting the running time of the test scripts. At the same time, the test process is recorded and monitored, and the test results have high accuracy. Summary of the invention

[0006] In view of the above defects and improvement needs of the prior art, the present invention provides an automated testing method and system for mobile hard disk aging test, which aims to provide an automated testing method for mobile hard disk aging test that can realize long-term running of test scripts, effectively record the test process, and improve the accuracy of test results, thereby solving the technical problems of short test time and inaccurate test results in the prior art.

[0007] To achieve the above object, the present invention provides an automated test method for mobile hard disk aging test, comprising the steps of:

[0008] S1. Obtain the information of the mobile hard disk to be tested;

[0009] S2. Execute the test script according to the preset script running time;

[0010] S3. Calculate the test script execution result.

[0011] Furthermore, the method further comprises the steps of:

[0012] The information of the mobile hard disk to be tested is obtained at preset time intervals in order to calculate the test script execution result.

[0013] Further, step S2 specifically includes the steps of:

[0014] Test script 1 is executed according to the preset script running time to continuously create files and file contents in the mobile hard disk to be tested, and test script 2 is executed after a preset time interval to continuously delete the created files and file contents in the mobile hard disk to be tested.

[0015] Furthermore, the method further comprises the steps of:

[0016] According to the preset time interval, it is determined whether the mobile hard disk to be tested is written successfully and whether the mobile hard disk to be tested is mounted on the PC to be tested, so as to determine whether the execution of the test script is normal.

[0017] Furthermore, step S3 specifically includes the steps of:

[0018] The running time of the current mobile hard disk is obtained according to the information of the mobile hard disk to be tested obtained at the preset time interval, thereby calculating the continuous reading and writing time of the mobile hard disk, and calculating the execution result of the test script.

[0019] Accordingly, a mobile hard disk aging test automation test system is also provided, comprising:

[0020] An acquisition module is used to obtain the information of the mobile hard disk to be tested;

[0021] An execution module is used to execute the test script according to the preset script running time;

[0022] The calculation module is used to calculate the execution result of the test script.

[0023] Furthermore, it also includes:

[0024] The acquisition module is used to acquire the information of the mobile hard disk to be tested according to a preset time interval.

[0025] Furthermore, it also includes:

[0026] A creation unit, used to continuously create files and file contents in the hard disk according to test script 1;

[0027] The deleting unit is used to continuously delete the created files and file contents according to the test script 2 after a preset time interval.

[0028] Furthermore, it also includes:

[0029] The judgment module is used to judge whether the mobile hard disk to be tested is written successfully and whether the mobile hard disk to be tested is mounted on the PC to be tested according to a preset time interval.

[0030] Furthermore, it also includes:

[0031] The calculation module is used to calculate the continuous reading and writing time of the mobile hard disk.

[0032] Compared with the prior art, the present invention has the following advantages:

[0033] By writing automated test scripts based on Python and presetting the running time of the test scripts, the hard disk can be continuously operated for a long time. At the same time, the test process is recorded and monitored, and the test results are highly accurate. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 This is a flow chart of an automated test method for mobile hard disk aging test provided in Example 1;

[0035] Figure 2 This is a structural diagram of an automated test system for mobile hard disk aging test provided in Example 1;

[0036] Figure 3 This is a flow chart of an automated test method for mobile hard disk aging test provided in Example 2;

[0037] Figure 4 This is a structural diagram of an automated test system for mobile hard disk aging test provided in Example 2. DETAILED DESCRIPTION

[0038] The following are specific embodiments of the present invention and the accompanying drawings to further describe the technical solution of the present invention, but the present invention is not limited to these embodiments.

[0039] Embodiment 1

[0040] This embodiment provides an automated test method for mobile hard disk aging test. Figure 1 As shown, the steps include:

[0041] S11. Obtaining the information of the mobile hard disk to be tested;

[0042] S12. Execute the test script according to the preset script running time;

[0043] S13. Calculate the test script execution result.

[0044] Furthermore, the method further comprises the steps of:

[0045] The information of the mobile hard disk to be tested is obtained at preset time intervals in order to calculate the test script execution result.

[0046] Furthermore, step S12 specifically includes the steps of:

[0047] Test script 1 is executed according to the preset script running time to continuously create files and file contents in the mobile hard disk to be tested, and test script 2 is executed after a preset time interval to continuously delete the created files and file contents in the mobile hard disk to be tested.

[0048] Furthermore, step S13 specifically includes the steps of:

[0049] The running time of the current mobile hard disk is obtained according to the information of the mobile hard disk to be tested obtained at the preset time interval, thereby calculating the continuous reading and writing time of the mobile hard disk, and calculating the execution result of the test script.

[0050] Insert the hard disk to be tested into the PC to be tested, and obtain the information of the mobile hard disk to be tested, including: hard disk identification name, hard disk power-on time and hard disk current time. After obtaining the relevant information of the mobile hard disk to be tested, start executing the test script, which is an automated test script written based on Python. Python is an object-oriented interpreted computer programming language, and its source code and interpreter CPython follow the GPL (General Public License) protocol. Python has a rich and powerful library that can easily connect various modules made in other languages.

[0051] The execution of the test script is carried out under the condition of the preset script running time, which can be 72 hours, 10 days, etc. The user can set it according to the stress test needs and environmental requirements. The more reliable test time is 3 days. The execution process can be summarized as follows: Test script 1 creates files and file contents in the mobile hard disk to be tested, and continues to create; Test script 2 waits for test script 1 to run for 10 seconds, and then continuously deletes the files created in test script 1 in the mobile hard disk to be tested. The files are arranged in chronological order to ensure that the hard disk capacity is not filled.

[0052] After the mobile hard disk to be tested is powered on, during the execution of the test script, the mobile hard disk information to be tested needs to be continuously obtained at preset time intervals. This is to monitor whether the execution of the test script is normal on the one hand, and on the other hand, by obtaining the power-on time information T1, T2, T3...Tn of the mobile hard disk to be tested, the current running time of the mobile hard disk to be tested is obtained, thereby calculating the continuous reading and writing time of the mobile hard disk, and calculating whether the running result of the test script is PASS or FAIL. The preset time interval can be 5 minutes, or a longer or shorter time interval can be set to further ensure the accuracy of the test results.

[0053] Accordingly, a mobile hard disk aging test automation test system is also provided, such as Figure 2 As shown, including:

[0054] The acquisition module 11 is used to acquire the information of the mobile hard disk to be tested;

[0055] An execution module 12 is used to execute the test script according to a preset script running time;

[0056] The calculation module 13 is used to calculate the test script execution result.

[0057] Furthermore, it also includes:

[0058] The acquisition module 11 is used to acquire the information of the mobile hard disk to be tested according to a preset time interval.

[0059] Furthermore, it also includes:

[0060] A creation unit 14, used to continuously create files and file contents in the hard disk according to the test script 1;

[0061] The deleting unit 15 is used to continuously delete the created files and file contents according to the test script 2 after a preset time interval.

[0062] Furthermore, it also includes:

[0063] The calculation module 13 is used to calculate the continuous reading and writing time of the mobile hard disk.

[0064] After the acquisition module 11 acquires the identification name, power-on time, current time and other information of the mobile hard disk to be tested, the execution module 12 executes the test script in the mobile hard disk to be tested according to the preset script running time. Specifically, the creation unit 14 in the execution module 12 continuously creates files and file contents in the hard disk according to the test script 1. After the preset time interval, the deletion unit 15 in the execution module 12 continuously deletes the created files and file contents according to the test script 2. During the execution of the test script by the execution module 12, the acquisition module 11 acquires the information of the mobile hard disk to be tested according to the preset time interval. When the execution module 12 finishes executing the running time of the test script, the calculation module 13 calculates the test script execution result according to the recorded data.

[0065] This embodiment uses Python to write automated test scripts, and by presetting the running time of the test scripts, it achieves long-term continuous operation of the hard disk. At the same time, the test process is recorded and monitored, and the test results have high accuracy.

[0066] Embodiment 2

[0067] This embodiment provides an automated test method for mobile hard disk aging test. Figure 3 As shown, the steps include:

[0068] S21. Obtain the information of the mobile hard disk to be tested;

[0069] S22. Execute the test script according to the preset script running time;

[0070] S23. Calculate the test script execution result.

[0071] Furthermore, the method further comprises the steps of:

[0072] The information of the mobile hard disk to be tested is obtained at preset time intervals in order to calculate the test script execution result.

[0073] Further, step S22 specifically includes the steps of:

[0074] Test script 1 is executed according to the preset script running time to continuously create files and file contents in the mobile hard disk to be tested, and test script 2 is executed after a preset time interval to continuously delete the created files and file contents in the mobile hard disk to be tested.

[0075] Furthermore, the method further comprises the steps of:

[0076] According to the preset time interval, it is determined whether the mobile hard disk to be tested is written successfully and whether the mobile hard disk is mounted on the PC to be tested, so as to determine whether the execution of the test script is normal.

[0077] Further, step S23 specifically includes the steps of:

[0078] The running time of the current mobile hard disk is obtained according to the information of the mobile hard disk to be tested obtained at the preset time interval, thereby calculating the continuous reading and writing time of the mobile hard disk, and calculating the execution result of the test script.

[0079] The difference from the first embodiment is that the method further includes the following steps:

[0080] According to the preset time interval, it is determined whether the mobile hard disk to be tested is written successfully and whether the mobile hard disk to be tested is mounted on the PC to be tested, so as to determine whether the execution of the test script is normal.

[0081] During the execution of the test script, the reading and writing of the mobile hard disk must be checked. At preset time intervals, the reading and writing of the mobile hard disk is checked regularly. If successful, it means that the test script is executing normally, and the number of files written is recorded so that after the test script is executed, data comparison can be performed when calculating the execution results to further improve the accuracy of the test. During the execution of the test script, it is also necessary to regularly check whether the mobile hard disk is mounted on the PC to be tested. At preset time intervals, the reading and writing of the mobile hard disk is checked regularly. If it is still mounted on the PC to be tested, it means that the test script is running normally.

[0082] Compared with the first embodiment, the advantages of this embodiment are:

[0083] Regularly checking the test script and the status of the mobile hard disk to be tested can help to detect problems in a timely manner and improve the accuracy of the test script execution results.

[0084] Accordingly, a mobile hard disk aging test automation test system is also provided, such as Figure 4 As shown, including:

[0085] The acquisition module 21 is used to acquire the information of the mobile hard disk to be tested;

[0086] An execution module 22 is used to execute the test script according to a preset script running time;

[0087] The calculation module 23 is used to calculate the test script execution result.

[0088] Furthermore, it also includes:

[0089] The acquisition module 21 is used to acquire the information of the mobile hard disk to be tested according to a preset time interval.

[0090] Furthermore, it also includes:

[0091] A creation unit 24, used to continuously create files and file contents in the hard disk according to the test script 1;

[0092] The deleting unit 25 is used to continuously delete the created files and file contents according to the test script 2 after a preset time interval.

[0093] Furthermore, it also includes:

[0094] The judgment module 26 is used to judge whether the mobile hard disk to be tested is written successfully and whether the mobile hard disk to be tested is mounted on the PC to be tested according to a preset time interval.

[0095] Furthermore, it also includes:

[0096] The calculation module 23 is used to calculate the continuous reading and writing time of the mobile hard disk.

[0097] The difference from the first embodiment is that a judgment module 26 is further included.

[0098] The judgment module 26 is used to judge whether the mobile hard disk to be tested is written successfully and whether the mobile hard disk to be tested is mounted on the PC to be tested according to a preset time interval.

[0099] When the execution module 22 executes the test script, the judgment module 26 judges whether the mobile hard disk to be tested is written successfully and whether the mobile hard disk to be tested is mounted on the PC to be tested according to the preset time interval. Regularly checking the status of the test script and the mobile hard disk to be tested helps to find problems in time and improve the accuracy of the test script execution results.

[0100] The specific embodiments described herein are merely examples of the spirit of the present invention. Those skilled in the art may make various modifications or additions to the specific embodiments described or replace them in similar ways, but they will not deviate from the spirit of the present invention or exceed the scope defined by the appended claims.

Claims

1. A mobile hard disk aging automated testing method, characterized in that: Includes steps: S1. Obtain the information of the mobile hard disk to be tested; S2. Execute the test script according to the preset script running time; S3. Calculate the test script execution results; Also includes the steps: Obtain the information of the mobile hard disk to be tested at preset time intervals in order to calculate the test script execution results; Step S2 specifically includes the following steps: Execute test script 1 according to the preset script running time, continuously create files and file contents in the mobile hard disk to be tested, and execute test script 2 after the preset time interval to continuously delete the created files and file contents in the mobile hard disk to be tested; the test script 1 creates files and file contents in the mobile hard disk to be tested, and continues to create; the test script 2 waits for test script 1 to run for 10 seconds, and then continuously deletes the files created in test script 1 in the mobile hard disk to be tested, and the files are arranged in chronological order to ensure that the hard disk capacity is not filled; Step S3 specifically includes the following steps: The running time of the current mobile hard disk is obtained according to the information of the mobile hard disk to be tested obtained at the preset time interval, thereby calculating the continuous reading and writing time of the mobile hard disk, and calculating the execution result of the test script.

2. The mobile hard disk aging test automation test method according to claim 1, characterized in that: Also includes the steps: According to the preset time interval, it is determined whether the mobile hard disk to be tested is written successfully and whether the mobile hard disk to be tested is mounted on the PC to be tested, so as to determine whether the execution of the test script is normal.

3. A mobile hard disk aging test automation test system, characterized in that: include: An acquisition module is used to obtain the information of the mobile hard disk to be tested; An execution module is used to execute the test script according to the preset script running time; A calculation module, used for calculating the test script execution result; The execution module also includes: A creation unit, used to continuously create files and file contents in the hard disk according to test script 1; A deleting unit, used to continuously delete the created files and file contents according to test script 2 after a preset time interval; The test script 1 creates files and file contents in the mobile hard disk to be tested, and continues to create files; the test script 2 waits for the test script 1 to run for 10 seconds, and then continues to delete the files created in the test script 1 in the mobile hard disk to be tested. The files are arranged in chronological order to ensure that the hard disk capacity is not filled; The calculation module also obtains the running time of the current mobile hard disk according to the mobile hard disk information to be tested obtained at the preset time interval, thereby calculating the continuous reading and writing time of the mobile hard disk, and calculating the execution result of the test script; The acquisition module is used to acquire the information of the mobile hard disk to be tested according to a preset time interval.

4. The mobile hard disk aging test automation test system according to claim 3, characterized in that: Also includes: The judgment module is used to judge whether the mobile hard disk to be tested is mounted on the PC to be tested according to a preset time interval.

Citation Information

Patent Citations

  • Method and system for hard disk pressure automatic test in Windows

    CN107832176A

  • Disk pressure testing method for Linux server

    CN103473158A

  • Method and device for testing hard disks

    CN104765665A

  • SSD product test system

    CN106710636A