A hard disk firmware debugging method, system, electronic device, and storage medium.

CN116543827BActive Publication Date: 2026-09-01SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310547993.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-12
Publication Date
2026-09-01
Estimated Expiration
2043-05-12

AI Technical Summary

Technical Problem

[0004]有鉴于此,本发明提出了一种硬盘固件调试方法、系统、电子设备及存储介质,解决了硬盘容量调小时,导致硬盘原容量的特性发生改变,并且调试困难、效率低的问题,能够高效率调整用于测试的硬盘的固件,并且在硬盘容量调低的同时保持原容量的部分特性,由此达到测试目的,提高测试准确性

Benefits of technology

[0053]本发明至少具有以下有益技术效果:通过本发明的方案,能够高效率调整用于测试的硬盘的固件,并且在将硬盘容量调低的同时保持原容量硬盘的部分特性,并且调整好的固件参数可以用于和硬盘安全性和稳定性相关的测试,例如,Endurance测试,由此提高测试准确性和测试效率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116543827B_ABST
    Figure CN116543827B_ABST
Patent Text Reader

Abstract

This invention relates to the field of hard disk testing technology, and specifically discloses a hard disk firmware debugging method, system, electronic device, and storage medium. The method includes: determining a first average write / erase wear rate (ACR) of a first hard disk; testing the first hard disk using an endurance test script, and calculating the number of blocks to be modified and a second user capacity based on the test results; modifying the firmware of the first hard disk based on the second user capacity and the number of blocks; after the firmware modification is completed, testing a second hard disk with modified firmware using an endurance test script, and obtaining the second ACR of the second hard disk during the test; adjusting the second user capacity and / or the number of blocks based on the difference between the second ACR and the first ACR so that the second ACR meets the requirements. Through the solution of this invention, the firmware of the hard disk can be adjusted efficiently, so that the capacity and characteristics of the hard disk after firmware adjustment meet the testing requirements.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of hard disk testing technology, and in particular to a hard disk firmware debugging method, system, electronic device, and storage medium. Background Technology

[0002] With the rapid development and widespread application of SSDs, security and stability have become important indicators for SSDs.

[0003] Reliability Development Test (RDT) is a test of the security and stability of Solid State Disks (SSDs). It consists of two parts: Endurance and Quality. The Endurance test is mainly used to test the durability of NAND (flash memory) and firmware error correction capabilities. The Endurance test requires wearing down the SSD to the end of its lifespan within a specified test time, which is difficult to achieve even for large-capacity drives. Therefore, current technology usually uses a method of reducing the SSD capacity to achieve the Endurance test. However, this will change some characteristics of the original SSD capacity, and debugging is difficult and inefficient. Summary of the Invention

[0004] In view of this, the present invention proposes a hard disk firmware debugging method, system, electronic device and storage medium, which solves the problem that when the hard disk capacity is reduced, the characteristics of the original capacity of the hard disk will change, and the debugging is difficult and inefficient. It can efficiently adjust the firmware of the hard disk used for testing, and maintain some characteristics of the original capacity while reducing the hard disk capacity, thereby achieving the testing purpose and improving the testing accuracy.

[0005] To achieve the above objectives, one aspect of the present invention provides a hard disk firmware debugging method, specifically including the following steps:

[0006] Determine the first average write / erase wear rate of the first hard drive;

[0007] The first hard drive is tested using an endurance test script, and the number of blocks that need to be modified and the second user capacity are calculated based on the test results.

[0008] Modify the firmware of the first hard drive based on the second user capacity and the number of blocks;

[0009] After the firmware modification is completed, the endurance test script is used to test the second hard drive with the modified firmware, and the second average erase and write wear rate of the second hard drive during the test is obtained;

[0010] The second user capacity and / or the number of blocks are adjusted based on the difference between the second average erase / write wear rate and the first average erase / write wear rate so that the second average erase / write wear rate meets the requirements.

[0011] In some implementations, the step of testing the first hard drive using an endurance test script and calculating the number of blocks to be modified and the second user capacity based on the test results includes:

[0012] The first hard drive was tested using an endurance test script to obtain the average write bandwidth and write amplification of the first hard drive.

[0013] The second physical capacity is calculated based on the average write bandwidth, the write amplification, and the first average erase / write wear rate.

[0014] The number of blocks is calculated based on the second physical capacity and the block capacity of the first hard disk;

[0015] The second user capacity is calculated based on the reserved space of the first hard drive and the second physical capacity.

[0016] In some implementations, the step of testing the first hard drive using an endurance test script to obtain the average write bandwidth and write amplification of the first hard drive includes:

[0017] The first hard drive was tested using an endurance test script to obtain the average write bandwidth of the first hard drive, and the write amplification was calculated based on the increase in host write volume and the increase in garbage collection volume during the test.

[0018] The step of calculating the second physical capacity based on the average write bandwidth, the write amplification, and the first average erase / write wear rate includes:

[0019] The amount of data written to the first hard disk per unit time is calculated based on the average write bandwidth.

[0020] The second physical capacity is calculated based on the write volume, the write amplification, and the first average erase / write wear rate.

[0021] The step of calculating the second user capacity based on the reserved space of the first hard disk and the second physical capacity includes:

[0022] The reserved space is calculated based on the first physical capacity and the first user capacity of the first hard disk;

[0023] The second user capacity is calculated based on the reserved space and the second physical capacity.

[0024] In some embodiments, the step of adjusting the second user capacity and / or the number of blocks based on the difference between the second average write wear rate and the first average write wear rate to ensure that the second average write wear rate meets the requirement includes:

[0025] Determine whether the second average erase / write wear rate reaches the first average erase / write wear rate;

[0026] If the second average write wear rate does not reach the first average write wear rate, then adjust the second user capacity and / or the number of blocks, and return to the step of modifying the firmware of the first hard drive based on the second user capacity and the number of blocks.

[0027] In some embodiments, the step of adjusting the second user capacity and / or the number of blocks based on the difference between the second average write wear rate and the first average write wear rate to ensure that the second average write wear rate meets the requirement includes:

[0028] Determine whether the second average erase / write wear rate reaches the first average erase / write wear rate and does not exceed the threshold.

[0029] If the second average erase / write wear rate does not reach the first average erase / write wear rate, or reaches the first average erase / write wear rate and exceeds the threshold, then adjust the second user capacity and / or the number of blocks, and return to the step of modifying the firmware of the first hard drive based on the second user capacity and the number of blocks.

[0030] In some implementations, the method further includes:

[0031] During the testing of the second hard drive, the actual erase and write wear rate was monitored;

[0032] When the actual erase / write wear rate reaches the first average erase / write wear rate, the data writing operation during the test is stopped.

[0033] In some implementations, the step of calculating the second physical capacity based on the write amount, the write amplification, and the first average erase / write wear rate includes:

[0034] The second physical capacity is calculated based on the physical capacity calculation formula, the write amount, the write amplification, and the first average erase / write wear rate, wherein the physical capacity calculation formula is:

[0035] Second physical capacity = Write amount × Write amplification / First average erase / write wear rate.

[0036] In some implementations, the step of calculating write amplification based on the host write increment and garbage collection increment during the test includes:

[0037] The write amplification is calculated based on the write amplification formula, the host write increment, and the garbage collection increment, wherein the write amplification formula is:

[0038] Write amplification = (Increment in host writes + Increment in garbage collection) / Increment in host writes;

[0039] The step of calculating the reserved space based on the first physical capacity and the first user capacity of the first hard disk includes:

[0040] The reserved space is calculated based on the reserved space calculation formula, the first physical capacity, and the first user capacity, wherein the reserved space calculation formula is:

[0041] Reserved space = First physical capacity / First user capacity - 1;

[0042] The step of calculating the second user capacity based on the reserved space and the second physical capacity includes:

[0043] The second user capacity is calculated based on the user capacity calculation formula, the reserved space, and the second physical capacity, wherein the user capacity calculation formula is:

[0044] Second user capacity = First physical capacity / (1 + reserved space).

[0045] Another aspect of this invention provides a hard disk firmware debugging system, comprising:

[0046] The determining module is configured to determine the first average erase / write wear rate of the first hard disk;

[0047] The first test module is configured to use an endurance test script to test the first hard disk and calculate the number of blocks that need to be modified and the second user capacity based on the test results.

[0048] The modification module is configured to modify the firmware of the first hard disk based on the second user capacity and the number of blocks;

[0049] The second test module is configured to use the endurance test script to test the second hard drive after the firmware modification is completed, and to obtain the second average erase and write wear rate of the second hard drive during the test process.

[0050] An adjustment module is configured to adjust the second user capacity and / or the number of blocks based on the difference between the second average erase / write wear rate and the first average erase / write wear rate so that the second average erase / write wear rate meets the requirements.

[0051] In another aspect of the present invention, an electronic device is provided, comprising: at least one processor; and a memory storing a computer program executable on the processor, the computer program performing the steps of the method described above when executed by the processor.

[0052] In another aspect of the present invention, a storage medium is provided, which stores a computer program that, when executed by a processor, implements the above-described method steps.

[0053] The present invention has at least the following beneficial technical effects: the solution of the present invention can efficiently adjust the firmware of the hard drive used for testing, and while reducing the hard drive capacity, it can maintain some characteristics of the original capacity hard drive. Furthermore, the adjusted firmware parameters can be used for tests related to hard drive security and stability, such as endurance testing, thereby improving test accuracy and efficiency. Attached Figure Description

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

[0055] Figure 1 A flowchart of an embodiment of the hard disk firmware debugging method provided by the present invention;

[0056] Figure 2 A flowchart of yet another embodiment of the hard disk firmware debugging method provided by the present invention;

[0057] Figure 3 A schematic diagram of an embodiment of the hard disk firmware debugging system provided by the present invention;

[0058] Figure 4 A schematic diagram of the structure of an embodiment of the electronic device provided by the present invention;

[0059] Figure 5 A schematic diagram of an embodiment of the storage medium provided by the present invention. Detailed Implementation

[0060] To make the objectives, technical solutions, and advantages of the present invention clearer, the embodiments of the present invention will be further described in detail below with reference to specific examples and the accompanying drawings.

[0061] It should be noted that all uses of "first" and "second" in the embodiments of the present invention are for the purpose of distinguishing two entities or parameters with the same name but different names. It is clear that "first" and "second" are only for the convenience of expression and should not be construed as limiting the embodiments of the present invention. Subsequent embodiments will not explain this in detail.

[0062] Based on the above objectives, a first aspect of the present invention provides a hard disk firmware debugging method. In such... Figure 1 In the illustrated embodiment, the method includes the following steps:

[0063] S10. Determine the first average erase / write wear rate of the first hard disk;

[0064] S20. Use an endurance test script to test the first hard disk, and calculate the number of blocks that need to be modified and the second user capacity based on the test results.

[0065] S30. Modify the firmware of the first hard disk based on the second user capacity and the number of blocks;

[0066] S40. After the firmware modification is completed, the endurance test script is used to test the second hard drive after the firmware modification, and the second average erase and write wear rate of the second hard drive during the test is obtained.

[0067] S50. Adjust the second user capacity and / or the number of blocks based on the difference between the second average erase / write wear rate and the first average erase / write wear rate so that the second average erase / write wear rate meets the requirements.

[0068] Specifically, in step S10, the first average erase / write wear rate of the first hard disk is determined. The hard disk can be a solid-state drive. Based on the NAND lifespan and Ea characteristics of the solid-state drive, the test temperature and test duration are determined, and then the average erase / write wear rate of the solid-state drive at normal capacity is determined, i.e., the first average erase / write wear rate.

[0069] In step S20, an endurance test script is used to test the normal capacity disk, i.e., the first hard disk, and the number of blocks that need to be modified and the second user capacity are calculated based on the test results.

[0070] In step S30, the firmware of the first hard disk is modified based on the second user capacity and the number of blocks, thereby adjusting the capacity of the normal capacity disk to a small capacity disk, i.e., the second hard disk.

[0071] In steps S40 and S50, after the firmware modification is completed, an endurance test script is used to test the small-capacity disk and obtain the second average erase / write wear rate of the second hard drive during the test. It is observed whether the second average erase / write wear rate reaches the first average erase / write wear rate. If there is a difference, the second user capacity and / or the number of blocks are adjusted so that the second average erase / write wear rate reaches the first average erase / write wear rate. This ensures that after the hard drive capacity is adjusted, it can still maintain some characteristics of the normal capacity.

[0072] The above method can efficiently adjust the firmware of the hard drive used for testing, and retain some characteristics of the original capacity hard drive while reducing the hard drive capacity.

[0073] Furthermore, the adjusted firmware parameters can be used for tests related to hard drive security and stability, such as endurance testing, thereby improving test accuracy and efficiency.

[0074] In some implementations, step S20 includes:

[0075] S21. Use an endurance test script to test the first hard disk and obtain the average write bandwidth and write amplification of the first hard disk;

[0076] S22. Calculate the second physical capacity based on the average write bandwidth, the write amplification, and the first average erase / write wear rate;

[0077] S23. Calculate the number of blocks based on the second physical capacity and the block capacity of the first hard disk;

[0078] S24. Calculate the second user capacity based on the reserved space of the first hard disk and the second physical capacity.

[0079] The above method can be used to obtain a second user capacity for adjusting the hard drive firmware.

[0080] In some implementations, step S21 includes:

[0081] The first hard drive was tested using an endurance test script to obtain its average write bandwidth. Write amplification was calculated based on the increase in host write volume and the increase in garbage collection volume during the test. Write amplification = (increase in host write volume + increase in garbage collection volume) / increase in host write volume.

[0082] Step S22 includes:

[0083] The amount of data written to the first hard disk per unit time is calculated based on the average write bandwidth.

[0084] The second physical capacity is calculated based on the write amount, the write amplification, and the first average erase / write wear rate. The second physical capacity = write amount × write amplification / first average erase / write wear rate.

[0085] Step S24 includes:

[0086] The reserved space is calculated based on the first physical capacity and the first user capacity of the first hard disk;

[0087] The second user capacity is calculated based on the reserved space and the second physical capacity. The second user capacity = the first physical capacity / (1 + reserved space).

[0088] In some implementations, step S50 may include the following steps:

[0089] S51. Determine whether the second average erase / write wear rate reaches the first average erase / write wear rate;

[0090] S52. If the second average erase / write wear rate does not reach the first average erase / write wear rate, then adjust the second user capacity and / or the number of blocks, and return to the step of modifying the firmware of the first hard disk based on the second user capacity and the number of blocks;

[0091] S53. If the second average erase / write wear rate reaches the first average erase / write wear rate, then the method ends.

[0092] In some implementations, step S50 may further include the following steps:

[0093] S55. Determine whether the second average erase / write wear rate reaches the first average erase / write wear rate and does not exceed the threshold, wherein the threshold can be set to (1+20%) of the first average erase / write wear rate, but is not limited thereto;

[0094] S56. If the second average erase / write wear rate does not reach the first average erase / write wear rate or reaches the first average erase / write wear rate and exceeds the threshold, then adjust the second user capacity and / or the number of blocks, and return to the step of modifying the firmware of the first hard disk based on the second user capacity and the number of blocks;

[0095] S57. If the second average erase / write wear rate reaches the first average erase / write wear rate but does not exceed the threshold, then the method ends.

[0096] In some implementations, the method further includes:

[0097] During the testing of the second hard drive, the actual erase and write wear rate was monitored;

[0098] When the actual erase / write wear rate reaches the first average erase / write wear rate, the data writing operation during the test is stopped.

[0099] In some implementations, the step of calculating the second physical capacity based on the write amount, the write amplification, and the first average erase / write wear rate includes:

[0100] The second physical capacity is calculated based on the physical capacity calculation formula, the write amount, the write amplification, and the first average erase / write wear rate, wherein the physical capacity calculation formula is:

[0101] Second physical capacity = Write amount × Write amplification / First average erase / write wear rate.

[0102] In some implementations, the step of calculating write amplification based on the host write increment and garbage collection increment during the test includes:

[0103] The write amplification is calculated based on the write amplification formula, the host write increment, and the garbage collection increment, wherein the write amplification formula is:

[0104] Write amplification = (Increment in host writes + Increment in garbage collection) / Increment in host writes;

[0105] The step of calculating the reserved space based on the first physical capacity and the first user capacity of the first hard disk includes:

[0106] The reserved space is calculated based on the reserved space calculation formula, the first physical capacity, and the first user capacity, wherein the reserved space calculation formula is:

[0107] Reserved space = First physical capacity / First user capacity - 1;

[0108] The step of calculating the second user capacity based on the reserved space and the second physical capacity includes:

[0109] The second user capacity is calculated based on the user capacity calculation formula, the reserved space, and the second physical capacity, wherein the user capacity calculation formula is:

[0110] Second user capacity = First physical capacity / (1 + reserved space).

[0111] The following describes the concept of the present invention in conjunction with a specific hard drive firmware debugging process. It should be understood that the embodiments described herein are for illustration and explanation only and are not intended to limit the present invention.

[0112] like Figure 2 As shown, the specific hard drive firmware debugging process is as follows:

[0113] S1. Based on the NAND lifespan and Ea characteristics, determine the test temperature and test duration, and then determine the average PE (Program & Erase) wear rate S per hour. PE (i.e., the first average erase / write wear rate in the embodiments of the present invention), the following describes S PE The calculation process is illustrated with an example:

[0114] When the NAND lifespan is 10000PE and Ea = 1.0, and the NAND is tested at a temperature of 80.8℃, it needs to be tested for 1000 hours. Then SPE = 10000PE / 1000h = 10PE / h, which means that it takes one hour to wear down 10PE. After testing for 1000 hours, the NAND can be worn down to the end of its lifespan.

[0115] S2. For a normal capacity disk under steady-state conditions, the average write bandwidth (BW) is measured using the Endurance test script. The write amplification (WA) is calculated based on the increase in host write volume and the increase in GC (garbage collection) write volume. The formula for calculating write amplification is:

[0116] WA = (increment of host_write_cnt + increment of gc_write_cnt) / increment of host_write_cnt;

[0117] Here, host_write_cnt represents the amount of data written to the host, and gc_write_cnt represents the amount of data written during garbage collection.

[0118] S3. Calculate the reserved space OP based on the normal capacity disk. OP = physical capacity / user capacity - 1.

[0119] S4. Calculate the write count per hour based on the write bandwidth BW.

[0120] S5. Calculate the average write volume per 1PE increase, which is the physical capacity C of the small-capacity disk after adjusting the normal capacity disk to a small-capacity disk (i.e., the second hard disk in this embodiment). phy =write_count_per_hour*WA / S PE Then, based on the capacity of each block, the number of blocks is calculated.

[0121] S6, Physical capacity C via OP and small capacity disk phy To calculate the user capacity C user C user =C phy / (OP+1).

[0122] S7. This initially determined the user capacity C of the small-capacity disk. user After modifying the hard drive firmware and determining the number of blocks, the Endurance test script was used to conduct tests and observe the actual average PE wear rate S. PE_real Can it reach S? PE If there is a slight difference, then adjust the user capacity C. user Fine-tune the number of blocks until the PE wear rate condition is met.

[0123] S8. To further ensure the actual PE wear rate in the test, and to control the write volume of the Endurance test script, when the PE growth reaches S within one hour... PE If no data is written, only read-only operations are performed. By controlling the PE growth of the test script, the wear growth of the PE during the test can be effectively guaranteed to be relatively uniform within a unit of time.

[0124] The above scheme obtains the user capacity and number of blocks of the small capacity disk through the actual test results and calculations of the normal capacity disk. After testing the small capacity disk, it is fine-tuned until the test conditions are met. This can efficiently adjust the firmware of the hard drive used for testing, and maintain some characteristics of the normal capacity hard drive while reducing the hard drive capacity.

[0125] Furthermore, the adjusted firmware parameters can be used for tests related to hard drive security and stability, such as endurance testing, thereby improving test accuracy and efficiency.

[0126] Based on the same inventive concept, according to another aspect of the present invention, such as Figure 2 As shown, embodiments of the present invention also provide a hard disk firmware debugging system, comprising:

[0127] Determining module 110, the determining module 110 is configured to determine the first average erase / write wear rate of the first hard disk;

[0128] The first test module 120 is configured to use an endurance test script to test the first hard disk and calculate the number of blocks that need to be modified and the second user capacity based on the test results.

[0129] Modification module 130, configured to modify the firmware of the first hard disk based on the second user capacity and the number of blocks;

[0130] The second test module 140 is configured to use the endurance test script to test the second hard disk after the firmware modification is completed, and to obtain the second average erase and write wear rate of the second hard disk during the test process.

[0131] An adjustment module 150 is configured to adjust the second user capacity and / or the number of blocks based on the difference between the second average erase / write wear rate and the first average erase / write wear rate so that the second average erase / write wear rate meets the requirements.

[0132] Based on the same inventive concept, according to another aspect of the present invention, such as Figure 3 As shown, an embodiment of the present invention also provides an electronic device 30, which includes a processor 310 and a memory 320. The memory 320 stores a computer program 321 that can run on the processor. When the processor 310 executes the program, it performs the steps of the method described above.

[0133] The memory, as a non-volatile storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as the program instructions / modules corresponding to the hard disk firmware debugging method described in this application embodiment. The processor executes various system functions and data processing by running the non-volatile software programs, instructions, and modules stored in the memory, thereby implementing the hard disk firmware debugging method described in the above embodiment.

[0134] The memory may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on system usage. Furthermore, the memory may include high-speed random access memory and non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory may optionally include memory remotely located relative to the processor, which can be connected to the local module via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0135] Based on the same inventive concept, according to another aspect of the present invention, such as Figure 4 As shown, an embodiment of the present invention also provides a storage medium 40, which stores a computer program 410 that executes the above method when executed by a processor.

[0136] Finally, it should be noted that those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the methods described above. The storage medium for the program can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc. The above computer program embodiments can achieve the same or similar effects as any of the corresponding foregoing method embodiments.

[0137] Those skilled in the art will also understand that the various exemplary logic blocks, modules, circuits, and algorithm steps described in conjunction with the disclosure herein can be implemented as electronic hardware, computer software, or a combination of both. To clearly illustrate this interchangeability between hardware and software, the functionality of various illustrative components, blocks, modules, circuits, and steps has been generally described. Whether this functionality is implemented as software or as hardware depends on the specific application and the design constraints imposed on the system as a whole. Those skilled in the art can implement the functionality in various ways for each specific application, but such implementation decisions should not be construed as departing from the scope of the embodiments disclosed herein.

[0138] The above are exemplary embodiments disclosed in this invention. However, it should be noted that various changes and modifications can be made without departing from the scope of the embodiments of this invention as defined by the claims. The functions, steps, and / or actions of the methods according to the disclosed embodiments described herein do not need to be performed in any particular order. The sequence numbers of the disclosed embodiments of this invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments. Furthermore, although the elements disclosed in the embodiments of this invention may be described or claimed individually, they may be understood as multiple unless explicitly limited to a singular number.

[0139] It should be understood that, as used herein, the singular form “a” is intended to include the plural form as well, unless the context clearly supports an exception. It should also be understood that, as used herein, “and / or” refers to any and all possible combinations of one or more of the associated listed items.

[0140] Those skilled in the art should understand that the discussion of any of the above embodiments is merely exemplary and is not intended to imply that the scope of the invention (including the claims) is limited to these examples. Within the framework of the invention, technical features of the above embodiments or different embodiments can be combined, and many other variations of different aspects of the invention exist, which are not provided in the details for the sake of brevity. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the invention should be included within the protection scope of the invention.

Claims

1. A hard disk firmware debugging method, characterized in that, include: Determine the first average write / erase wear rate of the first hard drive; The first hard drive is tested using an endurance test script, and the number of blocks to be modified and the second user capacity are calculated based on the test results. The steps include: testing the first hard drive using an endurance test script to obtain the average write bandwidth and write amplification of the first hard drive; calculating the second physical capacity based on the average write bandwidth, the write amplification, and the first average erase / write wear rate; calculating the number of blocks based on the second physical capacity and the block capacity of the first hard drive; and calculating the second user capacity based on the reserved space of the first hard drive and the second physical capacity. Modify the firmware of the first hard drive based on the second user capacity and the number of blocks; After the firmware modification is completed, the endurance test script is used to test the second hard drive with the modified firmware, and the second average erase and write wear rate of the second hard drive during the test is obtained; Adjusting the second user capacity and / or the number of blocks based on the difference between the second average erase / write wear rate and the first average erase / write wear rate to ensure that the second average erase / write wear rate meets the requirements, the step of adjusting the second user capacity and / or the number of blocks based on the difference between the second average erase / write wear rate and the first average erase / write wear rate to ensure that the second average erase / write wear rate meets the requirements includes: determining whether the second average erase / write wear rate reaches the first average erase / write wear rate; if the second average erase / write wear rate does not reach the first average erase / write wear rate, adjusting the second user capacity and / or the number of blocks, and returning to the step of modifying the firmware of the first hard drive based on the second user capacity and the number of blocks.

2. The method according to claim 1, characterized in that, The step of testing the first hard drive using an endurance test script to obtain the average write bandwidth and write amplification of the first hard drive includes: The first hard drive was tested using an endurance test script to obtain the average write bandwidth of the first hard drive, and the write amplification was calculated based on the increase in host write volume and the increase in garbage collection volume during the test. The step of calculating the second physical capacity based on the average write bandwidth, the write amplification, and the first average erase / write wear rate includes: The amount of data written to the first hard disk per unit time is calculated based on the average write bandwidth. The second physical capacity is calculated based on the write volume, the write amplification, and the first average erase / write wear rate. The step of calculating the second user capacity based on the reserved space of the first hard disk and the second physical capacity includes: The reserved space is calculated based on the first physical capacity and the first user capacity of the first hard disk; The second user capacity is calculated based on the reserved space and the second physical capacity.

3. The method according to claim 1, characterized in that, The step of adjusting the second user capacity and / or the number of blocks based on the difference between the second average erase / write wear rate and the first average erase / write wear rate to ensure that the second average erase / write wear rate meets the requirements includes: Determine whether the second average erase / write wear rate reaches the first average erase / write wear rate and does not exceed the threshold. If the second average erase / write wear rate does not reach the first average erase / write wear rate, or reaches the first average erase / write wear rate and exceeds the threshold, then adjust the second user capacity and / or the number of blocks, and return to the step of modifying the firmware of the first hard drive based on the second user capacity and the number of blocks.

4. The method according to claim 1, characterized in that, Also includes: During the testing of the second hard drive, the actual erase and write wear rate was monitored; When the actual erase / write wear rate reaches the first average erase / write wear rate, the data writing operation during the test is stopped.

5. The method according to claim 2, characterized in that, The step of calculating the second physical capacity based on the write volume, the write amplification, and the first average erase / write wear rate includes: The second physical capacity is calculated based on the physical capacity calculation formula, the write amount, the write amplification, and the first average erase / write wear rate, wherein the physical capacity calculation formula is: Second physical capacity = Write amount × Write amplification / First average erase / write wear rate.

6. The method according to claim 2, characterized in that, The steps for calculating write amplification based on the increase in host write volume and the increase in garbage collection volume during the test include: The write amplification is calculated based on the write amplification formula, the host write increment, and the garbage collection increment, wherein the write amplification formula is: Write amplification = (Increase in host writes + Increase in garbage collection) / Increase in host writes; The step of calculating the reserved space based on the first physical capacity and the first user capacity of the first hard disk includes: The reserved space is calculated based on the reserved space calculation formula, the first physical capacity, and the first user capacity, wherein the reserved space calculation formula is: Reserved space = First physical capacity / First user capacity - 1; The step of calculating the second user capacity based on the reserved space and the second physical capacity includes: The second user capacity is calculated based on the user capacity calculation formula, the reserved space, and the second physical capacity, wherein the user capacity calculation formula is: Second user capacity = First physical capacity / (1 + reserved space).

7. A hard disk firmware debugging system, characterized in that, include: The determining module is configured to determine the first average erase / write wear rate of the first hard disk; A first testing module is configured to test the first hard drive using an endurance test script, and calculate the number of blocks to be modified and the second user capacity based on the test results. The steps of testing the first hard drive using the endurance test script and calculating the number of blocks to be modified and the second user capacity based on the test results include: testing the first hard drive using the endurance test script to obtain the average write bandwidth and write amplification of the first hard drive; calculating the second physical capacity based on the average write bandwidth, the write amplification, and the first average erase / write wear rate; calculating the number of blocks based on the second physical capacity and the block capacity of the first hard drive; and calculating the second user capacity based on the reserved space of the first hard drive and the second physical capacity. The modification module is configured to modify the firmware of the first hard disk based on the second user capacity and the number of blocks; The second test module is configured to use the endurance test script to test the second hard drive after the firmware modification is completed, and to obtain the second average erase and write wear rate of the second hard drive during the test process. An adjustment module is configured to adjust the second user capacity and / or the number of blocks based on the difference between the second average erase / write wear rate and the first average erase / write wear rate, so that the second average erase / write wear rate meets the requirements. The step of adjusting the second user capacity and / or the number of blocks based on the difference between the second average erase / write wear rate and the first average erase / write wear rate to make the second average erase / write wear rate meet the requirements includes: determining whether the second average erase / write wear rate reaches the first average erase / write wear rate; if the second average erase / write wear rate does not reach the first average erase / write wear rate, adjusting the second user capacity and / or the number of blocks, and returning to the step of modifying the firmware of the first hard disk based on the second user capacity and the number of blocks.

8. An electronic device, comprising: At least one processor; as well as A memory storing a computer program executable on the processor, characterized in that the processor executes the program and performs the steps of the method as described in any one of claims 1 to 6.

9. A storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it performs the steps of the method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Method and system for testing stability of hard disk based on capacity adjustment

    CN110554947A

  • Hard disk pressure testing method, system and equipment and medium

    CN114550798A