Storage controller testing method, device, electronic device and storage medium
By obtaining the target type of the equalization access operation of the storage controller and the address information of the storage device, the test information is generated, and sent to the storage controller for the equalization access operation, and the number of erases of each storage unit is obtained after completion, the problem that the storage controller cannot perform the equalization access operation correctly is solved and the service life of the storage device is extended.
Patent Information
- Application Number
- CN202510963505.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-14
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2045-07-14
AI Technical Summary
The storage controller fails to perform balanced access operations correctly, resulting in a shorter storage device life.
By obtaining the target type of the equalization access operation of the storage controller and the address information of the storage device, the test information is generated, and sent to the storage controller for the equalization access operation. After completion, the number of erases of each storage unit is obtained to determine the test result to ensure the equalization processing.
Ensure that the storage controller accurately performs balanced access operations in actual business and extends the service life of the storage device.
Smart Images

Figure CN120472974B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of storage technology, and in particular to a testing method, device, electronic device, and storage medium for a storage controller. Background Art
[0002] In the field of storage technology, a storage device includes multiple storage cells, each of which has a limited lifespan. For example, a storage controller may perform tens of thousands to millions of write operations on each storage cell. To achieve wear leveling across the storage cells in the storage device and extend the overall lifespan of the storage device, the storage controller can evenly distribute write operations across the storage cells.
[0003] However, there may be problems with the balanced access operation of the storage controller. Directly using the storage controller may cause the balanced access operation to fail to be performed correctly, thereby shortening the life of the storage device. Summary of the Invention
[0004] The present application provides a storage controller testing method, device, electronic device, storage medium, and program product to solve the problem of shortened storage device life caused by the storage controller's inability to correctly perform balanced access operations.
[0005] The present application provides a storage controller testing method, which is applied to a test system. The test system includes a test device, a storage controller, and a storage device. The method is executed by the test device and includes:
[0006] Acquire first test information corresponding to a target type to which a balanced access operation of the storage controller belongs, and address information of at least one storage unit included in the storage device;
[0007] generating second test information according to the address information of each storage unit and the first test information;
[0008] Sending second test information to the storage controller so that the storage controller performs a balanced access operation on one or more storage units included in the storage device based on the second test information;
[0009] After recognizing that the storage controller completes the balanced access operation, the erase count of each storage unit is obtained;
[0010] A test result of the access balancing operation performed by the storage controller is determined according to the target type and the number of erasures of each storage unit.
[0011] The present application also provides a storage controller testing device, the device comprising:
[0012] an acquisition module, configured to acquire first test information corresponding to a target type to which a balanced access operation of the storage controller belongs, and address information of at least one storage unit included in a storage device controlled by the storage controller;
[0013] A generating module, configured to generate second test information according to the address information of each storage unit and the first test information;
[0014] a sending module, configured to send second test information to the storage controller, so that the storage controller performs a balanced access operation on one or more storage units included in the storage device based on the second test information;
[0015] The acquisition module is further configured to acquire the number of erase times of each storage unit after recognizing that the storage controller completes the balanced access operation;
[0016] The determination module is used to determine a test result of the storage controller performing the balanced access operation according to the target type and the number of erasures of each storage unit.
[0017] The present application also provides an electronic device, comprising: a memory for storing a computer program; and a processor for implementing the steps of any of the above-mentioned methods for testing a storage controller when executing the computer program.
[0018] The present application also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned methods for testing a storage controller are implemented.
[0019] The present application also provides a computer program product, including a computer program, which implements the steps of any of the above-mentioned storage controller testing methods when executed by a processor.
[0020] Through the present application, before a storage controller is put into use, the target type of the current storage controller's balanced access operation can be obtained, as well as the address information of the storage unit on the storage device on which the storage controller performs a write operation. In this way, a testing device can generate second test information based on the address information of the storage unit and the first test information, and send it to the storage controller, so that the storage controller can perform a balanced access operation on the storage unit of the storage device based on the second test information. After recognizing that the storage controller has completed the balanced access operation, the testing device can obtain the number of erases of each storage unit. Since the erase number can reflect the wear of the storage unit, based on the target type and the number of erases of the storage unit, it can be determined whether the storage controller performed accurate balancing during the access operation. In this way, technicians can improve the storage controller based on the test results and put it into use after the storage controller meets the relevant requirements. This can ensure that the storage controller accurately performs balanced access operations in actual business processing, ensure wear balancing between the various storage units included in the storage device, and thus extend the service life of the storage device. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0022] Figure 1 A schematic diagram of the architecture of a test system provided in an embodiment of the present application;
[0023] Figure 2 A flowchart of a method for testing a storage controller provided in an embodiment of the present application;
[0024] Figure 3 A schematic diagram of a dynamic balancing type of data storage provided in an embodiment of the present application;
[0025] Figure 4 A schematic diagram of a static balancing type of data storage provided in an embodiment of the present application;
[0026] Figure 5 A flowchart of another storage controller testing method provided in an embodiment of the present application;
[0027] Figure 6 A flowchart of another method for testing a storage controller provided in an embodiment of the present application;
[0028] Figure 7A flowchart of another method for testing a storage controller provided in an embodiment of the present application;
[0029] Figure 8 A schematic structural diagram of a storage controller test device provided in an embodiment of the present application;
[0030] Figure 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0031] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0032] It should be noted that, in the description of this application, the terms "comprises," "includes," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. The terms "first," "second," etc., in this application are used to distinguish similar objects, and are not used to describe a particular order or sequence.
[0033] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0034] The test method for the storage controller provided in this application can be implemented by a test system, such as Figure 1As shown, the test system may include a test device and a storage subsystem. The storage subsystem may include a storage controller and a storage device. The test device may be a computer device, such as a server or a computer. The storage subsystem may be a hard drive, such as a solid-state drive (SSD). The storage controller may be the host controller in the hard drive. The storage device may include multiple storage units, which may also be referred to as physical data blocks. The storage device may be the flash memory (NAND) in the hard drive. The flash memory may include multiple flash memory cells (which may be the aforementioned storage cells). Each flash memory cell has a limited lifespan. After multiple writes, the flash memory cell wears out significantly, making it incapable of further reading and writing, and therefore unusable for data storage, shortening the lifespan of the storage device. Therefore, the storage controller can perform access balancing operations to balance the wear between the flash memory cells, thereby extending the lifespan of the storage device. To ensure that the storage controller can correctly perform access balancing operations, it can be tested first. If the test result is successful, the storage controller can be used again.
[0035] The embodiment of the present application provides a test method for a storage controller, which can be executed by a test device, such as Figure 2 As shown, the specific processing steps of the storage controller testing method may include:
[0036] Step S201: Acquire first test information corresponding to a target type of a balanced access operation of a storage controller and address information of at least one storage unit included in a storage device.
[0037] The first test information may be information indicating an access operation of the storage controller to the storage device. For example, when the target type is dynamic balancing, the first test information may include grouping operation indication information, erase count allocation indication information, random write operation type, and the number of write operations corresponding to the random write operation type. When the target type is static balancing, the first test information may include a target test scenario, or the first test information may directly include test address indication information corresponding to the target test scenario, the number of tests, multiple operation types, and the operation sequence corresponding to each operation type.
[0038] The dynamic balancing type of balanced access operation is that when the storage controller receives data sent by the host, it performs a write operation (writes new data or updates old data), first determines the storage unit with the least number of erase cycles (PE), and writes the data to the storage unit to achieve wear leveling of the storage units in the storage device. Figure 3As shown, cold data is written to the oldest data block (storage unit 1), and hot data is written to the youngest data block (storage unit 2).
[0039] The static wear leveling (SWL) type of balanced access operation is a type of balanced access operation in which the storage controller migrates cold data (data with an access frequency lower than a preset frequency threshold) to achieve wear leveling of storage units in the storage device. For example, the storage controller can monitor the erase counts of each storage unit in the background. When it is monitored that the erase count of any storage unit is greater than a third preset threshold, it migrates the hot data (data with an access frequency greater than or equal to the preset frequency threshold) stored in it to a storage unit with an erase count less than the third preset threshold, and migrates a cold data to the storage unit with an erase count greater than the third preset threshold. In this way, cold data that has not been modified for a long time can be migrated from a young data block (a storage unit with an erase count less than or equal to the third preset threshold) to an old data block (a storage unit with an erase count greater than the third preset threshold). That is, in a certain storage unit, cold data was originally stored, and hot data will be stored after a subsequent balanced access operation. Or, hot data was originally stored, and cold data will be stored after a subsequent balanced access operation. For example Figure 4 As shown, storage unit 1 originally stores hot data. Since it is monitored that the number of erasures is greater than a third preset threshold, the hot data in storage unit 1 is migrated to another storage unit whose number of erasures is less than or equal to the third preset threshold, and the cold data is migrated to storage unit 1. This is equivalent to the hot data originally stored in storage unit 1 being later stored as cold data.
[0040] Specifically, before testing the storage controller, the test device needs to first obtain first test information and address information of at least one storage unit included in the storage device, and then perform a test operation using the first test information and the address information of the storage unit.
[0041] First, obtain the first test information.
[0042] The test device may first identify the target type of the storage controller's access balancing operation and then, based on the target type, select test information corresponding to the target type from among multiple pre-built test information corresponding to each type as the first test information. Alternatively, the test device may directly receive the first test information sent by the user device.
[0043] Second, obtain address information of at least one storage unit included in the storage device.
[0044] The test device can first obtain the total capacity of the storage device and, based on the preset logical block size and total capacity, determine at least one logical block address (LBA) corresponding to the storage device. For each logical block address, the test device can first obtain an instruction to obtain the physical block address (PBA) corresponding to each logical block address, and deduplicate all the obtained physical block addresses to obtain a set of physical block addresses corresponding to the storage device. A physical block address in the set of physical block addresses is the address information of the above-mentioned storage unit. For example, the first acquisition instruction can be "nvme get-pba-o 0xaa -p F / dev / nvme", where "0xaa" indicates the operation type for obtaining the number of erase times, and "pba" indicates the physical block address.
[0045] In some optional embodiments, before performing subsequent tests, the test device may first obtain the initial erase count of each storage unit. Furthermore, the test device may issue a write operation instruction to the storage controller, wherein the write operation instruction may include a sequential write operation type and the number of write operations corresponding to the sequential write operation type. In this way, the storage controller may perform a balanced access operation based on the sequential write operation type and its corresponding number of write operations. When the test device detects that the storage controller completes the balanced access operation, it may obtain the test erase count of each storage unit included in the storage device. Finally, the storage controller may determine the initial test result based on the test erase count, the initial erase count, and the number of write operations corresponding to the sequential write operation type of each storage unit. When it is determined that the initial test result is a successful test, subsequent test operations are performed.
[0046] Since the initial test is a relatively basic testing process, if subsequent complex tests are performed before the initial test fails, it will lead to a waste of resources. Therefore, this solution only performs subsequent test operations after determining that the initial test result is a success, which can reduce the problem of resource waste.
[0047] The process of determining the initial test results may specifically include:
[0048] Based on the number of test erases and the initial erase number of the first storage unit, the change value of the erase number of the first storage unit is determined. Further, the target difference between the change value of the erase number of the first storage unit and the number of write operations corresponding to the sequential write operation type is calculated to determine whether the target difference is less than a preset threshold. If so, the test success can be determined as the sub-test result corresponding to the first storage unit. If not, the test failure can be determined as the sub-test result corresponding to the first storage unit. The first storage unit is any storage unit in the storage device. When the sub-test result of each storage unit is determined based on the same method, the test device can count the proportion of the sub-test results of the test failure in all the sub-test results. When it is determined that the proportion is greater than the first preset proportion threshold, the test success is determined as the initial test result. When it is determined that the proportion is less than or equal to the first preset proportion threshold, the test failure is determined as the initial test result.
[0049] Step S202 : generating second test information according to the address information of each storage unit and the first test information.
[0050] Specifically, the test device can process the acquired address information of the storage unit according to the first test information to obtain the second test information. Because the first test information is related to the target type of the access balancing operation, the process of generating the second test information is described in detail below in two cases.
[0051] Case 1: Dynamic balancing type. The test device groups the address information of all storage cells in at least one storage cell according to the grouping operation instruction information to obtain multiple test groups. Based on the erase count allocation instruction information, an erase count is assigned to each test group to obtain an erase count corresponding to each test group. Second test information is generated based on each test group, the erase count corresponding to each test group, the random write operation type, and the write count.
[0052] The test device can group the address information of all acquired storage units according to the grouping operation instruction information to obtain multiple test groups. Then, according to the erase count allocation instruction information, an erase count is allocated to each test group. Finally, second test information can be generated based on each test group, the erase count corresponding to each test group, the random write operation type, and the write operation count. In this way, multiple test groups are obtained through the grouping operation, and different erase counts are allocated to different test groups. This allows the storage controller to set different erase counts for storage units corresponding to different test groups, so that in subsequent random write operations, the storage controller can perform random write operations based on the different erase counts of the storage units, triggering the storage controller to perform dynamic balancing processing.
[0053] Specifically, during the process of generating the second test information, the testing device can generate a first erase count setting instruction based on the first test group (any test group) and the erase count corresponding to the first test group. Similarly, a corresponding erase count setting instruction can be generated for each test group. Furthermore, the testing device can generate a first write operation instruction based on the random write operation type and its corresponding write count. The erase count setting instruction and the first write operation instruction corresponding to each test group constitute the second test information.
[0054] For example, during a grouping operation, the test equipment can divide the address information of the memory cells into odd and even groups (i.e., test groups) based on the address information of the memory cells. A first erase count can be assigned to the odd group, and a second erase count can be assigned to the even group. Furthermore, the first erase count can be one order of magnitude smaller than the second erase count (the first erase count can be 150, and the second erase count can be 1500). The number of random write operations can be 500. The erase count setting instruction for the odd group can be "Nvme set-block-pe / dev / nvme -p pba –o 0xds–t 150," where "0xds" indicates the erase count setting operation type, "150" is the first erase count, and "pba" indicates the address information of the memory cells included in the odd group. The erase count setting instruction corresponding to the even group can be "Nvme set-block-pe / dev / nvme -p pba –o 0xds –t 150", where "0xds" indicates the erase count setting operation type, "1500" is the first erase count, and "pba" indicates the address information of the storage unit included in the even group.
[0055] Case 2: Static balancing. Based on the target test scenario, the test device obtains test address indication information corresponding to the target test scenario, the number of tests, multiple operation types, and the operation sequence corresponding to each operation type. Second test information is generated based on the number of tests, each operation type, the operation sequence corresponding to each operation type, and the test address indication information.
[0056] The test device can select the target sub-test information corresponding to the target test scenario from the sub-test information corresponding to the multiple test scenarios according to the target test scenario. The target sub-test information may include test address indication information, test times, multiple operation types, and operation sequences corresponding to the multiple operation types. In this way, the test device can generate second test information based on the test times, each operation type, the operation sequence corresponding to each operation type, and the test address indication information. The test address indication information may be a preset ratio. When the target test scenario is a scenario in which an error is injected to trigger data migration, the test address indication information included in the target sub-test information may be 10%, the test times may be 500 times, and the multiple operation types may be random write operations, error injection operations, and random read operations in order of operation. When the target test scenario is a scenario in which data is forced to be moved, the test address indication information included in the target sub-test information may be 1%, the test times may be 500 times, and the multiple operation types may be random write operations and forced move operations in order of operation.
[0057] Specifically, the test device may determine all physical data block addresses corresponding to the test address indication information based on the test address indication information, all logical data block addresses, and the mapping relationship between the logical data block addresses and the physical data block addresses. Furthermore, the test device may generate second test information based on all physical data block addresses corresponding to the test address indication information, the number of tests, each operation type, and the operation sequence corresponding to each operation type.
[0058] Furthermore, in scenarios where errors are injected to trigger data migration, during the process of generating the second test information, the test device can first generate a second write operation instruction based on all physical data block addresses and random write operation types corresponding to the test address indication information. Then, based on all physical data block addresses and error injection operation types corresponding to the test address indication information, an error injection operation instruction can be generated. Then, based on all physical data block addresses and random read operation types corresponding to the test address indication information, a third write operation instruction can be generated. The number of tests, the order of operations corresponding to each operation type, the second write operation instruction, the third write operation instruction, and the error injection instruction together constitute the second test information.
[0059] For the scenario of forced data relocation, in the process of generating the second test information, the test device can first generate a fourth write operation instruction based on all physical data block addresses and random write operation types corresponding to the test address indication information. Generate a forced relocation operation instruction based on all physical data block addresses and forced relocation operation types corresponding to the test address indication information. Among them, the number of tests, the operation sequence corresponding to each operation type, the fourth write operation instruction, and the forced relocation operation instruction together constitute the second test information. For example, the forced relocation operation instruction can be "nvme rm_debug_entry –o 0xf0 –f 4 -p <pba> / dev / nvme", where "0xf0" indicates the forced move operation type, <pba>" indicates all physical data block addresses corresponding to the test address indication information.
[0060] For example, the first 10% of all logical data block addresses corresponding to the storage device are determined as the logical data block addresses to be tested, and based on the mapping relationship between the logical data block addresses and the physical data block addresses, the physical data block addresses corresponding to the logical data block addresses to be tested are determined, that is, the physical data block addresses corresponding to the test address indication information are determined.
[0061] Step S203: Send second test information to the storage controller.
[0062] The storage controller performs a balanced access operation on one or more storage units included in the storage device based on the second test information.
[0063] Specifically, the test device may send the second test information to the storage controller. The storage controller may perform a balanced access operation on the storage device based on the second test information and the balanced access mechanism of the target type. Accordingly, after receiving different test information, the storage controller may perform different balanced access operations, which may specifically include:
[0064] Case 1: Dynamic balancing type. The test device may first send the write operation instruction corresponding to each test group to the storage controller separately or simultaneously, and then send the first write operation instruction to the test device after detecting that the storage controller has completed the erase count setting operation corresponding to all test groups. Alternatively, the test device may directly send the entire content of the second test information to the storage controller. For the former operation mode, the storage controller executes the operation corresponding to the operation instruction each time it receives an operation instruction. For the latter operation mode, the storage controller may first execute the erase count setting instruction corresponding to each test group, that is, update the erase count of the storage unit corresponding to the target test group according to the erase count corresponding to the target test group, and the target test group is any test group in at least one test group, so that the storage controller performs a random write operation on the storage device according to the updated erase count of each storage unit and the first write operation instruction. Specifically, it may be to perform a random write operation on the storage units included in the storage device according to the updated erase count of each storage unit and the random write operation type, the number of times the first write operation is equal to the number of times the first write operation is performed.
[0065] After modifying the erase count, the storage controller, when continuing to perform random write operations, will write data to the storage cells with fewer erase counts. For example, because the erase count of the odd-numbered array is less than that of the even-numbered array, the storage controller will prioritize writing data to the storage cells corresponding to the odd-numbered array when performing a data write operation. After completing the random write operation, the erase count of the storage cells in the odd-numbered array increases significantly, while the erase count of the storage cells in the even-numbered array increases less significantly. This allows subsequent test results to accurately determine whether the storage controller correctly performed access balancing based on this rule.
[0066] Case 2: static equilibrium type.
[0067] In each test round, the test device may send each operation instruction included in the second test information to the storage controller in the order of operation. The storage controller performs the operation corresponding to each operation instruction received. After the operation is completed, it executes the next operation instruction received, and so on. Alternatively, the test device may directly send the entire content of the second test information to the storage controller.
[0068] In the scenario of injecting errors to trigger data migration, after receiving the second test information, the storage controller determines, based on the test address indication information, the memory cell to be tested that corresponds to the test address indication information among the memory cells included in the storage device. The storage controller can then perform multiple rounds of balanced access operations on the memory cell to be tested, equal to the number of tests. In each round of testing, a random write operation, an error injection operation, and a random read operation are performed in the order in which the operations are performed. For example, the injected error can be an uncorrectable error (Unc).
[0069] In the forced data migration scenario, after receiving the second test information, the storage controller determines, based on the test address indication information, a memory cell to be tested corresponding to the test address indication information among the memory cells included in the storage device. The storage controller can then perform multiple rounds of balanced access operations on the memory cell to be tested, equal to the number of tests. In each round of testing, the random write operation and the forced data migration operation are performed sequentially according to the operation order.
[0070] After completing the access balancing operation, the storage controller may send a completion notification to the test device.
[0071] In some optional implementations, the test equipment can retrieve and record the erase count of each storage unit after detecting that the storage controller has completed each round of testing operations. This allows technicians to conduct analysis based on the erase counts collected after each round of testing operations if a test result is subsequently determined to be a test failure.
[0072] Step S204 : After it is recognized that the storage controller completes the access balancing operation, the erasure count of each storage unit is obtained.
[0073] Specifically, the test device can determine that the balancing access operation is complete upon receiving a completion notification from the storage controller. Upon completing the balancing access operation, the test device can send an erase count acquisition instruction to the storage controller. Upon receiving the erase count acquisition instruction, the storage controller can send the erase count for each storage unit, which it has recorded, to the test device. This allows the test device to obtain the erase count for each storage unit. For example, the erase count acquisition instruction can be "nvme get_block_PE / dev / nvme -o 0xee -f 2 -p pba."
[0074] Step S205 : determining a test result of the access balancing operation performed by the storage controller according to the target type and the erase count of each storage unit.
[0075] Specifically, the test device may perform analysis and processing on the erase count of the storage unit according to the target type to obtain an analysis result. Further, the test result of the storage controller performing the access balancing operation may be determined based on the analysis result. Accordingly, step S205 may include the following two cases:
[0076] Case 1: dynamic equilibrium type.
[0077] Step 1: When it is determined that the target type is the dynamic balancing type, obtain erasure count change range indication information corresponding to each test group.
[0078] Step 2: determining a test result according to the erasure count of each memory cell, the erasure count of each test group, and the erasure count variation range indication information corresponding to each test group.
[0079] When the test device determines that the target type is a dynamic balancing type, it can obtain the erasure count change range indication information corresponding to each test group, and determine the erasure count of each test group and the erasure count change range indication information corresponding to each test group as reference information for analysis and processing. Finally, the test device can determine the test results based on the erasure count of each storage unit and the determined reference information, which may include:
[0080] Step 1: Determine the change in the number of erase times of the target storage unit according to the number of erase times of the target storage unit and the number of erase times corresponding to the target test group.
[0081] The target storage unit is any one of the at least one storage unit, and the target test group is the test group to which the target storage unit belongs.
[0082] Step 2: When it is determined that the erase count change amount of the target storage unit matches the erase count change amplitude indication information corresponding to the target test group, determine the test success as the target sub-test result corresponding to the target storage unit.
[0083] Step 3: When it is determined that the erase count change amount of the target storage unit does not match the erase count change amplitude indication information corresponding to the target test group, determine a test failure as the target sub-test result.
[0084] Step 4: After the sub-test results corresponding to each storage unit are determined, a test result is determined according to the sub-test results corresponding to each storage unit.
[0085] Taking the target storage unit as an example, the test device can determine the difference between the number of erasures of the target storage unit and the number of erasures of the target erasure group as the change in the number of erasures of the target storage unit. When it is determined that the change in the number of erasures of the target storage unit is within the range indicated by the erasure number change amplitude indication information corresponding to the target test group, the test success is determined as the target sub-test result corresponding to the target storage unit. Alternatively, when it is determined that the change in the number of erasures of the target storage unit is not within the range indicated by the erasure number change amplitude indication information corresponding to the target test group, the test failure is determined as the target sub-test result corresponding to the target storage unit. In this way, for each storage unit, the sub-test results corresponding to all storage units can be determined in a similar manner. Finally, the test device can determine whether the proportion of sub-test results that are test successes is greater than a second preset proportion threshold. If so, the test success is determined as the test result. If not, the test device is determined as the test result.
[0086] Case 2: static equilibrium type.
[0087] Step 1: When the target type is determined to be the static balancing type, the maximum erase count, the minimum erase count, and the average erase count are determined according to the erase count of each memory cell.
[0088] Step 2: Determine the test result based on the maximum erase times, the minimum erase times, and the average erase times.
[0089] When the test equipment determines the static balancing type, it determines relevant statistical index values based on the number of erase times of each storage unit, namely, the maximum number of erase times, the minimum number of erase times, and the average number of erase times, and determines the test results based on the relevant statistical index values, specifically including the following steps:
[0090] Step 1: Determine a first erasure count difference according to the maximum erasure count and the minimum erasure count.
[0091] Step 2: Determine a second erasure count difference according to the maximum erasure count and the average erasure count.
[0092] Step 3: When it is determined that the first erasure count difference is less than the first preset threshold value, and the second erasure count difference is less than the second preset threshold value, determine the test success as the test result.
[0093] or,
[0094] Step 4: When it is determined that the first erasure count difference is greater than or equal to the first preset threshold, or the second erasure count difference is greater than or equal to the second preset threshold, determine a test failure as the test result.
[0095] For example, the first preset threshold is greater than the second preset threshold, the first preset threshold may be 100, and the second preset threshold may be 50.
[0096] Under the processing of the static balancing type of balanced access operation, the number of erase times of each storage unit will tend to be averaged. When it is determined that the difference in the first number of erase times is less than the first preset threshold, and the difference in the second number of erase times is less than the second preset threshold, it can be said that the number of erase times of the storage unit is relatively average, that is, the storage controller accurately performs the balancing process. When it is determined that the difference in the first number of erase times is greater than or equal to the first preset threshold, or that the difference in the second number of erase times is greater than or equal to the second preset threshold, it can be said that the difference in the number of erase times between different storage units is high, that is, the storage controller does not accurately perform the balancing process. Therefore, through the above comparison, the test results of the storage controller can be determined, thereby guiding technicians to improve the storage controller, achieve better balanced access effects, and extend the life of the storage device.
[0097] In a storage controller testing method according to an embodiment of the present application, before the storage controller is put into use, the target type of the current storage controller's balanced access operation and the address information of the storage unit on the storage device on which the storage controller performs a write operation can be obtained. In this way, the testing device can generate second test information based on the address information of the storage unit and the first test information, and send it to the storage controller, so that the storage controller can perform balanced access operations on the storage units of the storage device based on the second test information. After recognizing that the storage controller has completed the balanced access operation, the testing device can obtain the erase count of each storage unit. Since the erase count can reflect the wear of the storage unit, based on the target type and the erase count of the storage unit, it can be determined whether the storage controller accurately performed balanced access operations during the access operation. In this way, technicians can improve the storage controller based on the test results and put it into use only after the storage controller meets the relevant requirements. This can ensure that the storage controller accurately performs balanced access operations in actual business processing, ensure wear balancing between the various storage units included in the storage device, and thus extend the service life of the storage device.
[0098] The following describes in detail the execution process of the above storage controller testing method using multiple specific examples.
[0099] Example 1: In the dynamic balancing mode, the test process for the storage controller can be as follows: Figure 5 As shown, the following steps are included:
[0100] In step 1, the test device traverses the logical data block addresses of the storage device. For each logical data block address traversed, the test device uses "nvme get-pba -o 0xaa -p F / dev / nvme" to obtain the physical data block address corresponding to each logical data block address. After obtaining the physical data block address corresponding to each logical data block address, it performs deduplication processing to obtain the set of physical data block addresses required for subsequent testing.
[0101] In step 2, for each physical data block address in this set of physical data block addresses, the test device can use "nvme get_block_PE / dev / nvme -o 0xee -f 2 -p pba" to obtain the initial erase count corresponding to each physical data block address. The test device can then send a write operation command to the storage controller (the write operation command includes a sequential full-disk write operation type and the write operation count corresponding to the sequential full-disk write operation type, for example, 100). Upon receiving the write operation command, the storage controller can sequentially write data 100 times to the entire disk of the storage device. After recognizing that the storage controller has completed the write operation, the test device again uses "nvme get_block_PE / dev / nvme -o 0xee -f 2 -p pba" to obtain the test erase count corresponding to each physical data block address. Based on the initial erase count and test erase count corresponding to each physical data block address, as well as the write operation count corresponding to the sequential full-disk write operation type, the test device can determine the initial test result (for details, see step S201 above).
[0102] Step 3. When the initial test result is determined to be successful, the physical data block address set is divided into an odd group and an even group. For the odd group, the test device can send the "Nvme set-block-pe / dev / nvme* -p pba –o 0xds –t 150" command to the storage controller, and the storage controller can set the erase count corresponding to the physical data block addresses of the odd group to 150. For the even group, the test device can send the "Nvme set-block-pe / dev / nvme -p pba –o 0xds –t 1500" command to the storage controller, and the storage controller can set the erase count corresponding to the physical data block addresses of the even group to 1500.
[0103] Step 4: After completing the erase count setting operation, the test device can again send a write operation command to the storage controller (this write operation command includes the full-disk random write operation type and the write operation count corresponding to the full-disk random write operation type). Upon receiving the write operation command, the storage controller can perform 500 random write operations on the entire disk. After the test device detects that the storage controller has completed 500 random write operations, it rechecks the erase count corresponding to each physical data block.
[0104] In step five, the test equipment may analyze the erase count of each memory cell acquired last time to obtain a test result (for details, please refer to the processing of case one in step S205 ).
[0105] Example 2: In static balancing, a registration error triggers data migration. The test process for the storage controller can be as follows: Figure 6 As shown, the following steps are included:
[0106] Step 1: Obtain the required physical data block address set (similar to step 1 in Example 1 and will not be repeated here).
[0107] Step 2: Perform an initial test on the storage controller to obtain an initial test result (similar to step 2 in Example 1 and will not be repeated here).
[0108] Step three: When it is determined that the initial test result is a success, the pre-generated second test information is sent to the storage controller.
[0109] Step 4: The storage controller performs a random write operation once in the physical data block corresponding to the test address indication information in the storage device.
[0110] In step five, the storage controller injects an error into the physical data block corresponding to the test address indication information in the storage device to simulate a failure or abnormal state of the physical data block.
[0111] Step six: the storage controller performs a random read operation on the physical data block corresponding to the test address indication information in the storage device.
[0112] Repeat steps 4 to 6 500 times (test times). After completing step 6 each time, the memory controller may send the updated erase count of each memory cell to the test device for subsequent analysis.
[0113] In step seven, the test equipment may analyze the erase count of each memory cell acquired last time to obtain a test result (for details, refer to the processing of case two in step S205 ).
[0114] Example 3: For forced data movement under static balancing type, the test process for the storage controller can be as follows: Figure 7 As shown, the following steps are included:
[0115] Step 1: Obtain the required physical data block address set (similar to step 1 in Example 1 and will not be repeated here).
[0116] Step 2: Perform an initial test on the storage controller to obtain an initial test result (similar to step 2 in Example 1 and will not be repeated here).
[0117] Step three: When it is determined that the initial test result is a success, the pre-generated second test information is sent to the storage controller.
[0118] In step 4, the storage controller performs a random write operation once in the storage unit corresponding to the test address indication information in the storage device to simulate a random write load.
[0119] Step 5: The storage controller may execute the following command according to the "nvme rm_debug_entry –o0xf0 –f 4 -p <pba> / dev / nvme" forcibly moves the data written in step 4 to simulate data block migration and defragmentation.
[0120] Repeat steps 4 and 5 500 times to simulate continuous writing, migration, and defragmentation.
[0121] Step 6: The test equipment obtains the erase count of each memory cell, analyzes the count, and obtains a test result (for details, refer to the processing of case 2 in step S205).
[0122] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method.
[0123] The embodiment of the present application also provides a test device for a storage controller, such as Figure 8 Shown, including:
[0124] An acquisition module 810 is configured to acquire first test information corresponding to a target type of a balanced access operation of the storage controller, and address information of at least one storage unit included in a storage device controlled by the storage controller;
[0125] A generating module 820, configured to generate second test information according to the address information of each storage unit and the first test information;
[0126] a sending module 830 configured to send second test information to the storage controller so that the storage controller performs a balanced access operation on one or more storage units included in the storage device based on the second test information;
[0127] The acquisition module 810 is further configured to acquire the number of erase times of each storage unit after recognizing that the storage controller completes the access balancing operation;
[0128] The determination module 840 is configured to determine a test result of the storage controller performing the access balancing operation according to the target type and the number of erase times of each storage unit.
[0129] In some optional implementations, when the target type is a dynamic balancing type, the first test information includes grouping operation indication information, erase count allocation indication information, a random write operation type, and a write operation count corresponding to the random write operation type; the generation module 820 is specifically configured to:
[0130] Grouping address information of all storage units in at least one storage unit according to the grouping operation instruction information to obtain a plurality of test groups;
[0131] Allocating an erasure count to each test group according to the erasure count allocation indication information to obtain an erasure count corresponding to each test group;
[0132] Second test information is generated according to each test group, the number of erase operations corresponding to each test group, the random write operation type, and the number of write operations.
[0133] In some optional implementations, the generating module 820 is specifically configured to:
[0134] When the target type is determined to be a dynamic balancing type, obtaining erasure count change amplitude indication information corresponding to each test group;
[0135] The test result is determined according to the number of erasures of each storage unit, the number of erasures corresponding to each test group, and the indication information of the change range of the number of erasures corresponding to each test group.
[0136] In some optional implementations, the determination module 840 is specifically configured to:
[0137] determining a change in the number of erase times of the target storage unit according to the number of erase times of the target storage unit and the number of erase times corresponding to the target test group, wherein the target storage unit is any one of the at least one storage unit, and the target test group is the test group to which the target storage unit belongs;
[0138] When it is determined that the erase count change amount of the target storage unit matches the erase count change amplitude indication information corresponding to the target test group, determining the test success as the target sub-test result corresponding to the target storage unit;
[0139] Alternatively, when it is determined that the erase count change amount of the target storage unit does not match the erase count change amplitude indication information corresponding to the target test group, a test failure is determined as the target sub-test result;
[0140] After the sub-test results corresponding to each memory cell are determined, a test result is determined based on the sub-test results corresponding to each memory cell.
[0141] In some optional implementations, when the target type is a static balancing type, the first test information includes a target test scenario; the generating module 820 is specifically configured to:
[0142] According to the target test scenario, obtaining test address indication information, test times, multiple operation types, and an operation sequence corresponding to each operation type corresponding to the target test scenario;
[0143] Second test information is generated according to the number of tests, each operation type, the operation sequence corresponding to each operation type, and the test address indication information.
[0144] In some optional implementations, the determination module 840 is specifically configured to:
[0145] When the target type is determined to be a static balancing type, the maximum erase count, the minimum erase count, and the average erase count are determined according to the erase count of each storage unit.
[0146] The test result is determined based on the maximum erase times, the minimum erase times, and the average erase times.
[0147] In some optional implementations, the determination module 840 is specifically configured to:
[0148] Determining a first erasure count difference according to the maximum erasure count and the minimum erasure count;
[0149] Determining a second erasure count difference according to the maximum erasure count and the average erasure count;
[0150] When it is determined that the first erasure count difference is less than a first preset threshold value, and the second erasure count difference is less than a second preset threshold value, determining the test success as the test result;
[0151] or,
[0152] When it is determined that the first erasure count difference is greater than or equal to the first preset threshold, or the second erasure count difference is greater than or equal to the second preset threshold, a test failure is determined as the test result.
[0153] For descriptions of features in the embodiments corresponding to the storage controller testing device, reference may be made to the relevant descriptions of the embodiments corresponding to the storage controller testing method, which will not be detailed here.
[0154] The embodiment of the present application also provides an electronic device, such as Figure 9 As shown, it includes a memory 10 and a processor 20, wherein the memory 10 stores a computer program, and the processor 20 is configured to run the computer program to execute the steps in any of the above-mentioned memory controller test method embodiments.
[0155] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. The computer program is configured to execute the steps of any of the above-mentioned storage controller testing method embodiments when run.
[0156] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.
[0157] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps of any of the above-mentioned storage controller testing method embodiments are implemented.
[0158] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of any of the above-mentioned storage controller test method embodiments are implemented.
[0159] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0160] The above is a detailed introduction to the test method, device, electronic device, storage medium, and program product of a storage controller provided by the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core ideas of the present application. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of the present application.< / pba> < / pba> < / pba>
Claims
1. A method for testing a storage controller, characterized in that: The method is applied to a test system, the test system including a test device, a storage controller, and a storage device. The method is executed by the test device and includes: Acquire first test information corresponding to a target type to which the balanced access operation of the storage controller belongs, and address information of at least one storage unit included in the storage device; generating second test information according to the address information of each of the storage units and the first test information; Sending the second test information to the storage controller, so that the storage controller performs a balanced access operation on one or more storage units included in the storage device based on the second test information; When it is recognized that the storage controller completes the balanced access operation, obtaining the number of erasures of each of the storage units; A test result of the access balance operation performed by the storage controller is determined according to the target type and the number of erasures of each of the storage units.
2. The storage controller testing method according to claim 1, wherein: When the target type is a dynamic balancing type, the first test information includes grouping operation indication information, erasure count allocation indication information, a random write operation type, and a write operation count corresponding to the random write operation type; Generating second test information according to the address information of each storage unit and the first test information includes: grouping the address information of all storage units in at least one of the storage units according to the grouping operation instruction information to obtain a plurality of test groups; Allocating an erasure count to each of the test groups according to the erasure count allocation indication information, to obtain an erasure count corresponding to each of the test groups; The second test information is generated according to each of the test groups, the number of erasures corresponding to each of the test groups, the random write operation type, and the number of write operations.
3. The storage controller testing method according to claim 2, wherein: The step of determining, based on the target type and the number of erase times of each of the storage units, a test result of the storage controller performing the access balancing operation includes: When it is determined that the target type is the dynamic balancing type, obtaining erasure count change amplitude indication information corresponding to each of the test groups; The test result is determined according to the number of erasures of each storage unit, the number of erasures corresponding to each test group, and the indication information of the change range of the number of erasures corresponding to each test group.
4. The storage controller testing method according to claim 3, wherein: The determining the test result according to the number of erasures of each storage unit, the number of erasures corresponding to each test group, and the indication information of the change range of the number of erasures corresponding to each test group includes: determining a change in the number of erase times of the target storage unit according to the number of erase times of the target storage unit and the number of erase times corresponding to the target test group, wherein the target storage unit is any one of the at least one storage unit, and the target test group is the test group to which the target storage unit belongs; When it is determined that the erase count change amount of the target storage unit matches the erase count change amplitude indication information corresponding to the target test group, determining a test success as a target sub-test result corresponding to the target storage unit; Alternatively, when it is determined that the erase count change amount of the target storage unit does not match the erase count change amplitude indication information corresponding to the target test group, a test failure is determined as the target sub-test result; After the sub-test results corresponding to each of the storage units are determined, the test result is determined according to the sub-test results corresponding to each of the storage units.
5. The storage controller testing method according to claim 1, wherein: When the target type is a static balancing type, the first test information includes a target test scenario; Generating second test information according to the address information of each storage unit and the first test information includes: According to the target test scenario, acquiring test address indication information, test times, multiple operation types, and an operation sequence corresponding to each of the operation types corresponding to the target test scenario; The second test information is generated according to the test number, each of the operation types, the operation sequence corresponding to each of the operation types, and the test address indication information.
6. The storage controller testing method according to claim 5, wherein: The step of determining, based on the target type and the number of erase times of each of the storage units, a test result of the storage controller performing the access balancing operation includes: When it is determined that the target type is the static balancing type, determining a maximum erasure count, a minimum erasure count, and an average erasure count according to the erasure count of each of the storage cells; The test result is determined according to the maximum number of erasures, the minimum number of erasures, and the average number of erasures.
7. The storage controller testing method according to claim 6, wherein: The determining the test result according to the maximum number of erasures, the minimum number of erasures, and the average number of erasures includes: Determining a first erasure count difference according to the maximum erasure count and the minimum erasure count; determining a second erasure count difference according to the maximum erasure count and the average erasure count; When it is determined that the first erasure number difference is less than a first preset threshold value, and the second erasure number difference is less than a second preset threshold value, determining that the test is successful as the test result; or, When it is determined that the first erasure number difference is greater than or equal to the first preset threshold, or the second erasure number difference is greater than or equal to the second preset threshold, a test failure is determined as the test result.
8. A test device for a storage controller, characterized in that: include: an acquisition module, configured to acquire first test information corresponding to a target type to which a balanced access operation of a storage controller belongs, and address information of at least one storage unit included in a storage device controlled by the storage controller; a generating module, configured to generate second test information according to the address information of each storage unit and the first test information; a sending module, configured to send the second test information to the storage controller, so that the storage controller performs a balanced access operation on one or more storage units included in the storage device based on the second test information; The acquisition module is further configured to acquire the number of erasures of each storage unit after recognizing that the storage controller completes the balanced access operation; A determination module is configured to determine a test result of the storage controller performing the access balancing operation according to the target type and the number of erasures of each of the storage units.
9. An electronic device, characterized in that: include: memory for storing computer programs; A processor, configured to implement the steps of the storage controller testing method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the steps of the storage controller testing method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Hard disk life analysis method and system, storage medium and equipment
CN114077523A
Automatic testing method and system for solid state disk aging test
CN118398069A