Test method, device, computer device, readable storage medium and program product of storage device

By defining the scheduler queue and read/write operation data structure, read/write tests of storage devices are performed directly, avoiding merging and sorting. Combined with the particle swarm optimization algorithm, the problem of low accuracy of storage device test results is solved, achieving a more accurate hardware performance evaluation.

CN119645746BActive Publication Date: 2026-02-27CHINA TELECOM CLOUD TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411792020.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-06
Publication Date
2026-02-27
Estimated Expiration
2044-12-06

AI Technical Summary

Technical Problem

In existing technologies, performance testing methods for storage devices such as smart network interface cards cannot accurately reflect the test status of each read/write queue distributed by the system to the storage device during read/write path testing, resulting in low accuracy of test results.

Method used

By determining the scheduler queue and multiple read/write operation data structures to be tested based on read/write test parameters, converting them into read/write request data structures and placing them into the scheduler queue in sequence, the storage device is directly invoked for read/write tests, avoiding merging and sorting operations. The test parameters are optimized using the particle swarm optimization algorithm to ensure that the hardware queue is always fully loaded.

Benefits of technology

This improves the accuracy of storage device test results, enabling a more accurate reflection of hardware processing capabilities and providing a scientific basis for performance evaluation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119645746B_ABST
    Figure CN119645746B_ABST
Patent Text Reader

Abstract

The application relates to a storage device test method and device, computer equipment, a readable storage medium and a program product, and relates to the technical field of storage devices. The method comprises the following steps: determining a scheduler queue and a plurality of to-be-tested read-write operation data structures based on read-write test parameters of a to-be-tested storage device, and determining corresponding memory pages based on the to-be-tested read-write operation data structures; converting each to-be-tested read-write operation data structure into a corresponding read-write request data structure, and sequentially placing each read-write request data structure into the scheduler queue; calling the to-be-tested storage device, sequentially passing through the memory pages corresponding to the to-be-tested read-write operation data structures according to the read-write request data structures in the scheduler queue, performing read-write tests on each storage sector in the to-be-tested storage device, and obtaining a test result of the to-be-tested storage device. The method can improve the accuracy of the test result.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of storage devices, and in particular to a storage device testing method and device, computer equipment, computer readable storage medium, and computer program product. BACKGROUND

[0002] Smart NICs are increasingly used as computer infrastructure, especially as cloud computing base hardware devices. The complexity of developing new devices based on smart NICs is high, and the hardware performance of smart NIC storage systems needs to be mastered to meet product development. The performance testing method for smart NICs and other storage devices currently merges and sorts read-write queues when testing read-write paths, and the test results obtained are the merged read-write execution results, which cannot show the test conditions of each read-write queue distributed to the storage device. Therefore, the related art has the problem of low accuracy of test results. SUMMARY

[0003] Therefore, it is necessary to provide a storage device testing method and device, computer equipment, computer readable storage medium, and computer program product that can improve the accuracy of test results.

[0004] In a first aspect, the present application provides a storage device testing method, comprising:

[0005] determining a dispatcher queue and a plurality of to-be-tested read-write operation data structures based on read-write test parameters for a to-be-tested storage device, and determining corresponding memory pages based on the to-be-tested read-write operation data structures;

[0006] converting each to-be-tested read-write operation data structure into a corresponding read-write request data structure, and sequentially placing each read-write request data structure in the dispatcher queue;

[0007] calling the to-be-tested storage device, sequentially passing through the memory pages corresponding to the to-be-tested read-write operation data structures according to each read-write request data structure in the dispatcher queue, performing read-write testing on each storage sector in the to-be-tested storage device, and obtaining a test result of the to-be-tested storage device.

[0008] In one embodiment, the storage device testing method described in the above embodiments further comprises:

[0009] obtaining a user-specified test parameter range for the to-be-tested storage device;

[0010] obtaining a plurality of particle parameters included in an initial particle population according to the test parameter range and a particle swarm optimization algorithm, and obtaining read-write test parameters for the to-be-tested storage device according to the particle parameters.

[0011] In one of the embodiments, after the calling the to-be-tested storage device, sequentially performing read-write test on the memory page corresponding to the to-be-tested read-write operation data structure according to each read-write request data structure in the scheduler queue, and obtaining the test result of the to-be-tested storage device, the method further comprises:

[0012] According to the test result, iteratively updating the initial particle population until a preset iteration end condition is met, and obtaining a target test result and a corresponding target read-write test parameter.

[0013] In one of the embodiments, the read-write test parameter at least comprises a read-write queue number and a read-write queue depth.

[0014] The method of determining the scheduler queue and the plurality of to-be-tested read-write operation data structures based on the read-write test parameter of the to-be-tested storage device, and determining the corresponding memory page based on the to-be-tested read-write operation data structure comprises:

[0015] According to the read-write test parameter, determining a plurality of kernel threads matched with the read-write queue number, and determining a scheduler queue matched with the read-write queue depth.

[0016] Calling each kernel thread to generate a preset number of to-be-tested read-write operation data structures;

[0017] According to the read-write test parameter and each to-be-tested read-write operation data structure, determining the memory page corresponding to each to-be-tested read-write operation data structure.

[0018] In one of the embodiments, after the calling the to-be-tested storage device, sequentially performing read-write test on the memory page corresponding to the to-be-tested read-write operation data structure according to each read-write request data structure in the scheduler queue, and obtaining the test result of the to-be-tested storage device, the method further comprises:

[0019] In the case that the read-write type of the read-write test parameter is sequential read-write, sequentially performing read-write test on each storage sector in the to-be-tested storage device according to the sector order through the memory page corresponding to each read-write request data structure in the scheduler queue, and obtaining the test result of the to-be-tested storage device;

[0020] In the case that the read-write type of the read-write test parameter is random read-write, the read-write test is performed on each storage sector in the to-be-tested storage device in a random order by sequentially passing the memory page corresponding to the to-be-tested read-write operation data structure according to each read-write request data structure in the scheduler queue, and the test result of the to-be-tested storage device is obtained.

[0021] In one of the embodiments, the calling the to-be-tested storage device to perform the read-write test on each storage sector in the to-be-tested storage device by sequentially passing the memory page corresponding to the to-be-tested read-write operation data structure according to each read-write request data structure in the scheduler queue to obtain the test result of the to-be-tested storage device comprises:

[0022] calling the to-be-tested storage device to perform the read-write test on each storage sector in the to-be-tested storage device by sequentially passing the memory page corresponding to the to-be-tested read-write operation data structure according to each read-write request data structure in the scheduler queue to obtain a test time;

[0023] determining the unit read-write operation number and the read-write bandwidth of the to-be-tested storage device according to the test time, and taking the unit read-write operation number and the read-write bandwidth as the test result.

[0024] In a second aspect, the present application further provides a test device for a storage device, comprising:

[0025] a data determination module configured to determine a scheduler queue and a plurality of to-be-tested read-write operation data structures based on read-write test parameters for a to-be-tested storage device, and determine a corresponding memory page based on the to-be-tested read-write operation data structures;

[0026] a queue construction module configured to convert each to-be-tested read-write operation data structure into a corresponding read-write request data structure, and sequentially put each read-write request data structure into the scheduler queue;

[0027] a device test module configured to call the to-be-tested storage device to perform the read-write test on each storage sector in the to-be-tested storage device by sequentially passing the memory page corresponding to the to-be-tested read-write operation data structure according to each read-write request data structure in the scheduler queue to obtain the test result of the to-be-tested storage device.

[0028] In a third aspect, the present application further provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the following steps when executing the computer program:

[0029] determining a scheduler queue and a plurality of to-be-tested read-write operation data structures based on read-write test parameters for a to-be-tested storage device, and determining corresponding memory pages based on the to-be-tested read-write operation data structures;

[0030] converting each of the to-be-tested read-write operation data structures into a corresponding read-write request data structure, and sequentially placing each of the read-write request data structures into the scheduler queue;

[0031] invoking the to-be-tested storage device, sequentially passing through the memory pages corresponding to the to-be-tested read-write operation data structures according to each of the read-write request data structures in the scheduler queue, performing read-write tests on each storage sector in the to-be-tested storage device, and obtaining a test result of the to-be-tested storage device.

[0032] In a fourth aspect, the present application further provides a computer readable storage medium having a computer program stored thereon, the computer program being executed by a processor to implement the following steps:

[0033] determining a scheduler queue and a plurality of to-be-tested read-write operation data structures based on read-write test parameters for a to-be-tested storage device, and determining corresponding memory pages based on the to-be-tested read-write operation data structures;

[0034] converting each of the to-be-tested read-write operation data structures into a corresponding read-write request data structure, and sequentially placing each of the read-write request data structures into the scheduler queue;

[0035] invoking the to-be-tested storage device, sequentially passing through the memory pages corresponding to the to-be-tested read-write operation data structures according to each of the read-write request data structures in the scheduler queue, performing read-write tests on each storage sector in the to-be-tested storage device, and obtaining a test result of the to-be-tested storage device.

[0036] In a fifth aspect, the present application further provides a computer program product comprising a computer program, the computer program being executed by a processor to implement the following steps:

[0037] determining a scheduler queue and a plurality of to-be-tested read-write operation data structures based on read-write test parameters for a to-be-tested storage device, and determining corresponding memory pages based on the to-be-tested read-write operation data structures;

[0038] converting each of the to-be-tested read-write operation data structures into a corresponding read-write request data structure, and sequentially placing each of the read-write request data structures into the scheduler queue;

[0039] The storage device to be tested is called to sequentially pass through the memory pages corresponding to the read-write operation data structures in the read-write request data structures in the scheduler queue, and read-write tests are performed on each storage sector in the storage device to be tested, to obtain the test result of the storage device to be tested.

[0040] The storage device test method, device, computer equipment, computer readable storage medium and computer program product described above determine a scheduler queue and a plurality of read-write operation data structures to be tested based on read-write test parameters for a storage device to be tested, and determine the corresponding memory pages based on the read-write operation data structures to be tested, to lay the foundation for subsequent read-write tests. Then each read-write operation data structure to be tested is converted into a corresponding read-write request data structure, and each read-write request data structure is sequentially placed in the scheduler queue. No operation of merging and sorting the read-write data corresponding to the read-write request data structure is performed. Further, the storage device to be tested is called to sequentially pass through the memory pages corresponding to the read-write operation data structures to be tested, and read-write tests are performed on each storage sector in the storage device to be tested, to obtain the test result of the storage device to be tested. The storage device to be tested sequentially responds to the read-write request data structure, and the test result of each read-write request data structure without merging and sorting is obtained, which can more truly reflect the hardware processing capability of the storage device to be tested, thereby improving the accuracy of the test result. BRIEF DESCRIPTION OF DRAWINGS

[0041] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related art, the drawings needed to be used in the description of the embodiments of the present application or the related art will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other related drawings can be obtained by those skilled in the art without creative labor.

[0042] Figure 1 A read-write flowchart of an operating system in the related art is shown.

[0043] Figure 2 A flowchart of a storage device test method in an embodiment is shown.

[0044] Figure 3 A flowchart of a scheduler queue and read-write operation data structure and memory page determination step in an embodiment is shown.

[0045] Figure 4 A flowchart of a storage device test method in another embodiment is shown.

[0046] Figure 5A flow chart of working principle of a self-defined scheduler in an embodiment;

[0047] Figure 6 A structural block diagram of a test device of a storage device in an embodiment;

[0048] Figure 7 An internal structural diagram of a computer device in an embodiment. DETAILED DESCRIPTION

[0049] In order to make the purposes, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and not used to limit the present application.

[0050] As described in the background, the performance test method of the storage device such as the intelligent network card in the related art has the problem of low precision of the test result, and the inventors have found that the reason for the problem is that, for example, Figure 1As shown, a read-write flowchart of an operating system in the related art is provided. Input / output (I / O) data is submitted to a block I / O layer through a submit_bio function from a file system or a kernel, and the I / O data is encapsulated into a bio data structure at this time. The I / O is added to a queue of the process in a blk_plug_device function in a generic_make_request function, and I / O merging of the process can be performed without locking in the queue of the scheduler. Next, in the generic_make_request function, an operation function of an I / O scheduler is called to merge the bios and generate a request data structure and put the request data structure into an I / O scheduler queue. Multiple bios can be merged into one request, and a bio that is too large can also be split into multiple requests. Subsequently, when the device is idle, the storage device driver takes the request from the I / O scheduler queue to a device distribution queue. The device distribution queue is a software queue, and one software queue can correspond to one hardware queue, or multiple software queues can be bound to one hardware queue. When the request is converted into a hardware recognizable cmd command from the software queue to the hardware queue, the corresponding I / O operation is performed by the storage hardware. For a smart network card device, which is generally a multi-queue block device, the actual processing capacity of the hardware is the actual device distribution queue. However, the test method in the related art is affected by the merging operation and the sorting operation in the scheduling of the operating system itself, and cannot accurately measure the processing capacity of the hardware. Especially, the full load capacity of the I / O queue and the I / O depth becomes a black box and is not controlled by the user state test program. In some tests, there are several test results with large differences, especially the random write is greatly affected.

[0051] Based on the above reasons, the present application provides a test method of a storage device, which aims to solve the problem of low accuracy of test results in the related art,

[0052] In one embodiment, as Figure 2 shown, a test method of a storage device is provided, and the embodiment takes the method applied to a terminal as an example. It can be understood that the method can also be applied to a server, and can also be applied to a system including the terminal and the server, and is realized through interaction of the terminal and the server. In the embodiment, the method includes the following steps:

[0053] In step 202, a scheduler queue and a plurality of to-be-tested read-write operation data structures are determined based on read-write test parameters for a to-be-tested storage device, and corresponding memory pages are determined based on the to-be-tested read-write operation data structures.

[0054] The to-be-tested storage device can be a storage device that needs to be tested for hardware performance, such as the hardware processing capability of an FPGA (Field-Programmable Gate Array) or an ASIC (Application-Specific Integrated Circuit), the overall performance of a virtio-blk (a block device driver in a virtualization environment) and an RDMA (Remote Direct Memory Access, a high-performance data transmission technology) and the like.

[0055] The read-write test parameters can be parameters configured by a technician for a read-write test task of the to-be-tested storage device.

[0056] The scheduler queue can be an important component in the operating system kernel, responsible for managing disk I / O (Input / Output) requests. When a user process initiates a read-write operation, these requests are added to the kernel's IO queue, which is actually a data structure used to organize and queue these I / O tasks according to certain strategies (such as first-come-first-served, shortest response time, etc.). When the CPU has free time to process these I / O requests, the scheduler will select a task from the queue, convert it from a waiting state to an execution state, and transfer data from memory to disk or vice versa.

[0057] The to-be-tested read-write operation data structure can be a read-write operation data structure that needs to be tested by the to-be-tested storage device. The read-write operation data structure is a BIO (Blocking I / O) that is an abbreviation of "Blocking Input / Output", which is an input / output model used in Java NIO (New I / O) API (Application Programming Interface). In this model, read-write operations on files or network connections are usually blocking, that is, if an operation needs to wait for data to return, the thread will pause until the operation is complete. In other words, when the BIO performs a read-write operation, if the data is not available, the program will temporarily stop and hang until the data is available before continuing execution. Simply put, the BIO data structure usually includes BufferedInputStream (BufferedInputStream) and BufferedOutputStream (BufferedOutputStream), which provide encapsulation of underlying low-level IO, increasing processing performance and simplifying the work of programmers.

[0058] The memory page can be a basic storage unit in a computer operating system, which is one of the core concepts of virtual memory management. In modern operating systems, each process has a virtual address space, which is divided into several fixed-size pages. The size of a page is usually 4KB, 8KB or a fixed value larger than that. Common sizes include 4KB, 16KB, 32KB or even larger. When a process runs, its required data is loaded into memory and managed and exchanged in page units. Each physical memory block corresponds to one or more virtual pages. When a process tries to access a virtual address, it actually finds the corresponding physical page through the page table mapping mechanism.

[0059] Optionally, the system constructs a scheduler queue and a plurality of to-be-tested read-write operation data structures based on read-write test parameters for the to-be-tested storage device, respectively, and determines the corresponding memory page based on the binding relationship in the to-be-tested read-write operation data structure, thereby laying the foundation for subsequent invocation of the to-be-tested storage device to perform read-write tests.

[0060] In step S204, each to-be-tested read-write operation data structure is converted into a corresponding read-write request data structure, and each read-write request data structure is sequentially placed in the scheduler queue.

[0061] The read-write request data structure can be a Request, which is a request corresponding to a read-write test task.

[0062] Optionally, the system converts each to-be-tested read-write operation data structure into a corresponding read-write request data structure through a _make_request (request generation) function call p-noop (private noop) custom scheduler, and sequentially places the read-write request data structure in the scheduler queue. In addition, when the p-noop sequentially places the read-write request data structure in the scheduler queue, no read-write data merging and sorting operations are performed.

[0063] It should be noted that, compared with the traditional noop scheduler, the p-noop no longer calls the pulg list queue of the create process in the make_request_fn() function. The scheduler removes the elevator_merge_fn operation function in elevator_ops, which is responsible for read-write data merging operations. The operation of implementing p-noop is as follows:

[0064] void p_noop_elevator_add_req_fn(struct request *request)

[0065] / / Create a FIFO queue

[0066] create_fifo_queue(fifo_queue)

[0067] / / Get the lock for the queue

[0068] lock_fifo_queue(fifo_queue)

[0069] / / Add the request to the tail of the queue

[0070] enqueue_request(fifo_queue, request)

[0071] / / Release the lock for the queue

[0072] unlock_fifo_queue(fifo_queue)

[0073] static const struct elevator_ops p_noop_elevator_ops =

[0074] .elevator_merge_req_fn = p_noop_elevator_merge_req_fn

[0075] .elevator_add_req_fn = p_noop_elevator_add_req_fn

[0076] static int __make_request(struct bio *bio)

[0077] / / Request the p-noop scheduler queue

[0078] get_p_noop_scheduler_queue(p_noop)

[0079] / / Create a request

[0080] create_request(request)

[0081] / / Set some properties of the request

[0082] request->bio = bio

[0083] request->scheduler = p_noop

[0084] / / Call the p_noop_elevator_add_req_fn function to add the request to the queue

[0085] p_noop_elevator_add_req_fn(request)

[0086] return 0

[0087] In step S206, the storage device to be tested is called to sequentially pass through the memory pages corresponding to the read-write request data structures in the scheduler queue according to the read-write request data structures in the scheduler queue, and read and write tests are performed on each storage sector in the storage device to be tested, so as to obtain the test result of the storage device to be tested.

[0088] The storage sector can be a sector in the storage device to be tested. A sector is the smallest addressable unit of data, and usually refers to a physical area on a storage medium such as a hard disk, a solid state disk, etc. The size of a sector of a traditional hard disk is usually 512 bytes, while the size of a sector of a modern hard disk and a solid state disk is generally 4K (4096 bytes).

[0089] Optionally, the system calls the storage device to be tested to sequentially pass through the memory pages corresponding to the read-write request data structures in the scheduler queue according to the read-write request data structures in the scheduler queue, and performs read and write tests on each storage sector in the storage device to be tested. For example, if the test performed is a read data test, the memory pages corresponding to the read-write request data structures in the scheduler queue are sequentially passed through as the memory in the system that needs to write data, and then data is read from each storage sector in the storage device to be tested and written into the corresponding memory page.

[0090] In the test method of the storage device, the method determines a scheduler queue and a plurality of to-be-tested read-write operation data structures based on read-write test parameters for the to-be-tested storage device, and determines corresponding memory pages based on the to-be-tested read-write operation data structures, so as to lay a foundation for subsequent read-write test; each to-be-tested read-write operation data structure is converted into a corresponding read-write request data structure, and each read-write request data structure is sequentially placed in the scheduler queue, without performing merging and sorting operations on read-write data corresponding to the read-write request data structure, and further calling the to-be-tested storage device, sequentially passing through the memory pages corresponding to the to-be-tested read-write operation data structures according to the read-write request data structures in the scheduler queue, performing read-write test on each storage sector in the to-be-tested storage device, obtaining a test result of the to-be-tested storage device, realizing that the to-be-tested storage device sequentially responds to the read-write request data structure, and obtaining a test result of each read-write request data structure without merging and sorting, which can more truly reflect the hardware processing capability of the to-be-tested storage device, thereby improving the accuracy of the test result.

[0091] In an exemplary embodiment, the test method of the storage device described in the above embodiments further comprises:

[0092] obtaining a test parameter range specified by a user for the to-be-tested storage device; obtaining a plurality of particle parameters included in an initial particle population according to the test parameter range and a particle swarm optimization algorithm, and obtaining read-write test parameters for the to-be-tested storage device according to the particle parameters.

[0093] The test parameter range can be a range value formed by an upper limit and a lower limit of the read-write test parameters entered by the user in the system, such as a range of the smallest unit of read-write data, a range of the number of read-write queues, and a range of the depth of read-write queues.

[0094] The particle swarm optimization algorithm can be a swarm intelligence optimization algorithm used to solve optimization problems, which finds the optimal solution by simulating a group of particles learning and cooperating with each other in a search space. The particle parameters can be a plurality of particles simulated according to the test parameter range, and each particle parameter corresponds to a random number in the test parameter range.

[0095] Optionally, the system obtains a test parameter range specified by a user for the to-be-tested storage device, initializes the size of the initial particle population to N using the particle swarm optimization algorithm, sets the initial value of each particle parameter to a random number in the test parameter range, and uses the particle parameters as the read-write test parameters for the to-be-tested storage device.

[0096] In this embodiment, the particle swarm optimization algorithm is used to optimize the read-write test parameters of the specific storage device, which can not only improve the efficiency and accuracy of the test, but also provide a more scientific basis for evaluating the performance of the storage device.

[0097] In one exemplary embodiment, the step of the above embodiment calls the storage device to be tested, sequentially performs read-write test on the memory page corresponding to the read-write operation data structure to be tested according to the read-write request data structure in each scheduler queue, and obtains the test result of the storage device to be tested. After that, the method further comprises:

[0098] According to the test result, the initial particle population is iteratively updated until the preset iteration end condition is met, and the target test result and the corresponding target read-write test parameter are obtained.

[0099] The preset iteration condition can be that the fitness of each particle meets a preset fitness threshold or the number of iteration updates reaches a preset number threshold.

[0100] The target test result can be the test result with the best performance of the storage device among all the test results of the storage device to be tested in the iteration update process, and the target read-write test parameter is the read-write test parameter used in the test of the test result with the best performance of the storage device.

[0101] Optionally, the system calculates the fitness of each particle in each initial particle population using a preset weight when the test result does not meet the actual demand, iteratively updates the initial particle population according to the fitness of each particle, and obtains the target test result and the corresponding target read-write test parameter until the preset iteration end condition is met. The update formula of the particle population is:

[0102]

[0103] wherein, represents the updated particle population, represents the preset weight, represents the particle population before updating, represents the individual best position of particle i, represents the current global best position, represents the particle individual acceleration constant, represents the particle population group acceleration constant, represents a random number in the test parameter range.

[0104] In this embodiment, the particle swarm optimization algorithm is used to optimize the read-write test parameters of the storage device. In particular, when the test results do not meet the actual requirements, the preset weight and fitness calculation are used for iterative updating. When the initial test results do not meet the requirements, the search strategy can be adjusted flexibly by iteratively updating the particle population, ensuring that the system improves the test results by constantly learning and adapting, finds the optimal test results, and provides data-driven basis for product development and improvement.

[0105] In one exemplary embodiment, as shown in Figure 3 The read-write test parameters include at least the number of read-write queues and the depth of read-write queues; step S202 determines the scheduler queue and a plurality of read-write operation data structures based on the read-write test parameters for the storage device to be tested, and determines the corresponding memory page based on the read-write operation data structure, including:

[0106] Step S302, according to the read-write test parameters, a plurality of kernel threads matched with the number of read-write queues are determined, and a scheduler queue matched with the depth of read-write queues is determined.

[0107] The kernel thread can be a thread created and managed by the operating system kernel, which can access all resources of the operating system and can execute any services provided by the operating system, such as file system, network, etc.

[0108] The read-write queue depth can be an important performance indicator in a data storage system, which represents the number of pending IO requests that the storage system can handle at a certain point in time. This depth is directly related to the concurrency and throughput of the system.

[0109] Optionally, the system determines a plurality of kernel threads matching the number of read-write queues according to the number of read-write queues included in the read-write test parameters, and constructs a scheduler queue with a queue depth twice the read-write queue depth according to the read-write queue depth included in the read-write test parameters, to ensure that the hardware queue of the storage device to be tested is always in a full load state during the test. It can be understood that when the user specifies the need to test multiple read-write queues and io depths, a p-noop FIFO scheduler queue is generated for each read-write queue, with a queue depth of 2 times the read-write queue depth specified by the user, to ensure that the device hardware queue is always in full load, and the kernel io data generator generates a corresponding number of threads, each thread writes to a p-noop FIFO scheduling queue. Each p-noop FIFO scheduling queue corresponds to a device distribution queue and a hardware hardwaredispatch q (hardware dispatch request processing queue). This way is different from the original operating system scheduling method, in addition to solving the influence of traditional read-write request merging, splitting and sorting. Each thread tests a read-write queue and queue depth separately, solving the influence of the original operating system scheduler 1 hardware q binding multiple soft-q (soft queue), avoiding the ambiguity of single or multiple threads testing read-write queues.

[0110] Step S304, calling each kernel thread to generate a preset number of read-write operation data structures to be tested.

[0111] Optionally, the system calls each kernel thread to generate a preset number of read-write operation data structures to be tested, enters the block io (read-write block) layer, bypasses the influence of traditional vfs (Virtual File System, virtual file system) and file system calls for read-write in the operating system, and can realize more fine-grained control, directly controlling the data storage process, management buffer and I / O scheduling.

[0112] Step S306, determining the memory page corresponding to each read-write operation data structure to be tested according to the read-write test parameters and each read-write operation data structure to be tested.

[0113] Optionally, the system determines the memory page corresponding to each read-write operation data structure to be tested according to the read-write test parameters and each read-write operation data structure to be tested, and further determines the storage sector position pointed to by the read-write operation data structure and the length of the storage sector pointed to by the read-write operation data structure. As shown in Table 1, the structure of the read-write operation data structure is provided:

[0114] Table 1

[0115]

[0116] It should be noted that, based on the read / write test parameters and the data structure of each read / write operation to be tested, the system determines the operation corresponding to the memory page of each data structure to be tested as follows:

[0117] struct bio {

[0118] sector_t bi_sector; / * Disk start sector number * /

[0119] struct block_device *bi_bdev; / * Block device for bio operations * /

[0120] unsigned long bi_flags; / * Status flags * /

[0121] unsigned long bi_rw; / *Read and write * /

[0122] unsigned short bi_vcnt; / * Number of bio_vecs * /

[0123] unsigned short bi_idx; / * The index of the current bvl_vec array * /

[0124] unsigned int bi_size; / * Size of the entire bio: sum of all bi_io_vec->len * /

[0125] bio_end_io_t *bi_end_io; / * Called when bio completes * /

[0126] void *bi_private; / *bio private data* /

[0127] unsigned int bi_max_vecs; / * Maximum number of bio_vecs carried by bio (the actual number of bio_vecs used is represented by bi_vcnt) * /

[0128] atomic_t bi_cnt; / * bio reference count * /

[0129] struct bio_vec *bi_io_vec; / * bio_vec array* /

[0130] struct bio_set *bi_pool; / *bio_set maintains several bio slabs of different sizes* /

[0131] struct bio_vec bi_inline_vecs[0]; / * bio's inline bio_vecs * /

[0132] };

[0133] struct bio_vec {

[0134] struct page *bv_page; / * page the data belongs to * /

[0135] unsigned int bv_len; / * size of data * /

[0136] unsigned int bv_offset; / * offset of data within page * /

[0137] }

[0138] bio_vec represents a piece of memory data, with a maximum of one page. Generally, bio_vec corresponds to one page (memory page), and all bio_vecs make up all the data carried by bio. The system constructs a kernel thread and allocates a memory page to simulate the upper-layer user's io write data requirement. Here, according to the user-specified test parameters obtained from the above proc file / proc / kernel_io_test_param, the corresponding memory page is created and data is written, and the kernel thread creates the corresponding bio and binds the memory page to the bio. For sequential bios, the sector stores the continuous position of the sector. For random bios, each bio is added with a random step, and the value of the random step is generated by a pseudo-random number generator to achieve the same purpose of random numbers in each round of testing, which can effectively evaluate the random test results under different scenarios.

[0139] In this embodiment, the read-write queue number in the read-write test parameter is read and written to determine the corresponding read-write queue kernel thread to generate multiple read-write operation data structures, and to construct a scheduler queue corresponding to the read-write queue depth. Each scheduler queue corresponds to a device distribution queue and a hardware dispatch request processing queue in subsequent testing. In addition to solving the influence of traditional read-write request merging, splitting and sorting, each thread tests a read-write queue and queue depth separately, solving the influence of the original operating system scheduler 1 hardware binding multiple queues, avoiding the ambiguity of single or multiple threads testing read-write queues, and further improving the accuracy of the test results.

[0140] In an exemplary embodiment, step S206 invokes the to-be-tested storage device to sequentially pass through the memory pages corresponding to the to-be-tested read-write operation data structures according to the read-write request data structures in the scheduler queue, perform read-write tests on each storage sector in the to-be-tested storage device, and obtain the test results of the to-be-tested storage device, including:

[0141] In the case where the read-write type of the read-write test parameter is sequential read-write, the read-write tests are performed on each storage sector in the to-be-tested storage device in sector order according to the read-write request data structures in the scheduler queue sequentially passing through the memory pages corresponding to the to-be-tested read-write operation data structures; in the case where the read-write type of the read-write test parameter is random read-write, the read-write tests are performed on each storage sector in the to-be-tested storage device in random order according to the read-write request data structures in the scheduler queue sequentially passing through the memory pages corresponding to the to-be-tested read-write operation data structures.

[0142] The sequential read-write can be to access data blocks in a continuous order, and the read or write operation occurs at adjacent positions on the data storage device, usually in a specific order.

[0143] The random read-write can be to perform the read or write operation of data in a scattered manner at different positions of the storage device, that is, the I / O request can be performed between multiple random positions.

[0144] Optionally, in the case where the read-write type of the read-write test parameter is sequential read-write, the read-write tests are performed on each storage sector in the to-be-tested storage device in sector order according to the read-write request data structures in the scheduler queue sequentially passing through the memory pages corresponding to the to-be-tested read-write operation data structures, and the sector order used at this time is configured when the read-write operation data structure is generated, and the storage sectors pointed to by each generated read-write operation data structure can be arranged and configured in ascending order at a preset interval. In the case where the read-write type of the read-write test parameter is random read-write, the read-write tests are performed on each storage sector in the to-be-tested storage device in random order according to the read-write request data structures in the scheduler queue sequentially passing through the memory pages corresponding to the to-be-tested read-write operation data structures, and the random order adopted at this time can be configured by using a random number generator to generate a random number and configuring the random number into the read-write operation data structure.

[0145] In this embodiment, the storage sectors pointed by the read-write operation data structure are configured according to the read-write type in the read-write test parameter, and the read-write test is performed on each storage sector of the storage device to be tested in the order of the sectors or in random order during the test, thereby improving the flexibility of the system during the test.

[0146] In an exemplary embodiment, the storage device to be tested is called according to the read-write request data structure in the scheduler queue, and the read-write test is performed on each storage sector of the storage device to be tested by sequentially passing through the memory page corresponding to the read-write operation data structure of the storage device to be tested, thereby obtaining the test result of the storage device to be tested, including:

[0147] The storage device to be tested is called according to the read-write request data structure in the scheduler queue, and the read-write test is performed on each storage sector of the storage device to be tested by sequentially passing through the memory page corresponding to the read-write operation data structure of the storage device to be tested, thereby obtaining the test time; and the unit read-write operation number and the read-write bandwidth of the storage device to be tested are determined according to the test time, and the unit read-write operation number and the read-write bandwidth are taken as the test result.

[0148] The unit read-write operation number can be iops (Input / Output Operations Per Second), which represents the number of input / output operations per second and is an important indicator for measuring the performance of the storage device, especially in random read-write operations.

[0149] The read-write bandwidth can be bw, which represents the amount of data transmitted within a certain time and is usually expressed in bytes per second (B / s) or more common units (such as MB / s or GB / s), reflecting the data transmission capability of the storage device in read-write operations.

[0150] Optionally, the storage device to be tested is called according to the read-write request data structure in the scheduler queue, and the read-write test is performed on each storage sector of the storage device to be tested by sequentially passing through the memory page corresponding to the read-write operation data structure of the storage device to be tested, and the time spent during the test is counted to obtain the test time. The unit read-write operation number is obtained according to the ratio of the total read-write operation number involved in the test process to the test time, and the read-write bandwidth is obtained according to the ratio of the total transmission data amount involved in the test process to the test time.

[0151] In this embodiment, the unit read-write operation number and the read-write bandwidth of the storage device to be tested are determined by counting the test time during the test, which can reflect the hardware performance of the storage device to be tested, help the system administrator or developer make a more intelligent decision when selecting a storage device or configuring a storage architecture, and can be used as an optimization reference for developing a storage device.

[0152] In one exemplary embodiment, as shown in Figure 4 A method for testing a storage device is provided, comprising:

[0153] Step 1, the parameter updating module automatically calculates the optimal iops and bw values by particle swarm evolution algorithm, and outputs the corresponding read-write test parameters bs size, io queue number, and io queue depth. Here, the general tool needs to manually try to test the optimal solution, which is a tedious work. It is automatically completed by the program. The particle swarm evolution algorithm is a mature AI intelligent algorithm, and here only the design of the io service model of the device is described: each particle in the service has three parameters, namely bs size, io queue number, and io queue depth. Initialize the particle swarm, and set the maximum and minimum values of the three parameters: The population size is N, and the initialization value of each particle is a random number between the maximum and minimum values of the three parameters. Calculate the fitness of each particle, pass the parameters of each particle into the device, perform io performance test, obtain the corresponding iops or bw, and obtain the fitness of each particle. Update the particle parameters by introducing the standard particle swarm optimization algorithm of inertia weight. Iterate the steps between calculating the fitness and performing the io performance test until the maximum iteration number is reached or the global optimal solution (target test result and target read-write test parameter) is obtained.

[0154] ​​Step 2, the kernel io data generator module generates specified io data, i.e. bio, through a kernel thread. User instruction is accepted through the proc (a virtual file system of the operating system) file system, and the user can specify test bs size, typical io size can be input as 4k and 1024k two options, respectively used for testing iops and bandwidth. The user can specify the test type (read-write type): sequential and random, read or write. The user can specify the io queue and queue depth to be tested. The kernel io data generator receives user instruction and generates bio meeting the requirements, directly generates bio into the block io layer, bypassing the influence of traditional vfs and file system calls write and read in the operating system. bio_vec represents a piece of memory data, with a maximum of a page. Generally, bio_vec corresponds to a page one by one, and all bio_vecs constitute all the data carried by a bio. The kernel io data generator allocates memory pages as a kernel thread to simulate the io write data requirements of the upper layer user, and according to the user-specified test parameters obtained from the above proc file / proc / kernel_io_test_param to create corresponding memory pages and write data, at the same time, the kernel thread creates corresponding bio and binds the memory page to the bio. For sequential bio, sectors are continuous, and for random bio, each bio is added with a random step, and the value of the random step is generated by a pseudo-random number generator to achieve the same purpose of random numbers in each round of testing, which can effectively evaluate the random test results under different scenarios.

[0155] Step 3, as Figure 5As shown, a working principle flowchart of the p-noop scheduler is provided, by constructing a custom io scheduler p-noop (private noop), the scheduler is modified from the noop scheduler, and the make_request_fn() function no longer calls the create process plug list queue. The scheduler removes the elevator_merge_fn operation function in elevator_ops. The function is responsible for the io merge operation. Remove the io merge operation. Create the corresponding FIFO scheduler queue according to the number of queues required for testing, execute the IO request one by one, and do not perform io merge and sorting. Each bio generates 1 request. When the user specifies that multiple io queues and io depths need to be tested, a p-noop FIFO scheduling queue is generated for each io queue, and the queue depth is 2 times the user-specified depth, to ensure that the device hardware queue is always at full load, and the kernel io data generator generates the corresponding number of threads, each thread writes to a p-noop FIFO scheduling queue. Each p-noop FIFO scheduling queue corresponds to a device dispatch queue and hardware hardware dispatch q. This way is different from the original operating system scheduling method, in addition to solving the influence of traditional io merge, splitting and sorting. Each thread tests an io queue and queue depth separately, solves the influence of the original operating system scheduler 1 hardware q binding multiple soft-q, avoids the ambiguity of single or multiple threads testing io queue mismatch. When the storage device is idle, the device driver takes io from the custom scheduler p-noop queue in turn to perform testing, the io data generator receives io return count 1 io completion, 10000 bios are generated in each round of testing, and the test time is counted after the test is completed. Calculate iops and bandwidth and print to dmesg (an operating system command for printing messages that protect the control kernel ring buffer) for the user to view.

[0156] In this embodiment, the maximum and minimum values ​​of the input IO test parameters are combined with the intelligent AI algorithm particle swarm optimization and the underlying hardware IO performance calculation system of this invention to calculate the optimal solution for the IO performance of the underlying hardware storage system. A dedicated kernel IO data generator bypasses VFS and the file system, directly operating at the block IO layer to generate targeted test bios, including bs size, sector values, etc. These controllable bios allow for controllable sequential IO sector continuity. Random IO is tested by generating a controllable and iteratively comparable set of random sectors through a pseudo-random number generator, ensuring effective product iteration evaluation and comparison. A custom p-noop IO scheduler creates corresponding kernel threads and IO scheduler queues for testing the required number of IO queues. The actual number and depth of storage hardware queues are generated and bound to the memory hardware queues for targeted testing. Simultaneously, the IO scheduler's operation functions are centralized, generating one request per bio without bio merging or request sorting, ensuring accurate and controllable IOPS performance and truly reflecting the hardware processing capabilities.

[0157] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0158] Based on the same inventive concept, this application also provides a testing apparatus for a storage device to implement the testing method for the storage device described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, the specific limitations in one or more storage device testing apparatus embodiments provided below can be found in the limitations of the storage device testing method described above, and will not be repeated here.

[0159] In one exemplary embodiment, such as Figure 6 As shown, a testing apparatus 600 for a storage device is provided, comprising: a data determination module 602, a queue construction module 604, and a device testing module 606, wherein:

[0160] The data determination module 602 is configured to determine the scheduler queue and a plurality of to-be-tested read-write operation data structures based on read-write test parameters for a to-be-tested storage device, and determine corresponding memory pages based on the to-be-tested read-write operation data structures.

[0161] The queue construction module 604 is configured to convert each to-be-tested read-write operation data structure into a corresponding read-write request data structure, and sequentially place each read-write request data structure into the scheduler queue.

[0162] The device test module 606 is configured to call the to-be-tested storage device, sequentially pass through the memory pages corresponding to the to-be-tested read-write operation data structures according to the read-write request data structures in the scheduler queue, perform read-write tests on each storage sector in the to-be-tested storage device, and obtain a test result of the to-be-tested storage device.

[0163] Further, in an embodiment, the storage device test apparatus 600 further includes a data acquisition module configured to acquire a test parameter range specified by a user for the to-be-tested storage device, obtain a plurality of particle parameters included in an initial particle population according to the test parameter range and a particle swarm optimization algorithm, and obtain read-write test parameters for the to-be-tested storage device according to the particle parameters.

[0164] Further, in an embodiment, the device test module 606 is further configured to iteratively update the initial particle population according to the test result until a preset iteration end condition is met, and obtain a target test result and corresponding target read-write test parameters.

[0165] Further, in an embodiment, the data determination module 602 is further configured to determine a plurality of kernel threads matched with a read-write queue number according to the read-write test parameters, and determine a scheduler queue matched with a read-write queue depth; call each kernel thread to generate a preset number of to-be-tested read-write operation data structures; and determine memory pages corresponding to each to-be-tested read-write operation data structure according to the read-write test parameters and each to-be-tested read-write operation data structure.

[0166] Further, in an embodiment, the device test module 606 is further configured to, when a read-write type of the read-write test parameters is sequential read-write, sequentially pass through the memory pages corresponding to the to-be-tested read-write operation data structures according to the read-write request data structures in the scheduler queue, perform read-write tests on each storage sector in the to-be-tested storage device according to a sector order, and obtain a test result of the to-be-tested storage device; and when the read-write type of the read-write test parameters is random read-write, sequentially pass through the memory pages corresponding to the to-be-tested read-write operation data structures according to the read-write request data structures in the scheduler queue, perform read-write tests on each storage sector in the to-be-tested storage device according to a random order, and obtain a test result of the to-be-tested storage device.

[0167] Further, in one embodiment, the device test module 606 is further configured to invoke the storage device to be tested to sequentially pass through the memory pages corresponding to the read-write request data structures in the scheduler queue according to the read-write request data structures, to perform read-write test on each storage sector in the storage device to be tested according to the read-write operation data structure corresponding to the memory page, and to obtain a test time; and to determine the unit read-write operation number and the read-write bandwidth of the storage device to be tested according to the test time, and to take the unit read-write operation number and the read-write bandwidth as the test result.

[0168] The modules in the storage device test apparatus 600 described above can be implemented by software, hardware, or a combination thereof, in whole or in part. The modules described above can be embedded in or independent of the processor in the computer device in hardware form, or can be stored in the memory in the computer device in software form, so as to be called and executed by the processor to perform the operations corresponding to the modules.

[0169] In one exemplary embodiment, a computer device, which can be a server, is provided, and an internal structure diagram of the computer device can be as shown in Figure 7 The computer device includes a processor, a memory, an input / output interface (I / O), and a communication interface. The processor, the memory, and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operating system and the computer program in the non-volatile storage medium to run. The database of the computer device is configured to store read-write test parameters, read-write operation data structures, read-write request data structures, and the like. The input / output interface of the computer device is configured to exchange information between the processor and external devices. The communication interface of the computer device is configured to communicate with a terminal outside through a network connection. The computer program is executed by the processor to implement a storage device test method.

[0170] Those skilled in the art can understand that Figure 7 The structure shown in the above-mentioned embodiments is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. Specifically, the computer device can include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0171] In one embodiment, a computer device is also provided, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps in the above-mentioned method embodiments.

[0172] In one embodiment, a computer readable storage medium is provided, having stored thereon a computer program which, when executed by a processor, implements the steps of any of the above method embodiments.

[0173] In one embodiment, a computer program product is provided, comprising a computer program which, when executed by a processor, implements the steps of any of the above method embodiments.

[0174] A person of ordinary skill in the art can understand that all or part of the processes in the above method embodiments can be completed by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer readable storage medium and can include the processes of the above method embodiments when executed. Any reference to a memory, database or other medium used in the embodiments provided in the present application can include at least one of a non-volatile memory and a volatile memory. The non-volatile memory can include a read-only memory (ROM), a magnetic tape, a floppy disk, a flash memory, an optical storage, a high-density embedded non-volatile memory, a resistive random access memory (ReRAM), a magnetoresistive random access memory (MRAM), a ferroelectric random access memory (FRAM), a phase change memory (PCM), a graphene memory, etc. The volatile memory can include a random access memory (RAM) or an external cache memory, etc. As an illustration but not limitation, the RAM can be in various forms such as a static random access memory (SRAM) or a dynamic random access memory (DRAM), etc. The database involved in the embodiments provided in the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., without being limited thereto. The processor involved in the embodiments provided in the present application can be a general processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., without being limited thereto.

[0175] Any technical features in the above embodiments can be combined, and for the sake of brevity, not all possible combinations are described above, however, any combination of these technical features is deemed to be within the scope of the present application.

[0176] The above embodiments only express several implementation manners of the present application, and the description is relatively specific and detailed, but it should not be understood as a limitation on the patent scope of the present application. It should be pointed out that, for ordinary skilled persons in the art, several modifications and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.

Claims

1. A test method for a storage device, characterized by, The method comprises: obtaining a user-specified test parameter range for a to-be-tested storage device; obtaining a plurality of particle parameters included in an initial particle population according to the test parameter range and a particle swarm optimization algorithm, and obtaining read-write test parameters for the to-be-tested storage device according to the particle parameters; the read-write test parameters at least include a read-write queue number and a read-write queue depth; determining a plurality of kernel threads matched with the read-write queue number and a scheduler queue matched with the read-write queue depth according to the read-write test parameters; and calling each of the kernel threads to generate a preset number of to-be-tested read-write operation data structures; determining a memory page corresponding to each of the to-be-tested read-write operation data structures according to the read-write test parameters and each of the to-be-tested read-write operation data structures; converting each of the to-be-tested read-write operation data structures into a corresponding read-write request data structure, and sequentially placing each of the read-write request data structures into the scheduler queue; calling the to-be-tested storage device to sequentially perform read-write tests on each memory sector in the to-be-tested storage device through the memory page corresponding to each of the read-write request data structures in the scheduler queue according to each of the read-write request data structures, to obtain a test result of the to-be-tested storage device.

2. The method of claim 1, wherein, After the calling of the to-be-tested storage device, the sequentially performing of the read-write tests on the memory page corresponding to each of the read-write request data structures in the scheduler queue according to each of the read-write request data structures, and the obtaining of the test result of the to-be-tested storage device, the method further comprises: iteratively updating the initial particle population according to the test result until a preset iteration end condition is met, to obtain a target test result and corresponding target read-write test parameters.

3. The method according to any one of claims 1 to 2, characterized in that, The calling of the to-be-tested storage device, the sequentially performing of the read-write tests on the memory page corresponding to each of the read-write request data structures in the scheduler queue according to each of the read-write request data structures, and the obtaining of the test result of the to-be-tested storage device, comprise: in a case where a read-write type of the read-write test parameters is sequential read-write, sequentially performing read-write tests on each memory sector in the to-be-tested storage device according to a sector order through the memory page corresponding to each of the read-write request data structures in the scheduler queue according to each of the read-write request data structures, to obtain the test result of the to-be-tested storage device; in a case where the read-write type of the read-write test parameters is random read-write, sequentially performing read-write tests on each memory sector in the to-be-tested storage device according to a random order through the memory page corresponding to each of the read-write request data structures in the scheduler queue according to each of the read-write request data structures, to obtain the test result of the to-be-tested storage device.

4. The method according to any one of claims 1 to 2, characterized in that, The device testing module is configured to call the to-be-tested storage device, sequentially pass through the memory page corresponding to each to-be-tested read-write operation data structure according to each read-write request data structure in the scheduler queue, perform read-write testing on each storage sector in the to-be-tested storage device, and obtain a test result of the to-be-tested storage device. The device testing module is configured to call the to-be-tested storage device, sequentially pass through the memory page corresponding to each to-be-tested read-write operation data structure according to each read-write request data structure in the scheduler queue, perform read-write testing on each storage sector in the to-be-tested storage device, and obtain a test result of the to-be-tested storage device. According to the test time, the unit read-write operation number and the read-write bandwidth of the to-be-tested storage device are determined, and the unit read-write operation number and the read-write bandwidth are taken as the test result.

5. A testing apparatus for a storage device, characterized by comprising: The device includes: The data acquisition module is configured to acquire a test parameter range specified by a user for a to-be-tested storage device, obtain a plurality of particle parameters included in an initial particle population according to the test parameter range and a particle swarm optimization algorithm, and obtain read-write test parameters for the to-be-tested storage device according to the particle parameters; the read-write test parameters at least include a read-write queue number and a read-write queue depth. The data determination module is configured to determine a plurality of kernel threads matched with the read-write queue number and determine a scheduler queue matched with the read-write queue depth according to the read-write test parameters, call each kernel thread to generate a preset number of to-be-tested read-write operation data structures, and determine a memory page corresponding to each to-be-tested read-write operation data structure according to the read-write test parameters and each to-be-tested read-write operation data structure. The queue construction module is configured to convert each to-be-tested read-write operation data structure into a corresponding read-write request data structure, and sequentially put each read-write request data structure into the scheduler queue. The device testing module is configured to call the to-be-tested storage device, sequentially pass through the memory page corresponding to each to-be-tested read-write operation data structure according to each read-write request data structure in the scheduler queue, perform read-write testing on each storage sector in the to-be-tested storage device, and obtain a test result of the to-be-tested storage device.

6. The apparatus of claim 5, wherein, The device testing module is further configured to iteratively update the initial particle population according to the test result until a preset iteration end condition is met, and obtain a target test result and a corresponding target read-write test parameter.

7. The apparatus of any one of claims 5 to 6, wherein, The device test module is further configured to, when the read-write type of the read-write test parameter is sequential read-write, sequentially pass through the memory pages corresponding to the read-write operation data structures to be tested according to the read-write request data structures in the scheduler queue, perform read-write test on each storage sector in the storage device to be tested according to a sector sequence, and obtain a test result of the storage device to be tested; and when the read-write type of the read-write test parameter is random read-write, sequentially pass through the memory pages corresponding to the read-write operation data structures to be tested according to the read-write request data structures in the scheduler queue, perform read-write test on each storage sector in the storage device to be tested according to a random sequence, and obtain a test result of the storage device to be tested. 8.A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the computer device is configured to perform the method according to any one of claims 1-7. The computer program, when executed by the processor, implements the steps of the method of any one of claims 1 to 4.

9. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program, when executed by the processor, implements the steps of the method of any one of claims 1 to 4.

10. A computer program product comprising a computer program, characterized in that, The computer program, when executed by the processor, implements the steps of the method of any one of claims 1 to 4. The computer program, when executed by the processor, implements the steps of the method of any one of claims 1 to 4.

Citation Information

Patent Citations

  • Hard disk performance test method, system and equipment and storage medium

    CN118571302A

  • Estimating Power Consumption in a Computing Environment

    US20100050008A1