Test methods and apparatus, storage media and electronic devices for solid-state drive performance testing
By obtaining the specifications of the solid-state drive, determining the test unit, and performing read, write, and erase operations, the problems of low testing efficiency and inaccuracy in existing technologies are solved, enabling comprehensive stress testing of NAND flash memory and improving testing efficiency and accuracy.
Patent Information
- Application Number
- CN202411487583.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-23
- Publication Date
- 2026-01-30
- Estimated Expiration
- 2044-10-23
AI Technical Summary
Existing technologies for solid-state drive (SSD) performance testing are inefficient and inaccurate, failing to fully cover the storage space of SSDs, especially with insufficient stress testing of NAND flash memory.
By obtaining the specifications of the non-volatile storage modules on the solid-state drive, the number of test units and targets is determined, and read, write, and erase data operations are performed according to the status flags. This fully utilizes the concurrency characteristics of the CPU core and NAND flash memory to achieve maximum concurrency testing of the NAND flash memory.
It improves the efficiency and accuracy of aging tests, covers the entire storage space of the SSD, and ensures comprehensive stress testing of NAND flash memory.
Smart Images

Figure CN119446235B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computers, and more specifically, to a testing method and apparatus, storage medium and electronic device for testing the performance of solid-state drives. Background Technology
[0002] For SSDs, aging tests primarily focus on the stability of the NAND flash memory, including read, write, and erase operations on the NAND flash chips. Traditional aging test methods mainly involve using FIO tools to issue read, write, and erase commands over a long period to perform long-term stress tests on the SSD. This method has two main drawbacks. First, its efficiency is affected by the host's performance. For a typical storage server with 24 SSDs, it's unlikely that each drive's FIO will run at maximum performance, as the server's resources and performance cannot support simultaneous FIO testing of all drives. Second, the maximum stress exerted by the host on read, write, and erase data can only reach the maximum performance point of the SSD, making it difficult to apply greater stress to the NAND flash memory. Enterprise-grade SSDs, to ensure quality, often require tests exceeding the target stress levels to guarantee maximum stability and reliability.
[0003] Due to the characteristics of SSDs, they offer improved write performance, reduced write amplification, increased flash memory lifespan, and data protection. Not all of their internal persistent storage space is provided to the user; a portion is reserved, known as pre-allocated space. The remaining space, after deducting this pre-allocated space, is the user space. Using FIO tools for SSD aging tests only allows reading, writing, and erasing the user space, not the entire SSD's storage capacity. Therefore, this type of test suffers from incompleteness. In other words, related technologies suffer from low efficiency and inaccurate testing of hard drives.
[0004] There is currently no effective solution to the above problems. Summary of the Invention
[0005] This application provides a testing method and apparatus, storage medium and electronic device for testing the performance of solid-state drives (SSDs), in order to at least solve the technical problems of low testing efficiency and inaccurate testing of hard drives in related technologies.
[0006] According to one embodiment of this application, a method for testing the performance of a solid-state drive (SSD) is provided, comprising: acquiring a set of specification parameters matching a non-volatile storage module on the SSD, wherein the set of specification parameters includes a channel quantity parameter, a core quantity parameter, and a logic unit quantity parameter, the channel quantity parameter indicating the number of data channels on the non-volatile storage module used for data transmission, the core quantity parameter indicating the number of chips for receiving and executing commands, and the logic unit quantity parameter indicating the number of logic units used for performing logical operations; determining, based on the set of specification parameters, the test units in the non-volatile storage module to perform a target test operation and the target number of test units, wherein the target test operation includes at least one of the following: a read data operation, a write data operation, and an erase data operation; acquiring a status identifier of a test resource from a set of test resources, and determining, based on the status identifier, to perform the target test operation on the test units, wherein the number of test resources in the set of test resources is equal to the target number of test units.
[0007] According to another aspect of the embodiments of this application, a testing apparatus for testing the performance of a solid-state drive (SSD) is also provided, comprising: an acquisition unit for acquiring a set of specification parameters matching a non-volatile storage module on the SSD, wherein the set of specification parameters includes a channel quantity parameter, a core quantity parameter, and a logic unit quantity parameter, wherein the channel quantity parameter indicates the number of data channels on the non-volatile storage module used for data transmission, the core quantity parameter indicates the number of chips for receiving and executing commands, and the logic unit quantity parameter indicates the number of logic units used for performing logic operations; a determination unit for determining, based on the set of specification parameters, a test unit in the non-volatile storage module for performing a target test operation and a target number of test units, wherein the target test operation includes at least one of the following: a read data operation, a write data operation, and an erase data operation; and an execution unit for acquiring a status identifier of a test resource from a set of test resources and determining, based on the status identifier, to perform the target test operation on the test unit, wherein the number of test resources in the set of test resources is equal to the target number of test units.
[0008] Optionally, the above execution unit includes: a first execution module, configured to: obtain test resources from the task processing set when the task processing set is not empty, and obtain a status identifier matching the test resource; when the status identifier is a data wipe request identifier, perform a data wipe operation on the test unit according to the test unit address and the test resource, and modify the status identifier of the test resource to data wipe complete, wherein the test unit address is determined according to the specification parameter set; when the status identifier is a data write request identifier, perform a data write operation on the test unit according to the test unit address and the test resource, and modify the status identifier of the test resource to data write complete; when the status identifier is a data read request identifier, perform a data read operation on the test unit according to the test unit address and the test resource, and modify the status identifier of the test resource to data read complete.
[0009] Optionally, the first execution module is further configured to: modify the status identifier of the test resource to a waiting status identifier when the current number of erased blocks equals the maximum number of erased blocks and the current number of test rounds meets the target number of test rounds, wherein the current number of erased blocks is the number of blocks in the test unit that have undergone data erasure operations, the maximum number of erased blocks is determined according to the physical characteristics of the non-volatile storage module, and the waiting status identifier is used to indicate that the test resource is in a low-power waiting state; modify the status identifier of the test resource to a write data request identifier when the current number of erased blocks equals the maximum number of erased blocks and the current number of test rounds is less than the target number of test rounds; and increment the current number of erased blocks by 1 and modify the status identifier of the test resource to an erase data request identifier when the current number of erased blocks is less than the maximum number of erased blocks.
[0010] Optionally, the first execution module is further configured to: when the current number of written pages equals the maximum number of written pages and the current number of written blocks equals the maximum number of written blocks, modify the status identifier of the test resource to a read data request identifier, wherein the current number of written pages is the number of pages in the current write block that matches the current written page that have undergone write data operations, the maximum number of written pages and the maximum number of written blocks are determined according to the physical characteristics of the non-volatile storage module, and the current number of written blocks is the number of blocks in the test unit that have undergone write data operations; when the current number of written pages equals the maximum number of written pages and the current number of written blocks is less than the maximum number of written blocks, modify the status identifier of the test resource to a write data request identifier, increment the current number of written blocks by 1, and set the current number of written pages to 0; when the current number of written pages is less than the maximum number of written pages, increment the current number of written pages by 1, and modify the status identifier of the test resource to a write data request identifier.
[0011] Optionally, the first execution module is further configured to: increment the current test round number by 1 when the current number of pages read is equal to the maximum number of pages read, the current number of blocks read is equal to the maximum number of blocks read, and the current test round number is less than the target test round number; wherein the current number of pages read is the number of pages in the block matching the current page that has been read; the maximum number of pages read and the maximum number of blocks read are determined according to the physical characteristics of the non-volatile storage module; and the current number of blocks read is the number of blocks in the test unit that have been read; modify the status identifier of the test resource to a data wipe request identifier when the current number of pages read is equal to the maximum number of pages read, the current number of blocks read is equal to the maximum number of blocks read, and the current test round number has reached the target test round number; modify the status identifier of the test resource to a read data request identifier when the current number of pages read is equal to the maximum number of pages read, and the current number of blocks read is less than the maximum number of blocks read; increment the current number of blocks read by 1 and set the current number of pages to 0 when the current number of pages read is less than the maximum number of pages read; increment the current number of pages read by 1 and modify the status identifier of the test resource to a read data request identifier when the current number of pages read is less than the maximum number of pages read.
[0012] Optionally, the execution unit is further configured to: traverse the test resource set, obtain the status identifier and current test round number of each test resource; and determine that the test is completed when the status identifier of each test resource set is a waiting status identifier and the current test round number corresponding to the test resource is equal to the target test round number, wherein the waiting status identifier is used to indicate that the test resource is in a low-power waiting state.
[0013] Optionally, the execution unit is further configured to: perform initialization operations on the test resources in the test resource set, wherein the initialization operation is used to set the status identifier of the test resource to a waiting status identifier, wherein the waiting status matching the waiting status identifier is a low-power state; perform periodic detection of CPU utilization through a timer, and if the CPU utilization is less than a target threshold, request test resources from the test resource set, and create a task processing set based on the requested test resources, wherein the CPU utilization is used to determine the CPU idle state, and the test resources in the task processing set are used to execute the target test operation.
[0014] According to another aspect of the embodiments of this application, a computer-readable storage medium is also provided, wherein a computer program is stored in the computer program, and the computer program is configured to execute the above-described test method for testing the performance of a solid-state drive when it is run.
[0015] According to another aspect of the embodiments of this application, a computer program product or computer program is provided, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the test method for solid-state drive performance testing as described above.
[0016] According to another aspect of the embodiments of this application, an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the above-described test method for testing the performance of a solid-state drive through the computer program.
[0017] This application first obtains a set of specifications matching the non-volatile storage module on the solid-state drive (SSD). This set includes parameters for the number of channels, cores, and logic units. The number of channels indicates the number of data channels on the non-volatile storage module used for data transmission. The number of cores indicates the number of chips for receiving and executing commands. The number of logic units indicates the number of logic units used for performing logical operations. In this embodiment, the test units and the target number of test units for performing the target test operation in the non-volatile storage module are determined based on the set of specifications. Then, the status identifiers of the test resources are obtained from the test resource set. Based on the status identifiers, the target test operation is performed on the test units. During the test, the target test operation is performed on each test unit on the NAND flash memory, fully utilizing the idle computing power of each CPU core to achieve maximum concurrency for reading, writing, and erasing the NAND flash memory. It also fully utilizes the multi-channel concurrency characteristics of the NAND flash memory to apply maximum read, write, and erase pressure to the NAND flash memory, thus solving the technical problems of low testing efficiency and inaccurate testing in related technologies. Attached Figure Description
[0018] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0019] Figure 1 This is a hardware structure block diagram of a server device for a test method of solid-state drive performance testing according to an embodiment of this application;
[0020] Figure 2 This is a flowchart of a test method for testing the performance of a solid-state drive according to an embodiment of this application;
[0021] Figure 3This is a schematic diagram of a test method for testing the performance of a solid-state drive according to an embodiment of this application;
[0022] Figure 4 This is a flowchart of another test method for testing the performance of a solid-state drive according to an embodiment of this application;
[0023] Figure 5 This is a flowchart of another test method for testing the performance of a solid-state drive according to an embodiment of this application;
[0024] Figure 6 This is a flowchart of another test method for testing the performance of a solid-state drive according to an embodiment of this application;
[0025] Figure 7 This is a flowchart of another test method for testing the performance of a solid-state drive according to an embodiment of this application;
[0026] Figure 8 This is a flowchart of another test method for testing the performance of a solid-state drive according to an embodiment of this application;
[0027] Figure 9 This is a flowchart of another test method for testing the performance of a solid-state drive according to an embodiment of this application;
[0028] Figure 10 This is a flowchart of another test method for testing the performance of a solid-state drive according to an embodiment of this application;
[0029] Figure 11 This is a schematic diagram of a testing apparatus for testing the performance of a solid-state drive according to an embodiment of this application;
[0030] Figure 12 This is a schematic diagram of a test electronic device for testing the performance of a solid-state drive according to an embodiment of this application. Detailed Implementation
[0031] The embodiments of this application will be described in detail below with reference to the accompanying drawings and examples.
[0032] It should be noted that the terms "first," "second," etc., in the specification, claims, and drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
[0033] The methods and embodiments provided in this application can be executed on a server device or a similar computing device. Taking running on a server device as an example, Figure 1 This is a hardware structure block diagram of a server device for a test method of solid-state drive performance testing according to an embodiment of this application. For example... Figure 1 As shown, the server device may include one or more ( Figure 1 Only one is shown in the diagram. A processor 102 (which may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.) and a memory 104 for storing data are also shown. The server device may further include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that… Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the server equipment described above. For example, the server equipment may also include components that are more... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0034] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the test method for solid-state drive performance testing in this embodiment of the application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, thereby implementing the above-described method. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to server devices via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0035] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider for the server device. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module used for wireless communication with the Internet.
[0036] As an optional implementation method, such as Figure 2 As shown, the test methods for solid-state drive performance testing mentioned above include:
[0037] S202, Obtain a set of specification parameters that match the non-volatile storage module on the solid-state drive. The set of specification parameters includes a channel number parameter, a core number parameter, and a logic unit number parameter. The channel number parameter indicates the number of data channels on the non-volatile storage module used for data transmission. The core number parameter indicates the number of chips used to receive and execute commands. The logic unit number parameter indicates the number of logic units used to perform logical operations.
[0038] S204, determine the test units and the target number of test units in the non-volatile memory module that will perform the target test operation according to the specification parameter set, wherein the target test operation includes at least one of the following: read data operation, write data operation, and erase data operation;
[0039] S206, Obtain the status identifier of the test resource from the test resource set, and determine the target test operation to be performed on the test unit based on the status identifier, wherein the number of test resources in the test resource set is equal to the target number of test units.
[0040] In an optional implementation, it should be noted that in step S202 above, a set of specification parameters matching the non-volatile storage module on the solid-state drive is obtained. The set of specification parameters includes a channel number parameter, a core number parameter, and a logic unit number parameter. The channel number parameter is used to indicate the number of data channels on the non-volatile storage module used for data transmission. The core number parameter is used to indicate the number of chips for receiving and executing commands. The logic unit number parameter is used to indicate the number of logic units used for performing logic operations.
[0041] As an optional implementation, this solution uses a 4-core CPU and an 8-channel-2-target-21un NAND flash memory as an example. Each core of the 4-core CPU is defined as {core0, core1, core2, core3}, and the total number of cores is 4. The NAND flash memory is operated in units of LUNs, with each LUN representing one resource unit for task allocation.
[0042] Specifically, in this embodiment, the above-mentioned channel quantity parameter corresponds to 8 channels in the NAND chip specification, the above-mentioned core quantity parameter corresponds to 2 targets in the NAND chip specification, and the above-mentioned logic unit quantity parameter corresponds to 21 units in the NAND chip specification.
[0043] In step S204 above, the test units that perform the target test operation in the non-volatile memory module and the target number of test units are determined according to the specification parameter set. The target test operation includes at least one of the following: read data operation, write data operation, and erase data operation.
[0044] It should be noted that NAND operations are performed on a LUN basis, so the total number of LUNs needs to be calculated first to create the test task pool. In the example specification of this scheme, the total number of LUNs is lun_all_num.
[0045] The formula for calculating lun_all_num is: lun_all_num = channel × target × lun = 8 × 2 × 2 = 32;
[0046] Targeted testing operations need to be performed on 32 resources. Specifically, each test unit performs targeted testing operations on one context, with one context allocated per LUN. This context-based approach maximizes the utilization of each core's computational power. Based on the calculated lun_all_num, a total of 32 context resources are required. Each context is a block of memory, which can be allocated from the heap space using malloc and released after testing is complete.
[0047] Understandably, a unique identifier, i.e. a context key, needs to be defined for each test resource. The context states include: idle, erase request, write request, read request, erase return, write return, and read return.
[0048] The context is stored in global variables. The test unit performing NAND aging tests, based on the resource of the task it's handling and the context state, can determine the corresponding NAND address to be operated on and whether the operation is a read, erase, or write operation. It's important to note that the NAND address, called flashAddr, is composed of channel, target, LUN, block, and page information. Address initialization for NAND operations needs to be arranged in the order of channel-target-LUN. Block and page are set to 0 by default. For example, see [reference needed]. Figure 3 The layout is as shown.
[0049] Next, step S206 is executed, whereby the status identifier of the test resource is obtained from the test resource set, and the target test operation is performed on the test unit based on the status identifier, wherein the number of test resources in the test resource set is equal to the target number of test units.
[0050] In some alternative implementations, a global linked list pointer g_test_poll_list is first created. Through the listAddTail operation, a linked list operation, each context resource is linked together with the list and added to the list from the tail. All requested context resources are managed. After initialization, it contains resources of all LUN contexts by default, and the context state is set to idle by default, thus obtaining the above resource test set.
[0051] Based on the status identifier, the target test operation is determined to be performed on the test unit. For example, if the status identifier of the resource to be tested obtained from the test resource set is erase_req (write data request identifier), then the write data operation is performed, and the status identifier is updated to erase_cpl (write data completion identifier).
[0052] This application first obtains a set of specifications matching the non-volatile storage module on the solid-state drive (SSD). This set includes parameters for the number of channels, cores, and logic units. The number of channels indicates the number of data channels on the non-volatile storage module used for data transmission. The number of cores indicates the number of chips for receiving and executing commands. The number of logic units indicates the number of logic units used for performing logical operations. In this embodiment, the test units and the target number of test units for performing the target test operation in the non-volatile storage module are determined based on the set of specifications. Then, the status identifiers of the test resources are obtained from the test resource set. Based on the status identifiers, the target test operation is performed on the test units. During the test, the target test operation is performed on each test unit on the NAND flash memory, fully utilizing the idle computing power of each CPU core to achieve maximum concurrency for reading, writing, and erasing the NAND flash memory. It also fully utilizes the multi-channel concurrency characteristics of the NAND flash memory, applying maximum read, write, and erase pressure to the NAND flash memory, thus solving the technical problems of low testing efficiency and inaccurate testing in related technologies.
[0053] In one optional implementation, determining the target test operation to be performed on the test unit based on the status identifier includes:
[0054] S1, if the task processing set is not empty, obtain the test resource from the task processing set and obtain the status identifier that matches the test resource;
[0055] S2, when the status identifier is data wipe request identifier, perform data wipe operation on the test unit according to the test unit address and test resource, and change the status identifier of the test resource to data wipe complete. The test unit address is determined according to the specification parameter set.
[0056] S3, when the status flag is write data request flag, perform write data operation on the test unit according to the test unit address and test resource, and change the status flag of the test resource to write data complete;
[0057] S4. If the status identifier is read data request identifier, perform read data operation on the test unit according to the test unit address and test resource, and change the status identifier of the test resource to read data completed.
[0058] Optionally, in this embodiment, S1 is executed first. If the task processing set is not empty, test resources are obtained from the task processing set, and a status identifier matching the test resources is obtained.
[0059] It should be noted that an empty linked list head can be created in this core, `core_test_process_list`, and the context can be added to the `g_test_poll_list` linked list for management. Specifically, a context resource is taken from the head of the `g_test_poll_list` linked list and added to the tail of the test linked list `core_test_process_list` of this core. Resource requests are made to obtain a non-empty task processing set, and then the target test operation is executed according to the status identifier of the test resource in the above task processing set.
[0060] Then, steps S2-S4 are executed. In step S2, if the status flag is "erase data request flag," an erase data operation is performed on the test unit according to the test unit address and test resource, and the status flag of the test resource is changed to "erase data complete." The test unit address is determined according to the specification parameter set; that is, if the context state is "erase_req," the state is changed to "erase_cpl," and the NAND addr information is used. The aforementioned NAND addr information is as follows: Figure 3 As shown, a NAND erase operation is sent to the FCC controller, which stands for Flash Channel Control, or NAND flash control module.
[0061] Step S3: When the status identifier is write data request identifier, perform write data operation on the test unit according to the test unit address and test resource, and change the status identifier of the test resource to write data complete; that is, if the context status is write_req, change the status to write_cpl, and send a nand write page operation to the FCC controller according to the nand addr information.
[0062] Step S4: If the status identifier is "Read Data Request," perform a read data operation on the test unit based on the test unit address and test resource, and modify the status identifier of the test resource to "Read Data Complete." That is, if the context state is "read_req," change the state to "read_cpl," and send a NAND read page operation to the FCC controller based on the NAND addr information. It should also be noted that if the initial default state is "idle," change the state to "erase_cpl," and send a NAND erase operation to the FCC controller based on the NAND addr information.
[0063] Through the above-described embodiments of this application, the corresponding target test operation is executed according to the status identifier of the obtained test resource. Without relying on host FIO tools and resources, target testing of each test unit inside the SSD is realized, and all space of all NAND flash chips is covered. The aging test is more comprehensive and the efficiency of the aging test is improved.
[0064] In one alternative implementation, modifying the status flag of the test resource to indicate that data erasure is complete includes:
[0065] S1, when the current number of erased blocks is equal to the maximum number of erased blocks, and the current number of test rounds meets the target number of test rounds, the status flag of the test resource is changed to the waiting status flag. Here, the current number of erased blocks is the number of blocks in the test unit that have been erased, the maximum number of erased blocks is determined according to the physical characteristics of the non-volatile memory module, and the waiting status flag is used to indicate that the test resource is in a low-power waiting state.
[0066] S2, if the current number of erased blocks is equal to the maximum number of erased blocks and the current test round number is less than the target test round number, change the status flag of the test resource to the write data request flag;
[0067] S3, if the current number of erased blocks is less than the maximum number of erased blocks, increment the current number of erased blocks by 1 and change the status flag of the test resource to the erase data request flag.
[0068] As an optional implementation, the current test round number mentioned above refers to the number of rounds corresponding to the completion of the target test operation for the current test resource. The target test round number is the preset number of rounds required to test the test resource. It should be noted that in solid-state drives (SSDs) and flash memory storage devices, the number of blocks and pages is usually fixed and determined by the manufacturer based on the capacity and performance requirements of the device. In traditional disk drives (HDDs), the number of blocks and pages is usually determined by the number of tracks and sectors. For example, the maximum number of erase blocks mentioned above can be determined by querying the device's management software or operating system.
[0069] In this application, the FCC returns a NAND operation completion message. Based on the key value in the FCC's returned message, the corresponding context is found by traversing the core_test_process_list of the current core. If the context state is erase_cp1, it is further determined that if the number of blocks in the current erase is equal to the maximum number of blocks in the LUN, and the number of test rounds recorded in the context is equal to the user's preset round, the state is changed to idle, and the resource release method, i.e., test_free, is called.
[0070] If the number of blocks in the current erase is equal to the maximum number of blocks in the LUN, and the number of test rounds recorded in the context is less than the user-preset round, then change the state to write_req and call the resource release method, i.e., test_free.
[0071] If the number of blocks in the current erase is less than the maximum number of blocks in the LUN, the number of blocks in the NAND addr in the context is incremented by 1, the state is changed to erase_req, and the resource release method, test_free, is called.
[0072] Through the above-described embodiments of this application, after data erasure is completed, if the current number of erased blocks equals the maximum number of erased blocks and the current test rounds meet the target test rounds, the status flag of the test resource is modified to a waiting status flag; if the current number of erased blocks equals the maximum number of erased blocks and the current test rounds are less than the target test rounds, the status flag of the test resource is modified to a write data request flag; if the current number of erased blocks is less than the maximum number of erased blocks, the current number of erased blocks is incremented by 1, and the status flag of the test resource is modified to an erase data request flag. This achieves complete read, write, and erase operation testing for each test resource, improves the accuracy of aging tests, and automatically modifies the status flags according to the corresponding status, thereby improving the efficiency of aging tests.
[0073] In one alternative implementation, modifying the status flag of the test resource to indicate that writing data is complete includes:
[0074] S1, when the current number of pages written is equal to the maximum number of pages written, and the current number of blocks written is equal to the maximum number of blocks written, the status identifier of the test resource is modified to the read data request identifier. Here, the current number of pages written is the number of pages in the current write block that matches the current page written, the maximum number of pages written and the maximum number of blocks written are determined according to the physical characteristics of the non-volatile storage module, and the current number of blocks written is the number of blocks in the test unit that have been written.
[0075] S2, when the current number of pages written is equal to the maximum number of pages written and the current number of blocks written is less than the maximum number of blocks written, change the status flag of the test resource to the write data request flag, increment the current number of blocks written by 1, and set the current number of pages written to 0;
[0076] S3: If the current number of pages to be written is less than the maximum number of pages to be written, increment the current number of pages to be written by 1 and change the status flag of the test resource to the write data request flag.
[0077] In this application, the FCC returns a NAND operation completion message. Based on the key value in the FCC's returned message, the corresponding context is found by traversing the core_test_process_list of the current core. If the context state is write_cp1, it is further determined that if the number of pages currently written is equal to the maximum number of pages in a block, and the number of blocks is equal to the maximum number of blocks in the IUN, the state is changed to read_req, and test_free is called.
[0078] If the current number of pages written is equal to the maximum number of pages in a block, and the number of blocks is less than the maximum number of blocks in a 1UN, then change the state to write_req, increment the number of blocks in the NAND addr, configure the number of pages to 0, and call test_free;
[0079] If the current number of pages written is less than the maximum number of pages in a block, increment the number of pages in the nand addr, change the status to write_req, and call test_free.
[0080] Through the above-described embodiments of this application, when the current number of written pages equals the maximum number of written pages and the current number of written blocks equals the maximum number of written blocks, the status identifier of the test resource is modified to a read data request identifier; when the current number of written pages equals the maximum number of written pages and the current number of written blocks is less than the maximum number of written blocks, the status identifier of the test resource is modified to a write data request identifier, the current number of written blocks is incremented by 1, and the current number of written pages is set to 0; when the current number of written pages is less than the maximum number of written pages, the current number of written pages is incremented by 1, and the status identifier of the test resource is modified to a write data request identifier. This achieves complete read, write, and erase operation testing for each test resource, improves the accuracy of aging tests, and automatically modifies the status identifier according to the corresponding status, thereby improving the efficiency of aging tests.
[0081] In one optional implementation, modifying the status flag of the test resource to indicate that data reading is complete includes:
[0082] S1, if the current number of pages read is equal to the maximum number of pages read, the current number of blocks read is equal to the maximum number of blocks read, and the current number of test rounds is less than the target number of test rounds, increment the current number of test rounds by 1. Here, the current number of pages read is the number of pages in the block that matches the current page read that has been read. The maximum number of pages read and the maximum number of blocks read are determined according to the physical characteristics of the non-volatile storage module. The current number of blocks read is the number of blocks in the test unit that have been read.
[0083] S2, if the current number of pages read is equal to the maximum number of pages read, the current number of blocks read is equal to the maximum number of blocks read, and the current test round reaches the target test round, change the status flag of the test resource to the data wipe request flag;
[0084] S3, if the current number of pages read is equal to the maximum number of pages read, and the current number of blocks read is less than the maximum number of blocks read, change the status flag of the test resource to the read data request flag, increment the current number of blocks read by 1, and set the current number of pages to 0;
[0085] S4. If the current number of pages read is less than the maximum number of pages read, increment the current number of pages read by 1 and modify the status flag of the test resource to the read data request flag.
[0086] In this application, the FCC returns a NAND operation completion message. Based on the key value in the FCC's returned message, the corresponding context is found by traversing the core_test_process_list of the current core. If the context state is read_cp1, it is further determined that if the number of pages read is equal to the maximum number of pages in a block, and the number of blocks is equal to the maximum number of blocks in the LUN, the test round number in the context needs to be incremented by one to indicate that a test round is completed.
[0087] If the current number of pages read is equal to the maximum number of pages in a block, and the number of blocks is less than the maximum number of blocks in a LUN, then change the status to read_req, increment the number of blocks in the NAND addr, configure the number of pages to 0, and call test_free;
[0088] If the current number of pages read is less than the maximum number of pages in a block, increment the page count in the NAND addr, change the status to read_req, and call test_free;
[0089] If the test round number is equal to the user-preset round, the status is changed to erase_req, and test_free is called.
[0090] This application's implementation achieves complete read, write, and erase operations for each test resource by incrementing the current test round number by 1 when the current number of read pages equals the maximum number of read pages, the current number of read blocks equals the maximum number of read blocks, and the current test round number is less than the target test round number; modifying the test resource's status identifier to an erase data request identifier when the current number of read pages equals the maximum number of read pages, the current number of read blocks equals the maximum number of read blocks, and the current test round number reaches the target test round number; modifying the test resource's status identifier to a read data request identifier, incrementing the current number of read blocks by 1, and setting the current number of pages to 0 when the current number of read pages is less than the maximum number of read pages; and incrementing the current number of read pages by 1 and modifying the test resource's status identifier to a read data request identifier when the current number of read pages equals the maximum number of read pages, and the current number of read blocks is less than the maximum number of read blocks. This improves the accuracy of aging tests and automatically modifies the status identifier according to the corresponding status, thus improving the efficiency of aging tests.
[0091] In one optional implementation, after obtaining the status identifier of the test resource from the test resource set and determining the target test operation to be performed on the test unit based on the status identifier, the process includes:
[0092] S1, Traverse the test resource set and obtain the status identifier and current test round number of each test resource;
[0093] S2, when the status identifier of each test resource set is a waiting status identifier, and the current test round number corresponding to the test resource is equal to the target test round number, the test is determined to be completed. The waiting status identifier is used to indicate that the test resource is in a low-power waiting state.
[0094] In steps S1-S2 above, the test resource set is traversed to obtain the status identifier and current test round number of each test resource. If the status identifier of each test resource set is a waiting status identifier, and the current test round number corresponding to the test resource is equal to the target test round number, the test is considered complete. The waiting status identifier indicates that the test resource is in a low-power waiting state. Specifically, `g_test_poll_list` is traversed to count the status of each context in the resource pool. If the status is idle and the test round number is equal to the user-preset value `round`, then `complete_count` is incremented. If `complete_count` equals `lun_all_num`, meaning that each test resource has executed the target test operation for the target test round, then all tests are complete, and the main core needs to shut down its timer and notify other cores to shut down their timers.
[0095] By traversing the test resource set as described above, the status identifier and current test round number of each test resource are obtained. When the status identifier of each test resource set is a waiting status identifier and the current test round number corresponding to the test resource is equal to the target test round number, the test is determined to be completed, thereby realizing the testing of all spaces of the NAND particle and improving the testing efficiency.
[0096] In one optional implementation, obtaining the status identifier of a test resource from the test resource set, and determining the steps before performing the target test operation on the test unit based on the status identifier, includes:
[0097] S1, Initialize the test resources in the test resource set, wherein the initialization operation is used to set the status flag of the test resource to a waiting status flag, wherein the waiting status matching the waiting status flag is a low power state; S2, perform periodic detection of CPU utilization through a timer, and if the CPU utilization is less than the target threshold, request test resources from the test resource set, and create a task processing set based on the requested test resources, wherein the CPU utilization is used to determine the CPU idle state, and the test resources in the task processing set are used to execute the target test operation.
[0098] Optionally, in step S1 above, an initialization operation is performed on the test resources in the test resource set. The initialization operation is used to set the status flag of the test resource to a waiting status flag, that is, to set the context state to idle, i.e., a low-power waiting state.
[0099] Further in step S2, after initializing the test resources, a timer is started to detect the CPU utilization in the first second. It should be noted that the timer is not enabled by default during initialization. When the CPU utilization is greater than or equal to the target threshold, that is, when the CPU is in an idle state, for example, when the CPU utilization is less than 80%, it is determined that the CPU is in an idle state. Then, the test resource request operation can be performed, that is, a context resource is taken from the head of the global linked list pointer g_test_pol1_list and added to the tail of the test linked list core_test_process_list of this core, thus creating the above task processing set.
[0100] It should be noted that when the timer accumulates 1 minute, the test progress needs to be updated. That is, this action is triggered once every minute to traverse the g_test_poll_list linked list and the core_test_process_list linked list of each core, and count the test round value of each context, denoted as ctx_round_count.
[0101] Specifically, the test progress = ctx_round_count / (lun_all_num × round);
[0102] In the above embodiments of this application, the test resources in the test resource set are initialized. The initialization operation is used to set the status flag of the test resources to a waiting status flag, wherein the waiting status matching the waiting status flag is a low power state. A timer is started to detect the CPU utilization. If the CPU utilization is not less than the target threshold, test resources are requested from the test resource set. A task processing set is created according to the requested test resources. By determining the idle state of the multi-core processor CPU, the idle computing power of each CPU is fully utilized for aging tests, thereby achieving maximum pressure for reading, writing and erasing operations on NAND chips.
[0103] The following describes a complete test method for solid-state drive performance testing.
[0104] Before the testing phase, the number of rounds for the aging test is set using the NVMe CLI tool, and the SSD stores this round setting internally.
[0105] The SSD enters aging mode and initializes its internal resources in preparation for aging tests by issuing the BIST aging mode initialization command through the NVMe CLI tool.
[0106] It should be noted that NAND operations are performed on a LUN basis, so the total number of LUNs needs to be calculated first to create the test task pool. In the example specification of this scheme, the total number of LUNs is lun_all_num;
[0107] For example, let's illustrate the solution using a 4-core CPU and an 8-channel-2-target-2-lunn NAND flash memory configuration. The 4-core CPU is defined as {core0, core1, core2, core3}, and the total number of cores is defined as core_num. The NAND flash memory is operated on a LUN (Land Unit) basis, with each LUN representing one resource unit for task allocation. lun_all_num = channel × target × 1un = 8 × 2 × 2 = 32.
[0108] One context is allocated per LUN to maximize the computing power of each core. Based on the calculated `lun_all_num`, a total of 32 context resources are required. A context is essentially a block of memory, which can be allocated from the heap space using `malloc` and released after testing.
[0109] Specifically, the context content definition includes: a context key value, which is a unique identifier for the context resource; and the address for the Nand operation, called flashAddr, which consists of channel, target, LUN, block, and page information. The address initialization for the Nand operation needs to be arranged according to ch-target-LUN. The block and page values are both set to 0 by default. See [reference needed] for details. Figure 9 The layout shown in the diagram only illustrates the corresponding arrangement of the 4-channel NAND addr and key-value pairs; Context states: idle, erase request, write request, read request, erase return (erase_cp1), write return (read_cpl), read return (read_cpl); Test round number record (initialized default value is 0), used to record and calculate test progress; Linked list head, used for context resource management.
[0110] The context is stored in global variables. When the NAND aging test starts, based on the task object resources being processed and the context state, it is possible to determine the NAND address to be operated on and whether the operation to be performed is a read operation, an erase operation, or a write operation. The context content initialization requires setting the context state to idle by default.
[0111] Then, the test task pool is initialized;
[0112] S1. Create a global linked list pointer g_test_po1l_1ist. Use the listAddTail operation (a linked list operation that links each context resource together with a linked list and adds it to the list from the tail) to manage all the requested context resources. After initialization, it will contain the resources of all LUN contexts by default.
[0113] S2, each CPU core then creates its own test processing linked list pointer core_test_process_list, which is used as the linked list of test tasks being processed by this core. After initialization, it is an empty linked list by default.
[0114] Further initialization of the CPU core utilization interface is required. This variable, one for each CPU core, identifies the current core's computing power utilization and is denoted as CPUUsage. It's important to note that for RTOS systems, the core utilization can be directly obtained using the built-in CPU core utilization interface functions. However, for bare-metal systems, other methods or calculations are needed to obtain the CPU core utilization. For example, obtaining the total number of executions for a core's phase (CPU_core_all_count) and then counting the number of executions for the idle branch (idle_count) will yield a rough estimate of the CPU core utilization. The calculation formula is as follows:
[0115] CPUUsage=(CPU_core_all_count-idle_count) / CPU_core_all_count;
[0116] In addition, each core enables a 1-second timer to periodically detect CPU utilization in the previous second. By default, the timer is not enabled during initialization.
[0117] During the testing phase, core_0 is the primary core. In addition to being responsible for NAND flash memory aging tests, core_0 also handles aging test control commands from the host, controlling the start of the test, progress updates, and progress query functions.
[0118] The following is a complete initialization process:
[0119] S1: The main core first initializes its CPU core utilization interface, creates timers, initializes contexts, creates an empty linked list head for its core_test_process_list, and adds all contexts to the g_test_poll_list linked list for management. It then notifies other cores to begin initializing their respective CPU utilization interfaces, creating timers, and creating empty linked list heads for their respective core_test_process_lists.
[0120] S2, after the main core detects that all cores have completed initialization, it starts the timer of its own core and notifies other cores to start their timers;
[0121] The following is Figure 4 A complete explanation of the main core initialization process:
[0122] S402, Request context resources based on the total number of NAND LUNs;
[0123] S404, Initialize the context structure;
[0124] 406, context added to linked list g_test_poll_list;
[0125] S408 notifies other cores to begin initialization;
[0126] S41 0, Create a timer;
[0127] S4 1 2, Create the current core linked list core_test_process_list;
[0128] Determine if S414 and other cores have completed initialization.
[0129] If other cores have not completed initialization, execute S4 1 6 to notify other cores to start timers, and then execute S4 1 8 to start the timer for this core.
[0130] If other cores have not been initialized, the loop continues to wait and check until other cores have been initialized.
[0131] The following is Figure 5 A complete explanation of the initialization process for other cores:
[0132] S502, Create the core test list core_test_process_list;
[0133] S504, waiting for notification to start the timer;
[0134] 506, Start the timer.
[0135] The following is Figure 6 A complete explanation of the timer processing flow:
[0136] S602, check if the CPU utilization of this core is less than 50%?
[0137] If CPU utilization is less than 50%, execute S604, `test_alloc`; that is, request a context for the CPU core in idle state to perform aging tests. It should be noted that retrieving a context resource from the head of the `g_test_poll_list` linked list and adding it to the tail of the core's test linked list `core_test_process_1ist` is called test resource allocation. Requesting test resources requires checking that the number of test rounds in the context is less than the user-preset round value. This action is encapsulated in the `test_alloc` interface. This interface encapsulation needs to ensure atomicity and data safety.
[0138] For the corresponding test resource request and release process, the context is retrieved from the corresponding core's `core_test_process_list` and added to the end of the `g_test_poll_list` linked list. This action is encapsulated in the `test_free` interface. This interface encapsulation requires careful attention to atomicity and data safety.
[0139] S606, exit timer processing, no test performed.
[0140] The following is Figure 7 A complete testing process is described below:
[0141] Determine if S702 and core_test_process_list are empty linked lists. If not, continue to check the context state for further processing.
[0142] S704, the context state is idle; S704-1, based on the context information, send the corresponding operation instruction to the FCC, that is, if the context state is idle, change the state to erase_cp1, and send a nanderase operation to the FCC controller based on the nand addr information.
[0143] S706, the context has a state of type req; S706-1, based on the context information, send the corresponding operation instruction to the FCC.
[0144] Specifically, if the context state is erase_req, the state is changed to erase_cpl, and a NAND erase operation is sent to the FCC controller based on the NAND addr information; if the context state is write_req, the state is changed to write_cp1, and a NAND write page operation is sent to the FCC controller based on the NAND addr information; if the context state is read_req, the state is changed to read_cpl, and a NAND read page operation is sent to the FCC controller based on the NAND addr information.
[0145] S708, FCC returned a message; S710, enter cp1 processing flow.
[0146] Specifically, if the FCC returns a NAND operation completion message, the system matches the key value in the FCC's returned message, iterates through the core_test_process_list of the current core to find the corresponding context, and processes it according to the corresponding rules.
[0147] The following is Figures 8 to 10 The above rules are explained as follows:
[0148] like Figure 8 The following is the processing flow when the context state is erase_cpl:
[0149] S802, block++, increments the block in the current NAND addr by 1, then checks S804, block > max_block? If block is not greater than max_block, it means there are still blocks that need to be erased, so S804-1 is executed, and the context is set to erase_req.
[0150] If block is greater than max_block, execute S806 to determine if the number of test rounds equals round. If the number of test rounds equals round, execute S808 and set the context to idle; S812, test_free.
[0151] If the number of test rounds is not equal to round (i.e., the number of test rounds does not meet the preset number of rounds), execute S8 1 0, setting the context to write_req; S8 12, test_free.
[0152] like Figure 9 The following is the processing flow when the context state is write_cpl:
[0153] In step S902, if page == max_page, and page is not equal to max_page, it means there are still pages that have not been written, and a write operation needs to be performed on the next page. Then execute S902-1, page++; S910, set the context to write_req; S912, test_free.
[0154] If page equals max_page, then execute S902-2, block++, incrementing the block in the current NAND addr by 1, and then check S904, block > max_block? If block is not greater than max_block, it means that a write operation is still needed on the page in the block after incrementing by 1, i.e., execute S908, page = 0; S910, set the context to write_req; S912, test_free.
[0155] If block is greater than max_block, it means that all blocks have been written. Further execution is performed in S906, setting the context to read_req; S912, test_free.
[0156] like Figure 10 The following is the processing flow when the context state is Tead_cpl:
[0157] In S1002, is page equal to max_page? If page is not equal to max_page, it means there are still pages that have not been read, and a read operation needs to be performed on the next page, i.e., execute S1004-2, page++; S1010, set the context to read_req; S1012, test_free.
[0158] If page equals max_page, execute S1004-1, block++, increment the block in the current NAND addr by 1, and check S1006: block > max_block? If block is not greater than max_block, it means that a write operation is still needed on the page in the block after incrementing by 1, that is, execute S1008, page = 0; S1010, set the context to read_req; S1012, test_free.
[0159] If block is greater than max_block, it means that all blocks have been read. Execute S1006-1, increment the context test round number by 1, and in S1006-2, set the context to erease_req, which means entering a new round of test operations.
[0160] It should also be noted that, in addition to the basic process of retrieving context from the task pool g_test_poll_list and adding it to the main core's pending list core_test_process_1ist, the main core timer also needs to additionally check whether the test is complete. When the timer accumulates one minute, it also needs to update the test progress.
[0161] The method to determine whether a test is complete is to iterate through `g_test_poll_list`, count the status of each context in the resource pool, and increment `complete_count` if the status is `idle` and the test round number equals the user-preset value `round`. If `complete_count` equals `lun_all_num`, it means all tests are complete, and the main core needs to shut down its timer and notify other cores to shut down their timers.
[0162] This action is triggered periodically every minute, traversing the g_test_poll_list linked list and the core_test_process_list linked list for each core, counting the test rounds for each context, denoted as ctx_round_count, and thus calculating the test progress. For example, the test progress is calculated as follows:
[0163] Test progress = ctx_round_count / (lun_all_num × round);
[0164] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0165] According to another aspect of the embodiments of this application, a testing apparatus for testing the performance of a solid-state drive (SSD) is also provided for implementing the above-described testing method for SSD performance testing. For example... Figure 11 As shown, the device includes:
[0166] The acquisition unit 1102 acquires a set of specification parameters that match the non-volatile storage module on the solid-state drive. The set of specification parameters includes a channel number parameter, a core number parameter, and a logic unit number parameter. The channel number parameter indicates the number of data channels on the non-volatile storage module used for data transmission. The core number parameter indicates the number of chips used to receive and execute commands. The logic unit number parameter indicates the number of logic units used to perform logical operations.
[0167] Unit 1104 determines the test unit and the target number of test units in the non-volatile memory module that will perform the target test operation based on the specification parameter set. The target test operation includes at least one of the following: read data operation, write data operation, and erase data operation.
[0168] Execution unit 1106 obtains the status identifier of the test resource from the test resource set, and determines the target test operation to be performed on the test unit based on the status identifier, wherein the number of test resources in the test resource set is equal to the target number of test units.
[0169] Optionally, the above execution unit includes: a first execution module, configured to: obtain test resources from the task processing set when the task processing set is not empty, and obtain a status identifier matching the test resource; when the status identifier is a data wipe request identifier, perform a data wipe operation on the test unit according to the test unit address and the test resource, and modify the status identifier of the test resource to data wipe complete, wherein the test unit address is determined according to the specification parameter set; when the status identifier is a data write request identifier, perform a data write operation on the test unit according to the test unit address and the test resource, and modify the status identifier of the test resource to data write complete; when the status identifier is a data read request identifier, perform a data read operation on the test unit according to the test unit address and the test resource, and modify the status identifier of the test resource to data read complete.
[0170] Optionally, the first execution module is further configured to: modify the status identifier of the test resource to a waiting status identifier when the current number of erased blocks equals the maximum number of erased blocks and the current number of test rounds meets the target number of test rounds, wherein the current number of erased blocks is the number of blocks in the test unit that have undergone data erasure operations, the maximum number of erased blocks is determined according to the physical characteristics of the non-volatile storage module, and the waiting status identifier is used to indicate that the test resource is in a low-power waiting state; modify the status identifier of the test resource to a write data request identifier when the current number of erased blocks equals the maximum number of erased blocks and the current number of test rounds is less than the target number of test rounds; and increment the current number of erased blocks by 1 and modify the status identifier of the test resource to an erase data request identifier when the current number of erased blocks is less than the maximum number of erased blocks.
[0171] Optionally, the first execution module is further configured to: when the current number of written pages equals the maximum number of written pages and the current number of written blocks equals the maximum number of written blocks, modify the status identifier of the test resource to a read data request identifier, wherein the current number of written pages is the number of pages in the current write block that matches the current written page that have undergone write data operations, the maximum number of written pages and the maximum number of written blocks are determined according to the physical characteristics of the non-volatile storage module, and the current number of written blocks is the number of blocks in the test unit that have undergone write data operations; when the current number of written pages equals the maximum number of written pages and the current number of written blocks is less than the maximum number of written blocks, modify the status identifier of the test resource to a write data request identifier, increment the current number of written blocks by 1, and set the current number of written pages to 0; when the current number of written pages is less than the maximum number of written pages, increment the current number of written pages by 1, and modify the status identifier of the test resource to a write data request identifier.
[0172] Optionally, the first execution module is further configured to: increment the current test round number by 1 when the current number of pages read is equal to the maximum number of pages read, the current number of blocks read is equal to the maximum number of blocks read, and the current test round number is less than the target test round number; wherein the current number of pages read is the number of pages in the block matching the current page that has been read; the maximum number of pages read and the maximum number of blocks read are determined according to the physical characteristics of the non-volatile storage module; and the current number of blocks read is the number of blocks in the test unit that have been read; modify the status identifier of the test resource to a data wipe request identifier when the current number of pages read is equal to the maximum number of pages read, the current number of blocks read is equal to the maximum number of blocks read, and the current test round number has reached the target test round number; modify the status identifier of the test resource to a read data request identifier when the current number of pages read is equal to the maximum number of pages read, and the current number of blocks read is less than the maximum number of blocks read; increment the current number of blocks read by 1 and set the current number of pages to 0 when the current number of pages read is less than the maximum number of pages read; increment the current number of pages read by 1 and modify the status identifier of the test resource to a read data request identifier when the current number of pages read is less than the maximum number of pages read.
[0173] Optionally, the execution unit is further configured to: traverse the test resource set, obtain the status identifier and current test round number of each test resource; and determine that the test is completed when the status identifier of each test resource set is a waiting status identifier and the current test round number corresponding to the test resource is equal to the target test round number, wherein the waiting status identifier is used to indicate that the test resource is in a low-power waiting state.
[0174] Optionally, the execution unit is further configured to: perform an initialization operation on the test resources in the test resource set, wherein the initialization operation is used to set the status identifier of the test resources to a waiting status identifier, wherein the waiting status matching the waiting status identifier is a low-power state; perform periodic detection of CPU utilization using a timer, and when the CPU utilization is less than a target threshold, request test resources from the test resource set, and create a task processing set based on the requested test resources, wherein the CPU utilization is used to determine the CPU idle state, and the test resources in the task processing set are used to execute the target test operation. According to another aspect of the embodiments of this application, an electronic device is also provided for implementing the above-described test method for testing the performance of a solid-state drive in a memory, the electronic device being... Figure 1 The terminal device or server shown. This embodiment uses a mobile phone or computer as an example for illustration. Figure 12 As shown, the electronic device includes a memory 1202 and a processor 1204. The memory 1202 stores a computer program, and the processor 1204 is configured to execute the steps of any of the above method embodiments through the computer program.
[0175] Optionally, in this embodiment, the aforementioned electronic device may be located in at least one of a plurality of network devices in a computer network.
[0176] Optionally, in this embodiment, the processor can be configured to perform the following steps via a computer program:
[0177] S 1, Obtain a set of specifications that match the non-volatile storage module on the solid-state drive. The set of specifications includes a channel number parameter, a core number parameter, and a logic unit number parameter. The channel number parameter indicates the number of data channels on the non-volatile storage module used for data transmission. The core number parameter indicates the number of chips used to receive and execute commands. The logic unit number parameter indicates the number of logic units used to perform logical operations.
[0178] S2, determine the test units and the target number of test units that will perform the target test operation in the non-volatile memory module according to the specification parameter set, wherein the target test operation includes at least one of the following: read data operation, write data operation, and erase data operation;
[0179] S3, obtain the status identifier of the test resource from the test resource set, and determine the target test operation to be performed on the test unit based on the status identifier, wherein the number of test resources in the test resource set is equal to the target number of test units.
[0180] Alternatively, as those skilled in the art will understand, Figure 1The structure shown in Figure 2 is for illustrative purposes only. Electronic devices can also be smartphones (such as Android phones, iOS phones, etc.), tablets, handheld computers, mobile internet devices (MIDs), PADs, and other terminal devices. Figure 1 2. This does not limit the structure of the aforementioned electronic device. For example, the electronic device may also include components that are more... Figure 1 The components shown in Figure 2, whether more or fewer (such as network interfaces), or having the same... Figure 12 The different configurations shown.
[0181] The memory 1202 can be used to store software programs and modules, such as the program instructions / modules corresponding to the test method and apparatus for testing solid-state drive performance in this embodiment. The processor 1204 executes various functional applications and data processing by running the software programs and modules stored in the memory 1202, thereby realizing the aforementioned test method for testing solid-state drive performance. The memory 1202 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 1202 may further include memory remotely located relative to the processor 1204, and these remote memories can be connected to the terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. Specifically, the memory 1202 may be used, but is not limited to, to store information such as page elements and page styles. As an example, such as Figure 1 As shown in Figure 2, the memory 1202 described above may include, but is not limited to, the acquisition unit 1102, the determination unit 1104, and the execution unit 1108 in the testing device for testing solid-state drive performance. Furthermore, it may include, but is not limited to, other module units in the testing device for testing solid-state drive performance, which will not be elaborated upon in this example.
[0182] Optionally, the transmission device 1 206 described above is used to receive or send data via a network. Specific examples of the network described above may include wired networks and wireless networks. In one example, the transmission device 1 206 includes a Network Interface Controller (NIC), which can be connected to other network devices and routers via a network cable to communicate with the Internet or a local area network. In one example, the transmission device 1 206 is a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0183] In addition, the aforementioned electronic device also includes: a display 1208 for displaying the target page; and a connection bus 1210 for connecting the various module components in the aforementioned electronic device.
[0184] In other embodiments, the aforementioned terminal device or server can be a node in a distributed system, wherein the distributed system can be a blockchain system, which is a distributed system formed by connecting multiple nodes through network communication. The nodes can form a point-to-point network, and any form of computing device, such as a server, terminal, or other electronic device, can become a node in the blockchain system by joining this point-to-point network.
[0185] According to one aspect of this application, a computer-readable storage medium is provided, wherein a processor of a computer device reads computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, causing the computer device to perform the methods provided in the various optional implementations described above;
[0186] Optionally, in this embodiment, the computer-readable storage medium may be configured to store a computer program for performing the following steps:
[0187] S 1, Obtain a set of specifications that match the non-volatile storage module on the solid-state drive. The set of specifications includes a channel number parameter, a core number parameter, and a logic unit number parameter. The channel number parameter indicates the number of data channels on the non-volatile storage module used for data transmission. The core number parameter indicates the number of chips used to receive and execute commands. The logic unit number parameter indicates the number of logic units used to perform logical operations.
[0188] S2, determine the test units and the target number of test units that will perform the target test operation in the non-volatile memory module according to the specification parameter set, wherein the target test operation includes at least one of the following: read data operation, write data operation, and erase data operation;
[0189] S3, obtain the status identifier of the test resource from the test resource set, and determine the target test operation to be performed on the test unit based on the status identifier, wherein the number of test resources in the test resource set is equal to the target number of test units.
[0190] Optionally, in embodiments of this application, the terms "module" or "unit" refer to a computer program or part of a computer program with a predetermined function, which works together with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.
[0191] Optionally, in this embodiment, those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing the hardware related to the terminal device. The program can be stored in a computer-readable storage medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0192] If the integrated units in the above embodiments are implemented as software functional units and sold or used as independent products, they can be stored in the aforementioned computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause one or more computer devices (which may be personal computers, servers, or network devices, etc.) to execute all or part of the steps of the methods of the various embodiments of this application.
[0193] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0194] In the several embodiments provided in this application, it should be understood that the disclosed client can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, or the indirect coupling or communication connection of units or modules may be electrical or other forms.
[0195] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0196] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0197] The above are merely preferred embodiments of this application. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
[0198] It should be noted that the above modules can be implemented by software or hardware. For the latter, they can be implemented in the following ways, but are not limited to: all the above modules are located in the same processor; or, the above modules are located in different processors in any combination.
[0199] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above method embodiments when run.
[0200] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.
[0201] Embodiments of this application also provide an electronic device, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.
[0202] In one exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.
[0203] Embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above method embodiments.
[0204] Embodiments of this application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps in any of the above method embodiments.
[0205] The embodiments described herein also provide a computer program that includes computer instructions stored in a computer-readable storage medium; a processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the steps in any of the above method embodiments.
[0206] Specific examples in this embodiment can be found in the examples described in the above embodiments and exemplary implementations, and will not be repeated here.
[0207] Obviously, those skilled in the art should understand that the modules or steps of this application described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. They can be implemented using computer-executable program code, and thus can be stored in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those presented here, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, this application is not limited to any particular combination of hardware and software.
[0208] The above are merely preferred embodiments of this application and are not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the principles of this application should be included within the protection scope of this application.
Claims
1. A test method for solid state disk performance test, characterized in that, comprising: obtaining a specification parameter set matched with a non-volatile storage module on a solid state disk, wherein the specification parameter set comprises a channel number parameter, a core number parameter and a logical unit number parameter, the channel number parameter is used to indicate the number of data channels for data transmission on the non-volatile storage module, the core number parameter is used to indicate the number of chips for receiving and executing commands, and the logical unit number parameter is used to indicate the number of logical units for executing logical operations; determining a test unit in the non-volatile storage module for executing a target test operation and a target number of the test unit according to the specification parameter set, wherein the target test operation comprises at least one of the following: read data operation, write data operation, and erase data operation; obtaining a state identifier of a test resource from a test resource set, and determining to execute the target test operation on the test unit according to the state identifier, comprising: in the case that a task processing set is not empty, obtaining the test resource from the task processing set and obtaining the state identifier matched with the test resource; in the case that the state identifier is an erase data request identifier, executing the erase data operation on the test unit according to a test unit address and the test resource, and modifying the state identifier of the test resource to an erase data completion, wherein the test unit address is determined according to the specification parameter set; in the case that the state identifier is a write data request identifier, executing the write data operation on the test unit according to the test unit address and the test resource, and modifying the state identifier of the test resource to a write data completion; in the case that the state identifier is a read data request identifier, executing the read data operation on the test unit according to the test unit address and the test resource, and modifying the state identifier of the test resource to a read data completion, wherein the number of the test resource in the test resource set is equal to the target number of the test unit.
2. The method of claim 1, wherein, after modifying the state identifier of the test resource to the erase data completion, comprising: in the case that a current erase block number is equal to a maximum erase block number and a current test round number satisfies a target test round number, modifying the state identifier of the test resource to a waiting state identifier, wherein the current erase block number is the number of blocks in the test unit that have performed the erase data operation, the maximum erase block number is determined according to the physical characteristics of the non-volatile storage module, and the waiting state identifier is used to indicate that the test resource is in a low-power waiting state; in the case that the current erase block number is equal to the maximum erase block number and the current test round number is less than the target test round number, modifying the state identifier of the test resource to the write data request identifier. In a case that the current erase block number is less than the maximum erase block number, the current erase block number is added by 1, and the state identifier of the test resource is modified as the data erasing request identifier.
3. The method of claim 1, wherein, after the state identifier of the test resource is modified as the data writing completion, the method further comprises: In a case that the current writing page number is equal to the maximum writing page number, the current writing block number is equal to the maximum writing block number, and the current test round number is less than the target test round number, the current test round number is added by 1, wherein the current writing page number is a number of pages in the current writing block that match the current writing page and have been operated by the data writing operation, the maximum writing page number and the maximum writing block number are determined according to physical characteristics of the non-volatile storage module, and the current writing block number is a number of blocks in the test unit that have been operated by the data writing operation. In a case that the current writing page number is equal to the maximum writing page number, the current writing block number is less than the maximum writing block number, the state identifier of the test resource is modified as the data writing request identifier, and the current writing block number is added by 1, the current writing page number is set as 0. In a case that the current writing page number is less than the maximum writing page number, the current writing page number is added by 1, and the state identifier of the test resource is modified as the data writing request identifier.
4. The method of claim 1, wherein, after the state identifier of the test resource is modified as the data reading completion, the method further comprises: In a case that the current reading page number is equal to the maximum reading page number, the current reading block number is equal to the maximum reading block number, and the current test round number is less than the target test round number, the current test round number is added by 1, wherein the current reading page number is a number of pages in the block that match the current reading page and have been operated by the data reading operation, the maximum reading page number and the maximum reading block number are determined according to physical characteristics of the non-volatile storage module, and the current reading block number is a number of blocks in the test unit that have been operated by the data reading operation. In a case that the current reading page number is equal to the maximum reading page number, the current reading block number is equal to the maximum reading block number, and the current test round number reaches the target test round number, the state identifier of the test resource is modified as the data erasing request identifier. In a case that the current reading page number is equal to the maximum reading page number, the current reading block number is less than the maximum reading block number, the state identifier of the test resource is modified as the data reading request identifier, and the current reading block number is added by 1, the current page number is set as 0. In a case that the current reading page number is less than the maximum reading page number, the current reading page number is added by 1, and the state identifier of the test resource is modified as the data reading request identifier.
5. The method of claim 1, wherein, after the state identifier of the test resource is obtained from the test resource set and the target test operation is executed on the test unit according to the state identifier, the method further comprises: Traverse the test resource set, obtain the state identifier and the current test round number of each test resource; In the case that the state identifier of each test resource set is a waiting state identifier, and the current test round number corresponding to the test resource is equal to the target test round number, it is determined that the test is completed, wherein the waiting state identifier is used to indicate that the test resource is in a low-power waiting state.
6. The method of claim 1, wherein, The state identifier of the test resource is obtained from the test resource set, and the target test operation is executed on the test unit according to the state identifier, comprising: The test resource in the test resource set is initialized, wherein the initialization operation is used to set the state identifier of the test resource to a waiting state identifier, and the waiting state matched with the waiting state identifier is a low-power state; The CPU utilization is detected by a timer, and in the case that the CPU utilization is less than a target threshold, the test resource is applied from the test resource set, and a task processing set is created according to the applied test resource, wherein the CPU utilization is used to determine the CPU idle state, and the test resource in the task processing set is used to execute the target test operation.
7. A test device for testing the performance of a solid state disk, comprising: An acquisition unit acquires a specification parameter set matched with a non-volatile storage module on a solid state disk, wherein the specification parameter set includes a channel number parameter, a core number parameter and a logical unit number parameter, the channel number parameter is used to indicate the number of data channels for data transmission on the non-volatile storage module, the core number parameter is used to indicate the number of chips for receiving and executing commands, and the logical unit number parameter is used to indicate the number of logical units for executing logical operations; A determination unit determines a test unit for executing a target test operation in the non-volatile storage module and a target number of the test unit according to the specification parameter set, wherein the target test operation includes at least one of the following: read data operation, write data operation, and erase data operation. The execution unit obtains a state identifier of a test resource from a test resource set, and determines to execute the target test operation on the test unit according to the state identifier, including: in a case where a task processing set is not empty, obtaining the test resource from the task processing set, and obtaining the state identifier matched with the test resource; in a case where the state identifier is an erase data request identifier, executing the erase data operation on the test unit according to a test unit address and the test resource, and modifying the state identifier of the test resource to erase data completion, wherein the test unit address is determined according to the specification parameter set; in a case where the state identifier is a write data request identifier, executing the write data operation on the test unit according to the test unit address and the test resource, and modifying the state identifier of the test resource to write data completion; in a case where the state identifier is a read data request identifier, executing the read data operation on the test unit according to the test unit address and the test resource, and modifying the state identifier of the test resource to read data completion, wherein a quantity of the test resources in the test resource set is equal to the target quantity of the test units. 8.A computer readable storage medium, comprising: The computer readable storage medium stores a computer program, wherein the computer program is executed by a processor to implement the steps of the method in any one of claims 1 to 6. 9.An electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: The processor executes the computer program to implement the steps of the method in any one of claims 1 to 6. 10.A computer program product, comprising a computer program, wherein: The computer program is executed by a processor to implement the steps of the method in any one of claims 1 to 6.
Citation Information
Patent Citations
Multi-test-channel priority adaptive arbitration method and memory access controller
CN112100097A
Method and device for testing Nand Flash of solid state disk and solid state disk
CN118098326A