A performance testing method, device, equipment and product for shingled hard disk
By switching states in the shingled hard drive and performing read and write tests, the problem of low efficiency and insufficient accuracy in SMR hard drive performance testing is solved, and efficient and accurate performance testing is achieved.
Patent Information
- Application Number
- CN202210411364.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-19
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2042-04-19
AI Technical Summary
Existing technology cannot effectively verify the accuracy of data transmission for shingled hard drives (SMR hard drives), resulting in low efficiency and insufficient accuracy in performance testing.
By issuing a status switching command to the hard disk to be tested, the status of each forced sequential writing area is switched from empty to full, and read and write tests are performed based on the switching completion information, and performance test results are generated to reflect the identification, attributes and functions of the hard disk. consumption mode.
It improves the efficiency of performance testing, ensures the accuracy of data transmission, and can reflect the performance of mechanical hard disks through pass-through consistency verification.
Smart Images

Figure CN114664372B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of storage technology, and in particular to a performance testing method, device, equipment and product for a shingled hard disk. Background Art
[0002] Mechanical hard disks are divided into two types: horizontal (lateral) magnetic recording (Longitudinal Magnetic Recording, LMR) disks and perpendicular magnetic recording (Perpendicular Magnetic Recording, PMR) disks. PMR hard disks can store more data on the hard disk, greatly increasing the storage capacity of the hard disk. Among them, the shingled magnetic recording (SMR) hard disk in the PMR hard disk can greatly increase the disk storage density. SMR hard disk technology can effectively reduce the disk storage cost per unit capacity.
[0003] Due to the shingled track structure of SMR hard disks, writing data to a track may overwrite adjacent tracks. The pass-through consistency check of mechanical hard disks can largely reflect the accuracy of mechanical hard disk data transmission (reading and writing), thereby reflecting the performance of mechanical hard disks. However, the pass-through consistency check of other types of mechanical hard disks is not applicable to SMR hard disks due to the track structure of SMR hard disks. Therefore, the performance test method applicable to SMR shingled hard disks is an important issue that the industry needs to solve urgently. Summary of the invention
[0004] In view of this, embodiments of the present invention provide a performance testing method, device, equipment and product for a shingled hard disk to solve the problem that there is no accuracy verification for data transmission in an SMR hard disk.
[0005] According to a first aspect, an embodiment of the present invention provides a performance testing method for a shingled hard disk, the method comprising:
[0006] Sending a state switching command to the hard disk to be tested, and determining the switching completion information returned by the hard disk to be tested according to the state switching command; the state switching command is used to switch the state of all forced sequential write areas in the mechanical hard disk to be tested from empty to full;
[0007] Based on the determined switching completion information, a read and write test is performed on the hard disk to be tested, and a performance test result of the shingled hard disk to be tested is generated; the read and write test is used to query and verify at least one of the identification, attributes and power consumption mode of the hard disk to be tested.
[0008] By adopting the above technical solution, the present invention issues a state switching command to the hard disk to be tested, and switches the state of each forced sequential write area of the hard disk to be tested from empty to full by the state switching command, which can avoid the mechanical hard disk having a large capacity and / or being an SMR hard disk. The time required for the forced sequential write area state switching is too long, resulting in too low performance test efficiency, thereby improving the performance test efficiency. Afterwards, based on the switching completion information returned by the hard disk to be tested according to the state switching command, the hard disk to be tested is subjected to a read-write test, and a corresponding performance test result is obtained. The performance test result can be used to represent at least one of the above parameters of the identification, attributes, and power consumption mode of the mechanical hard disk. Therefore, the performance test result can be used to reflect whether the hard disk to be tested can pass the direct consistency check, and reflect the accuracy of the mechanical hard disk when reading and writing, thereby reflecting the performance of the mechanical hard disk. The performance testing method of the shingled hard disk of the present invention provides a solution for performance testing of SMR hard disks, which improves the performance test efficiency while ensuring the accuracy of data transmission detection.
[0009] In combination with the first aspect, in a first implementation of the first aspect, sending a state switching command to the hard disk to be tested, and determining the switching completion information returned by the hard disk to be tested according to the state switching command, includes:
[0010] A first record command is issued to the hard disk to be tested, and first quantity information returned by the hard disk to be tested according to the first record command is determined; the first record command is used to query and record the number of the forced sequential write areas in the empty state contained in the hard disk to be tested, and the first quantity information is used to characterize the number of the forced sequential write areas recorded by the first record command;
[0011] Based on the determined first quantity information, a region switching command is issued to the hard disk to be tested; the region switching command is used to switch the state of the forced sequential write area corresponding to the first quantity information from empty to full;
[0012] Based on the completion of the state switching of the forced sequential write area, a second record command is issued to the hard disk to be tested, and second quantity information returned by the hard disk to be tested according to the second record command is determined; the second record command is used to query and record the number of the forced sequential write areas in the full state contained in the hard disk to be tested, and the second quantity information is used to represent the number of the forced sequential write areas recorded by the second record command;
[0013] Determine that the first quantity information matches the second quantity information, and determine that the hard disk to be tested is based on the switching completion information returned when the matching occurs;
[0014] The state switching command includes a first recording command, the area switching command and the second recording command.
[0015] In combination with the first embodiment of the first aspect, in the second embodiment of the first aspect, the method further includes the following steps:
[0016] When it is determined that the first quantity information does not match the second quantity information, a state switching command is re-issued to the hard disk to be tested until the hard disk to be tested returns the switching completion information.
[0017] By adopting the above technical solution, the present invention can switch the state of each forced sequential write area of the mechanical hard disk from empty to full by means of commands.
[0018] In combination with the first implementation of the first aspect, in the third implementation of the first aspect, the first quantity information further includes the size of the forced sequential write area;
[0019] Correspondingly, in the step of sending an area switching command to the hard disk to be tested based on the determined quantity information, the status of the forced sequential write areas of the corresponding order are switched from empty to full in ascending or descending order of the sizes corresponding to the forced sequential write areas in the first quantity information.
[0020] By adopting the above technical solution, the present invention facilitates the acquisition of the second quantity information and can ensure the accuracy of the acquired second quantity information.
[0021] In combination with the first implementation of the first aspect, the second implementation of the first aspect, or the third implementation of the first aspect, in a fourth implementation of the first aspect, before the step of sending an initialization command to the hard disk to be tested, the method further includes:
[0022] Sending an initialization command to the hard disk to be tested; the initialization command is used to switch the status of all forced sequential write areas in the mechanical hard disk to empty;
[0023] The state switching command includes the first recording command, the area switching command, the second recording command and the initialization command.
[0024] By adopting the above technical solution, the present invention restores the mechanical hard disk to the default state, that is, switches all forced sequential write areas of all tracks in the mechanical hard disk to the default state, i.e., the empty state, so that the first quantity information and the second quantity information obtained are more accurate.
[0025] In combination with the first aspect, in a fifth implementation of the first aspect, performing a read and write test on the hard disk to be tested based on the determined switching completion information, and generating a performance test result of the shingled hard disk to be tested, specifically includes:
[0026] Based on the determined switching completion information, a read / write test command is issued to the hard disk to be tested; the read / write test command is used to perform the read / write test on the hard disk to be tested;
[0027] During the read and write test, at least one of a first verification command, a second verification command and a third verification command is sequentially issued to the hard disk to be tested after each preset time period; the first verification command, the second verification command and the third verification command are respectively used to query and verify the identification, attributes and power consumption mode information of the mechanical hard disk;
[0028] The performance test result is generated based on the verification result returned by the hard disk to be tested according to at least one of the first verification command, the second verification command and the third verification command.
[0029] By adopting the above technical scheme, the present invention can verify the direct consistency of the mechanical hard disk by checking at least one of the above parameters of the identification, attributes and power consumption mode of the mechanical hard disk. When the mechanical hard disk can pass the direct consistency check, the accuracy of the mechanical hard disk data transmission can be greatly ensured.
[0030] In a second aspect, an embodiment of the present invention further provides a performance testing device for a shingled hard disk, the device comprising:
[0031] A state switching module is used to send a state switching command to the hard disk to be tested, and determine the switching completion information returned by the hard disk to be tested according to the state switching command; the state switching command is used to switch the state of all forced sequential write areas in the mechanical hard disk to be tested from empty to full;
[0032] A performance testing module is used to perform a read and write test on the hard disk to be tested based on the determined switching completion information, and generate a performance test result of the shingled hard disk to be tested; the read and write test is used to query and verify at least one of the identification, attributes and power consumption mode of the hard disk to be tested.
[0033] By adopting the above technical solution, the present invention issues a state switching command to the hard disk to be tested, and switches the state of each forced sequential write area of the hard disk to be tested from empty to full by the state switching command, which can avoid the mechanical hard disk having a large capacity and / or being an SMR hard disk. The time required for the forced sequential write area state switching is too long, resulting in too low performance test efficiency, thereby improving the performance test efficiency. Afterwards, based on the switching completion information returned by the hard disk to be tested according to the state switching command, the hard disk to be tested is subjected to a read-write test, and a corresponding performance test result is obtained. The performance test result can be used to represent at least one of the above parameters of the identification, attributes, and power consumption mode of the mechanical hard disk. Therefore, the performance test result can be used to reflect whether the hard disk to be tested can pass the direct consistency check, and reflect the accuracy of the mechanical hard disk when reading and writing, thereby reflecting the performance of the mechanical hard disk. The performance testing method of the shingled hard disk of the present invention provides a solution for performance testing of SMR hard disks, which improves the performance test efficiency while ensuring the accuracy of data transmission detection.
[0034] In a third aspect, an embodiment of the present invention further provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the performance testing method of the shingled hard disk as described above are implemented.
[0035] In a fourth aspect, an embodiment of the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the above-described methods for testing the performance of shingled hard disks.
[0036] In a fifth aspect, an embodiment of the present invention further provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of any of the above-mentioned methods for testing the performance of shingled hard disks.
[0037] The performance test method, device, equipment and product of the shingled hard disk provided by the present invention, by sending a state switching command to the hard disk to be tested, the state of each forced sequential write area of the hard disk to be tested is switched from empty to full by the state switching command, which can avoid the mechanical hard disk having a large capacity and / or being an SMR hard disk. The time required for the forced sequential write area state switching is too long, resulting in too low performance test efficiency, thereby improving the performance test efficiency. Afterwards, based on the switching completion information returned by the hard disk to be tested according to the state switching command, the hard disk to be tested is subjected to a read-write test, and a corresponding performance test result is obtained. The performance test result can be used to represent at least one of the above parameters of the identification, attributes and power consumption mode of the mechanical hard disk. Therefore, the performance test result can be used to reflect whether the hard disk to be tested can pass the straight-through consistency check, and reflect the accuracy of the mechanical hard disk when reading and writing, thereby reflecting the performance of the mechanical hard disk. The performance test method of the shingled hard disk of the present invention provides a solution for performance testing of SMR hard disks, which improves the performance test efficiency while ensuring the accuracy of data transmission detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] The features and advantages of the present invention will be more clearly understood by referring to the accompanying drawings, which are schematic and should not be construed as limiting the present invention in any way. In the accompanying drawings:
[0039] Figure 1 A schematic diagram showing a flow chart of a performance testing method for a shingled hard disk provided by the present invention;
[0040] Figure 2 One of the specific flow diagrams of step S101 in the performance testing method of the shingled hard disk provided by the present invention is shown;
[0041] Figure 3 The second schematic diagram shows a specific flow chart of step S101 in the performance testing method of the shingled hard disk provided by the present invention;
[0042] Figure 4 The third schematic diagram shows a specific flow chart of step S101 in the performance testing method of the shingled hard disk provided by the present invention;
[0043] Figure 5 A specific flow chart of step S102 in the performance testing method of a shingled hard disk provided by the present invention is shown;
[0044] Figure 6 A schematic structural diagram of a performance testing device for a shingled hard disk provided by the present invention is shown;
[0045] Figure 7 One of the specific structural schematic diagrams of the state switching module in the performance testing device for the shingled hard disk provided by the present invention is shown;
[0046] Figure 8 The second schematic diagram shows a specific structure of the state switching module in the performance testing device for shingled hard disks provided by the present invention;
[0047] Fig. 9 The third schematic diagram shows a specific structure of the state switching module in the performance testing device for shingled hard disks provided by the present invention;
[0048] Fig.10 A specific structural schematic diagram of a performance test module in a performance test device for a shingled hard disk provided by the present invention is shown;
[0049] Fig.11 A structural schematic diagram of an electronic device provided by the present invention is shown. DETAILED DESCRIPTION
[0050] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0051] At present, mechanical hard disks can be divided into two types: LMR hard disks and PMR hard disks. LMR hard disks are horizontal (transverse) magnetic recording hard disks, but because the magnetic particles of mechanical hard disks are arranged horizontally and the density is relatively low, a single disk cannot hold too much data, and it is not currently the mainstream mechanical hard disk used in the industry. Based on the LMR hard disk, the PMR hard disk changes the horizontal tracks (magnetic blocks) into vertical tracks, which increases the storage capacity of the hard disk. PMR hard disks include conventional magnetic recording (CMR) hard disks and SMR hard disks. The SMR hard disk has very small changes in the manufacturing process. The SMR hard disk keeps the existing magnetic head and medium technology unchanged. The SMR hard disk achieves the increase in its storage surface density by overlapping the tracks like tiles on the roof of a house.
[0052] The pass-through consistency check of a mechanical hard disk can largely reflect the accuracy of the mechanical hard disk data transmission, i.e., reading and writing (Input / Output, I / O). The result of the pass-through consistency check is an important indicator for checking the performance of the mechanical hard disk. Since the SMR hard disk has a track structure with a small read head, a large write head, and a high density of shingled tracks, it will affect the work of the write head of the SMR hard disk. When randomly writing or rewriting the contents of the track, because the write head has to write the entire track, and each track has a part covered by the adjacent track, the data on the adjacent tracks that need to be randomly written or rewritten will also be changed, destroying the data on the adjacent tracks. In order to ensure the integrity of the data on the adjacent tracks, it is necessary to separate the data on the adjacent tracks before writing, and reorganize the data to be written and then write them in sequence. Therefore, the requirements for pass-through consistency are particularly important.
[0053] The existing pass-through consistency check of hard disk data transmission performance mainly uses FIO tools and components such as the libaio engine to perform read I / O tests on the hard disk under test. However, the SMR hard disk has a small read head, a large write head, and a track structure with high shingled track density, which makes the currently used FIO tools and components such as the libaio engine unable to perform pass-through consistency checks on SMR hard disks.
[0054] Combine the following Figure 1 The performance testing method of the mechanical shingled hard disk of the present invention is described, and the method comprises the following steps:
[0055] S101, sending a state switching command to a hard disk to be tested, and determining the switching completion information returned by the hard disk to be tested according to the state switching command. It should be noted that the hard disk to be tested refers to an SMR hard disk.
[0056] In this embodiment, the state switching command is used to switch the state of all the forced sequential write zones (Sequential-Required Zone, SR-Zone) in the mechanical hard disk from empty to full.
[0057] SMR hard disks divide tracks into several bands, which are continuously writable areas consisting of continuous tracks. Each area constitutes a basic unit that needs to be written sequentially. Band is a physical concept on SMR disks, and its corresponding logical concept is zone, which is the sequential write area of SMR disks that can be obtained by upper-layer software. For SMR hard disks, the size of a zone is usually in the order of 256MB. Since SMR hard disks still ensure that data can be read from the non-overlapping parts of the tracks, data reading within the zone can still be performed randomly.
[0058] SMR disks are divided into zones during manufacturing, and the starting position of the zones is marked by leaving a large gap between the zones. In addition, hard disk manufacturers use the non-overlapping track organization method of traditional hard disks in a small area on the SMR disk, sacrificing some storage density in exchange for the ability to write randomly in these zones. This part of the zone is called the conventional zone (C-Zone), which provides a foothold for random writes of upper-layer applications.
[0059] SMR hard disks use shingled recording to partially overlap tracks in a zone in order, achieving higher storage density and larger disk capacity. While achieving this benefit, SMR hard disks also impose some restrictions on upper-layer applications, including that SMR hard disks can only write sequentially within a zone and do not support random writes, and that space recovery on SMR hard disks is based on the size of a zone (e.g. 256MB).
[0060] The write constraints of SMR hard drives can be managed by the hard drive itself on the hardware side, or on the host side.
[0061] At present, the relevant protocol standards abstract the SMR hard disk into a set of zones, in which a zone consists of a continuous logical block address (Logical Block Address, LBA). For the C-Zone of the SMR hard disk, like the traditional mechanical hard disk, it has complete random write capabilities, and there is no restriction on the order of LBAs in which I / O is written. The size of the C-Zone generally does not exceed 1% of the capacity of the SMR hard disk. As a reserved area, the C-Zone of the SMR hard disk is generally not read or written. Data is stored in the SR-Zone. For each zone, the SR-Zone also exposes the position of the write pointer WP, but the hard disk device will refuse to write to any location other than the LBA pointed to by the write pointer, that is, the SR-Zone must be used as the starting point for sequential append writes based on the current position of the write pointer.
[0062] The initial state of all SR-Zones of SMR hard disks is empty. In order to ensure the accuracy of pass-through consistency check, all SR-Zones need to be filled up to make the SR-Zone state full. In the prior art, for LMR hard disks and CMR hard disks, the hard disk is generally filled up through I / O tools, such as FIO tools and libaio engine components. This method is relatively slow. It takes dozens or even hundreds of minutes to write a large-capacity mechanical hard disk, and the time required for performance testing is too long.
[0063] In this method, by sending a state switching command to the hard disk to be tested, the state of each SR-Zone of the mechanical hard disk (including the SMR hard disk) is switched / modified from empty to full by means of the state switching command, i.e., by means of commands / instructions. In this way, compared with the method of filling up the SR-Zone using I / O tools in the prior art, even if the capacity of the mechanical hard disk is large and / or it is an SMR hard disk, the present invention can complete the switching of the state of each SR-Zone in a relatively short time, such as one minute, to perform subsequent read and write tests and hard disk parameter verification.
[0064] S102 . Based on the determined switching completion information, perform a read and write test on the hard disk to be tested, and generate a performance test result of the shingled hard disk to be tested.
[0065] In this embodiment, the read-write test is used to query and verify at least one of the identification, attributes, and power consumption mode of the SMR hard disk. By verifying at least one of the above parameters of the identification, attributes, and power consumption mode of the mechanical hard disk, the Pass-through consistency of the mechanical hard disk can be verified. When the mechanical hard disk can pass the Pass-through consistency check, the accuracy of the mechanical hard disk data transmission can be greatly ensured.
[0066] The performance test method of the shingled hard disk of the present invention, by sending a state switching command to the hard disk to be tested, switches the state of each forced sequential write area of the hard disk to be tested from empty to full by the state switching command, can avoid the mechanical hard disk having a large capacity and / or being an SMR hard disk, which results in too long a time for the forced sequential write area state switching, resulting in too low performance test efficiency, thereby improving the performance test efficiency. Afterwards, based on the switching completion information returned by the hard disk to be tested according to the state switching command, the hard disk to be tested is subjected to a read-write test, and a corresponding performance test result is obtained. The performance test result can be used to represent at least one of the above parameters of the identification, attributes, and power consumption mode of the mechanical hard disk, so that the performance test result can be used to reflect whether the hard disk to be tested can pass the straight-through consistency check, and reflect the accuracy of the mechanical hard disk when reading and writing, thereby reflecting the performance of the mechanical hard disk. The performance test method of the shingled hard disk of the present invention provides a solution for performance testing of SMR hard disks, which improves the performance test efficiency while ensuring the accuracy of data transmission detection.
[0067] Combine the following Figure 2 The performance test method of the mechanical shingled hard disk of the present invention is described, and step S101 specifically includes:
[0068] S1012: Send a first recording command to the hard disk to be tested, and determine first quantity information returned by the hard disk to be tested according to the first recording command.
[0069] In this embodiment, the first recording command is used to query and record the number of SR-Zones contained in the hard disk to be tested, and the first quantity information is used to characterize the number of SR-Zones recorded by the first recording command, that is, the first quantity information is the total number of SR-Zones recorded based on the first recording command.
[0070] In some possible embodiments, in the method, a first record command may be issued through a zbc_report_zones tool, and the number of SR-Zones whose status (indication) is empty contained in the hard disk to be tested may be queried and recorded based on the zbc_report_zones tool.
[0071] S1013: Based on the determined first quantity information, issue a region switching command to the hard disk to be tested.
[0072] In this embodiment, the zone switching command is used to switch the state of the SR-Zone corresponding to the first quantity information from empty to full.
[0073] S1014: Based on the completion of the SR-Zone state switching, a second recording command is issued to the hard disk to be tested, and second quantity information returned by the hard disk to be tested according to the second recording command is determined.
[0074] In this embodiment, the second record command is used to query and record the number of SR-Zones whose status (indication) is full contained in the hard disk to be tested, and the second quantity information is used to characterize the number of forced sequential write areas recorded by the second record command, that is, the second quantity information is the total number of SR-Zones recorded based on the second record command.
[0075] In some possible embodiments, the state switching of the SR-Zone may be determined to be completed after a preset waiting time has passed after the zone switching command is issued.
[0076] Similarly, in some possible embodiments, in this method, the second record command may also be issued through the zbc_report_zones tool, and the number of SR-Zones in the full state contained in the hard disk to be tested may be queried and recorded based on the zbc_report_zones tool.
[0077] S1015, determine that the first quantity information matches the second quantity information, and determine the switching completion information returned by the hard disk to be tested based on the matching. It should be noted that, in this embodiment, the first quantity information matches the second quantity information means that the quantity of the first quantity information is equal to the quantity of the second quantity information. When the first quantity information matches the second quantity information, it indicates that the SR-Zone has been switched from an empty state to a full state, that is, the switching of all SR-Zone states has been completed.
[0078] In the method, the state switching command includes a first recording command, an area switching command and a second recording command.
[0079] It is understandable that when the first quantity information does not match the second quantity information, including when the first quantity information is greater than the second quantity information or the first quantity information is less than the second quantity information, it may mean that not all SR-Zones in the empty state have successfully completed the state switching. Figure 3 The performance test method of the mechanical shingled hard disk of the present invention is described. The method further includes the following steps based on steps S1011 to S1015:
[0080] S1016. When it is determined that the first quantity information and the second quantity information do not match, resend the status switching command to the hard disk to be tested until the switching completion information returned by the hard disk to be tested is determined, that is, it is determined that the first quantity information and the second quantity information match, that is, the switching of all SR-Zone states is completed.
[0081] In other embodiments, the first quantity information also includes the size of the forced sequential write zone. Accordingly, in these embodiments, in step S1013, the states of the SR-Zones of the corresponding order are switched from empty to full in ascending or descending order according to the sizes corresponding to the SR-Zones in the first quantity information. In this way, it is convenient to obtain the second quantity information and the accuracy of the obtained second quantity information can be guaranteed.
[0082] In these embodiments, the sg_zone tool can be used to start from the first SR-Zone in the first quantity information, and modify the status of all SR-Zones from empty to full in descending order according to the number of SR-Zones queried.
[0083] Combine the following Figure 4 The performance testing method of the mechanical shingled hard disk of the present invention is described. The method further comprises before step S1012:
[0084] S1011. Send an initialization command to the hard disk to be tested.
[0085] In this embodiment, the initialization command is used to switch the state of all forced sequential write areas in the mechanical hard disk to empty. At this time, the state switching command includes a first recording command, an area switching command, a second recording command and an initialization command. Through the initialization command, the first quantity information and the second quantity information are obtained more accurately and can better reflect the state of the corresponding SR-Zone.
[0086] In some possible embodiments, the method can restore the mechanical hard disk to the default state through the zbc_reset_zone tool, that is, all SR-Zones of all tracks in the mechanical hard disk (including SMR hard disk) are switched to the default state, that is, the empty state, so that the obtained first quantity information and the second quantity information are more accurate.
[0087] Combine the following Figure 5 The performance test method of the mechanical shingled hard disk of the present invention is described, and step S102 specifically includes:
[0088] S1021. Based on the determined switching completion information, a read / write test command is issued to the hard disk to be tested.
[0089] In this embodiment, the read / write test command is used to perform a read / write (I / O) test on the hard disk to be tested.
[0090] In some possible embodiments, the read / write test uses FIO mixed stress. FIO is a tool that tests the number of read / write operations per second (IOPS) and is used to stress test and verify the disk. FIO is a tool that can generate many threads or processes and execute specific types of I / O operations specified by the user. The typical use of FIO is to write job files that match the simulated I / O load. In other words, FIO is a multi-threaded I / O generation tool that can generate multiple I / O modes to test the performance of disk devices.
[0091] Preferably, the test parameters of the FIO mixed stress test are I / O size 32M, queue depth setting maximum supported depth 1, and mixed read and write 50%.
[0092] S1022. During the read and write test, at least one of a first verification command, a second verification command, and a third verification command is sequentially sent to the hard disk to be tested every preset time period, for example, 15 seconds.
[0093] In this embodiment, the first verification command, the second verification command and the third verification command are respectively used to query and verify the identification, attributes and power consumption mode information of the mechanical hard disk.
[0094] In some possible embodiments, the method may send a zbc_info command through the zbc_info tool, and query and verify the property information of the mechanical hard disk based on the zbc_info command; the method may send an Identify Device command through sg_sat_identify, and query and verify the identification information of the mechanical hard disk based on the Identify Device command; the method may send a Check Power Mode command through the sg_raw tool, and query and verify the power consumption mode information of the mechanical hard disk based on the Check Power Mode command.
[0095] S1023: Generate a performance test result based on the verification result returned by the hard disk to be tested according to at least one of the first verification command, the second verification command and the third verification command.
[0096] If there is no error in the I / O test, the mechanical hard disk can be correctly identified and the mechanical hard disk can correctly respond to the zbc_info command, Identify Device command and Check Power Mode command.
[0097] The performance testing device of the shingled hard disk provided by the present invention is described below. The performance testing device of the shingled hard disk described below and the performance testing method of the shingled hard disk described above can be referred to each other.
[0098] Combine the following Figure 6 The performance testing device of the mechanical shingled hard disk of the present invention is described, and the device comprises the following steps:
[0099] The state switching module 101 is used to send a state switching command to the hard disk to be tested, and determine the switching completion information returned by the hard disk to be tested according to the state switching command. It should be noted that the hard disk to be tested is an SMR hard disk.
[0100] In this embodiment, the state switching command is used to switch the state of all SR-Zones in the mechanical hard disk from empty to full.
[0101] In the device, by sending a state switching command to the hard disk to be tested, the state of each SR-Zone of the mechanical hard disk (including the SMR hard disk) is switched / modified from empty to full by means of the state switching command, i.e., by means of a command / instruction. In this way, compared with the method of filling up the SR-Zone with an I / O tool in the prior art, even if the capacity of the mechanical hard disk is large and / or it is an SMR hard disk, the present invention can complete the switching of the state of each SR-Zone in a relatively short time, such as one minute, to perform subsequent read and write tests and hard disk parameter verification.
[0102] The performance test module 102 is used to perform a read and write test on the hard disk to be tested based on the determined switching completion information, and generate a performance test result of the shingled hard disk to be tested.
[0103] In this embodiment, the read-write test is used to query and verify at least one of the identification, attributes, and power consumption mode of the SMR hard disk. By verifying at least one of the above parameters of the identification, attributes, and power consumption mode of the mechanical hard disk, the Pass-through consistency of the mechanical hard disk can be verified. When the mechanical hard disk can pass the Pass-through consistency check, the accuracy of the mechanical hard disk data transmission can be greatly ensured.
[0104] The performance test device of the shingled hard disk of the present invention, by sending a state switching command to the hard disk to be tested, switches the state of each forced sequential write area of the hard disk to be tested from empty to full by the state switching command, can avoid the mechanical hard disk having a large capacity and / or when it is an SMR hard disk, which results in too low performance test efficiency due to the long time required for forced sequential write area state switching, thereby improving the performance test efficiency. Afterwards, based on the switching completion information returned by the hard disk to be tested according to the state switching command, the hard disk to be tested is subjected to a read-write test, and a corresponding performance test result is obtained. The performance test result can be used to represent at least one of the above parameters of the identification, attributes and power consumption mode of the mechanical hard disk. Therefore, the performance test result can be used to reflect whether the hard disk to be tested can pass the straight-through consistency check, and reflect the accuracy of the mechanical hard disk when reading and writing, thereby reflecting the performance of the mechanical hard disk. The performance test method of the shingled hard disk of the present invention provides a solution for performance testing of SMR hard disks, which improves the efficiency of performance testing while ensuring the accuracy of data transmission detection.
[0105] Combine the following Figure 7 The performance test device of the mechanical shingled hard disk of the present invention is described, and the state switching module 101 specifically includes:
[0106] The first sending unit 1012 is used to send a first recording command to the hard disk to be tested, and determine the first quantity information returned by the hard disk to be tested according to the first recording command.
[0107] In this embodiment, the first recording command is used to query and record the number of SR-Zones contained in the hard disk to be tested, and the first quantity information is used to characterize the number of SR-Zones recorded by the first recording command, that is, the first quantity information is the total number of SR-Zones recorded based on the first recording command.
[0108] In some possible embodiments, the device may issue a first record command through a zbc_report_zones tool, and query and record the number of SR-Zones of the hard disk to be tested whose status (indication) is empty based on the zbc_report_zones tool.
[0109] The first switching unit 1013 is configured to send a region switching command to the hard disk to be tested based on the determined first quantity information.
[0110] In this embodiment, the zone switching command is used to switch the state of the SR-Zone corresponding to the first quantity information from empty to full.
[0111] The second sending unit 1014 is configured to send a second recording command to the hard disk to be tested based on the completion of the state switching of the SR-Zone, and determine the second quantity information returned by the hard disk to be tested according to the second recording command.
[0112] In this embodiment, the second record command is used to query and record the number of SR-Zones whose status (indication) is full contained in the hard disk to be tested, and the second quantity information is used to characterize the number of forced sequential write areas recorded by the second record command, that is, the second quantity information is the total number of SR-Zones recorded based on the second record command.
[0113] In some possible embodiments, the state switching of the SR-Zone may be determined to be completed after a preset waiting time has passed after the zone switching command is issued.
[0114] Similarly, in some possible embodiments, the device may also issue a second record command through the zbc_report_zones tool, and query and record the number of SR-Zones in the full state contained in the hard disk to be tested based on the zbc_report_zones tool.
[0115] In the state determination unit 1015, the user determines that the first quantity information matches the second quantity information, and determines the switching completion information returned by the hard disk to be tested based on the matching. It should be noted that, in this embodiment, the first quantity information matches the second quantity information, which means that the quantity of the first quantity information is equal to that of the second quantity information. When the first quantity information matches the second quantity information, it indicates that the SR-Zone has been switched from an empty state to a full state, that is, the switching of all SR-Zone states has been completed.
[0116] In the device, the state switching command includes a first recording command, an area switching command and a second recording command.
[0117] It is understandable that when the first quantity information does not match the second quantity information, including when the first quantity information is greater than the second quantity information or the first quantity information is less than the second quantity information, it may mean that not all SR-Zones in the empty state have successfully completed the state switching. Figure 3 The performance testing device of the mechanical shingled hard disk of the present invention is described, and the device also includes:
[0118] The second switching unit 1016 is used to re-send the status switching command to the hard disk to be tested when it is determined that the first quantity information and the second quantity information do not match, until the switching completion information returned by the hard disk to be tested is determined, that is, it is determined that the first quantity information and the second quantity information match, that is, the switching of all SR-Zone states is completed.
[0119] In other embodiments, the first quantity information also includes the size (size) of the forced sequential write zone. Accordingly, in these embodiments, the first switching unit 1013 switches the state of the corresponding SR-Zone from empty to full in ascending or descending order according to the size corresponding to the SR-Zone in the first quantity information. In this way, it is convenient to obtain the second quantity information and the accuracy of the obtained second quantity information can be guaranteed.
[0120] In these embodiments, the sg_zone tool can be used to start from the first SR-Zone in the first quantity information, and modify the status of all SR-Zones from empty to full in descending order according to the number of SR-Zones queried.
[0121] Combine the following Fig. 9 The performance testing device of the mechanical shingled hard disk of the present invention is described, and the device also includes:
[0122] The initialization unit 1011 sends an initialization command to the hard disk to be tested.
[0123] In this embodiment, the initialization command is used to switch the state of all forced sequential write areas in the mechanical hard disk to empty. At this time, the state switching command includes a first recording command, an area switching command, a second recording command and an initialization command. Through the initialization command, the first quantity information and the second quantity information are obtained more accurately and can better reflect the state of the corresponding SR-Zone.
[0124] In some possible embodiments, the device can restore the mechanical hard disk to the default state through the zbc_reset_zone tool, that is, switch all SR-Zones of all tracks in the mechanical hard disk (including SMR hard disk) to the default state, that is, the empty state.
[0125] Combine the following Figure 5 The performance test device of the mechanical shingled hard disk of the present invention is described, and the performance switching module 102 specifically includes:
[0126] The read / write test unit 1021 is used to send a read / write test command to the hard disk to be tested based on the determined switching completion information.
[0127] In this embodiment, the read / write test command is used to perform a read / write (I / O) test on the hard disk to be tested.
[0128] In some possible embodiments, the read / write test uses FIO mixed stress. FIO is a tool that tests the number of read / write operations per second (IOPS) and is used to stress test and verify the disk. FIO is a tool that can generate many threads or processes and execute specific types of I / O operations specified by the user. The typical use of FIO is to write job files that match the simulated I / O load. In other words, FIO is a multi-threaded I / O generation tool that can generate multiple I / O modes to test the performance of disk devices.
[0129] Preferably, the test parameters of the FIO mixed stress test are I / O size 32M, queue depth setting maximum supported depth 1, and mixed read and write 50%.
[0130] The performance verification unit 1022 is used to send at least one of a first verification command, a second verification command and a third verification command to the hard disk to be tested in sequence every preset time, such as 15 seconds, during the read and write test.
[0131] In this embodiment, the first verification command, the second verification command and the third verification command are respectively used to query and verify the identification, attributes and power consumption mode information of the mechanical hard disk.
[0132] In some possible embodiments, the device can send the zbc_info command through the zbc_info tool, and query and verify the property information of the mechanical hard disk based on the zbc_info command; the device can send the Identify Device command through the sg_sat_identify, and query and verify the identification information of the mechanical hard disk based on the Identify Device command; the device can send the Check Power Mode command through the sg_raw tool, and query and verify the power consumption mode information of the mechanical hard disk based on the Check Power Mode command.
[0133] The result generating unit 1023 is used to generate a performance test result based on the verification result returned by the hard disk to be tested according to at least one of the first verification command, the second verification command and the third verification command.
[0134] If there is no error in the I / O test, the mechanical hard disk can be correctly identified and the mechanical hard disk can correctly respond to the zbc_info command, Identify Device command and Check Power Mode command.
[0135] Fig.11 An example of a physical structure diagram of an electronic device is shown in FIG. Fig.11 As shown, the electronic device may include: a processor 210, a communication interface 220, a memory 230 and a communication bus 240, wherein the processor 210, the communication interface 220 and the memory 230 communicate with each other through the communication bus 240. The processor 210 may call the logic command in the memory 230 to execute the performance test method of the shingled hard disk, and the method includes:
[0136] Send a state switching command to the hard disk to be tested, and determine the switching completion information returned by the hard disk to be tested according to the state switching command; the state switching command is used to switch the state of all forced sequential write areas in the mechanical hard disk to be tested from empty to full;
[0137] Based on the determined switching completion information, a read and write test is performed on the hard disk to be tested, and a performance test result of the shingled hard disk to be tested is generated; the read and write test is used to query and verify at least one of the identification, attributes and power consumption mode of the mechanical hard disk.
[0138] In addition, the logic commands in the above-mentioned memory 230 can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several commands to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk.
[0139] On the other hand, the present invention further provides a computer program product, the computer program product includes a computer program, the computer program can be stored in a non-transitory computer-readable storage medium, when the computer program is executed by a processor, the computer can execute the performance test method of the shingled hard disk provided by the above methods, the method comprising:
[0140] Send a state switching command to the hard disk to be tested, and determine the switching completion information returned by the hard disk to be tested according to the state switching command; the state switching command is used to switch the state of all forced sequential write areas in the mechanical hard disk to be tested from empty to full;
[0141] Based on the determined switching completion information, a read and write test is performed on the hard disk to be tested, and a performance test result of the shingled hard disk to be tested is generated; the read and write test is used to query and verify at least one of the identification, attributes and power consumption mode of the mechanical hard disk.
[0142] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the performance test method of the shingled hard disk provided by the above methods is implemented, and the method comprises:
[0143] Send a state switching command to the hard disk to be tested, and determine the switching completion information returned by the hard disk to be tested according to the state switching command; the state switching command is used to switch the state of all forced sequential write areas in the mechanical hard disk to be tested from empty to full;
[0144] Based on the determined switching completion information, a read and write test is performed on the hard disk to be tested, and a performance test result of the shingled hard disk to be tested is generated; the read and write test is used to query and verify at least one of the identification, attributes and power consumption mode of the mechanical hard disk.
[0145] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0146] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of commands to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0147] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A performance test method for a shingled hard disk, characterized in that: The method comprises: Sending a state switching command to the hard disk to be tested, and determining the switching completion information returned by the hard disk to be tested according to the state switching command; the state switching command is used to switch the state of all forced sequential write areas in the mechanical hard disk to be tested from empty to full; The method of sending a status switching command to the hard disk to be tested and determining the switching completion information returned by the hard disk to be tested according to the status switching command includes: sending a first recording command to the hard disk to be tested and determining the first quantity information returned by the hard disk to be tested according to the first recording command; the first recording command is used to query and record the number of the forced sequential write areas with an empty status contained in the hard disk to be tested, and the first quantity information is used to characterize the number of the forced sequential write areas recorded by the first recording command; based on the determined first quantity information, sending an area switching command to the hard disk to be tested; the area switching command is used to query and record the status of the forced sequential write areas corresponding to the first quantity information The state of the forced sequential write area is switched from empty to full; based on the completion of the state switching of the forced sequential write area, a second record command is issued to the hard disk to be tested, and the second quantity information returned by the hard disk to be tested according to the second record command is determined; the second record command is used to query and record the number of the forced sequential write areas with a full state contained in the hard disk to be tested, and the second quantity information is used to characterize the number of the forced sequential write areas recorded by the second record command; it is determined that the first quantity information matches the second quantity information, and the switching completion information returned by the hard disk to be tested based on the match; the state switching command includes the first record command, the area switching command and the second record command; Based on the determined switching completion information, a read and write test is performed on the hard disk to be tested, and a performance test result of the shingled hard disk to be tested is generated; the read and write test is used to query and verify at least one of the identification, attributes and power consumption mode of the hard disk to be tested.
2. The performance testing method of the shingled hard disk according to claim 1, characterized in that: The method further comprises the following steps: When it is determined that the first quantity information does not match the second quantity information, a state switching command is re-issued to the hard disk to be tested until the hard disk to be tested returns the switching completion information.
3. The performance testing method of a shingled hard disk according to claim 1, characterized in that: The first quantity information also includes the size of the forced sequential write area; Correspondingly, in the step of sending an area switching command to the hard disk to be tested based on the determined quantity information, the status of the forced sequential write areas of the corresponding order are switched from empty to full in ascending or descending order of the sizes corresponding to the forced sequential write areas in the first quantity information.
4. The performance testing method of a shingled hard disk according to claim 2 or 3, characterized in that: The method further includes, before the step of sending an initialization command to the hard disk to be tested: Sending an initialization command to the hard disk to be tested; the initialization command is used to switch the status of all forced sequential write areas in the mechanical hard disk to empty; The state switching command includes the first recording command, the area switching command, the second recording command and the initialization command.
5. The performance testing method of a shingled hard disk according to claim 1, characterized in that: The step of performing a read and write test on the hard disk to be tested based on the determined switching completion information and generating a performance test result of the shingled hard disk to be tested specifically includes: Based on the determined switching completion information, a read / write test command is issued to the hard disk to be tested; the read / write test command is used to perform the read / write test on the hard disk to be tested; During the read and write test, at least one of a first verification command, a second verification command and a third verification command is sequentially issued to the hard disk to be tested after each preset time period; the first verification command, the second verification command and the third verification command are respectively used to query and verify the identification, attributes and power consumption mode information of the mechanical hard disk; The performance test result is generated based on the verification result returned by the hard disk to be tested according to at least one of the first verification command, the second verification command and the third verification command.
6. A performance test device for a shingled hard disk, characterized in that: The device comprises: A state switching module is used to send a state switching command to the hard disk to be tested, and determine the switching completion information returned by the hard disk to be tested according to the state switching command; the state switching command is used to switch the state of all forced sequential write areas in the mechanical hard disk to be tested from empty to full; The state switching module sends a state switching command to the hard disk to be tested, and determines the switching completion information returned by the hard disk to be tested according to the state switching command, including: sending a first recording command to the hard disk to be tested, and determining the first quantity information returned by the hard disk to be tested according to the first recording command; the first recording command is used to query and record the number of the forced sequential write areas in the state of being empty contained in the hard disk to be tested, and the first quantity information is used to characterize the number of the forced sequential write areas recorded by the first recording command; based on the determined first quantity information, sending an area switching command to the hard disk to be tested; the area switching command is used to write the forced sequential write areas corresponding to the first quantity information The state of the forced sequential write area is switched from empty to full; based on the completion of the state switching of the forced sequential write area, a second record command is issued to the hard disk to be tested, and the second quantity information returned by the hard disk to be tested according to the second record command is determined; the second record command is used to query and record the number of the forced sequential write areas with a full state contained in the hard disk to be tested, and the second quantity information is used to characterize the number of the forced sequential write areas recorded by the second record command; it is determined that the first quantity information matches the second quantity information, and the switching completion information returned by the hard disk to be tested based on the match is determined; the state switching command includes the first record command, the area switching command and the second record command; A performance testing module is used to perform a read and write test on the hard disk to be tested based on the determined switching completion information, and generate a performance test result of the shingled hard disk to be tested; the read and write test is used to query and verify at least one of the identification, attributes and power consumption mode of the hard disk to be tested.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the performance testing method of the shingled hard disk as described in any one of claims 1 to 5 are implemented.
8. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the performance testing method of the shingled hard disk as claimed in any one of claims 1 to 5 are implemented.
9. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the performance testing method of the shingled hard disk as claimed in any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Method and device for testing D3 supporting characteristics of solid state disk, computer equipment and storage medium
CN111949460A
Method and device for testing low-power state access time of solid state disk, computer equipment and storage medium
CN113468006A
