Hard drive upgrade / downgrade testing methods, devices, electronic equipment, and storage media

By obtaining the hard drive's SMART information under the Linux system for stress testing and firmware version upgrades/downgrades, the problem of hard drive anomalies in FIO testing was solved, achieving comprehensiveness and accuracy in hard drive stability assessment.

CN115658136BActive Publication Date: 2026-07-31INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

When performing hard drive FIO testing and firmware version upgrade/downgrade testing simultaneously under a Linux system, it is impossible to determine whether it will lead to abnormal issues such as system crashes or hard drive failures. Existing testing methods cannot fully assess system stability.

Method used

By acquiring the initial SMART information of the hard drive, stress testing is performed in response to FIO test commands, and firmware version upgrade/downgrade operations are executed during the stress test. Upgrade/downgrade test results are generated using the target SMART information, including test normal and abnormal information.

Benefits of technology

It enriches the methods for testing hard drive stability, improves the accuracy of test results, and ensures the stability assessment of hard drives during FIO testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115658136B_ABST
    Figure CN115658136B_ABST
Patent Text Reader

Abstract

This invention provides a method, apparatus, electronic device, and storage medium for hard drive upgrade / downgrade testing. The method includes: acquiring initial SMART information corresponding to the hard drive; then, in response to an FIO test command for the hard drive, acquiring stress test information corresponding to the FIO test command, and continuously performing stress tests on the hard drive based on the stress test information; then, in response to acquiring a firmware upgrade / downgrade command for the hard drive during the continuous stress test, performing a firmware version upgrade / downgrade operation on the hard drive according to the firmware upgrade / downgrade command; if the hard drive is detected to have completed the upgrade / downgrade operation corresponding to the firmware upgrade / downgrade command, acquiring target SMART information corresponding to the hard drive, and generating upgrade / downgrade test results for the hard drive based on the initial SMART information and the target SMART information. On the one hand, by combining FIO testing and upgrade / downgrade testing, the method of hard drive stability testing is enriched, and the accuracy of test results can be effectively guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of equipment testing technology, and in particular to a hard disk upgrade / downgrade testing method, a hard disk upgrade / downgrade testing device, an electronic device, and a computer-readable storage medium. Background Technology

[0002] Currently, Linux systems are widely used on servers, offering advantages over Windows in terms of stability and less susceptibility to crashes. During server operation, routine firmware upgrade / downgrade testing of server hard drives generally prevents system crashes or disk failures. However, performing firmware upgrade / downgrade testing on the hard drive during FIO (Flexible I / O Tester) stress testing raises concerns about its impact on system stability. It's possible that disk failures or system crashes may occur during the firmware upgrade / downgrade process. Therefore, determining how to perform firmware upgrade / downgrade testing on the hard drive during FIO stress testing is crucial for assessing the stability of Linux servers and is of great significance to both hardware manufacturers and Linux users. Summary of the Invention

[0003] The present invention provides a method, apparatus, electronic device, and computer-readable storage medium for hard disk upgrade / downgrade testing, in order to solve or partially solve the problem in the related art that firmware version upgrade / downgrade testing cannot be performed simultaneously with FIO testing of the hard disk of a device.

[0004] This invention discloses a method for upgrading or downgrading a hard drive, applied to an electronic device running a Linux system, the electronic device including a hard drive, the method comprising:

[0005] Obtain the initial SMART information corresponding to the hard drive;

[0006] In response to an FIO test command for the hard drive, stress test information corresponding to the FIO test command is obtained, and stress test is continuously performed on the hard drive based on the stress test information;

[0007] In response to receiving a firmware upgrade / downgrade instruction for the hard drive during continuous stress testing, the firmware version upgrade / downgrade operation for the hard drive is performed according to the firmware upgrade / downgrade instruction.

[0008] If the hard drive is detected to have completed the upgrade / downgrade operation corresponding to the firmware upgrade / downgrade instruction, the target SMART information corresponding to the hard drive is obtained, and the upgrade / downgrade test result corresponding to the hard drive is generated based on the initial SMART information and the target SMART information. The upgrade / downgrade test result includes one of test normal information and test abnormal information.

[0009] Optionally, the stress test information includes at least block size, queue depth, asynchronous mode, and read / write strategy information, and the step of continuously stress testing the hard drive based on the stress test information includes:

[0010] The hard drive is subjected to continuous stress testing according to the block size, queue depth, asynchronous mode, and read / write strategy information.

[0011] Optionally, the firmware upgrade / downgrade instruction includes a version upgrade instruction and a target version number, and the step of performing a firmware version upgrade / downgrade operation on the hard drive according to the firmware upgrade / downgrade instruction includes:

[0012] Obtain the current version number of the hard drive;

[0013] The current version can be upgraded to the target version number step by step using the version upgrade instruction, or the current version can be upgraded to the target version number using the version upgrade instruction.

[0014] Optionally, the firmware upgrade / downgrade instruction includes a version downgrade instruction and a target version number, and the step of performing a firmware version upgrade / downgrade operation on the hard drive according to the firmware upgrade / downgrade instruction includes:

[0015] Obtain the current version number of the hard drive;

[0016] The version downgrade instruction is used to downgrade the current version number to the target version number step by step, or the version downgrade instruction is used to downgrade the current version number to the target version number.

[0017] Optionally, the firmware upgrade / downgrade instruction includes a version upgrade instruction, a target version number, and a number of tests. The step of performing a firmware upgrade / downgrade operation on the hard drive according to the firmware upgrade / downgrade instruction includes:

[0018] The version upgrade command is used to upgrade the current version number of the hard drive to the target version number one by one until the number of upgrades for the hard drive reaches the number of tests, at which point the upgrade / downgrade operation of the hard drive ends.

[0019] Optionally, the SMART information includes at least a hard drive status identifier, and the step of generating the upgrade / downgrade test result corresponding to the hard drive based on the initial SMART information and the target SMART information includes:

[0020] If the first hard disk status identifier in the initial SMART information is different from the second hard disk status identifier in the target SMART information, then test anomaly information for the hard disk is generated.

[0021] If the first hard disk status identifier is the same as the second hard disk status identifier, then test normal information for the hard disk is generated;

[0022] The hard drive status identifier includes at least one of the following: a health status identifier, a hard drive lock status identifier, and a test status identifier.

[0023] Optionally, the SMART information includes hard disk status parameters, and the step of generating the upgrade / downgrade test result corresponding to the hard disk based on the initial SMART information and the target SMART information includes:

[0024] If at least one of the hard disk status parameters in the target SMART information does not meet the corresponding preset threshold, test anomaly information for the hard disk is generated.

[0025] If all the hard disk status parameters in the target SMART information meet the corresponding preset threshold, then normal test information for the hard disk is generated.

[0026] The hard disk status parameters include at least one of the following: number of remapped sectors, number of reset configuration events, and temperature.

[0027] This invention also discloses a hard drive upgrade / downgrade testing device, applied to an electronic device running a Linux system, the electronic device including a hard drive, and the device comprising:

[0028] The first information acquisition module is used to acquire the initial SMART information corresponding to the hard disk;

[0029] The stress testing module is used to respond to the FIO test command for the hard disk, obtain stress test information corresponding to the FIO test command, and continuously perform stress test on the hard disk according to the stress test information;

[0030] The firmware testing module is used to respond to a firmware upgrade / downgrade command for the hard drive obtained during continuous stress testing of the hard drive, and to perform a firmware version upgrade / downgrade operation for the hard drive according to the firmware upgrade / downgrade command.

[0031] The second information acquisition module is used to acquire the target SMART information corresponding to the hard drive if it is detected that the hard drive has completed the upgrade operation corresponding to the firmware upgrade command, and generate the upgrade test result corresponding to the hard drive based on the initial SMART information and the target SMART information. The upgrade test result includes one of test normal information and test abnormal information.

[0032] Optionally, the stress test information includes at least block size, queue depth, asynchronous mode, and read / write strategy information, and the stress test module is specifically used for:

[0033] The hard drive is subjected to continuous stress testing according to the block size, queue depth, asynchronous mode, and read / write strategy information.

[0034] Optionally, the firmware upgrade / downgrade instruction includes a version upgrade instruction and a target version number, and the firmware testing module is specifically used for:

[0035] Obtain the current version number of the hard drive;

[0036] The current version can be upgraded to the target version number step by step using the version upgrade instruction, or the current version can be upgraded to the target version number using the version upgrade instruction.

[0037] Optionally, the firmware upgrade / downgrade command includes a version downgrade command and a target version number, and the firmware testing module is specifically used for:

[0038] Obtain the current version number of the hard drive;

[0039] The version downgrade instruction is used to downgrade the current version number to the target version number step by step, or the version downgrade instruction is used to downgrade the current version number to the target version number.

[0040] Optionally, the firmware upgrade / downgrade instruction includes a version upgrade instruction, a target version number, and a number of tests. The firmware testing module is specifically used for:

[0041] The version upgrade command is used to upgrade the current version number of the hard drive to the target version number one by one until the number of upgrades for the hard drive reaches the number of tests, at which point the upgrade / downgrade operation of the hard drive ends.

[0042] Optionally, the SMART information includes at least a hard disk status identifier, and the second information acquisition module is specifically used for:

[0043] If the first hard disk status identifier in the initial SMART information is different from the second hard disk status identifier in the target SMART information, then test anomaly information for the hard disk is generated.

[0044] If the first hard disk status identifier is the same as the second hard disk status identifier, then test normal information for the hard disk is generated;

[0045] The hard drive status identifier includes at least one of the following: a health status identifier, a hard drive lock status identifier, and a test status identifier.

[0046] Optionally, the SMART information includes hard disk status parameters, and the second information acquisition module is specifically used for:

[0047] If at least one of the hard disk status parameters in the target SMART information does not meet the corresponding preset threshold, test anomaly information for the hard disk is generated.

[0048] If all the hard disk status parameters in the target SMART information meet the corresponding preset threshold, then normal test information for the hard disk is generated.

[0049] The hard disk status parameters include at least one of the following: number of remapped sectors, number of reset configuration events, and temperature.

[0050] This invention also discloses an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;

[0051] The memory is used to store computer programs;

[0052] When the processor executes a program stored in the memory, it implements the method described in the embodiments of the present invention.

[0053] This invention also discloses a computer-readable storage medium storing instructions that, when executed by one or more processors, cause the processors to perform the methods described in this invention.

[0054] The embodiments of the present invention have the following advantages:

[0055] In this embodiment of the invention, for an electronic device operating a Linux system, during the hard drive upgrade / downgrade test, the initial SMART information corresponding to the hard drive can be obtained. Then, in response to an FIO test command for the hard drive, stress test information corresponding to the FIO test command can be obtained, and stress testing of the hard drive can be continuously performed based on the stress test information. Then, in response to the continuous stress testing of the hard drive, a firmware upgrade / downgrade command for the hard drive can be obtained, and a firmware version upgrade / downgrade operation can be performed based on the firmware upgrade / downgrade command. If the hard drive is detected to have completed the upgrade / downgrade operation corresponding to the firmware upgrade / downgrade command, the target SMART information corresponding to the hard drive is obtained, and an upgrade / downgrade test result is generated based on the initial SMART information and the target SMART information. The upgrade / downgrade test result includes one of two types of test results: normal test information and abnormal test information. Therefore, by performing firmware upgrade / downgrade testing on the hard drive simultaneously with the FIO process test, the combination of FIO testing and upgrade / downgrade testing enriches the methods for hard drive stability testing. Furthermore, by detecting the test results of the hard drive based on the SMART information before and after the test, the accuracy of the test results can be effectively guaranteed. Attached Figure Description

[0056] Figure 1 This is a flowchart of the steps of a hard drive upgrade / downgrade testing method provided in an embodiment of the present invention;

[0057] Figure 2 This is a structural block diagram of a hard drive upgrade / downgrade testing device provided in an embodiment of the present invention;

[0058] Figure 3 This is a block diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0059] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0060] As an example, during server use, routine FW (Firmware) upgrade / downgrade tests on the server's hard drive generally do not result in system crashes or disk failures. However, if the system is subjected to stress testing (FIO, or Flexible I / O Tester) and then FW upgrade / downgrade tests are performed on the hard drive, it is impossible to determine whether this will affect the normal operation of the system. It is possible that during the FW upgrade / downgrade process, the hard drive may fail, and the system may crash.

[0061] Among the related technologies, the testing method used is based on the Linux system, and performs firmware upgrade / downgrade tests on the hard drive in RAID (Redundant Arrays of Independent Disks) mode or Direct Mode Operator mode. The test steps are as follows:

[0062] In RAID card mode, when using a RAID array, the hard drive firmware can be refreshed via command:

[0063] 1. Query the hard drive information of the RAID card: . / storcli64 / c0 show

[0064] 2. Check the hard drive's firmware information: . / storcli64 / c0 / e* / show all|grep –I firmware

[0065] 3. To upgrade the hard drive firewall, you can use a loop statement: for i in {0..12}; do . / storcli64 / c0 / e* / s$idownload src=FWscript; sleep 1; done.

[0066] However, the above process is based solely on the Linux system, performing FW upgrade and downgrade tests on the device's hard drive within the system. The testing method is relatively simple and cannot comprehensively test the system's stability, which may lead to hidden performance problems of the system and hard drive not being exposed.

[0067] One of the core inventive points of this invention is that, for electronic devices operating on Linux systems, during hard drive upgrade / downgrade testing, the initial SMART information corresponding to the hard drive can be obtained. Then, in response to an FIO test command for the hard drive, stress test information corresponding to the FIO test command can be obtained, and stress testing of the hard drive can be continuously performed based on the stress test information. Then, in response to the continuous stress testing of the hard drive, a firmware upgrade / downgrade command for the hard drive can be obtained, and a firmware version upgrade / downgrade operation can be performed according to the firmware upgrade / downgrade command. If the hard drive is detected to have completed the upgrade / downgrade operation corresponding to the firmware upgrade / downgrade command, the target SMART information corresponding to the hard drive is obtained, and an upgrade / downgrade test result is generated based on the initial SMART information and the target SMART information. The upgrade / downgrade test result includes either normal test information or abnormal test information for the hard drive. Therefore, by performing firmware upgrade / downgrade testing on the hard drive simultaneously with the FIO process test, the combination of FIO testing and upgrade / downgrade testing enriches the methods for hard drive stability testing. Furthermore, by detecting the test results of the hard drive based on the SMART information before and after the test, the accuracy of the test results can be effectively guaranteed.

[0068] Reference Figure 1 This diagram illustrates a flowchart of a hard drive upgrade / downgrade testing method provided in an embodiment of the present invention. The method is applied to an electronic device running a Linux system, and the electronic device includes a hard drive. Specifically, it may include the following steps:

[0069] Step 101: Obtain the initial SMART information corresponding to the hard disk;

[0070] Optionally, the electronic device can be a server, which can run a Linux system and be configured with a corresponding hard drive for data storage, etc. It should be noted that in this embodiment of the invention, a server is used as an example for illustrative purposes; it is understood that the invention can also be applied to other electronic devices with hard drives, and the invention does not limit this application.

[0071] Before testing the hard drive of an electronic device, initial SMART information can be obtained to assess the hard drive's status. Typically, the initial SMART information acquired before testing the hard drive indicates that it is in normal operating condition. For example, SMART information may include health status indicators, hard drive lock status indicators, test status indicators, number of remapped sectors, number of reset configuration events, temperature, and SMART test results.

[0072] It's important to note that SMART stands for "Self-Monitoring Analysis and Reporting Technology." It's an automatic hard drive status detection and early warning system and standard. By monitoring and recording the operation of hard drive hardware components such as read / write heads, platters, motors, and circuitry using internal hardware monitoring commands, it compares 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.

[0073] The status of each SMART information item during normal hard drive operation can be as follows: SMARTHealth Status: OK; Reallocated_Sector_Ct: Standard value < 5; Pending_Sector: Standard value < 10; Reallocated_Event_Count: Standard value < 5; SMART overall-health self-assessment test result: Standard value PASSED; Temperature: Standard value: SSD < 74℃, HDD < 65℃; The hard drive is locked: Standard value notlocked, etc. These different parameters can be used to indicate whether the hard drive is operating normally.

[0074] Step 102: In response to the FIO test command for the hard disk, obtain the stress test information corresponding to the FIO test command, and continuously perform stress test on the hard disk according to the stress test information;

[0075] To enrich the testing methods for hard drive stability, a stress test can be performed on the hard drive before testing firmware upgrades or downgrades. This allows for continuous stress testing while simultaneously testing firmware upgrades or downgrades.

[0076] In practical implementation, electronic devices can respond to FIO test commands for hard drives, obtain stress test information corresponding to the FIO test commands, and continuously perform stress tests on the hard drive based on the stress test information. Specifically, the stress test information can at least include block size, queue depth, asynchronous mode, and read / write strategy information. Then, the hard drive can be continuously stressed according to the block size, queue depth, asynchronous mode, and read / write strategy information. By executing FIO tests for the hard drive, a stress environment is created so that firmware version upgrade / downgrade tests can be performed on the hard drive under this stress environment, enriching the methods of hard drive stability testing.

[0077] The block size (BS) defines the I / O block size, with units such as k, K, m, and M. The default I / O block size is 4KB. The queue depth (QS) defines the test queue depth, such as 16, 32, 64, and 128. In asynchronous libaio mode, a batch of I / O requests can be submitted and then waited for each batch to complete, reducing the number of interactions and improving processing efficiency. For read / write strategy information, it can be either -rwmixread or -rwmixwrite. The former specifies the read percentage in mixed read / write mode, while the latter specifies the write percentage. For example, -rwmixread=30 indicates a read percentage of 30% in mixed read / write mode, and -rwmixwrite=50 indicates a write percentage of 50%. Furthermore, the stress test information also includes the test task name, which is not limited in this invention.

[0078] In one example, the electronic device can obtain FIO test commands for the hard drive and the corresponding FIO tool (BS=4K; QD=128, job=1 (test task name), libaio asynchronous mode, rwmixread=50). Then, it can perform IO tests on all hard drives on the electronic device that need firmware version upgrade / downgrade tests. By executing FIO tests on the hard drive, a stress environment is created so that firmware version upgrade / downgrade tests can be performed on the hard drive under this stress environment, thus enriching the ways to test hard drive stability.

[0079] Step 103: In response to obtaining a firmware upgrade / downgrade instruction for the hard drive during the continuous stress test of the hard drive, perform a firmware version upgrade / downgrade operation for the hard drive according to the firmware upgrade / downgrade instruction.

[0080] During continuous stress testing of the hard drive using the FIO tool, testers can input corresponding firmware upgrade / downgrade commands to perform firmware version upgrades / downgrades simultaneously with the stress test. These firmware version upgrades / downgrades can include different methods, allowing testers to configure the appropriate methods to test the hard drive's stability.

[0081] In one optional embodiment, the firmware upgrade / downgrade instruction includes a version upgrade instruction and a target version number. During the hard drive upgrade / downgrade test, the electronic device can obtain the current version number of the hard drive and then use the version upgrade instruction to upgrade the current version step-by-step to the target version number, or use the version upgrade instruction to upgrade the current version to the target version number. For example, assuming the current version number of the hard drive is 1.0 and the target version number is 4.0, in one implementation, the electronic device can first upgrade the hard drive from 1.0 to 2.0, then from 2.0 to 3.0, and then from 3.0 to 4.0. By upgrading the firmware version of the hard drive step-by-step, the device can perform a step-by-step firmware upgrade while stress testing, thus detecting the stability of the hard drive under different firmware versions. In another implementation, the electronic device can directly upgrade the hard drive from 1.0 to 4.0, performing a leapfrog firmware version upgrade, thus performing a specified firmware version upgrade while stress testing, and detecting the stability of the hard drive under a specific version.

[0082] In another optional embodiment, the firmware upgrade / downgrade instruction includes a version downgrade instruction and a target version number. During the hard drive upgrade / downgrade test, the electronic device can obtain the current version number of the hard drive and then use the version downgrade instruction to downgrade the current version number step by step to the target version number, or use the version downgrade instruction to downgrade the current version number to the target version number. For example, assuming the current version number of the hard drive is 4.0 and the target version number is 1.0, in one implementation, the electronic device can first downgrade the hard drive from 4.0 to 3.0, then from 3.0 to 2.0, and then from 2.0 to 1.0. By downgrading the firmware version of the hard drive step by step, the device can perform a step-by-step firmware version downgrade while stress testing, thus detecting the stability of the hard drive under different firmware versions. In another implementation, the electronic device can directly downgrade the hard drive from 4.0 to 1.0, performing a leapfrog firmware version downgrade, thus performing a specified firmware version downgrade while stress testing, thus detecting the stability of the hard drive under a specific version.

[0083] In another optional embodiment, the firmware upgrade / downgrade command includes a version upgrade command, a target version number, and the number of tests. During the hard drive upgrade / downgrade test, the electronic device can use the version upgrade command to sequentially upgrade the hard drive's current version number to the target version number until the upgrade count reaches the required number of tests, at which point the upgrade / downgrade operation ends. For example, assuming the hard drive's current version number is 1.0, the target version number is 2.0, and the number of tests is 3, the electronic device can upgrade the hard drive from 1.0 to 2.0, then from 2.0 to 2.0, and then from 2.0 to 2.0 again, for a total of 3 upgrades. By performing multiple tests on the same firmware version, the stability of the hard drive under the same firmware version is tested.

[0084] In addition, after the hard drive completes the firmware version upgrade / downgrade test, the electronic device can retain the corresponding test log, so that it can check whether there is any hard drive failure information or hard drive error information, and observe whether there is a red light on the hard drive surface or whether there is a hard drive failure alarm sound.

[0085] Step 104: If it is detected that the hard disk has completed the upgrade / downgrade operation corresponding to the firmware upgrade / downgrade instruction, then the target SMART information corresponding to the hard disk is obtained, and the upgrade / downgrade test result corresponding to the hard disk is generated according to the initial SMART information and the target SMART information. The upgrade / downgrade test result includes one of test normal information and test abnormal information.

[0086] While performing FIO testing on the hard drive, the electronic device also completes the corresponding firmware version upgrade / downgrade test. The electronic device can then obtain the target SMART information of the hard drive after the firmware upgrade / downgrade test. Based on the initial SMART information and the target SMART information, it can generate the corresponding upgrade / downgrade test results for the hard drive. These results include either normal test information or abnormal test information. By performing firmware upgrade / downgrade testing on the hard drive simultaneously with FIO testing, the combination of FIO and upgrade / downgrade testing enriches the methods for testing hard drive stability. Furthermore, by analyzing the test results based on the SMART information before and after the test, the accuracy of the test results can be effectively guaranteed.

[0087] In practical implementation, since SMART information can include hardware status identifiers and hardware status parameters, the former can be the identifier corresponding to the hard drive's relevant status, and the latter can be used to characterize the hard drive's relevant performance parameters. When comparing the initial SMART information with the target SMART information to determine whether the hard drive is running normally after performing FIO testing and firmware version upgrade / downgrade testing, the judgment can be made based on the same type of SMART information. Specifically, if the first hard drive status identifier in the initial SMART information is different from the second hard drive status identifier in the target SMART information, test abnormal information for the hard drive is generated; if the first hard drive status identifier is the same as the second hard drive status identifier, test normal information for the hard drive is generated. The hard drive status identifier includes at least one of the following: health status identifier, hard drive lock status identifier, and test status identifier. Furthermore, if at least one hard drive status parameter in the target SMART information does not meet the corresponding preset threshold, test anomaly information for the hard drive is generated; if all hard drive status parameters in the target SMART information meet the corresponding preset threshold, test normal information for the hard drive is generated. The hard drive status parameters include at least one of the following: number of remapped sectors, number of reset configuration events, and temperature. Thus, by performing firmware upgrade / downgrade tests on the hard drive while performing FIO tests on the hard drive process, the combination of FIO tests and upgrade / downgrade tests enriches the methods for testing hard drive stability. On the other hand, by detecting the test results of the hard drive based on the SMART information before and after the test, the accuracy of the test results can be effectively guaranteed.

[0088] In one example, suppose the initial SMART information corresponding to the hard drive under normal operating conditions can be: SMART Health Status: OK; Reallocated_Sector_Ct: Standard value < 5; Pending_Sector: Standard value < 10; Reallocated_Event_Count: Standard value < 5; SMART overall-health self-assessment test result: PASSED; Temperature: Standard value: SSD < 74℃, HDD < 65℃; The hard drive is locked: notlocked, etc. After completing the hard drive firmware upgrade / downgrade test, the electronic device can reacquire the SMART information corresponding to the hard drive. Assuming the target SMART information includes at least one of the following: SMART HealthStatus: Not OK; Reallocated_Sector_Ct: Standard value > 5; Pending_Sector: Standard value > 10; Reallocated_Event_Count: Standard value > 5; SMART overall-health self-assessment test result: FAILED; Temperature: Standard value: SSD > 74℃, HDD > 65℃; The hard drive is locked: locked, etc., then it indicates that the hard drive experienced stability issues during the firmware upgrade / downgrade test while performing the FIO test, generating corresponding test anomaly information to indicate a stability problem with the hard drive. If none of the above is included, then corresponding normal test information can be generated to indicate stable hard drive operation.

[0089] It should be noted that the embodiments of the present invention include, but are not limited to, the examples described above. It is understood that those skilled in the art can make further settings according to actual needs under the guidance of the ideas in the embodiments of the present invention, and the present invention does not limit such settings.

[0090] In this embodiment of the invention, for an electronic device operating a Linux system, during the hard drive upgrade / downgrade test, the initial SMART information corresponding to the hard drive can be obtained. Then, in response to an FIO test command for the hard drive, stress test information corresponding to the FIO test command can be obtained, and stress testing of the hard drive can be continuously performed based on the stress test information. Then, in response to the continuous stress testing of the hard drive, a firmware upgrade / downgrade command for the hard drive can be obtained, and a firmware version upgrade / downgrade operation can be performed based on the firmware upgrade / downgrade command. If the hard drive is detected to have completed the upgrade / downgrade operation corresponding to the firmware upgrade / downgrade command, the target SMART information corresponding to the hard drive is obtained, and an upgrade / downgrade test result is generated based on the initial SMART information and the target SMART information. The upgrade / downgrade test result includes one of two types of test results: normal test information and abnormal test information. Therefore, by performing firmware upgrade / downgrade testing on the hard drive simultaneously with the FIO process test, the combination of FIO testing and upgrade / downgrade testing enriches the methods for hard drive stability testing. Furthermore, by detecting the test results of the hard drive based on the SMART information before and after the test, the accuracy of the test results can be effectively guaranteed.

[0091] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of the present invention are not limited to the described order of actions, because according to the embodiments of the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions involved are not necessarily essential to the embodiments of the present invention.

[0092] Reference Figure 2 This diagram illustrates a structural block diagram of a hard disk upgrade / downgrade testing device provided in an embodiment of the present invention. The device is applied to an electronic device running a Linux system. The electronic device includes a hard disk and may specifically include the following modules:

[0093] The first information acquisition module 201 is used to acquire the initial SMART information corresponding to the hard disk;

[0094] The stress testing module 202 is used to respond to the FIO test command for the hard disk, obtain stress test information corresponding to the FIO test command, and continuously perform stress test on the hard disk according to the stress test information;

[0095] Firmware testing module 203 is used to respond to a firmware upgrade / downgrade instruction for the hard drive obtained during continuous stress testing of the hard drive, and to perform a firmware version upgrade / downgrade operation for the hard drive according to the firmware upgrade / downgrade instruction.

[0096] The second information acquisition module 204 is used to acquire the target SMART information corresponding to the hard drive if it is detected that the hard drive has completed the upgrade operation corresponding to the firmware upgrade instruction, and generate the upgrade test result corresponding to the hard drive based on the initial SMART information and the target SMART information. The upgrade test result includes one of test normal information and test abnormal information.

[0097] In one optional embodiment, the stress test information includes at least block size, queue depth, asynchronous mode, and read / write strategy information, and the stress test module 202 is specifically used for:

[0098] The hard drive is subjected to continuous stress testing according to the block size, queue depth, asynchronous mode, and read / write strategy information.

[0099] In one optional embodiment, the firmware upgrade / downgrade instruction includes a version upgrade instruction and a target version number, and the firmware testing module 203 is specifically used for:

[0100] Obtain the current version number of the hard drive;

[0101] The current version can be upgraded to the target version number step by step using the version upgrade instruction, or the current version can be upgraded to the target version number using the version upgrade instruction.

[0102] In one optional embodiment, the firmware upgrade / downgrade instruction includes a version downgrade instruction and a target version number, and the firmware testing module 203 is specifically used for:

[0103] Obtain the current version number of the hard drive;

[0104] The version downgrade instruction is used to downgrade the current version number to the target version number step by step, or the version downgrade instruction is used to downgrade the current version number to the target version number.

[0105] In one optional embodiment, the firmware upgrade / downgrade instruction includes a version upgrade instruction, a target version number, and a number of tests. The firmware testing module 203 is specifically used for:

[0106] The version upgrade command is used to upgrade the current version number of the hard drive to the target version number one by one until the number of upgrades for the hard drive reaches the number of tests, at which point the upgrade / downgrade operation of the hard drive ends.

[0107] In one optional embodiment, the SMART information includes at least a hard disk status identifier, and the second information acquisition module 204 is specifically used for:

[0108] If the first hard disk status identifier in the initial SMART information is different from the second hard disk status identifier in the target SMART information, then test anomaly information for the hard disk is generated.

[0109] If the first hard disk status identifier is the same as the second hard disk status identifier, then test normal information for the hard disk is generated;

[0110] The hard drive status identifier includes at least one of the following: a health status identifier, a hard drive lock status identifier, and a test status identifier.

[0111] In one optional embodiment, the SMART information includes hard disk status parameters, and the second information acquisition module 204 is specifically used for:

[0112] If at least one of the hard disk status parameters in the target SMART information does not meet the corresponding preset threshold, test anomaly information for the hard disk is generated.

[0113] If all the hard disk status parameters in the target SMART information meet the corresponding preset threshold, then normal test information for the hard disk is generated.

[0114] The hard disk status parameters include at least one of the following: number of remapped sectors, number of reset configuration events, and temperature.

[0115] As the device embodiment is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be found in the description of the method embodiment.

[0116] In addition, this invention also provides an electronic device, including: a processor, a memory, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, it implements the various processes of the above-described hard disk upgrade / downgrade test method embodiment and achieves the same technical effect. To avoid repetition, it will not be described again here.

[0117] This invention also provides a computer-readable storage medium storing a computer program. When executed by a processor, the computer program implements the various processes of the aforementioned hard disk upgrade / downgrade testing method embodiments and achieves the same technical effects. To avoid repetition, it will not be described again here. The computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0118] Figure 3 A schematic diagram of the hardware structure of an electronic device for implementing various embodiments of the present invention.

[0119] The electronic device 300 includes, but is not limited to, components such as: a radio frequency unit 301, a network module 302, an audio output unit 303, an input unit 304, a sensor 305, a display unit 306, a user input unit 307, an interface unit 308, a memory 309, a processor 310, and a power supply 311. Those skilled in the art will understand that the electronic device structure involved in the embodiments of the present invention does not constitute a limitation on the electronic device. An electronic device may include more or fewer components than illustrated, or combine certain components, or have different component arrangements. In the embodiments of the present invention, the electronic device includes, but is not limited to, mobile phones, tablet computers, laptop computers, PDAs, in-vehicle terminals, wearable devices, and pedometers.

[0120] It should be understood that, in this embodiment of the invention, the radio frequency unit 301 can be used for receiving and transmitting signals during information transmission or calls. Specifically, it receives downlink data from the base station and processes it with the processor 310; additionally, it transmits uplink data to the base station. Typically, the radio frequency unit 301 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low-noise amplifier, a duplexer, etc. Furthermore, the radio frequency unit 301 can also communicate with networks and other devices through a wireless communication system.

[0121] The electronic device provides users with wireless broadband internet access through network module 302, such as helping users send and receive emails, browse web pages, and access streaming media.

[0122] The audio output unit 303 can convert audio data received by the radio frequency unit 301 or the network module 302 or stored in the memory 309 into audio signals and output them as sound. Furthermore, the audio output unit 303 can also provide audio output related to specific functions performed by the electronic device 300 (e.g., call signal reception sound, message reception sound, etc.). The audio output unit 303 includes a speaker, a buzzer, and a receiver, etc.

[0123] Input unit 304 is used to receive audio or video signals. Input unit 304 may include a graphics processing unit (GPU) 3041 and a microphone 3042. The GPU 3041 processes image data of still images or videos acquired by an image capture device (such as a camera) in video capture mode or image capture mode. The processed image frames can be displayed on display unit 306. The image frames processed by GPU 3041 can be stored in memory 309 (or other storage media) or transmitted via radio frequency unit 301 or network module 302. Microphone 3042 can receive sound and process such sound into audio data. The processed audio data can be converted into a format that can be transmitted to a mobile communication base station via radio frequency unit 301 in telephone call mode.

[0124] The electronic device 300 also includes at least one sensor 305, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor and a proximity sensor. The ambient light sensor can adjust the brightness of the display panel 3061 according to the ambient light level, and the proximity sensor can turn off the display panel 3061 and / or backlight when the electronic device 300 is moved to the ear. As a type of motion sensor, an accelerometer sensor can detect the magnitude of acceleration in various directions (generally three axes). When stationary, it can detect the magnitude and direction of gravity and can be used to identify the posture of the electronic device (such as landscape / portrait switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc. The sensor 305 may also include a fingerprint sensor, pressure sensor, iris sensor, molecular sensor, gyroscope, barometer, hygrometer, thermometer, infrared sensor, etc., which will not be described in detail here.

[0125] The display unit 306 is used to display information input by the user or information provided to the user. The display unit 306 may include a display panel 3061, which may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.

[0126] User input unit 307 can be used to receive input numerical or character information, and generate key signal inputs related to user settings and function control of electronic devices. Specifically, user input unit 307 includes a touch panel 3071 and other input devices 3072. Touch panel 3071, also known as a touch screen, can collect touch operations performed by the user on or near it (such as operations performed by the user using a finger, stylus, or any suitable object or accessory on or near touch panel 3071). Touch panel 3071 may include two parts: a touch detection device and a touch controller. The touch detection device detects the user's touch position and the signal generated by the touch operation, and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device, converts it into touch point coordinates, and sends it to the processor 310, which receives and executes commands from the processor 310. In addition, touch panel 3071 can be implemented using various types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to touch panel 3071, user input unit 307 may also include other input devices 3072. Specifically, other input devices 3072 may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, power buttons, etc.), trackballs, mice, joysticks, etc., which will not be described in detail here.

[0127] Furthermore, the touch panel 3071 can cover the display panel 3061. When the touch panel 3071 detects a touch operation on or near it, it transmits the information to the processor 310 to determine the type of touch event. Subsequently, the processor 310 provides corresponding visual output on the display panel 3061 according to the type of touch event. It is understood that in one embodiment, the touch panel 3071 and the display panel 3061 are implemented as two independent components to realize the input and output functions of the electronic device. However, in some embodiments, the touch panel 3071 and the display panel 3061 can be integrated to realize the input and output functions of the electronic device. The specific implementation is not limited here.

[0128] Interface unit 308 serves as an interface for connecting external devices to electronic device 300. For example, external devices may include a wired or wireless headphone port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device with an identification module, an audio input / output (I / O) port, a video I / O port, a headphone port, and so on. Interface unit 308 can be used to receive input from external devices (e.g., data, power, etc.) and transmit the received input to one or more components within electronic device 300, or it can be used to transmit data between electronic device 300 and external devices.

[0129] The memory 309 can be used to store software programs and various data. The memory 309 may primarily include a program storage area and a data storage area. The program storage area may store the operating system, applications required for at least one function (such as sound playback, image playback, etc.), etc.; the data storage area may store data created based on the use of the mobile phone (such as audio data, phonebook, etc.). Furthermore, the memory 309 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device.

[0130] The processor 310 is the control center of the electronic device. It connects various parts of the electronic device via various interfaces and lines. By running or executing software programs and / or modules stored in the memory 309, and by calling data stored in the memory 309, it performs various functions and processes data, thereby providing overall monitoring of the electronic device. The processor 310 may include one or more processing units; preferably, the processor 310 may integrate an application processor and a modem processor. The application processor mainly handles the operating system, user interface, and applications, while the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 310.

[0131] The electronic device 300 may also include a power supply 311 (such as a battery) for supplying power to various components. Preferably, the power supply 311 can be logically connected to the processor 310 through a power management system, thereby enabling functions such as managing charging, discharging, and power consumption through the power management system.

[0132] In addition, the electronic device 300 includes some functional modules not shown, which will not be described in detail here.

[0133] It should be noted that, in this document, 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. Unless otherwise specified, 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 that element.

[0134] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of the present invention.

[0135] The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of the present invention without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of the present invention.

[0136] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed in this invention can be implemented in electronic hardware, or a combination of computer software and electronic hardware. 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.

[0137] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0138] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus 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 apparatuses or units may be electrical, mechanical, or other forms.

[0139] 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.

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

[0141] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, ROM, RAM, magnetic disks, or optical disks.

[0142] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A method of stress testing a hard disk drive, comprising: An electronic device running a Linux system, the electronic device including a hard disk, the method comprising: Obtain the initial SMART information corresponding to the hard drive; In response to an FIO test command for the hard drive, stress test information corresponding to the FIO test command is obtained, and stress test is continuously performed on the hard drive based on the stress test information; In response to receiving a firmware upgrade / downgrade instruction for the hard drive during continuous stress testing, the firmware version upgrade / downgrade operation for the hard drive is performed according to the firmware upgrade / downgrade instruction. If the hard drive is detected to have completed the upgrade / downgrade operation corresponding to the firmware upgrade / downgrade instruction, then the target SMART information corresponding to the hard drive is obtained, and the upgrade / downgrade test result corresponding to the hard drive is generated based on the initial SMART information and the target SMART information. The upgrade / downgrade test result includes one of test normal information and test abnormal information; the SMART information includes at least the hard drive status identifier. Keep the test log, check the test log for any hard drive failure information or hard drive error information, and observe whether there is a red light on the surface of the hard drive or whether there is a hard drive failure alarm sound. The step of generating the upgrade / downgrade test results corresponding to the hard drive based on the initial SMART information and the target SMART information includes: If the first hard disk status identifier in the initial SMART information is different from the second hard disk status identifier in the target SMART information, then test anomaly information for the hard disk is generated. If the first hard disk status identifier is the same as the second hard disk status identifier, then test normal information for the hard disk is generated; The hard drive status identifier includes at least one of the following: a health status identifier, a hard drive lock status identifier, and a test status identifier.

2. The method of claim 1, wherein, The stress test information includes at least block size, queue depth, asynchronous mode, and read / write strategy information. The step of continuously stress testing the hard drive based on the stress test information includes: The hard drive is subjected to continuous stress testing according to the block size, queue depth, asynchronous mode, and read / write strategy information.

3. The method of claim 1, wherein, The firmware upgrade / downgrade instruction includes a version upgrade instruction and a target version number. The step of performing a firmware upgrade / downgrade operation on the hard drive according to the firmware upgrade / downgrade instruction includes: Obtain the current version number of the hard drive; The current version can be upgraded to the target version number step by step using the version upgrade instruction, or the current version can be upgraded to the target version number using the version upgrade instruction.

4. The method of claim 1, wherein, The firmware upgrade / downgrade command includes a version downgrade command and a target version number. The step of performing a firmware upgrade / downgrade operation on the hard drive according to the firmware upgrade / downgrade command includes: Obtain the current version number of the hard drive; The version downgrade instruction is used to downgrade the current version number to the target version number step by step, or the version downgrade instruction is used to downgrade the current version number to the target version number.

5. The method according to claim 1, characterized in that, The firmware upgrade / downgrade command includes a version upgrade command, a target version number, and a number of tests. The step of performing a firmware upgrade / downgrade operation on the hard drive according to the firmware upgrade / downgrade command includes: The version upgrade command is used to upgrade the current version number of the hard drive to the target version number one by one until the number of upgrades for the hard drive reaches the number of tests, at which point the upgrade / downgrade operation of the hard drive ends.

6. The method of claim 1, wherein, SMART information includes hard drive status parameters. The step of generating upgrade / downgrade test results for the hard drive based on the initial SMART information and the target SMART information includes: If at least one of the hard disk status parameters in the target SMART information does not meet the corresponding preset threshold, test anomaly information for the hard disk is generated. If all the hard disk status parameters in the target SMART information meet the corresponding preset threshold, then normal test information for the hard disk is generated. The hard disk status parameters include at least one of the following: number of remapped sectors, number of reset configuration events, and temperature.

7. A hard drive upgrade / downgrade testing device, characterized in that, An electronic device for running a Linux system, the electronic device including a hard disk, the device comprising: The first information acquisition module is used to acquire the initial SMART information corresponding to the hard disk; The stress testing module is used to respond to the FIO test command for the hard disk, obtain stress test information corresponding to the FIO test command, and continuously perform stress test on the hard disk according to the stress test information; The firmware testing module is used to respond to a firmware upgrade / downgrade command for the hard drive obtained during continuous stress testing of the hard drive, and to perform a firmware version upgrade / downgrade operation for the hard drive according to the firmware upgrade / downgrade command. The second information acquisition module is used to acquire the target SMART information corresponding to the hard drive if it is detected that the hard drive has completed the upgrade operation corresponding to the firmware upgrade command, and generate the upgrade test result corresponding to the hard drive based on the initial SMART information and the target SMART information. The upgrade test result includes one of test normal information and test abnormal information. The SMART information includes at least the hard drive status identifier. This module is used to retain test logs, check for hard drive failure information or hard drive error information through the test logs, and observe whether there is a red light on the surface of the hard drive or whether there is a hard drive failure alarm sound. The second information acquisition module is specifically used for: If the first hard disk status identifier in the initial SMART information is different from the second hard disk status identifier in the target SMART information, then test anomaly information for the hard disk is generated. If the first hard disk status identifier is the same as the second hard disk status identifier, then test normal information for the hard disk is generated; The hard drive status identifier includes at least one of the following: a health status identifier, a hard drive lock status identifier, and a test status identifier.

8. An electronic device, comprising: It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; The memory is used to store computer programs; When the processor executes a program stored in the memory, it implements the method as described in any one of claims 1-6.

9. A computer-readable storage medium having instructions stored thereon that, when executed by one or more processors, cause the processors to perform the method as described in any one of claims 1-6.